From 4adc7e41eb6ef5706e68a940240b60015f53c077 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 19 Jan 2010 07:32:29 +0000 Subject: [PATCH] untabify --- src/CONVERTOR/VISUConvertor.cxx | 158 +- src/CONVERTOR/VISU_AppendFilter.cxx | 18 +- src/CONVERTOR/VISU_AppendFilterUtilities.cxx | 326 +- src/CONVERTOR/VISU_AppendFilterUtilities.hxx | 22 +- src/CONVERTOR/VISU_AppendPolyData.cxx | 18 +- src/CONVERTOR/VISU_AppendPolyData.hxx | 2 +- src/CONVERTOR/VISU_CommonCellsFilter.cxx | 10 +- src/CONVERTOR/VISU_Convertor.cxx | 2 +- src/CONVERTOR/VISU_Convertor.hxx | 58 +- src/CONVERTOR/VISU_ConvertorDef.hxx | 8 +- src/CONVERTOR/VISU_ConvertorUtils.cxx | 80 +- src/CONVERTOR/VISU_ConvertorUtils.hxx | 8 +- src/CONVERTOR/VISU_Convertor_impl.cxx | 584 ++-- src/CONVERTOR/VISU_Convertor_impl.hxx | 134 +- src/CONVERTOR/VISU_ElnoMeshValue.hxx | 12 +- .../VISU_ExtractUnstructuredGrid.cxx | 12 +- src/CONVERTOR/VISU_GaussMergeFilter.cxx | 110 +- src/CONVERTOR/VISU_GaussMergeFilter.hxx | 2 +- src/CONVERTOR/VISU_IDMapper.cxx | 4 +- src/CONVERTOR/VISU_MedConvertor.cxx | 2648 ++++++++--------- src/CONVERTOR/VISU_MedConvertor.hxx | 60 +- src/CONVERTOR/VISU_MergeFilter.cxx | 44 +- src/CONVERTOR/VISU_MergeFilterUtilities.cxx | 506 ++-- src/CONVERTOR/VISU_MergeFilterUtilities.hxx | 58 +- src/CONVERTOR/VISU_MeshValue.hxx | 60 +- src/CONVERTOR/VISU_PointCoords.cxx | 130 +- src/CONVERTOR/VISU_PointCoords.hxx | 14 +- src/CONVERTOR/VISU_Structures.hxx | 2 +- src/CONVERTOR/VISU_Structures_impl.hxx | 30 +- src/CONVERTOR/VISU_TableReader.cxx | 170 +- src/CONVERTOR/VISU_TypeList.hxx | 4 +- src/CONVERTOR/VISU_UsedPointsFilter.cxx | 2 +- src/CONVERTOR/VISU_VTKTypeList.hxx | 54 +- src/CONVERTOR/VISU_Vtk2MedConvertor.cxx | 54 +- src/CONVERTOR/VISU_Vtk2MedConvertor.hxx | 58 +- src/GUITOOLS/VisuGUI_TableDlg.cxx | 492 +-- src/GUITOOLS/VisuGUI_TableDlg.h | 24 +- src/OBJECT/VISU_Actor.h | 26 +- src/OBJECT/VISU_ActorBase.cxx | 4 +- src/OBJECT/VISU_GaussPtsAct.cxx | 432 +-- src/OBJECT/VISU_GaussPtsAct.h | 32 +- src/OBJECT/VISU_GaussPtsDeviceActor.cxx | 20 +- src/OBJECT/VISU_GaussPtsDeviceActor.h | 6 +- src/OBJECT/VISU_IsoSurfActor.cxx | 4 +- src/OBJECT/VISU_MeshAct.cxx | 18 +- src/OBJECT/VISU_MeshAct.h | 6 +- src/OBJECT/VISU_ScalarMapAct.cxx | 48 +- src/OBJECT/VISU_ScalarMapAct.h | 6 +- src/PIPELINE/SALOME_ExtractGeometry.cxx | 22 +- .../SALOME_ExtractPolyDataGeometry.cxx | 22 +- src/PIPELINE/VISUPipeLine.cxx | 262 +- src/PIPELINE/VISU_ColoredPL.cxx | 38 +- src/PIPELINE/VISU_ColoredPL.hxx | 6 +- src/PIPELINE/VISU_CutLinesPL.cxx | 86 +- src/PIPELINE/VISU_CutLinesPL.hxx | 16 +- src/PIPELINE/VISU_CutPlanesPL.cxx | 108 +- src/PIPELINE/VISU_CutPlanesPL.hxx | 50 +- src/PIPELINE/VISU_CutSegmentPL.cxx | 28 +- src/PIPELINE/VISU_CutSegmentPL.hxx | 18 +- src/PIPELINE/VISU_DataSetMapperHolder.cxx | 8 +- src/PIPELINE/VISU_DataSetMapperHolder.hxx | 2 +- src/PIPELINE/VISU_DeformedGridPL.cxx | 2 +- src/PIPELINE/VISU_DeformedGridPL.hxx | 2 +- .../VISU_DeformedShapeAndScalarMapPL.cxx | 6 +- .../VISU_DeformedShapeAndScalarMapPL.hxx | 2 +- src/PIPELINE/VISU_DeformedShapePL.cxx | 6 +- src/PIPELINE/VISU_DeformedShapePL.hxx | 2 +- src/PIPELINE/VISU_ElnoAssembleFilter.cxx | 20 +- src/PIPELINE/VISU_ElnoDisassembleFilter.cxx | 206 +- src/PIPELINE/VISU_Extractor.cxx | 8 +- src/PIPELINE/VISU_FieldTransform.cxx | 134 +- src/PIPELINE/VISU_GaussPointsPL.cxx | 4 +- src/PIPELINE/VISU_GaussPointsPL.hxx | 6 +- src/PIPELINE/VISU_ImplicitFunctionWidget.cxx | 4 +- src/PIPELINE/VISU_IsoSurfacesPL.cxx | 6 +- src/PIPELINE/VISU_IsoSurfacesPL.hxx | 2 +- src/PIPELINE/VISU_LabelPointsFilter.cxx | 96 +- src/PIPELINE/VISU_LabelPointsFilter.hxx | 14 +- src/PIPELINE/VISU_LookupTable.hxx | 8 +- src/PIPELINE/VISU_MapperHolder.cxx | 6 +- src/PIPELINE/VISU_MapperHolder.hxx | 2 +- src/PIPELINE/VISU_MergedPL.cxx | 6 +- src/PIPELINE/VISU_MergedPL.hxx | 2 +- src/PIPELINE/VISU_MeshPL.hxx | 2 +- src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx | 122 +- src/PIPELINE/VISU_PipeLine.cxx | 32 +- src/PIPELINE/VISU_PipeLine.hxx | 14 +- src/PIPELINE/VISU_PipeLineUtils.cxx | 88 +- src/PIPELINE/VISU_PipeLineUtils.hxx | 44 +- src/PIPELINE/VISU_PlanesWidget.cxx | 64 +- src/PIPELINE/VISU_PlanesWidget.hxx | 10 +- src/PIPELINE/VISU_Plot3DPL.cxx | 16 +- src/PIPELINE/VISU_Plot3DPL.hxx | 16 +- src/PIPELINE/VISU_PointSpriteMapperHolder.cxx | 6 +- src/PIPELINE/VISU_PointSpriteMapperHolder.hxx | 2 +- src/PIPELINE/VISU_PolyDataMapperHolder.cxx | 8 +- src/PIPELINE/VISU_PolyDataMapperHolder.hxx | 2 +- src/PIPELINE/VISU_ScalarBarActor.cxx | 90 +- src/PIPELINE/VISU_ScalarBarActor.hxx | 8 +- src/PIPELINE/VISU_ScalarBarCtrl.cxx | 8 +- src/PIPELINE/VISU_ScalarBarCtrl.hxx | 8 +- src/PIPELINE/VISU_ScalarMapPL.hxx | 6 +- src/PIPELINE/VISU_SphereWidget.cxx | 6 +- src/PIPELINE/VISU_SphereWidget.hxx | 4 +- src/PIPELINE/VISU_StreamLinesPL.cxx | 88 +- src/PIPELINE/VISU_StreamLinesPL.hxx | 38 +- src/PIPELINE/VISU_VectorsPL.cxx | 14 +- src/PIPELINE/VISU_VectorsPL.hxx | 2 +- src/PIPELINE/VISU_WidgetCtrl.cxx | 36 +- src/PIPELINE/VISU_WidgetCtrl.hxx | 12 +- src/PIPELINE/VISU_XYPlotActor.hxx | 2 +- src/VISUGUI/VisuGUI.h | 4 +- src/VISUGUI/VisuGUI_BasePanel.cxx | 2 +- src/VISUGUI/VisuGUI_BuildProgressDlg.cxx | 38 +- src/VISUGUI/VisuGUI_CacheDlg.cxx | 10 +- src/VISUGUI/VisuGUI_CacheDlg.h | 2 +- src/VISUGUI/VisuGUI_ClippingDlg.cxx | 30 +- src/VISUGUI/VisuGUI_ClippingDlg.h | 2 +- src/VISUGUI/VisuGUI_ClippingPanel.cxx | 162 +- src/VISUGUI/VisuGUI_ClippingPlaneDlg.cxx | 34 +- src/VISUGUI/VisuGUI_ClippingPlaneDlg.h | 2 +- src/VISUGUI/VisuGUI_CursorDlg.cxx | 4 +- src/VISUGUI/VisuGUI_CutLinesDlg.cxx | 34 +- src/VISUGUI/VisuGUI_CutLinesDlg.h | 2 +- src/VISUGUI/VisuGUI_CutPlanesDlg.cxx | 44 +- src/VISUGUI/VisuGUI_CutPlanesDlg.h | 2 +- src/VISUGUI/VisuGUI_CutSegmentDlg.cxx | 2 +- src/VISUGUI/VisuGUI_CutSegmentDlg.h | 2 +- .../VisuGUI_DeformedShapeAndScalarMapDlg.cxx | 160 +- .../VisuGUI_DeformedShapeAndScalarMapDlg.h | 6 +- src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx | 96 +- src/VISUGUI/VisuGUI_DeformedShapeDlg.h | 2 +- src/VISUGUI/VisuGUI_DialogRunner.cxx | 8 +- src/VISUGUI/VisuGUI_Displayer.cxx | 108 +- src/VISUGUI/VisuGUI_EditContainerDlg.cxx | 226 +- src/VISUGUI/VisuGUI_FeatureEdgesPanel.cxx | 20 +- src/VISUGUI/VisuGUI_FileDlg.cxx | 22 +- src/VISUGUI/VisuGUI_FileDlg.h | 18 +- src/VISUGUI/VisuGUI_FilterScalarsDlg.cxx | 16 +- src/VISUGUI/VisuGUI_FindPane.cxx | 38 +- src/VISUGUI/VisuGUI_GaussPointsDlg.h | 2 +- .../VisuGUI_GaussPointsSelectionPane.cxx | 68 +- .../VisuGUI_GaussPointsSelectionPane.h | 6 +- src/VISUGUI/VisuGUI_InputPane.cxx | 22 +- src/VISUGUI/VisuGUI_InputPane.h | 4 +- src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx | 4 +- src/VISUGUI/VisuGUI_IsoSurfacesDlg.h | 4 +- src/VISUGUI/VisuGUI_Module.cxx | 1034 +++---- src/VISUGUI/VisuGUI_Module.h | 2 +- src/VISUGUI/VisuGUI_NameDlg.cxx | 2 +- src/VISUGUI/VisuGUI_OffsetDlg.cxx | 10 +- src/VISUGUI/VisuGUI_OffsetDlg.h | 4 +- src/VISUGUI/VisuGUI_Panel.cxx | 6 +- src/VISUGUI/VisuGUI_Panel.h | 6 +- src/VISUGUI/VisuGUI_Plot3DDlg.cxx | 2 +- src/VISUGUI/VisuGUI_Plot3DDlg.h | 2 +- src/VISUGUI/VisuGUI_Prs3dDlg.h | 8 +- src/VISUGUI/VisuGUI_Prs3dTools.h | 298 +- src/VISUGUI/VisuGUI_ScalarBarDlg.cxx | 2 +- src/VISUGUI/VisuGUI_ScalarBarDlg.h | 2 +- src/VISUGUI/VisuGUI_Selection.cxx | 100 +- src/VISUGUI/VisuGUI_SelectionPanel.cxx | 520 ++-- src/VISUGUI/VisuGUI_SelectionPrefDlg.cxx | 6 +- src/VISUGUI/VisuGUI_SetupPlot2dDlg.cxx | 358 +-- src/VISUGUI/VisuGUI_ShrinkFactorDlg.cxx | 58 +- src/VISUGUI/VisuGUI_ShrinkFactorDlg.h | 2 +- src/VISUGUI/VisuGUI_Slider.cxx | 252 +- src/VISUGUI/VisuGUI_Slider.h | 4 +- src/VISUGUI/VisuGUI_StreamLinesDlg.cxx | 12 +- src/VISUGUI/VisuGUI_StreamLinesDlg.h | 2 +- src/VISUGUI/VisuGUI_Sweep.cxx | 172 +- src/VISUGUI/VisuGUI_Sweep.h | 4 +- src/VISUGUI/VisuGUI_Table3dDlg.cxx | 62 +- src/VISUGUI/VisuGUI_TimeAnimation.cxx | 350 +-- src/VISUGUI/VisuGUI_TimeAnimation.h | 12 +- src/VISUGUI/VisuGUI_Timer.cxx | 6 +- src/VISUGUI/VisuGUI_Tools.cxx | 238 +- src/VISUGUI/VisuGUI_Tools.h | 96 +- src/VISUGUI/VisuGUI_TransparencyDlg.cxx | 44 +- src/VISUGUI/VisuGUI_TransparencyDlg.h | 2 +- src/VISUGUI/VisuGUI_VectorsDlg.cxx | 2 +- src/VISUGUI/VisuGUI_VectorsDlg.h | 2 +- src/VISUGUI/VisuGUI_ViewExtender.cxx | 4 +- src/VISUGUI/VisuGUI_ViewTools.cxx | 134 +- src/VISUGUI/VisuGUI_ViewTools.h | 50 +- src/VISU_I/VISU_ClippingPlaneMgr.cxx | 268 +- src/VISU_I/VISU_ClippingPlaneMgr.hxx | 12 +- src/VISU_I/VISU_CorbaMedConvertor.cxx | 824 ++--- src/VISU_I/VISU_CorbaMedConvertor.hxx | 44 +- src/VISU_I/VISU_TimeAnimation.cxx | 630 ++-- src/VISU_I/VISU_TimeAnimation.h | 2 +- src/VISU_I/VISU_Tools.h | 26 +- src/VVTK/VVTK_ImageWriter.cxx | 14 +- src/VVTK/VVTK_ImageWriter.h | 8 +- src/VVTK/VVTK_ImageWriterMgr.cxx | 22 +- src/VVTK/VVTK_ImageWriterMgr.h | 6 +- src/VVTK/VVTK_InteractorStyle.cxx | 32 +- src/VVTK/VVTK_InteractorStyle.h | 6 +- src/VVTK/VVTK_MainWindow.cxx | 92 +- src/VVTK/VVTK_MainWindow.h | 26 +- src/VVTK/VVTK_PickingDlg.cxx | 84 +- src/VVTK/VVTK_PickingDlg.h | 10 +- src/VVTK/VVTK_PrimitiveBox.cxx | 12 +- src/VVTK/VVTK_Recorder.cxx | 28 +- src/VVTK/VVTK_Recorder.h | 6 +- src/VVTK/VVTK_RecorderDlg.cxx | 12 +- src/VVTK/VVTK_Renderer.cxx | 56 +- src/VVTK/VVTK_Renderer.h | 8 +- src/VVTK/VVTK_SegmentationCursorDlg.cxx | 46 +- src/VVTK/VVTK_SegmentationCursorDlg.h | 10 +- src/VVTK/VVTK_ViewManager.cxx | 2 +- src/VVTK/VVTK_ViewModel.cxx | 26 +- src/VVTK/VVTK_ViewWindow.cxx | 36 +- src/VVTK/VVTK_ViewWindow.h | 8 +- 214 files changed, 7985 insertions(+), 7985 deletions(-) diff --git a/src/CONVERTOR/VISUConvertor.cxx b/src/CONVERTOR/VISUConvertor.cxx index c6418177..6e6170d9 100644 --- a/src/CONVERTOR/VISUConvertor.cxx +++ b/src/CONVERTOR/VISUConvertor.cxx @@ -30,9 +30,9 @@ #include "VISU_Convertor_impl.hxx" #include "VISU_TableReader.hxx" -#include +#include #include -#include +#include #include #include @@ -85,59 +85,59 @@ void ParseMEDFile(const char* theFileName) //Import fields aMeshOnEntityMapIter = aMeshOnEntityMap.begin(); for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){ - const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first; - const VISU::PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second; - const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap; - VISU::TFieldMap::const_reverse_iterator aFieldMapIter = aFieldMap.rbegin(); - for(; aFieldMapIter != aFieldMap.rend(); aFieldMapIter++){ - const string& aFieldName = aFieldMapIter->first; - const VISU::PField& aField = aFieldMapIter->second; - const VISU::TValField& aValField = aField->myValField; - VISU::TValField::const_iterator aValFieldIter = aValField.begin(); - for(; aValFieldIter != aValField.end(); aValFieldIter++){ - int aTimeStamp = aValFieldIter->first; - - if(anEntity != VISU::NODE_ENTITY){ - VISU::PGaussPtsIDMapper aGaussMesh = - aCon->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp); + const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first; + const VISU::PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second; + const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap; + VISU::TFieldMap::const_reverse_iterator aFieldMapIter = aFieldMap.rbegin(); + for(; aFieldMapIter != aFieldMap.rend(); aFieldMapIter++){ + const string& aFieldName = aFieldMapIter->first; + const VISU::PField& aField = aFieldMapIter->second; + const VISU::TValField& aValField = aField->myValField; + VISU::TValField::const_iterator aValFieldIter = aValField.begin(); + for(; aValFieldIter != aValField.end(); aValFieldIter++){ + int aTimeStamp = aValFieldIter->first; + + if(anEntity != VISU::NODE_ENTITY){ + VISU::PGaussPtsIDMapper aGaussMesh = + aCon->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp); #ifdef _DEBUG_ID_MAPPING_ - vtkDataSet* aDataSet = aGaussMesh->GetOutput(); - aDataSet->Update(); - int aNbCells = aDataSet->GetNumberOfCells(); - MESSAGE("aNbCells = "<GetObjID(anCellId); - cout<GetNodeVTKID(anObjID.first)<GetNodeCoord(anCellId); - cout<GetOutput(); + aDataSet->Update(); + int aNbCells = aDataSet->GetNumberOfCells(); + MESSAGE("aNbCells = "<GetObjID(anCellId); + cout<GetNodeVTKID(anObjID.first)<GetNodeCoord(anCellId); + cout<GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp); + }else{ + //continue; + VISU::PIDMapper anIDMapper = + aCon->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp); #ifdef _DEBUG_ID_MAPPING_ - vtkDataSet* aDataSet = anIDMapper->GetOutput(); - aDataSet->Update(); - int aNbCells = aDataSet->GetNumberOfCells(); - for(int anCellId = 0; anCellId < aNbCells; anCellId++){ - int anObjID = anIDMapper->GetElemObjID(anCellId); - int aVTKID = anIDMapper->GetElemVTKID(anObjID); - cout<GetOutput(); + aDataSet->Update(); + int aNbCells = aDataSet->GetNumberOfCells(); + for(int anCellId = 0; anCellId < aNbCells; anCellId++){ + int anObjID = anIDMapper->GetElemObjID(anCellId); + int aVTKID = anIDMapper->GetElemVTKID(anObjID); + cout<myGroupMap; VISU::TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin(); for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){ - const string& aGroupName = aGroupMapIter->first; - aCon->GetMeshOnGroup(aMeshName,aGroupName); + const string& aGroupName = aGroupMapIter->first; + aCon->GetMeshOnGroup(aMeshName,aGroupName); } //continue; @@ -145,32 +145,32 @@ void ParseMEDFile(const char* theFileName) //Import mesh on entity aMeshOnEntityMapIter = aMeshOnEntityMap.begin(); for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){ - const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first; - VISU::PIDMapper anIDMapper = aCon->GetMeshOnEntity(aMeshName,anEntity); + const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first; + VISU::PIDMapper anIDMapper = aCon->GetMeshOnEntity(aMeshName,anEntity); #ifdef _DEBUG_ID_MAPPING_ - vtkDataSet* aDataSet = anIDMapper->GetOutput(); - int aNbCells, anCellId, anObjID, aVTKID; - aNbCells = aDataSet->GetNumberOfCells(); - for(anCellId = 0; anCellId < aNbCells; anCellId++){ - anObjID = anIDMapper->GetElemObjID(anCellId); - aVTKID = anIDMapper->GetElemVTKID(anObjID); - MESSAGE(anObjID<<"; "<GetOutput(); + int aNbCells, anCellId, anObjID, aVTKID; + aNbCells = aDataSet->GetNumberOfCells(); + for(anCellId = 0; anCellId < aNbCells; anCellId++){ + anObjID = anIDMapper->GetElemObjID(anCellId); + aVTKID = anIDMapper->GetElemVTKID(anObjID); + MESSAGE(anObjID<<"; "<first; - const VISU::PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second; - //aCon->GetMeshOnEntity(aMeshName,anEntity); - const VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap; - VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin(); - for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){ - const string& aFamilyName = aFamilyMapIter->first; - aCon->GetFamilyOnEntity(aMeshName,anEntity,aFamilyName); - } + const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first; + const VISU::PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second; + //aCon->GetMeshOnEntity(aMeshName,anEntity); + const VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap; + VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin(); + for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){ + const string& aFamilyName = aFamilyMapIter->first; + aCon->GetFamilyOnEntity(aMeshName,anEntity,aFamilyName); + } } } OK: @@ -197,21 +197,21 @@ main( int argc, char** argv ) QFileInfo aFileInfo( argv[1] ); for ( int i = 0; i < 1; i++ ) { if ( aFileInfo.exists() ) { - if ( aFileInfo.isDir() ) { - QDir aDir( aFileInfo.absoluteFilePath() ); - QStringList wildcards; wildcards << "*.med"; - QStringList aStringList = aDir.entryList( wildcards, QDir::Files ); - int jEnd = aStringList.count(); - for ( int j = 0; j < jEnd; j++ ) { - ParseMEDFile( aDir.filePath( aStringList[j] ).toLatin1().data() ); - } - } else { - QString anExtension = aFileInfo.suffix(); - if ( anExtension == "med" ) - ParseMEDFile( argv[1] ); - else if ( anExtension == "xls" || anExtension == "txt" ) - ParseXLSFile( argv[1] ); - } + if ( aFileInfo.isDir() ) { + QDir aDir( aFileInfo.absoluteFilePath() ); + QStringList wildcards; wildcards << "*.med"; + QStringList aStringList = aDir.entryList( wildcards, QDir::Files ); + int jEnd = aStringList.count(); + for ( int j = 0; j < jEnd; j++ ) { + ParseMEDFile( aDir.filePath( aStringList[j] ).toLatin1().data() ); + } + } else { + QString anExtension = aFileInfo.suffix(); + if ( anExtension == "med" ) + ParseMEDFile( argv[1] ); + else if ( anExtension == "xls" || anExtension == "txt" ) + ParseXLSFile( argv[1] ); + } } } return 0; diff --git a/src/CONVERTOR/VISU_AppendFilter.cxx b/src/CONVERTOR/VISU_AppendFilter.cxx index 643ff117..ae1f897a 100644 --- a/src/CONVERTOR/VISU_AppendFilter.cxx +++ b/src/CONVERTOR/VISU_AppendFilter.cxx @@ -51,21 +51,21 @@ VISU_AppendFilter int VISU_AppendFilter ::RequestData(vtkInformation *theRequest, - vtkInformationVector **theInputVector, - vtkInformationVector *theOutputVector) + vtkInformationVector **theInputVector, + vtkInformationVector *theOutputVector) { bool anIsExecuted = false; if( IsMergingInputs() || IsMappingInputs() ) anIsExecuted = VISU::UnstructuredGridRequestData(theInputVector, - GetNumberOfInputConnections( 0 ), - theOutputVector, - GetSharedPointSet(), - IsMergingInputs(), - IsMappingInputs()); + GetNumberOfInputConnections( 0 ), + theOutputVector, + GetSharedPointSet(), + IsMergingInputs(), + IsMappingInputs()); if( !anIsExecuted ) anIsExecuted = Superclass::RequestData(theRequest, - theInputVector, - theOutputVector); + theInputVector, + theOutputVector); return anIsExecuted; } diff --git a/src/CONVERTOR/VISU_AppendFilterUtilities.cxx b/src/CONVERTOR/VISU_AppendFilterUtilities.cxx index 35b8763d..2a943476 100644 --- a/src/CONVERTOR/VISU_AppendFilterUtilities.cxx +++ b/src/CONVERTOR/VISU_AppendFilterUtilities.cxx @@ -63,23 +63,23 @@ namespace //--------------------------------------------------------------- void DoMergingInputs(vtkCellData *theCellData, - TInputId theInputId, - TObject2InputIdMap& theResult) + TInputId theInputId, + TObject2InputIdMap& theResult) { if(vtkDataArray *aDataArray = theCellData->GetArray("VISU_CELLS_MAPPER")){ if(vtkIntArray *anIntArray = dynamic_cast(aDataArray)){ int *aPointer = anIntArray->GetPointer(0); int aNbCells = anIntArray->GetNumberOfTuples(); - for(vtkIdType aCellId = 0; aCellId < aNbCells; aCellId++){ + for(vtkIdType aCellId = 0; aCellId < aNbCells; aCellId++){ int aObjId = *aPointer++; int anEntity = *aPointer++; - TObjectId anObjectId(aObjId, anEntity); - TObject2InputIdMap::iterator anIter = theResult.find(anObjectId); - if(anIter != theResult.end()) - continue; - TInputCellId anInputCellId(theInputId, aCellId); - theResult.insert(anIter, TObject2InputIdMap::value_type(anObjectId, anInputCellId)); - } + TObjectId anObjectId(aObjId, anEntity); + TObject2InputIdMap::iterator anIter = theResult.find(anObjectId); + if(anIter != theResult.end()) + continue; + TInputCellId anInputCellId(theInputId, aCellId); + theResult.insert(anIter, TObject2InputIdMap::value_type(anObjectId, anInputCellId)); + } } } } @@ -101,10 +101,10 @@ namespace { vtkCellData *aCellData = theDataSet->GetCellData(); if(myIsFirstCellData){ - myFieldList.InitializeFieldList(aCellData); - myIsFirstCellData = false; + myFieldList.InitializeFieldList(aCellData); + myIsFirstCellData = false; }else{ - myFieldList.IntersectFieldList(aCellData); + myFieldList.IntersectFieldList(aCellData); } } @@ -170,13 +170,13 @@ namespace template void ForEachInput(vtkInformationVector **theInputVector, - vtkIdType theNumberOfInputConnections, - TFunctor& theFunctor) + vtkIdType theNumberOfInputConnections, + TFunctor& theFunctor) { for(vtkIdType anInputId = 0; anInputId < theNumberOfInputConnections; anInputId++) if(vtkDataSet *aDataSet = VISU::GetInput(theInputVector, anInputId)) - if(aDataSet->GetNumberOfPoints() > 0 && aDataSet->GetNumberOfCells() > 0) - theFunctor(anInputId, aDataSet); + if(aDataSet->GetNumberOfPoints() > 0 && aDataSet->GetNumberOfCells() > 0) + theFunctor(anInputId, aDataSet); } @@ -184,11 +184,11 @@ namespace template bool RequestData(vtkInformationVector **theInputVector, - vtkIdType theNumberOfInputConnections, - vtkInformationVector *theOutputVector, - vtkPointSet* theSharedPointSet, - bool theIsMergingInputs, - bool theIsMappingInputs) + vtkIdType theNumberOfInputConnections, + vtkInformationVector *theOutputVector, + vtkPointSet* theSharedPointSet, + bool theIsMergingInputs, + bool theIsMappingInputs) { if ( theNumberOfInputConnections == 1 ) { // get the input and ouptut @@ -196,7 +196,7 @@ namespace vtkDataSet* anOutput = VISU::GetOutput( theOutputVector ); if ( anInput->GetDataObjectType() != anOutput->GetDataObjectType() ) - return false; + return false; // This has to be here because it initialized all field datas. anOutput->CopyStructure( anInput ); @@ -212,134 +212,134 @@ namespace if ( theSharedPointSet ) { vtkPoints* aPoints = theSharedPointSet->GetPoints(); if(aPoints->GetNumberOfPoints() < 1) - return true; + return true; TDataSet* anOutput = TDataSet::SafeDownCast(VISU::GetOutput(theOutputVector)); vtkIdType anNbInputs = theNumberOfInputConnections; if ( theIsMergingInputs ) { - TCellIdMerger aFunctor(anNbInputs); - ForEachInput(theInputVector, anNbInputs, aFunctor); - - vtkDataSetAttributes::FieldList& aFieldList = aFunctor.myFieldList; - TObject2InputIdMap& anObject2InputIdMap = aFunctor.myObject2InputIdMap; - vtkIdType aNbCells = aFunctor.GetNbCells(); - if(aNbCells < 1) - return true; + TCellIdMerger aFunctor(anNbInputs); + ForEachInput(theInputVector, anNbInputs, aFunctor); + + vtkDataSetAttributes::FieldList& aFieldList = aFunctor.myFieldList; + TObject2InputIdMap& anObject2InputIdMap = aFunctor.myObject2InputIdMap; + vtkIdType aNbCells = aFunctor.GetNbCells(); + if(aNbCells < 1) + return true; - // Now can allocate memory - anOutput->Allocate(aNbCells); - vtkCellData *anOutputCellData = anOutput->GetCellData(); - anOutputCellData->CopyAllocate(aFieldList, aNbCells); + // Now can allocate memory + anOutput->Allocate(aNbCells); + vtkCellData *anOutputCellData = anOutput->GetCellData(); + anOutputCellData->CopyAllocate(aFieldList, aNbCells); - // Append each input dataset together - // 1.points - anOutput->SetPoints(theSharedPointSet->GetPoints()); - anOutput->GetPointData()->PassData(theSharedPointSet->GetPointData()); + // Append each input dataset together + // 1.points + anOutput->SetPoints(theSharedPointSet->GetPoints()); + anOutput->GetPointData()->PassData(theSharedPointSet->GetPointData()); - // 2.cells - vtkIdList *anIdList = vtkIdList::New(); - anIdList->Allocate(VTK_CELL_SIZE); - TObject2InputIdMap::const_iterator anIter = anObject2InputIdMap.begin(); - TObject2InputIdMap::const_iterator anEndIter = anObject2InputIdMap.end(); - for(; anIter != anEndIter; anIter++){ - //TObjectId anObjectId = anIter->first; - const TInputCellId& anInputCellId = anIter->second; - TInputId anInputId = anInputCellId.first; - if(vtkDataSet *aDataSet = VISU::GetInput(theInputVector, anInputId)){ - TCellId aCellId = anInputCellId.second; - aDataSet->GetCellPoints(aCellId, anIdList); - - vtkIdType aCellType = aDataSet->GetCellType(aCellId); - vtkIdType aNewCellId = anOutput->InsertNextCell(aCellType, anIdList); - - vtkCellData *aCellData = aDataSet->GetCellData(); - anOutputCellData->CopyData(aFieldList, aCellData, anInputId, aCellId, aNewCellId); - } - } - anIdList->Delete(); - - if(theIsMappingInputs){ - vtkIntArray *aDataArray = vtkIntArray::New(); - aDataArray->SetName("VISU_INPUTS_MAPPER"); - aDataArray->SetNumberOfComponents(2); - aDataArray->SetNumberOfTuples(aNbCells); - - vtkIdType aTupleId = 0; - TObject2InputIdMap::const_iterator anIter = anObject2InputIdMap.begin(); - TObject2InputIdMap::const_iterator anEndIter = anObject2InputIdMap.end(); - for(vtkIdType aCellId = 0; anIter != anEndIter; anIter++, aCellId++){ - const TInputCellId& anInputCellId = anIter->second; - TInputId anInputId = anInputCellId.first; - /*TCellId*/ aCellId = anInputCellId.second; - aDataArray->SetValue(aTupleId++, anInputId); - aDataArray->SetValue(aTupleId++, aCellId); - } - - anOutputCellData->AddArray(aDataArray); - aDataArray->Delete(); - } - - return true; + // 2.cells + vtkIdList *anIdList = vtkIdList::New(); + anIdList->Allocate(VTK_CELL_SIZE); + TObject2InputIdMap::const_iterator anIter = anObject2InputIdMap.begin(); + TObject2InputIdMap::const_iterator anEndIter = anObject2InputIdMap.end(); + for(; anIter != anEndIter; anIter++){ + //TObjectId anObjectId = anIter->first; + const TInputCellId& anInputCellId = anIter->second; + TInputId anInputId = anInputCellId.first; + if(vtkDataSet *aDataSet = VISU::GetInput(theInputVector, anInputId)){ + TCellId aCellId = anInputCellId.second; + aDataSet->GetCellPoints(aCellId, anIdList); + + vtkIdType aCellType = aDataSet->GetCellType(aCellId); + vtkIdType aNewCellId = anOutput->InsertNextCell(aCellType, anIdList); + + vtkCellData *aCellData = aDataSet->GetCellData(); + anOutputCellData->CopyData(aFieldList, aCellData, anInputId, aCellId, aNewCellId); + } + } + anIdList->Delete(); + + if(theIsMappingInputs){ + vtkIntArray *aDataArray = vtkIntArray::New(); + aDataArray->SetName("VISU_INPUTS_MAPPER"); + aDataArray->SetNumberOfComponents(2); + aDataArray->SetNumberOfTuples(aNbCells); + + vtkIdType aTupleId = 0; + TObject2InputIdMap::const_iterator anIter = anObject2InputIdMap.begin(); + TObject2InputIdMap::const_iterator anEndIter = anObject2InputIdMap.end(); + for(vtkIdType aCellId = 0; anIter != anEndIter; anIter++, aCellId++){ + const TInputCellId& anInputCellId = anIter->second; + TInputId anInputId = anInputCellId.first; + /*TCellId*/ aCellId = anInputCellId.second; + aDataArray->SetValue(aTupleId++, anInputId); + aDataArray->SetValue(aTupleId++, aCellId); + } + + anOutputCellData->AddArray(aDataArray); + aDataArray->Delete(); + } + + return true; }else{ - TCellCounter aFunctor(anNbInputs); - ForEachInput(theInputVector, anNbInputs, aFunctor); - - vtkDataSetAttributes::FieldList& aFieldList = aFunctor.myFieldList; - vtkIdType aNbCells = aFunctor.GetNbCells(); - if(aNbCells < 1) - return true; - - // Now can allocate memory - anOutput->Allocate(aNbCells); - vtkCellData *anOutputCellData = anOutput->GetCellData(); - anOutputCellData->CopyAllocate(aFieldList, aNbCells); - - // Append each input dataset together - // 1.points - anOutput->SetPoints(theSharedPointSet->GetPoints()); - anOutput->GetPointData()->PassData(theSharedPointSet->GetPointData()); - - // 2.cells - vtkIdList *anIdList = vtkIdList::New(); - anIdList->Allocate(VTK_CELL_SIZE); - for(vtkIdType anInputId = 0; anInputId < anNbInputs; anInputId++){ - if(vtkDataSet *aDataSet = VISU::GetInput(theInputVector, anInputId)){ - vtkIdType aNbCells = aDataSet->GetNumberOfCells(); - vtkCellData *aCellData = aDataSet->GetCellData(); - // copy cell and cell data - for(vtkIdType aCellId = 0; aCellId < aNbCells; aCellId++){ - aDataSet->GetCellPoints(aCellId, anIdList); - - vtkIdType aCellType = aDataSet->GetCellType(aCellId); - vtkIdType aNewCellId = anOutput->InsertNextCell(aCellType, anIdList); - - anOutputCellData->CopyData(aFieldList, aCellData, anInputId, aCellId, aNewCellId); - } - } - } - anIdList->Delete(); - - if(theIsMappingInputs){ - vtkIntArray *aDataArray = vtkIntArray::New(); - aDataArray->SetName("VISU_INPUTS_MAPPER"); - aDataArray->SetNumberOfComponents(2); - aDataArray->SetNumberOfTuples(aNbCells); - - vtkIdType aTupleId = 0; - for(vtkIdType anInputId = 0; anInputId < anNbInputs; anInputId++){ - if(vtkDataSet *aDataSet = VISU::GetInput(theInputVector, anInputId)){ - vtkIdType aNbCells = aDataSet->GetNumberOfCells(); - for(vtkIdType aCellId = 0; aCellId < aNbCells; aCellId++){ - aDataArray->SetValue(aTupleId++, aCellId); - aDataArray->SetValue(aTupleId++, anInputId); - } - } - } - - anOutputCellData->AddArray(aDataArray); - aDataArray->Delete(); - } - return true; + TCellCounter aFunctor(anNbInputs); + ForEachInput(theInputVector, anNbInputs, aFunctor); + + vtkDataSetAttributes::FieldList& aFieldList = aFunctor.myFieldList; + vtkIdType aNbCells = aFunctor.GetNbCells(); + if(aNbCells < 1) + return true; + + // Now can allocate memory + anOutput->Allocate(aNbCells); + vtkCellData *anOutputCellData = anOutput->GetCellData(); + anOutputCellData->CopyAllocate(aFieldList, aNbCells); + + // Append each input dataset together + // 1.points + anOutput->SetPoints(theSharedPointSet->GetPoints()); + anOutput->GetPointData()->PassData(theSharedPointSet->GetPointData()); + + // 2.cells + vtkIdList *anIdList = vtkIdList::New(); + anIdList->Allocate(VTK_CELL_SIZE); + for(vtkIdType anInputId = 0; anInputId < anNbInputs; anInputId++){ + if(vtkDataSet *aDataSet = VISU::GetInput(theInputVector, anInputId)){ + vtkIdType aNbCells = aDataSet->GetNumberOfCells(); + vtkCellData *aCellData = aDataSet->GetCellData(); + // copy cell and cell data + for(vtkIdType aCellId = 0; aCellId < aNbCells; aCellId++){ + aDataSet->GetCellPoints(aCellId, anIdList); + + vtkIdType aCellType = aDataSet->GetCellType(aCellId); + vtkIdType aNewCellId = anOutput->InsertNextCell(aCellType, anIdList); + + anOutputCellData->CopyData(aFieldList, aCellData, anInputId, aCellId, aNewCellId); + } + } + } + anIdList->Delete(); + + if(theIsMappingInputs){ + vtkIntArray *aDataArray = vtkIntArray::New(); + aDataArray->SetName("VISU_INPUTS_MAPPER"); + aDataArray->SetNumberOfComponents(2); + aDataArray->SetNumberOfTuples(aNbCells); + + vtkIdType aTupleId = 0; + for(vtkIdType anInputId = 0; anInputId < anNbInputs; anInputId++){ + if(vtkDataSet *aDataSet = VISU::GetInput(theInputVector, anInputId)){ + vtkIdType aNbCells = aDataSet->GetNumberOfCells(); + for(vtkIdType aCellId = 0; aCellId < aNbCells; aCellId++){ + aDataArray->SetValue(aTupleId++, aCellId); + aDataArray->SetValue(aTupleId++, anInputId); + } + } + } + + anOutputCellData->AddArray(aDataArray); + aDataArray->Delete(); + } + return true; } } @@ -432,36 +432,36 @@ namespace VISU //--------------------------------------------------------------- bool UnstructuredGridRequestData(vtkInformationVector **theInputVector, - vtkIdType theNumberOfInputConnections, - vtkInformationVector *theOutputVector, - vtkPointSet* theSharedPointSet, - bool theIsMergingInputs, - bool theIsMappingInputs) + vtkIdType theNumberOfInputConnections, + vtkInformationVector *theOutputVector, + vtkPointSet* theSharedPointSet, + bool theIsMergingInputs, + bool theIsMappingInputs) { return RequestData(theInputVector, - theNumberOfInputConnections, - theOutputVector, - theSharedPointSet, - theIsMergingInputs, - theIsMappingInputs); + theNumberOfInputConnections, + theOutputVector, + theSharedPointSet, + theIsMergingInputs, + theIsMappingInputs); } //--------------------------------------------------------------- bool PolyDataRequestData(vtkInformationVector **theInputVector, - vtkIdType theNumberOfInputConnections, - vtkInformationVector *theOutputVector, - vtkPointSet* theSharedPointSet, - bool theIsMergingInputs, - bool theIsMappingInputs) + vtkIdType theNumberOfInputConnections, + vtkInformationVector *theOutputVector, + vtkPointSet* theSharedPointSet, + bool theIsMergingInputs, + bool theIsMappingInputs) { return RequestData(theInputVector, - theNumberOfInputConnections, - theOutputVector, - theSharedPointSet, - theIsMergingInputs, - theIsMappingInputs); + theNumberOfInputConnections, + theOutputVector, + theSharedPointSet, + theIsMergingInputs, + theIsMappingInputs); } diff --git a/src/CONVERTOR/VISU_AppendFilterUtilities.hxx b/src/CONVERTOR/VISU_AppendFilterUtilities.hxx index 06d6fd83..108399b5 100644 --- a/src/CONVERTOR/VISU_AppendFilterUtilities.hxx +++ b/src/CONVERTOR/VISU_AppendFilterUtilities.hxx @@ -37,7 +37,7 @@ namespace VISU TAppendFilterHelper(TAppendFilterHelper&); public: - void + void SetSharedPointSet(vtkPointSet* thePointSet); vtkPointSet* @@ -68,20 +68,20 @@ namespace VISU //--------------------------------------------------------------- bool UnstructuredGridRequestData(vtkInformationVector **theInputVector, - vtkIdType theNumberOfInputConnections, - vtkInformationVector *theOutputVector, - vtkPointSet* theSharedPointSet, - bool theIsMergingInputs, - bool theIsMappingInputs); + vtkIdType theNumberOfInputConnections, + vtkInformationVector *theOutputVector, + vtkPointSet* theSharedPointSet, + bool theIsMergingInputs, + bool theIsMappingInputs); //--------------------------------------------------------------- bool PolyDataRequestData(vtkInformationVector **theInputVector, - vtkIdType theNumberOfInputConnections, - vtkInformationVector *theOutputVector, - vtkPointSet* theSharedPointSet, - bool theIsMergingInputs, - bool theIsMappingInputs); + vtkIdType theNumberOfInputConnections, + vtkInformationVector *theOutputVector, + vtkPointSet* theSharedPointSet, + bool theIsMergingInputs, + bool theIsMappingInputs); } #endif diff --git a/src/CONVERTOR/VISU_AppendPolyData.cxx b/src/CONVERTOR/VISU_AppendPolyData.cxx index faee1310..67b445c6 100644 --- a/src/CONVERTOR/VISU_AppendPolyData.cxx +++ b/src/CONVERTOR/VISU_AppendPolyData.cxx @@ -51,21 +51,21 @@ VISU_AppendPolyData int VISU_AppendPolyData ::RequestData(vtkInformation *theRequest, - vtkInformationVector **theInputVector, - vtkInformationVector *theOutputVector) + vtkInformationVector **theInputVector, + vtkInformationVector *theOutputVector) { bool anIsExecuted = false; if(GetNumberOfInputConnections(0) > 1 || IsMergingInputs() || IsMappingInputs()) anIsExecuted = VISU::PolyDataRequestData(theInputVector, - this->GetNumberOfInputConnections(0), - theOutputVector, - GetSharedPointSet(), - IsMergingInputs(), - IsMappingInputs()); + this->GetNumberOfInputConnections(0), + theOutputVector, + GetSharedPointSet(), + IsMergingInputs(), + IsMappingInputs()); if(!anIsExecuted) anIsExecuted = Superclass::RequestData(theRequest, - theInputVector, - theOutputVector); + theInputVector, + theOutputVector); return anIsExecuted; } diff --git a/src/CONVERTOR/VISU_AppendPolyData.hxx b/src/CONVERTOR/VISU_AppendPolyData.hxx index 84817af4..0eaf4e4e 100644 --- a/src/CONVERTOR/VISU_AppendPolyData.hxx +++ b/src/CONVERTOR/VISU_AppendPolyData.hxx @@ -29,7 +29,7 @@ /*! \brief This class used same as vtkAppendFilter. See documentation on VTK for more information. */ class VISU_AppendPolyData : public vtkAppendPolyData, - public VISU::TAppendFilterHelper + public VISU::TAppendFilterHelper { public: /*! \fn static VTKViewer_AppendFilter *New() diff --git a/src/CONVERTOR/VISU_CommonCellsFilter.cxx b/src/CONVERTOR/VISU_CommonCellsFilter.cxx index 46e8ac69..9959ca13 100644 --- a/src/CONVERTOR/VISU_CommonCellsFilter.cxx +++ b/src/CONVERTOR/VISU_CommonCellsFilter.cxx @@ -310,16 +310,16 @@ VISU_CommonCellsFilter //anOutput->GetPointData()->GetArray("VISU_CELLS_MAPPER")->SetName("VISU_POINTS_MAPPER"); // apply VISU_POINTS_MAPPER - int anEntity = int(VISU::NODE_ENTITY); + int anEntity = int(VISU::NODE_ENTITY); vtkIntArray* aNewPointsIdsArray = vtkIntArray::New(); aNewPointsIdsArray->SetName("VISU_POINTS_MAPPER"); aNewPointsIdsArray->SetNumberOfComponents(2); aNewPointsIdsArray->SetNumberOfTuples(aPointIdsForCopy->GetNumberOfIds()); - int *aPtr = aNewPointsIdsArray->GetPointer(0); + int *aPtr = aNewPointsIdsArray->GetPointer(0); for(int i = 0; i < aPointIdsForCopy->GetNumberOfIds(); i++){ - *aPtr++ = aPointIdsForCopy->GetId(i); - *aPtr++ = anEntity; - } + *aPtr++ = aPointIdsForCopy->GetId(i); + *aPtr++ = anEntity; + } anOutput->GetPointData()->AddArray(aNewPointsIdsArray); diff --git a/src/CONVERTOR/VISU_Convertor.cxx b/src/CONVERTOR/VISU_Convertor.cxx index cece23c0..ace49808 100644 --- a/src/CONVERTOR/VISU_Convertor.cxx +++ b/src/CONVERTOR/VISU_Convertor.cxx @@ -85,7 +85,7 @@ VISU_Convertor std::string VISU_Convertor ::GenerateName(const std::string& theName, - unsigned int theTimeId) + unsigned int theTimeId) { static QString aName; aName = QString(theName.c_str()).simplified(); diff --git a/src/CONVERTOR/VISU_Convertor.hxx b/src/CONVERTOR/VISU_Convertor.hxx index 33b31f71..ee7ffa1f 100644 --- a/src/CONVERTOR/VISU_Convertor.hxx +++ b/src/CONVERTOR/VISU_Convertor.hxx @@ -101,95 +101,95 @@ public: virtual VISU::PNamedIDMapper GetMeshOnEntity(const std::string& theMeshName, - const VISU::TEntity& theEntity) = 0; + const VISU::TEntity& theEntity) = 0; //! Get amount of memory to build mesh for corresponding MED ENTITY virtual size_t GetMeshOnEntitySize(const std::string& theMeshName, - const VISU::TEntity& theEntity) = 0; + const VISU::TEntity& theEntity) = 0; //! Get mesh for corresponding MED FAMILY virtual VISU::PUnstructuredGridIDMapper GetFamilyOnEntity(const std::string& theMeshName, - const VISU::TEntity& theEntity, - const std::string& theFamilyName) = 0; + const VISU::TEntity& theEntity, + const std::string& theFamilyName) = 0; //! Get amount of memory to build mesh for corresponding MED FAMILY virtual size_t GetFamilyOnEntitySize(const std::string& theMeshName, - const VISU::TEntity& theEntity, - const std::string& theFamilyName) = 0; + const VISU::TEntity& theEntity, + const std::string& theFamilyName) = 0; //! Get mesh for corresponding MED GROUP virtual VISU::PUnstructuredGridIDMapper GetMeshOnGroup(const std::string& theMeshName, - const std::string& theGroupName) = 0; + const std::string& theGroupName) = 0; //! Get amount of memory to build mesh for corresponding MED GROUP virtual size_t GetMeshOnGroupSize(const std::string& theMeshName, - const std::string& theGroupName) = 0; + const std::string& theGroupName) = 0; //! Get mesh with attached values for corresponding MED TIMESTAMP virtual VISU::PUnstructuredGridIDMapper GetTimeStampOnMesh(const std::string& theMeshName, - const VISU::TEntity& theEntity, - const std::string& theFieldName, - int theTimeStampNumber) = 0; + const VISU::TEntity& theEntity, + const std::string& theFieldName, + int theTimeStampNumber) = 0; //! Get Gauss Points mesh with attached values for corresponding MED TIMESTAMP virtual VISU::PGaussPtsIDMapper GetTimeStampOnGaussPts(const std::string& theMeshName, - const VISU::TEntity& theEntity, - const std::string& theFieldName, - int theTimeStampNumber) = 0; + const VISU::TEntity& theEntity, + const std::string& theFieldName, + int theTimeStampNumber) = 0; //! Get amount of memory to build vtkDataSet for corresponding MED TIMESTAMP on mesh virtual size_t GetTimeStampOnMeshSize(const std::string& theMeshName, - const VISU::TEntity& theEntity, - const std::string& theFieldName, - int theTimeStampNumber, - bool& theIsEstimated) = 0; + const VISU::TEntity& theEntity, + const std::string& theFieldName, + int theTimeStampNumber, + bool& theIsEstimated) = 0; //! Get amount of memory to build vtkDataSet for corresponding MED TIMESTAMP on Gauss Points virtual size_t GetTimeStampOnGaussPtsSize(const std::string& theMeshName, - const VISU::TEntity& theEntity, - const std::string& theFieldName, - int theTimeStampNumber, - bool& theIsEstimated) = 0; + const VISU::TEntity& theEntity, + const std::string& theFieldName, + int theTimeStampNumber, + bool& theIsEstimated) = 0; //! Get amount of memory to build all MED TIMESTAMPS for corresponding MED FIELD virtual size_t GetFieldOnMeshSize(const std::string& theMeshName, - const VISU::TEntity& theEntity, - const std::string& theFieldName) = 0; + const VISU::TEntity& theEntity, + const std::string& theFieldName) = 0; //! Find MED FIELD container virtual const VISU::PField GetField(const std::string& theMeshName, - VISU::TEntity theEntity, - const std::string& theFieldName) = 0; + VISU::TEntity theEntity, + const std::string& theFieldName) = 0; //! Find MED TIMESTAMP container virtual const VISU::PValForTime GetTimeStamp(const std::string& theMeshName, - const VISU::TEntity& theEntity, - const std::string& theFieldName, - int theTimeStampNumber) = 0; + const VISU::TEntity& theEntity, + const std::string& theFieldName, + int theTimeStampNumber) = 0; //! Allow to generate pretty name for MED TIMESTAMP static diff --git a/src/CONVERTOR/VISU_ConvertorDef.hxx b/src/CONVERTOR/VISU_ConvertorDef.hxx index cf416a92..9e9099d3 100644 --- a/src/CONVERTOR/VISU_ConvertorDef.hxx +++ b/src/CONVERTOR/VISU_ConvertorDef.hxx @@ -43,10 +43,10 @@ namespace VISU //--------------------------------------------------------------- //! Defines VISU enumeration of geometrical types enum EGeometry {ePOINT1=1, eSEG2=102, eSEG3=103, eTRIA3=203, - eQUAD4=204, eTRIA6=206,eQUAD8=208, eTETRA4=304, - ePYRA5=305, ePENTA6=306, eHEXA8=308, eTETRA10=310, - ePYRA13=313, ePENTA15=315, eHEXA20=320, - ePOLYGONE=400, ePOLYEDRE=500, eNONE=-1}; + eQUAD4=204, eTRIA6=206,eQUAD8=208, eTETRA4=304, + ePYRA5=305, ePENTA6=306, eHEXA8=308, eTETRA10=310, + ePYRA13=313, ePENTA15=315, eHEXA20=320, + ePOLYGONE=400, ePOLYEDRE=500, eNONE=-1}; //--------------------------------------------------------------- diff --git a/src/CONVERTOR/VISU_ConvertorUtils.cxx b/src/CONVERTOR/VISU_ConvertorUtils.cxx index c3740649..72ce3048 100644 --- a/src/CONVERTOR/VISU_ConvertorUtils.cxx +++ b/src/CONVERTOR/VISU_ConvertorUtils.cxx @@ -190,7 +190,7 @@ namespace VISU //--------------------------------------------------------------- void WriteToFile(vtkUnstructuredGrid* theDataSet, - const std::string& theFileName) + const std::string& theFileName) { vtkUnstructuredGridWriter* aWriter = vtkUnstructuredGridWriter::New(); //aWriter->SetFileType(VTK_BINARY); @@ -204,7 +204,7 @@ namespace VISU //--------------------------------------------------------------- void WriteToFile(vtkPolyData* theDataSet, - const std::string& theFileName) + const std::string& theFileName) { vtkPolyDataWriter* aWriter = vtkPolyDataWriter::New(); //aWriter->SetFileType(VTK_BINARY); @@ -242,11 +242,11 @@ namespace VISU if ( vtkDataSetAttributes *aDataSetAttributes = theDataSet->GetCellData() ) if ( aDataSetAttributes->GetArray( "ELNO_FIELD" ) != NULL ) - return true; + return true; if ( vtkDataSetAttributes *aDataSetAttributes = theDataSet->GetPointData() ) if ( aDataSetAttributes->GetArray( "ELNO_POINT_COORDS" ) != NULL ) - return true; + return true; return false; } @@ -260,10 +260,10 @@ namespace VISU int aNbTuples = anIntArray->GetNumberOfTuples(); int* aPointer = anIntArray->GetPointer(0); for(int aTupleId = 0; aTupleId < aNbTuples; aTupleId++){ - if(*aPointer == theID && *(aPointer + 1) == theEntity){ - return aTupleId; - } - aPointer += 2; + if(*aPointer == theID && *(aPointer + 1) == theEntity){ + return aTupleId; + } + aPointer += 2; } } return -1; @@ -291,28 +291,28 @@ namespace VISU vtkDataSetAttributes *aDataSetAttributes = theDataSet->GetCellData(); if(vtkDataArray *aDataArray = aDataSetAttributes->GetArray("VISU_CELLS_MAPPER")){ if(theEntity < 0){ - { - vtkIdType anID = GetVTKID(aDataArray, theID, VISU::CELL_ENTITY); - if(anID != -1) - return anID; - } - { - vtkIdType anID = GetVTKID(aDataArray, theID, VISU::FACE_ENTITY); - if(anID != -1) - return anID; - } - { - vtkIdType anID = GetVTKID(aDataArray, theID, VISU::EDGE_ENTITY); - if(anID != -1) - return anID; - } - { - vtkIdType anID = GetVTKID(aDataArray, theID, VISU::NODE_ENTITY); - if(anID != -1) - return anID; - } + { + vtkIdType anID = GetVTKID(aDataArray, theID, VISU::CELL_ENTITY); + if(anID != -1) + return anID; + } + { + vtkIdType anID = GetVTKID(aDataArray, theID, VISU::FACE_ENTITY); + if(anID != -1) + return anID; + } + { + vtkIdType anID = GetVTKID(aDataArray, theID, VISU::EDGE_ENTITY); + if(anID != -1) + return anID; + } + { + vtkIdType anID = GetVTKID(aDataArray, theID, VISU::NODE_ENTITY); + if(anID != -1) + return anID; + } }else - return GetVTKID(aDataArray, theID, theEntity); + return GetVTKID(aDataArray, theID, theEntity); } return -1; } @@ -384,10 +384,10 @@ namespace VISU vtkDataSetAttributes *aDataSetAttributes = theDataSet->GetCellData(); if(vtkDataArray *aDataArray = aDataSetAttributes->GetArray("VISU_CELLS_MAPPER")){ if(vtkIntArray *anIntArray = dynamic_cast(aDataArray)){ - vtkIdType anID = 2 * theID; - TCellID aCellID = anIntArray->GetValue(anID); - TLocalPntID aLocalPntID = anIntArray->GetValue(anID + 1); - return TGaussPointID(aCellID, aLocalPntID); + vtkIdType anID = 2 * theID; + TCellID aCellID = anIntArray->GetValue(anID); + TLocalPntID aLocalPntID = anIntArray->GetValue(anID + 1); + return TGaussPointID(aCellID, aLocalPntID); } } return TGaussPointID(); @@ -402,11 +402,11 @@ namespace VISU vtkDataSetAttributes *aDataSetAttributes = theDataSet->GetCellData(); if(vtkDataArray *aDataArray = aDataSetAttributes->GetArray("VISU_INPUTS_MAPPER")){ if(vtkIntArray *anIntArray = dynamic_cast(aDataArray)){ - vtkIdType aVTKID = GetElemVTKID(theDataSet, theObjID); - vtkIdType aTupleID = 2 * aVTKID; - TCellID aCellID = anIntArray->GetValue(aTupleID); - TInputID anInputID = anIntArray->GetValue(aTupleID + 1); - return TInputCellID(anInputID, aCellID); + vtkIdType aVTKID = GetElemVTKID(theDataSet, theObjID); + vtkIdType aTupleID = 2 * aVTKID; + TCellID aCellID = anIntArray->GetValue(aTupleID); + TInputID anInputID = anIntArray->GetValue(aTupleID + 1); + return TInputCellID(anInputID, aCellID); } } return TInputCellID(); @@ -416,7 +416,7 @@ namespace VISU //--------------------------------------------------------------- vtkDataSet* GetInput(vtkInformationVector **theInputVector, - vtkIdType theInputId) + vtkIdType theInputId) { if(vtkInformation* anInformation = theInputVector[0]->GetInformationObject(theInputId)) return vtkDataSet::SafeDownCast(anInformation->Get(vtkDataObject::DATA_OBJECT())); @@ -464,7 +464,7 @@ namespace VISU //--------------------------------------------------------------- TTimerLog ::TTimerLog(int theIsDebug, - const std::string& theName): + const std::string& theName): myIsDebug(MYDEBUG + theIsDebug), myTimerLog(vtkTimerLog::New()), myPrefixPrinter(myIsDebug == 1), diff --git a/src/CONVERTOR/VISU_ConvertorUtils.hxx b/src/CONVERTOR/VISU_ConvertorUtils.hxx index b3a9ddf4..2d51c376 100644 --- a/src/CONVERTOR/VISU_ConvertorUtils.hxx +++ b/src/CONVERTOR/VISU_ConvertorUtils.hxx @@ -74,7 +74,7 @@ namespace VISU VISU_CONVERTOR_EXPORT void WriteToFile(vtkUnstructuredGrid* theDataSet, - const std::string& theFileName); + const std::string& theFileName); //--------------------------------------------------------------- @@ -82,7 +82,7 @@ namespace VISU VISU_CONVERTOR_EXPORT void WriteToFile(vtkPolyData* theDataSet, - const std::string& theFileName); + const std::string& theFileName); //--------------------------------------------------------------- @@ -156,7 +156,7 @@ namespace VISU VISU_CONVERTOR_EXPORT vtkDataSet* GetInput(vtkInformationVector **theInputVector, - vtkIdType theInputId = 0); + vtkIdType theInputId = 0); VISU_CONVERTOR_EXPORT vtkDataSet* @@ -185,7 +185,7 @@ namespace VISU public: TTimerLog(int theIsDebug, - const std::string& theName); + const std::string& theName); ~TTimerLog(); }; diff --git a/src/CONVERTOR/VISU_Convertor_impl.cxx b/src/CONVERTOR/VISU_Convertor_impl.cxx index 0658fc5b..f3c03075 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.cxx +++ b/src/CONVERTOR/VISU_Convertor_impl.cxx @@ -85,7 +85,7 @@ namespace inline void PrintCells( vtkCellArray* theConnectivity, - const VISU::TConnect& theVector) + const VISU::TConnect& theVector) { theConnectivity->InsertNextCell( theVector.size(), &theVector[ 0 ] ); } @@ -94,18 +94,18 @@ namespace //--------------------------------------------------------------- void GetCellsOnSubMesh(const VISU::PUnstructuredGrid& theSource, - const VISU::PMeshOnEntityImpl& theMeshOnEntity, - const VISU::PSubMeshImpl& theSubMesh, - const vtkIdType theGeom) + const VISU::PMeshOnEntityImpl& theMeshOnEntity, + const VISU::PSubMeshImpl& theSubMesh, + const vtkIdType theGeom) { VISU::TTimerLog aTimerLog(MYDEBUG,"GetCellsOnSubMesh"); const VISU::TCell2Connect& anArray = theSubMesh->myCell2Connect; vtkIdType aCellsSize = theSubMesh->myCellsSize; vtkIdType aNbCells = theSubMesh->myNbCells; INITMSG(MYDEBUG,"GetCellsOnSubMesh "<< - "- theGeom = "<myGeom2SubMeshID; if(aGeom2SubMeshID.empty()) - EXCEPTION(std::runtime_error,"GetCells >> There is no elements on the family !!!"); + EXCEPTION(std::runtime_error,"GetCells >> There is no elements on the family !!!"); VISU::TGeom2SubMeshID::const_iterator aGeom2SubMeshIDIter = aGeom2SubMeshID.find(aEGeom); if(aGeom2SubMeshIDIter == aGeom2SubMeshID.end()) - continue; + continue; const VISU::TSubMeshID& aSubMeshID = aGeom2SubMeshIDIter->second; INITMSG(MYDEBUG, - " - aEGeom = "<second; - if(aSubProfile->myStatus == VISU::eRemoveAll) - continue; - - GetMeshOnSubProfile(theMesh, - theMeshOnEntity, - theProfile, - aSubProfile); - - const VISU::PUnstructuredGrid& aSource = aSubProfile->GetSource(); - anAppendFilter->AddInput(aSource.GetPointer()); - - vtkIdType aNbCells = aSource->GetNumberOfCells(); - for(vtkIdType aCell = 0; aCell < aNbCells; aCell++, aCellID++){ - vtkIdType anObjID = aSubProfile->GetElemObjID(aCell); - anElemObj2VTKID[anObjID] = aCellID; - } - - aSubProfileArr[anInputID++] = aSubProfile; + VISU::PSubProfileImpl aSubProfile = anIter->second; + if(aSubProfile->myStatus == VISU::eRemoveAll) + continue; + + GetMeshOnSubProfile(theMesh, + theMeshOnEntity, + theProfile, + aSubProfile); + + const VISU::PUnstructuredGrid& aSource = aSubProfile->GetSource(); + anAppendFilter->AddInput(aSource.GetPointer()); + + vtkIdType aNbCells = aSource->GetNumberOfCells(); + for(vtkIdType aCell = 0; aCell < aNbCells; aCell++, aCellID++){ + vtkIdType anObjID = aSubProfile->GetElemObjID(aCell); + anElemObj2VTKID[anObjID] = aCellID; + } + + aSubProfileArr[anInputID++] = aSubProfile; } } anAppendFilter->Update(); // Fix on VTK @@ -423,8 +423,8 @@ namespace //--------------------------------------------------------------- void GetGaussSubMeshSource(const VISU::PPolyData& theSource, - const VISU::PGaussSubMeshImpl& theGaussSubMesh, - const VISU::PMeshOnEntityImpl& theMeshOnEntity) + const VISU::PGaussSubMeshImpl& theGaussSubMesh, + const VISU::PMeshOnEntityImpl& theMeshOnEntity) { vtkCellArray* aConnectivity = vtkCellArray::New(); vtkIdType aCellsSize = theGaussSubMesh->myCellsSize; @@ -455,9 +455,9 @@ namespace aDataArray->SetNumberOfTuples(aNbTuples); int *aDataArrayPtr = aDataArray->GetPointer(0); for(vtkIdType aTupleId = 0; aTupleId < aNbTuples; aTupleId++){ - vtkIdType aGlobalID = theGaussSubMesh->GetGlobalID(aTupleId); - *aDataArrayPtr++ = aGlobalID; - *aDataArrayPtr++ = 0; + vtkIdType aGlobalID = theGaussSubMesh->GetGlobalID(aTupleId); + *aDataArrayPtr++ = aGlobalID; + *aDataArrayPtr++ = 0; } aSource->GetPointData()->AddArray(aDataArray); aDataArray->Delete(); @@ -471,9 +471,9 @@ namespace aDataArray->SetNumberOfTuples(aNbTuples); int *aDataArrayPtr = aDataArray->GetPointer(0); for(vtkIdType aTupleId = 0; aTupleId < aNbTuples; aTupleId++){ - VISU::TGaussPointID aGaussPointID = theGaussSubMesh->GetObjID(aTupleId); - *aDataArrayPtr++ = aGaussPointID.first; - *aDataArrayPtr++ = aGaussPointID.second; + VISU::TGaussPointID aGaussPointID = theGaussSubMesh->GetObjID(aTupleId); + *aDataArrayPtr++ = aGaussPointID.first; + *aDataArrayPtr++ = aGaussPointID.second; } aSource->GetCellData()->AddArray(aDataArray); aDataArray->Delete(); @@ -484,9 +484,9 @@ namespace //--------------------------------------------------------------- void GetGaussSubMesh(const VISU::PMeshImpl& theMesh, - const VISU::PMeshOnEntityImpl& theMeshOnEntity, - const VISU::PGaussMeshImpl& theGaussMesh, - const VISU::PGaussSubMeshImpl& theGaussSubMesh) + const VISU::PMeshOnEntityImpl& theMeshOnEntity, + const VISU::PGaussMeshImpl& theGaussMesh, + const VISU::PGaussSubMeshImpl& theGaussSubMesh) { VISU::PGaussImpl aGauss = theGaussSubMesh->myGauss; @@ -512,8 +512,8 @@ namespace //--------------------------------------------------------------- void BuildGaussMesh(const VISU::PMeshImpl& theMesh, - const VISU::PMeshOnEntityImpl& theMeshOnEntity, - const VISU::PGaussMeshImpl& theGaussMesh) + const VISU::PMeshOnEntityImpl& theMeshOnEntity, + const VISU::PGaussMeshImpl& theGaussMesh) { if(theGaussMesh->myIsVTKDone) return; @@ -525,14 +525,14 @@ namespace for(vtkIdType aStartID = 0; anIter != aGeom2GaussSubMesh.end(); anIter++){ VISU::PGaussSubMeshImpl aGaussSubMesh = anIter->second; if(aGaussSubMesh->myStatus == VISU::eRemoveAll) - continue; + continue; aGaussSubMesh->myStartID = aStartID; GetGaussSubMesh(theMesh, - theMeshOnEntity, - theGaussMesh, - aGaussSubMesh); + theMeshOnEntity, + theGaussMesh, + aGaussSubMesh); const VISU::PPolyData& aSource = aGaussSubMesh->GetSource(); aStartID += aSource->GetNumberOfCells(); @@ -631,12 +631,12 @@ VISU_Convertor_impl VISU::PNamedIDMapper VISU_Convertor_impl ::GetMeshOnEntity(const std::string& theMeshName, - const VISU::TEntity& theEntity) + const VISU::TEntity& theEntity) { INITMSG(MYDEBUG,"GetMeshOnEntity"<< - "; theMeshName = '"<GetOutput(),aFileName); + std::string aMeshName = (const char*)QString(theMeshName.c_str()).simplified().toLatin1(); + std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-"; + aFileName += aMeshName + dtos("-%d-",int(theEntity)) + "-MeshOnEntity.vtk"; + VISU::WriteToFile(anAppendFilter->GetOutput(),aFileName); } if(MYVTKDEBUG){ - GetMeshOnEntitySize(theMeshName,theEntity); - PrintMemorySize(anAppendFilter->GetOutput()); + GetMeshOnEntitySize(theMeshName,theEntity); + PrintMemorySize(anAppendFilter->GetOutput()); } } @@ -717,14 +717,14 @@ VISU_Convertor_impl VISU::PUnstructuredGridIDMapper VISU_Convertor_impl ::GetFamilyOnEntity(const std::string& theMeshName, - const VISU::TEntity& theEntity, - const std::string& theFamilyName) + const VISU::TEntity& theEntity, + const std::string& theFamilyName) { INITMSG(MYDEBUG,"GetFamilyOnEntity"<< - "; theMeshName = '"<myIsVTKDone = true; if(MYDEBUGWITHFILES){ - std::string aMeshName = (const char*)QString(theMeshName.c_str()).simplified().toLatin1(); - std::string aFamilyName = (const char*)QString(theFamilyName.c_str()).simplified().toLatin1(); - std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-"; - aFileName += aMeshName + dtos("-%d-",int(theEntity)) + aFamilyName + "-FamilyOnEntity.vtk"; - VISU::WriteToFile(aSource.GetPointer(),aFileName); + std::string aMeshName = (const char*)QString(theMeshName.c_str()).simplified().toLatin1(); + std::string aFamilyName = (const char*)QString(theFamilyName.c_str()).simplified().toLatin1(); + std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-"; + aFileName += aMeshName + dtos("-%d-",int(theEntity)) + aFamilyName + "-FamilyOnEntity.vtk"; + VISU::WriteToFile(aSource.GetPointer(),aFileName); } if(MYVTKDEBUG){ - GetFamilyOnEntitySize(theMeshName,theEntity,theFamilyName); - PrintMemorySize(aSource.GetPointer()); + GetFamilyOnEntitySize(theMeshName,theEntity,theFamilyName); + PrintMemorySize(aSource.GetPointer()); } } @@ -778,13 +778,13 @@ VISU_Convertor_impl VISU::PUnstructuredGridIDMapper VISU_Convertor_impl ::GetMeshOnGroup(const std::string& theMeshName, - const std::string& theGroupName) + const std::string& theGroupName) { INITMSG(MYDEBUG,"GetMeshOnGroup\n"); INITMSGA(MYDEBUG,0, - "- theMeshName = '"<myName; - const VISU::TEntity& anEntity = aFamily->myEntity; - - VISU::PIDMapper anIDMapper = GetFamilyOnEntity(theMeshName,anEntity,aFamilyName); - vtkDataSet* anOutput = anIDMapper->GetOutput(); - anAppendFilter->AddInput(anOutput); - - vtkIdType aStartID = anElemObj2VTKID.size(); - vtkIdType aNbCells = anOutput->GetNumberOfCells(); - for(vtkIdType aCellID = 0; aCellID < aNbCells; aCellID++){ - anElemObj2VTKID[aFamily->GetElemObjID(aCellID)] = aStartID + aCellID; - } - aFamilyArr[anID] = aFamily; + VISU::PFamilyImpl aFamily = *anIter; + const std::string& aFamilyName = aFamily->myName; + const VISU::TEntity& anEntity = aFamily->myEntity; + + VISU::PIDMapper anIDMapper = GetFamilyOnEntity(theMeshName,anEntity,aFamilyName); + vtkDataSet* anOutput = anIDMapper->GetOutput(); + anAppendFilter->AddInput(anOutput); + + vtkIdType aStartID = anElemObj2VTKID.size(); + vtkIdType aNbCells = anOutput->GetNumberOfCells(); + for(vtkIdType aCellID = 0; aCellID < aNbCells; aCellID++){ + anElemObj2VTKID[aFamily->GetElemObjID(aCellID)] = aStartID + aCellID; + } + aFamilyArr[anID] = aFamily; } aGroup->CopyStructure( aMesh ); @@ -830,11 +830,11 @@ VISU_Convertor_impl aGroup->myIsVTKDone = true; if(MYDEBUGWITHFILES){ - std::string aMeshName = (const char*)QString(theMeshName.c_str()).simplified().toLatin1(); - std::string aGroupName = (const char*)QString(theGroupName.c_str()).simplified().toLatin1(); - std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-"; - aFileName += aMeshName + "-" + aGroupName + "-MeshOnGroup.vtk"; - VISU::WriteToFile(anAppendFilter->GetOutput(),aFileName); + std::string aMeshName = (const char*)QString(theMeshName.c_str()).simplified().toLatin1(); + std::string aGroupName = (const char*)QString(theGroupName.c_str()).simplified().toLatin1(); + std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-"; + aFileName += aMeshName + "-" + aGroupName + "-MeshOnGroup.vtk"; + VISU::WriteToFile(anAppendFilter->GetOutput(),aFileName); } } #ifndef _DEXCEPT_ @@ -851,12 +851,12 @@ VISU_Convertor_impl vtkUnstructuredGrid* VISU_Convertor_impl ::GetTimeStampOnProfile( const VISU::PMeshImpl& theMesh, - const VISU::PMeshOnEntityImpl& theMeshOnEntity, - const VISU::PFieldImpl& theField, - const VISU::PValForTimeImpl& theValForTime, - const VISU::PUnstructuredGridIDMapperImpl& theUnstructuredGridIDMapper, - const VISU::PProfileImpl& theProfile, - const VISU::TEntity& theEntity ) + const VISU::PMeshOnEntityImpl& theMeshOnEntity, + const VISU::PFieldImpl& theField, + const VISU::PValForTimeImpl& theValForTime, + const VISU::PUnstructuredGridIDMapperImpl& theUnstructuredGridIDMapper, + const VISU::PProfileImpl& theProfile, + const VISU::TEntity& theEntity ) { LoadMeshOnEntity( theMesh, theMeshOnEntity ); GetMeshOnEntity( theMeshOnEntity->myMeshName, theMeshOnEntity->myEntity ); @@ -874,21 +874,21 @@ VISU_Convertor_impl const VISU::EGeometry& aGeom = aSubProfileIter->first; const VISU::PSubProfileImpl& aSubProfile = aSubProfileIter->second; if ( aSubProfile->myStatus == VISU::eAddPart && aGeom == VISU::ePOINT1 ) { - const VISU::TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap; - VISU::TMeshOnEntityMap::const_reverse_iterator aMeshOnEntityIter = aMeshOnEntityMap.rbegin(); - for( ; aMeshOnEntityIter != aMeshOnEntityMap.rend(); aMeshOnEntityIter++ ) { - VISU::TEntity anEntity = aMeshOnEntityIter->first; - if ( anEntity == VISU::NODE_ENTITY ) - continue; - VISU::PNamedIDMapper aNamedIDMapper = GetMeshOnEntity( theMesh->myName, anEntity ); - if( aNamedIDMapper ) { - theUnstructuredGridIDMapper->SetReferencedMesh( aNamedIDMapper ); - VISU::PUnstructuredGrid aSource = theUnstructuredGridIDMapper->GetSource(); - VISU::GetTimeStampOnProfile( aSource, theField, theValForTime, theEntity ); - - return theUnstructuredGridIDMapper->GetUnstructuredGridOutput(); - } - } + const VISU::TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap; + VISU::TMeshOnEntityMap::const_reverse_iterator aMeshOnEntityIter = aMeshOnEntityMap.rbegin(); + for( ; aMeshOnEntityIter != aMeshOnEntityMap.rend(); aMeshOnEntityIter++ ) { + VISU::TEntity anEntity = aMeshOnEntityIter->first; + if ( anEntity == VISU::NODE_ENTITY ) + continue; + VISU::PNamedIDMapper aNamedIDMapper = GetMeshOnEntity( theMesh->myName, anEntity ); + if( aNamedIDMapper ) { + theUnstructuredGridIDMapper->SetReferencedMesh( aNamedIDMapper ); + VISU::PUnstructuredGrid aSource = theUnstructuredGridIDMapper->GetSource(); + VISU::GetTimeStampOnProfile( aSource, theField, theValForTime, theEntity ); + + return theUnstructuredGridIDMapper->GetUnstructuredGridOutput(); + } + } } } } @@ -904,22 +904,22 @@ VISU_Convertor_impl VISU::PUnstructuredGridIDMapper VISU_Convertor_impl ::GetTimeStampOnMesh( const std::string& theMeshName, - const VISU::TEntity& theEntity, - const std::string& theFieldName, - int theStampsNum ) + const VISU::TEntity& theEntity, + const std::string& theFieldName, + int theStampsNum ) { INITMSG(MYDEBUG,"GetTimeStampOnMesh"<< - "; theMeshName = '"<myProfile, - aVTKMeshOnEntity->myEntity); + MSG(MYDEBUG,"Follow exception was occured :\n"<myProfile, + aVTKMeshOnEntity->myEntity); } anUnstructuredGridIDMapper->CopyStructure( aMesh ); @@ -961,21 +961,21 @@ VISU_Convertor_impl anUnstructuredGridIDMapper->myIsVTKDone = true; if(MYDEBUGWITHFILES){ - std::string aMeshName = (const char*)QString(theMeshName.c_str()).simplified().toLatin1(); - std::string aFieldName = (const char*)QString(theFieldName.c_str()).simplified().toLatin1(); - std::string aPrefix = std::string(getenv("HOME"))+"/"+getenv("USER")+"-"; - std::string aFileName = aPrefix + aMeshName + dtos("-%d-",int(theEntity)) + - aFieldName + dtos("-%d", theStampsNum) + "-TimeStampOnMesh.vtk"; - VISU::WriteToFile(anOutput,aFileName); + std::string aMeshName = (const char*)QString(theMeshName.c_str()).simplified().toLatin1(); + std::string aFieldName = (const char*)QString(theFieldName.c_str()).simplified().toLatin1(); + std::string aPrefix = std::string(getenv("HOME"))+"/"+getenv("USER")+"-"; + std::string aFileName = aPrefix + aMeshName + dtos("-%d-",int(theEntity)) + + aFieldName + dtos("-%d", theStampsNum) + "-TimeStampOnMesh.vtk"; + VISU::WriteToFile(anOutput,aFileName); } if(MYVTKDEBUG){ - GetTimeStampSize(theMeshName, theEntity, theFieldName, theStampsNum); - anOutput->Update(); - if(theEntity == VISU::NODE_ENTITY) - BEGMSG(MYVTKDEBUG,"GetPointData() = "<GetPointData()->GetActualMemorySize()*1000)<(aFindTimeStamp); VISU::PMeshOnEntityImpl aMeshOnEntity = boost::get<1>(aFindTimeStamp); @@ -1036,9 +1036,9 @@ VISU_Convertor_impl VISU::PGaussMeshImpl aGaussMesh = aValForTime->myGaussMesh; if(!aGaussMesh->myIsVTKDone){ - BuildGaussMesh(aMesh, aVTKMeshOnEntity, aGaussMesh); - aGaussMesh->myParent = aProfile.get(); - aGaussMesh->myIsVTKDone = true; + BuildGaussMesh(aMesh, aVTKMeshOnEntity, aGaussMesh); + aGaussMesh->myParent = aProfile.get(); + aGaussMesh->myIsVTKDone = true; } aGaussPtsIDFilter->myIDMapper = aGaussMesh; @@ -1050,21 +1050,21 @@ VISU_Convertor_impl aGaussPtsIDFilter->myIsVTKDone = true; if(MYDEBUGWITHFILES){ - std::string aMeshName = (const char*)QString(theMeshName.c_str()).simplified().toLatin1(); - std::string aFieldName = (const char*)QString(theFieldName.c_str()).simplified().toLatin1(); - std::string aPrefix = std::string(getenv("HOME"))+"/"+getenv("USER")+"-"; - std::string aFileName = aPrefix + aMeshName + dtos("-%d-",int(theEntity)) + - aFieldName + dtos("-%d",theStampsNum) + "-TimeStampOnGaussPts.vtk"; - VISU::WriteToFile(anOutput, aFileName); + std::string aMeshName = (const char*)QString(theMeshName.c_str()).simplified().toLatin1(); + std::string aFieldName = (const char*)QString(theFieldName.c_str()).simplified().toLatin1(); + std::string aPrefix = std::string(getenv("HOME"))+"/"+getenv("USER")+"-"; + std::string aFileName = aPrefix + aMeshName + dtos("-%d-",int(theEntity)) + + aFieldName + dtos("-%d",theStampsNum) + "-TimeStampOnGaussPts.vtk"; + VISU::WriteToFile(anOutput, aFileName); } if(MYVTKDEBUG){ - GetTimeStampSize(theMeshName, theEntity, theFieldName, theStampsNum); - anOutput->Update(); - if(theEntity == VISU::NODE_ENTITY) - BEGMSG(MYVTKDEBUG,"GetPointData() = "<GetPointData()->GetActualMemorySize()*1000)<second; return TFindFamilyOnEntity(aMesh, - aMeshOnEntity, - aFamily); + aMeshOnEntity, + aFamily); } } return TFindFamilyOnEntity(); @@ -1162,28 +1162,28 @@ VISU_Convertor_impl const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap; VISU::TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin(); for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++){ - const std::string& aFieldName = aFieldMapIter->first; - const VISU::PField aField = aFieldMapIter->second; - const VISU::TValField& aValField = aField->myValField; - VISU::TValField::const_iterator aValFieldIter = aValField.begin(); - for(; aValFieldIter != aValField.end(); aValFieldIter++){ - int aTimeStamp = aValFieldIter->first; - aResult += GetTimeStampSize(aMeshName,anEntity,aFieldName,aTimeStamp); - } + const std::string& aFieldName = aFieldMapIter->first; + const VISU::PField aField = aFieldMapIter->second; + const VISU::TValField& aValField = aField->myValField; + VISU::TValField::const_iterator aValFieldIter = aValField.begin(); + for(; aValFieldIter != aValField.end(); aValFieldIter++){ + int aTimeStamp = aValFieldIter->first; + aResult += GetTimeStampSize(aMeshName,anEntity,aFieldName,aTimeStamp); + } } //Importing groups const VISU::TGroupMap& aGroupMap = aMesh->myGroupMap; VISU::TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin(); for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){ - const std::string& aGroupName = aGroupMapIter->first; - aResult += GetMeshOnGroupSize(aMeshName,aGroupName); + const std::string& aGroupName = aGroupMapIter->first; + aResult += GetMeshOnGroupSize(aMeshName,aGroupName); } //Import families const VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap; VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin(); for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){ - const std::string& aFamilyName = aFamilyMapIter->first; - aResult += GetFamilyOnEntitySize(aMeshName,anEntity,aFamilyName); + const std::string& aFamilyName = aFamilyMapIter->first; + aResult += GetFamilyOnEntitySize(aMeshName,anEntity,aFamilyName); } //Import mesh on entity aResult += GetMeshOnEntitySize(aMeshName,anEntity); @@ -1198,7 +1198,7 @@ VISU_Convertor_impl size_t VISU_Convertor_impl ::GetMeshOnEntitySize(const std::string& theMeshName, - const VISU::TEntity& theEntity) + const VISU::TEntity& theEntity) { TFindMeshOnEntity aFindMeshOnEntity = FindMeshOnEntity(theMeshName, theEntity); @@ -1240,8 +1240,8 @@ VISU_Convertor_impl size_t VISU_Convertor_impl ::GetFamilyOnEntitySize(const std::string& theMeshName, - const VISU::TEntity& theEntity, - const std::string& theFamilyName) + const VISU::TEntity& theEntity, + const std::string& theFamilyName) { TFindFamilyOnEntity aFindFamilyOnEntity = FindFamilyOnEntity(theMeshName,theEntity,theFamilyName); @@ -1284,7 +1284,7 @@ VISU_Convertor_impl VISU_Convertor_impl::TFindMeshOnGroup VISU_Convertor_impl ::FindMeshOnGroup(const std::string& theMeshName, - const std::string& theGroupName) + const std::string& theGroupName) { VISU::PMeshImpl aMesh = FindMesh(theMeshName); VISU::TGroupMap& aGroupMap = aMesh->myGroupMap; @@ -1300,7 +1300,7 @@ VISU_Convertor_impl size_t VISU_Convertor_impl ::GetMeshOnGroupSize(const std::string& theMeshName, - const std::string& theGroupName) + const std::string& theGroupName) { TFindMeshOnGroup aFindMeshOnGroup = FindMeshOnGroup(theMeshName,theGroupName); VISU::PMeshImpl aMesh = boost::get<0>(aFindMeshOnGroup); @@ -1334,8 +1334,8 @@ VISU_Convertor_impl VISU_Convertor_impl::TFindField VISU_Convertor_impl ::FindField(const std::string& theMeshName, - const VISU::TEntity& theEntity, - const std::string& theFieldName) + const VISU::TEntity& theEntity, + const std::string& theFieldName) { TFindMeshOnEntity aFindMeshOnEntity = FindMeshOnEntity(theMeshName,theEntity); @@ -1365,17 +1365,17 @@ VISU_Convertor_impl VISU::PFieldImpl aField = aFieldIter->second; return TFindField( aMesh, - aMeshOnEntity, - aVTKMeshOnEntity, - aField ); + aMeshOnEntity, + aVTKMeshOnEntity, + aField ); } size_t VISU_Convertor_impl ::GetFieldOnMeshSize(const std::string& theMeshName, - const VISU::TEntity& theEntity, - const std::string& theFieldName) + const VISU::TEntity& theEntity, + const std::string& theFieldName) { TFindField aFindField = FindField(theMeshName,theEntity,theFieldName); VISU::PMeshOnEntityImpl aVTKMeshOnEntity = boost::get<2>(aFindField); @@ -1396,9 +1396,9 @@ VISU_Convertor_impl VISU_Convertor_impl::TFindTimeStamp VISU_Convertor_impl ::FindTimeStamp(const std::string& theMeshName, - const VISU::TEntity& theEntity, - const std::string& theFieldName, - int theStampsNum) + const VISU::TEntity& theEntity, + const std::string& theFieldName, + int theStampsNum) { TFindField aFindField = FindField(theMeshName,theEntity,theFieldName); VISU::PField aField = boost::get<3>(aFindField); @@ -1414,19 +1414,19 @@ VISU_Convertor_impl VISU::PValForTimeImpl aValForTime = aValFieldIter->second; return TFindTimeStamp(aMesh, - aMeshOnEntity, - aVTKMeshOnEntity, - aField, - aValForTime); + aMeshOnEntity, + aVTKMeshOnEntity, + aField, + aValForTime); } size_t VISU_Convertor_impl ::GetTimeStampSize(const std::string& theMeshName, - const VISU::TEntity& theEntity, - const std::string& theFieldName, - int theStampsNum) + const VISU::TEntity& theEntity, + const std::string& theFieldName, + int theStampsNum) { TFindTimeStamp aFindTimeStamp = FindTimeStamp(theMeshName,theEntity,theFieldName,theStampsNum); @@ -1449,26 +1449,26 @@ VISU_Convertor_impl size_t VISU_Convertor_impl ::GetTimeStampOnMeshSize(const std::string& theMeshName, - const VISU::TEntity& theEntity, - const std::string& theFieldName, - int theTimeStampNumber, - bool& theIsEstimated) + const VISU::TEntity& theEntity, + const std::string& theFieldName, + int theTimeStampNumber, + bool& theIsEstimated) { size_t aSize = 0; //Cheching possibility do the query TFindTimeStamp aFindTimeStamp = FindTimeStamp(theMeshName, - theEntity, - theFieldName, - theTimeStampNumber); + theEntity, + theFieldName, + theTimeStampNumber); VISU::PValForTimeImpl aValForTime = boost::get<4>(aFindTimeStamp); VISU::PUnstructuredGridIDMapperImpl anUnstructuredGridIDMapper = aValForTime->myUnstructuredGridIDMapper; if(anUnstructuredGridIDMapper->myIsVTKDone){ VISU::PIDMapper anIDMapper = GetTimeStampOnMesh(theMeshName, - theEntity, - theFieldName, - theTimeStampNumber); + theEntity, + theFieldName, + theTimeStampNumber); anIDMapper->GetOutput(); aSize += anIDMapper->GetMemorySize(); }else @@ -1484,26 +1484,26 @@ VISU_Convertor_impl size_t VISU_Convertor_impl ::GetTimeStampOnGaussPtsSize(const std::string& theMeshName, - const VISU::TEntity& theEntity, - const std::string& theFieldName, - int theTimeStampNumber, - bool& theIsEstimated) + const VISU::TEntity& theEntity, + const std::string& theFieldName, + int theTimeStampNumber, + bool& theIsEstimated) { size_t aSize = 0; //Cheching possibility do the query TFindTimeStamp aFindTimeStamp = FindTimeStamp(theMeshName, - theEntity, - theFieldName, - theTimeStampNumber); + theEntity, + theFieldName, + theTimeStampNumber); VISU::PValForTimeImpl aValForTime = boost::get<4>(aFindTimeStamp); VISU::PGaussPtsIDFilter aGaussPtsIDFilter = aValForTime->myGaussPtsIDFilter; if(aGaussPtsIDFilter->myIsVTKDone){ VISU::PGaussPtsIDMapper aGaussPtsIDMapper = GetTimeStampOnGaussPts(theMeshName, - theEntity, - theFieldName, - theTimeStampNumber); + theEntity, + theFieldName, + theTimeStampNumber); aGaussPtsIDMapper->GetOutput(); aSize += aGaussPtsIDMapper->GetMemorySize(); }else @@ -1519,8 +1519,8 @@ VISU_Convertor_impl const VISU::PField VISU_Convertor_impl ::GetField(const std::string& theMeshName, - VISU::TEntity theEntity, - const std::string& theFieldName) + VISU::TEntity theEntity, + const std::string& theFieldName) { TFindField aFindField = FindField(theMeshName,theEntity,theFieldName); VISU::PField aField = boost::get<3>(aFindField); @@ -1531,9 +1531,9 @@ VISU_Convertor_impl const VISU::PValForTime VISU_Convertor_impl ::GetTimeStamp(const std::string& theMeshName, - const VISU::TEntity& theEntity, - const std::string& theFieldName, - int theStampsNum) + const VISU::TEntity& theEntity, + const std::string& theFieldName, + int theStampsNum) { TFindTimeStamp aFindTimeStamp = FindTimeStamp(theMeshName,theEntity,theFieldName,theStampsNum); diff --git a/src/CONVERTOR/VISU_Convertor_impl.hxx b/src/CONVERTOR/VISU_Convertor_impl.hxx index fd3f073a..86c950a6 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.hxx +++ b/src/CONVERTOR/VISU_Convertor_impl.hxx @@ -82,95 +82,95 @@ public: virtual VISU::PNamedIDMapper GetMeshOnEntity(const std::string& theMeshName, - const VISU::TEntity& theEntity); + const VISU::TEntity& theEntity); //! Implemention of the VISU_Convertor::GetMeshOnEntitySize virtual size_t GetMeshOnEntitySize(const std::string& theMeshName, - const VISU::TEntity& theEntity); + const VISU::TEntity& theEntity); //! Implemention of the VISU_Convertor::GetFamilyOnEntity virtual VISU::PUnstructuredGridIDMapper GetFamilyOnEntity(const std::string& theMeshName, - const VISU::TEntity& theEntity, - const std::string& theFamilyName); + const VISU::TEntity& theEntity, + const std::string& theFamilyName); //! Implemention of the VISU_Convertor::GetFamilyOnEntitySize virtual size_t GetFamilyOnEntitySize(const std::string& theMeshName, - const VISU::TEntity& theEntity, - const std::string& theFamilyName); + const VISU::TEntity& theEntity, + const std::string& theFamilyName); //! Implemention of the VISU_Convertor::GetMeshOnGroup virtual VISU::PUnstructuredGridIDMapper GetMeshOnGroup(const std::string& theMeshName, - const std::string& theGroupName); + const std::string& theGroupName); //! Implemention of the VISU_Convertor::GetMeshOnGroupSize virtual size_t GetMeshOnGroupSize(const std::string& theMeshName, - const std::string& theGroupName); + const std::string& theGroupName); //! Implemention of the VISU_Convertor::GetTimeStampOnMesh virtual VISU::PUnstructuredGridIDMapper GetTimeStampOnMesh( const std::string& theMeshName, - const VISU::TEntity& theEntity, - const std::string& theFieldName, - int theTimeStampNumber ); + const VISU::TEntity& theEntity, + const std::string& theFieldName, + int theTimeStampNumber ); //! Get amount of memory to build vtkDataSet for corresponding MED TIMESTAMP on mesh virtual size_t GetTimeStampOnMeshSize(const std::string& theMeshName, - const VISU::TEntity& theEntity, - const std::string& theFieldName, - int theTimeStampNumber, - bool& theIsEstimated); + const VISU::TEntity& theEntity, + const std::string& theFieldName, + int theTimeStampNumber, + bool& theIsEstimated); //! Get amount of memory to build vtkDataSet for corresponding MED TIMESTAMP on Gauss Points virtual size_t GetTimeStampOnGaussPtsSize(const std::string& theMeshName, - const VISU::TEntity& theEntity, - const std::string& theFieldName, - int theTimeStampNumber, - bool& theIsEstimated); + const VISU::TEntity& theEntity, + const std::string& theFieldName, + int theTimeStampNumber, + bool& theIsEstimated); //! Implemention of the VISU_Convertor::GetTimeStampOnGaussPts virtual VISU::PGaussPtsIDMapper GetTimeStampOnGaussPts(const std::string& theMeshName, - const VISU::TEntity& theEntity, - const std::string& theFieldName, - int theTimeStampNumber); + const VISU::TEntity& theEntity, + const std::string& theFieldName, + int theTimeStampNumber); //! Implemention of the VISU_Convertor::GetFieldOnMeshSize virtual size_t GetFieldOnMeshSize(const std::string& theMeshName, - const VISU::TEntity& theEntity, - const std::string& theFieldName); + const VISU::TEntity& theEntity, + const std::string& theFieldName); //! Implemention of the VISU_Convertor::GetField virtual const VISU::PField GetField(const std::string& theMeshName, - VISU::TEntity theEntity, - const std::string& theFieldName); + VISU::TEntity theEntity, + const std::string& theFieldName); //! Implemention of the VISU_Convertor::GetTimeStamp virtual const VISU::PValForTime GetTimeStamp(const std::string& theMeshName, - const VISU::TEntity& theEntity, - const std::string& theFieldName, - int theStampsNum); + const VISU::TEntity& theEntity, + const std::string& theFieldName, + int theStampsNum); protected: //! An utility method to find TMesh by its name @@ -179,100 +179,100 @@ protected: //! An utility method to find TMeshOnEntity by name of its parent mesh and entity typedef boost::tuple TFindMeshOnEntity; + VISU::PMeshOnEntityImpl> TFindMeshOnEntity; TFindMeshOnEntity FindMeshOnEntity(const std::string& theMeshName, - const VISU::TEntity& theEntity); + const VISU::TEntity& theEntity); //! An utility method to find TFamily by name of its parent mesh, corresponding entity and its name typedef boost::tuple TFindFamilyOnEntity; + VISU::PMeshOnEntityImpl,VISU::PFamilyImpl> TFindFamilyOnEntity; TFindFamilyOnEntity FindFamilyOnEntity(const std::string& theMeshName, - const VISU::TEntity& theEntity, - const std::string& theFamilyName); + const VISU::TEntity& theEntity, + const std::string& theFamilyName); //! An utility method to find Group by name of its parent mesh and its name typedef boost::tuple TFindMeshOnGroup; + VISU::PGroupImpl> TFindMeshOnGroup; TFindMeshOnGroup FindMeshOnGroup(const std::string& theMeshName, - const std::string& theGroupName); + const std::string& theGroupName); //! An utility method to find TField by name of its parent mesh, corresponding entity and its name typedef boost::tuple TFindField; + VISU::PMeshOnEntityImpl, + VISU::PMeshOnEntityImpl, + VISU::PFieldImpl> TFindField; TFindField FindField( const std::string& theMeshName, - const VISU::TEntity& theEntity, - const std::string& theFieldName ); + const VISU::TEntity& theEntity, + const std::string& theFieldName ); //! An utility method to find TTimeStamp by name of its parent mesh, corresponding entity, field name and its number typedef boost::tuple TFindTimeStamp; + VISU::PMeshOnEntityImpl, + VISU::PMeshOnEntityImpl, + VISU::PFieldImpl, + VISU::PValForTimeImpl> TFindTimeStamp; TFindTimeStamp FindTimeStamp(const std::string& theMeshName, - const VISU::TEntity& theEntity, - const std::string& theFieldName, - int theStampsNum); + const VISU::TEntity& theEntity, + const std::string& theFieldName, + int theStampsNum); vtkUnstructuredGrid* GetTimeStampOnProfile( const VISU::PMeshImpl& theMesh, - const VISU::PMeshOnEntityImpl& theMeshOnEntity, - const VISU::PFieldImpl& theField, - const VISU::PValForTimeImpl& theValForTime, - const VISU::PUnstructuredGridIDMapperImpl& theIDMapperFilter, - const VISU::PProfileImpl& theProfile, - const VISU::TEntity& theEntity ); + const VISU::PMeshOnEntityImpl& theMeshOnEntity, + const VISU::PFieldImpl& theField, + const VISU::PValForTimeImpl& theValForTime, + const VISU::PUnstructuredGridIDMapperImpl& theIDMapperFilter, + const VISU::PProfileImpl& theProfile, + const VISU::TEntity& theEntity ); protected: //! Implemention of the VISU_Convertor::GetTimeStampSize virtual size_t GetTimeStampSize(const std::string& theMeshName, - const VISU::TEntity& theEntity, - const std::string& theFieldName, - int theStampsNum); + const VISU::TEntity& theEntity, + const std::string& theFieldName, + int theStampsNum); //! To fill intermeiate representation of TMeshOnEntity from a MED source virtual int LoadMeshOnEntity(VISU::PMeshImpl theMesh, - VISU::PMeshOnEntityImpl theMeshOnEntity) = 0; + VISU::PMeshOnEntityImpl theMeshOnEntity) = 0; //! To fill intermeiate representation of TFamily from a MED source virtual int LoadFamilyOnEntity(VISU::PMeshImpl theMesh, - VISU::PMeshOnEntityImpl theMeshOnEntity, - VISU::PFamilyImpl theFamily) = 0; + VISU::PMeshOnEntityImpl theMeshOnEntity, + VISU::PFamilyImpl theFamily) = 0; //! To fill intermeiate representation of TGroup from a MED source virtual int LoadMeshOnGroup(VISU::PMeshImpl theMesh, - const VISU::TFamilySet& theFamilySet) = 0; + const VISU::TFamilySet& theFamilySet) = 0; //! To fill intermeiate representation of TValForTime for ordinary mesh from a MED source virtual int LoadValForTimeOnMesh(VISU::PMeshImpl theMesh, - VISU::PMeshOnEntityImpl theMeshOnEntity, - VISU::PFieldImpl theField, - VISU::PValForTimeImpl theValForTime) = 0; + VISU::PMeshOnEntityImpl theMeshOnEntity, + VISU::PFieldImpl theField, + VISU::PValForTimeImpl theValForTime) = 0; //! To fill intermeiate representation of TValForTime for mesh on Gauss Points from a MED source virtual int LoadValForTimeOnGaussPts(VISU::PMeshImpl theMesh, - VISU::PMeshOnEntityImpl theMeshOnEntity, - VISU::PFieldImpl theField, - VISU::PValForTimeImpl theValForTime) = 0; + VISU::PMeshOnEntityImpl theMeshOnEntity, + VISU::PFieldImpl theField, + VISU::PValForTimeImpl theValForTime) = 0; }; #endif diff --git a/src/CONVERTOR/VISU_ElnoMeshValue.hxx b/src/CONVERTOR/VISU_ElnoMeshValue.hxx index 1e7c32f8..74d1732b 100644 --- a/src/CONVERTOR/VISU_ElnoMeshValue.hxx +++ b/src/CONVERTOR/VISU_ElnoMeshValue.hxx @@ -50,7 +50,7 @@ namespace VISU //---------------------------------------------------------------------------- TGetElnoNodeData( vtkDataArray *theElnoDataArray, - vtkDataArray *theElnoDataMapper ) + vtkDataArray *theElnoDataMapper ) : myElnoDataArray( TVTKDataArray::SafeDownCast( theElnoDataArray ) ) , myElnoDataMapper( vtkIntArray::SafeDownCast( theElnoDataMapper ) ) {} @@ -88,10 +88,10 @@ namespace VISU //---------------------------------------------------------------------------------------------- TSetElnoNodeData( vtkIdType theEffectNbComp, - vtkIdType theRealNbComp, - vtkIdType theNbTuples, - const char* theDataArrayName, - const char* theMapperArrayName ) + vtkIdType theRealNbComp, + vtkIdType theNbTuples, + const char* theDataArrayName, + const char* theMapperArrayName ) : myElnoDataArray( TVTKDataArray::New() ) , myElnoDataMapper( vtkIntArray::New() ) { @@ -126,7 +126,7 @@ namespace VISU TDataType* aDataPtr = myElnoDataArray->GetPointer( aPos ); for ( vtkIdType aCompId = 0; aCompId < myElemInfo[ 1 ]; aCompId++ ) - *aDataPtr++ = *theDataPtr++; + *aDataPtr++ = *theDataPtr++; return myElemInfo[ 2 ]++; } diff --git a/src/CONVERTOR/VISU_ExtractUnstructuredGrid.cxx b/src/CONVERTOR/VISU_ExtractUnstructuredGrid.cxx index b53ad25c..5559598f 100644 --- a/src/CONVERTOR/VISU_ExtractUnstructuredGrid.cxx +++ b/src/CONVERTOR/VISU_ExtractUnstructuredGrid.cxx @@ -60,8 +60,8 @@ void VISU_ExtractUnstructuredGrid::RemoveCellsWithType(vtkIdType theCellType){ namespace{ inline void InsertCell(vtkUnstructuredGrid *theInput, - vtkUnstructuredGrid *theOutput, - vtkIdType theCellId, vtkIdList *theCellIds) + vtkUnstructuredGrid *theOutput, + vtkIdType theCellId, vtkIdList *theCellIds) { theCellIds->Reset(); vtkCell *aCell = theInput->GetCell(theCellId); @@ -99,16 +99,16 @@ int VISU_ExtractUnstructuredGrid::RequestData( else if(!myRemovedCellIds.empty() && myRemovedCellTypes.empty()){ for(vtkIdType aCellId = 0; aCellId < aNbCells; aCellId++) if(myRemovedCellIds.find(aCellId) == myRemovedCellIds.end()) - InsertCell(anInput,anOutput,aCellId,aCellIds); + InsertCell(anInput,anOutput,aCellId,aCellIds); }else if(myRemovedCellIds.empty() && !myRemovedCellTypes.empty()){ for(vtkIdType aCellId = 0; aCellId < aNbCells; aCellId++) if(myRemovedCellTypes.find(anInput->GetCellType(aCellId)) == myRemovedCellTypes.end()) - InsertCell(anInput,anOutput,aCellId,aCellIds); + InsertCell(anInput,anOutput,aCellId,aCellIds); }else if(!myRemovedCellIds.empty() && !myRemovedCellTypes.empty()) for(vtkIdType aCellId = 0; aCellId < aNbCells; aCellId++) if(myRemovedCellTypes.find(anInput->GetCellType(aCellId)) == myRemovedCellTypes.end()) - if(myRemovedCellIds.find(aCellId) == myRemovedCellIds.end()) - InsertCell(anInput,anOutput,aCellId,aCellIds); + if(myRemovedCellIds.find(aCellId) == myRemovedCellIds.end()) + InsertCell(anInput,anOutput,aCellId,aCellIds); aCellIds->Delete(); anOutput->SetPoints(anInput->GetPoints()); MSG(MYDEBUG,"Execute - anOutput->GetNumberOfCells() = "<GetNumberOfCells()); diff --git a/src/CONVERTOR/VISU_GaussMergeFilter.cxx b/src/CONVERTOR/VISU_GaussMergeFilter.cxx index 0d76105a..cf380c81 100644 --- a/src/CONVERTOR/VISU_GaussMergeFilter.cxx +++ b/src/CONVERTOR/VISU_GaussMergeFilter.cxx @@ -203,18 +203,18 @@ VISU_GaussMergeFilter int VISU_GaussMergeFilter ::RequestData(vtkInformation *theRequest, - vtkInformationVector **theInputVector, - vtkInformationVector *theOutputVector) + vtkInformationVector **theInputVector, + vtkInformationVector *theOutputVector) { if(vtkUnstructuredGrid *anInput = dynamic_cast(this->GetInput())){ vtkPolyData *anOutput = dynamic_cast(this->GetOutput()); return ExecuteGauss(anInput, - anOutput); + anOutput); } return Superclass::RequestData(theRequest, - theInputVector, - theOutputVector); + theInputVector, + theOutputVector); } //---------------------------------------------------------------------------- @@ -226,8 +226,8 @@ VISU_GaussMergeFilter int VISU_GaussMergeFilter ::RequestUpdateExtent(vtkInformation *vtkNotUsed(request), - vtkInformationVector **inputVector, - vtkInformationVector *vtkNotUsed(outputVector)) + vtkInformationVector **inputVector, + vtkInformationVector *vtkNotUsed(outputVector)) { vtkInformation *inputInfo; int idx; @@ -290,7 +290,7 @@ VISU_GaussMergeFilter bool VISU_GaussMergeFilter ::ExecuteGauss(vtkUnstructuredGrid* theInput, - vtkPolyData* theOutput) + vtkPolyData* theOutput) { if(IsMergingInputs()){ vtkCellData *aCellData = theInput->GetCellData(); @@ -298,8 +298,8 @@ VISU_GaussMergeFilter vtkIntArray *aGeometryCellMapper = dynamic_cast(aCellMapper); vtkIntArray* aDataPointMapper = GetIDMapper(FieldList, - VISU::TGetPointData(), - "VISU_POINTS_MAPPER"); + VISU::TGetPointData(), + "VISU_POINTS_MAPPER"); vtkIntArray* aDataCellIds = vtkIntArray::New(); @@ -308,62 +308,62 @@ VISU_GaussMergeFilter aDataCellIds->SetNumberOfTuples(nbPoints); int* aDataCellPointer = aDataCellIds->GetPointer(0); { - int nbPoints = aDataPointMapper->GetNumberOfTuples(); - for(int i=0;iGetObjID(i); - vtkIdType aCellId = aGPID.first; - *aDataCellPointer = aCellId; - aDataCellPointer++; - *aDataCellPointer = 3; // it's a entity CELL - } + int nbPoints = aDataPointMapper->GetNumberOfTuples(); + for(int i=0;iGetObjID(i); + vtkIdType aCellId = aGPID.first; + *aDataCellPointer = aCellId; + aDataCellPointer++; + *aDataCellPointer = 3; // it's a entity CELL + } } /* vtkIntArray* anCellArr = GetIDMapper(FieldList, - VISU::TGetCellData(), - "VISU_CELLS_MAPPER"); + VISU::TGetCellData(), + "VISU_CELLS_MAPPER"); vtkIntArray* anPMArr = GetIDMapper(FieldList, - VISU::TGetPointData(), - "VISU_POINTS_MAPPER"); + VISU::TGetPointData(), + "VISU_POINTS_MAPPER"); vtkDataArray* anFArr = GetIDMapper(FieldList, - VISU::TGetPointData(), - "VISU_FIELD"); + VISU::TGetPointData(), + "VISU_FIELD"); */ if(VISU::IsDifferent(aDataCellIds, aGeometryCellMapper)){ - VISU::TObjectIdArray anIntersection; - VISU::GetIntersection(aDataCellIds, - aGeometryCellMapper, - anIntersection); + VISU::TObjectIdArray anIntersection; + VISU::GetIntersection(aDataCellIds, + aGeometryCellMapper, + anIntersection); VISU::TObjectId2TupleGaussIdMap aDataCellId2TupleGaussIdMap; - VISU::GetObjectId2TupleGaussIdArray(aDataCellIds, aDataCellId2TupleGaussIdMap); + VISU::GetObjectId2TupleGaussIdArray(aDataCellIds, aDataCellId2TupleGaussIdMap); vtkIdType aNbTuples = 0; for(vtkIdType i = 0;i < anIntersection.size();i++) aNbTuples += aDataCellId2TupleGaussIdMap[anIntersection[i].first].size(); - - vtkPointSet* aScalarsDataSet = dynamic_cast(GetScalars()); - vtkPoints* aDataPoints = aScalarsDataSet->GetPoints(); - vtkPoints* anOutputPoints = vtkPoints::New(aDataPoints->GetDataType()); - - anOutputPoints->SetNumberOfPoints(aNbTuples); - theOutput->SetPoints(anOutputPoints); - anOutputPoints->Delete(); - - vtkCellData* anInputCellData = aScalarsDataSet->GetCellData(); - vtkPointData* anInputPointData = aScalarsDataSet->GetPointData(); - - theOutput->Allocate(aNbTuples); - vtkCellData* anOutputCellData = theOutput->GetCellData(); - vtkPointData* anOutputPointData = theOutput->GetPointData(); - - anOutputCellData->CopyAllocate(anInputCellData,aNbTuples); - anOutputPointData->CopyAllocate(anInputPointData,aNbTuples); - - vtkIdList *aCellIds = vtkIdList::New(); - vtkFloatingPointType aCoords[3]; - for(int aTupleId=0, aNewTupleId=0; aTupleId(GetScalars()); + vtkPoints* aDataPoints = aScalarsDataSet->GetPoints(); + vtkPoints* anOutputPoints = vtkPoints::New(aDataPoints->GetDataType()); + + anOutputPoints->SetNumberOfPoints(aNbTuples); + theOutput->SetPoints(anOutputPoints); + anOutputPoints->Delete(); + + vtkCellData* anInputCellData = aScalarsDataSet->GetCellData(); + vtkPointData* anInputPointData = aScalarsDataSet->GetPointData(); + + theOutput->Allocate(aNbTuples); + vtkCellData* anOutputCellData = theOutput->GetCellData(); + vtkPointData* anOutputPointData = theOutput->GetPointData(); + + anOutputCellData->CopyAllocate(anInputCellData,aNbTuples); + anOutputPointData->CopyAllocate(anInputPointData,aNbTuples); + + vtkIdList *aCellIds = vtkIdList::New(); + vtkFloatingPointType aCoords[3]; + for(int aTupleId=0, aNewTupleId=0; aTupleIdReset(); aCellIds->InsertNextId(aNewTupleId); aNewTupleId++; - + vtkIdType aCellType = GetScalars()->GetCellType(aCellId); vtkIdType aNewCellId = theOutput->InsertNextCell(aCellType, aCellIds); - + anOutputCellData->CopyData(anInputCellData, aCellId, aNewCellId); anOutputPointData->CopyData(anInputPointData, aCellId, aNewCellId); aDataPoints->GetPoint(aCellId, aCoords); anOutputPoints->SetPoint(aNewCellId, aCoords); } - } + } } } } diff --git a/src/CONVERTOR/VISU_GaussMergeFilter.hxx b/src/CONVERTOR/VISU_GaussMergeFilter.hxx index d47ef519..21bc0305 100644 --- a/src/CONVERTOR/VISU_GaussMergeFilter.hxx +++ b/src/CONVERTOR/VISU_GaussMergeFilter.hxx @@ -125,7 +125,7 @@ protected: bool ExecuteGauss(vtkUnstructuredGrid* theInput, - vtkPolyData* theOutput); + vtkPolyData* theOutput); private: VISU_GaussMergeFilter(const VISU_GaussMergeFilter&); // Not implemented. diff --git a/src/CONVERTOR/VISU_IDMapper.cxx b/src/CONVERTOR/VISU_IDMapper.cxx index c40ede51..dac794bc 100644 --- a/src/CONVERTOR/VISU_IDMapper.cxx +++ b/src/CONVERTOR/VISU_IDMapper.cxx @@ -105,7 +105,7 @@ namespace VISU if ( IsStructured() ) { TObj2StructuredId::const_iterator aIter = myObj2StructuredId.find( theNodeId ); if ( aIter != myObj2StructuredId.end() ) - return aIter->second; + return aIter->second; } return TStructuredId(); @@ -118,7 +118,7 @@ namespace VISU TObj2StructuredId::const_iterator aIter = myObj2StructuredId.begin(); for (; aIter != myObj2StructuredId.end(); aIter++ ) { if ( theVec == aIter->second ) - return aIter->first; + return aIter->first; } return -1; diff --git a/src/CONVERTOR/VISU_MedConvertor.cxx b/src/CONVERTOR/VISU_MedConvertor.cxx index 4beb4133..46155e84 100644 --- a/src/CONVERTOR/VISU_MedConvertor.cxx +++ b/src/CONVERTOR/VISU_MedConvertor.cxx @@ -186,11 +186,11 @@ namespace //--------------------------------------------------------------- VISU::PMEDSubProfile CrSubProfile(const MED::PWrapper& theMEDWrapper, - const MED::PMeshInfo& theMeshInfo, - MED::EEntiteMaillage theMEntity, - MED::EGeometrieElement theMGeom, - const MED::TGeom2Size& theGeom2Size, - const MED::TGeom2Profile& theGeom2Profile) + const MED::PMeshInfo& theMeshInfo, + MED::EEntiteMaillage theMEntity, + MED::EGeometrieElement theMGeom, + const MED::TGeom2Size& theGeom2Size, + const MED::TGeom2Profile& theGeom2Profile) { VISU::EGeometry aEGeom = MEDGeom2VISU(theMGeom); vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom); @@ -206,87 +206,87 @@ namespace else{ MED::TGeom2Profile::const_iterator aProfileIter = theGeom2Profile.find(theMGeom); if(aProfileIter != theGeom2Profile.end()){ - MED::PProfileInfo aProfileInfo = aProfileIter->second; - - aSubProfile->myName = aProfileInfo->GetName(); - aSubProfile->myStatus = VISU::eAddPart; - - const MED::TElemNum& anElemNum = aProfileInfo->myElemNum; - TInt aNbElem = anElemNum.size(); - aSubProfile->myNbCells = aNbElem; - switch(theMGeom){ - case MED::ePOLYGONE: { - MED::PPolygoneInfo aPolygoneInfo = - theMEDWrapper->GetPPolygoneInfo(theMeshInfo,theMEntity,theMGeom); - for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){ - TInt aNbConn = aPolygoneInfo->GetNbConn( anElemNum[ anElemId ] - 1 ); - aSubProfile->myCellsSize += aNbConn; - } - break; - } - case MED::ePOLYEDRE: { - MED::PPolyedreInfo aPolyedreInfo = - theMEDWrapper->GetPPolyedreInfo(theMeshInfo,theMEntity,theMGeom); - for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){ - MED::TCConnSliceArr aConnSliceArr = - aPolyedreInfo->GetConnSliceArr( anElemNum[ anElemId ] - 1 ); - TInt aNbFaces = aConnSliceArr.size(); - TInt aCellSize = 0; - for(TInt iFace = 0; iFace < aNbFaces; iFace++){ - MED::TCConnSlice aConnSlice = aConnSliceArr[iFace]; - TInt aNbConn = aConnSlice.size(); - aCellSize += aNbConn; - } - aSubProfile->myCellsSize += aCellSize; - } - break; - } - default: { - aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes; - }} + MED::PProfileInfo aProfileInfo = aProfileIter->second; + + aSubProfile->myName = aProfileInfo->GetName(); + aSubProfile->myStatus = VISU::eAddPart; + + const MED::TElemNum& anElemNum = aProfileInfo->myElemNum; + TInt aNbElem = anElemNum.size(); + aSubProfile->myNbCells = aNbElem; + switch(theMGeom){ + case MED::ePOLYGONE: { + MED::PPolygoneInfo aPolygoneInfo = + theMEDWrapper->GetPPolygoneInfo(theMeshInfo,theMEntity,theMGeom); + for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){ + TInt aNbConn = aPolygoneInfo->GetNbConn( anElemNum[ anElemId ] - 1 ); + aSubProfile->myCellsSize += aNbConn; + } + break; + } + case MED::ePOLYEDRE: { + MED::PPolyedreInfo aPolyedreInfo = + theMEDWrapper->GetPPolyedreInfo(theMeshInfo,theMEntity,theMGeom); + for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){ + MED::TCConnSliceArr aConnSliceArr = + aPolyedreInfo->GetConnSliceArr( anElemNum[ anElemId ] - 1 ); + TInt aNbFaces = aConnSliceArr.size(); + TInt aCellSize = 0; + for(TInt iFace = 0; iFace < aNbFaces; iFace++){ + MED::TCConnSlice aConnSlice = aConnSliceArr[iFace]; + TInt aNbConn = aConnSlice.size(); + aCellSize += aNbConn; + } + aSubProfile->myCellsSize += aCellSize; + } + break; + } + default: { + aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes; + }} }else{ - TInt aNbElem = aTimeStampIter->second; - aSubProfile->myNbCells = aNbElem; - switch(theMGeom){ - case MED::ePOLYGONE: { - MED::PPolygoneInfo aPolygoneInfo = - theMEDWrapper->GetPPolygoneInfo(theMeshInfo,theMEntity,theMGeom); - for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){ - TInt aNbConn = aPolygoneInfo->GetNbConn(anElemId); - aSubProfile->myCellsSize += aNbConn; - } - break; - } - case MED::ePOLYEDRE: { - MED::PPolyedreInfo aPolyedreInfo = - theMEDWrapper->GetPPolyedreInfo(theMeshInfo,theMEntity,theMGeom); - for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){ - MED::TCConnSliceArr aConnSliceArr = - aPolyedreInfo->GetConnSliceArr(anElemId); - TInt aNbFaces = aConnSliceArr.size(); - TInt aCellSize = 0; - for(TInt iFace = 0; iFace < aNbFaces; iFace++){ - MED::TCConnSlice aConnSlice = aConnSliceArr[iFace]; - TInt aNbConn = aConnSlice.size(); - aCellSize += aNbConn; - } - aSubProfile->myCellsSize += aCellSize; - } - break; - } - default: { - aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes; - }} + TInt aNbElem = aTimeStampIter->second; + aSubProfile->myNbCells = aNbElem; + switch(theMGeom){ + case MED::ePOLYGONE: { + MED::PPolygoneInfo aPolygoneInfo = + theMEDWrapper->GetPPolygoneInfo(theMeshInfo,theMEntity,theMGeom); + for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){ + TInt aNbConn = aPolygoneInfo->GetNbConn(anElemId); + aSubProfile->myCellsSize += aNbConn; + } + break; + } + case MED::ePOLYEDRE: { + MED::PPolyedreInfo aPolyedreInfo = + theMEDWrapper->GetPPolyedreInfo(theMeshInfo,theMEntity,theMGeom); + for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){ + MED::TCConnSliceArr aConnSliceArr = + aPolyedreInfo->GetConnSliceArr(anElemId); + TInt aNbFaces = aConnSliceArr.size(); + TInt aCellSize = 0; + for(TInt iFace = 0; iFace < aNbFaces; iFace++){ + MED::TCConnSlice aConnSlice = aConnSliceArr[iFace]; + TInt aNbConn = aConnSlice.size(); + aCellSize += aNbConn; + } + aSubProfile->myCellsSize += aCellSize; + } + break; + } + default: { + aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes; + }} } } INITMSG(MYDEBUG, - "- aMGeom = "<first; VISU::PSubProfile aSubProfile = CrSubProfile(theMEDWrapper, - theMeshInfo, - theMEntity, - aMGeom, - theGeom2Size, - aGeom2Profile); + theMeshInfo, + theMEntity, + aMGeom, + theGeom2Size, + aGeom2Profile); aProfileKey.insert(aSubProfile); } @@ -326,12 +326,12 @@ namespace //--------------------------------------------------------------- void InitProfile(const MED::PWrapper& theMEDWrapper, - const MED::PMeshInfo& theMeshInfo, - MED::PTimeStampValueBase& theTimeStampValue, - VISU::TMEDMeshOnEntity& theMeshOnEntity, - MED::EEntiteMaillage theMEntity, - const MED::TGeom2Size& theGeom2Size, - VISU::TMEDValForTime& theValForTime) + const MED::PMeshInfo& theMeshInfo, + MED::PTimeStampValueBase& theTimeStampValue, + VISU::TMEDMeshOnEntity& theMeshOnEntity, + MED::EEntiteMaillage theMEntity, + const MED::TGeom2Size& theGeom2Size, + VISU::TMEDValForTime& theValForTime) { VISU::TTimerLog aTimerLog(MYDEBUG,"InitProfile"); INITMSG(MYDEBUG,"InitProfile"<myIsAll && aSubProfile->myStatus != VISU::eAddAll) - aProfile->myIsAll = false; + if(aProfile->myIsAll && aSubProfile->myStatus != VISU::eAddAll) + aProfile->myIsAll = false; - VISU::EGeometry aEGeom = aSubProfile->myGeom; - aGeom2SubProfile[aEGeom] = aSubProfile; + VISU::EGeometry aEGeom = aSubProfile->myGeom; + aGeom2SubProfile[aEGeom] = aSubProfile; } aProfileMap[aProfileKey] = aProfile; @@ -373,9 +373,9 @@ namespace //--------------------------------------------------------------- VISU::TGaussKey GetGaussKey(const MED::PTimeStampValueBase& theTimeStampValue, - const VISU::TMEDMeshOnEntity& theMeshOnEntity, - const MED::TGeom2Size& theGeom2Size, - VISU::TMEDValForTime& theValForTime) + const VISU::TMEDMeshOnEntity& theMeshOnEntity, + const MED::TGeom2Size& theGeom2Size, + VISU::TMEDValForTime& theValForTime) { VISU::TTimerLog aTimerLog(MYDEBUG,"GetGaussKey"); INITMSG(MYDEBUG,"GetGaussKey"<second; MED::TGeom2Size::const_iterator aTimeStampIter = theGeom2Size.find(aMGeom); if(aTimeStampIter != theGeom2Size.end()){ - TInt aNbCells = aTimeStampIter->second; - if(aSubProfile->myStatus == VISU::eAddPart) - aNbCells = aSubProfile->myNbCells; - - VISU::PMEDGaussSubMesh aGaussSubMesh(new VISU::TMEDGaussSubMesh()); - aGaussSubMesh->mySubProfile = aSubProfile; - aGaussSubMesh->myStatus = aSubProfile->myStatus; - - VISU::PMEDGauss aGauss(new VISU::TMEDGauss()); - aGaussSubMesh->myGauss = aGauss; - aGauss->myGeom = aEGeom; - aGauss->myNbPoints = 1; - - MED::TGeom2Gauss::const_iterator aGaussIter = aGeom2Gauss.find(aMGeom); - if(aGaussIter != aGeom2Gauss.end()){ - MED::PGaussInfo aGaussInfo = aGaussIter->second; - aGauss->myGaussInfo = aGaussInfo; - aGauss->myName = aGaussInfo->GetName(); - aGauss->myNbPoints = aGaussInfo->GetNbGauss(); - } else if ( aTimeStampInfo.GetNbGauss(aMGeom) > 1 ) - EXCEPTION( std::runtime_error, "aGaussIter == aGeom2Gauss.end()" - " && aTimeStampInfo.GetNbGauss(aMGeom) > 1 !!!" ); - - aGaussSubMesh->myNbCells = aNbCells*aGauss->myNbPoints; - aGaussSubMesh->myCellsSize = aGaussSubMesh->myNbCells*2; - - aGaussKey.insert(aGaussSubMesh); - - INITMSGA(MYDEBUG,0, - "- aEGeom = "<myGeom<< - "; aName = '"<myName<<"'"<< - "; aNbGauss = "<myNbPoints<< - "; aStatus = "<myStatus<< - "; aNbCells = "<myNbCells<< - "; aCellsSize = "<myCellsSize<< - endl); - - //break; + TInt aNbCells = aTimeStampIter->second; + if(aSubProfile->myStatus == VISU::eAddPart) + aNbCells = aSubProfile->myNbCells; + + VISU::PMEDGaussSubMesh aGaussSubMesh(new VISU::TMEDGaussSubMesh()); + aGaussSubMesh->mySubProfile = aSubProfile; + aGaussSubMesh->myStatus = aSubProfile->myStatus; + + VISU::PMEDGauss aGauss(new VISU::TMEDGauss()); + aGaussSubMesh->myGauss = aGauss; + aGauss->myGeom = aEGeom; + aGauss->myNbPoints = 1; + + MED::TGeom2Gauss::const_iterator aGaussIter = aGeom2Gauss.find(aMGeom); + if(aGaussIter != aGeom2Gauss.end()){ + MED::PGaussInfo aGaussInfo = aGaussIter->second; + aGauss->myGaussInfo = aGaussInfo; + aGauss->myName = aGaussInfo->GetName(); + aGauss->myNbPoints = aGaussInfo->GetNbGauss(); + } else if ( aTimeStampInfo.GetNbGauss(aMGeom) > 1 ) + EXCEPTION( std::runtime_error, "aGaussIter == aGeom2Gauss.end()" + " && aTimeStampInfo.GetNbGauss(aMGeom) > 1 !!!" ); + + aGaussSubMesh->myNbCells = aNbCells*aGauss->myNbPoints; + aGaussSubMesh->myCellsSize = aGaussSubMesh->myNbCells*2; + + aGaussKey.insert(aGaussSubMesh); + + INITMSGA(MYDEBUG,0, + "- aEGeom = "<myGeom<< + "; aName = '"<myName<<"'"<< + "; aNbGauss = "<myNbPoints<< + "; aStatus = "<myStatus<< + "; aNbCells = "<myNbCells<< + "; aCellsSize = "<myCellsSize<< + endl); + + //break; } } @@ -450,9 +450,9 @@ namespace //--------------------------------------------------------------- void InitGaussMesh(MED::PTimeStampValueBase& theTimeStampValue, - VISU::TMEDMeshOnEntity& theMeshOnEntity, - const MED::TGeom2Size& theGeom2Size, - VISU::TMEDValForTime& theValForTime) + VISU::TMEDMeshOnEntity& theMeshOnEntity, + const MED::TGeom2Size& theGeom2Size, + VISU::TMEDValForTime& theValForTime) { VISU::TTimerLog aTimerLog(MYDEBUG,"InitGaussMesh"); INITMSG(MYDEBUG,"InitGaussMesh"<myGeom2GaussSubMesh; { - VISU::TGaussKey::const_iterator anIter = aGaussKey.begin(); - for(; anIter != aGaussKey.end(); anIter++){ - VISU::PMEDGaussSubMesh aGaussSubMesh(*anIter); - VISU::PMEDGauss aGauss = aGaussSubMesh->myGauss; - VISU::EGeometry aEGeom = aGauss->myGeom; - aGeom2GaussSubMesh[aEGeom] = aGaussSubMesh; - } + VISU::TGaussKey::const_iterator anIter = aGaussKey.begin(); + for(; anIter != aGaussKey.end(); anIter++){ + VISU::PMEDGaussSubMesh aGaussSubMesh(*anIter); + VISU::PMEDGauss aGauss = aGaussSubMesh->myGauss; + VISU::EGeometry aEGeom = aGauss->myGeom; + aGeom2GaussSubMesh[aEGeom] = aGaussSubMesh; + } } { - VISU::TGaussSubMeshArr& aGaussSubMeshArr = aGaussMesh->myGaussSubMeshArr; - aGaussSubMeshArr.resize(aGeom2GaussSubMesh.size()); - VISU::TGeom2GaussSubMesh::const_iterator anIter = aGeom2GaussSubMesh.begin(); - for(TInt anID = 0; anIter != aGeom2GaussSubMesh.end(); anIter++, anID++){ - const VISU::PGaussSubMeshImpl& aGaussSubMesh = anIter->second; - aGaussSubMeshArr[anID] = aGaussSubMesh; - } + VISU::TGaussSubMeshArr& aGaussSubMeshArr = aGaussMesh->myGaussSubMeshArr; + aGaussSubMeshArr.resize(aGeom2GaussSubMesh.size()); + VISU::TGeom2GaussSubMesh::const_iterator anIter = aGeom2GaussSubMesh.begin(); + for(TInt anID = 0; anIter != aGeom2GaussSubMesh.end(); anIter++, anID++){ + const VISU::PGaussSubMeshImpl& aGaussSubMesh = anIter->second; + aGaussSubMeshArr[anID] = aGaussSubMesh; + } } INITMSG(MYDEBUG,"aGaussMeshMap[aGaussKey] = aGaussMesh"<myEntity = aVEntity; aMeshOnEntity->myMeshName = aMeshName; aMeshOnEntity->myGeom2Size = aGeom2Size; @@ -526,107 +526,107 @@ namespace VISU::TGeom2ElemID2FamilyID& aGeom2ElemID2FamilyID = aMeshOnEntity->myGeom2ElemID2FamilyID; INITMSG(MYDEBUG, - "- aMEntity = "<myGrilleStructure; if ( theGrilleInfo->GetGrilleType() != MED::eGRILLE_STANDARD ) for ( int aDimId = 0; aDimId < theMesh->myDim; aDimId++ ) - aGrilleStructure[aDimId] = theGrilleInfo->GetNbIndexes(aDimId); + aGrilleStructure[aDimId] = theGrilleInfo->GetNbIndexes(aDimId); else { MED::TIntVector aVector = theGrilleInfo->GetGrilleStructure(); for ( int aDimId = 0; aDimId < aVector.size(); aDimId++ ) - aGrilleStructure[aDimId] = aVector[aDimId]; + aGrilleStructure[aDimId] = aVector[aDimId]; } int kMax = aGrilleStructure[2]; @@ -665,25 +665,25 @@ namespace switch ( theMesh->myDim ) { case 1: for ( int i = 1; i <= iMax; i++ ) - aObj2StructuredId[i-1][0] = i; + aObj2StructuredId[i-1][0] = i; break; case 2: for ( int j = 1; j <= jMax; j++ ) - for ( int i = 1; i <= iMax; i++ ) { - aObj2StructuredId[iii][0] = i; - aObj2StructuredId[iii][1] = j; - iii++; - } + for ( int i = 1; i <= iMax; i++ ) { + aObj2StructuredId[iii][0] = i; + aObj2StructuredId[iii][1] = j; + iii++; + } break; case 3: for ( int k = 1; k <= kMax; k++ ) - for ( int j = 1; j <= jMax; j++ ) - for ( int i = 1; i <= iMax; i++ ) { - aObj2StructuredId[iii][0] = i; - aObj2StructuredId[iii][1] = j; - aObj2StructuredId[iii][2] = k; - iii++; - } + for ( int j = 1; j <= jMax; j++ ) + for ( int i = 1; i <= iMax; i++ ) { + aObj2StructuredId[iii][0] = i; + aObj2StructuredId[iii][1] = j; + aObj2StructuredId[iii][2] = k; + iii++; + } } for(; anEntityIter != theEntityInfo.end(); anEntityIter++){ @@ -692,7 +692,7 @@ namespace VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity); VISU::PMEDMeshOnEntity aMeshOnEntity = - aMeshOnEntityMap[aVEntity](new VISU::TMEDMeshOnEntity()); + aMeshOnEntityMap[aVEntity](new VISU::TMEDMeshOnEntity()); aMeshOnEntity->myEntity = aVEntity; aMeshOnEntity->myMeshName = aMeshName; aMeshOnEntity->myGeom2Size = aGeom2Size; @@ -700,58 +700,58 @@ namespace VISU::TGeom2ElemID2FamilyID& aGeom2ElemID2FamilyID = aMeshOnEntity->myGeom2ElemID2FamilyID; INITMSG(MYDEBUG, - "- aMEntity = "<GetNbFields(); @@ -774,7 +774,7 @@ namespace MED::TErr anError = 0; MED::PFieldInfo aFieldInfo = theMEDWrapper->GetPFieldInfo(aMeshInfo, iField, &anError); if ( anError < 0 ) - continue; + continue; TInt aNbComp = aFieldInfo->GetNbComp(); std::string aFieldName = aFieldInfo->GetName(); @@ -782,19 +782,19 @@ namespace MED::TGeom2Size aGeom2Size; MED::EEntiteMaillage aMEntity; TInt aNbTimeStamps = theMEDWrapper->GetNbTimeStamps(aFieldInfo, - theEntityInfo, - aMEntity, - aGeom2Size); + theEntityInfo, + aMEntity, + aGeom2Size); if(aNbTimeStamps < 1) - continue; + continue; VISU::TEntity aVEntity = MEDEntityToVTK( aMEntity ); vtkIdType aDataType = VTK_DOUBLE; if ( aFieldInfo->GetType() != MED::eFLOAT64 ) { #if defined(HAVE_F77INT64) - aDataType = VTK_LONG; -#else - aDataType = VTK_INT; + aDataType = VTK_LONG; +#else + aDataType = VTK_INT; #endif } VISU::PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[aVEntity]; @@ -809,53 +809,53 @@ namespace aField->myIsELNO = ( aMEntity == MED::eNOEUD_ELEMENT ); INITMSG(MYDEBUG,"myName = '"<myName<<"'"<< - "; myId = "<myId<< - "; myEntity = "<myEntity<< - "; myDataSize = "<myDataSize<< - "; myNbComp = "<myNbComp<<"\n"); + "; myId = "<myId<< + "; myEntity = "<myEntity<< + "; myDataSize = "<myDataSize<< + "; myNbComp = "<myNbComp<<"\n"); for(TInt iComp = 0; iComp < aNbComp; iComp++){ - aField->myCompNames[iComp] = aFieldInfo->GetCompName(iComp); - aField->myUnitNames[iComp] = aFieldInfo->GetUnitName(iComp); + aField->myCompNames[iComp] = aFieldInfo->GetCompName(iComp); + aField->myUnitNames[iComp] = aFieldInfo->GetUnitName(iComp); } for(TInt iTimeStamp = 1; iTimeStamp <= aNbTimeStamps; iTimeStamp++){ - VISU::TTimerLog aTimerLog(MYDEBUG,"GetPTimeStampInfo"); - - MED::TErr anError = 0; - MED::PTimeStampInfo aTimeStampInfo = theMEDWrapper->GetPTimeStampInfo(aFieldInfo, - aMEntity, - aGeom2Size, - iTimeStamp, - &anError); - if ( anError < 0 ) - continue; - - TFloat aDt = aTimeStampInfo->GetDt(); - std::string anUnitDt = aTimeStampInfo->GetUnitDt(); - - VISU::TValField& aValField = aField->myValField; - VISU::PMEDValForTime aValForTime = aValField[iTimeStamp](new VISU::TMEDValForTime()); - aValForTime->myId = iTimeStamp; - aValForTime->myFieldName = aField->myName; - aValForTime->myEntity = aField->myEntity; - aValForTime->myMeshName = aField->myMeshName; - aValForTime->myTime = VISU::TTime(aDt,anUnitDt); - INITMSG(MYDEBUG,"aDt = '"<myGeom2NbGauss; - const MED::TGeom2NbGauss& aMGeom2NbGauss = aTimeStampInfo->myGeom2NbGauss; - MED::TGeom2NbGauss::const_iterator anIter = aMGeom2NbGauss.begin(); - for(; anIter != aMGeom2NbGauss.end(); anIter++){ - const MED::EGeometrieElement& aMGeom = anIter->first; - VISU::EGeometry aEGeom = MEDGeom2VISU( aMGeom ); - TInt aNbGauss = anIter->second; - aVGeom2NbGauss[ aEGeom ] = aNbGauss; - - // ELNO data should satisfy the following condition ( implicitly ) - vtkIdType aNbNodes = MEDGeom2NbNodes( aMGeom ); - aField->myIsELNO &= ( aNbGauss == aNbNodes ); - } + VISU::TTimerLog aTimerLog(MYDEBUG,"GetPTimeStampInfo"); + + MED::TErr anError = 0; + MED::PTimeStampInfo aTimeStampInfo = theMEDWrapper->GetPTimeStampInfo(aFieldInfo, + aMEntity, + aGeom2Size, + iTimeStamp, + &anError); + if ( anError < 0 ) + continue; + + TFloat aDt = aTimeStampInfo->GetDt(); + std::string anUnitDt = aTimeStampInfo->GetUnitDt(); + + VISU::TValField& aValField = aField->myValField; + VISU::PMEDValForTime aValForTime = aValField[iTimeStamp](new VISU::TMEDValForTime()); + aValForTime->myId = iTimeStamp; + aValForTime->myFieldName = aField->myName; + aValForTime->myEntity = aField->myEntity; + aValForTime->myMeshName = aField->myMeshName; + aValForTime->myTime = VISU::TTime(aDt,anUnitDt); + INITMSG(MYDEBUG,"aDt = '"<myGeom2NbGauss; + const MED::TGeom2NbGauss& aMGeom2NbGauss = aTimeStampInfo->myGeom2NbGauss; + MED::TGeom2NbGauss::const_iterator anIter = aMGeom2NbGauss.begin(); + for(; anIter != aMGeom2NbGauss.end(); anIter++){ + const MED::EGeometrieElement& aMGeom = anIter->first; + VISU::EGeometry aEGeom = MEDGeom2VISU( aMGeom ); + TInt aNbGauss = anIter->second; + aVGeom2NbGauss[ aEGeom ] = aNbGauss; + + // ELNO data should satisfy the following condition ( implicitly ) + vtkIdType aNbNodes = MEDGeom2NbNodes( aMGeom ); + aField->myIsELNO &= ( aNbGauss == aNbNodes ); + } } } } @@ -864,10 +864,10 @@ namespace //--------------------------------------------------------------- void BuildFamilyMap(VISU::PMEDMesh theMesh, - const MED::TEntityInfo& theEntityInfo, - const MED::TEntity2TGeom2ElemInfo& theEntity2TGeom2ElemInfo, - const MED::TFamilyInfoSet& theFamilyInfoSet, - MED::PWrapper theMEDWrapper) + const MED::TEntityInfo& theEntityInfo, + const MED::TEntity2TGeom2ElemInfo& theEntity2TGeom2ElemInfo, + const MED::TFamilyInfoSet& theFamilyInfoSet, + MED::PWrapper theMEDWrapper) { VISU::TTimerLog aTimerLog(MYDEBUG,"BuildFamilyMap"); INITMSG(MYDEBUG,"BuildFamilyMap\n"); @@ -884,61 +884,61 @@ namespace const VISU::TFamilyID2CellsSize& aFamilyID2CellsSize = aMeshOnEntity->myFamilyID2CellsSize; VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap; VISU::TFamilyIDMap& aFamilyIDMap = aMeshOnEntity->myFamilyIDMap; - + if(aFamilyTSizeSet.empty()) - continue; - + continue; + INITMSG(MY_FAMILY_DEBUG, - "- aMEntity = "<(aFamilyTSize); + TInt aSize = boost::get<1>(aFamilyTSize); + TInt anId = aFamilyInfo->GetId(); + if(anId == 0) + continue; + + std::string aFamilyName = aFamilyInfo->GetName(); + + VISU::PMEDFamily aFamily = aFamilyMap[aFamilyName](new VISU::TMEDFamily()); + aFamily->myId = anId; + aFamily->myEntity = aVEntity; + aFamily->myName = aFamilyName; + aFamily->myNbCells = aSize; + + aFamily->myCellsSize = 0; + VISU::TFamilyID2CellsSize::const_iterator anIter = aFamilyID2CellsSize.find(anId); + if(anIter != aFamilyID2CellsSize.end()) + aFamily->myCellsSize = anIter->second; + + const TInt aNbGroup = aFamilyInfo->GetNbGroup(); + VISU::TNames& aGroupNames = aFamily->myGroupNames; + aGroupNames.resize(aNbGroup); + for(TInt i = 0; i < aNbGroup; i++){ + std::string aGroupName = aFamilyInfo->GetGroupName(i); + aGroupNames[i] = aGroupName; + } + + aFamilyIDMap[anId] = aFamily; + + INITMSG(MY_FAMILY_DEBUG, + "- aFamilyName = '"<GetId(); if(anId == 0) - continue; + continue; std::string aFamilyName = aFamilyInfo->GetName(); const MED::EEntiteMaillage& aMEntity = MED::GetEntityByFamilyId(aGrilleInfo, - anId); + anId); VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity); VISU::PMEDMeshOnEntity aMeshOnEntity; VISU::TMeshOnEntityMap::iterator aMeshOnEntityIter = aMeshOnEntityMap.find(aVEntity); if(aMeshOnEntityIter != aMeshOnEntityMap.end()) - aMeshOnEntity = aMeshOnEntityIter->second; + aMeshOnEntity = aMeshOnEntityIter->second; VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap; VISU::TFamilyIDMap& aFamilyIDMap = aMeshOnEntity->myFamilyIDMap; @@ -998,30 +998,30 @@ namespace const VISU::TFamilyID2CellsSize& aFamilyID2CellsSize = aMeshOnEntity->myFamilyID2CellsSize; VISU::TFamilyID2CellsSize::const_iterator aFamilyid2CellsSizeIter = aFamilyID2CellsSize.find(anId); if(aFamilyid2CellsSizeIter != (aMeshOnEntity->myFamilyID2CellsSize).end()) - aFamily->myCellsSize = aFamilyid2CellsSizeIter->second; + aFamily->myCellsSize = aFamilyid2CellsSizeIter->second; MED::TFamilyID2NbCells::const_iterator aFam2NbCellsIter = aFam2NbCells.find(anId); if(aFam2NbCellsIter != aFam2NbCells.end()) - aFamily->myNbCells = aFam2NbCellsIter->second; + aFamily->myNbCells = aFam2NbCellsIter->second; const TInt aNbGroup = aFamilyInfo->GetNbGroup(); VISU::TNames& aGroupNames = aFamily->myGroupNames; aGroupNames.resize(aNbGroup); for(TInt i = 0; i < aNbGroup; i++){ - std::string aGroupName = aFamilyInfo->GetGroupName(i); - aGroupNames[i] = aGroupName; + std::string aGroupName = aFamilyInfo->GetGroupName(i); + aGroupNames[i] = aGroupName; } aFamilyIDMap[anId] = aFamily; INITMSG(MY_FAMILY_DEBUG, - "- aFamilyName =|"<myName<<"|" - << "; myId = "<myId - << "; aNbAttr = "<GetNbAttr() - << "; aNbGroup = "<GetNbGroup() - << "; aVEntity = "<myName<<"|" + << "; myId = "<myId + << "; aNbAttr = "<GetNbAttr() + << "; aNbGroup = "<GetNbGroup() + << "; aVEntity = "<second; MED::TFamilyInfoSet::const_iterator aFamilyIter = aFamilyInfoSet.begin(); for(; aFamilyIter != aFamilyInfoSet.end(); aFamilyIter++){ - const MED::PFamilyInfo& aFamilyInfo = *aFamilyIter; - std::string aFamilyName = aFamilyInfo->GetName(); - - VISU::TEntity aVEntity = VISU::TEntity(-1); - VISU::PMEDFamily aFamily; - - // Find aVisuEntity - const VISU::TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap; - VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityIter = aMeshOnEntityMap.begin(); - for(; aMeshOnEntityIter != aMeshOnEntityMap.end(); aMeshOnEntityIter++){ - const VISU::PMeshOnEntity& aMeshOnEntity = aMeshOnEntityIter->second; - const VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap; - VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin(); - for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){ - const std::string& aName = aFamilyMapIter->first; - if(aName == aFamilyName){ + const MED::PFamilyInfo& aFamilyInfo = *aFamilyIter; + std::string aFamilyName = aFamilyInfo->GetName(); + + VISU::TEntity aVEntity = VISU::TEntity(-1); + VISU::PMEDFamily aFamily; + + // Find aVisuEntity + const VISU::TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap; + VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityIter = aMeshOnEntityMap.begin(); + for(; aMeshOnEntityIter != aMeshOnEntityMap.end(); aMeshOnEntityIter++){ + const VISU::PMeshOnEntity& aMeshOnEntity = aMeshOnEntityIter->second; + const VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap; + VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin(); + for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){ + const std::string& aName = aFamilyMapIter->first; + if(aName == aFamilyName){ aFamily = aFamilyMapIter->second; - aVEntity = aFamily->myEntity; - goto exit_lable; - } - } - } + aVEntity = aFamily->myEntity; + goto exit_lable; + } + } + } exit_lable: - if(aFamily && aVEntity >= 0){ - aFamilySet.insert(aFamily); - INITMSG(MY_GROUP_DEBUG, - "- aFamilyName = '"<= 0){ + aFamilySet.insert(aFamily); + INITMSG(MY_GROUP_DEBUG, + "- aFamilyName = '"<GetNbElem(); @@ -1149,7 +1149,7 @@ namespace VISU VISU::TCoordSlice aVCoordSlice = GetCoordSlice(iElem); MED::TNodeCoord aMCoord = theGrilleInfo->GetCoord(iElem); for(TInt iDim = 0; iDim < aDim; iDim++){ - aVCoordSlice[iDim] = aMCoord[iDim]; + aVCoordSlice[iDim] = aMCoord[iDim]; } } } @@ -1171,13 +1171,13 @@ namespace VISU if(myIsElemNum){ // To prepare corresponding mapper engine if(myObj2VTKID.empty()){ - vtkIdType anEnd = myElemNum->size(); - for(vtkIdType anID = 0; anID < anEnd; anID++) - myObj2VTKID[(*myElemNum)[anID]] = anID; + vtkIdType anEnd = myElemNum->size(); + for(vtkIdType anID = 0; anID < anEnd; anID++) + myObj2VTKID[(*myElemNum)[anID]] = anID; } TObj2VTKID::const_iterator anIter = myObj2VTKID.find(theID); if(anIter != myObj2VTKID.end()) - return anIter->second; + return anIter->second; return -1; } return TNamedPointCoords::GetVTKID(theID); @@ -1239,10 +1239,10 @@ namespace VISU { if ( myIsElemNum ) for ( size_t anId = 0; anId < (*myElemNum).size(); anId++ ) - if ( (*myElemNum)[ anId ] == theID ) { - theID = anId; - break; - } + if ( (*myElemNum)[ anId ] == theID ) { + theID = anId; + break; + } return TSubProfileImpl::GetElemVTKID( theID ); } @@ -1264,14 +1264,14 @@ namespace VISU void TMEDGauss ::LessThan(const PGaussImpl& theGauss, - bool& theResult) const + bool& theResult) const { TGaussImpl::LessThan(theGauss,theResult); if(myGaussInfo){ if(PMEDGauss aGauss = theGauss){ - const MED::TGaussInfo& aLeft = myGaussInfo; - const MED::TGaussInfo& aReight = aGauss->myGaussInfo; - theResult = MED::TGaussInfo::TLess()(aLeft,aReight); + const MED::TGaussInfo& aLeft = myGaussInfo; + const MED::TGaussInfo& aReight = aGauss->myGaussInfo; + theResult = MED::TGaussInfo::TLess()(aLeft,aReight); } } } @@ -1334,7 +1334,7 @@ namespace VISU void TMEDSubMesh ::Init(const MED::PElemInfo& theElemInfo, - MED::EVersion theVersion) + MED::EVersion theVersion) { myVersion = theVersion; myIsElemNum = theElemInfo->IsElemNum(); @@ -1439,7 +1439,7 @@ VISU_MedConvertor std::string aMeshName = aMeshInfo->GetName(); TInt aDim = aMeshInfo->GetDim(); MED::EMaillage aType = aMeshInfo->GetType(); - + // creating TMesh structure and TMeshOnEntityMap VISU::PMEDMesh aMesh = aMeshMap[aMeshName](new VISU::TMEDMesh()); @@ -1449,66 +1449,66 @@ VISU_MedConvertor aMesh->myNamedPointCoords(new VISU::TMEDNamedPointCoords()); INITMSG(MYDEBUG,"aMeshName = '"<GetPNodeInfo(aMeshInfo)){ - MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo); + if(MED::PNodeInfo aNodeInfo = myMed->GetPNodeInfo(aMeshInfo)){ + MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo); - aMesh->myNbPoints = aNodeInfo->GetNbElem(); - aMesh->myEntityInfo = anEntityInfo; - - + aMesh->myNbPoints = aNodeInfo->GetNbElem(); + aMesh->myEntityInfo = anEntityInfo; + + #ifndef _DEXCEPT_ - try{ + try{ #endif - INITMSG(MYDEBUG,"myNbPoints = "<myNbPoints<< - "; anEntityInfo.size() = "<GetPGrilleInfo(aMeshInfo); + MED::PGrilleInfo aGrilleInfo = myMed->GetPGrilleInfo(aMeshInfo); - MED::TEntityInfo anEntityInfo; - anEntityInfo[MED::eNOEUD][MED::ePOINT1] = aGrilleInfo->GetNbNodes(); - anEntityInfo[aGrilleInfo->GetEntity()][aGrilleInfo->GetGeom()] = aGrilleInfo->GetNbCells(); - - aMesh->myNbPoints = aGrilleInfo->GetNbNodes(); - aMesh->myEntityInfo = anEntityInfo; + MED::TEntityInfo anEntityInfo; + anEntityInfo[MED::eNOEUD][MED::ePOINT1] = aGrilleInfo->GetNbNodes(); + anEntityInfo[aGrilleInfo->GetEntity()][aGrilleInfo->GetGeom()] = aGrilleInfo->GetNbCells(); + + aMesh->myNbPoints = aGrilleInfo->GetNbNodes(); + aMesh->myEntityInfo = anEntityInfo; - aMesh->myIsPolarType = (MED::eGRILLE_POLAIRE == aGrilleInfo->GetGrilleType()); - aMesh->myIsStructured = true; + aMesh->myIsPolarType = (MED::eGRILLE_POLAIRE == aGrilleInfo->GetGrilleType()); + aMesh->myIsStructured = true; #ifndef _DEXCEPT_ - try{ + try{ #endif - BEGMSG(MYDEBUG,"anEntityInfo.size() = "<second; INITMSG(MYDEBUG,"aMeshName = '"<GetEntityInfo(aMeshInfo); + MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo); - BuildFieldMap(aMesh, - anEntityInfo, - myMed); + BuildFieldMap(aMesh, + anEntityInfo, + myMed); #ifndef _DEXCEPT_ }catch(std::exception& exc){ - MSG(MYDEBUG,"Follow exception was occured in:\n"< void BuildTimeStampMinMax(MED::SharedPtr theTimeStampValue, - const VISU::PMEDMeshOnEntity theMeshOnEntity, - const MED::TGeom2Gauss& theGeom2Gauss, - VISU::TMetric2Comp2MinMax& theMetric2Comp2MinMax, + const VISU::PMEDMeshOnEntity theMeshOnEntity, + const MED::TGeom2Gauss& theGeom2Gauss, + VISU::TMetric2Comp2MinMax& theMetric2Comp2MinMax, VISU::TMetric2Comp2MinMax& theMetric2Comp2AverageMinMax, - VISU::TMetric2Comp2Group2MinMax& theMetric2Comp2Group2MinMax, - VISU::TMetric2Comp2Group2MinMax& theMetric2Comp2Group2AverageMinMax, - TInt theNbComp, - TInt theNbComp2) + VISU::TMetric2Comp2Group2MinMax& theMetric2Comp2Group2MinMax, + VISU::TMetric2Comp2Group2MinMax& theMetric2Comp2Group2AverageMinMax, + TInt theNbComp, + TInt theNbComp2) { const VISU::TFamilyIDMap& aFamilyIDMap = theMeshOnEntity->myFamilyIDMap; VISU::TGeom2ElemID2FamilyID aGeom2ElemID2FamilyID = theMeshOnEntity->myGeom2ElemID2FamilyID; @@ -1615,19 +1615,19 @@ BuildTimeStampMinMax(MED::SharedPtr theTimeStampValue, for(; anIter != aGeom2Value.end(); anIter++){ const typename TimeStampValueType::TTMeshValue& aMMeshValue = anIter->second; MED::EGeometrieElement aMGeom = anIter->first; - + TInt aNbElem = aMMeshValue.myNbElem; TInt aNbGauss = aMMeshValue.myNbGauss; - + MED::TGeom2Gauss::const_iterator aGaussIter = theGeom2Gauss.find(aMGeom); if(aGaussIter == theGeom2Gauss.end()) aNbGauss = 1; - + INITMSG(MYDEBUG, - "- aMGeom = "<GetEntityInfo(aMeshInfo); - - for(TInt iField = 1; iField <= aNbFields; iField++){ - VISU::TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPFieldInfo()"); - - MED::TErr anError = 0; - MED::PFieldInfo aFieldInfo = myMed->GetPFieldInfo(aMeshInfo, iField, &anError); - if ( anError < 0 ) - continue; - - std::string aFieldName = aFieldInfo->GetName(); - INITMSG(MYDEBUG,"- aFieldName = '"<GetNbTimeStamps(aFieldInfo, - anEntityInfo, - aMEntity, - aGeom2Size); - if(aNbTimeStamps < 1) - continue; - - VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity); - VISU::PMEDMeshOnEntity aMeshOnEntity = aMesh->myMeshOnEntityMap[aVEntity]; - VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap; - VISU::PMEDField aField = aFieldMap[aFieldName]; - - TInt aNbComp = aField->myNbComp; - int aNbComp2 = aNbComp; - if(aNbComp == 2 || aNbComp == 4) - aNbComp2 = 2; - else if(aNbComp > 4) - aNbComp2 = 3; - - VISU::TMetric2Comp2MinMax& aMetric2Comp2MinMax = aField->myMetric2Comp2MinMax; + TInt aNbFields = myMed->GetNbFields(); + + INITMSG(MYDEBUG, + "- aMeshName = '"<GetEntityInfo(aMeshInfo); + + for(TInt iField = 1; iField <= aNbFields; iField++){ + VISU::TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPFieldInfo()"); + + MED::TErr anError = 0; + MED::PFieldInfo aFieldInfo = myMed->GetPFieldInfo(aMeshInfo, iField, &anError); + if ( anError < 0 ) + continue; + + std::string aFieldName = aFieldInfo->GetName(); + INITMSG(MYDEBUG,"- aFieldName = '"<GetNbTimeStamps(aFieldInfo, + anEntityInfo, + aMEntity, + aGeom2Size); + if(aNbTimeStamps < 1) + continue; + + VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity); + VISU::PMEDMeshOnEntity aMeshOnEntity = aMesh->myMeshOnEntityMap[aVEntity]; + VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap; + VISU::PMEDField aField = aFieldMap[aFieldName]; + + TInt aNbComp = aField->myNbComp; + int aNbComp2 = aNbComp; + if(aNbComp == 2 || aNbComp == 4) + aNbComp2 = 2; + else if(aNbComp > 4) + aNbComp2 = 3; + + VISU::TMetric2Comp2MinMax& aMetric2Comp2MinMax = aField->myMetric2Comp2MinMax; VISU::TMetric2Comp2MinMax& aMetric2Comp2AverageMinMax = aField->myMetric2Comp2AverageMinMax; VISU::TMetric2Comp2Group2MinMax& aMetric2Comp2Group2MinMax = aField->myMetric2Comp2Group2MinMax; VISU::TMetric2Comp2Group2MinMax& aMetric2Comp2Group2AverageMinMax = aField->myMetric2Comp2Group2AverageMinMax; - TSetIsDone aSetIsDone(aField->myIsMinMaxInitilized); - for(TInt iTimeStamp = aNbTimeStamps; iTimeStamp >= 1; iTimeStamp--){ - VISU::TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPTimeStampInfo()"); - INITMSG(MYDEBUG,"- iTimeStamp = "<myIsMinMaxInitilized); + for(TInt iTimeStamp = aNbTimeStamps; iTimeStamp >= 1; iTimeStamp--){ + VISU::TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPTimeStampInfo()"); + INITMSG(MYDEBUG,"- iTimeStamp = "<GetType() == MED::eFLOAT64) BuildTimeStampMinMax(CastToFloatTimeStampValue(aTimeStampValue), - aMeshOnEntity, + aMeshOnEntity, aGeom2Gauss, aMetric2Comp2MinMax, aMetric2Comp2AverageMinMax, - aMetric2Comp2Group2MinMax, - aMetric2Comp2Group2AverageMinMax, + aMetric2Comp2Group2MinMax, + aMetric2Comp2Group2AverageMinMax, aNbComp, aNbComp2); else BuildTimeStampMinMax(CastToIntTimeStampValue(aTimeStampValue), - aMeshOnEntity, + aMeshOnEntity, aGeom2Gauss, aMetric2Comp2MinMax, aMetric2Comp2AverageMinMax, - aMetric2Comp2Group2MinMax, - aMetric2Comp2Group2AverageMinMax, + aMetric2Comp2Group2MinMax, + aMetric2Comp2Group2AverageMinMax, aNbComp, aNbComp2); @@ -1990,17 +1990,17 @@ VISU_MedConvertor MSG(MYDEBUG,"Unknown exception !!!"); } #endif - } - for(TInt iComp = 0; iComp <= aNbComp; iComp++){ - VISU::TMinMax aMinMax = aField->GetMinMax(iComp, VISU::TNames()); - INITMSG(MYDEBUG,"- "<GetMinMax(iComp, VISU::TNames()); + INITMSG(MYDEBUG,"- "<second; INITMSG(MYDEBUG,"aMeshName = '"<GetEntityInfo(aMeshInfo); MED::TEntity2TGeom2ElemInfo anEntity2TGeom2ElemInfo = - MED::GetEntity2TGeom2ElemInfo(myMed, aMeshInfo, anEntityInfo); + MED::GetEntity2TGeom2ElemInfo(myMed, aMeshInfo, anEntityInfo); #ifndef _DEXCEPT_ try{ #endif - MED::TFamilyInfoSet aFamilyInfoSet = MED::GetFamilyInfoSet(myMed, aMeshInfo); - - if(aType == MED::eNON_STRUCTURE) - BuildFamilyMap(aMesh, - anEntityInfo, - anEntity2TGeom2ElemInfo, - aFamilyInfoSet, - myMed); - else - BuildGrilleFamilyMap(aMesh, - anEntityInfo, - aFamilyInfoSet, - myMed); - - BuildGroupMap(aMesh, - aFamilyInfoSet); + MED::TFamilyInfoSet aFamilyInfoSet = MED::GetFamilyInfoSet(myMed, aMeshInfo); + + if(aType == MED::eNON_STRUCTURE) + BuildFamilyMap(aMesh, + anEntityInfo, + anEntity2TGeom2ElemInfo, + aFamilyInfoSet, + myMed); + else + BuildGrilleFamilyMap(aMesh, + anEntityInfo, + aFamilyInfoSet, + myMed); + + BuildGroupMap(aMesh, + aFamilyInfoSet); #ifndef _DEXCEPT_ }catch(std::exception& exc){ - MSG(MYDEBUG,"Follow exception was occured in:\n"<myCell2Connect; aCell2Connect.resize(aNbElem); for (int iElem = 0; iElem < aNbElem; iElem++) - aCell2Connect[iElem] = VISU::TConnect(1,iElem); + aCell2Connect[iElem] = VISU::TConnect(1,iElem); } // END NON_STRUCTURED else { // STRUCTURED //Main part of code @@ -2272,7 +2272,7 @@ VISU_MedConvertor VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect; aCell2Connect.resize(aNbElem); for(int iElem = 0; iElem < aNbElem; iElem++) - aCell2Connect[iElem] = VISU::TConnect(1,iElem); + aCell2Connect[iElem] = VISU::TConnect(1,iElem); } @@ -2294,8 +2294,8 @@ VISU_MedConvertor int VISU_MedConvertor ::LoadPointsOnFamily(const MED::PWrapper& theMed, - const VISU::PMEDMesh theMesh, - const VISU::PMEDFamily theFamily) + const VISU::PMEDMesh theMesh, + const VISU::PMEDFamily theFamily) { VISU::TTimerLog aTimerLog(MYDEBUG,"LoadPointsOnFamily"); try{ @@ -2311,11 +2311,11 @@ VISU_MedConvertor TInt aNbElem = aNodeInfo->GetNbElem(); if(aNbElem > 0){ - TInt anId = theFamily->myId; - VISU::TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[VISU::ePOINT1]; - for(TInt iElem = 0; iElem < aNbElem; iElem++) - if(aNodeInfo->GetFamNum(iElem) == anId) - aSubMeshID.push_back(iElem); + TInt anId = theFamily->myId; + VISU::TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[VISU::ePOINT1]; + for(TInt iElem = 0; iElem < aNbElem; iElem++) + if(aNodeInfo->GetFamNum(iElem) == anId) + aSubMeshID.push_back(iElem); } } else { @@ -2323,11 +2323,11 @@ VISU_MedConvertor TInt aNbElem = aGrilleInfo->GetNbNodes(); if(aNbElem > 0){ - TInt anId = theFamily->myId; - VISU::TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[VISU::ePOINT1]; - for(TInt iElem = 0; iElem < aNbElem; iElem++) - if(aGrilleInfo->GetFamNumNode(iElem) == anId) - aSubMeshID.push_back(iElem); + TInt anId = theFamily->myId; + VISU::TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[VISU::ePOINT1]; + for(TInt iElem = 0; iElem < aNbElem; iElem++) + if(aGrilleInfo->GetFamNumNode(iElem) == anId) + aSubMeshID.push_back(iElem); } } @@ -2349,8 +2349,8 @@ VISU_MedConvertor int VISU_MedConvertor ::LoadCellsOnEntity(const MED::PWrapper& theMed, - const VISU::PMEDMesh theMesh, - const VISU::PMEDMeshOnEntity theMeshOnEntity) + const VISU::PMEDMesh theMesh, + const VISU::PMEDMeshOnEntity theMeshOnEntity) { VISU::TTimerLog aTimerLog(MYDEBUG,"LoadCellsOnEntity"); #ifndef _DEXCEPT_ @@ -2381,75 +2381,75 @@ VISU_MedConvertor VISU::TGeom2SubMesh& aGeom2SubMesh = theMeshOnEntity->myGeom2SubMesh; for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){ - const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first; - VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom); - INITMSG(MYDEBUG,"aMGeom = "<second;//aGrilleInfo->GetNbCells(); - - if(aNbElem > 0){ - VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh()); - - aSubMesh->Init(aGrilleInfo); - aSubMesh->myNbCells = aNbElem; - aSubMesh->myCellsSize = aNbElem*(aVNbNodes+1); - - VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect; - aCell2Connect.resize(aNbElem); - - TInt aMNbNodes = MEDGeom2NbNodes(aMGeom); - VISU::TVector aConnect(aMNbNodes); - - for(TInt iElem = 0; iElem < aNbElem; iElem++) { - MED::TIntVector aConn = aGrilleInfo->GetConn(iElem); - VISU::TConnect& anArray = aCell2Connect[iElem]; - anArray.resize(aVNbNodes); - - if(anIsNodeNum){ - for(TInt iConn = 0; iConn < aMNbNodes; iConn++){ - aConnect[iConn] = aNodeIdMap[aConn[iConn] - 1]; - } - }else{ - for(int iConn = 0; iConn < aMNbNodes; ++iConn){ - aConnect[iConn] = aConn[iConn]; - } - } - - switch(aMGeom){ - case MED::eQUAD4: - anArray[0] = aConnect[0]; - anArray[1] = aConnect[2]; - anArray[2] = aConnect[3]; - anArray[3] = aConnect[1]; - break; - case MED::eHEXA8: - anArray[0] = aConnect[0]; - anArray[1] = aConnect[2]; - anArray[2] = aConnect[3]; - anArray[3] = aConnect[1]; - anArray[4] = aConnect[4]; - anArray[5] = aConnect[6]; - anArray[6] = aConnect[7]; - anArray[7] = aConnect[5]; - break; - default: - for(int iNode = 0; iNode < aVNbNodes; iNode++) - anArray[iNode] = aConnect[iNode]; - } - - for(int iNode = 0; iNode < aVNbNodes; iNode++) - if(anArray[iNode] < 0 || aNbPoints <= anArray[iNode]) - EXCEPTION(std::runtime_error,"LoadCellsOnEntity - "<< - " aNbPoints("<first; + VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom); + INITMSG(MYDEBUG,"aMGeom = "<second;//aGrilleInfo->GetNbCells(); + + if(aNbElem > 0){ + VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh()); + + aSubMesh->Init(aGrilleInfo); + aSubMesh->myNbCells = aNbElem; + aSubMesh->myCellsSize = aNbElem*(aVNbNodes+1); + + VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect; + aCell2Connect.resize(aNbElem); + + TInt aMNbNodes = MEDGeom2NbNodes(aMGeom); + VISU::TVector aConnect(aMNbNodes); + + for(TInt iElem = 0; iElem < aNbElem; iElem++) { + MED::TIntVector aConn = aGrilleInfo->GetConn(iElem); + VISU::TConnect& anArray = aCell2Connect[iElem]; + anArray.resize(aVNbNodes); + + if(anIsNodeNum){ + for(TInt iConn = 0; iConn < aMNbNodes; iConn++){ + aConnect[iConn] = aNodeIdMap[aConn[iConn] - 1]; + } + }else{ + for(int iConn = 0; iConn < aMNbNodes; ++iConn){ + aConnect[iConn] = aConn[iConn]; + } + } + + switch(aMGeom){ + case MED::eQUAD4: + anArray[0] = aConnect[0]; + anArray[1] = aConnect[2]; + anArray[2] = aConnect[3]; + anArray[3] = aConnect[1]; + break; + case MED::eHEXA8: + anArray[0] = aConnect[0]; + anArray[1] = aConnect[2]; + anArray[2] = aConnect[3]; + anArray[3] = aConnect[1]; + anArray[4] = aConnect[4]; + anArray[5] = aConnect[6]; + anArray[6] = aConnect[7]; + anArray[7] = aConnect[5]; + break; + default: + for(int iNode = 0; iNode < aVNbNodes; iNode++) + anArray[iNode] = aConnect[iNode]; + } + + for(int iNode = 0; iNode < aVNbNodes; iNode++) + if(anArray[iNode] < 0 || aNbPoints <= anArray[iNode]) + EXCEPTION(std::runtime_error,"LoadCellsOnEntity - "<< + " aNbPoints("<myIsDone = true; @@ -2468,7 +2468,7 @@ VISU_MedConvertor EBooleen anIsNodeNum = aNodeInfo->IsElemNum(); if(anIsNodeNum){ for(TInt i = 0; i < aNbPoints; i++){ - aNodeIdMap[aNodeInfo->GetElemNum(i)-1] = i; + aNodeIdMap[aNodeInfo->GetElemNum(i)-1] = i; } } #endif @@ -2483,198 +2483,198 @@ VISU_MedConvertor INITMSG(MYDEBUG,"aMGeom = "<GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom); - TInt aNbElem = aPolygoneInfo->GetNbElem(); - if(aNbElem > 0){ - VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh()); - - aSubMesh->Init(MED::PElemInfo(aPolygoneInfo),theMed->GetVersion()); - aSubMesh->myNbCells = aNbElem; - - VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect; - aCell2Connect.resize(aNbElem); - - for(TInt iElem = 0; iElem < aNbElem; iElem++) { - MED::TCConnSlice aConnSlice = aPolygoneInfo->GetConnSlice(iElem); - TInt aNbConn = aPolygoneInfo->GetNbConn(iElem); - aSubMesh->myCellsSize += aNbConn; - VISU::TConnect& anArray = aCell2Connect[iElem]; - anArray.resize(aNbConn); - for(TInt iConn = 0; iConn < aNbConn; iConn++) - anArray[iConn] = aConnSlice[iConn] - 1; - } - } - break; + MED::PPolygoneInfo aPolygoneInfo = theMed->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom); + TInt aNbElem = aPolygoneInfo->GetNbElem(); + if(aNbElem > 0){ + VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh()); + + aSubMesh->Init(MED::PElemInfo(aPolygoneInfo),theMed->GetVersion()); + aSubMesh->myNbCells = aNbElem; + + VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect; + aCell2Connect.resize(aNbElem); + + for(TInt iElem = 0; iElem < aNbElem; iElem++) { + MED::TCConnSlice aConnSlice = aPolygoneInfo->GetConnSlice(iElem); + TInt aNbConn = aPolygoneInfo->GetNbConn(iElem); + aSubMesh->myCellsSize += aNbConn; + VISU::TConnect& anArray = aCell2Connect[iElem]; + anArray.resize(aNbConn); + for(TInt iConn = 0; iConn < aNbConn; iConn++) + anArray[iConn] = aConnSlice[iConn] - 1; + } + } + break; } case MED::ePOLYEDRE: { - MED::PPolyedreInfo aPolyedreInfo = theMed->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom); - TInt aNbElem = aPolyedreInfo->GetNbElem(); - - if(aNbElem > 0){ - VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh()); - - aSubMesh->Init(MED::PElemInfo(aPolyedreInfo),theMed->GetVersion()); - aSubMesh->myNbCells = aNbElem; - - VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect; - aCell2Connect.resize(aNbElem); - - for(TInt iElem = 0; iElem < aNbElem; iElem++){ - MED::TCConnSliceArr aConnSliceArr = aPolyedreInfo->GetConnSliceArr(iElem); - VISU::TConnect& anArray = aCell2Connect[iElem]; - typedef std::set TConnectSet; - TConnectSet aConnectSet; - TInt aNbFaces = aConnSliceArr.size(); - for(TInt iFace = 0; iFace < aNbFaces; iFace++){ - MED::TCConnSlice aConnSlice = aConnSliceArr[iFace]; - TInt aNbConn = aConnSlice.size(); - aSubMesh->myCellsSize += aNbConn; - for(TInt iConn = 0; iConn < aNbConn; iConn++){ - aConnectSet.insert(aConnSlice[iConn]); - } - } - - int aNbConn = aConnectSet.size(); - anArray.resize(aNbConn); - TConnectSet::iterator anIter = aConnectSet.begin(); - for(int i = 0; anIter != aConnectSet.end(); anIter++, i++){ - TInt anId = *anIter; - anArray[i] = anId - 1; - } - } - } - - break; + MED::PPolyedreInfo aPolyedreInfo = theMed->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom); + TInt aNbElem = aPolyedreInfo->GetNbElem(); + + if(aNbElem > 0){ + VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh()); + + aSubMesh->Init(MED::PElemInfo(aPolyedreInfo),theMed->GetVersion()); + aSubMesh->myNbCells = aNbElem; + + VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect; + aCell2Connect.resize(aNbElem); + + for(TInt iElem = 0; iElem < aNbElem; iElem++){ + MED::TCConnSliceArr aConnSliceArr = aPolyedreInfo->GetConnSliceArr(iElem); + VISU::TConnect& anArray = aCell2Connect[iElem]; + typedef std::set TConnectSet; + TConnectSet aConnectSet; + TInt aNbFaces = aConnSliceArr.size(); + for(TInt iFace = 0; iFace < aNbFaces; iFace++){ + MED::TCConnSlice aConnSlice = aConnSliceArr[iFace]; + TInt aNbConn = aConnSlice.size(); + aSubMesh->myCellsSize += aNbConn; + for(TInt iConn = 0; iConn < aNbConn; iConn++){ + aConnectSet.insert(aConnSlice[iConn]); + } + } + + int aNbConn = aConnectSet.size(); + anArray.resize(aNbConn); + TConnectSet::iterator anIter = aConnectSet.begin(); + for(int i = 0; anIter != aConnectSet.end(); anIter++, i++){ + TInt anId = *anIter; + anArray[i] = anId - 1; + } + } + } + + break; } default: { - vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom); - INITMSG(MYDEBUG,"aVNbNodes = "<GetPCellInfo(aMeshInfo,aMEntity,aMGeom); - TInt aNbElem = aCellInfo->GetNbElem(); - - if(aNbElem > 0){ - VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh()); - - aSubMesh->Init(MED::PElemInfo(aCellInfo), theMed->GetVersion()); - aSubMesh->myNbCells = aNbElem; - aSubMesh->myCellsSize = aNbElem*(aVNbNodes+1); - - VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect; - aCell2Connect.resize(aNbElem); - - TInt aMNbNodes = MEDGeom2NbNodes(aMGeom); - VISU::TVector aConnect(aMNbNodes); - - for(TInt iElem = 0; iElem < aNbElem; iElem++) { - MED::TCConnSlice aConnSlice = aCellInfo->GetConnSlice(iElem); - VISU::TConnect& anArray = aCell2Connect[iElem]; - anArray.resize(aVNbNodes); - - if(anIsNodeNum){ - for(TInt iConn = 0; iConn < aMNbNodes; iConn++){ - aConnect[iConn] = aNodeIdMap[aConnSlice[iConn] - 1]; - } - }else{ - for(int iConn = 0; iConn < aMNbNodes; iConn++){ - aConnect[iConn] = aConnSlice[iConn] - 1; - } - } - - switch(aMGeom){ + vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom); + INITMSG(MYDEBUG,"aVNbNodes = "<GetPCellInfo(aMeshInfo,aMEntity,aMGeom); + TInt aNbElem = aCellInfo->GetNbElem(); + + if(aNbElem > 0){ + VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh()); + + aSubMesh->Init(MED::PElemInfo(aCellInfo), theMed->GetVersion()); + aSubMesh->myNbCells = aNbElem; + aSubMesh->myCellsSize = aNbElem*(aVNbNodes+1); + + VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect; + aCell2Connect.resize(aNbElem); + + TInt aMNbNodes = MEDGeom2NbNodes(aMGeom); + VISU::TVector aConnect(aMNbNodes); + + for(TInt iElem = 0; iElem < aNbElem; iElem++) { + MED::TCConnSlice aConnSlice = aCellInfo->GetConnSlice(iElem); + VISU::TConnect& anArray = aCell2Connect[iElem]; + anArray.resize(aVNbNodes); + + if(anIsNodeNum){ + for(TInt iConn = 0; iConn < aMNbNodes; iConn++){ + aConnect[iConn] = aNodeIdMap[aConnSlice[iConn] - 1]; + } + }else{ + for(int iConn = 0; iConn < aMNbNodes; iConn++){ + aConnect[iConn] = aConnSlice[iConn] - 1; + } + } + + switch(aMGeom){ #if !(defined(VTK_QUADRATIC_EDGE) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC) - case MED::eSEG3: - anArray[0] = aConnect[0]; - anArray[2] = aConnect[1]; + case MED::eSEG3: + anArray[0] = aConnect[0]; + anArray[2] = aConnect[1]; - anArray[1] = aConnect[2]; - break; + anArray[1] = aConnect[2]; + break; #endif #if !(defined(VTK_QUADRATIC_TRIANGLE) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC) - case MED::eTRIA6: - anArray[0] = aConnect[0]; - anArray[2] = aConnect[1]; - anArray[4] = aConnect[2]; - - anArray[1] = aConnect[3]; - anArray[3] = aConnect[4]; - anArray[5] = aConnect[5]; - break; + case MED::eTRIA6: + anArray[0] = aConnect[0]; + anArray[2] = aConnect[1]; + anArray[4] = aConnect[2]; + + anArray[1] = aConnect[3]; + anArray[3] = aConnect[4]; + anArray[5] = aConnect[5]; + break; #endif #if !(defined(VTK_QUADRATIC_QUAD) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC) - case MED::eQUAD8: - anArray[0] = aConnect[0]; - anArray[2] = aConnect[1]; - anArray[4] = aConnect[2]; - anArray[6] = aConnect[3]; - - anArray[1] = aConnect[4]; - anArray[3] = aConnect[5]; - anArray[5] = aConnect[6]; - anArray[7] = aConnect[7]; - break; + case MED::eQUAD8: + anArray[0] = aConnect[0]; + anArray[2] = aConnect[1]; + anArray[4] = aConnect[2]; + anArray[6] = aConnect[3]; + + anArray[1] = aConnect[4]; + anArray[3] = aConnect[5]; + anArray[5] = aConnect[6]; + anArray[7] = aConnect[7]; + break; #endif #if (defined(VTK_QUADRATIC_TETRA) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC) - case MED::eTETRA10: - anArray[0] = aConnect[0]; - anArray[1] = aConnect[2]; - anArray[2] = aConnect[1]; - anArray[3] = aConnect[3]; - - anArray[4] = aConnect[6]; - anArray[5] = aConnect[5]; - anArray[6] = aConnect[4]; - - anArray[7] = aConnect[7]; - anArray[8] = aConnect[9]; - anArray[9] = aConnect[8]; - break; + case MED::eTETRA10: + anArray[0] = aConnect[0]; + anArray[1] = aConnect[2]; + anArray[2] = aConnect[1]; + anArray[3] = aConnect[3]; + + anArray[4] = aConnect[6]; + anArray[5] = aConnect[5]; + anArray[6] = aConnect[4]; + + anArray[7] = aConnect[7]; + anArray[8] = aConnect[9]; + anArray[9] = aConnect[8]; + break; #endif - case MED::eTETRA4: - anArray[0] = aConnect[0]; - anArray[1] = aConnect[2]; - anArray[2] = aConnect[1]; - anArray[3] = aConnect[3]; - break; + case MED::eTETRA4: + anArray[0] = aConnect[0]; + anArray[1] = aConnect[2]; + anArray[2] = aConnect[1]; + anArray[3] = aConnect[3]; + break; #if (defined(VTK_QUADRATIC_PYRAMID) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC) - case MED::ePYRA13: - anArray[0] = aConnect[0]; - anArray[1] = aConnect[3]; - anArray[2] = aConnect[2]; - anArray[3] = aConnect[1]; - anArray[4] = aConnect[4]; - - anArray[5] = aConnect[8]; - anArray[6] = aConnect[7]; - anArray[7] = aConnect[6]; - anArray[8] = aConnect[5]; - - anArray[9] = aConnect[9]; - anArray[10] = aConnect[12]; - anArray[11] = aConnect[11]; - anArray[12] = aConnect[10]; - break; + case MED::ePYRA13: + anArray[0] = aConnect[0]; + anArray[1] = aConnect[3]; + anArray[2] = aConnect[2]; + anArray[3] = aConnect[1]; + anArray[4] = aConnect[4]; + + anArray[5] = aConnect[8]; + anArray[6] = aConnect[7]; + anArray[7] = aConnect[6]; + anArray[8] = aConnect[5]; + + anArray[9] = aConnect[9]; + anArray[10] = aConnect[12]; + anArray[11] = aConnect[11]; + anArray[12] = aConnect[10]; + break; #endif - case MED::ePYRA5: - anArray[0] = aConnect[0]; - anArray[1] = aConnect[3]; - anArray[2] = aConnect[2]; - anArray[3] = aConnect[1]; - anArray[4] = aConnect[4]; - break; - default: - for(int iNode = 0; iNode < aVNbNodes; iNode++) - anArray[iNode] = aConnect[iNode]; - } - for(int iNode = 0; iNode < aVNbNodes; iNode++) - if(anArray[iNode] < 0 || aNbPoints <= anArray[iNode]) - EXCEPTION(std::runtime_error,"LoadCellsOnEntity - "<< - " aNbPoints("<first; if(aType == MED::eNON_STRUCTURE){ - MED::PElemInfo anElemInfo; - switch(aMGeom){ - case MED::ePOLYGONE: { - anElemInfo = theMed->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom); - break; - } - case MED::ePOLYEDRE: { - anElemInfo = theMed->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom); - break; - } - default: { - anElemInfo = theMed->GetPCellInfo(aMeshInfo,aMEntity,aMGeom); - break; - }} - if(anElemInfo){ - if(TInt aNbElem = anElemInfo->GetNbElem()){ - VISU::TSubMeshID aSubMeshID; - for(TInt iElem = 0; iElem < aNbElem; iElem++) - if(anElemInfo->GetFamNum(iElem) == anId) - aSubMeshID.push_back(iElem); - if(!aSubMeshID.empty()){ - VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom); - INITMSG(MYDEBUG,"aMGeom = "<GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom); + break; + } + case MED::ePOLYEDRE: { + anElemInfo = theMed->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom); + break; + } + default: { + anElemInfo = theMed->GetPCellInfo(aMeshInfo,aMEntity,aMGeom); + break; + }} + if(anElemInfo){ + if(TInt aNbElem = anElemInfo->GetNbElem()){ + VISU::TSubMeshID aSubMeshID; + for(TInt iElem = 0; iElem < aNbElem; iElem++) + if(anElemInfo->GetFamNum(iElem) == anId) + aSubMeshID.push_back(iElem); + if(!aSubMeshID.empty()){ + VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom); + INITMSG(MYDEBUG,"aMGeom = "<GetPGrilleInfo(aMeshInfo); - if(anElemInfo){ - TInt aNbElem = anElemInfo->GetNbCells(); - if(aNbElem>0 && (aMGeom == anElemInfo->GetGeom()) ){ - VISU::TSubMeshID aSubMeshID; - for(TInt iElem = 0; iElem < aNbElem; iElem++) - if(anElemInfo->GetFamNum(iElem) == anId) - aSubMeshID.push_back(iElem); - if(!aSubMeshID.empty()){ - VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom); - INITMSG(MYDEBUG,"aMGeom = "<GetPGrilleInfo(aMeshInfo); + if(anElemInfo){ + TInt aNbElem = anElemInfo->GetNbCells(); + if(aNbElem>0 && (aMGeom == anElemInfo->GetGeom()) ){ + VISU::TSubMeshID aSubMeshID; + for(TInt iElem = 0; iElem < aNbElem; iElem++) + if(anElemInfo->GetFamNum(iElem) == anId) + aSubMeshID.push_back(iElem); + if(!aSubMeshID.empty()){ + VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom); + INITMSG(MYDEBUG,"aMGeom = "<myElemNum; if(!anElemNum.empty()){ - VISU::TSubMeshID& aSubMeshID = aSubProfile->mySubMeshID; - TInt aSize = anElemNum.size(); - aSubMeshID.resize(aSize); - for(TInt anId = 0; anId < aSize; anId++) - aSubMeshID[anId] = anElemNum[anId] - 1; + VISU::TSubMeshID& aSubMeshID = aSubProfile->mySubMeshID; + TInt aSize = anElemNum.size(); + aSubMeshID.resize(aSize); + for(TInt anId = 0; anId < aSize; anId++) + aSubMeshID[anId] = anElemNum[anId] - 1; } INITMSG(MYDEBUG, - "- aEGeom = "<GetPPolygoneInfo(aMeshInfo, - aMEntity, - aMGeom); + aMEntity, + aMGeom); anElemInfo = aPolygoneInfo; break; case MED::ePOLYEDRE: aPolyedreInfo = theMed->GetPPolyedreInfo(aMeshInfo, - aMEntity, - aMGeom); + aMEntity, + aMGeom); anElemInfo = aPolyedreInfo; break; default: aCellInfo = theMed->GetPCellInfo(aMeshInfo, - aMEntity, - aMGeom); + aMEntity, + aMGeom); anElemInfo = aCellInfo; } aGaussSubMesh->myIsElemNum = anElemInfo->IsElemNum(); @@ -2931,69 +2931,69 @@ LoadGaussMesh(const MED::PWrapper& theMed, VISU::PMEDGauss aGauss = aGaussSubMesh->myGauss; MED::PGaussInfo aGaussInfo = aGauss->myGaussInfo; if(aGaussInfo){ - aName = aGaussInfo->GetName(); - if(!aSubMeshID.empty()){ - const std::string& aProfileName = aSubProfile->myName; - MED::PProfileInfo aProfileInfo = MED::GetProfileInfo(theMed, - aProfileName); - if(aProfileInfo){ - const MED::TElemNum& anElemNum = aProfileInfo->myElemNum; - anIsGaussCoord3D = MED::GetGaussCoord3D(aGaussInfo, - aCellInfo, - aNodeInfo, - aGaussCoord, - anElemNum); - } - }else - anIsGaussCoord3D = MED::GetGaussCoord3D(aGaussInfo, - aCellInfo, - aNodeInfo, - aGaussCoord); + aName = aGaussInfo->GetName(); + if(!aSubMeshID.empty()){ + const std::string& aProfileName = aSubProfile->myName; + MED::PProfileInfo aProfileInfo = MED::GetProfileInfo(theMed, + aProfileName); + if(aProfileInfo){ + const MED::TElemNum& anElemNum = aProfileInfo->myElemNum; + anIsGaussCoord3D = MED::GetGaussCoord3D(aGaussInfo, + aCellInfo, + aNodeInfo, + aGaussCoord, + anElemNum); + } + }else + anIsGaussCoord3D = MED::GetGaussCoord3D(aGaussInfo, + aCellInfo, + aNodeInfo, + aGaussCoord); } }else{ if(!aSubMeshID.empty()){ - const std::string& aProfileName = aSubProfile->myName; - MED::PProfileInfo aProfileInfo = MED::GetProfileInfo(theMed, - aProfileName); - if(aProfileInfo){ - const MED::TElemNum& anElemNum = aProfileInfo->myElemNum; - switch(aMGeom){ - case MED::ePOLYGONE: - anIsGaussCoord3D = MED::GetBaryCenter(aPolygoneInfo, - aNodeInfo, - aGaussCoord, - anElemNum); - break; - case MED::ePOLYEDRE: - anIsGaussCoord3D = MED::GetBaryCenter(aPolyedreInfo, - aNodeInfo, - aGaussCoord, - anElemNum); - break; - default: - anIsGaussCoord3D = MED::GetBaryCenter(aCellInfo, - aNodeInfo, - aGaussCoord, - anElemNum); - } - } + const std::string& aProfileName = aSubProfile->myName; + MED::PProfileInfo aProfileInfo = MED::GetProfileInfo(theMed, + aProfileName); + if(aProfileInfo){ + const MED::TElemNum& anElemNum = aProfileInfo->myElemNum; + switch(aMGeom){ + case MED::ePOLYGONE: + anIsGaussCoord3D = MED::GetBaryCenter(aPolygoneInfo, + aNodeInfo, + aGaussCoord, + anElemNum); + break; + case MED::ePOLYEDRE: + anIsGaussCoord3D = MED::GetBaryCenter(aPolyedreInfo, + aNodeInfo, + aGaussCoord, + anElemNum); + break; + default: + anIsGaussCoord3D = MED::GetBaryCenter(aCellInfo, + aNodeInfo, + aGaussCoord, + anElemNum); + } + } }else - switch(aMGeom){ - case MED::ePOLYGONE: - anIsGaussCoord3D = MED::GetBaryCenter(aPolygoneInfo, - aNodeInfo, - aGaussCoord); - break; - case MED::ePOLYEDRE: - anIsGaussCoord3D = MED::GetBaryCenter(aPolyedreInfo, - aNodeInfo, - aGaussCoord); - break; - default: - anIsGaussCoord3D = MED::GetBaryCenter(aCellInfo, - aNodeInfo, - aGaussCoord); - } + switch(aMGeom){ + case MED::ePOLYGONE: + anIsGaussCoord3D = MED::GetBaryCenter(aPolygoneInfo, + aNodeInfo, + aGaussCoord); + break; + case MED::ePOLYEDRE: + anIsGaussCoord3D = MED::GetBaryCenter(aPolyedreInfo, + aNodeInfo, + aGaussCoord); + break; + default: + anIsGaussCoord3D = MED::GetBaryCenter(aCellInfo, + aNodeInfo, + aGaussCoord); + } } if(anIsGaussCoord3D){ @@ -3009,13 +3009,13 @@ LoadGaussMesh(const MED::PWrapper& theMed, TInt aNbCells = aNbElem*aNbGauss; INITMSG(MYDEBUG, - "- aEGeom = "< void FillValForTime(MED::SharedPtr theTimeStampValue, - const VISU::TGeom2SubProfile& theGeom2SubProfile, - VISU::PMEDValForTime theValForTime, - VISU::PMEDField theField) + const VISU::TGeom2SubProfile& theGeom2SubProfile, + VISU::PMEDValForTime theValForTime, + VISU::PMEDField theField) { theField->myDataSize = 0; TInt aNbComp = theField->myNbComp; @@ -3047,10 +3047,10 @@ FillValForTime(MED::SharedPtr theTimeStampValue, TInt aNbGauss = theValForTime->GetNbGauss(aEGeom); INITMSG(MYDEBUG, - "- aEGeom = "<GetCellData()) - anIsDataOnCells = (aCellData->GetArray("VISU_FIELD") != NULL); - if(anIsDataOnCells){ - vtkIntArray *aGeometryCellMapper = dynamic_cast(aCellMapper); - vtkIntArray* aDataCellMapper = GetIDMapper(theFieldList, - TGetCellData(), - "VISU_CELLS_MAPPER"); - CopyDataOnCells(theInput, - aGeometryCellMapper, - aDataCellMapper, - theScalarsDataSet, - theVectorsDataSet, - theNormalsDataSet, - theTCoordsDataSet, - theTensorsDataSet, - theFieldList, - theOutput); - }else{ - vtkPointData *aPointData = theInput->GetPointData(); - vtkDataArray *aPointMapper = aPointData->GetArray("VISU_POINTS_MAPPER"); - vtkIntArray *aGeometryPointMapper = dynamic_cast(aPointMapper); - vtkIntArray* aDataPointMapper = GetIDMapper(theFieldList, - TGetPointData(), - "VISU_POINTS_MAPPER"); - CopyDataOnPoints(theInput, - aGeometryPointMapper, - aDataPointMapper, - theScalarsDataSet, - theVectorsDataSet, - theNormalsDataSet, - theTCoordsDataSet, - theTensorsDataSet, - theFieldList, - theOutput); - } + bool anIsDataOnCells = false; + if(vtkDataSet* aDataSet = theScalarsDataSet) + if(vtkCellData* aCellData = aDataSet->GetCellData()) + anIsDataOnCells = (aCellData->GetArray("VISU_FIELD") != NULL); + if(anIsDataOnCells){ + vtkIntArray *aGeometryCellMapper = dynamic_cast(aCellMapper); + vtkIntArray* aDataCellMapper = GetIDMapper(theFieldList, + TGetCellData(), + "VISU_CELLS_MAPPER"); + CopyDataOnCells(theInput, + aGeometryCellMapper, + aDataCellMapper, + theScalarsDataSet, + theVectorsDataSet, + theNormalsDataSet, + theTCoordsDataSet, + theTensorsDataSet, + theFieldList, + theOutput); + }else{ + vtkPointData *aPointData = theInput->GetPointData(); + vtkDataArray *aPointMapper = aPointData->GetArray("VISU_POINTS_MAPPER"); + vtkIntArray *aGeometryPointMapper = dynamic_cast(aPointMapper); + vtkIntArray* aDataPointMapper = GetIDMapper(theFieldList, + TGetPointData(), + "VISU_POINTS_MAPPER"); + CopyDataOnPoints(theInput, + aGeometryPointMapper, + aDataPointMapper, + theScalarsDataSet, + theVectorsDataSet, + theNormalsDataSet, + theTCoordsDataSet, + theTensorsDataSet, + theFieldList, + theOutput); + } } }else{ BasicExecute(theInput, - theScalarsDataSet, - theVectorsDataSet, - theNormalsDataSet, - theTCoordsDataSet, - theTensorsDataSet, - theFieldList, - theOutput); + theScalarsDataSet, + theVectorsDataSet, + theNormalsDataSet, + theTCoordsDataSet, + theTensorsDataSet, + theFieldList, + theOutput); } return true; } @@ -645,7 +645,7 @@ namespace VISU //--------------------------------------------------------------- void GetObjectIdSet(vtkIntArray *theArray, - TObjectIdSet& theObjectIdSet) + TObjectIdSet& theObjectIdSet) { theObjectIdSet.clear(); int aMaxId = theArray->GetMaxId(); @@ -663,7 +663,7 @@ namespace VISU //--------------------------------------------------------------- void GetObjectId2TupleIdMap(vtkIntArray *theArray, - TObjectId2TupleIdMap& theObjectId2TupleIdMap) + TObjectId2TupleIdMap& theObjectId2TupleIdMap) { theObjectId2TupleIdMap.clear(); int* aPointer = theArray->GetPointer(0); @@ -703,17 +703,17 @@ namespace VISU template vtkIntArray* GetIDMapper(VISU::TFieldList* theFieldList, - TGetFieldData theGetFieldData, - const char* theFieldName) + TGetFieldData theGetFieldData, + const char* theFieldName) { VISU::TFieldListIterator anIter(theFieldList); for(anIter.Begin(); !anIter.End() ; anIter.Next()){ const char* aFieldName = anIter.Get()->GetName(); if(strcmp(aFieldName, theFieldName) == 0){ - vtkDataSet* aDataSet = anIter.Get()->Ptr; - vtkFieldData *aFieldData = theGetFieldData(aDataSet); - vtkDataArray *anIDMapper = aFieldData->GetArray(theFieldName); - return dynamic_cast(anIDMapper); + vtkDataSet* aDataSet = anIter.Get()->Ptr; + vtkFieldData *aFieldData = theGetFieldData(aDataSet); + vtkDataArray *anIDMapper = aFieldData->GetArray(theFieldName); + return dynamic_cast(anIDMapper); } } return NULL; @@ -724,8 +724,8 @@ namespace VISU template vtkIntArray* GetIDMapper(vtkDataSet* theIDMapperDataSet, - TGetFieldData theGetFieldData, - const char* theFieldName) + TGetFieldData theGetFieldData, + const char* theFieldName) { vtkFieldData *aFieldData = theGetFieldData(theIDMapperDataSet); vtkDataArray *anIDMapper = aFieldData->GetArray(theFieldName); @@ -736,7 +736,7 @@ namespace VISU //--------------------------------------------------------------- bool IsDifferent(vtkIntArray *theFirstIDMapper, - vtkIntArray *theSecondIDMapper) + vtkIntArray *theSecondIDMapper) { vtkIdType aFirstNbTuples = theFirstIDMapper->GetNumberOfTuples(); vtkIdType aSecondNbTuples = theSecondIDMapper->GetNumberOfTuples(); @@ -748,7 +748,7 @@ namespace VISU int* aSecondPointer = theSecondIDMapper->GetPointer(0); for(int anId = 0; anId <= aMaxId; anId++){ if(*aFirstPointer++ != *aSecondPointer++) - return true; + return true; } return false; @@ -758,8 +758,8 @@ namespace VISU //--------------------------------------------------------------- void GetIntersection(vtkIntArray *theFirstIDMapper, - vtkIntArray *theSecondIDMapper, - TObjectIdArray& theResult) + vtkIntArray *theSecondIDMapper, + TObjectIdArray& theResult) { TObjectIdSet aFirstObjectIdSet; GetObjectIdSet(theFirstIDMapper, aFirstObjectIdSet); @@ -771,57 +771,57 @@ namespace VISU theResult.resize(aMaxLength); TObjectIdArray::iterator anArrayIter = theResult.begin(); anArrayIter = std::set_intersection(aFirstObjectIdSet.begin(), - aFirstObjectIdSet.end(), - aSecondObjectIdSet.begin(), - aSecondObjectIdSet.end(), - anArrayIter); + aFirstObjectIdSet.end(), + aSecondObjectIdSet.begin(), + aSecondObjectIdSet.end(), + anArrayIter); theResult.erase(anArrayIter, theResult.end()); } //--------------------------------------------------------------- bool Execute(vtkUnstructuredGrid *theInput, - vtkUnstructuredGrid *theOutput, - vtkDataSet* theScalarsDataSet, - vtkDataSet* theVectorsDataSet, - vtkDataSet* theNormalsDataSet, - vtkDataSet* theTCoordsDataSet, - vtkDataSet* theTensorsDataSet, - TFieldList* theFieldList, - bool theIsMergingInputs) + vtkUnstructuredGrid *theOutput, + vtkDataSet* theScalarsDataSet, + vtkDataSet* theVectorsDataSet, + vtkDataSet* theNormalsDataSet, + vtkDataSet* theTCoordsDataSet, + vtkDataSet* theTensorsDataSet, + TFieldList* theFieldList, + bool theIsMergingInputs) { return ::Execute(theInput, - theScalarsDataSet, - theVectorsDataSet, - theNormalsDataSet, - theTCoordsDataSet, - theTensorsDataSet, - theFieldList, - theIsMergingInputs, - theOutput); + theScalarsDataSet, + theVectorsDataSet, + theNormalsDataSet, + theTCoordsDataSet, + theTensorsDataSet, + theFieldList, + theIsMergingInputs, + theOutput); } //--------------------------------------------------------------- bool Execute(vtkPolyData *theInput, - vtkPolyData *theOutput, - vtkDataSet* theScalarsDataSet, - vtkDataSet* theVectorsDataSet, - vtkDataSet* theNormalsDataSet, - vtkDataSet* theTCoordsDataSet, - vtkDataSet* theTensorsDataSet, - TFieldList* theFieldList, - bool theIsMergingInputs) + vtkPolyData *theOutput, + vtkDataSet* theScalarsDataSet, + vtkDataSet* theVectorsDataSet, + vtkDataSet* theNormalsDataSet, + vtkDataSet* theTCoordsDataSet, + vtkDataSet* theTensorsDataSet, + TFieldList* theFieldList, + bool theIsMergingInputs) { return ::Execute(theInput, - theScalarsDataSet, - theVectorsDataSet, - theNormalsDataSet, - theTCoordsDataSet, - theTensorsDataSet, - theFieldList, - theIsMergingInputs, - theOutput); + theScalarsDataSet, + theVectorsDataSet, + theNormalsDataSet, + theTCoordsDataSet, + theTensorsDataSet, + theFieldList, + theIsMergingInputs, + theOutput); } } diff --git a/src/CONVERTOR/VISU_MergeFilterUtilities.hxx b/src/CONVERTOR/VISU_MergeFilterUtilities.hxx index 52f74407..d0bfb0f0 100644 --- a/src/CONVERTOR/VISU_MergeFilterUtilities.hxx +++ b/src/CONVERTOR/VISU_MergeFilterUtilities.hxx @@ -86,7 +86,7 @@ namespace VISU void GetObjectId2TupleIdMap(vtkIntArray *theArray, - TObjectId2TupleIdMap& theObjectId2TupleIdMap); + TObjectId2TupleIdMap& theObjectId2TupleIdMap); void GetObjectId2TupleGaussIdArray(vtkIntArray *theArray, @@ -95,48 +95,48 @@ namespace VISU template vtkIntArray* GetIDMapper(VISU::TFieldList* theFieldList, - TGetFieldData theGetFieldData, - const char* theFieldName); + TGetFieldData theGetFieldData, + const char* theFieldName); template vtkIntArray* GetIDMapper(vtkDataSet* theIDMapperDataSet, - TGetFieldData theGetFieldData, - const char* theFieldName); + TGetFieldData theGetFieldData, + const char* theFieldName); bool IsDifferent(vtkIntArray *theFirstIDMapper, - vtkIntArray *theSecondIDMapper); + vtkIntArray *theSecondIDMapper); void GetIntersection(vtkIntArray *theFirstIDMapper, - vtkIntArray *theSecondIDMapper, - TObjectIdArray& theResult); + vtkIntArray *theSecondIDMapper, + TObjectIdArray& theResult); //--------------------------------------------------------------- bool Execute(vtkUnstructuredGrid *theInput, - vtkUnstructuredGrid *theOutput, - vtkDataSet* theScalarsDataSet, - vtkDataSet* theVectorsDataSet, - vtkDataSet* theNormalsDataSet, - vtkDataSet* theTCoordsDataSet, - vtkDataSet* theTensorsDataSet, - TFieldList* theFieldList, - bool theIsMergingInputs); + vtkUnstructuredGrid *theOutput, + vtkDataSet* theScalarsDataSet, + vtkDataSet* theVectorsDataSet, + vtkDataSet* theNormalsDataSet, + vtkDataSet* theTCoordsDataSet, + vtkDataSet* theTensorsDataSet, + TFieldList* theFieldList, + bool theIsMergingInputs); //--------------------------------------------------------------- bool Execute(vtkPolyData *theInput, - vtkPolyData *theOutput, - vtkDataSet* theScalarsDataSet, - vtkDataSet* theVectorsDataSet, - vtkDataSet* theNormalsDataSet, - vtkDataSet* theTCoordsDataSet, - vtkDataSet* theTensorsDataSet, - TFieldList* theFieldList, - bool theIsMergingInputs); + vtkPolyData *theOutput, + vtkDataSet* theScalarsDataSet, + vtkDataSet* theVectorsDataSet, + vtkDataSet* theNormalsDataSet, + vtkDataSet* theTCoordsDataSet, + vtkDataSet* theTensorsDataSet, + TFieldList* theFieldList, + bool theIsMergingInputs); //--------------------------------------------------------------- class TFieldNode @@ -146,8 +146,8 @@ namespace VISU { int length = static_cast(strlen(name)); if (length > 0) { - this->Name = new char[length+1]; - strcpy(this->Name, name); + this->Name = new char[length+1]; + strcpy(this->Name, name); } else { this->Name = 0; } @@ -197,8 +197,8 @@ namespace VISU { TFieldNode* newNode = new TFieldNode(name, ptr); if (!this->First) { - this->First = newNode; - this->Last = newNode; + this->First = newNode; + this->Last = newNode; } else { this->Last->Next = newNode; this->Last = newNode; @@ -229,7 +229,7 @@ namespace VISU void Next() { if (this->Position) { - this->Position = this->Position->Next; + this->Position = this->Position->Next; } } int End() diff --git a/src/CONVERTOR/VISU_MeshValue.hxx b/src/CONVERTOR/VISU_MeshValue.hxx index 4e42e7b2..e29f2922 100644 --- a/src/CONVERTOR/VISU_MeshValue.hxx +++ b/src/CONVERTOR/VISU_MeshValue.hxx @@ -48,8 +48,8 @@ namespace VISU //! To intitilize the data strucutre void Init(vtkIdType theNbElem, - vtkIdType theNbGauss, - vtkIdType theNbComp); + vtkIdType theNbGauss, + vtkIdType theNbComp); //! Gets memory size used by the instance (bytes). virtual @@ -107,11 +107,11 @@ namespace VISU TCValueSliceArr aValueSliceArr(this->myNbGauss); vtkIdType anId = theElemId * this->myStep; for(vtkIdType aGaussId = 0; aGaussId < this->myNbGauss; aGaussId++){ - aValueSliceArr[aGaussId] = - TCValueSlice(this->GetPointer(), - this->size(), - std::slice(anId, this->myNbComp, 1)); - anId += this->myNbComp; + aValueSliceArr[aGaussId] = + TCValueSlice(this->GetPointer(), + this->size(), + std::slice(anId, this->myNbComp, 1)); + anId += this->myNbComp; } return aValueSliceArr; } @@ -123,11 +123,11 @@ namespace VISU TValueSliceArr aValueSliceArr(this->myNbGauss); vtkIdType anId = theElemId * this->myStep; for(vtkIdType aGaussId = 0; aGaussId < this->myNbGauss; aGaussId++){ - aValueSliceArr[aGaussId] = - TValueSlice(this->GetPointer(), - this->size(), - std::slice(anId, this->myNbComp, 1)); - anId += this->myNbComp; + aValueSliceArr[aGaussId] = + TValueSlice(this->GetPointer(), + this->size(), + std::slice(anId, this->myNbComp, 1)); + anId += this->myNbComp; } return aValueSliceArr; } @@ -139,11 +139,11 @@ namespace VISU TCValueSliceArr aValueSliceArr(this->myNbComp); vtkIdType anId = theElemId * this->myStep; for(vtkIdType aCompId = 0; aCompId < this->myNbComp; aCompId++){ - aValueSliceArr[aCompId] = - TCValueSlice(this->GetPointer(), - this->size(), - std::slice(anId, this->myNbGauss, this->myNbComp)); - anId += 1; + aValueSliceArr[aCompId] = + TCValueSlice(this->GetPointer(), + this->size(), + std::slice(anId, this->myNbGauss, this->myNbComp)); + anId += 1; } return aValueSliceArr; } @@ -155,11 +155,11 @@ namespace VISU TValueSliceArr aValueSliceArr(this->myNbComp); vtkIdType anId = theElemId * this->myStep; for(vtkIdType aCompId = 0; aCompId < this->myNbComp; aCompId++){ - aValueSliceArr[aCompId] = - TValueSlice(this->GetPointer(), - this->size(), - std::slice(anId, this->myNbGauss, this->myNbComp)); - anId += 1; + aValueSliceArr[aCompId] = + TValueSlice(this->GetPointer(), + this->size(), + std::slice(anId, this->myNbGauss, this->myNbComp)); + anId += 1; } return aValueSliceArr; } @@ -183,9 +183,9 @@ namespace VISU //! To initilize the class instance void Init(vtkIdType theNbElem, - vtkIdType theNbGauss, - vtkIdType theNbComp, - const TContainerType& theContainer) + vtkIdType theNbGauss, + vtkIdType theNbComp, + const TContainerType& theContainer) { TMeshValueBase::Init(theNbElem, theNbGauss, theNbComp); myContainer = theContainer; @@ -200,17 +200,17 @@ namespace VISU // Initilize corresponding vtkDataSetAttributes for TValForTime void GetTimeStampOnProfile(const PUnstructuredGrid& theSource, - const PFieldImpl& theField, - const PValForTimeImpl& theValForTime, - const VISU::TEntity& theEntity); + const PFieldImpl& theField, + const PValForTimeImpl& theValForTime, + const VISU::TEntity& theEntity); //--------------------------------------------------------------- // Initilize corresponding vtkDataSetAttributes for TValForTime void GetTimeStampOnGaussMesh(const PPolyData& theSource, - const PFieldImpl& theField, - const PValForTimeImpl& theValForTime); + const PFieldImpl& theField, + const PValForTimeImpl& theValForTime); void InitMed2VisuArray(std::vector& anArray, EGeometry aEGeom); diff --git a/src/CONVERTOR/VISU_PointCoords.cxx b/src/CONVERTOR/VISU_PointCoords.cxx index f48cdf2b..189887f1 100644 --- a/src/CONVERTOR/VISU_PointCoords.cxx +++ b/src/CONVERTOR/VISU_PointCoords.cxx @@ -43,7 +43,7 @@ namespace VISU void TCoordHolderBase ::Init(vtkIdType theNbPoints, - vtkIdType theDim) + vtkIdType theDim) { myDim = theDim; myNbPoints = theNbPoints; @@ -159,23 +159,23 @@ namespace VISU vtkIdType aDim = GetDim(); INITMSG(MYDEBUG,"TPointCoords::GetPoints - aNbPoints = "<GetPoints(); - for(vtkIdType aPointId = 0; aPointId < aNbPoints; aPointId++){ - TCCoordSlice aSlice = GetCoordSlice(aPointId); + vtkPoints* aPoints = myPointSet->GetPoints(); + for(vtkIdType aPointId = 0; aPointId < aNbPoints; aPointId++){ + TCCoordSlice aSlice = GetCoordSlice(aPointId); - vtkFloatingPointType aCoords[3] = {0.0, 0.0, 0.0}; - for(vtkIdType aDimId = 0; aDimId < aDim; aDimId++) - aCoords[aDimId] = aSlice[aDimId]; + vtkFloatingPointType aCoords[3] = {0.0, 0.0, 0.0}; + for(vtkIdType aDimId = 0; aDimId < aDim; aDimId++) + aCoords[aDimId] = aSlice[aDimId]; - aPoints->SetPoint(aPointId, aCoords); - } + aPoints->SetPoint(aPointId, aCoords); + } } myIsVTKDone = true; @@ -302,7 +302,7 @@ namespace VISU VISU::TCoord GetCoord(VISU::TCCoordSlice& theCoordSlice, - int theCoordId) + int theCoordId) { return (*myGetCoord[theCoordId])(theCoordSlice); } @@ -324,72 +324,72 @@ namespace VISU // 1D - always along X // 2D - always in XOY plane anIsDimPresent[iDim] = iDim < GetDim(); -// std::string aName = GetName(iDim); -// if ( aName.size() > 1 ) // PAL13021 (PAL12148), aName has size 8 or 16 -// aName = aName.substr(0,1); -// if(aName == "x" || aName == "X") -// anIsDimPresent[eX] = true; -// else if(aName == "y" || aName == "Y") -// anIsDimPresent[eY] = true; -// else if(aName == "z" || aName == "Z") -// anIsDimPresent[eZ] = true; +// std::string aName = GetName(iDim); +// if ( aName.size() > 1 ) // PAL13021 (PAL12148), aName has size 8 or 16 +// aName = aName.substr(0,1); +// if(aName == "x" || aName == "X") +// anIsDimPresent[eX] = true; +// else if(aName == "y" || aName == "Y") +// anIsDimPresent[eY] = true; +// else if(aName == "z" || aName == "Z") +// anIsDimPresent[eZ] = true; } switch(GetDim()){ case 3: - aCoordHelperPtr.reset(new TCoordHelper(aXYZGetCoord)); - break; + aCoordHelperPtr.reset(new TCoordHelper(aXYZGetCoord)); + break; case 2: - if(anIsDimPresent[eY] && anIsDimPresent[eZ]) - aCoordHelperPtr.reset(new TCoordHelper(aYZGetCoord)); - else if(anIsDimPresent[eX] && anIsDimPresent[eZ]) - aCoordHelperPtr.reset(new TCoordHelper(aXZGetCoord)); - else - aCoordHelperPtr.reset(new TCoordHelper(aXYGetCoord)); - break; + if(anIsDimPresent[eY] && anIsDimPresent[eZ]) + aCoordHelperPtr.reset(new TCoordHelper(aYZGetCoord)); + else if(anIsDimPresent[eX] && anIsDimPresent[eZ]) + aCoordHelperPtr.reset(new TCoordHelper(aXZGetCoord)); + else + aCoordHelperPtr.reset(new TCoordHelper(aXYGetCoord)); + break; case 1: - if(anIsDimPresent[eY]) - aCoordHelperPtr.reset(new TCoordHelper(aYGetCoord)); - else if(anIsDimPresent[eZ]) - aCoordHelperPtr.reset(new TCoordHelper(aZGetCoord)); - else - aCoordHelperPtr.reset(new TCoordHelper(aXGetCoord)); - break; + if(anIsDimPresent[eY]) + aCoordHelperPtr.reset(new TCoordHelper(aYGetCoord)); + else if(anIsDimPresent[eZ]) + aCoordHelperPtr.reset(new TCoordHelper(aZGetCoord)); + else + aCoordHelperPtr.reset(new TCoordHelper(aXGetCoord)); + break; } INITMSG(MYDEBUG,"TNamedPointCoords::GetPoints - aNbPoints = "<GetPoints(); - for(vtkIdType aNodeId = 0; aNodeId < GetNbPoints(); aNodeId++){ - TCCoordSlice aCoordSlice = GetCoordSlice(aNodeId); - aPoints->SetPoint(aNodeId, - aCoordHelperPtr->GetCoord(aCoordSlice,eX), - aCoordHelperPtr->GetCoord(aCoordSlice,eY), - aCoordHelperPtr->GetCoord(aCoordSlice,eZ)); - } + vtkPoints* aPoints = myPointSet->GetPoints(); + for(vtkIdType aNodeId = 0; aNodeId < GetNbPoints(); aNodeId++){ + TCCoordSlice aCoordSlice = GetCoordSlice(aNodeId); + aPoints->SetPoint(aNodeId, + aCoordHelperPtr->GetCoord(aCoordSlice,eX), + aCoordHelperPtr->GetCoord(aCoordSlice,eY), + aCoordHelperPtr->GetCoord(aCoordSlice,eZ)); + } } { - vtkIdType aNbTuples = GetNbPoints(); - int anEntity = int(VISU::NODE_ENTITY); - vtkIntArray *aDataArray = vtkIntArray::New(); - aDataArray->SetName("VISU_POINTS_MAPPER"); - aDataArray->SetNumberOfComponents(2); - aDataArray->SetNumberOfTuples(aNbTuples); - int *aPtr = aDataArray->GetPointer(0); - for(vtkIdType aTupleId = 0; aTupleId < aNbTuples; aTupleId++){ - vtkIdType anObjID = GetObjID(aTupleId); - *aPtr++ = anObjID; - *aPtr++ = anEntity; - } - myPointSet->GetPointData()->AddArray(aDataArray); - aDataArray->Delete(); + vtkIdType aNbTuples = GetNbPoints(); + int anEntity = int(VISU::NODE_ENTITY); + vtkIntArray *aDataArray = vtkIntArray::New(); + aDataArray->SetName("VISU_POINTS_MAPPER"); + aDataArray->SetNumberOfComponents(2); + aDataArray->SetNumberOfTuples(aNbTuples); + int *aPtr = aDataArray->GetPointer(0); + for(vtkIdType aTupleId = 0; aTupleId < aNbTuples; aTupleId++){ + vtkIdType anObjID = GetObjID(aTupleId); + *aPtr++ = anObjID; + *aPtr++ = anEntity; + } + myPointSet->GetPointData()->AddArray(aDataArray); + aDataArray->Delete(); } myIsVTKDone = true; diff --git a/src/CONVERTOR/VISU_PointCoords.hxx b/src/CONVERTOR/VISU_PointCoords.hxx index f8624c61..b1fcd87b 100644 --- a/src/CONVERTOR/VISU_PointCoords.hxx +++ b/src/CONVERTOR/VISU_PointCoords.hxx @@ -60,7 +60,7 @@ namespace VISU //! To initilize the instance void Init(vtkIdType theNbPoints, - vtkIdType theDim); + vtkIdType theDim); vtkIdType GetNbPoints() const; @@ -105,8 +105,8 @@ namespace VISU //! To initilize the class instance void Init(vtkIdType theNbPoints, - vtkIdType theDim, - const TContainerType& theCoord) + vtkIdType theDim, + const TContainerType& theCoord) { TCoordHolderBase::Init(theNbPoints, theDim); myCoord = theCoord; @@ -128,8 +128,8 @@ namespace VISU GetCoordSlice(vtkIdType theNodeId) const { return TCCoordSlice(this->GetPointer(), - this->size(), - std::slice(theNodeId * this->GetDim(), this->GetDim(), 1)); + this->size(), + std::slice(theNodeId * this->GetDim(), this->GetDim(), 1)); } //! Get slice of coordinates for defined node @@ -138,8 +138,8 @@ namespace VISU GetCoordSlice(vtkIdType theNodeId) { return TCoordSlice(this->GetPointer(), - this->size(), - std::slice(theNodeId * this->GetDim(), this->GetDim(), 1)); + this->size(), + std::slice(theNodeId * this->GetDim(), this->GetDim(), 1)); } virtual diff --git a/src/CONVERTOR/VISU_Structures.hxx b/src/CONVERTOR/VISU_Structures.hxx index d9f08fb0..70f620fb 100644 --- a/src/CONVERTOR/VISU_Structures.hxx +++ b/src/CONVERTOR/VISU_Structures.hxx @@ -186,7 +186,7 @@ namespace VISU //--------------------------------------------------------------- //! Define a basic class for MED FAMILY entity struct VISU_CONVERTOR_EXPORT TFamily: virtual TIntId, - virtual TUnstructuredGridIDMapper + virtual TUnstructuredGridIDMapper { TEntity myEntity; //!< Referes to MED ENTITY where the TFamily belongs to. TName myName; //!< Contains name of the corresponding MED FAMILY diff --git a/src/CONVERTOR/VISU_Structures_impl.hxx b/src/CONVERTOR/VISU_Structures_impl.hxx index baec9a32..8b96bd1b 100644 --- a/src/CONVERTOR/VISU_Structures_impl.hxx +++ b/src/CONVERTOR/VISU_Structures_impl.hxx @@ -102,7 +102,7 @@ namespace VISU //--------------------------------------------------------------- //! Define an intermediate class which unifies memory size calculation struct VISU_CONVERTOR_EXPORT TMemoryCheckIDMapper: public virtual TIsVTKDone, - public virtual TIDMapper + public virtual TIDMapper { //! Gets memory size used by the instance (bytes). virtual @@ -185,7 +185,7 @@ namespace VISU //--------------------------------------------------------------- //! Specialize TMesh to provide VTK mapping for nodes struct VISU_CONVERTOR_EXPORT TMeshImpl: virtual TMesh, - virtual TIsVTKDone + virtual TIsVTKDone { PNamedPointCoords myNamedPointCoords; //!< Keeps intermediate representation of the nodes vtkIdType myNbPoints; //!< Keeps number of the nodes @@ -209,7 +209,7 @@ namespace VISU //! Specialize TSubProfile to provide VTK mapping struct VISU_CONVERTOR_EXPORT TSubProfileImpl: virtual TSubProfile, - virtual TUnstructuredGridHolder + virtual TUnstructuredGridHolder { TSubProfileImpl(); @@ -248,7 +248,7 @@ namespace VISU //! Specialize TProfile to provide VTK mapping for MED TIMESTAMP mesh struct VISU_CONVERTOR_EXPORT TProfileImpl: virtual TProfile, - virtual TAppendFilterHolder + virtual TAppendFilterHolder { TProfileImpl(); bool myIsAll; //!< Say, whether the MED TIMESTAMP defined on all MED ENTITY or not @@ -315,7 +315,7 @@ namespace VISU //--------------------------------------------------------------- //! Specialize TIDMapper to provide VTK mapping for MED TIMESTAMP mesh struct TUnstructuredGridIDMapperImpl: virtual TMergeFilterHolder, - virtual TUnstructuredGridIDMapper + virtual TUnstructuredGridIDMapper { PAppendFilterHolder myIDMapper; //!< Responsible for numbering PCommonCellsFilter myCommonCellsFilter; @@ -382,7 +382,7 @@ namespace VISU //--------------------------------------------------------------- //! Specialize TIDMapper to provide VTK mapping for MED TIMESTAMP mesh struct TPolyDataIDMapperImpl: virtual TMergeFilterHolder, - virtual TPolyDataIDMapper + virtual TPolyDataIDMapper { PAppendPolyDataHolder myIDMapper; //!< Responsible for numbering @@ -455,14 +455,14 @@ namespace VISU virtual void LessThan(const PGaussImpl& theGauss, - bool& theResult) const; + bool& theResult) const; }; //--------------------------------------------------------------- //! Specialize TGaussSubMesh to provide VTK mapping for the entity struct VISU_CONVERTOR_EXPORT TGaussSubMeshImpl: virtual TGaussSubMesh, - virtual TPolyDataHolder + virtual TPolyDataHolder { TGaussSubMeshImpl(); @@ -513,7 +513,7 @@ namespace VISU //! Specialize TGaussMesh to provide VTK mapping for the entity struct VISU_CONVERTOR_EXPORT TGaussMeshImpl: virtual TGaussMesh, - virtual TAppendPolyDataHolder + virtual TAppendPolyDataHolder { TGaussMeshImpl(); @@ -551,7 +551,7 @@ namespace VISU //--------------------------------------------------------------- //! Specialize TGaussPtsIDMapper to provide VTK mapping for MED TIMESTAMP mesh struct VISU_CONVERTOR_EXPORT TGaussPtsIDFilter: virtual TPolyDataIDMapperImpl, - virtual TGaussPtsIDMapper + virtual TGaussPtsIDMapper { PGaussPtsIDMapper myGaussPtsIDMapper; @@ -623,8 +623,8 @@ namespace VISU //! Specialize TMeshOnEntity to provide VTK mapping for the entity struct VISU_CONVERTOR_EXPORT TMeshOnEntityImpl: virtual TMeshOnEntity, - virtual TAppendFilterHolder, - virtual TSizeCounter + virtual TAppendFilterHolder, + virtual TSizeCounter { TMeshOnEntityImpl(); @@ -686,7 +686,7 @@ namespace VISU //! Specialize TFamily to provide VTK mapping for the entity struct VISU_CONVERTOR_EXPORT TFamilyImpl: virtual TFamily, - virtual TUnstructuredGridHolder + virtual TUnstructuredGridHolder { //! Reimplements the TStructured::CopyStructure virtual @@ -738,7 +738,7 @@ namespace VISU //! Specialize TGroup to provide VTK mapping for the entity struct VISU_CONVERTOR_EXPORT TGroupImpl: virtual TGroup, - virtual TAppendFilterHolder + virtual TAppendFilterHolder { //! Reimplements the TStructured::CopyStructure virtual @@ -801,7 +801,7 @@ namespace VISU //! To initialize the data structure void Init(vtkIdType theNbComp, - vtkIdType theDataType); + vtkIdType theDataType); //! Gets type idetificator of the mesh data. vtkIdType diff --git a/src/CONVERTOR/VISU_TableReader.cxx b/src/CONVERTOR/VISU_TableReader.cxx index 475771ee..caeb9ac9 100644 --- a/src/CONVERTOR/VISU_TableReader.cxx +++ b/src/CONVERTOR/VISU_TableReader.cxx @@ -125,7 +125,7 @@ namespace while ( theStmIn.get( tmp ) ) { aStrOut<= 0 ) { - data = aTmp.left( index ).trimmed(); - cmt = aTmp.mid( index+1 ).trimmed(); + data = aTmp.left( index ).trimmed(); + cmt = aTmp.mid( index+1 ).trimmed(); } // if comment is not empty, try to get keyword from it (separated by ':' symbol) if ( !cmt.isEmpty() ) { - int index1 = cmt.indexOf( ":" ); - if ( index1 >= 0 ) { - QString tmpstr = cmt.left( index1 ).trimmed(); - if ( tmpstr == QString( "TITLE" ) || - tmpstr == QString( "COLUMN_TITLES" ) || - tmpstr == QString( "COLUMN_UNITS" ) || - tmpstr == QString( "COMMENT" ) ) { - keyword = tmpstr; - cmt = cmt.mid( index1+1 ).trimmed(); - } - } + int index1 = cmt.indexOf( ":" ); + if ( index1 >= 0 ) { + QString tmpstr = cmt.left( index1 ).trimmed(); + if ( tmpstr == QString( "TITLE" ) || + tmpstr == QString( "COLUMN_TITLES" ) || + tmpstr == QString( "COLUMN_UNITS" ) || + tmpstr == QString( "COMMENT" ) ) { + keyword = tmpstr; + cmt = cmt.mid( index1+1 ).trimmed(); + } + } } // if data is empty, process only comment if ( data.isEmpty() ) { - // if keyword is found, try to process it - // elsewise it is a simple comment, just ignore it - if ( !keyword.isEmpty() ) { - if ( keyword == QString( "TITLE" ) ) { - QString title = cmt; - if ( aTable2D.myTitle != "" ) - title = QString( aTable2D.myTitle.c_str() ) + QString( " " ) + title; - if(MYDEBUG) std::cout << "...Table TITLE is: " << title.toLatin1().constData() << std::endl; - aTable2D.myTitle = title.toLatin1().constData(); - } - else if ( keyword == QString( "COLUMN_TITLES" ) ) { - // comment may contain column headers - QStringList aStrList = cmt.split( "|", QString::SkipEmptyParts ); - if(MYDEBUG) std::cout << "...Column TITLES are: "; - for ( int i = 0; i < aStrList.count(); i++ ) { - QString tmpstr = aStrList[ i ].trimmed(); - if(MYDEBUG) std::cout << tmpstr.toLatin1().constData() << " "; - aTable2D.myColumnTitles.push_back( tmpstr.toLatin1().constData() ); - } - if(MYDEBUG) std::cout << std::endl; - } - else if ( keyword == QString( "COLUMN_UNITS" ) ) { - // comment may contain column units - QStringList aStrList = cmt.split( " ", QString::SkipEmptyParts ); - if(MYDEBUG) std::cout << "...Column UNITS are: "; - for ( int i = 0; i < aStrList.count(); i++ ) { - QString tmpstr = aStrList[ i ].trimmed(); - if(MYDEBUG) std::cout << tmpstr.toLatin1().constData() << " "; - aTable2D.myColumnUnits.push_back( tmpstr.toLatin1().constData() ); - } - if(MYDEBUG) std::cout << std::endl; - } - else if ( keyword == QString( "COMMENT" ) ) { - // keyword 'COMMENT' processing can be here - // currently it is ignored - if(MYDEBUG) std::cout << "...COMMENT: " << cmt.toLatin1().constData() << std::endl; - } - } - else { - if(MYDEBUG) std::cout << "...comment: " << cmt.toLatin1().constData() << std::endl; - // simple comment processing can be here - // currently it is ignored - } + // if keyword is found, try to process it + // elsewise it is a simple comment, just ignore it + if ( !keyword.isEmpty() ) { + if ( keyword == QString( "TITLE" ) ) { + QString title = cmt; + if ( aTable2D.myTitle != "" ) + title = QString( aTable2D.myTitle.c_str() ) + QString( " " ) + title; + if(MYDEBUG) std::cout << "...Table TITLE is: " << title.toLatin1().constData() << std::endl; + aTable2D.myTitle = title.toLatin1().constData(); + } + else if ( keyword == QString( "COLUMN_TITLES" ) ) { + // comment may contain column headers + QStringList aStrList = cmt.split( "|", QString::SkipEmptyParts ); + if(MYDEBUG) std::cout << "...Column TITLES are: "; + for ( int i = 0; i < aStrList.count(); i++ ) { + QString tmpstr = aStrList[ i ].trimmed(); + if(MYDEBUG) std::cout << tmpstr.toLatin1().constData() << " "; + aTable2D.myColumnTitles.push_back( tmpstr.toLatin1().constData() ); + } + if(MYDEBUG) std::cout << std::endl; + } + else if ( keyword == QString( "COLUMN_UNITS" ) ) { + // comment may contain column units + QStringList aStrList = cmt.split( " ", QString::SkipEmptyParts ); + if(MYDEBUG) std::cout << "...Column UNITS are: "; + for ( int i = 0; i < aStrList.count(); i++ ) { + QString tmpstr = aStrList[ i ].trimmed(); + if(MYDEBUG) std::cout << tmpstr.toLatin1().constData() << " "; + aTable2D.myColumnUnits.push_back( tmpstr.toLatin1().constData() ); + } + if(MYDEBUG) std::cout << std::endl; + } + else if ( keyword == QString( "COMMENT" ) ) { + // keyword 'COMMENT' processing can be here + // currently it is ignored + if(MYDEBUG) std::cout << "...COMMENT: " << cmt.toLatin1().constData() << std::endl; + } + } + else { + if(MYDEBUG) std::cout << "...comment: " << cmt.toLatin1().constData() << std::endl; + // simple comment processing can be here + // currently it is ignored + } } // if data is not empty, try to process it else { - TTable2D::TRow aRow; - if(MYDEBUG) std::cout << "...New row is found: " << std::endl; - if ( !cmt.isEmpty() ) { - aRow.myTitle = cmt.toLatin1().constData(); - if(MYDEBUG) std::cout << "......ROW TITLE is: " << cmt.toLatin1().constData() << std::endl; - } - QString datar1 = data.replace(QRegExp("\t"), " "); - QStringList aValList = datar1.split( " ", QString::SkipEmptyParts ); - for ( int i = 0; i < aValList.count(); i++ ) { - if ( aValList[i].trimmed() != "" ) { - TTable2D::TValue aVal = aValList[i].trimmed().toLatin1().constData(); - aRow.myValues.push_back( aVal ); - } - } - if( aRow.myValues.size() > 0 ) - aTable2D.myRows.push_back( aRow ); - // ************** OLD CODE ****************** - /* - TValue aVal; - istrstream aStream( data ); - aStream.precision( STRPRECISION ); - while( aStream >> aVal ) { - aRow.myValues.push_back( aVal ); - } - if( aRow.myValues.size() > 0 ) - aTable2D.myRows.push_back( aRow ); - */ - // ************** OLD CODE ****************** + TTable2D::TRow aRow; + if(MYDEBUG) std::cout << "...New row is found: " << std::endl; + if ( !cmt.isEmpty() ) { + aRow.myTitle = cmt.toLatin1().constData(); + if(MYDEBUG) std::cout << "......ROW TITLE is: " << cmt.toLatin1().constData() << std::endl; + } + QString datar1 = data.replace(QRegExp("\t"), " "); + QStringList aValList = datar1.split( " ", QString::SkipEmptyParts ); + for ( int i = 0; i < aValList.count(); i++ ) { + if ( aValList[i].trimmed() != "" ) { + TTable2D::TValue aVal = aValList[i].trimmed().toLatin1().constData(); + aRow.myValues.push_back( aVal ); + } + } + if( aRow.myValues.size() > 0 ) + aTable2D.myRows.push_back( aRow ); + // ************** OLD CODE ****************** + /* + TValue aVal; + istrstream aStream( data ); + aStream.precision( STRPRECISION ); + while( aStream >> aVal ) { + aRow.myValues.push_back( aVal ); + } + if( aRow.myValues.size() > 0 ) + aTable2D.myRows.push_back( aRow ); + */ + // ************** OLD CODE ****************** } ::getLine( aStmIn, aTmp ); } diff --git a/src/CONVERTOR/VISU_TypeList.hxx b/src/CONVERTOR/VISU_TypeList.hxx index d70dabef..bf548181 100644 --- a/src/CONVERTOR/VISU_TypeList.hxx +++ b/src/CONVERTOR/VISU_TypeList.hxx @@ -115,8 +115,8 @@ namespace VISU typedef typename TSequence< T02, T03, T04, T05, T06, T07, T08, T09, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, - T31, T32, T33, T34, T35, T36, T37, T38, T39, T40 - >::TResult + T31, T32, T33, T34, T35, T36, T37, T38, T39, T40 + >::TResult TailResult; public: typedef TList< T01, TailResult > TResult; diff --git a/src/CONVERTOR/VISU_UsedPointsFilter.cxx b/src/CONVERTOR/VISU_UsedPointsFilter.cxx index fc6bd810..660a6183 100644 --- a/src/CONVERTOR/VISU_UsedPointsFilter.cxx +++ b/src/CONVERTOR/VISU_UsedPointsFilter.cxx @@ -88,7 +88,7 @@ void VISU_UsedPointsFilter::Execute(){ vtkIdType anOldId = anOldPointsIds->GetId(i); TId2IdMap::iterator anIter = aId2IdMap.find(anOldId); if(anIter == aId2IdMap.end()) - goto NEXT_CELL; + goto NEXT_CELL; vtkIdType aNewId = anIter->second; aNewPointsIds->InsertNextId(aNewId); } diff --git a/src/CONVERTOR/VISU_VTKTypeList.hxx b/src/CONVERTOR/VISU_VTKTypeList.hxx index b76d7797..d0b2862c 100644 --- a/src/CONVERTOR/VISU_VTKTypeList.hxx +++ b/src/CONVERTOR/VISU_VTKTypeList.hxx @@ -49,41 +49,41 @@ namespace VISU { //---------------------------------------------------------------------------- typedef TSequence< char, - unsigned char, - short, - unsigned short, - int, - unsigned int, - long, - unsigned long, - float, - double >::TResult TVTKBasicTypeList; + unsigned char, + short, + unsigned short, + int, + unsigned int, + long, + unsigned long, + float, + double >::TResult TVTKBasicTypeList; //---------------------------------------------------------------------------- typedef TSequence< vtkCharArray, - vtkUnsignedCharArray, - vtkShortArray, - vtkUnsignedShortArray, - vtkIntArray, - vtkUnsignedIntArray, - vtkLongArray, - vtkUnsignedLongArray, - vtkFloatArray, - vtkDoubleArray >::TResult TVTKArrayTypeList; + vtkUnsignedCharArray, + vtkShortArray, + vtkUnsignedShortArray, + vtkIntArray, + vtkUnsignedIntArray, + vtkLongArray, + vtkUnsignedLongArray, + vtkFloatArray, + vtkDoubleArray >::TResult TVTKArrayTypeList; //---------------------------------------------------------------------------- typedef TSequence< TInt2Type< VTK_CHAR >, - TInt2Type< VTK_UNSIGNED_CHAR >, - TInt2Type< VTK_SHORT >, - TInt2Type< VTK_UNSIGNED_SHORT >, - TInt2Type< VTK_INT >, - TInt2Type< VTK_UNSIGNED_INT >, - TInt2Type< VTK_LONG >, - TInt2Type< VTK_UNSIGNED_LONG >, - TInt2Type< VTK_FLOAT >, - TInt2Type< VTK_DOUBLE > >::TResult TVTKBasicEnumList; + TInt2Type< VTK_UNSIGNED_CHAR >, + TInt2Type< VTK_SHORT >, + TInt2Type< VTK_UNSIGNED_SHORT >, + TInt2Type< VTK_INT >, + TInt2Type< VTK_UNSIGNED_INT >, + TInt2Type< VTK_LONG >, + TInt2Type< VTK_UNSIGNED_LONG >, + TInt2Type< VTK_FLOAT >, + TInt2Type< VTK_DOUBLE > >::TResult TVTKBasicEnumList; //---------------------------------------------------------------------------- diff --git a/src/CONVERTOR/VISU_Vtk2MedConvertor.cxx b/src/CONVERTOR/VISU_Vtk2MedConvertor.cxx index f50d10e3..b6e3a872 100644 --- a/src/CONVERTOR/VISU_Vtk2MedConvertor.cxx +++ b/src/CONVERTOR/VISU_Vtk2MedConvertor.cxx @@ -78,33 +78,33 @@ using namespace std; /* # = dynamic_cast( );define VTK_EMPTY_CELL 0 -#define VTK_VERTEX 1 -#define VTK_POLY_VERTEX 2 -#define VTK_LINE 3 -#define VTK_POLY_LINE 4 -#define VTK_TRIANGLE 5 -#define VTK_TRIANGLE_STRIP 6 -#define VTK_POLYGON 7 -#define VTK_PIXEL 8 -#define VTK_QUAD 9 -#define VTK_TETRA 10 -#define VTK_VOXEL 11 -#define VTK_HEXAHEDRON 12 -#define VTK_WEDGE 13 -#define VTK_PYRAMID 14 -#define VTK_QUADRATIC_EDGE 21 -#define VTK_QUADRATIC_TRiTSIANGLE 22 -#define VTK_QUADRATIC_QUAD 23 -#define VTK_QUADRATIC_TETRA 24 -#define VTK_QUADRATIC_HEXAHEDRON 25 -#define VTK_CONVEX_POINT_SET 41 -#define VTK_PARAMETRIC_CURVE 51 -#define VTK_PARAMETRIC_SURFACE 52 -#define VTK_PARAMETRIC_TRI_SURFACE 53 -#define VTK_PARAMETRIC_QUAD_SURFACE 54 -#define VTK_PARAMETRIC_TETRA_REGION 55 -#define VTK_PARAMETRIC_HEX_REGION 56 +*>( );define VTK_EMPTY_CELL 0 +#define VTK_VERTEX 1 +#define VTK_POLY_VERTEX 2 +#define VTK_LINE 3 +#define VTK_POLY_LINE 4 +#define VTK_TRIANGLE 5 +#define VTK_TRIANGLE_STRIP 6 +#define VTK_POLYGON 7 +#define VTK_PIXEL 8 +#define VTK_QUAD 9 +#define VTK_TETRA 10 +#define VTK_VOXEL 11 +#define VTK_HEXAHEDRON 12 +#define VTK_WEDGE 13 +#define VTK_PYRAMID 14 +#define VTK_QUADRATIC_EDGE 21 +#define VTK_QUADRATIC_TRiTSIANGLE 22 +#define VTK_QUADRATIC_QUAD 23 +#define VTK_QUADRATIC_TETRA 24 +#define VTK_QUADRATIC_HEXAHEDRON 25 +#define VTK_CONVEX_POINT_SET 41 +#define VTK_PARAMETRIC_CURVE 51 +#define VTK_PARAMETRIC_SURFACE 52 +#define VTK_PARAMETRIC_TRI_SURFACE 53 +#define VTK_PARAMETRIC_QUAD_SURFACE 54 +#define VTK_PARAMETRIC_TETRA_REGION 55 +#define VTK_PARAMETRIC_HEX_REGION 56 */ static MED::EGeometrieElement VTK2MED( const int theGeom ) diff --git a/src/CONVERTOR/VISU_Vtk2MedConvertor.hxx b/src/CONVERTOR/VISU_Vtk2MedConvertor.hxx index aec54656..50610707 100644 --- a/src/CONVERTOR/VISU_Vtk2MedConvertor.hxx +++ b/src/CONVERTOR/VISU_Vtk2MedConvertor.hxx @@ -51,11 +51,11 @@ public: VISU_Vtk2MedConvertor(); VISU_Vtk2MedConvertor( const std::string theMEDFileName, - const std::string theFirstVTKFileName ); + const std::string theFirstVTKFileName ); VISU_Vtk2MedConvertor( const std::string theMEDFileName, - const std::string theFirstVTKFileName, - const TVectorString theDataVTKFileNames ); + const std::string theFirstVTKFileName, + const TVectorString theDataVTKFileNames ); void setMEDFileName( const std::string theFileName ); @@ -105,58 +105,58 @@ private: // Fill container with indices of cells which match given type. void GetIdsOfCellsOfType( vtkDataSet* theInput, // input - const int type, // input - vtkIntArray *array ); // output + const int type, // input + vtkIntArray *array ); // output // ret value 0 - OK // ret value 1 - ERROR int Geometry2MED( vtkDataSet* aInput, - MED::PWrapper myMed, - MED::PMeshInfo aMeshInfo, - TGeom2CellIds& outGeom2CellIdMap ); + MED::PWrapper myMed, + MED::PMeshInfo aMeshInfo, + TGeom2CellIds& outGeom2CellIdMap ); // ret value 0 - OK // ret value 1 - ERROR int Data2MED( std::vector theListForAdd, - MED::PWrapper myMed, - MED::PMeshInfo theMeshInfo, - TGeom2CellIds& theGeom2CellIdMap ); + MED::PWrapper myMed, + MED::PMeshInfo theMeshInfo, + TGeom2CellIds& theGeom2CellIdMap ); // ret value 0 - OK // ret value 1 - ERROR int CreateElements( vtkDataSet* theInput, - MED::PMeshInfo theMeshInfo, - MED::PWrapper theMed, - vtkIntArray* theCellsMapper, - MED::EEntiteMaillage theEntity, - int theVTKGeom, - int nbPointsInGeom, - std::vector& theNumberingConvertor, - TGeom2CellIds& theGeom2CellIdMap ); + MED::PMeshInfo theMeshInfo, + MED::PWrapper theMed, + vtkIntArray* theCellsMapper, + MED::EEntiteMaillage theEntity, + int theVTKGeom, + int nbPointsInGeom, + std::vector& theNumberingConvertor, + TGeom2CellIds& theGeom2CellIdMap ); // ret value 0 - OK // ret value 1 - ERROR int CreatePolygons( vtkDataSet* theInput, - MED::PMeshInfo theMeshInfo, - MED::PWrapper theMed, - vtkIntArray* theCellsMapper, - MED::EEntiteMaillage theEntity, - TGeom2CellIds& theGeom2CellIdMap ); + MED::PMeshInfo theMeshInfo, + MED::PWrapper theMed, + vtkIntArray* theCellsMapper, + MED::EEntiteMaillage theEntity, + TGeom2CellIds& theGeom2CellIdMap ); // ret value 0 - OK // ret value 1 - ERROR int CreatePolyedres( vtkDataSet* theInput, - MED::PMeshInfo theMeshInfo, - MED::PWrapper theMed, - vtkIntArray* theCellsMapper, - MED::EEntiteMaillage theEntity, - TGeom2CellIds& theGeom2CellIdMap ); + MED::PMeshInfo theMeshInfo, + MED::PWrapper theMed, + vtkIntArray* theCellsMapper, + MED::EEntiteMaillage theEntity, + TGeom2CellIds& theGeom2CellIdMap ); }; diff --git a/src/GUITOOLS/VisuGUI_TableDlg.cxx b/src/GUITOOLS/VisuGUI_TableDlg.cxx index cc5a8b70..b782a881 100644 --- a/src/GUITOOLS/VisuGUI_TableDlg.cxx +++ b/src/GUITOOLS/VisuGUI_TableDlg.cxx @@ -139,7 +139,7 @@ protected: bool testUnits = ( myOrientation == Qt::Horizontal && col == 0 ) || ( myOrientation == Qt::Vertical && row == 0 ); QWidget* wg = QTable::createEditor( row, col, initFromCell ); if ( wg && wg->inherits("QLineEdit") && myValidator && !testUnits ) - (( QLineEdit*)wg)->setValidator( myValidator ); + (( QLineEdit*)wg)->setValidator( myValidator ); return wg; } @@ -152,11 +152,11 @@ protected: Constructor */ VisuGUI_TableDlg::VisuGUI_TableDlg( QWidget* parent, - _PTR(SObject) obj, - bool edit, - int which, - Qt::Orientation orient, - bool showColumnTitles ) + _PTR(SObject) obj, + bool edit, + int which, + Qt::Orientation orient, + bool showColumnTitles ) : QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ), myIntTable( 0 ), myRealTable( 0 ) { @@ -274,104 +274,104 @@ void VisuGUI_TableDlg::onOK() _PTR(StudyBuilder) builder = study->NewBuilder(); builder->NewCommand(); // start transaction !!!!!!!!!!!!!!!!!!!!!!!!!!!!! try { - if ( myIntTable ) { - builder->RemoveAttribute( myObject, "AttributeTableOfInteger" ); - tblIntAttr = builder->FindOrCreateAttribute( myObject, "AttributeTableOfInteger" ); + if ( myIntTable ) { + builder->RemoveAttribute( myObject, "AttributeTableOfInteger" ); + tblIntAttr = builder->FindOrCreateAttribute( myObject, "AttributeTableOfInteger" ); - int i; - int nbRows = myIntTable->getNumRows(); - int nbCols = myIntTable->getNumCols(); - QString tlt = myIntTable->getTableTitle(); - QStringList rowTitles, colTitles, units; - myIntTable->getRowTitles( rowTitles ); - myIntTable->getColTitles( colTitles ); - myIntTable->getUnits( units ); - - if ( nbRows > 0) { - // data - int nRow = 0; - tblIntAttr->SetNbColumns( nbCols ); - for ( i = 0; i < nbRows; i++ ) { - QStringList data; - myIntTable->getRowData( i, data ); - bool bEmptyRow = true; - for ( int j = 0; j < data.count(); j++ ) { - if ( !data[ j ].isNull() ) { - tblIntAttr->PutValue( data[ j ].toInt(), nRow+1, j+1 ); - bEmptyRow = false; - } - } - if ( !bEmptyRow ) { // Skip rows with no data !!! - // set row title - tblIntAttr->SetRowTitle( nRow+1, rowTitles[ i ].isNull() ? "" : (const char*)rowTitles[ i ].toLatin1() ); - // set row unit - tblIntAttr->SetRowUnit( nRow+1, units[ i ].isNull() ? "" : (const char*)units[ i ].toLatin1() ); - nRow++; - } - } - if ( nRow > 0 ) { // Set columns only if table is not empty, otherwise exception is raised !!! - // column titles - for ( i = 0; i < colTitles.count(); i++ ) - tblIntAttr->SetColumnTitle( i+1, colTitles[ i ].isNull() ? "" : (const char*)colTitles[ i ].toLatin1() ); - } - } - // title - tblIntAttr->SetTitle( (const char*)myIntTable->getTableTitle().toLatin1() ); - } - if ( myRealTable ) { - builder->RemoveAttribute( myObject, "AttributeTableOfReal" ); - tblRealAttr = builder->FindOrCreateAttribute( myObject, "AttributeTableOfReal" ); + int i; + int nbRows = myIntTable->getNumRows(); + int nbCols = myIntTable->getNumCols(); + QString tlt = myIntTable->getTableTitle(); + QStringList rowTitles, colTitles, units; + myIntTable->getRowTitles( rowTitles ); + myIntTable->getColTitles( colTitles ); + myIntTable->getUnits( units ); + + if ( nbRows > 0) { + // data + int nRow = 0; + tblIntAttr->SetNbColumns( nbCols ); + for ( i = 0; i < nbRows; i++ ) { + QStringList data; + myIntTable->getRowData( i, data ); + bool bEmptyRow = true; + for ( int j = 0; j < data.count(); j++ ) { + if ( !data[ j ].isNull() ) { + tblIntAttr->PutValue( data[ j ].toInt(), nRow+1, j+1 ); + bEmptyRow = false; + } + } + if ( !bEmptyRow ) { // Skip rows with no data !!! + // set row title + tblIntAttr->SetRowTitle( nRow+1, rowTitles[ i ].isNull() ? "" : (const char*)rowTitles[ i ].toLatin1() ); + // set row unit + tblIntAttr->SetRowUnit( nRow+1, units[ i ].isNull() ? "" : (const char*)units[ i ].toLatin1() ); + nRow++; + } + } + if ( nRow > 0 ) { // Set columns only if table is not empty, otherwise exception is raised !!! + // column titles + for ( i = 0; i < colTitles.count(); i++ ) + tblIntAttr->SetColumnTitle( i+1, colTitles[ i ].isNull() ? "" : (const char*)colTitles[ i ].toLatin1() ); + } + } + // title + tblIntAttr->SetTitle( (const char*)myIntTable->getTableTitle().toLatin1() ); + } + if ( myRealTable ) { + builder->RemoveAttribute( myObject, "AttributeTableOfReal" ); + tblRealAttr = builder->FindOrCreateAttribute( myObject, "AttributeTableOfReal" ); - int i; - int nbRows = myRealTable->getNumRows(); - int nbCols = myRealTable->getNumCols(); - QString tlt = myRealTable->getTableTitle(); - QStringList rowTitles, colTitles, units; - myRealTable->getRowTitles( rowTitles ); - myRealTable->getColTitles( colTitles ); - myRealTable->getUnits( units ); - - if ( nbRows > 0) { - // data - int nRow = 0; - tblRealAttr->SetNbColumns( nbCols ); - for ( i = 0; i < nbRows; i++ ) { - QStringList data; - myRealTable->getRowData( i, data ); - bool bEmptyRow = true; - for ( int j = 0; j < data.count(); j++ ) { - if ( !data[ j ].isNull() ) { - tblRealAttr->PutValue( data[ j ].toDouble(), nRow+1, j+1 ); - bEmptyRow = false; - } - } - if ( !bEmptyRow ) { // Skip rows with no data !!! - // set row title - tblRealAttr->SetRowTitle( nRow+1, rowTitles[ i ].isNull() ? "" : (const char*)rowTitles[ i ].toLatin1() ); - // set row unit - tblRealAttr->SetRowUnit( nRow+1, units[ i ].isNull() ? "" : (const char*)units[ i ].toLatin1() ); - nRow++; - } - } - if ( nRow > 0 ) { // Set columns only if table is not empty, otherwise exception is raised !!! - // column titles - for ( i = 0; i < colTitles.count(); i++ ) - tblRealAttr->SetColumnTitle( i+1, colTitles[ i ].isNull() ? "" : (const char*)colTitles[ i ].toLatin1() ); - } - } - // title - tblRealAttr->SetTitle( (const char*)myRealTable->getTableTitle().toLatin1() ); - } - if ( myIntTable || myRealTable) - builder->CommitCommand(); // commit transaction !!!!!!!!!!!!!!!!!!!!!!!!!!! - else - builder->AbortCommand(); // abort transaction !!!!!!!!!!!!!!!!!!!!!!!!!!! + int i; + int nbRows = myRealTable->getNumRows(); + int nbCols = myRealTable->getNumCols(); + QString tlt = myRealTable->getTableTitle(); + QStringList rowTitles, colTitles, units; + myRealTable->getRowTitles( rowTitles ); + myRealTable->getColTitles( colTitles ); + myRealTable->getUnits( units ); + + if ( nbRows > 0) { + // data + int nRow = 0; + tblRealAttr->SetNbColumns( nbCols ); + for ( i = 0; i < nbRows; i++ ) { + QStringList data; + myRealTable->getRowData( i, data ); + bool bEmptyRow = true; + for ( int j = 0; j < data.count(); j++ ) { + if ( !data[ j ].isNull() ) { + tblRealAttr->PutValue( data[ j ].toDouble(), nRow+1, j+1 ); + bEmptyRow = false; + } + } + if ( !bEmptyRow ) { // Skip rows with no data !!! + // set row title + tblRealAttr->SetRowTitle( nRow+1, rowTitles[ i ].isNull() ? "" : (const char*)rowTitles[ i ].toLatin1() ); + // set row unit + tblRealAttr->SetRowUnit( nRow+1, units[ i ].isNull() ? "" : (const char*)units[ i ].toLatin1() ); + nRow++; + } + } + if ( nRow > 0 ) { // Set columns only if table is not empty, otherwise exception is raised !!! + // column titles + for ( i = 0; i < colTitles.count(); i++ ) + tblRealAttr->SetColumnTitle( i+1, colTitles[ i ].isNull() ? "" : (const char*)colTitles[ i ].toLatin1() ); + } + } + // title + tblRealAttr->SetTitle( (const char*)myRealTable->getTableTitle().toLatin1() ); + } + if ( myIntTable || myRealTable) + builder->CommitCommand(); // commit transaction !!!!!!!!!!!!!!!!!!!!!!!!!!! + else + builder->AbortCommand(); // abort transaction !!!!!!!!!!!!!!!!!!!!!!!!!!! } catch( ... ) { - MESSAGE("VisuGUI_TableDlg::onOK : Exception has been caught !!!"); - builder->AbortCommand(); // abort transaction !!!!!!!!!!!!!!!!!!!!!!!!!!! - done = false; - SUIT_MessageBox::critical ( this, tr("ERR_ERROR"), tr("ERR_APP_EXCEPTION") ); + MESSAGE("VisuGUI_TableDlg::onOK : Exception has been caught !!!"); + builder->AbortCommand(); // abort transaction !!!!!!!!!!!!!!!!!!!!!!!!!!! + done = false; + SUIT_MessageBox::critical ( this, tr("ERR_ERROR"), tr("ERR_APP_EXCEPTION") ); } } } @@ -389,11 +389,11 @@ void VisuGUI_TableDlg::onHelp() if (app) app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName); else { - QString platform; + QString platform; #ifdef WIN32 - platform = "winapplication"; + platform = "winapplication"; #else - platform = "application"; + platform = "application"; #endif SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). @@ -420,111 +420,111 @@ void VisuGUI_TableDlg::initDlg() // Table of integer if ( tblIntAttr && myIntTable ) { try { - // title - myIntTable->setTableTitle( tblIntAttr->GetTitle().c_str() ); - // nb of rows & cols - int nbRows = tblIntAttr->GetNbRows() ; - int nbCols = tblIntAttr->GetNbColumns(); - myIntTable->setNumRows( nbRows ); - myIntTable->setNumCols( nbCols ); - // rows titles - QStringList strlist; - vector rowTitles = tblIntAttr->GetRowTitles(); - for ( i = 0; i < nbRows; i++ ) { - if ( rowTitles.size() > 0 ) - strlist.append( rowTitles[i].c_str() ); - else - strlist.append( "" ); - } - myIntTable->setRowTitles( strlist ); - // columns titles - strlist.clear(); - vector colTitles = tblIntAttr->GetColumnTitles(); - for ( i = 0; i < nbCols; i++ ) { - if ( colTitles.size() > 0 ) - strlist.append( colTitles[i].c_str() ); - else - strlist.append( "" ); - } - myIntTable->setColTitles( strlist ); - // units - strlist.clear(); - vector rowUnits = tblIntAttr->GetRowUnits(); - if ( rowUnits.size() > 0 ) { - for ( i = 0; i < nbRows; i++ ) - strlist.append( rowUnits[i].c_str() ); - myIntTable->setUnits( strlist ); - } - // data - for ( i = 1; i <= nbRows; i++ ) { - strlist.clear(); - for ( j = 1; j <= nbCols; j++ ) { - if ( tblIntAttr->HasValue( i, j ) ) - strlist.append( QString::number( tblIntAttr->GetValue( i, j ) ) ); - else - strlist.append( QString::null ); - } - myIntTable->setRowData( i-1, strlist ); - } - myIntTable->adjustTable(); + // title + myIntTable->setTableTitle( tblIntAttr->GetTitle().c_str() ); + // nb of rows & cols + int nbRows = tblIntAttr->GetNbRows() ; + int nbCols = tblIntAttr->GetNbColumns(); + myIntTable->setNumRows( nbRows ); + myIntTable->setNumCols( nbCols ); + // rows titles + QStringList strlist; + vector rowTitles = tblIntAttr->GetRowTitles(); + for ( i = 0; i < nbRows; i++ ) { + if ( rowTitles.size() > 0 ) + strlist.append( rowTitles[i].c_str() ); + else + strlist.append( "" ); + } + myIntTable->setRowTitles( strlist ); + // columns titles + strlist.clear(); + vector colTitles = tblIntAttr->GetColumnTitles(); + for ( i = 0; i < nbCols; i++ ) { + if ( colTitles.size() > 0 ) + strlist.append( colTitles[i].c_str() ); + else + strlist.append( "" ); + } + myIntTable->setColTitles( strlist ); + // units + strlist.clear(); + vector rowUnits = tblIntAttr->GetRowUnits(); + if ( rowUnits.size() > 0 ) { + for ( i = 0; i < nbRows; i++ ) + strlist.append( rowUnits[i].c_str() ); + myIntTable->setUnits( strlist ); + } + // data + for ( i = 1; i <= nbRows; i++ ) { + strlist.clear(); + for ( j = 1; j <= nbCols; j++ ) { + if ( tblIntAttr->HasValue( i, j ) ) + strlist.append( QString::number( tblIntAttr->GetValue( i, j ) ) ); + else + strlist.append( QString::null ); + } + myIntTable->setRowData( i-1, strlist ); + } + myIntTable->adjustTable(); } catch( ... ) { - MESSAGE("VisuGUI_TableDlg::initDlg : Exception has been caught !!!"); + MESSAGE("VisuGUI_TableDlg::initDlg : Exception has been caught !!!"); } } // Table of real if ( tblRealAttr && myRealTable ) { try { - // title - myRealTable->setTableTitle( tblRealAttr->GetTitle().c_str() ); - // nb of rows & cols - int nbRows = tblRealAttr->GetNbRows() ; - int nbCols = tblRealAttr->GetNbColumns(); - myRealTable->setNumRows( nbRows ); - myRealTable->setNumCols( nbCols ); - // rows titles - QStringList strlist; - vector rowTitles = tblRealAttr->GetRowTitles(); - for ( i = 0; i < nbRows; i++ ) { - if ( rowTitles.size() > 0 ) - strlist.append( rowTitles[i].c_str() ); - else - strlist.append( "" ); - } - myRealTable->setRowTitles( strlist ); - // columns titles - strlist.clear(); - vector colTitles = tblRealAttr->GetColumnTitles(); - for ( i = 0; i < nbCols; i++ ) { - if ( colTitles.size() > 0 ) - strlist.append( colTitles[i].c_str() ); - else - strlist.append( "" ); - } - myRealTable->setColTitles( strlist ); - // units - strlist.clear(); - vector rowUnits = tblRealAttr->GetRowUnits(); - if ( rowUnits.size() > 0 ) { - for ( i = 0; i < nbRows; i++ ) - strlist.append( rowUnits[i].c_str() ); - myRealTable->setUnits( strlist ); - } + // title + myRealTable->setTableTitle( tblRealAttr->GetTitle().c_str() ); + // nb of rows & cols + int nbRows = tblRealAttr->GetNbRows() ; + int nbCols = tblRealAttr->GetNbColumns(); + myRealTable->setNumRows( nbRows ); + myRealTable->setNumCols( nbCols ); + // rows titles + QStringList strlist; + vector rowTitles = tblRealAttr->GetRowTitles(); + for ( i = 0; i < nbRows; i++ ) { + if ( rowTitles.size() > 0 ) + strlist.append( rowTitles[i].c_str() ); + else + strlist.append( "" ); + } + myRealTable->setRowTitles( strlist ); + // columns titles + strlist.clear(); + vector colTitles = tblRealAttr->GetColumnTitles(); + for ( i = 0; i < nbCols; i++ ) { + if ( colTitles.size() > 0 ) + strlist.append( colTitles[i].c_str() ); + else + strlist.append( "" ); + } + myRealTable->setColTitles( strlist ); + // units + strlist.clear(); + vector rowUnits = tblRealAttr->GetRowUnits(); + if ( rowUnits.size() > 0 ) { + for ( i = 0; i < nbRows; i++ ) + strlist.append( rowUnits[i].c_str() ); + myRealTable->setUnits( strlist ); + } // data - for ( i = 1; i <= nbRows; i++ ) { - strlist.clear(); - for ( j = 1; j <= nbCols; j++ ) { - if ( tblRealAttr->HasValue( i, j ) ) - strlist.append( QString::number( tblRealAttr->GetValue( i, j ) ) ); - else - strlist.append( QString::null ); - } - myRealTable->setRowData( i-1, strlist ); - } - myRealTable->adjustTable(); + for ( i = 1; i <= nbRows; i++ ) { + strlist.clear(); + for ( j = 1; j <= nbCols; j++ ) { + if ( tblRealAttr->HasValue( i, j ) ) + strlist.append( QString::number( tblRealAttr->GetValue( i, j ) ) ); + else + strlist.append( QString::null ); + } + myRealTable->setRowData( i-1, strlist ); + } + myRealTable->adjustTable(); } catch( ... ) { - MESSAGE("VisuGUI_TableDlg::initDlg : Exception has been caught !!!"); + MESSAGE("VisuGUI_TableDlg::initDlg : Exception has been caught !!!"); } } } @@ -550,10 +550,10 @@ void VisuGUI_TableDlg::keyPressEvent( QKeyEvent* e ) Constructor */ VisuGUI_TableWidget::VisuGUI_TableWidget( QWidget* parent, - const char* name, - bool edit, - Qt::Orientation orient, - bool showColumnTitles ) + const char* name, + bool edit, + Qt::Orientation orient, + bool showColumnTitles ) : QWidget( parent ), myOrientation( orient ) { QGridLayout* mainLayout = new QGridLayout( this ); @@ -885,8 +885,8 @@ void VisuGUI_TableWidget::updateButtonsState() QTableSelection ts = myTable->selection( i ); for ( int j = ts.topRow(); j < ts.bottomRow()+1; j++) { for ( int k = ts.leftCol(); k < ts.rightCol()+1; k++) { - if ( myTable->item( j, k ) ) - bCT = true; + if ( myTable->item( j, k ) ) + bCT = true; } } }*/ @@ -988,13 +988,13 @@ void VisuGUI_TableWidget::clearTable() QTableSelection ts = myTable->selection( i ); for ( int j = ts.topRow(); j < ts.bottomRow()+1; j++) { if ( myOrientation == Qt::Vertical && j == 0 ) { -// continue; // UNITS +// continue; // UNITS } for ( int k = ts.leftCol(); k < ts.rightCol()+1; k++) { - if ( myOrientation == Qt::Horizontal && k == 0 ) { -// continue; // UNITS - } - myTable->clearCell( j, k ); + if ( myOrientation == Qt::Horizontal && k == 0 ) { +// continue; // UNITS + } + myTable->clearCell( j, k ); } } } @@ -1014,44 +1014,44 @@ bool VisuGUI_TableWidget::eventFilter( QObject* o, QEvent* e ) /*QMouseEvent* me = ( QMouseEvent* )e; if ( me->button() == Qt::LeftButton && (myTable->editTriggers() != QAbstractItemView::NoEditTriggers ) ) { if ( o == myTable->horizontalHeader() ) { - for ( int i = 0; i < myTable->horizontalHeader()->count(); i++ ) { - QRect rect = myTable->horizontalHeader()->sectionRect( i ); - rect.addCoords( 1, 1, -1, -1 ); - if ( rect.contains( myTable->horizontalHeader()->mapFromGlobal( me->globalPos() ) ) ) { - if ( myOrientation == Qt::Vertical || i != 0 ) { - bool bOk; - QString tlt = QInputDialog::getText( tr( "SET_TITLE_TLT" ), - tr( "TITLE_LBL" ), - QLineEdit::Normal, - myTable->horizontalHeader()->label( i ), - &bOk, - this ); - if ( bOk && !tlt.isNull() ) - myTable->horizontalHeader()->setLabel( i, tlt ); - break; - } - } - } + for ( int i = 0; i < myTable->horizontalHeader()->count(); i++ ) { + QRect rect = myTable->horizontalHeader()->sectionRect( i ); + rect.addCoords( 1, 1, -1, -1 ); + if ( rect.contains( myTable->horizontalHeader()->mapFromGlobal( me->globalPos() ) ) ) { + if ( myOrientation == Qt::Vertical || i != 0 ) { + bool bOk; + QString tlt = QInputDialog::getText( tr( "SET_TITLE_TLT" ), + tr( "TITLE_LBL" ), + QLineEdit::Normal, + myTable->horizontalHeader()->label( i ), + &bOk, + this ); + if ( bOk && !tlt.isNull() ) + myTable->horizontalHeader()->setLabel( i, tlt ); + break; + } + } + } } if ( o == myTable->verticalHeader() ) { - for ( int i = 0; i < myTable->verticalHeader()->count(); i++ ) { - QRect rect = myTable->verticalHeader()->sectionRect( i ); - rect.addCoords( 1, 1, -1, -1 ); - if ( rect.contains( myTable->verticalHeader()->mapFromGlobal( me->globalPos() ) ) ) { - if ( myOrientation == Qt::Horizontal || i != 0 ) { - bool bOk; - QString tlt = QInputDialog::getText( tr( "SET_TITLE_TLT" ), - tr( "TITLE_LBL" ), - QLineEdit::Normal, - myTable->verticalHeader()->label( i ), - &bOk, - this ); - if ( bOk && !tlt.isNull() ) - myTable->verticalHeader()->setLabel( i, tlt ); - break; - } - } - } + for ( int i = 0; i < myTable->verticalHeader()->count(); i++ ) { + QRect rect = myTable->verticalHeader()->sectionRect( i ); + rect.addCoords( 1, 1, -1, -1 ); + if ( rect.contains( myTable->verticalHeader()->mapFromGlobal( me->globalPos() ) ) ) { + if ( myOrientation == Qt::Horizontal || i != 0 ) { + bool bOk; + QString tlt = QInputDialog::getText( tr( "SET_TITLE_TLT" ), + tr( "TITLE_LBL" ), + QLineEdit::Normal, + myTable->verticalHeader()->label( i ), + &bOk, + this ); + if ( bOk && !tlt.isNull() ) + myTable->verticalHeader()->setLabel( i, tlt ); + break; + } + } + } } }*/ } @@ -1066,7 +1066,7 @@ bool VisuGUI_TableWidget::eventFilter( QObject* o, QEvent* e ) int j = myTable->currentColumn() - 1; if ( j < 0 ) { j = myTable->columnCount()-1; i--; } if ( i >= 0 && j >= 0 ) - myTable->setCurrentCell( i, j ); + myTable->setCurrentCell( i, j ); } } return QWidget::eventFilter( o, e ); diff --git a/src/GUITOOLS/VisuGUI_TableDlg.h b/src/GUITOOLS/VisuGUI_TableDlg.h index 702824af..9f708ae7 100644 --- a/src/GUITOOLS/VisuGUI_TableDlg.h +++ b/src/GUITOOLS/VisuGUI_TableDlg.h @@ -47,11 +47,11 @@ public: enum { ttNone, ttInt, ttReal, ttBoth, ttAuto }; VisuGUI_TableDlg( QWidget* parent, - _PTR(SObject) obj, - bool edit = false, - int which = ttAuto, - Qt::Orientation orient = Qt::Horizontal, - bool showColumnTitles = true ); + _PTR(SObject) obj, + bool edit = false, + int which = ttAuto, + Qt::Orientation orient = Qt::Horizontal, + bool showColumnTitles = true ); ~VisuGUI_TableDlg(); private: @@ -79,10 +79,10 @@ class VISU_GUITOOLS_EXPORT VisuGUI_TableWidget : public QWidget Q_OBJECT public: VisuGUI_TableWidget( QWidget* parent = 0, - const char* name = 0, - bool edit = false, - Qt::Orientation orient = Qt::Horizontal, - bool showColumnTitles = true ); + const char* name = 0, + bool edit = false, + Qt::Orientation orient = Qt::Horizontal, + bool showColumnTitles = true ); ~VisuGUI_TableWidget(); void setTableTitle( const QString& title ); @@ -138,10 +138,10 @@ public: virtual ~NumDelegateItem(); virtual QWidget * createEditor( QWidget * parent, - const QStyleOptionViewItem & option, - const QModelIndex & index ) const; + const QStyleOptionViewItem & option, + const QModelIndex & index ) const; virtual void setEditorData( QWidget * editor, - const QModelIndex & index ) const; + const QModelIndex & index ) const; private: int myMode; }; diff --git a/src/OBJECT/VISU_Actor.h b/src/OBJECT/VISU_Actor.h index bb69e585..41152cfc 100644 --- a/src/OBJECT/VISU_Actor.h +++ b/src/OBJECT/VISU_Actor.h @@ -195,16 +195,16 @@ class VISU_OBJECT_EXPORT VISU_Actor : public VISU_ActorBase virtual void GetFeatureEdgesFlags(bool& theIsFeatureEdges, - bool& theIsBoundaryEdges, - bool& theIsManifoldEdges, - bool& theIsNonManifoldEdges); + bool& theIsBoundaryEdges, + bool& theIsManifoldEdges, + bool& theIsNonManifoldEdges); virtual void SetFeatureEdgesFlags(bool theIsFeatureEdges, - bool theIsBoundaryEdges, - bool theIsManifoldEdges, - bool theIsNonManifoldEdges); + bool theIsBoundaryEdges, + bool theIsManifoldEdges, + bool theIsNonManifoldEdges); virtual bool @@ -250,15 +250,15 @@ class VISU_OBJECT_EXPORT VISU_Actor : public VISU_ActorBase virtual bool PreHighlight(vtkInteractorStyle* theInteractorStyle, - SVTK_SelectionEvent* theSelectionEvent, - bool theIsHighlight); + SVTK_SelectionEvent* theSelectionEvent, + bool theIsHighlight); //! To process highlight (called from #SVTK_InteractorStyle) virtual bool Highlight(vtkInteractorStyle* theInteractorStyle, - SVTK_SelectionEvent* theSelectionEvent, - bool theIsHighlight); + SVTK_SelectionEvent* theSelectionEvent, + bool theIsHighlight); //! Internal highlight. virtual @@ -374,9 +374,9 @@ class VISU_OBJECT_EXPORT VISU_Actor : public VISU_ActorBase static void ProcessEvents(vtkObject* theObject, - unsigned long theEvent, - void* theClientData, - void* theCallData); + unsigned long theEvent, + void* theClientData, + void* theCallData); //---------------------------------------------------------------------------- private: diff --git a/src/OBJECT/VISU_ActorBase.cxx b/src/OBJECT/VISU_ActorBase.cxx index 1a09a771..44dbbc6f 100644 --- a/src/OBJECT/VISU_ActorBase.cxx +++ b/src/OBJECT/VISU_ActorBase.cxx @@ -81,8 +81,8 @@ VISU_ActorBase if(theActorFactory) myDestroySignal.connect(boost::bind(&TActorFactory::RemoveActor, - theActorFactory, - _1)); + theActorFactory, + _1)); myActorFactory = theActorFactory; } diff --git a/src/OBJECT/VISU_GaussPtsAct.cxx b/src/OBJECT/VISU_GaussPtsAct.cxx index 3d02199a..1071352a 100644 --- a/src/OBJECT/VISU_GaussPtsAct.cxx +++ b/src/OBJECT/VISU_GaussPtsAct.cxx @@ -99,7 +99,7 @@ namespace { bool CheckIsSameValue(vtkFloatingPointType theTarget, - vtkFloatingPointType theSource) + vtkFloatingPointType theSource) { static vtkFloatingPointType TOL = 10.0 / VTK_LARGE_FLOAT; return fabs(theTarget - theSource) < TOL; @@ -107,12 +107,12 @@ namespace bool CheckIsSameVector(vtkFloatingPointType* theTarget, - vtkFloatingPointType* theSource, - size_t theLength) + vtkFloatingPointType* theSource, + size_t theLength) { for ( size_t anId = 0; anId < theLength; anId++ ) { if ( !CheckIsSameValue( theTarget[ anId ], theSource[ anId ] ) ) - return false; + return false; } return true; @@ -199,8 +199,8 @@ VISU_GaussPtsAct if( VISU_PickingSettings* aPickingSettings = VISU_PickingSettings::Get() ) aPickingSettings->AddObserver(VISU::UpdatePickingSettingsEvent, - myEventCallbackCommand.GetPointer(), - myPriority); + myEventCallbackCommand.GetPointer(), + myPriority); } VISU_GaussPtsAct @@ -383,17 +383,17 @@ VISU_GaussPtsAct if(theWidgetCtrl){ theWidgetCtrl->AddObserver(vtkCommand::EnableEvent, - myEventCallbackCommand.GetPointer(), - myPriority); + myEventCallbackCommand.GetPointer(), + myPriority); theWidgetCtrl->AddObserver(vtkCommand::DisableEvent, - myEventCallbackCommand.GetPointer(), - myPriority); + myEventCallbackCommand.GetPointer(), + myPriority); theWidgetCtrl->AddObserver(vtkCommand::StartInteractionEvent, - myEventCallbackCommand.GetPointer(), - myPriority); + myEventCallbackCommand.GetPointer(), + myPriority); theWidgetCtrl->AddObserver(vtkCommand::EndInteractionEvent, - myEventCallbackCommand.GetPointer(), - myPriority); + myEventCallbackCommand.GetPointer(), + myPriority); } myWidgetCtrl = theWidgetCtrl; @@ -460,8 +460,8 @@ namespace inline vtkFloatingPointType GetRadius(vtkIdType theVTKID, - vtkDataArray *theScalarArray, - VISU_GaussPointsPL* theGaussPointsPL) + vtkDataArray *theScalarArray, + VISU_GaussPointsPL* theGaussPointsPL) { vtkFloatingPointType aRadius = 0.5; if(theGaussPointsPL->GetPointSpriteMapper()->GetPointSpriteMode() == 1) // Geometry mode @@ -469,9 +469,9 @@ namespace else if(theGaussPointsPL->GetBicolor()){ vtkFloatingPointType aVal = theScalarArray->GetTuple1(theVTKID); if(aVal > 0.0) - aRadius *= theGaussPointsPL->GetMaxSize(); + aRadius *= theGaussPointsPL->GetMaxSize(); else - aRadius *= theGaussPointsPL->GetMinSize(); + aRadius *= theGaussPointsPL->GetMinSize(); aRadius *= theGaussPointsPL->GetAverageCellSize(); }else aRadius *= theGaussPointsPL->GetPointSize(theVTKID,theScalarArray); @@ -483,8 +483,8 @@ namespace vtkFloatingPointType VISU_GaussPtsAct ::GetRadius(vtkIdType theObjID, - vtkIdType theVTKID, - vtkDataArray *theScalarArray) + vtkIdType theVTKID, + vtkDataArray *theScalarArray) { return ::GetRadius(theVTKID,theScalarArray,myDeviceActor->GetPipeLine()); } @@ -538,8 +538,8 @@ VISU_GaussPtsAct using namespace VISU; myGaussPtsActorFactory = dynamic_cast(theActorFactory); myUpdatePrs3dSignal.connect(boost::bind(&TGaussPtsActorFactory::UpdateFromActor, - myGaussPtsActorFactory, - _1)); + myGaussPtsActorFactory, + _1)); Superclass::SetFactory(theActorFactory); } @@ -606,14 +606,14 @@ VISU_GaussPtsAct if(theInteractor){ theInteractor->AddObserver(vtkCommand::CharEvent, - myEventCallbackCommand.GetPointer(), - myPriority); + myEventCallbackCommand.GetPointer(), + myPriority); theInteractor->AddObserver(VISU::SetSMDecreaseMagnificationEvent, - myEventCallbackCommand.GetPointer(), - myPriority); + myEventCallbackCommand.GetPointer(), + myPriority); theInteractor->AddObserver(VISU::SetSMIncreaseMagnificationEvent, - myEventCallbackCommand.GetPointer(), - myPriority); + myEventCallbackCommand.GetPointer(), + myPriority); } Superclass::SetInteractor(theInteractor); @@ -623,16 +623,16 @@ VISU_GaussPtsAct void VISU_GaussPtsAct ::ProcessEvents(vtkObject* vtkNotUsed(theObject), - unsigned long theEvent, - void* theClientData, - void* vtkNotUsed(theCallData)) + unsigned long theEvent, + void* theClientData, + void* vtkNotUsed(theCallData)) { if(vtkObject* anObject = reinterpret_cast(theClientData)) if(VISU_GaussPtsAct* self = dynamic_cast(anObject)) { if(theEvent == VISU::UpdateInsideSettingsEvent) - self->UpdateInsideCursorSettings(); + self->UpdateInsideCursorSettings(); else - self->OnInteractorEvent(theEvent); + self->OnInteractorEvent(theEvent); } } @@ -649,8 +649,8 @@ VISU_GaussPtsAct { if( IsSegmentationEnabled() ) { - this->ChangeMagnification( myInteractor->GetShiftKey() ); - return; + this->ChangeMagnification( myInteractor->GetShiftKey() ); + return; } myChangeMagnification = myInteractor->GetShiftKey(); @@ -661,10 +661,10 @@ VISU_GaussPtsAct { if( IsSegmentationEnabled() && myWidgetCtrl->IsSphereActive() ) { - VISU_SphereWidget* aSphereWidget = myWidgetCtrl->GetSphereWidget(); - aSphereWidget->ChangeRadius( myInteractor->GetShiftKey() ); - myWidgetCtrl->InvokeEvent(vtkCommand::EndInteractionEvent,NULL); - myWidgetCtrl->GetInteractor()->Render(); + VISU_SphereWidget* aSphereWidget = myWidgetCtrl->GetSphereWidget(); + aSphereWidget->ChangeRadius( myInteractor->GetShiftKey() ); + myWidgetCtrl->InvokeEvent(vtkCommand::EndInteractionEvent,NULL); + myWidgetCtrl->GetInteractor()->Render(); } return; } @@ -715,8 +715,8 @@ VISU_GaussPtsAct if(Superclass::GetPickable()){ if(vtkMapper* aMapper = GetMapper()){ if(vtkDataSet* aDataSet= aMapper->GetInput()){ - aDataSet->Update(); - return aDataSet->GetNumberOfCells() > 0; + aDataSet->Update(); + return aDataSet->GetNumberOfCells() > 0; } } } @@ -728,8 +728,8 @@ VISU_GaussPtsAct bool VISU_GaussPtsAct ::PreHighlight(vtkInteractorStyle* theInteractorStyle, - SVTK_SelectionEvent* theSelectionEvent, - bool theIsHighlight) + SVTK_SelectionEvent* theSelectionEvent, + bool theIsHighlight) { if ( !GetPickable() ) return false; @@ -748,8 +748,8 @@ VISU_GaussPtsAct if(aSelectionMode == ActorSelection || !theIsHighlight) return Superclass::PreHighlight(theInteractorStyle, - theSelectionEvent, - theIsHighlight); + theSelectionEvent, + theIsHighlight); bool anIsChanged = (mySelectionMode != aSelectionMode); bool anIsPreselected = myIsPreselected; @@ -759,9 +759,9 @@ VISU_GaussPtsAct if(aSelectionMode == GaussPointSelection && theIsHighlight){ myPointPicker->Pick(theSelectionEvent->myX, - theSelectionEvent->myY, - 0.0, - theInteractorStyle->GetCurrentRenderer()); + theSelectionEvent->myY, + 0.0, + theInteractorStyle->GetCurrentRenderer()); if(myPointPicker->GetActor() != this) return (anIsPreselected != myIsPreselected); @@ -772,9 +772,9 @@ VISU_GaussPtsAct vtkIdType anObjId = GetNodeObjId( aVtkId ); myIsPreselected = (anObjId >= 0); if(myIsPreselected){ - anIsChanged = (myLastPreHighlightObjID != anObjId); - if(anIsChanged){ - vtkFloatingPointType* aNodeCoord = GetNodeCoord(anObjId); + anIsChanged = (myLastPreHighlightObjID != anObjId); + if(anIsChanged){ + vtkFloatingPointType* aNodeCoord = GetNodeCoord(anObjId); //Take into account translation vtkFloatingPointType aLocalNodeCoord[3]; this->Transform->Push(); @@ -791,30 +791,30 @@ VISU_GaussPtsAct aLocalNodeCoord[1] = aNodeCoord[1] + aPosition[1]; aLocalNodeCoord[2] = aNodeCoord[2] + aPosition[2]; - vtkDataSet* aDataSet = GetInput(); - vtkPointData* aPointData = aDataSet->GetPointData(); - if(vtkDataArray *aScalarArray = aPointData->GetScalars()){ - vtkFloatingPointType aPyramidHeight = aPickingSettings->GetPyramidHeight(); - aPyramidHeight = aPyramidHeight*myGaussPointsPL->GetMaxPointSize(); - //vtkFloatingPointType aColor[3] = myPreHighlightActor->GetProperty()->GetColor(); - vtkFloatingPointType aColor[3]; - theInteractorStyle->GetCurrentRenderer()->GetBackground( aColor ); - aColor[0] = 1. - aColor[0]; - aColor[1] = 1. - aColor[1]; - aColor[2] = 1. - aColor[2]; - - myCursorPyramid->Init(aPyramidHeight, - aPickingSettings->GetCursorSize(), - GetRadius(anObjId,aVtkId,aScalarArray), - GetMagnification(anObjId), - GetClamp(anObjId), - aNodeCoord, - aColor); - } + vtkDataSet* aDataSet = GetInput(); + vtkPointData* aPointData = aDataSet->GetPointData(); + if(vtkDataArray *aScalarArray = aPointData->GetScalars()){ + vtkFloatingPointType aPyramidHeight = aPickingSettings->GetPyramidHeight(); + aPyramidHeight = aPyramidHeight*myGaussPointsPL->GetMaxPointSize(); + //vtkFloatingPointType aColor[3] = myPreHighlightActor->GetProperty()->GetColor(); + vtkFloatingPointType aColor[3]; + theInteractorStyle->GetCurrentRenderer()->GetBackground( aColor ); + aColor[0] = 1. - aColor[0]; + aColor[1] = 1. - aColor[1]; + aColor[2] = 1. - aColor[2]; + + myCursorPyramid->Init(aPyramidHeight, + aPickingSettings->GetCursorSize(), + GetRadius(anObjId,aVtkId,aScalarArray), + GetMagnification(anObjId), + GetClamp(anObjId), + aNodeCoord, + aColor); + } this->Transform->Pop(); - myLastPreHighlightObjID = anObjId; - } - myCursorPyramid->SetVisibility(true); + myLastPreHighlightObjID = anObjId; + } + myCursorPyramid->SetVisibility(true); } } } @@ -830,9 +830,9 @@ VISU_GaussPtsAct inline void ChangeZoom(VISU_PickingSettings *thePickingSettings, - vtkRenderer* theRenderer, - vtkIdType theInitialHasIndex, - vtkIdType theCurrentHasIndex) + vtkRenderer* theRenderer, + vtkIdType theInitialHasIndex, + vtkIdType theCurrentHasIndex) { if( (theInitialHasIndex + theCurrentHasIndex == 1) && thePickingSettings){ vtkCamera *aCamera = theRenderer->GetActiveCamera(); @@ -852,8 +852,8 @@ ChangeZoom(VISU_PickingSettings *thePickingSettings, bool VISU_GaussPtsAct ::Highlight(vtkInteractorStyle* theInteractorStyle, - SVTK_SelectionEvent* theSelectionEvent, - bool theIsHighlight) + SVTK_SelectionEvent* theSelectionEvent, + bool theIsHighlight) { if ( !GetPickable() ) return false; @@ -868,10 +868,10 @@ VISU_GaussPtsAct mySelector->RemoveIObject(anIO); /* ChangeZoom(myPickingSettings, - theInteractorStyle, - anInitialHasIndex, - false, - anIO);*/ + theInteractorStyle, + anInitialHasIndex, + false, + anIO);*/ return true; } @@ -882,25 +882,25 @@ VISU_GaussPtsAct if(aSelectionMode == ActorSelection) return Superclass::Highlight(theInteractorStyle, - theSelectionEvent, - theIsHighlight); + theSelectionEvent, + theIsHighlight); if(aSelectionMode == GaussPointSelection && !theSelectionEvent->myIsRectangle){ vtkRenderer *aRenderer = theInteractorStyle->GetCurrentRenderer(); myPointPicker->Pick(theSelectionEvent->myX, - theSelectionEvent->myY, - 0.0, - aRenderer); + theSelectionEvent->myY, + 0.0, + aRenderer); if(myPointPicker->GetActor() != this) { mySelector->ClearIObjects(); /* ChangeZoom(myPickingSettings, - theInteractorStyle, - anInitialHasIndex, - false, - anIO);*/ + theInteractorStyle, + anInitialHasIndex, + false, + anIO);*/ return true; } @@ -909,52 +909,52 @@ VISU_GaussPtsAct if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId, true ) && hasIO()) { vtkIdType anObjId = GetNodeObjId( aVtkId ); if(anObjId >= 0){ - // myIsHighlighted = true; - // Update the Selector - if(mySelector->IsSelected(myIO)) - mySelector->AddOrRemoveIndex(myIO,anObjId,theSelectionEvent->myIsShift); - else{ - if(!theSelectionEvent->myIsShift){ - mySelector->ClearIObjects(); - } - mySelector->AddOrRemoveIndex(myIO,anObjId,theSelectionEvent->myIsShift); - mySelector->AddIObject(this); - } - /* - vtkFloatingPointType* aNodeCoord = GetNodeCoord(anObjId); - // - // FlyTo - vtkRenderWindowInteractor* anInteractor = theInteractorStyle->GetInteractor(); - vtkFloatingPointType aDollyWas = anInteractor->GetDolly(); - int aNumberOfFlyFramesWas = anInteractor->GetNumberOfFlyFrames(); - - anInteractor->SetDolly(0.); - anInteractor->SetNumberOfFlyFrames(myPickingSettings->GetStepNumber()); - anInteractor->FlyTo(aRenderer,aNodeCoord); - aRenderer->ResetCameraClippingRange(); - anInteractor->SetDolly(aDollyWas); - anInteractor->SetNumberOfFlyFrames(aNumberOfFlyFramesWas); - - anInteractor->InvokeEvent(SVTK::ChangeRotationPoint, aNodeCoord);*/ - - mySelectionMode = aSelectionMode; - - /* ChangeZoom(myPickingSettings, - theInteractorStyle, - anInitialHasIndex, - true, - anIO);*/ - - return true; + // myIsHighlighted = true; + // Update the Selector + if(mySelector->IsSelected(myIO)) + mySelector->AddOrRemoveIndex(myIO,anObjId,theSelectionEvent->myIsShift); + else{ + if(!theSelectionEvent->myIsShift){ + mySelector->ClearIObjects(); + } + mySelector->AddOrRemoveIndex(myIO,anObjId,theSelectionEvent->myIsShift); + mySelector->AddIObject(this); + } + /* + vtkFloatingPointType* aNodeCoord = GetNodeCoord(anObjId); + // + // FlyTo + vtkRenderWindowInteractor* anInteractor = theInteractorStyle->GetInteractor(); + vtkFloatingPointType aDollyWas = anInteractor->GetDolly(); + int aNumberOfFlyFramesWas = anInteractor->GetNumberOfFlyFrames(); + + anInteractor->SetDolly(0.); + anInteractor->SetNumberOfFlyFrames(myPickingSettings->GetStepNumber()); + anInteractor->FlyTo(aRenderer,aNodeCoord); + aRenderer->ResetCameraClippingRange(); + anInteractor->SetDolly(aDollyWas); + anInteractor->SetNumberOfFlyFrames(aNumberOfFlyFramesWas); + + anInteractor->InvokeEvent(SVTK::ChangeRotationPoint, aNodeCoord);*/ + + mySelectionMode = aSelectionMode; + + /* ChangeZoom(myPickingSettings, + theInteractorStyle, + anInitialHasIndex, + true, + anIO);*/ + + return true; }// if( anObjId >= 0 ) { }//if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId, true ) && hasIO()) }//if(!theSelectionEvent->myIsRectangle){ /* ChangeZoom(myPickingSettings, - theInteractorStyle, - anInitialHasIndex, - false, - anIO);*/ + theInteractorStyle, + anInitialHasIndex, + false, + anIO);*/ return false; } @@ -1004,9 +1004,9 @@ VISU_GaussPtsAct if( GetVisibility() && aPickingSettings->GetCameraMovementEnabled() ) { ChangeZoom(aPickingSettings, - GetRenderer(), - anInitialHasIndex, - aCurrentHasIndex); + GetRenderer(), + anInitialHasIndex, + aCurrentHasIndex); } if( aSelectionMode == ActorSelection ) { @@ -1033,9 +1033,9 @@ VISU_GaussPtsAct // Zoom if necessary // ChangeZoom(myPickingSettings, -// GetRenderer(), -// anInitialHasIndex, -// aCurrentHasIndex); +// GetRenderer(), +// anInitialHasIndex, +// aCurrentHasIndex); // TColStd_IndexedMapOfInteger aMapIndex; mySelector->GetIndex( getIO(), aMapIndex ); @@ -1108,16 +1108,16 @@ VISU_GaussPtsAct vtkFloatingPointType aPyramidHeight = aPickingSettings->GetPyramidHeight(); aPyramidHeight = aPyramidHeight*myGaussPointsPL->GetMaxPointSize(); myCursorPyramidSelected->Init(aPyramidHeight, - aPickingSettings->GetCursorSize(), - GetRadius(anObjId,aVtkId,aScalarArray), - GetMagnification(anObjId), - GetClamp(anObjId), - aLocalNodeCoord, - myHighlightActor->GetProperty()->GetColor()); + aPickingSettings->GetCursorSize(), + GetRadius(anObjId,aVtkId,aScalarArray), + GetMagnification(anObjId), + GetClamp(anObjId), + aLocalNodeCoord, + myHighlightActor->GetProperty()->GetColor()); myCursorPyramidSelected->SetVisibility(anIsVisible && theIsHighlight); // const VISU::PGaussPtsIDMapper& aGaussPtsIDMapper = - myGaussPointsPL->GetGaussPtsIDMapper(); + myGaussPointsPL->GetGaussPtsIDMapper(); VISU::TNamedIDMapper* aParent = aGaussPtsIDMapper->GetParent(); VISU::TGaussPointID aGaussPointID = myGaussPointsPL->GetObjID(anObjId); @@ -1126,7 +1126,7 @@ VISU_GaussPtsAct aStr<<"\nParentCellID: "<GetElemName(aCellID); if(aParentName != "") { - aStr<<"\nParentCellName: '"<GetNumberOfIds(); for (vtkIdType i = 0; i < aNbPoints; i++) { - aCellDataSet->GetPointCells(aCellPoints->GetId(i), aPointCells); + aCellDataSet->GetPointCells(aCellPoints->GetId(i), aPointCells); - // add cell ids - vtkIdType aNbCells = aPointCells->GetNumberOfIds(); - for (vtkIdType j = 0; j < aNbCells; j++) - aNeighbourCells->InsertUniqueId(aPointCells->GetId(j)); + // add cell ids + vtkIdType aNbCells = aPointCells->GetNumberOfIds(); + for (vtkIdType j = 0; j < aNbCells; j++) + aNeighbourCells->InsertUniqueId(aPointCells->GetId(j)); } aPointCells->Delete(); @@ -1195,7 +1195,7 @@ VISU_GaussPtsAct // get vector data vtkDataArray* anInputVectors = aDataSetAttributes->GetVectors(); if (!anInputVectors) - return; + return; // insert neighbour cells to the special dataset vtkUnstructuredGrid *aCellsToWarp = vtkUnstructuredGrid::New(); @@ -1214,53 +1214,53 @@ VISU_GaussPtsAct std::vector aTuple(aNbComp); for (vtkIdType i = 0; i < aNbNeighbourCells; i++) { - vtkIdType aVTKCellId = aNeighbourCells->GetId(i); - vtkIdType anObjCellId = aParent->GetElemObjID(aVTKCellId); - - vtkCell* aCurCell = aParent->GetElemCell(anObjCellId); - - vtkIdType aNewCellId = aCellsToWarp->InsertNextCell(aCurCell->GetCellType(), aCurCell->GetPointIds()); - - // get gauss points corresponding to the current cell - vtkIdType aPointVtkId = -1; - vtkIdType aLocalPntId = 0; - aPointVtkId = aGaussPtsIDMapper->GetVTKID(VISU::TGaussPointID(anObjCellId, aLocalPntId)); - - if (aPointVtkId >= 0) { - // Compute average vector - aCellVectors->Reset(); - while (aPointVtkId >= 0) { - anInputVectors->GetTuple(aPointVtkId, &aTuple[0]); - - if (aNbComp >= 3) - aCellVectors->InsertNextTuple3(aTuple[0], aTuple[1], aTuple[2]); - else if (aNbComp == 2) - aCellVectors->InsertNextTuple3(aTuple[0], aTuple[1], 0); - else if (aNbComp == 1) - aCellVectors->InsertNextTuple3(aTuple[0], 0, 0); - - aPointVtkId = aGaussPtsIDMapper->GetVTKID(VISU::TGaussPointID(anObjCellId, ++aLocalPntId)); - } - - double aXCoord = 0, anYCoord = 0, aZCoord = 0; - - vtkIdType aNbVectors = aCellVectors->GetNumberOfTuples(); - - for (vtkIdType aVecId = 0; aVecId < aNbVectors; aVecId++) { - aXCoord += aCellVectors->GetComponent(aVecId, 0); - anYCoord += aCellVectors->GetComponent(aVecId, 1); - aZCoord += aCellVectors->GetComponent(aVecId, 2); - } - - aXCoord = aXCoord / aNbVectors; - anYCoord = anYCoord / aNbVectors; - aZCoord = aZCoord / aNbVectors; - - // set vector data for the cell - aVectorsToSet->SetTuple3(aNewCellId, aXCoord, anYCoord, aZCoord); - } - else - aVectorsToSet->SetTuple3(aNewCellId, 0, 0, 0); + vtkIdType aVTKCellId = aNeighbourCells->GetId(i); + vtkIdType anObjCellId = aParent->GetElemObjID(aVTKCellId); + + vtkCell* aCurCell = aParent->GetElemCell(anObjCellId); + + vtkIdType aNewCellId = aCellsToWarp->InsertNextCell(aCurCell->GetCellType(), aCurCell->GetPointIds()); + + // get gauss points corresponding to the current cell + vtkIdType aPointVtkId = -1; + vtkIdType aLocalPntId = 0; + aPointVtkId = aGaussPtsIDMapper->GetVTKID(VISU::TGaussPointID(anObjCellId, aLocalPntId)); + + if (aPointVtkId >= 0) { + // Compute average vector + aCellVectors->Reset(); + while (aPointVtkId >= 0) { + anInputVectors->GetTuple(aPointVtkId, &aTuple[0]); + + if (aNbComp >= 3) + aCellVectors->InsertNextTuple3(aTuple[0], aTuple[1], aTuple[2]); + else if (aNbComp == 2) + aCellVectors->InsertNextTuple3(aTuple[0], aTuple[1], 0); + else if (aNbComp == 1) + aCellVectors->InsertNextTuple3(aTuple[0], 0, 0); + + aPointVtkId = aGaussPtsIDMapper->GetVTKID(VISU::TGaussPointID(anObjCellId, ++aLocalPntId)); + } + + double aXCoord = 0, anYCoord = 0, aZCoord = 0; + + vtkIdType aNbVectors = aCellVectors->GetNumberOfTuples(); + + for (vtkIdType aVecId = 0; aVecId < aNbVectors; aVecId++) { + aXCoord += aCellVectors->GetComponent(aVecId, 0); + anYCoord += aCellVectors->GetComponent(aVecId, 1); + aZCoord += aCellVectors->GetComponent(aVecId, 2); + } + + aXCoord = aXCoord / aNbVectors; + anYCoord = anYCoord / aNbVectors; + aZCoord = aZCoord / aNbVectors; + + // set vector data for the cell + aVectorsToSet->SetTuple3(aNewCellId, aXCoord, anYCoord, aZCoord); + } + else + aVectorsToSet->SetTuple3(aNewCellId, 0, 0, 0); } aCellsToWarp->GetCellData()->SetVectors(aVectorsToSet); @@ -1328,8 +1328,8 @@ VISU_GaussPtsAct if(theInsideCursorSettings){ theInsideCursorSettings->AddObserver(VISU::UpdateInsideSettingsEvent, - myEventCallbackCommand.GetPointer(), - myPriority); + myEventCallbackCommand.GetPointer(), + myPriority); UpdateInsideCursorSettings(); } } @@ -1603,8 +1603,8 @@ VISU_GaussPtsAct1 vtkFloatingPointType VISU_GaussPtsAct1 ::GetRadius(vtkIdType theObjID, - vtkIdType theVTKID, - vtkDataArray *theScalarArray) + vtkIdType theVTKID, + vtkDataArray *theScalarArray) { VISU_GaussPointsPL* aPipeLine = myDeviceActor->GetPipeLine(); if(IsSegmentationEnabled()){ @@ -1652,7 +1652,7 @@ VISU_GaussPtsAct1 void VISU_GaussPtsAct1::SetPosition(double _arg[3]){ - if(MYDEBUG1) MESSAGE("VISU_GaussPtsAct1::SetPosition - this = "<GetMeshOnGroup(theMeshName, - // "groupe1"); + // "groupe1"); // aPresent->AddGeometry(anIDMapper->GetOutput()); //} //{ // VISU::PUnstructuredGridIDMapper anIDMapper = // theConvertor->GetMeshOnGroup(theMeshName, - // "TUBEH "); + // "TUBEH "); // aPresent->AddGeometry(anIDMapper->GetOutput()); //} //{ // VISU::PUnstructuredGridIDMapper anIDMapper = // theConvertor->GetMeshOnGroup(theMeshName, - // "STRI "); + // "STRI "); // aPresent->AddGeometry(anIDMapper->GetOutput()); //} aPresent->Update(); @@ -381,97 +381,97 @@ main(int argc, char** argv) const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap; VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter; if(isOnlyMesh){ - const VISU::TEntity& anEntity = VISU::CELL_ENTITY; - aMeshOnEntityMapIter = aMeshOnEntityMap.find(anEntity); + const VISU::TEntity& anEntity = VISU::CELL_ENTITY; + aMeshOnEntityMapIter = aMeshOnEntityMap.find(anEntity); - VISU::PNamedIDMapper anIDMapper = - aConvertor->GetMeshOnEntity(aMeshName,anEntity); + VISU::PNamedIDMapper anIDMapper = + aConvertor->GetMeshOnEntity(aMeshName,anEntity); - VISU_MeshPL* aPresent = VISU_MeshPL::New(); - aPresent->SetUnstructuredGridIDMapper(anIDMapper); + VISU_MeshPL* aPresent = VISU_MeshPL::New(); + aPresent->SetUnstructuredGridIDMapper(anIDMapper); - vtkActor* aActor = vtkActor::New(); - aActor->SetMapper(aPresent->GetMapper()); - aActor->GetProperty()->SetRepresentation(VTK_WIREFRAME); - //aRenderer->ResetCameraClippingRange(); + vtkActor* aActor = vtkActor::New(); + aActor->SetMapper(aPresent->GetMapper()); + aActor->GetProperty()->SetRepresentation(VTK_WIREFRAME); + //aRenderer->ResetCameraClippingRange(); - aRenderer->AddActor(aActor); + aRenderer->AddActor(aActor); - aWindow->Render(); - anInteractor->Start(); - return 0; + aWindow->Render(); + anInteractor->Start(); + return 0; } //Import fields aMeshOnEntityMapIter = aMeshOnEntityMap.begin(); for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++) { - const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first; - const VISU::PMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second; - const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap; - VISU::TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin(); - for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++){ - const VISU::PField aField = aFieldMapIter->second; -// if(aField->myNbComp == 1) -// continue; - const std::string& aFieldName = aFieldMapIter->first; - const VISU::TValField& aValField = aField->myValField; - VISU::TValField::const_reverse_iterator aValFieldIter = aValField.rbegin(); - if(aValFieldIter == aValField.rend()) return 0; - int aTimeStamp = aValFieldIter->first; - - vtkActor* anActor = vtkActor::New(); - VISU_ColoredPL* aPresent = NULL; - if(anEntity == VISU::NODE_ENTITY){ - aPresent = CreateColoredPL(aConvertor, - aMeshName, - anEntity, - aFieldName, - aTimeStamp); - - anActor->SetMapper(aPresent->GetMapper()); - }else{ - continue; - aPresent = CreateColoredPL(aConvertor, - aMeshName, - anEntity, - aFieldName, - aTimeStamp); - - VTKViewer_GeometryFilter* aGeometryFilter = VTKViewer_GeometryFilter::New(); - aGeometryFilter->SetInput(aPresent->GetOutput()); - aGeometryFilter->SetInside(true); - - vtkMaskPoints* aMaskPoints = vtkMaskPoints::New(); - aMaskPoints->SetInput(aGeometryFilter->GetOutput()); - aMaskPoints->SetGenerateVertices(true); - aMaskPoints->SetOnRatio(1); - - VISU_OpenGLPointSpriteMapper* aMapper = VISU_OpenGLPointSpriteMapper::New(); - aMapper->SetAverageCellSize( VISU_DeformedShapePL::GetScaleFactor( aPresent->GetOutput() ) ); + const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first; + const VISU::PMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second; + const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap; + VISU::TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin(); + for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++){ + const VISU::PField aField = aFieldMapIter->second; +// if(aField->myNbComp == 1) +// continue; + const std::string& aFieldName = aFieldMapIter->first; + const VISU::TValField& aValField = aField->myValField; + VISU::TValField::const_reverse_iterator aValFieldIter = aValField.rbegin(); + if(aValFieldIter == aValField.rend()) return 0; + int aTimeStamp = aValFieldIter->first; + + vtkActor* anActor = vtkActor::New(); + VISU_ColoredPL* aPresent = NULL; + if(anEntity == VISU::NODE_ENTITY){ + aPresent = CreateColoredPL(aConvertor, + aMeshName, + anEntity, + aFieldName, + aTimeStamp); + + anActor->SetMapper(aPresent->GetMapper()); + }else{ + continue; + aPresent = CreateColoredPL(aConvertor, + aMeshName, + anEntity, + aFieldName, + aTimeStamp); + + VTKViewer_GeometryFilter* aGeometryFilter = VTKViewer_GeometryFilter::New(); + aGeometryFilter->SetInput(aPresent->GetOutput()); + aGeometryFilter->SetInside(true); + + vtkMaskPoints* aMaskPoints = vtkMaskPoints::New(); + aMaskPoints->SetInput(aGeometryFilter->GetOutput()); + aMaskPoints->SetGenerateVertices(true); + aMaskPoints->SetOnRatio(1); + + VISU_OpenGLPointSpriteMapper* aMapper = VISU_OpenGLPointSpriteMapper::New(); + aMapper->SetAverageCellSize( VISU_DeformedShapePL::GetScaleFactor( aPresent->GetOutput() ) ); - char aMainTexture[80]; - strcpy( aMainTexture, getenv( "VISU_ROOT_DIR" ) ); - strcat( aMainTexture, "/share/salome/resources/visu/sprite_texture.vti" ); - - char anAlphaTexture[80]; - strcpy( anAlphaTexture, getenv( "VISU_ROOT_DIR" ) ); - strcat( anAlphaTexture, "/share/salome/resources/visu/sprite_alpha.vti" ); - - vtkSmartPointer aTextureValue = - VISU_GaussPointsPL::MakeTexture( aMainTexture, anAlphaTexture ); - aMapper->SetImageData( aTextureValue.GetPointer() ); + char aMainTexture[80]; + strcpy( aMainTexture, getenv( "VISU_ROOT_DIR" ) ); + strcat( aMainTexture, "/share/salome/resources/visu/sprite_texture.vti" ); + + char anAlphaTexture[80]; + strcpy( anAlphaTexture, getenv( "VISU_ROOT_DIR" ) ); + strcat( anAlphaTexture, "/share/salome/resources/visu/sprite_alpha.vti" ); + + vtkSmartPointer aTextureValue = + VISU_GaussPointsPL::MakeTexture( aMainTexture, anAlphaTexture ); + aMapper->SetImageData( aTextureValue.GetPointer() ); - //vtkPolyDataMapper* aMapper = vtkPolyDataMapper::New(); - aMapper->SetLookupTable(aPresent->GetMapperTable()); - aMapper->SetUseLookupTableScalarRange(true); - aMapper->SetColorModeToMapScalars(); - aMapper->SetScalarVisibility(true); + //vtkPolyDataMapper* aMapper = vtkPolyDataMapper::New(); + aMapper->SetLookupTable(aPresent->GetMapperTable()); + aMapper->SetUseLookupTableScalarRange(true); + aMapper->SetColorModeToMapScalars(); + aMapper->SetScalarVisibility(true); - aMapper->SetInput(aMaskPoints->GetOutput()); - aGeometryFilter->Delete(); + aMapper->SetInput(aMaskPoints->GetOutput()); + aGeometryFilter->Delete(); - anActor->SetMapper(aMapper); - aMapper->Delete(); - } + anActor->SetMapper(aMapper); + aMapper->Delete(); + } @@ -483,9 +483,9 @@ main(int argc, char** argv) lut->SetNumberOfTableValues(nbColors); vtkDataArray* dataArr; if(VISU::IsDataOnCells(aPresent->GetInput())) { - dataArr = aPresent->GetInput()->GetCellData()->GetScalars(); + dataArr = aPresent->GetInput()->GetCellData()->GetScalars(); } else { - dataArr = aPresent->GetInput()->GetPointData()->GetScalars(); + dataArr = aPresent->GetInput()->GetPointData()->GetScalars(); } vtkFloatingPointType aRange[2]; dataArr->GetRange(aRange); @@ -506,10 +506,10 @@ main(int argc, char** argv) MSG(true, "3\n"); for(vtkIdType aValId = 0; aValId < aNbVals; aValId++){ // MSG(true, "Value: "<< *(dataArr->GetTuple(aValId))); - idx = lut->GetIndex(*(dataArr->GetTuple(aValId))); + idx = lut->GetIndex(*(dataArr->GetTuple(aValId))); // MSG(true, "Value index "<GetValue(idx); - distr->SetValue(idx, cnt + 1); + cnt = distr->GetValue(idx); + distr->SetValue(idx, cnt + 1); } MSG(true, "4\n"); distr->Modified(); @@ -523,8 +523,8 @@ main(int argc, char** argv) // points->Allocate(aNbVals); // double x[3] = {0., 0., 0.}; /* for(vtkIdType aValId = 0; aValId < aNbVals; aValId++){ - x[0] = aValId; - points->InsertPoint(aValId, x); + x[0] = aValId; + points->InsertPoint(aValId, x); */// MSG(true, "Inserted point "<GetValue(aValId)); // } @@ -559,7 +559,7 @@ main(int argc, char** argv) MSG(true, "nbYLabels = "<GetNumberOfYLabels()); if (ny < xyplot->GetNumberOfYLabels()) { MSG(true, "5.1"); - xyplot->SetNumberOfYLabels(ny); + xyplot->SetNumberOfYLabels(ny); MSG(true, "nbYLabels = "<GetNumberOfYLabels()); } */ xyplot->GetProperty()->SetColor(1, 1, 1); @@ -598,18 +598,18 @@ main(int argc, char** argv) vtkObject::GlobalWarningDisplayOn(); - VISU_ScalarBarActor * aScalarBar = VISU_ScalarBarActor::New(); - //vtkScalarBarActor * aScalarBar = vtkScalarBarActor::New(); - aPresent->SetNbColors(5); - aPresent->DebugOn(); - aPresent->Update(); - aScalarBar->SetLookupTable(aPresent->GetBarTable()); - aScalarBar->DebugOn(); - aScalarBar->SetDistribution(aPresent->GetDistribution()); - aScalarBar->DistributionVisibilityOn(); -// aScalarBar->SetOrientationToHorizontal(); -// aScalarBar->GetPositionCoordinate()->SetValue(.1, .6, 0); -// aScalarBar->GetPosition2Coordinate()->SetValue(.8, .3, 0); + VISU_ScalarBarActor * aScalarBar = VISU_ScalarBarActor::New(); + //vtkScalarBarActor * aScalarBar = vtkScalarBarActor::New(); + aPresent->SetNbColors(5); + aPresent->DebugOn(); + aPresent->Update(); + aScalarBar->SetLookupTable(aPresent->GetBarTable()); + aScalarBar->DebugOn(); + aScalarBar->SetDistribution(aPresent->GetDistribution()); + aScalarBar->DistributionVisibilityOn(); +// aScalarBar->SetOrientationToHorizontal(); +// aScalarBar->GetPositionCoordinate()->SetValue(.1, .6, 0); +// aScalarBar->GetPosition2Coordinate()->SetValue(.8, .3, 0); /*{ vtkScalarBarWidget* aWidget = vtkScalarBarWidget::New(); @@ -618,18 +618,18 @@ main(int argc, char** argv) aWidget->SetEnabled( 1 ); } */ - aRenderer->AddActor(anActor); -// aRenderer->AddActor2D(xyplot); //RKV - aRenderer->AddActor2D(aScalarBar); - - //aRenderer->AddActor2D(barChartActor()); //RKV - - aWindow->Render(); - aRenderer->ResetCamera(); - - anInteractor->Start(); - return 0; - } + aRenderer->AddActor(anActor); +// aRenderer->AddActor2D(xyplot); //RKV + aRenderer->AddActor2D(aScalarBar); + + //aRenderer->AddActor2D(barChartActor()); //RKV + + aWindow->Render(); + aRenderer->ResetCamera(); + + anInteractor->Start(); + return 0; + } } } else{ diff --git a/src/PIPELINE/VISU_ColoredPL.cxx b/src/PIPELINE/VISU_ColoredPL.cxx index 42a6c7c9..1407f02e 100644 --- a/src/PIPELINE/VISU_ColoredPL.cxx +++ b/src/PIPELINE/VISU_ColoredPL.cxx @@ -100,7 +100,7 @@ VISU_ColoredPL void VISU_ColoredPL ::DoShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput) + bool theIsCopyInput) { Superclass::DoShallowCopy(thePipeLine, theIsCopyInput); @@ -108,7 +108,7 @@ VISU_ColoredPL if ( theIsCopyInput ) { SetScalarRange( aPipeLine->GetScalarRange() ); if ( this->IsScalarFilterUsed() ) - SetScalarFilterRange( aPipeLine->GetScalarFilterRange() ); + SetScalarFilterRange( aPipeLine->GetScalarFilterRange() ); } SetScalarMode(aPipeLine->GetScalarMode()); @@ -132,23 +132,23 @@ VISU_ColoredPL void VISU_ColoredPL ::SetScalarMode(int theScalarMode, - vtkDataSet *theInput, - VISU_Extractor* theExtractor) + vtkDataSet *theInput, + VISU_Extractor* theExtractor) { if(theInput){ if(VISU::IsDataOnPoints(theInput)){ vtkPointData *aPointData = theInput->GetPointData(); if(!aPointData->GetAttribute(vtkDataSetAttributes::VECTORS)) { - if(theScalarMode == 0){ - return; - } + if(theScalarMode == 0){ + return; + } } } else { vtkCellData *aCellData = theInput->GetCellData(); if(!aCellData->GetAttribute(vtkDataSetAttributes::VECTORS)){ - if(theScalarMode == 0){ - return; - } + if(theScalarMode == 0){ + return; + } } } } @@ -254,25 +254,25 @@ VISU_ColoredPL unsigned long int aTime = this->GetMTime(); // If modified then update the distribution array if (aTime > myDistribution->GetMTime()) { - // Set number of colors for the distribution + // Set number of colors for the distribution int nbColors = this->GetNbColors(); - this->myDistribution->SetNumberOfValues(nbColors); - // Initialize numbers of colored cells with zero - this->myDistribution->FillComponent(0, 0); - // Create a lookup table to compute a color of a cell + this->myDistribution->SetNumberOfValues(nbColors); + // Initialize numbers of colored cells with zero + this->myDistribution->FillComponent(0, 0); + // Create a lookup table to compute a color of a cell VISU_LookupTable* lut = GetMapperTable(); vtkFloatingPointType aMapScale = lut->GetMapScale(); // Get scalar values from the input data to calculate their distribution within cells vtkDataArray* dataArr; // Dtermine where we have to take scalars from: cells data or points data. if(VISU::IsDataOnCells(this->GetOutput())) { - dataArr = this->GetOutput()->GetCellData()->GetScalars(); + dataArr = this->GetOutput()->GetCellData()->GetScalars(); } else { - dataArr = this->GetOutput()->GetPointData()->GetScalars(); + dataArr = this->GetOutput()->GetPointData()->GetScalars(); } // If scalars data array is not defined then create an empty one to avoid exceptions if (dataArr == NULL) { - dataArr = vtkDoubleArray::New(); + dataArr = vtkDoubleArray::New(); } // Get range of scalars values @@ -301,7 +301,7 @@ VISU_ColoredPL } } this->myDistribution->Modified(); - + } return myDistribution; diff --git a/src/PIPELINE/VISU_ColoredPL.hxx b/src/PIPELINE/VISU_ColoredPL.hxx index 0f84580a..04dfd7e9 100644 --- a/src/PIPELINE/VISU_ColoredPL.hxx +++ b/src/PIPELINE/VISU_ColoredPL.hxx @@ -156,7 +156,7 @@ protected: virtual void DoShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput); + bool theIsCopyInput); //---------------------------------------------------------------------------- VISU_Extractor* @@ -174,8 +174,8 @@ protected: static void SetScalarMode(int theScalarMode, - vtkDataSet *theInput, - VISU_Extractor* theExtractor); + vtkDataSet *theInput, + VISU_Extractor* theExtractor); private: vtkSmartPointer< VISU_LookupTable > myMapperTable; diff --git a/src/PIPELINE/VISU_CutLinesPL.cxx b/src/PIPELINE/VISU_CutLinesPL.cxx index f6980dd5..3182a43e 100644 --- a/src/PIPELINE/VISU_CutLinesPL.cxx +++ b/src/PIPELINE/VISU_CutLinesPL.cxx @@ -48,13 +48,13 @@ VISU_CutLinesPL void VISU_CutLinesPL ::DoShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput) + bool theIsCopyInput) { Superclass::DoShallowCopy(thePipeLine, theIsCopyInput); if(VISU_CutLinesPL *aPipeLine = dynamic_cast(thePipeLine)){ SetOrientation(aPipeLine->GetPlaneOrientation(1), - aPipeLine->GetRotateX(1),aPipeLine->GetRotateY(1),1); + aPipeLine->GetRotateX(1),aPipeLine->GetRotateY(1),1); SetDisplacement(aPipeLine->GetDisplacement(1),1); if (aPipeLine->IsDefault()) SetDefault(); @@ -116,13 +116,13 @@ VISU_CutLinesPL vtkFloatingPointType aDir[3]; GetDir(aDir, - myAng[0], - myBasePlane[0]); + myAng[0], + myBasePlane[0]); vtkFloatingPointType aBoundPrj[3]; GetBoundProject(aBoundPrj, - aBounds, - aDir); + aBounds, + aDir); aPosition = aBoundPrj[0] + aBoundPrj[2] * myDisplacement[0]; } @@ -173,17 +173,17 @@ VISU_CutLinesPL vtkFloatingPointType aDir[2][3]; GetDir(aDir[0], - myAng[0], - myBasePlane[0]); + myAng[0], + myBasePlane[0]); CutWithPlanes(anAppendPolyData, - GetMergedInput(), - 1, - aDir[0], - aBaseBounds, - myPosition, - myCondition, - myDisplacement[0]); + GetMergedInput(), + 1, + aDir[0], + aBaseBounds, + myPosition, + myCondition, + myDisplacement[0]); //Build lines vtkDataSet *aDataSet = anAppendPolyData->GetOutput(); aDataSet->Update(); @@ -195,17 +195,17 @@ VISU_CutLinesPL aDataSet->GetBounds(aBounds); GetDir(aDir[1], - myAng[1], - myBasePlane[1]); + myAng[1], + myBasePlane[1]); VISU_CutPlanesPL::CutWithPlanes(myAppendPolyData, - aDataSet, - GetNbParts(), - aDir[1], - aBounds, - myPartPosition, - myPartCondition, - myDisplacement[1]); + aDataSet, + GetNbParts(), + aDir[1], + aBounds, + myPartPosition, + myPartCondition, + myDisplacement[1]); //{ // std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-myAppendPolyData.vtk"; // VISU::WriteToFile(myAppendPolyData->GetOutput(), aFileName); @@ -221,15 +221,15 @@ VISU_CutLinesPL } GetBoundProject(myBoundPrjLn, - aBaseBounds, - myDirLn); + aBaseBounds, + myDirLn); VISU::Mul(myDirLn, - myBoundPrjLn[0], - myBasePnt); + myBoundPrjLn[0], + myBasePnt); CorrectPnt(myBasePnt, - aBaseBounds); + aBaseBounds); VISU_ScalarMapPL::Update(); } @@ -239,24 +239,24 @@ VISU_CutLinesPL void VISU_CutLinesPL ::CutWithPlanes(vtkAppendPolyData* theAppendPolyData, - vtkDataSet* theDataSet, - int theNbPlanes, - vtkFloatingPointType theDir[3], - vtkFloatingPointType theBounds[6], - vtkFloatingPointType thePartPosition, - int thePartCondition, - vtkFloatingPointType theDisplacement) + vtkDataSet* theDataSet, + int theNbPlanes, + vtkFloatingPointType theDir[3], + vtkFloatingPointType theBounds[6], + vtkFloatingPointType thePartPosition, + int thePartCondition, + vtkFloatingPointType theDisplacement) { std::vector aPartPosition(1,thePartPosition); std::vector aPartCondition(1,thePartCondition); VISU_CutPlanesPL::CutWithPlanes(theAppendPolyData, - theDataSet, - theNbPlanes, - theDir, - theBounds, - aPartPosition, - aPartCondition, - theDisplacement); + theDataSet, + theNbPlanes, + theDir, + theBounds, + aPartPosition, + aPartCondition, + theDisplacement); } diff --git a/src/PIPELINE/VISU_CutLinesPL.hxx b/src/PIPELINE/VISU_CutLinesPL.hxx index afe46a3c..f34504d5 100644 --- a/src/PIPELINE/VISU_CutLinesPL.hxx +++ b/src/PIPELINE/VISU_CutLinesPL.hxx @@ -74,13 +74,13 @@ public: static void CutWithPlanes(vtkAppendPolyData* theAppendPolyData, - vtkDataSet* theDataSet, - int theNbPlanes, - vtkFloatingPointType theDir[3], - vtkFloatingPointType theBounds[6], - vtkFloatingPointType thePlanePosition, - int thePlaneCondition, - vtkFloatingPointType theDisplacement); + vtkDataSet* theDataSet, + int theNbPlanes, + vtkFloatingPointType theDir[3], + vtkFloatingPointType theBounds[6], + vtkFloatingPointType thePlanePosition, + int thePlaneCondition, + vtkFloatingPointType theDisplacement); protected: VISU_CutLinesPL(); @@ -88,7 +88,7 @@ protected: virtual void DoShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput); + bool theIsCopyInput); vtkFloatingPointType myPosition; int myCondition; diff --git a/src/PIPELINE/VISU_CutPlanesPL.cxx b/src/PIPELINE/VISU_CutPlanesPL.cxx index c9b541cc..247f8943 100644 --- a/src/PIPELINE/VISU_CutPlanesPL.cxx +++ b/src/PIPELINE/VISU_CutPlanesPL.cxx @@ -108,22 +108,22 @@ VISU_CutPlanesPL void VISU_CutPlanesPL ::DoShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput) + bool theIsCopyInput) { Superclass::DoShallowCopy(thePipeLine, theIsCopyInput); if(VISU_CutPlanesPL *aPipeLine = dynamic_cast(thePipeLine)){ SetOrientation(aPipeLine->GetPlaneOrientation(), - aPipeLine->GetRotateX(), - aPipeLine->GetRotateY()); + aPipeLine->GetRotateX(), + aPipeLine->GetRotateY()); SetDisplacement(aPipeLine->GetDisplacement()); SetNbParts(aPipeLine->GetNbParts()); for (int i = 0, iEnd = GetNbParts(); i < iEnd; i++) - if(!aPipeLine->IsPartDefault(i)) - SetPartPosition(i, aPipeLine->GetPartPosition(i)); + if(!aPipeLine->IsPartDefault(i)) + SetPartPosition(i, aPipeLine->GetPartPosition(i)); } } @@ -177,8 +177,8 @@ VISU_CutPlanesPL vtkFloatingPointType aDir[3]; GetDir(aDir, - myAng[0], - myBasePlane[0]); + myAng[0], + myBasePlane[0]); vtkFloatingPointType aBounds[6]; @@ -188,12 +188,12 @@ VISU_CutPlanesPL CutWithPlanes(myAppendPolyData, aFilterOutput, - myNbParts, - aDir, - aBounds, - myPartPosition, - myPartCondition, - myDisplacement[0]); + myNbParts, + aDir, + aBounds, + myPartPosition, + myPartCondition, + myDisplacement[0]); @@ -256,7 +256,7 @@ GetRx(vtkFloatingPointType theRx[3][3], vtkFloatingPointType* VISU_CutPlanesPL ::GetRy(vtkFloatingPointType theRy[3][3], - vtkFloatingPointType thaAng) + vtkFloatingPointType thaAng) { theRy[0][0] = cos(thaAng); theRy[0][1] = 0.0; theRy[0][2] = sin(thaAng); theRy[1][0] = 0.0; theRy[1][1] = 1.0; theRy[1][2] = 0.0; @@ -269,7 +269,7 @@ VISU_CutPlanesPL vtkFloatingPointType* VISU_CutPlanesPL ::GetRz(vtkFloatingPointType theRz[3][3], - vtkFloatingPointType thaAng) + vtkFloatingPointType thaAng) { theRz[0][0] = cos(thaAng); theRz[0][1] = -sin(thaAng); theRz[0][2] = 0.0; theRz[1][0] = sin(thaAng); theRz[1][1] = cos(thaAng); theRz[1][2] = 0.0; @@ -282,7 +282,7 @@ VISU_CutPlanesPL void VISU_CutPlanesPL ::CorrectPnt(vtkFloatingPointType thePnt[3], - const vtkFloatingPointType BoundPrj[6]) + const vtkFloatingPointType BoundPrj[6]) { for(int i = 0, j = 0; i < 3; ++i, j=2*i){ if(thePnt[i] < BoundPrj[j]) thePnt[i] = BoundPrj[j]; @@ -295,17 +295,17 @@ VISU_CutPlanesPL void VISU_CutPlanesPL ::GetBoundProject(vtkFloatingPointType BoundPrj[3], - const vtkFloatingPointType BoundBox[6], - const vtkFloatingPointType Dir[3]) + const vtkFloatingPointType BoundBox[6], + const vtkFloatingPointType Dir[3]) { vtkFloatingPointType BoundPoints[8][3] = { {BoundBox[0],BoundBox[2],BoundBox[4]}, - {BoundBox[1],BoundBox[2],BoundBox[4]}, - {BoundBox[0],BoundBox[3],BoundBox[4]}, - {BoundBox[1],BoundBox[3],BoundBox[4]}, - {BoundBox[0],BoundBox[2],BoundBox[5]}, - {BoundBox[1],BoundBox[2],BoundBox[5]}, - {BoundBox[0],BoundBox[3],BoundBox[5]}, - {BoundBox[1],BoundBox[3],BoundBox[5]}}; + {BoundBox[1],BoundBox[2],BoundBox[4]}, + {BoundBox[0],BoundBox[3],BoundBox[4]}, + {BoundBox[1],BoundBox[3],BoundBox[4]}, + {BoundBox[0],BoundBox[2],BoundBox[5]}, + {BoundBox[1],BoundBox[2],BoundBox[5]}, + {BoundBox[0],BoundBox[3],BoundBox[5]}, + {BoundBox[1],BoundBox[3],BoundBox[5]}}; BoundPrj[0] = vtkMath::Dot(Dir,BoundPoints[0]), BoundPrj[1] = BoundPrj[0]; for(int i = 1; i < 8; i++){ vtkFloatingPointType tmp = vtkMath::Dot(Dir,BoundPoints[i]); @@ -323,9 +323,9 @@ VISU_CutPlanesPL void VISU_CutPlanesPL ::SetOrientation(const VISU_CutPlanesPL::PlaneOrientation& theOrient, - vtkFloatingPointType theXAng, - vtkFloatingPointType theYAng, - int theNum) + vtkFloatingPointType theXAng, + vtkFloatingPointType theYAng, + int theNum) { myBasePlane[theNum] = theOrient; switch(myBasePlane[theNum]){ @@ -389,7 +389,7 @@ VISU_CutPlanesPL void VISU_CutPlanesPL ::SetDisplacement(vtkFloatingPointType theDisp, - int theNum) + int theNum) { if(VISU::CheckIsSameValue(myDisplacement[theNum], theDisp)) return; @@ -426,7 +426,7 @@ VISU_CutPlanesPL void VISU_CutPlanesPL ::SetPartPosition(int thePartNumber, - vtkFloatingPointType thePartPosition) + vtkFloatingPointType thePartPosition) { if(thePartNumber >= myNbParts) return; @@ -446,7 +446,7 @@ VISU_CutPlanesPL vtkFloatingPointType VISU_CutPlanesPL ::GetPartPosition(int thePartNumber, - int theNum) + int theNum) { if(thePartNumber >= myNbParts) return 0; @@ -461,20 +461,20 @@ VISU_CutPlanesPL GetDir(aDir, - myAng[theNum], - myBasePlane[theNum]); + myAng[theNum], + myBasePlane[theNum]); GetBoundProject(aBoundPrj, - aBounds, - aDir); + aBounds, + aDir); if(myNbParts > 1){ - vtkFloatingPointType aDBoundPrj = aBoundPrj[2]/(myNbParts - 1); - vtkFloatingPointType aDisplacement = aDBoundPrj * myDisplacement[theNum]; - vtkFloatingPointType aStartPosition = aBoundPrj[0] - 0.5*aDBoundPrj + aDisplacement; - aPosition = aStartPosition + thePartNumber*aDBoundPrj; + vtkFloatingPointType aDBoundPrj = aBoundPrj[2]/(myNbParts - 1); + vtkFloatingPointType aDisplacement = aDBoundPrj * myDisplacement[theNum]; + vtkFloatingPointType aStartPosition = aBoundPrj[0] - 0.5*aDBoundPrj + aDisplacement; + aPosition = aStartPosition + thePartNumber*aDBoundPrj; }else - aPosition = aBoundPrj[0] + aBoundPrj[2]*myDisplacement[theNum]; + aPosition = aBoundPrj[0] + aBoundPrj[2]*myDisplacement[theNum]; } return aPosition; @@ -516,8 +516,8 @@ VISU_CutPlanesPL void VISU_CutPlanesPL ::GetDir(vtkFloatingPointType theDir[3], - const vtkFloatingPointType theAng[3], - const PlaneOrientation& theBasePlane) + const vtkFloatingPointType theAng[3], + const PlaneOrientation& theBasePlane) { int iPlane = 0; vtkFloatingPointType aRx[3][3], aRy[3][3], aRz[3][3], aRotation[3][3]; @@ -551,9 +551,9 @@ VISU_CutPlanesPL void VISU_CutPlanesPL ::CutWithPlane(vtkAppendPolyData* theAppendPolyData, - vtkDataSet* theDataSet, - vtkFloatingPointType theDir[3], - vtkFloatingPointType theOrig[3]) + vtkDataSet* theDataSet, + vtkFloatingPointType theDir[3], + vtkFloatingPointType theOrig[3]) { vtkCutter *aCutPlane = vtkCutter::New(); aCutPlane->SetInput(theDataSet); @@ -572,13 +572,13 @@ VISU_CutPlanesPL void VISU_CutPlanesPL ::CutWithPlanes(vtkAppendPolyData* theAppendPolyData, - vtkDataSet* theDataSet, - int theNbPlanes, - vtkFloatingPointType theDir[3], - vtkFloatingPointType theBounds[6], - const std::vector& thePlanePosition, - const std::vector& thePlaneCondition, - vtkFloatingPointType theDisplacement) + vtkDataSet* theDataSet, + int theNbPlanes, + vtkFloatingPointType theDir[3], + vtkFloatingPointType theBounds[6], + const std::vector& thePlanePosition, + const std::vector& thePlaneCondition, + vtkFloatingPointType theDisplacement) { vtkFloatingPointType aBoundPrj[3], aOrig[3], aPosition; GetBoundProject(aBoundPrj, theBounds, theDir); @@ -589,9 +589,9 @@ VISU_CutPlanesPL for (int i = 0; i < theNbPlanes; i++){ aPosition = aStartPosition + i*aDBoundPrj; if(thePlaneCondition[i]){ - aPosition = aStartPosition + i*aDBoundPrj; + aPosition = aStartPosition + i*aDBoundPrj; }else - aPosition = thePlanePosition[i]; + aPosition = thePlanePosition[i]; VISU::Mul(theDir,aPosition,aOrig); CutWithPlane(theAppendPolyData,theDataSet,theDir,aOrig); } diff --git a/src/PIPELINE/VISU_CutPlanesPL.hxx b/src/PIPELINE/VISU_CutPlanesPL.hxx index 537d0ba9..581ae148 100644 --- a/src/PIPELINE/VISU_CutPlanesPL.hxx +++ b/src/PIPELINE/VISU_CutPlanesPL.hxx @@ -58,9 +58,9 @@ public: virtual void SetOrientation(const VISU_CutPlanesPL::PlaneOrientation& theOrient, - vtkFloatingPointType theXAng, - vtkFloatingPointType theYAng, - int theNum = 0); + vtkFloatingPointType theXAng, + vtkFloatingPointType theYAng, + int theNum = 0); virtual const PlaneOrientation& @@ -81,17 +81,17 @@ public: virtual void SetDisplacement(vtkFloatingPointType theDisp, - int theNum = 0); + int theNum = 0); virtual void SetPartPosition(int thePartNumber, - vtkFloatingPointType thePartPosition); + vtkFloatingPointType thePartPosition); virtual vtkFloatingPointType GetPartPosition(int thePartNumber, - int theNum = 0); + int theNum = 0); virtual void @@ -134,34 +134,34 @@ public: static vtkFloatingPointType* GetRx(vtkFloatingPointType theRx[3][3], - vtkFloatingPointType thaAng); + vtkFloatingPointType thaAng); static vtkFloatingPointType* GetRy(vtkFloatingPointType theRy[3][3], - vtkFloatingPointType thaAng); + vtkFloatingPointType thaAng); static vtkFloatingPointType* GetRz(vtkFloatingPointType theRz[3][3], - vtkFloatingPointType thaAng); + vtkFloatingPointType thaAng); static void CorrectPnt(vtkFloatingPointType thePnt[3], - const vtkFloatingPointType BoundPrj[6]); + const vtkFloatingPointType BoundPrj[6]); static void GetBoundProject(vtkFloatingPointType BoundPrj[3], - const vtkFloatingPointType BoundBox[6], - const vtkFloatingPointType Dir[3]); + const vtkFloatingPointType BoundBox[6], + const vtkFloatingPointType Dir[3]); static void GetDir(vtkFloatingPointType theDir[3], - const vtkFloatingPointType theAng[3], - const PlaneOrientation& theBasePlane); + const vtkFloatingPointType theAng[3], + const PlaneOrientation& theBasePlane); static void @@ -170,20 +170,20 @@ public: static void CutWithPlane(vtkAppendPolyData* theAppendPolyData, - vtkDataSet* theDataSet, - vtkFloatingPointType theDir[3], - vtkFloatingPointType theOrig[3]); + vtkDataSet* theDataSet, + vtkFloatingPointType theDir[3], + vtkFloatingPointType theOrig[3]); static void CutWithPlanes(vtkAppendPolyData* theAppendPolyData, - vtkDataSet* theDataSet, - int theNbPlanes, - vtkFloatingPointType theDir[3], - vtkFloatingPointType theBounds[6], - const std::vector& thePlanePosition, - const std::vector& thePlaneCondition, - vtkFloatingPointType theDisplacement); + vtkDataSet* theDataSet, + int theNbPlanes, + vtkFloatingPointType theDir[3], + vtkFloatingPointType theBounds[6], + const std::vector& thePlanePosition, + const std::vector& thePlaneCondition, + vtkFloatingPointType theDisplacement); virtual void SetVectorialField(VISU::PUnstructuredGridIDMapper); VISU::PUnstructuredGridIDMapper getVectorialField(); @@ -206,7 +206,7 @@ protected: virtual void DoShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput); + bool theIsCopyInput); void SetPartPosition(int theNum = 0); diff --git a/src/PIPELINE/VISU_CutSegmentPL.cxx b/src/PIPELINE/VISU_CutSegmentPL.cxx index 2e1fcfe1..9a884804 100644 --- a/src/PIPELINE/VISU_CutSegmentPL.cxx +++ b/src/PIPELINE/VISU_CutSegmentPL.cxx @@ -42,7 +42,7 @@ VISU_CutSegmentPL void VISU_CutSegmentPL ::DoShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput) + bool theIsCopyInput) { Superclass::DoShallowCopy(thePipeLine, theIsCopyInput); @@ -77,8 +77,8 @@ VISU_CutSegmentPL void VISU_CutSegmentPL ::SetPoint1(vtkFloatingPointType theX, - vtkFloatingPointType theY, - vtkFloatingPointType theZ ) + vtkFloatingPointType theY, + vtkFloatingPointType theZ ) { myPoint1[0] = theX; myPoint1[1] = theY; @@ -89,8 +89,8 @@ VISU_CutSegmentPL void VISU_CutSegmentPL ::GetPoint1(vtkFloatingPointType& theX, - vtkFloatingPointType& theY, - vtkFloatingPointType& theZ ) + vtkFloatingPointType& theY, + vtkFloatingPointType& theZ ) { theX = myPoint1[0]; theY = myPoint1[1]; @@ -101,8 +101,8 @@ VISU_CutSegmentPL void VISU_CutSegmentPL ::SetPoint2(vtkFloatingPointType theX, - vtkFloatingPointType theY, - vtkFloatingPointType theZ ) + vtkFloatingPointType theY, + vtkFloatingPointType theZ ) { myPoint2[0] = theX; myPoint2[1] = theY; @@ -113,8 +113,8 @@ VISU_CutSegmentPL void VISU_CutSegmentPL ::GetPoint2(vtkFloatingPointType& theX, - vtkFloatingPointType& theY, - vtkFloatingPointType& theZ ) + vtkFloatingPointType& theY, + vtkFloatingPointType& theZ ) { theX = myPoint2[0]; theY = myPoint2[1]; @@ -202,15 +202,15 @@ VISU_CutSegmentPL } GetBoundProject(myBoundPrjLn, - aBounds, - myDirLn); + aBounds, + myDirLn); VISU::Mul(myDirLn, - myBoundPrjLn[0], - myBasePnt); + myBoundPrjLn[0], + myBasePnt); CorrectPnt(myBasePnt, - aBounds); + aBounds); VISU_ScalarMapPL::Update(); } diff --git a/src/PIPELINE/VISU_CutSegmentPL.hxx b/src/PIPELINE/VISU_CutSegmentPL.hxx index 9ead72e3..ece3967f 100644 --- a/src/PIPELINE/VISU_CutSegmentPL.hxx +++ b/src/PIPELINE/VISU_CutSegmentPL.hxx @@ -43,26 +43,26 @@ public: virtual void SetPoint1(vtkFloatingPointType theX, - vtkFloatingPointType theY, - vtkFloatingPointType theZ); + vtkFloatingPointType theY, + vtkFloatingPointType theZ); virtual void GetPoint1(vtkFloatingPointType& theX, - vtkFloatingPointType& theY, - vtkFloatingPointType& theZ); + vtkFloatingPointType& theY, + vtkFloatingPointType& theZ); virtual void SetPoint2(vtkFloatingPointType theX, - vtkFloatingPointType theY, - vtkFloatingPointType theZ); + vtkFloatingPointType theY, + vtkFloatingPointType theZ); virtual void GetPoint2(vtkFloatingPointType& theX, - vtkFloatingPointType& theY, - vtkFloatingPointType& theZ); + vtkFloatingPointType& theY, + vtkFloatingPointType& theZ); public: virtual @@ -82,7 +82,7 @@ protected: virtual void DoShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput); + bool theIsCopyInput); vtkFloatingPointType myPoint1[3]; vtkFloatingPointType myPoint2[3]; diff --git a/src/PIPELINE/VISU_DataSetMapperHolder.cxx b/src/PIPELINE/VISU_DataSetMapperHolder.cxx index 88dccf47..bdb227d8 100644 --- a/src/PIPELINE/VISU_DataSetMapperHolder.cxx +++ b/src/PIPELINE/VISU_DataSetMapperHolder.cxx @@ -87,15 +87,15 @@ VISU_DataSetMapperHolder void VISU_DataSetMapperHolder ::ShallowCopy(VISU_MapperHolder *theMapperHolder, - bool theIsCopyInput) + bool theIsCopyInput) { if(VISU_DataSetMapperHolder* aMapperHolder = dynamic_cast(theMapperHolder)){ if(theIsCopyInput) SetUnstructuredGridIDMapper(aMapperHolder->GetUnstructuredGridIDMapper()); VISU::CopyDataSetMapper(GetDataSetMapper(), - aMapperHolder->GetDataSetMapper(), - theIsCopyInput); + aMapperHolder->GetDataSetMapper(), + theIsCopyInput); myExtractGeometry->SetImplicitFunction(aMapperHolder->GetImplicitFunction()); } } @@ -339,7 +339,7 @@ VISU_DataSetMapperHolder vtkImplicitFunction* aFun = NULL; aFunction->InitTraversal(); for(vtkIdType anID = 0; anID <= theID; anID++) - aFun = aFunction->GetNextItem(); + aFun = aFunction->GetNextItem(); aPlane = dynamic_cast(aFun); } } diff --git a/src/PIPELINE/VISU_DataSetMapperHolder.hxx b/src/PIPELINE/VISU_DataSetMapperHolder.hxx index 99cd7ea8..da8a3bf8 100644 --- a/src/PIPELINE/VISU_DataSetMapperHolder.hxx +++ b/src/PIPELINE/VISU_DataSetMapperHolder.hxx @@ -49,7 +49,7 @@ public: virtual void ShallowCopy(VISU_MapperHolder *theMapperHolder, - bool theIsCopyInput); + bool theIsCopyInput); void SetElnoDisassembleState( bool theIsShrunk ); diff --git a/src/PIPELINE/VISU_DeformedGridPL.cxx b/src/PIPELINE/VISU_DeformedGridPL.cxx index e0a85cb9..112b55b4 100644 --- a/src/PIPELINE/VISU_DeformedGridPL.cxx +++ b/src/PIPELINE/VISU_DeformedGridPL.cxx @@ -94,7 +94,7 @@ VISU_DeformedGridPL void VISU_DeformedGridPL ::DoShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput) + bool theIsCopyInput) { Superclass::DoShallowCopy(thePipeLine, theIsCopyInput); diff --git a/src/PIPELINE/VISU_DeformedGridPL.hxx b/src/PIPELINE/VISU_DeformedGridPL.hxx index 90c1604f..38eb5938 100644 --- a/src/PIPELINE/VISU_DeformedGridPL.hxx +++ b/src/PIPELINE/VISU_DeformedGridPL.hxx @@ -100,7 +100,7 @@ protected: virtual void DoShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput); + bool theIsCopyInput); private: VISU_DeformedGridPL(const VISU_DeformedGridPL&); // Not implemented. diff --git a/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.cxx b/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.cxx index 4107e078..30b2ce06 100644 --- a/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.cxx +++ b/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.cxx @@ -140,8 +140,8 @@ VISU_DeformedShapeAndScalarMapPL GetMapper()->ScalarVisibilityOn(); VISU::CellDataToPoint(myWarpVector, - myCellDataToPointData, - GetMergedInput()); + myCellDataToPointData, + GetMergedInput()); myScalars = vtkUnstructuredGrid::SafeDownCast(GetMergedInput()); @@ -235,7 +235,7 @@ VISU_DeformedShapeAndScalarMapPL void VISU_DeformedShapeAndScalarMapPL ::DoShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput) + bool theIsCopyInput) { Superclass::DoShallowCopy(thePipeLine, theIsCopyInput); diff --git a/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.hxx b/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.hxx index f211f24b..546f7daa 100644 --- a/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.hxx +++ b/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.hxx @@ -160,7 +160,7 @@ protected: virtual void DoShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput); + bool theIsCopyInput); private: VISU_DeformedShapeAndScalarMapPL(const VISU_DeformedShapeAndScalarMapPL&); diff --git a/src/PIPELINE/VISU_DeformedShapePL.cxx b/src/PIPELINE/VISU_DeformedShapePL.cxx index 2f316876..b3c93c87 100644 --- a/src/PIPELINE/VISU_DeformedShapePL.cxx +++ b/src/PIPELINE/VISU_DeformedShapePL.cxx @@ -77,7 +77,7 @@ VISU_DeformedShapePL void VISU_DeformedShapePL ::DoShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput) + bool theIsCopyInput) { Superclass::DoShallowCopy(thePipeLine, theIsCopyInput); @@ -187,8 +187,8 @@ VISU_DeformedShapePL ::InsertCustomPL() { VISU::CellDataToPoint(myWarpVector, - myCellDataToPointData, - GetMergedInput()); + myCellDataToPointData, + GetMergedInput()); return myWarpVector->GetOutput(); } diff --git a/src/PIPELINE/VISU_DeformedShapePL.hxx b/src/PIPELINE/VISU_DeformedShapePL.hxx index e92e3a0e..2fbb3bf0 100644 --- a/src/PIPELINE/VISU_DeformedShapePL.hxx +++ b/src/PIPELINE/VISU_DeformedShapePL.hxx @@ -96,7 +96,7 @@ protected: virtual void DoShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput); + bool theIsCopyInput); vtkFloatingPointType myScaleFactor; vtkFloatingPointType myMapScaleFactor; diff --git a/src/PIPELINE/VISU_ElnoAssembleFilter.cxx b/src/PIPELINE/VISU_ElnoAssembleFilter.cxx index dcebe4b4..de46b628 100644 --- a/src/PIPELINE/VISU_ElnoAssembleFilter.cxx +++ b/src/PIPELINE/VISU_ElnoAssembleFilter.cxx @@ -41,10 +41,10 @@ vtkStandardNewMacro( VISU_ElnoAssembleFilter ); VISU_ElnoAssembleFilter::VISU_ElnoAssembleFilter() { this->SetInputArrayToProcess( 0, // idx - 0, // port - 0, // connection - vtkDataObject::FIELD_ASSOCIATION_POINTS, // field association - "ELNO_POINT_COORDS" ); // name + 0, // port + 0, // connection + vtkDataObject::FIELD_ASSOCIATION_POINTS, // field association + "ELNO_POINT_COORDS" ); // name this->myIsRestorePoints = false; } @@ -71,8 +71,8 @@ namespace //---------------------------------------------------------------------------- template < int points_type, int elno_type > int Execute2( vtkPointSet *theInput, - vtkPointSet *theOutput, - vtkDataArray *theElnoPointCoords ) + vtkPointSet *theOutput, + vtkDataArray *theElnoPointCoords ) { theOutput->CopyStructure( theInput ); @@ -108,8 +108,8 @@ namespace //---------------------------------------------------------------------------- template < int points_type > int Execute( vtkPointSet *theInput, - vtkPointSet *theOutput, - vtkDataArray *theElnoPointCoords ) + vtkPointSet *theOutput, + vtkDataArray *theElnoPointCoords ) { switch( theElnoPointCoords->GetDataType() ){ case VTK_DOUBLE: @@ -134,8 +134,8 @@ namespace //---------------------------------------------------------------------------- int VISU_ElnoAssembleFilter::RequestData( vtkInformation *vtkNotUsed(request), - vtkInformationVector **inputVector, - vtkInformationVector *outputVector ) + vtkInformationVector **inputVector, + vtkInformationVector *outputVector ) { // get the info objects vtkInformation *inInfo = inputVector[0]->GetInformationObject(0); diff --git a/src/PIPELINE/VISU_ElnoDisassembleFilter.cxx b/src/PIPELINE/VISU_ElnoDisassembleFilter.cxx index 3c73cbf2..38957e4b 100644 --- a/src/PIPELINE/VISU_ElnoDisassembleFilter.cxx +++ b/src/PIPELINE/VISU_ElnoDisassembleFilter.cxx @@ -41,16 +41,16 @@ vtkStandardNewMacro( VISU_ElnoDisassembleFilter ); VISU_ElnoDisassembleFilter::VISU_ElnoDisassembleFilter() { this->SetInputArrayToProcess( 0, // idx - 0, // port - 0, // connection - vtkDataObject::FIELD_ASSOCIATION_CELLS, // field association - "ELNO_FIELD" ); // name + 0, // port + 0, // connection + vtkDataObject::FIELD_ASSOCIATION_CELLS, // field association + "ELNO_FIELD" ); // name this->SetInputArrayToProcess( 1, // idx - 0, // port - 0, // connection - vtkDataObject::FIELD_ASSOCIATION_CELLS, // field association - "ELNO_COMPONENT_MAPPER" ); // name + 0, // port + 0, // connection + vtkDataObject::FIELD_ASSOCIATION_CELLS, // field association + "ELNO_COMPONENT_MAPPER" ); // name this->myShrinkFactor = -0.999; } @@ -112,10 +112,10 @@ namespace //---------------------------------------------------------------------------- TExecute2( vtkUnstructuredGrid *theInput, - vtkUnstructuredGrid *theOutput, - vtkDataArray *theElnoDataArray, - vtkDataArray *theElnoDataMapper, - vtkFloatingPointType theShrinkFactor ) + vtkUnstructuredGrid *theOutput, + vtkDataArray *theElnoDataArray, + vtkDataArray *theElnoDataMapper, + vtkFloatingPointType theShrinkFactor ) : myGetElnoNodeData( theElnoDataArray, theElnoDataMapper ) , myInput( theInput ) , myOutput( theOutput ) @@ -151,9 +151,9 @@ namespace myElnoPartialDataArray = TElnoDataArray::New(); // This partial data can be represented as in terms of vectors as scalars if ( anInputCellData->GetVectors() != NULL ) - myElnoPartialDataArray->SetNumberOfComponents( 3 ); + myElnoPartialDataArray->SetNumberOfComponents( 3 ); else - myElnoPartialDataArray->SetNumberOfComponents( 1 ); + myElnoPartialDataArray->SetNumberOfComponents( 1 ); myElnoPartialDataArray->SetNumberOfTuples( aNbPoints ); myElnoPointCoords = TPointsDataArray::New(); @@ -170,15 +170,15 @@ namespace myOutputPointsMapper->SetNumberOfTuples( aNbPoints ); if ( theShrinkFactor > 0.0 ) - this->ShrinkExecute(); + this->ShrinkExecute(); else - this->SimpleExecute(); + this->SimpleExecute(); theOutput->SetPoints( aPoints ); theOutput->SetCells( theInput->GetCellTypesArray(), - theInput->GetCellLocationsArray(), - myConnectivity ); + theInput->GetCellLocationsArray(), + myConnectivity ); myConnectivity->Delete(); @@ -196,9 +196,9 @@ namespace myElnoFullDataArray->Delete(); if ( anInputCellData->GetVectors() != NULL ) - myOutputPointData->SetVectors( myElnoPartialDataArray ); + myOutputPointData->SetVectors( myElnoPartialDataArray ); else - myOutputPointData->SetScalars( myElnoPartialDataArray ); + myOutputPointData->SetScalars( myElnoPartialDataArray ); myElnoPartialDataArray->Delete(); myOutputPointData->AddArray( myElnoPointCoords ); @@ -221,25 +221,25 @@ namespace vtkIdType aNbPts = 0, *aPts = 0; for ( vtkIdType aCellId = 0; myConnectivity->GetNextCell( aNbPts, aPts ); aCellId++ ) { for ( vtkIdType aPntId = 0; aPntId < aNbPts; aPntId++ ) { - TPointsDataType aCoords[ 3 ]; - vtkIdType aCurrentPntId = aPts[ aPntId ]; - myInputPointsArray->GetTupleValue( aCurrentPntId, aCoords ); - - aPts[ aPntId ] = myOutputPointsArray->InsertNextTupleValue( aCoords ); - vtkIdType aNewPntId = aPts[ aPntId ]; - - myElnoPointCoords->SetTupleValue( aNewPntId, aCoords ); - - myOutputPointData->CopyData( myInputPointData, aCurrentPntId, aNewPntId ); - - TElnoDataType* anElnoData = myGetElnoNodeData( aCellId, aPntId ); - myElnoFullDataArray->SetTupleValue( aNewPntId, anElnoData ); - - myElnoFullDataArray->GetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] ); - myElnoPartialDataArray->SetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] ); - - myInputPointsMapper->GetTupleValue( aCurrentPntId, &anPointsMapperValues[ 0 ] ); - myOutputPointsMapper->SetTupleValue( aNewPntId, &anPointsMapperValues[ 0 ] ); + TPointsDataType aCoords[ 3 ]; + vtkIdType aCurrentPntId = aPts[ aPntId ]; + myInputPointsArray->GetTupleValue( aCurrentPntId, aCoords ); + + aPts[ aPntId ] = myOutputPointsArray->InsertNextTupleValue( aCoords ); + vtkIdType aNewPntId = aPts[ aPntId ]; + + myElnoPointCoords->SetTupleValue( aNewPntId, aCoords ); + + myOutputPointData->CopyData( myInputPointData, aCurrentPntId, aNewPntId ); + + TElnoDataType* anElnoData = myGetElnoNodeData( aCellId, aPntId ); + myElnoFullDataArray->SetTupleValue( aNewPntId, anElnoData ); + + myElnoFullDataArray->GetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] ); + myElnoPartialDataArray->SetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] ); + + myInputPointsMapper->GetTupleValue( aCurrentPntId, &anPointsMapperValues[ 0 ] ); + myOutputPointsMapper->SetTupleValue( aNewPntId, &anPointsMapperValues[ 0 ] ); } } } @@ -256,52 +256,52 @@ namespace myConnectivity->InitTraversal(); vtkIdType aNbPts = 0, *aPts = 0; for ( vtkIdType aCellId = 0; myConnectivity->GetNextCell( aNbPts, aPts ); aCellId++ ) { - - TPointsDataType aCenter[ 3 ] = { TPointsDataType(), TPointsDataType(), TPointsDataType() }; - - for ( vtkIdType aPntId = 0; aPntId < aNbPts; aPntId++ ) { - TPointsDataType aCoords[ 3 ]; - myInputPointsArray->GetTupleValue( aPts[ aPntId ], aCoords ); - - aCenter[ 0 ] += aCoords[ 0 ]; - aCenter[ 1 ] += aCoords[ 1 ]; - aCenter[ 2 ] += aCoords[ 2 ]; - } - - aCenter[ 0 ] /= aNbPts; - aCenter[ 1 ] /= aNbPts; - aCenter[ 2 ] /= aNbPts; - - for ( vtkIdType aPntId = 0; aPntId < aNbPts; aPntId++ ) { - TPointsDataType aCoords[ 3 ]; - vtkIdType aCurrentPntId = aPts[ aPntId ]; - myInputPointsArray->GetTupleValue( aCurrentPntId, aCoords ); - - TPointsDataType aNewCoords[ 3 ]; - - aNewCoords[ 0 ] = aCenter[ 0 ] + - TPointsDataType( myShrinkFactor * ( aCoords[ 0 ] - aCenter[ 0 ] ) ); - aNewCoords[ 1 ] = aCenter[ 1 ] + - TPointsDataType( myShrinkFactor * ( aCoords[ 1 ] - aCenter[ 1 ] ) ); - aNewCoords[ 2 ] = aCenter[ 2 ] + - TPointsDataType( myShrinkFactor * ( aCoords[ 2 ] - aCenter[ 2 ] ) ); - - aPts[ aPntId ] = myOutputPointsArray->InsertNextTupleValue( aNewCoords ); - vtkIdType aNewPntId = aPts[ aPntId ]; - - myElnoPointCoords->SetTupleValue( aNewPntId, aCoords ); - - myOutputPointData->CopyData( myInputPointData, aCurrentPntId, aNewPntId ); - - TElnoDataType* anElnoData = myGetElnoNodeData( aCellId, aPntId ); - myElnoFullDataArray->SetTupleValue( aNewPntId, anElnoData ); - - myElnoFullDataArray->GetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] ); - myElnoPartialDataArray->SetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] ); - - myInputPointsMapper->GetTupleValue( aCurrentPntId, &anPointsMapperValues[ 0 ] ); - myOutputPointsMapper->SetTupleValue( aNewPntId, &anPointsMapperValues[ 0 ] ); - } + + TPointsDataType aCenter[ 3 ] = { TPointsDataType(), TPointsDataType(), TPointsDataType() }; + + for ( vtkIdType aPntId = 0; aPntId < aNbPts; aPntId++ ) { + TPointsDataType aCoords[ 3 ]; + myInputPointsArray->GetTupleValue( aPts[ aPntId ], aCoords ); + + aCenter[ 0 ] += aCoords[ 0 ]; + aCenter[ 1 ] += aCoords[ 1 ]; + aCenter[ 2 ] += aCoords[ 2 ]; + } + + aCenter[ 0 ] /= aNbPts; + aCenter[ 1 ] /= aNbPts; + aCenter[ 2 ] /= aNbPts; + + for ( vtkIdType aPntId = 0; aPntId < aNbPts; aPntId++ ) { + TPointsDataType aCoords[ 3 ]; + vtkIdType aCurrentPntId = aPts[ aPntId ]; + myInputPointsArray->GetTupleValue( aCurrentPntId, aCoords ); + + TPointsDataType aNewCoords[ 3 ]; + + aNewCoords[ 0 ] = aCenter[ 0 ] + + TPointsDataType( myShrinkFactor * ( aCoords[ 0 ] - aCenter[ 0 ] ) ); + aNewCoords[ 1 ] = aCenter[ 1 ] + + TPointsDataType( myShrinkFactor * ( aCoords[ 1 ] - aCenter[ 1 ] ) ); + aNewCoords[ 2 ] = aCenter[ 2 ] + + TPointsDataType( myShrinkFactor * ( aCoords[ 2 ] - aCenter[ 2 ] ) ); + + aPts[ aPntId ] = myOutputPointsArray->InsertNextTupleValue( aNewCoords ); + vtkIdType aNewPntId = aPts[ aPntId ]; + + myElnoPointCoords->SetTupleValue( aNewPntId, aCoords ); + + myOutputPointData->CopyData( myInputPointData, aCurrentPntId, aNewPntId ); + + TElnoDataType* anElnoData = myGetElnoNodeData( aCellId, aPntId ); + myElnoFullDataArray->SetTupleValue( aNewPntId, anElnoData ); + + myElnoFullDataArray->GetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] ); + myElnoPartialDataArray->SetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] ); + + myInputPointsMapper->GetTupleValue( aCurrentPntId, &anPointsMapperValues[ 0 ] ); + myOutputPointsMapper->SetTupleValue( aNewPntId, &anPointsMapperValues[ 0 ] ); + } } } }; @@ -310,16 +310,16 @@ namespace //---------------------------------------------------------------------------- template < int points_type, int elno_type > int Execute2( vtkUnstructuredGrid *theInput, - vtkUnstructuredGrid *theOutput, - vtkDataArray *theElnoDataArray, - vtkDataArray *theElnoDataMapper, - vtkFloatingPointType theShrinkFactor ) + vtkUnstructuredGrid *theOutput, + vtkDataArray *theElnoDataArray, + vtkDataArray *theElnoDataMapper, + vtkFloatingPointType theShrinkFactor ) { TExecute2< points_type, elno_type >( theInput, - theOutput, - theElnoDataArray, - theElnoDataMapper, - theShrinkFactor ); + theOutput, + theElnoDataArray, + theElnoDataMapper, + theShrinkFactor ); return 1; } @@ -328,24 +328,24 @@ namespace //---------------------------------------------------------------------------- template < int points_type > int Execute( vtkUnstructuredGrid *theInput, - vtkUnstructuredGrid *theOutput, - vtkDataArray *theElnoDataArray, - vtkDataArray *theElnoDataMapper, - vtkFloatingPointType theShrinkFactor ) + vtkUnstructuredGrid *theOutput, + vtkDataArray *theElnoDataArray, + vtkDataArray *theElnoDataMapper, + vtkFloatingPointType theShrinkFactor ) { switch( theElnoDataArray->GetDataType() ){ case VTK_DOUBLE: return Execute2< points_type, VTK_DOUBLE > - ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor ); + ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor ); case VTK_FLOAT: return Execute2< points_type, VTK_FLOAT > - ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor ); + ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor ); case VTK_INT: return Execute2< points_type, VTK_INT > - ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor ); + ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor ); case VTK_LONG: return Execute2< points_type, VTK_LONG > - ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor ); + ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor ); default: break; } @@ -360,8 +360,8 @@ namespace //---------------------------------------------------------------------------- int VISU_ElnoDisassembleFilter::RequestData( vtkInformation *vtkNotUsed(request), - vtkInformationVector **inputVector, - vtkInformationVector *outputVector ) + vtkInformationVector **inputVector, + vtkInformationVector *outputVector ) { // get the info objects vtkInformation *inInfo = inputVector[0]->GetInformationObject(0); diff --git a/src/PIPELINE/VISU_Extractor.cxx b/src/PIPELINE/VISU_Extractor.cxx index aafb7d55..52831311 100644 --- a/src/PIPELINE/VISU_Extractor.cxx +++ b/src/PIPELINE/VISU_Extractor.cxx @@ -161,8 +161,8 @@ vtkFloatingPointType CutValue (vtkFloatingPointType theValue, int theDecimals) template void Module2Scalars(vtkDataArray *theInputDataArray, - TValueType* theOutputPtr, - vtkIdType theNbOfTuples) + TValueType* theOutputPtr, + vtkIdType theNbOfTuples) { vtkIdType aNbComp = theInputDataArray->GetNumberOfComponents(); std::vector anArray(aNbComp < 3? 3: aNbComp); @@ -170,8 +170,8 @@ Module2Scalars(vtkDataArray *theInputDataArray, theInputDataArray->GetTuple(aTupleId, &anArray[0]); vtkFloatingPointType aVector[3] = {anArray[0], anArray[1], anArray[2]}; vtkFloatingPointType aScalar = sqrt(aVector[0]*aVector[0] + - aVector[1]*aVector[1] + - aVector[2]*aVector[2]); + aVector[1]*aVector[1] + + aVector[2]*aVector[2]); *theOutputPtr = TValueType(aScalar); theOutputPtr++; } diff --git a/src/PIPELINE/VISU_FieldTransform.cxx b/src/PIPELINE/VISU_FieldTransform.cxx index d448165c..16a36d01 100644 --- a/src/PIPELINE/VISU_FieldTransform.cxx +++ b/src/PIPELINE/VISU_FieldTransform.cxx @@ -161,9 +161,9 @@ VISU_FieldTransform template void LinearTransformVectors(TValueType* theInputPtr, - TValueType* theOutputPtr, - vtkIdType theNbOfTuples, - vtkFloatingPointType theScale[3]) + TValueType* theOutputPtr, + vtkIdType theNbOfTuples, + vtkFloatingPointType theScale[3]) { for(vtkIdType aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++){ for(vtkIdType aComponentId = 0; aComponentId < 3; aComponentId++){ @@ -179,14 +179,14 @@ LinearTransformVectors(TValueType* theInputPtr, template void NonLinearTransformVectors(vtkDataArray *theInputVectors, - TValueType* theInputPtr, - TValueType* theOutputPtr, - vtkIdType theNbOfTuples, - vtkFloatingPointType theScale[3], - VISU_FieldTransform::TTransformFun theFunction, - vtkFloatingPointType theModifiedScalarMin, - vtkFloatingPointType theModifiedScalarDelta, - vtkFloatingPointType theSourceScalarMax) + TValueType* theInputPtr, + TValueType* theOutputPtr, + vtkIdType theNbOfTuples, + vtkFloatingPointType theScale[3], + VISU_FieldTransform::TTransformFun theFunction, + vtkFloatingPointType theModifiedScalarMin, + vtkFloatingPointType theModifiedScalarDelta, + vtkFloatingPointType theSourceScalarMax) { for(vtkIdType aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++){ vtkFloatingPointType anInputVector[3]; @@ -194,9 +194,9 @@ NonLinearTransformVectors(vtkDataArray *theInputVectors, vtkFloatingPointType aMagnification = vtkMath::Norm(anInputVector); if(aMagnification > Tolerance) aMagnification = - ((*theFunction)(aMagnification) - theModifiedScalarMin) / - theModifiedScalarDelta * theSourceScalarMax / - aMagnification; + ((*theFunction)(aMagnification) - theModifiedScalarMin) / + theModifiedScalarDelta * theSourceScalarMax / + aMagnification; if(aMagnification < 0.0) aMagnification = 0.0; for(vtkIdType aComponentId = 0; aComponentId < 3; aComponentId++){ @@ -212,11 +212,11 @@ NonLinearTransformVectors(vtkDataArray *theInputVectors, template void ExecuteVectors(VISU_FieldTransform::TTransformFun theFunction, - VTKViewer_Transform* theTransform, - vtkFloatingPointType theScalarRange[2], - vtkIdType theNbOfTuples, - TDataSetAttributesType* theInputData, - TDataSetAttributesType* theOutputData) + VTKViewer_Transform* theTransform, + vtkFloatingPointType theScalarRange[2], + vtkIdType theNbOfTuples, + TDataSetAttributesType* theInputData, + TDataSetAttributesType* theOutputData) { vtkDataArray *anInputVectors = theInputData->GetVectors(); if(!anInputVectors || theNbOfTuples < 1) @@ -246,25 +246,25 @@ ExecuteVectors(VISU_FieldTransform::TTransformFun theFunction, if(theFunction == &(VISU_FieldTransform::Ident)){ switch(anInputDataType){ vtkTemplateMacro4(LinearTransformVectors, - (VTK_TT *)(anInputPtr), - (VTK_TT *)(anOutputPtr), - theNbOfTuples, - aScale); + (VTK_TT *)(anInputPtr), + (VTK_TT *)(anOutputPtr), + theNbOfTuples, + aScale); default: break; } }else{ switch(anInputDataType){ vtkTemplateMacro9(NonLinearTransformVectors, - anInputVectors, - (VTK_TT *)(anInputPtr), - (VTK_TT *)(anOutputPtr), - theNbOfTuples, - aScale, - theFunction, - aScalarRange[0], - aScalarDelta, - theScalarRange[1]); + anInputVectors, + (VTK_TT *)(anInputPtr), + (VTK_TT *)(anOutputPtr), + theNbOfTuples, + aScale, + theFunction, + aScalarRange[0], + aScalarDelta, + theScalarRange[1]); default: break; } @@ -279,11 +279,11 @@ ExecuteVectors(VISU_FieldTransform::TTransformFun theFunction, template void NonLinearTransformScalars(vtkDataArray *theInputScalars, - TValueType* theInputPtr, - TValueType* theOutputPtr, - vtkIdType theNbOfTuples, - VISU_FieldTransform::TTransformFun theFunction, - vtkFloatingPointType theModifiedScalarMin) + TValueType* theInputPtr, + TValueType* theOutputPtr, + vtkIdType theNbOfTuples, + VISU_FieldTransform::TTransformFun theFunction, + vtkFloatingPointType theModifiedScalarMin) { for(vtkIdType aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++){ vtkFloatingPointType aScalar = (*theFunction)(vtkFloatingPointType(*theInputPtr)); @@ -300,10 +300,10 @@ NonLinearTransformScalars(vtkDataArray *theInputScalars, template void ExecuteScalars(VISU_FieldTransform::TTransformFun theFunction, - vtkFloatingPointType theScalarRange[2], - vtkIdType theNbOfTuples, - TDataSetAttributesType* theInputData, - TDataSetAttributesType* theOutputData) + vtkFloatingPointType theScalarRange[2], + vtkIdType theNbOfTuples, + TDataSetAttributesType* theInputData, + TDataSetAttributesType* theOutputData) { vtkDataArray *anInputScalars = theInputData->GetScalars(); if(!anInputScalars || theNbOfTuples < 1) @@ -323,12 +323,12 @@ ExecuteScalars(VISU_FieldTransform::TTransformFun theFunction, switch(anInputDataType){ vtkTemplateMacro6(NonLinearTransformScalars, - anInputScalars, - (VTK_TT *)(anInputPtr), - (VTK_TT *)(anOutputPtr), - theNbOfTuples, - theFunction, - aScalarRange[0]); + anInputScalars, + (VTK_TT *)(anInputPtr), + (VTK_TT *)(anOutputPtr), + theNbOfTuples, + theFunction, + aScalarRange[0]); default: break; } @@ -342,8 +342,8 @@ ExecuteScalars(VISU_FieldTransform::TTransformFun theFunction, int VISU_FieldTransform ::RequestData(vtkInformation *vtkNotUsed(request), - vtkInformationVector **inputVector, - vtkInformationVector *outputVector) + vtkInformationVector **inputVector, + vtkInformationVector *outputVector) { // get the info objects vtkInformation *inInfo = inputVector[0]->GetInformationObject(0); @@ -364,30 +364,30 @@ VISU_FieldTransform output->GetCellData()->CopyVectorsOff(); ExecuteScalars(myFunction, - myScalarRange, - input->GetNumberOfPoints(), - input->GetPointData(), - output->GetPointData()); + myScalarRange, + input->GetNumberOfPoints(), + input->GetPointData(), + output->GetPointData()); ExecuteVectors(myFunction, - myTransform, - myScalarRange, - input->GetNumberOfPoints(), - input->GetPointData(), - output->GetPointData()); + myTransform, + myScalarRange, + input->GetNumberOfPoints(), + input->GetPointData(), + output->GetPointData()); ExecuteScalars(myFunction, - myScalarRange, - input->GetNumberOfCells(), - input->GetCellData(), - output->GetCellData()); + myScalarRange, + input->GetNumberOfCells(), + input->GetCellData(), + output->GetCellData()); ExecuteVectors(myFunction, - myTransform, - myScalarRange, - input->GetNumberOfCells(), - input->GetCellData(), - output->GetCellData()); + myTransform, + myScalarRange, + input->GetNumberOfCells(), + input->GetCellData(), + output->GetCellData()); }else{ output->GetPointData()->CopyAllOn(); output->GetCellData()->CopyAllOn(); diff --git a/src/PIPELINE/VISU_GaussPointsPL.cxx b/src/PIPELINE/VISU_GaussPointsPL.cxx index 12a1cf6b..70cc1b12 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.cxx +++ b/src/PIPELINE/VISU_GaussPointsPL.cxx @@ -190,7 +190,7 @@ CopyGlyph( vtkGlyph3D* theSource, vtkGlyph3D* theDestination ) void VISU_GaussPointsPL ::DoShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput) + bool theIsCopyInput) { Superclass::DoShallowCopy(thePipeLine, theIsCopyInput); VISU_MergedPL::DoShallowCopy(thePipeLine, theIsCopyInput); @@ -734,7 +734,7 @@ VISU_GaussPointsPL vtkSmartPointer VISU_GaussPointsPL ::MakeTexture( const char* theMainTexture, - const char* theAlphaTexture ) + const char* theAlphaTexture ) { if( !theMainTexture || !theAlphaTexture ) return 0; diff --git a/src/PIPELINE/VISU_GaussPointsPL.hxx b/src/PIPELINE/VISU_GaussPointsPL.hxx index 327ae38c..cbfec5a1 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.hxx +++ b/src/PIPELINE/VISU_GaussPointsPL.hxx @@ -58,7 +58,7 @@ class VISU_GaussMergeFilter; * for rendering the Gauss Points as Point Sprites. */ class VISU_PIPELINE_EXPORT VISU_GaussPointsPL : public VISU_MergedPL, - public VISU_ColoredPL + public VISU_ColoredPL { public: //---------------------------------------------------------------------------- @@ -263,7 +263,7 @@ public: static vtkSmartPointer MakeTexture( const char* theMainTexture, - const char* theAlphaTexture ); + const char* theAlphaTexture ); public: //---------------------------------------------------------------------------- @@ -343,7 +343,7 @@ protected: virtual void DoShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput); + bool theIsCopyInput); private: //---------------------------------------------------------------------------- diff --git a/src/PIPELINE/VISU_ImplicitFunctionWidget.cxx b/src/PIPELINE/VISU_ImplicitFunctionWidget.cxx index f3270860..b364e380 100644 --- a/src/PIPELINE/VISU_ImplicitFunctionWidget.cxx +++ b/src/PIPELINE/VISU_ImplicitFunctionWidget.cxx @@ -84,8 +84,8 @@ void VISU_UnScaledActor::Render(vtkRenderer *theRenderer) theRenderer->ViewToWorld(P[0][0],P[0][1],P[0][2]); theRenderer->ViewToWorld(P[1][0],P[1][1],P[1][2]); vtkFloatingPointType aWorldDiag = sqrt((P[1][0]-P[0][0])*(P[1][0]-P[0][0])+ - (P[1][1]-P[0][1])*(P[1][1]-P[0][1])+ - (P[1][2]-P[0][2])*(P[1][2]-P[0][2])); + (P[1][1]-P[0][1])*(P[1][1]-P[0][1])+ + (P[1][2]-P[0][2])*(P[1][2]-P[0][2])); int* aSize = theRenderer->GetRenderWindow()->GetSize(); vtkFloatingPointType aWinDiag = sqrt(vtkFloatingPointType(aSize[0]*aSize[0]+aSize[1]*aSize[1])); vtkDataSet* aDataSet = GetMapper()->GetInput(); diff --git a/src/PIPELINE/VISU_IsoSurfacesPL.cxx b/src/PIPELINE/VISU_IsoSurfacesPL.cxx index 47554dc0..23917c1d 100644 --- a/src/PIPELINE/VISU_IsoSurfacesPL.cxx +++ b/src/PIPELINE/VISU_IsoSurfacesPL.cxx @@ -84,7 +84,7 @@ VISU_IsoSurfacesPL void VISU_IsoSurfacesPL ::DoShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput) + bool theIsCopyInput) { Superclass::DoShallowCopy(thePipeLine, theIsCopyInput); @@ -218,8 +218,8 @@ VISU_IsoSurfacesPL Superclass::Build(); VISU::CellDataToPoint(myContourFilter, - myCellDataToPointData, - GetMergedInput()); + myCellDataToPointData, + GetMergedInput()); } diff --git a/src/PIPELINE/VISU_IsoSurfacesPL.hxx b/src/PIPELINE/VISU_IsoSurfacesPL.hxx index 1fb16590..697223a3 100644 --- a/src/PIPELINE/VISU_IsoSurfacesPL.hxx +++ b/src/PIPELINE/VISU_IsoSurfacesPL.hxx @@ -114,7 +114,7 @@ protected: virtual void DoShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput); + bool theIsCopyInput); int myNbParts; vtkFloatingPointType myRange[2]; diff --git a/src/PIPELINE/VISU_LabelPointsFilter.cxx b/src/PIPELINE/VISU_LabelPointsFilter.cxx index b0f14eba..577fc04b 100644 --- a/src/PIPELINE/VISU_LabelPointsFilter.cxx +++ b/src/PIPELINE/VISU_LabelPointsFilter.cxx @@ -83,8 +83,8 @@ VISU_LabelPointsFilter::~VISU_LabelPointsFilter() //---------------------------------------------------------------------------- int VISU_LabelPointsFilter::RequestData(vtkInformation* vtkNotUsed(request), - vtkInformationVector** inputVector, - vtkInformationVector* outputVector) + vtkInformationVector** inputVector, + vtkInformationVector* outputVector) { // get the info objects vtkInformation* inInfo = inputVector[0]->GetInformationObject(0); @@ -100,8 +100,8 @@ int VISU_LabelPointsFilter::RequestData(vtkInformation* vtkNotUsed(request), } int VISU_LabelPointsFilter::RequestUpdateExtent(vtkInformation* vtkNotUsed(request), - vtkInformationVector** inputVector, - vtkInformationVector* outputVector) + vtkInformationVector** inputVector, + vtkInformationVector* outputVector) { // get the info objects vtkInformation *inInfo = inputVector[0]->GetInformationObject(0); @@ -117,7 +117,7 @@ int VISU_LabelPointsFilter::RequestUpdateExtent(vtkInformation* vtkNotUsed(reque int VISU_LabelPointsFilter::GetRegions(vtkPolyData* theInput, - vtkPolyData* theOutput) + vtkPolyData* theOutput) { vtkIdType cellId, i; vtkIdType numPts, numCells; @@ -187,38 +187,38 @@ int VISU_LabelPointsFilter::GetRegions(vtkPolyData* theInput, aWave->InsertNextId(cellId); aPointNumber = 0; TraverseAndMark(aWave, aWave2, aVisited, aPointMap, - aRegionNumber, aPointNumber, aMesh); + aRegionNumber, aPointNumber, aMesh); if (aPointNumber >= myPointsNb) { - std::set aIdxSet; - for (i=0; i < numPts; i++) { - if ( aPointMap[i] > -1 ) { - aIdxSet.insert(i); - aPointMap[i] = -1; - } - } - std::vector aIdx(aIdxSet.begin(), aIdxSet.end()); - int aActualPts = aIdx.size(); - int aNewId; - if (myPointsNb > 2) { - int k = aActualPts/(myPointsNb - 1); - int count; - for (i=0, count = 0; i < aActualPts; i+=k, count++) { - aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[i])); - aOutPD->CopyData(aInpPD, aIdx[i], aNewId); - } - if (count < myPointsNb) { - aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[aActualPts - 1])); - aOutPD->CopyData(aInpPD, aIdx[aActualPts - 1], aNewId); - } - } else { - aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[0])); - aOutPD->CopyData(aInpPD, aIdx[0], aNewId); - if (myPointsNb == 2) { - aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[aActualPts - 1])); - aOutPD->CopyData(aInpPD, aIdx[aActualPts - 1], aNewId); - } - } + std::set aIdxSet; + for (i=0; i < numPts; i++) { + if ( aPointMap[i] > -1 ) { + aIdxSet.insert(i); + aPointMap[i] = -1; + } + } + std::vector aIdx(aIdxSet.begin(), aIdxSet.end()); + int aActualPts = aIdx.size(); + int aNewId; + if (myPointsNb > 2) { + int k = aActualPts/(myPointsNb - 1); + int count; + for (i=0, count = 0; i < aActualPts; i+=k, count++) { + aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[i])); + aOutPD->CopyData(aInpPD, aIdx[i], aNewId); + } + if (count < myPointsNb) { + aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[aActualPts - 1])); + aOutPD->CopyData(aInpPD, aIdx[aActualPts - 1], aNewId); + } + } else { + aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[0])); + aOutPD->CopyData(aInpPD, aIdx[0], aNewId); + if (myPointsNb == 2) { + aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[aActualPts - 1])); + aOutPD->CopyData(aInpPD, aIdx[aActualPts - 1], aNewId); + } + } } aWave->Reset(); aWave2->Reset(); @@ -247,12 +247,12 @@ int VISU_LabelPointsFilter::GetRegions(vtkPolyData* theInput, // traversal occurs across shared vertices. // void VISU_LabelPointsFilter::TraverseAndMark (vtkIdList* theWave, - vtkIdList* theWave2, - int* theVisited, - vtkIdType* thePointMap, - int& theRegionNumber, - vtkIdType& thePointNumber, - vtkPolyData* theMesh) + vtkIdList* theWave2, + int* theVisited, + vtkIdType* thePointMap, + int& theRegionNumber, + vtkIdType& thePointNumber, + vtkPolyData* theMesh) { vtkIdType cellId, ptId, numIds, i; int j, k; @@ -268,20 +268,20 @@ void VISU_LabelPointsFilter::TraverseAndMark (vtkIdList* theWave, if ( theVisited[cellId] < 0 ) { theVisited[cellId] = theRegionNumber; theMesh->GetCellPoints(cellId, npts, pts); - + for (j=0; j < npts; j++) { if ( thePointMap[ptId=pts[j]] < 0 ) { thePointMap[ptId] = thePointNumber++; - } + } theMesh->GetPointCells(ptId,ncells,cells); - + // check connectivity criterion (geometric + scalar) for (k=0; k < ncells; k++) { cellId = cells[k]; - theWave2->InsertNextId(cellId); - // } - }//for all cells using this point - }//for all points of this cell + theWave2->InsertNextId(cellId); + // } + }//for all cells using this point + }//for all points of this cell }//if cell not yet visited }//for all cells in this wave diff --git a/src/PIPELINE/VISU_LabelPointsFilter.hxx b/src/PIPELINE/VISU_LabelPointsFilter.hxx index d2e10a89..32eee87d 100644 --- a/src/PIPELINE/VISU_LabelPointsFilter.hxx +++ b/src/PIPELINE/VISU_LabelPointsFilter.hxx @@ -58,15 +58,15 @@ protected: void TraverseAndMark (vtkIdList* theWave, - vtkIdList* theWave2, - int* theVisited, - vtkIdType* thePointMap, - int& theRegionNumber, - vtkIdType& thePointNumber, - vtkPolyData* theMesh); + vtkIdList* theWave2, + int* theVisited, + vtkIdType* thePointMap, + int& theRegionNumber, + vtkIdType& thePointNumber, + vtkPolyData* theMesh); int GetRegions(vtkPolyData* theInput, - vtkPolyData* theOutput); + vtkPolyData* theOutput); int myPointsNb; diff --git a/src/PIPELINE/VISU_LookupTable.hxx b/src/PIPELINE/VISU_LookupTable.hxx index 16a8a477..0026a774 100644 --- a/src/PIPELINE/VISU_LookupTable.hxx +++ b/src/PIPELINE/VISU_LookupTable.hxx @@ -41,8 +41,8 @@ class VISU_PIPELINE_EXPORT VISU_LookupTable: public vtkLookupTable virtual void ForceBuild(); virtual void MapScalarsThroughTable2(void *input, unsigned char *output, - int inputDataType, int numberOfValues, - int inputIncrement, int outputIncrement); + int inputDataType, int numberOfValues, + int inputIncrement, int outputIncrement); vtkFloatingPointType GetMapScale() { return myScale; } void SetMapScale(vtkFloatingPointType theScale = 1.0); @@ -51,12 +51,12 @@ class VISU_PIPELINE_EXPORT VISU_LookupTable: public vtkLookupTable void SetBicolor( bool theBicolor ); static int ComputeLogRange( vtkFloatingPointType inRange[2], - vtkFloatingPointType outRange[2] ); + vtkFloatingPointType outRange[2] ); unsigned char *MapValue(vtkFloatingPointType v); void MarkValueByColor( vtkFloatingPointType theValue, - unsigned char* theColor ); + unsigned char* theColor ); bool HasMarkedValues() const { return myHasMarkedValues; } diff --git a/src/PIPELINE/VISU_MapperHolder.cxx b/src/PIPELINE/VISU_MapperHolder.cxx index 4c3261d7..3aec8976 100644 --- a/src/PIPELINE/VISU_MapperHolder.cxx +++ b/src/PIPELINE/VISU_MapperHolder.cxx @@ -61,14 +61,14 @@ VISU_MapperHolder void VISU_MapperHolder ::ShallowCopy(VISU_MapperHolder *theMapperHolder, - bool theIsCopyInput) + bool theIsCopyInput) { if(theIsCopyInput) SetIDMapper(theMapperHolder->GetIDMapper()); VISU::CopyMapper(GetMapper(), - theMapperHolder->GetMapper(), - theIsCopyInput); + theMapperHolder->GetMapper(), + theIsCopyInput); } diff --git a/src/PIPELINE/VISU_MapperHolder.hxx b/src/PIPELINE/VISU_MapperHolder.hxx index 0f146d4c..84d87710 100644 --- a/src/PIPELINE/VISU_MapperHolder.hxx +++ b/src/PIPELINE/VISU_MapperHolder.hxx @@ -53,7 +53,7 @@ public: virtual void ShallowCopy(VISU_MapperHolder *theMapperHolder, - bool theIsCopyInput); + bool theIsCopyInput); //! Gets memory size used by the instance (bytes). virtual diff --git a/src/PIPELINE/VISU_MergedPL.cxx b/src/PIPELINE/VISU_MergedPL.cxx index d0b2a328..17cb59b5 100644 --- a/src/PIPELINE/VISU_MergedPL.cxx +++ b/src/PIPELINE/VISU_MergedPL.cxx @@ -32,7 +32,7 @@ void VISU_MergedPL ::DoShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput) + bool theIsCopyInput) { if(VISU_MergedPL *aPipeLine = dynamic_cast(thePipeLine)){ if ( this == aPipeLine ) @@ -42,8 +42,8 @@ VISU_MergedPL ClearGeometry(); int aNbOfGeometry = aPipeLine->GetNumberOfGeometry(); for ( int aGeomNumber = 0; aGeomNumber < aNbOfGeometry; aGeomNumber++ ) { - VISU::TName aGeomName; - AddGeometry( aPipeLine->GetGeometry( aGeomNumber, aGeomName ), aGeomName ); + VISU::TName aGeomName; + AddGeometry( aPipeLine->GetGeometry( aGeomNumber, aGeomName ), aGeomName ); } }else SetSourceGeometry(); diff --git a/src/PIPELINE/VISU_MergedPL.hxx b/src/PIPELINE/VISU_MergedPL.hxx index 6d60e9cc..a2648e48 100644 --- a/src/PIPELINE/VISU_MergedPL.hxx +++ b/src/PIPELINE/VISU_MergedPL.hxx @@ -69,7 +69,7 @@ struct VISU_PIPELINE_EXPORT VISU_MergedPL virtual void DoShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput); + bool theIsCopyInput); virtual void diff --git a/src/PIPELINE/VISU_MeshPL.hxx b/src/PIPELINE/VISU_MeshPL.hxx index 9ae7bb7e..7118da3d 100644 --- a/src/PIPELINE/VISU_MeshPL.hxx +++ b/src/PIPELINE/VISU_MeshPL.hxx @@ -34,7 +34,7 @@ //---------------------------------------------------------------------------- class VISU_PIPELINE_EXPORT VISU_MeshPL : public VISU_PipeLine, - public VISU_UnstructuredGridPL + public VISU_UnstructuredGridPL { public: vtkTypeMacro(VISU_MeshPL, VISU_PipeLine); diff --git a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx index 82d59e35..fbf5a895 100755 --- a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx +++ b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx @@ -742,7 +742,7 @@ void VISU_OpenGLPointSpriteMapper::InitTextures() int* aSize = GetImageData()->GetDimensions(); unsigned char* dataPtr = (unsigned char*)GetImageData()->GetScalarPointer(); glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, aSize[0], aSize[1], 0, - GL_RGBA, GL_UNSIGNED_BYTE, dataPtr ); + GL_RGBA, GL_UNSIGNED_BYTE, dataPtr ); //glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); glEnable( GL_TEXTURE_2D ); @@ -906,11 +906,11 @@ struct TCellColors2Color : TColors2Color //----------------------------------------------------------------------------- template < class TCoordinates > void DrawPoints( TCoordinates *theStartPoints, - vtkCellArray *theCells, - TColorFunctorBase* theColorFunctor, - TVertex* theVertexArr, - vtkIdType &theCellId, - vtkIdType &theVertexId ) + vtkCellArray *theCells, + TColorFunctorBase* theColorFunctor, + TVertex* theVertexArr, + vtkIdType &theCellId, + vtkIdType &theVertexId ) { vtkIdType *ptIds = theCells->GetPointer(); vtkIdType *endPtIds = ptIds + theCells->GetNumberOfConnectivityEntries(); @@ -943,9 +943,9 @@ void DrawPoints( TCoordinates *theStartPoints, //----------------------------------------------------------------------------- template < class TCoordinates > void DrawCellsPoints( vtkPolyData *theInput, - vtkPoints* thePoints, - TColorFunctorBase* theColorFunctor, - TVertex* theVertexArr ) + vtkPoints* thePoints, + TColorFunctorBase* theColorFunctor, + TVertex* theVertexArr ) { vtkIdType aCellId = 0, aVertexId = 0; @@ -1024,62 +1024,62 @@ int VISU_OpenGLPointSpriteMapper::Draw(vtkRenderer *theRenderer, vtkActor *theAc glPointSize( this->DefaultPointSize ); { - TColorFunctorBase* aColorFunctor = NULL; - if( colors && this->PointSpriteMode != 1 ) { - if ( cellScalars ) - aColorFunctor = new TCellColors2Color( colors ); - else - aColorFunctor = new TPointColors2Color( colors ); - } else { - aColorFunctor = new TPropertyColor( theActor->GetProperty() ); - } - if ( points->GetDataType() == VTK_FLOAT ) - ::DrawCellsPoints< float >( input, points, aColorFunctor, aVertexArr ); - else - ::DrawCellsPoints< double >( input, points, aColorFunctor, aVertexArr ); - - delete aColorFunctor; + TColorFunctorBase* aColorFunctor = NULL; + if( colors && this->PointSpriteMode != 1 ) { + if ( cellScalars ) + aColorFunctor = new TCellColors2Color( colors ); + else + aColorFunctor = new TPointColors2Color( colors ); + } else { + aColorFunctor = new TPropertyColor( theActor->GetProperty() ); + } + if ( points->GetDataType() == VTK_FLOAT ) + ::DrawCellsPoints< float >( input, points, aColorFunctor, aVertexArr ); + else + ::DrawCellsPoints< double >( input, points, aColorFunctor, aVertexArr ); + + delete aColorFunctor; } if( this->ExtensionsInitialized ) { - GLuint aBufferObjectID = 0; - vglGenBuffersARB( 1, &aBufferObjectID ); - vglBindBufferARB( GL_ARRAY_BUFFER_ARB, aBufferObjectID ); - - int anArrayObjectSize = sizeof( TVertex ) * aTotalConnectivitySize; - vglBufferDataARB( GL_ARRAY_BUFFER_ARB, anArrayObjectSize, aVertexArr, GL_STATIC_DRAW_ARB ); - - delete [] aVertexArr; - - vglBindBufferARB( GL_ARRAY_BUFFER_ARB, 0 ); - vglBindBufferARB( GL_ARRAY_BUFFER_ARB, aBufferObjectID ); - - glColorPointer( 4, GL_FLOAT, sizeof(TVertex), (void*)0 ); - glVertexPointer( 3, GL_FLOAT, sizeof(TVertex), (void*)(4*sizeof(GLfloat)) ); - - glEnableClientState( GL_VERTEX_ARRAY ); - glEnableClientState( GL_COLOR_ARRAY ); - - glDrawArrays( GL_POINTS, 0, aTotalConnectivitySize ); - - glDisableClientState( GL_COLOR_ARRAY ); - glDisableClientState( GL_VERTEX_ARRAY ); - - vglDeleteBuffersARB( 1, &aBufferObjectID ); + GLuint aBufferObjectID = 0; + vglGenBuffersARB( 1, &aBufferObjectID ); + vglBindBufferARB( GL_ARRAY_BUFFER_ARB, aBufferObjectID ); + + int anArrayObjectSize = sizeof( TVertex ) * aTotalConnectivitySize; + vglBufferDataARB( GL_ARRAY_BUFFER_ARB, anArrayObjectSize, aVertexArr, GL_STATIC_DRAW_ARB ); + + delete [] aVertexArr; + + vglBindBufferARB( GL_ARRAY_BUFFER_ARB, 0 ); + vglBindBufferARB( GL_ARRAY_BUFFER_ARB, aBufferObjectID ); + + glColorPointer( 4, GL_FLOAT, sizeof(TVertex), (void*)0 ); + glVertexPointer( 3, GL_FLOAT, sizeof(TVertex), (void*)(4*sizeof(GLfloat)) ); + + glEnableClientState( GL_VERTEX_ARRAY ); + glEnableClientState( GL_COLOR_ARRAY ); + + glDrawArrays( GL_POINTS, 0, aTotalConnectivitySize ); + + glDisableClientState( GL_COLOR_ARRAY ); + glDisableClientState( GL_VERTEX_ARRAY ); + + vglDeleteBuffersARB( 1, &aBufferObjectID ); } else { // there are not extensions - glColorPointer( 4, GL_FLOAT, sizeof(TVertex), aVertexArr ); - glVertexPointer( 3, GL_FLOAT, sizeof(TVertex), - (void*)((GLfloat*)((void*)(aVertexArr)) + 4)); - - glEnableClientState( GL_VERTEX_ARRAY ); - glEnableClientState( GL_COLOR_ARRAY ); - - glDrawArrays( GL_POINTS, 0, aTotalConnectivitySize ); - - glDisableClientState( GL_COLOR_ARRAY ); - glDisableClientState( GL_VERTEX_ARRAY ); - - delete [] aVertexArr; + glColorPointer( 4, GL_FLOAT, sizeof(TVertex), aVertexArr ); + glVertexPointer( 3, GL_FLOAT, sizeof(TVertex), + (void*)((GLfloat*)((void*)(aVertexArr)) + 4)); + + glEnableClientState( GL_VERTEX_ARRAY ); + glEnableClientState( GL_COLOR_ARRAY ); + + glDrawArrays( GL_POINTS, 0, aTotalConnectivitySize ); + + glDisableClientState( GL_COLOR_ARRAY ); + glDisableClientState( GL_VERTEX_ARRAY ); + + delete [] aVertexArr; } } diff --git a/src/PIPELINE/VISU_PipeLine.cxx b/src/PIPELINE/VISU_PipeLine.cxx index d9519403..4ffd2030 100644 --- a/src/PIPELINE/VISU_PipeLine.cxx +++ b/src/PIPELINE/VISU_PipeLine.cxx @@ -94,7 +94,7 @@ VISU_PipeLine void VISU_PipeLine ::ShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput) + bool theIsCopyInput) { SetImplicitFunction(thePipeLine->GetImplicitFunction()); DoShallowCopy(thePipeLine, theIsCopyInput); @@ -106,10 +106,10 @@ VISU_PipeLine void VISU_PipeLine ::DoShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput) + bool theIsCopyInput) { GetMapperHolder()->ShallowCopy(thePipeLine->GetMapperHolder(), - theIsCopyInput); + theIsCopyInput); } @@ -387,16 +387,16 @@ VISU_PipeLine void VISU_PipeLine ::SetPlaneParam(vtkFloatingPointType theDir[3], - vtkFloatingPointType theDist, - vtkPlane* thePlane) + vtkFloatingPointType theDist, + vtkPlane* thePlane) { thePlane->SetNormal(theDir); vtkFloatingPointType anOrigin[3]; VISU::DistanceToPosition(GetInput(), - theDir, - theDist, - anOrigin); + theDir, + theDist, + anOrigin); thePlane->SetOrigin(anOrigin); } @@ -406,8 +406,8 @@ VISU_PipeLine void VISU_PipeLine ::GetPlaneParam(vtkFloatingPointType theDir[3], - vtkFloatingPointType& theDist, - vtkPlane* thePlane) + vtkFloatingPointType& theDist, + vtkPlane* thePlane) { thePlane->GetNormal(theDir); @@ -415,9 +415,9 @@ VISU_PipeLine thePlane->GetOrigin(anOrigin); VISU::PositionToDistance(GetInput(), - theDir, - anOrigin, - theDist); + theDir, + anOrigin, + theDist); } @@ -430,8 +430,8 @@ VISU_PipeLine try{ size_t aSize = size_t(theSize); if(char *aCheck = new char[aSize]){ - delete [] aCheck; - return aSize; + delete [] aCheck; + return aSize; } }catch(std::bad_alloc& exc){ }catch(...){ @@ -445,7 +445,7 @@ VISU_PipeLine size_t VISU_PipeLine ::GetAvailableMemory(size_t theSize, - size_t theMinSize) + size_t theMinSize) { // Finds acceptable memory size by half-deflection methods static double EPSILON = 2 * 1024; diff --git a/src/PIPELINE/VISU_PipeLine.hxx b/src/PIPELINE/VISU_PipeLine.hxx index ffc8138b..ebb73c7e 100644 --- a/src/PIPELINE/VISU_PipeLine.hxx +++ b/src/PIPELINE/VISU_PipeLine.hxx @@ -63,7 +63,7 @@ public: virtual void ShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput); + bool theIsCopyInput); virtual void @@ -169,14 +169,14 @@ public: virtual void SetPlaneParam(vtkFloatingPointType theDir[3], - vtkFloatingPointType theDist, - vtkPlane* thePlane); + vtkFloatingPointType theDist, + vtkPlane* thePlane); virtual void GetPlaneParam(vtkFloatingPointType theDir[3], - vtkFloatingPointType& theDist, - vtkPlane* thePlane); + vtkFloatingPointType& theDist, + vtkPlane* thePlane); //---------------------------------------------------------------------------- static @@ -186,7 +186,7 @@ public: static size_t GetAvailableMemory(size_t theSize, - size_t theMinSize = 1024*1024); + size_t theMinSize = 1024*1024); protected: //---------------------------------------------------------------------------- @@ -207,7 +207,7 @@ protected: virtual void DoShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput); + bool theIsCopyInput); //---------------------------------------------------------------------------- vtkDataSet* diff --git a/src/PIPELINE/VISU_PipeLineUtils.cxx b/src/PIPELINE/VISU_PipeLineUtils.cxx index 2223fb86..03c0edc7 100644 --- a/src/PIPELINE/VISU_PipeLineUtils.cxx +++ b/src/PIPELINE/VISU_PipeLineUtils.cxx @@ -48,8 +48,8 @@ namespace VISU //---------------------------------------------------------------------------- void Sub(const vtkFloatingPointType A[3], - const vtkFloatingPointType B[3], - vtkFloatingPointType C[3]) + const vtkFloatingPointType B[3], + vtkFloatingPointType C[3]) { //A-B for(int i = 0; i < 3; i++) C[i] = A[i] - B[i]; @@ -59,7 +59,7 @@ namespace VISU //---------------------------------------------------------------------------- bool CheckIsSameValue(vtkFloatingPointType theTarget, - vtkFloatingPointType theSource) + vtkFloatingPointType theSource) { static vtkFloatingPointType TOL = 10.0 / VTK_LARGE_FLOAT; if(fabs(theTarget - theSource) < TOL) @@ -71,7 +71,7 @@ namespace VISU //---------------------------------------------------------------------------- bool CheckIsSameRange(vtkFloatingPointType* theTarget, - vtkFloatingPointType* theSource) + vtkFloatingPointType* theSource) { return CheckIsSameValue(theTarget[0], theSource[0]) && CheckIsSameValue(theTarget[1], theSource[1]); @@ -81,8 +81,8 @@ namespace VISU //---------------------------------------------------------------------------- void CopyMapper(vtkMapper* theTarget, - vtkMapper* theSource, - bool theIsCopyInput) + vtkMapper* theSource, + bool theIsCopyInput) { // To customize vtkMapper::ShallowCopy ... theTarget->SetLookupTable(theSource->GetLookupTable()); @@ -90,7 +90,7 @@ namespace VISU if(theIsCopyInput){ vtkFloatingPointType* aScalarRange = theSource->GetScalarRange(); if(!CheckIsSameRange(theTarget->GetScalarRange(), aScalarRange)) - theTarget->SetScalarRange(aScalarRange); + theTarget->SetScalarRange(aScalarRange); } theTarget->SetColorMode(theSource->GetColorMode()); theTarget->SetScalarMode(theSource->GetScalarMode()); @@ -110,8 +110,8 @@ namespace VISU //---------------------------------------------------------------------------- void CopyDataSetMapper(vtkDataSetMapper* theTarget, - vtkDataSetMapper* theSource, - bool theIsCopyInput) + vtkDataSetMapper* theSource, + bool theIsCopyInput) { // To customize vtkDataSetMapper::ShallowCopy ... //theTarget->SetInput(theSource->GetInput()); @@ -122,8 +122,8 @@ namespace VISU //---------------------------------------------------------------------------- void CopyPolyDataMapper(vtkPolyDataMapper* theTarget, - vtkPolyDataMapper* theSource, - bool theIsCopyInput) + vtkPolyDataMapper* theSource, + bool theIsCopyInput) { // To customize vtkPolyDataMapper::ShallowCopy ... //theTarget->SetInput(theSource->GetInput()); @@ -138,8 +138,8 @@ namespace VISU //---------------------------------------------------------------------------- void CopyPointSpriteDataMapper(VISU_OpenGLPointSpriteMapper* theTarget, - VISU_OpenGLPointSpriteMapper* theSource, - bool theIsCopyInput) + VISU_OpenGLPointSpriteMapper* theSource, + bool theIsCopyInput) { // To customize VISU_OpenGLPointSpriteMapper::ShallowCopy ... theTarget->SetPrimitiveType( theSource->GetPrimitiveType() ); @@ -162,10 +162,10 @@ namespace VISU //---------------------------------------------------------------------------- void ComputeBoundsParam(vtkDataSet* theDataSet, - vtkFloatingPointType theDirection[3], - vtkFloatingPointType theMinPnt[3], - vtkFloatingPointType& theMaxBoundPrj, - vtkFloatingPointType& theMinBoundPrj) + vtkFloatingPointType theDirection[3], + vtkFloatingPointType theMinPnt[3], + vtkFloatingPointType& theMaxBoundPrj, + vtkFloatingPointType& theMinBoundPrj) { vtkFloatingPointType aBounds[6]; theDataSet->GetBounds(aBounds); @@ -179,13 +179,13 @@ namespace VISU } vtkFloatingPointType aBoundPoints[8][3] = { {aBounds[0],aBounds[2],aBounds[4]}, - {aBounds[1],aBounds[2],aBounds[4]}, - {aBounds[0],aBounds[3],aBounds[4]}, - {aBounds[1],aBounds[3],aBounds[4]}, - {aBounds[0],aBounds[2],aBounds[5]}, - {aBounds[1],aBounds[2],aBounds[5]}, - {aBounds[0],aBounds[3],aBounds[5]}, - {aBounds[1],aBounds[3],aBounds[5]}}; + {aBounds[1],aBounds[2],aBounds[4]}, + {aBounds[0],aBounds[3],aBounds[4]}, + {aBounds[1],aBounds[3],aBounds[4]}, + {aBounds[0],aBounds[2],aBounds[5]}, + {aBounds[1],aBounds[2],aBounds[5]}, + {aBounds[0],aBounds[3],aBounds[5]}, + {aBounds[1],aBounds[3],aBounds[5]}}; int aMaxId = 0, aMinId = aMaxId; theMaxBoundPrj = vtkMath::Dot(theDirection,aBoundPoints[aMaxId]); @@ -193,12 +193,12 @@ namespace VISU for(int i = 1; i < 8; i++){ vtkFloatingPointType aTmp = vtkMath::Dot(theDirection,aBoundPoints[i]); if(theMaxBoundPrj < aTmp){ - theMaxBoundPrj = aTmp; - aMaxId = i; + theMaxBoundPrj = aTmp; + aMaxId = i; } if(theMinBoundPrj > aTmp){ - theMinBoundPrj = aTmp; - aMinId = i; + theMinBoundPrj = aTmp; + aMinId = i; } } vtkFloatingPointType *aMinPnt = aBoundPoints[aMaxId]; @@ -211,16 +211,16 @@ namespace VISU //---------------------------------------------------------------------------- void DistanceToPosition(vtkDataSet* theDataSet, - vtkFloatingPointType theDirection[3], - vtkFloatingPointType theDist, - vtkFloatingPointType thePos[3]) + vtkFloatingPointType theDirection[3], + vtkFloatingPointType theDist, + vtkFloatingPointType thePos[3]) { vtkFloatingPointType aMaxBoundPrj, aMinBoundPrj, aMinPnt[3]; ComputeBoundsParam(theDataSet, - theDirection, - aMinPnt, - aMaxBoundPrj, - aMinBoundPrj); + theDirection, + aMinPnt, + aMaxBoundPrj, + aMinBoundPrj); vtkFloatingPointType aLength = (aMaxBoundPrj-aMinBoundPrj)*theDist; thePos[0] = aMinPnt[0] - theDirection[0] * aLength; thePos[1] = aMinPnt[1] - theDirection[1] * aLength; @@ -231,16 +231,16 @@ namespace VISU //---------------------------------------------------------------------------- void PositionToDistance(vtkDataSet* theDataSet, - vtkFloatingPointType theDirection[3], - vtkFloatingPointType thePos[3], - vtkFloatingPointType& theDist) + vtkFloatingPointType theDirection[3], + vtkFloatingPointType thePos[3], + vtkFloatingPointType& theDist) { vtkFloatingPointType aMaxBoundPrj, aMinBoundPrj, aMinPnt[3]; ComputeBoundsParam(theDataSet, - theDirection, - aMinPnt, - aMaxBoundPrj, - aMinBoundPrj); + theDirection, + aMinPnt, + aMaxBoundPrj, + aMinBoundPrj); vtkFloatingPointType aPrj = vtkMath::Dot(theDirection,thePos); theDist = (aPrj-aMinBoundPrj)/(aMaxBoundPrj-aMinBoundPrj); } @@ -252,8 +252,8 @@ namespace VISU { for(int i = 0, n = theDataSet->GetNumberOfCells(); i < n; i++) if(vtkCell* aCell = theDataSet->GetCell(i)) - if(!aCell->IsLinear()) - return true; + if(!aCell->IsLinear()) + return true; return false; } diff --git a/src/PIPELINE/VISU_PipeLineUtils.hxx b/src/PIPELINE/VISU_PipeLineUtils.hxx index d9d244c8..081869db 100644 --- a/src/PIPELINE/VISU_PipeLineUtils.hxx +++ b/src/PIPELINE/VISU_PipeLineUtils.hxx @@ -76,8 +76,8 @@ namespace VISU template void CellDataToPoint(TOutputFilter* theOutputFilter, - vtkCellDataToPointData *theCellDataToPointData, - vtkDataSet* theDataSet) + vtkCellDataToPointData *theCellDataToPointData, + vtkDataSet* theDataSet) { if(VISU::IsDataOnCells(theDataSet)){ @@ -92,61 +92,61 @@ namespace VISU //! Checks whether the float values are the same or not bool VISU_PIPELINE_EXPORT CheckIsSameValue(vtkFloatingPointType theTarget, - vtkFloatingPointType theSource); + vtkFloatingPointType theSource); //! Checks whether the scalar range is the same or not bool VISU_PIPELINE_EXPORT CheckIsSameRange(vtkFloatingPointType* theTarget, - vtkFloatingPointType* theSource); + vtkFloatingPointType* theSource); //! Customizes vtkMapper::ShallowCopy void VISU_PIPELINE_EXPORT CopyMapper(vtkMapper* theTarget, - vtkMapper* theSource, - bool theIsCopyInput); + vtkMapper* theSource, + bool theIsCopyInput); //! Customizes vtkDataSetMapper::ShallowCopy void VISU_PIPELINE_EXPORT CopyDataSetMapper(vtkDataSetMapper* theTarget, - vtkDataSetMapper* theSource, - bool theIsCopyInput); + vtkDataSetMapper* theSource, + bool theIsCopyInput); //! Customizes vtkPolyDataMapper::ShallowCopy void VISU_PIPELINE_EXPORT CopyPolyDataMapper(vtkPolyDataMapper* theTarget, - vtkPolyDataMapper* theSource, - bool theIsCopyInput); + vtkPolyDataMapper* theSource, + bool theIsCopyInput); //! Customizes VISU_OpenGLPointSpriteMapper::ShallowCopy void VISU_PIPELINE_EXPORT CopyPointSpriteDataMapper(VISU_OpenGLPointSpriteMapper* theTarget, - VISU_OpenGLPointSpriteMapper* theSource, - bool theIsCopyInput); + VISU_OpenGLPointSpriteMapper* theSource, + bool theIsCopyInput); //---------------------------------------------------------------------------- void VISU_PIPELINE_EXPORT ComputeBoundsParam(vtkDataSet* theDataSet, - vtkFloatingPointType theDirection[3], - vtkFloatingPointType theMinPnt[3], - vtkFloatingPointType& theMaxBoundPrj, - vtkFloatingPointType& theMinBoundPrj); + vtkFloatingPointType theDirection[3], + vtkFloatingPointType theMinPnt[3], + vtkFloatingPointType& theMaxBoundPrj, + vtkFloatingPointType& theMinBoundPrj); //---------------------------------------------------------------------------- void VISU_PIPELINE_EXPORT DistanceToPosition(vtkDataSet* theDataSet, - vtkFloatingPointType theDirection[3], - vtkFloatingPointType theDist, - vtkFloatingPointType thePos[3]); + vtkFloatingPointType theDirection[3], + vtkFloatingPointType theDist, + vtkFloatingPointType thePos[3]); //---------------------------------------------------------------------------- void VISU_PIPELINE_EXPORT PositionToDistance(vtkDataSet* theDataSet, - vtkFloatingPointType theDirection[3], - vtkFloatingPointType thePos[3], - vtkFloatingPointType& theDist); + vtkFloatingPointType theDirection[3], + vtkFloatingPointType thePos[3], + vtkFloatingPointType& theDist); //---------------------------------------------------------------------------- diff --git a/src/PIPELINE/VISU_PlanesWidget.cxx b/src/PIPELINE/VISU_PlanesWidget.cxx index 7ed31a8e..e7a91df0 100644 --- a/src/PIPELINE/VISU_PlanesWidget.cxx +++ b/src/PIPELINE/VISU_PlanesWidget.cxx @@ -62,17 +62,17 @@ static bool IsValidPlane2Position(vtkPlane *pPx, - vtkDataSet *pDataSet, - vtkFloatingPointType aTol=0.003); + vtkDataSet *pDataSet, + vtkFloatingPointType aTol=0.003); static void GetBndPoints(vtkDataSet *pDataSet, - vtkFloatingPointType aPnts[24]); + vtkFloatingPointType aPnts[24]); static vtkFloatingPointType DistanceToPlane(const vtkFloatingPointType x[3], - const vtkFloatingPointType n[3], - const vtkFloatingPointType p0[3]); + const vtkFloatingPointType n[3], + const vtkFloatingPointType p0[3]); vtkCxxRevisionMacro(VISU_PlanesWidget, "$Revision$"); vtkStandardNewMacro(VISU_PlanesWidget); @@ -384,32 +384,32 @@ void VISU_PlanesWidget::SetEnabled(int enabling) vtkRenderWindowInteractor *i = this->Interactor; if( this->HandleMoveEvent ) { i->AddObserver(vtkCommand::MouseMoveEvent, - this->EventCallbackCommand, - this->Priority); + this->EventCallbackCommand, + this->Priority); } if( this->HandleLeftButtonEvent ) { i->AddObserver(vtkCommand::LeftButtonPressEvent, - this->EventCallbackCommand, - this->Priority); + this->EventCallbackCommand, + this->Priority); i->AddObserver(vtkCommand::LeftButtonReleaseEvent, - this->EventCallbackCommand, - this->Priority); + this->EventCallbackCommand, + this->Priority); } if( this->HandleMiddleButtonEvent ) { i->AddObserver(vtkCommand::MiddleButtonPressEvent, - this->EventCallbackCommand, - this->Priority); + this->EventCallbackCommand, + this->Priority); i->AddObserver(vtkCommand::MiddleButtonReleaseEvent, - this->EventCallbackCommand, - this->Priority); + this->EventCallbackCommand, + this->Priority); } if( this->HandleRightButtonEvent ) { i->AddObserver(vtkCommand::RightButtonPressEvent, - this->EventCallbackCommand, - this->Priority); + this->EventCallbackCommand, + this->Priority); i->AddObserver(vtkCommand::RightButtonReleaseEvent, - this->EventCallbackCommand, - this->Priority); + this->EventCallbackCommand, + this->Priority); } // add the outline this->CurrentRenderer->AddActor(this->myOutlineActor); @@ -489,9 +489,9 @@ void VISU_PlanesWidget::SetEnabled(int enabling) // purpose : //================================================================== void VISU_PlanesWidget::ProcessEvents(vtkObject* vtkNotUsed(object), - unsigned long event, - void* clientdata, - void* vtkNotUsed(calldata)) + unsigned long event, + void* clientdata, + void* vtkNotUsed(calldata)) { VISU_PlanesWidget* self = reinterpret_cast( clientdata ); @@ -1135,7 +1135,7 @@ void VISU_PlanesWidget::TranslateOutline(double *p1, double *p2) // purpose : //================================================================== void VISU_PlanesWidget::Scale(double *p1, double *p2, - int vtkNotUsed(X), int Y) + int vtkNotUsed(X), int Y) { //Get the motion vector double v[3]; @@ -1229,8 +1229,8 @@ void VISU_PlanesWidget::InitialPlaceWidget(vtkFloatingPointType bds[6]) // this->AdjustBounds(bds, bounds, origin); this->SetOrigin((bounds[1]+bounds[0])/2.0, - (bounds[3]+bounds[2])/2.0, - (bounds[5]+bounds[4])/2.0); + (bounds[3]+bounds[2])/2.0, + (bounds[5]+bounds[4])/2.0); static vtkFloatingPointType DIST_COEFF = 0.1; SetDistance(this->InitialLength*DIST_COEFF); @@ -1568,8 +1568,8 @@ bool IsValidPlane2Position(vtkPlane *pPx, for (i=0; i<24; i+=3){ aD=-DistanceToPlane(aPnts+i, aN, aOr); if (aD>aDmax){ - aDmax=aD; - iFound=1; + aDmax=aD; + iFound=1; } } if (iFound && aDmax>aTol1) { @@ -1583,7 +1583,7 @@ bool IsValidPlane2Position(vtkPlane *pPx, //================================================================== void GetBndPoints(vtkDataSet *pDataSet, - vtkFloatingPointType aPnts[24]) + vtkFloatingPointType aPnts[24]) { int aIndx[24] = { 0,2,4,1,2,4,1,3,4,0,3,4, @@ -1602,12 +1602,12 @@ GetBndPoints(vtkDataSet *pDataSet, //================================================================== vtkFloatingPointType DistanceToPlane(const vtkFloatingPointType x[3], - const vtkFloatingPointType n[3], - const vtkFloatingPointType p0[3]) + const vtkFloatingPointType n[3], + const vtkFloatingPointType p0[3]) { return ((n[0]*(x[0]-p0[0]) + - n[1]*(x[1]-p0[1]) + - n[2]*(x[2]-p0[2]))); + n[1]*(x[1]-p0[1]) + + n[2]*(x[2]-p0[2]))); } /* //================================================================== diff --git a/src/PIPELINE/VISU_PlanesWidget.hxx b/src/PIPELINE/VISU_PlanesWidget.hxx index 34006817..7c5fc26c 100644 --- a/src/PIPELINE/VISU_PlanesWidget.hxx +++ b/src/PIPELINE/VISU_PlanesWidget.hxx @@ -85,8 +85,8 @@ public: // Get the origin of the plane. void SetOrigin(vtkFloatingPointType x, - vtkFloatingPointType y, - vtkFloatingPointType z); + vtkFloatingPointType y, + vtkFloatingPointType z); void SetOrigin(vtkFloatingPointType x[3]); @@ -101,8 +101,8 @@ public: // Get the normal to the plane. void SetNormal(vtkFloatingPointType x, - vtkFloatingPointType y, - vtkFloatingPointType z); + vtkFloatingPointType y, + vtkFloatingPointType z); void SetNormal(vtkFloatingPointType x[3]); @@ -237,7 +237,7 @@ protected: static void ProcessEvents(vtkObject* object, unsigned long event, - void* clientdata, void* calldata); + void* clientdata, void* calldata); // ProcessEvents() dispatches to these methods. void OnLeftButtonDown(); diff --git a/src/PIPELINE/VISU_Plot3DPL.cxx b/src/PIPELINE/VISU_Plot3DPL.cxx index adfc6ac4..22795765 100644 --- a/src/PIPELINE/VISU_Plot3DPL.cxx +++ b/src/PIPELINE/VISU_Plot3DPL.cxx @@ -100,7 +100,7 @@ VISU_Plot3DPL void VISU_Plot3DPL ::DoShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput) + bool theIsCopyInput) { Superclass::DoShallowCopy(thePipeLine, theIsCopyInput); @@ -153,7 +153,7 @@ VISU_Plot3DPL vtkFloatingPointType VISU_Plot3DPL ::GetScaleFactor( VISU_ColoredPL* theColoredPL, - vtkDataSet* theDataSet ) + vtkDataSet* theDataSet ) { theDataSet->Update(); vtkFloatingPointType aLength = theDataSet->GetLength(); // diagonal length @@ -358,7 +358,7 @@ VISU_Plot3DPL void VISU_Plot3DPL ::SetPlanePosition(vtkFloatingPointType thePosition, - bool theIsRelative) + bool theIsRelative) { bool anIsSameValue = VISU::CheckIsSameValue(myIsRelative, theIsRelative); anIsSameValue &= (myPosition == thePosition); @@ -420,8 +420,8 @@ GetRotateY(){ void VISU_Plot3DPL:: SetOrientation(VISU_CutPlanesPL::PlaneOrientation theOrientation, - vtkFloatingPointType theXAngle, - vtkFloatingPointType theYAngle) + vtkFloatingPointType theXAngle, + vtkFloatingPointType theYAngle) { bool anIsSameValue = VISU::CheckIsSameValue(GetRotateX(), theXAngle); anIsSameValue &= VISU::CheckIsSameValue(GetRotateY(), theYAngle); @@ -461,8 +461,8 @@ VISU_Plot3DPL void VISU_Plot3DPL ::GetBasePlane(vtkFloatingPointType theOrigin[3], - vtkFloatingPointType theNormal[3], - bool theCenterOrigine ) + vtkFloatingPointType theNormal[3], + bool theCenterOrigine ) { VISU_CutPlanesPL::GetDir(theNormal,myAngle,myOrientation); @@ -509,7 +509,7 @@ VISU_Plot3DPL void VISU_Plot3DPL ::GetMinMaxPosition( vtkFloatingPointType& minPos, - vtkFloatingPointType& maxPos ) + vtkFloatingPointType& maxPos ) { vtkFloatingPointType aBounds[6], aBoundPrj[3], aNormal[3]; VISU_CutPlanesPL::GetDir(aNormal,myAngle,myOrientation); diff --git a/src/PIPELINE/VISU_Plot3DPL.hxx b/src/PIPELINE/VISU_Plot3DPL.hxx index d1e7f802..9d7e379c 100644 --- a/src/PIPELINE/VISU_Plot3DPL.hxx +++ b/src/PIPELINE/VISU_Plot3DPL.hxx @@ -63,8 +63,8 @@ public: void SetOrientation(VISU_CutPlanesPL::PlaneOrientation theOrientation, - vtkFloatingPointType theXAngle = 0.0, - vtkFloatingPointType theYAngle = 0.0); + vtkFloatingPointType theXAngle = 0.0, + vtkFloatingPointType theYAngle = 0.0); vtkFloatingPointType GetPlanePosition(); @@ -74,7 +74,7 @@ public: void SetPlanePosition(vtkFloatingPointType thePosition, - bool theIsRelative); + bool theIsRelative); void SetScaleFactor(vtkFloatingPointType theScaleFactor); @@ -96,12 +96,12 @@ public: void GetBasePlane (vtkFloatingPointType theOrigin[3], - vtkFloatingPointType theNormal[3], - bool theCenterOrigine = false ); + vtkFloatingPointType theNormal[3], + bool theCenterOrigine = false ); void GetMinMaxPosition( vtkFloatingPointType& minPos, - vtkFloatingPointType& maxPos ); + vtkFloatingPointType& maxPos ); public: virtual @@ -124,7 +124,7 @@ public: static vtkFloatingPointType GetScaleFactor( VISU_ColoredPL* theColoredPL, - vtkDataSet* theDataSet ); + vtkDataSet* theDataSet ); void SetMapScale(vtkFloatingPointType theMapScale); @@ -142,7 +142,7 @@ protected: virtual void DoShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput); + bool theIsCopyInput); vtkFloatingPointType myAngle[3]; bool myIsRelative, myIsContour; diff --git a/src/PIPELINE/VISU_PointSpriteMapperHolder.cxx b/src/PIPELINE/VISU_PointSpriteMapperHolder.cxx index 6f6e1687..a83aa55e 100644 --- a/src/PIPELINE/VISU_PointSpriteMapperHolder.cxx +++ b/src/PIPELINE/VISU_PointSpriteMapperHolder.cxx @@ -63,15 +63,15 @@ VISU_PointSpriteMapperHolder void VISU_PointSpriteMapperHolder ::ShallowCopy(VISU_MapperHolder *theMapperHolder, - bool theIsCopyInput) + bool theIsCopyInput) { if(VISU_PointSpriteMapperHolder* aMapperHolder = dynamic_cast(theMapperHolder)){ if(theIsCopyInput) SetGaussPtsIDMapper(aMapperHolder->GetGaussPtsIDMapper()); VISU::CopyPointSpriteDataMapper(GetPointSpriteMapper(), - aMapperHolder->GetPointSpriteMapper(), - theIsCopyInput); + aMapperHolder->GetPointSpriteMapper(), + theIsCopyInput); myExtractPolyDataGeometry->SetImplicitFunction(aMapperHolder->GetImplicitFunction()); } } diff --git a/src/PIPELINE/VISU_PointSpriteMapperHolder.hxx b/src/PIPELINE/VISU_PointSpriteMapperHolder.hxx index 79ef77aa..96f6d56f 100644 --- a/src/PIPELINE/VISU_PointSpriteMapperHolder.hxx +++ b/src/PIPELINE/VISU_PointSpriteMapperHolder.hxx @@ -46,7 +46,7 @@ public: virtual void ShallowCopy(VISU_MapperHolder *theMapperHolder, - bool theIsCopyInput); + bool theIsCopyInput); //---------------------------------------------------------------------------- void diff --git a/src/PIPELINE/VISU_PolyDataMapperHolder.cxx b/src/PIPELINE/VISU_PolyDataMapperHolder.cxx index 74d39f1e..a328a587 100644 --- a/src/PIPELINE/VISU_PolyDataMapperHolder.cxx +++ b/src/PIPELINE/VISU_PolyDataMapperHolder.cxx @@ -83,15 +83,15 @@ VISU_PolyDataMapperHolder void VISU_PolyDataMapperHolder ::ShallowCopy(VISU_MapperHolder *theMapperHolder, - bool theIsCopyInput) + bool theIsCopyInput) { if(VISU_PolyDataMapperHolder* aMapperHolder = dynamic_cast(theMapperHolder)){ if(theIsCopyInput) SetPolyDataIDMapper(aMapperHolder->GetPolyDataIDMapper()); VISU::CopyPolyDataMapper(GetPolyDataMapper(), - aMapperHolder->GetPolyDataMapper(), - theIsCopyInput); + aMapperHolder->GetPolyDataMapper(), + theIsCopyInput); myExtractPolyDataGeometry->SetImplicitFunction(aMapperHolder->GetImplicitFunction()); } } @@ -281,7 +281,7 @@ VISU_PolyDataMapperHolder vtkImplicitFunction* aFun = NULL; aFunction->InitTraversal(); for(vtkIdType anID = 0; anID <= theID; anID++) - aFun = aFunction->GetNextItem(); + aFun = aFunction->GetNextItem(); aPlane = dynamic_cast(aFun); } } diff --git a/src/PIPELINE/VISU_PolyDataMapperHolder.hxx b/src/PIPELINE/VISU_PolyDataMapperHolder.hxx index 35e909b2..524c49ae 100644 --- a/src/PIPELINE/VISU_PolyDataMapperHolder.hxx +++ b/src/PIPELINE/VISU_PolyDataMapperHolder.hxx @@ -48,7 +48,7 @@ public: virtual void ShallowCopy(VISU_MapperHolder *theMapperHolder, - bool theIsCopyInput); + bool theIsCopyInput); //! Gets memory size used by the instance (bytes). virtual diff --git a/src/PIPELINE/VISU_ScalarBarActor.cxx b/src/PIPELINE/VISU_ScalarBarActor.cxx index fcb77b2d..4aadc308 100644 --- a/src/PIPELINE/VISU_ScalarBarActor.cxx +++ b/src/PIPELINE/VISU_ScalarBarActor.cxx @@ -324,15 +324,15 @@ int VISU_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport) // RKV : Begin // If the distribution is changed then recalculate the total if (this->Distribution->GetMTime() > this->BuildTime) { - int aNbVals = this->Distribution->GetNumberOfTuples(); + int aNbVals = this->Distribution->GetNumberOfTuples(); double range[2]; this->Distribution->GetRange(range); this->DistributionActor->SetYRange(0, range[1]); -/* int total = 0; - for(vtkIdType aValId = 0; aValId < aNbVals; aValId++){ - total += this->Distribution->GetValue(aValId); - } - this->DistributionActor->SetYRange(0, total); +/* int total = 0; + for(vtkIdType aValId = 0; aValId < aNbVals; aValId++){ + total += this->Distribution->GetValue(aValId); + } + this->DistributionActor->SetYRange(0, total); */ } @@ -645,9 +645,9 @@ void VISU_ScalarBarActor::AllocateAndSizeLabels(int *labelSize, int *size, if(LabelRatioWidth == 0) if ( this->Orientation == VTK_ORIENT_VERTICAL ) - targetWidth = (int)(0.6*size[0]); - else - targetWidth = (int)(size[0]*0.8/this->NumberOfLabels); + targetWidth = (int)(0.6*size[0]); + else + targetWidth = (int)(size[0]*0.8/this->NumberOfLabels); else targetWidth = (int)(0.01*LabelRatioWidth*size[0]); @@ -698,9 +698,9 @@ void VISU_ScalarBarActor::SetDistributionVisibility(int v) { this->DistributionVisibility = v; if (v) { - this->DistributionActor->VisibilityOn(); + this->DistributionActor->VisibilityOn(); } else { - this->DistributionActor->VisibilityOff(); + this->DistributionActor->VisibilityOff(); } } @@ -720,11 +720,11 @@ void VISU_ScalarBarActor::SetDistribution(vtkDoubleArray *distr) // int total = 0; if (this->GetDebug()) { for(vtkIdType aValId = 0; aValId < aNbVals; aValId++){ -// if (this->GetDebug()) { - if (this->Distribution->GetValue(aValId) > 0) - vtkDebugMacro(<< "D(" << aValId << ") = " << this->Distribution->GetValue(aValId)); -// } -// total += this->Distribution->GetValue(aValId); +// if (this->GetDebug()) { + if (this->Distribution->GetValue(aValId) > 0) + vtkDebugMacro(<< "D(" << aValId << ") = " << this->Distribution->GetValue(aValId)); +// } +// total += this->Distribution->GetValue(aValId); } } // this->DistributionActor->SetYRange(0, total); @@ -735,18 +735,18 @@ void VISU_ScalarBarActor::SetDistribution(vtkDoubleArray *distr) } void VISU_ScalarBarActor::DebugOn() { - this->DistributionActor->DebugOn(); - Superclass::DebugOn(); + this->DistributionActor->DebugOn(); + Superclass::DebugOn(); } void VISU_ScalarBarActor::DebugOff() { - this->DistributionActor->DebugOff(); - Superclass::DebugOff(); + this->DistributionActor->DebugOff(); + Superclass::DebugOff(); } // RKV : End void VISU_ScalarBarActor::SetRatios(int titleRatioSize, int labelRatioWidth, - int barRatioWidth, int barRatioHeight) + int barRatioWidth, int barRatioHeight) { TitleRatioSize=titleRatioSize; if(TitleRatioSize>100) @@ -783,16 +783,16 @@ void VISU_ScalarBarActor::GetRatios(int& titleRatioSize, int& labelRatioWidth, } void VISU_ScalarBarActor::SizeBar(int& barSizeWidth, int& barSizeHeight, int *size, - vtkViewport *viewport, vtkFloatingPointType *range) + vtkViewport *viewport, vtkFloatingPointType *range) { if(BarRatioWidth == 0) if ( this->Orientation == VTK_ORIENT_VERTICAL ) { - int labelSize[2]; - this->AllocateAndSizeLabels(labelSize, size, viewport,range); - barSizeWidth = size[0] - 4 - labelSize[0]; + int labelSize[2]; + this->AllocateAndSizeLabels(labelSize, size, viewport,range); + barSizeWidth = size[0] - 4 - labelSize[0]; } else - barSizeWidth = size[0]; + barSizeWidth = size[0]; else barSizeWidth = (int)(0.01*BarRatioWidth*size[0]); @@ -817,13 +817,13 @@ void VISU_ScalarBarActor::PlaceDistribution(vtkViewport *viewport, const int bar if ( this->Orientation == VTK_ORIENT_VERTICAL ) { // Position the distribution curve vertically if (u > 0.5) { - // X - UP, Y - TO THE LEFT - this->DistributionActor->SetPlotLocation(VISU_XYPLOT_RIGHT); - // Curve to be placed on the left side of the bar + // X - UP, Y - TO THE LEFT + this->DistributionActor->SetPlotLocation(VISU_XYPLOT_RIGHT); + // Curve to be placed on the left side of the bar vtkDebugMacro(<< "Curve to be placed on the left side of the bar"); // relative to the bar origin - u = 0; - v = 0; + u = 0; + v = 0; viewport->ViewportToNormalizedViewport(u, v); vtkDebugMacro(<< "u=" << u << "; v=" << v); this->DistributionActor->GetPositionCoordinate()->SetValue(u, v, 0); @@ -834,13 +834,13 @@ void VISU_ScalarBarActor::PlaceDistribution(vtkViewport *viewport, const int bar vtkDebugMacro("u2=" << u << "; v2=" << v); this->DistributionActor->GetPosition2Coordinate()->SetValue(u, v, 0); } else { - // X - UP, Y - TO THE RIGHT - this->DistributionActor->SetPlotLocation(VISU_XYPLOT_LEFT); - // Curve to be placed on the right side of the bar + // X - UP, Y - TO THE RIGHT + this->DistributionActor->SetPlotLocation(VISU_XYPLOT_LEFT); + // Curve to be placed on the right side of the bar vtkDebugMacro(<< "Curve to be placed on the right side of the bar"); // relative to the bar origin u = barWidth; - v = 0; + v = 0; viewport->ViewportToNormalizedViewport(u, v); vtkDebugMacro(<< "u=" << u << "; v=" << v); this->DistributionActor->GetPositionCoordinate()->SetValue(u, v, 0); @@ -854,13 +854,13 @@ void VISU_ScalarBarActor::PlaceDistribution(vtkViewport *viewport, const int bar } else { // Position the distribution curve horizontally if (v > 0.5) { - // X - TO THE LEFT, Y - DOWN - this->DistributionActor->SetPlotLocation(VISU_XYPLOT_TOP); - // Curve to be placed below the bar + // X - TO THE LEFT, Y - DOWN + this->DistributionActor->SetPlotLocation(VISU_XYPLOT_TOP); + // Curve to be placed below the bar vtkDebugMacro(<< "Curve to be placed below the bar"); // relative to the bar origin - u = 0; - v = 0; + u = 0; + v = 0; viewport->ViewportToNormalizedViewport(u, v); vtkDebugMacro(<< "u=" << u << "; v=" << v); this->DistributionActor->GetPositionCoordinate()->SetValue(u, v, 0); @@ -871,13 +871,13 @@ void VISU_ScalarBarActor::PlaceDistribution(vtkViewport *viewport, const int bar vtkDebugMacro("u2=" << u << "; v2=" << v); this->DistributionActor->GetPosition2Coordinate()->SetValue(u, v, 0); } else { - // X - TO THE RIGHT, Y - UP - this->DistributionActor->SetPlotLocation(VISU_XYPLOT_BOTTOM); - // Curve to be placed on the top of the bar + // X - TO THE RIGHT, Y - UP + this->DistributionActor->SetPlotLocation(VISU_XYPLOT_BOTTOM); + // Curve to be placed on the top of the bar vtkDebugMacro(<< "Curve to be placed on the top of the bar"); // relative to the bar origin - u = 0; - v = barHeight; + u = 0; + v = barHeight; viewport->ViewportToNormalizedViewport(u, v); vtkDebugMacro(<< "u=" << u << "; v=" << v); this->DistributionActor->GetPositionCoordinate()->SetValue(u, v, 0); diff --git a/src/PIPELINE/VISU_ScalarBarActor.hxx b/src/PIPELINE/VISU_ScalarBarActor.hxx index e624af0d..6a4bf8ee 100644 --- a/src/PIPELINE/VISU_ScalarBarActor.hxx +++ b/src/PIPELINE/VISU_ScalarBarActor.hxx @@ -131,9 +131,9 @@ public: // Set/Get the scalar bar dimention properties in persents. // 0 <= ration <= 100 void SetRatios(int titleRatioSize,int labelRatioWidth, - int barRatioWidth, int barRatioHeight); + int barRatioWidth, int barRatioHeight); void GetRatios(int& titleRatioSize, int& labelRatioWidth, - int& barRatioWidth, int& barRatioHeight); + int& barRatioWidth, int& barRatioHeight); // Description: // Set/Get the format with which to print the labels on the scalar @@ -200,8 +200,8 @@ private: void SizeTitle(int *titleSize, int *size, vtkViewport *viewport); void SizeBar(int& barSizeWidth, int& barSizeHeight, int *size, - vtkViewport *viewport, vtkFloatingPointType *range); - + vtkViewport *viewport, vtkFloatingPointType *range); + /** Place the distribution plot actor in the viewport according to the * scalar bar location and orientation */ void PlaceDistribution(vtkViewport *viewport, const int barWidth, const int barHeight); diff --git a/src/PIPELINE/VISU_ScalarBarCtrl.cxx b/src/PIPELINE/VISU_ScalarBarCtrl.cxx index 03b2a232..5833db1f 100644 --- a/src/PIPELINE/VISU_ScalarBarCtrl.cxx +++ b/src/PIPELINE/VISU_ScalarBarCtrl.cxx @@ -152,7 +152,7 @@ VISU_ScalarBarCtrl void VISU_ScalarBarCtrl ::SetRangeLocal(vtkFloatingPointType theMin, - vtkFloatingPointType theMax) + vtkFloatingPointType theMax) { myLocalLookupTable->SetTableRange(theMin,theMax); } @@ -169,7 +169,7 @@ VISU_ScalarBarCtrl void VISU_ScalarBarCtrl ::SetRangeGlobal(vtkFloatingPointType theMin, - vtkFloatingPointType theMax) + vtkFloatingPointType theMax) { myGlobalLookupTable->SetTableRange(theMin,theMax); } @@ -391,8 +391,8 @@ VISU_ScalarBarCtrl void VISU_ScalarBarCtrl ::PrepareTables(VISU_ScalarBarActor* theScalarBarActor, - VISU_LookupTable *theLookupTable, - vtkIdType theId) + VISU_LookupTable *theLookupTable, + vtkIdType theId) { vtkCoordinate * aCoordinate = theScalarBarActor->GetPositionCoordinate(); aCoordinate->SetCoordinateSystemToNormalizedViewport(); diff --git a/src/PIPELINE/VISU_ScalarBarCtrl.hxx b/src/PIPELINE/VISU_ScalarBarCtrl.hxx index b6155e5c..a8f7bf3d 100644 --- a/src/PIPELINE/VISU_ScalarBarCtrl.hxx +++ b/src/PIPELINE/VISU_ScalarBarCtrl.hxx @@ -57,7 +57,7 @@ public: // Ranges void SetRangeGlobal(vtkFloatingPointType theMin, - vtkFloatingPointType theMax); + vtkFloatingPointType theMax); void SetRangeGlobal(vtkFloatingPointType *theRange); @@ -66,7 +66,7 @@ public: void SetRangeLocal(vtkFloatingPointType theMin, - vtkFloatingPointType theMax); + vtkFloatingPointType theMax); void SetRangeLocal(vtkFloatingPointType *theRange); @@ -173,8 +173,8 @@ protected: void PrepareTables(VISU_ScalarBarActor* theScalarBarActor, - VISU_LookupTable *theLookupTable, - vtkIdType theId); + VISU_LookupTable *theLookupTable, + vtkIdType theId); protected: EMode myMode; diff --git a/src/PIPELINE/VISU_ScalarMapPL.hxx b/src/PIPELINE/VISU_ScalarMapPL.hxx index e504112b..ea975bc7 100644 --- a/src/PIPELINE/VISU_ScalarMapPL.hxx +++ b/src/PIPELINE/VISU_ScalarMapPL.hxx @@ -40,8 +40,8 @@ class VISU_MergeFilter; //---------------------------------------------------------------------------- class VISU_PIPELINE_EXPORT VISU_ScalarMapPL : public VISU_MergedPL, - public VISU_ColoredPL, - public VISU_UnstructuredGridPL + public VISU_ColoredPL, + public VISU_UnstructuredGridPL { public: vtkTypeMacro(VISU_ScalarMapPL, VISU_ColoredPL); @@ -121,7 +121,7 @@ protected: virtual void DoShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput); + bool theIsCopyInput); void SetElnoDisassembleState( bool theIsShrunk ); diff --git a/src/PIPELINE/VISU_SphereWidget.cxx b/src/PIPELINE/VISU_SphereWidget.cxx index 42eecb1d..4369d7bc 100755 --- a/src/PIPELINE/VISU_SphereWidget.cxx +++ b/src/PIPELINE/VISU_SphereWidget.cxx @@ -388,9 +388,9 @@ void VISU_SphereWidget::OnMouseMove() // Compute the two points defining the motion vector aCamera->GetFocalPoint(focalPoint); ComputeWorldToDisplay(focalPoint[0], - focalPoint[1], - focalPoint[2], - focalPoint); + focalPoint[1], + focalPoint[2], + focalPoint); z = focalPoint[2]; ComputeDisplayToWorld(double(Interactor->GetLastEventPosition()[0]), double(Interactor->GetLastEventPosition()[1]), diff --git a/src/PIPELINE/VISU_SphereWidget.hxx b/src/PIPELINE/VISU_SphereWidget.hxx index 91463804..ce571c82 100755 --- a/src/PIPELINE/VISU_SphereWidget.hxx +++ b/src/PIPELINE/VISU_SphereWidget.hxx @@ -75,8 +75,8 @@ public: // Description: // Set/Get the center of the sphere. void SetCenter(vtkFloatingPointType x, - vtkFloatingPointType y, - vtkFloatingPointType z); + vtkFloatingPointType y, + vtkFloatingPointType z); void SetCenter(vtkFloatingPointType x[3]); vtkFloatingPointType* GetCenter(); diff --git a/src/PIPELINE/VISU_StreamLinesPL.cxx b/src/PIPELINE/VISU_StreamLinesPL.cxx index 5ea2c4f9..1a832266 100644 --- a/src/PIPELINE/VISU_StreamLinesPL.cxx +++ b/src/PIPELINE/VISU_StreamLinesPL.cxx @@ -113,17 +113,17 @@ VISU_StreamLinesPL void VISU_StreamLinesPL ::DoShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput) + bool theIsCopyInput) { Superclass::DoShallowCopy(thePipeLine, theIsCopyInput); if(VISU_StreamLinesPL *aPipeLine = dynamic_cast(thePipeLine)){ SetParams(aPipeLine->GetIntegrationStep(), - aPipeLine->GetPropagationTime(), - aPipeLine->GetStepLength(), - aPipeLine->GetSource(), - aPipeLine->GetUsedPoints(), - aPipeLine->GetDirection()); + aPipeLine->GetPropagationTime(), + aPipeLine->GetStepLength(), + aPipeLine->GetSource(), + aPipeLine->GetUsedPoints(), + aPipeLine->GetDirection()); } } @@ -132,9 +132,9 @@ VISU_StreamLinesPL size_t VISU_StreamLinesPL ::GetNecasseryMemorySize(vtkIdType theNbOfPoints, - vtkFloatingPointType theStepLength, - vtkFloatingPointType thePropogationTime, - vtkFloatingPointType thePercents) + vtkFloatingPointType theStepLength, + vtkFloatingPointType thePropogationTime, + vtkFloatingPointType thePercents) { static vtkFloatingPointType aStreamPointSize = sizeof(vtkFloatingPointType)*15 + sizeof(vtkIdType)*2; static vtkFloatingPointType aStreamArraySize = aStreamPointSize*1024; // == 69632 @@ -162,9 +162,9 @@ VISU_StreamLinesPL size_t VISU_StreamLinesPL ::FindPossibleParams(vtkDataSet* theDataSet, - vtkFloatingPointType& theStepLength, - vtkFloatingPointType& thePropogationTime, - vtkFloatingPointType& thePercents) + vtkFloatingPointType& theStepLength, + vtkFloatingPointType& thePropogationTime, + vtkFloatingPointType& thePercents) { static vtkFloatingPointType aPercentsDecrease = 3.0, aStepLengthIncrease = 9.0; vtkIdType aNbOfPoints = theDataSet->GetNumberOfPoints(); @@ -178,19 +178,19 @@ VISU_StreamLinesPL vtkFloatingPointType aStepLength = theStepLength + aDeltaStepLength; if(aStepLength < aMaxStepLength) theStepLength = aStepLength; else if(aStepChanged){ - aStepLength = aMaxStepLength; - aStepChanged = 0; + aStepLength = aMaxStepLength; + aStepChanged = 0; } vtkFloatingPointType aPercents = thePercents /= aPercentsDecrease; if(aPercents*aNbOfPoints > 1) thePercents = aPercents; else if(aPerecentsChanged) { - thePercents = 1.1 / aNbOfPoints; - aPerecentsChanged = 0; + thePercents = 1.1 / aNbOfPoints; + aPerecentsChanged = 0; } aSize = GetNecasseryMemorySize(aNbOfPoints,theStepLength,thePropogationTime,thePercents); if(CheckAvailableMemory(aSize)){ - anIsPossible = i; - break; + anIsPossible = i; + break; } } } @@ -203,11 +203,11 @@ VISU_StreamLinesPL size_t VISU_StreamLinesPL ::SetParams(vtkFloatingPointType theIntStep, - vtkFloatingPointType thePropogationTime, - vtkFloatingPointType theStepLength, - vtkPointSet* theSource, - vtkFloatingPointType thePercents, - int theDirection) + vtkFloatingPointType thePropogationTime, + vtkFloatingPointType theStepLength, + vtkPointSet* theSource, + vtkFloatingPointType thePercents, + int theDirection) { vtkPointSet* aDataSet = theSource? theSource: GetMergedInput(); aDataSet->Update(); @@ -218,19 +218,19 @@ VISU_StreamLinesPL thePercents = 2.0 / aNbOfPoints; theIntStep = CorrectIntegrationStep(theIntStep, - aPointSet, - thePercents); + aPointSet, + thePercents); thePropogationTime = CorrectPropagationTime(thePropogationTime, - aPointSet); + aPointSet); theStepLength = CorrectStepLength(theStepLength, - aPointSet); + aPointSet); size_t anIsAccepted = FindPossibleParams(aPointSet, - theStepLength, - thePropogationTime, - thePercents); + theStepLength, + thePropogationTime, + thePercents); if (anIsAccepted) { mySource = theSource; @@ -310,7 +310,7 @@ VISU_StreamLinesPL size_t VISU_StreamLinesPL ::IsPossible(vtkPointSet* theDataSet, - vtkFloatingPointType thePercents) + vtkFloatingPointType thePercents) { vtkFloatingPointType aStepLength = GetBaseStepLength(theDataSet); vtkFloatingPointType aBasePropTime = GetBasePropagationTime(theDataSet); @@ -319,9 +319,9 @@ VISU_StreamLinesPL vtkDataSet* aDataSet = aPointsFilter->GetOutput(); aDataSet->Update(); size_t aRes = FindPossibleParams(aDataSet, - aStepLength, - aBasePropTime, - thePercents); + aStepLength, + aBasePropTime, + thePercents); aPointsFilter->Delete(); return aRes; } @@ -367,7 +367,7 @@ VISU_StreamLinesPL vtkFloatingPointType VISU_StreamLinesPL ::GetMinIntegrationStep(vtkDataSet* theDataSet, - vtkFloatingPointType thePercents) + vtkFloatingPointType thePercents) { if(!theDataSet) return -1.0; @@ -445,7 +445,7 @@ VISU_StreamLinesPL vtkFloatingPointType VISU_StreamLinesPL ::GetBaseIntegrationStep(vtkDataSet* theDataSet, - vtkFloatingPointType thePercents) + vtkFloatingPointType thePercents) { theDataSet->Update(); @@ -467,8 +467,8 @@ VISU_StreamLinesPL vtkFloatingPointType VISU_StreamLinesPL ::CorrectIntegrationStep(vtkFloatingPointType theStep, - vtkDataSet* theDataSet, - vtkFloatingPointType thePercents) + vtkDataSet* theDataSet, + vtkFloatingPointType thePercents) { theDataSet->Update(); @@ -530,7 +530,7 @@ VISU_StreamLinesPL vtkFloatingPointType VISU_StreamLinesPL ::CorrectPropagationTime(vtkFloatingPointType thePropagationTime, - vtkDataSet* theDataSet) + vtkDataSet* theDataSet) { vtkFloatingPointType aMinPropagationTime = GetMinPropagationTime(theDataSet); if(aMinPropagationTime > thePropagationTime) @@ -612,7 +612,7 @@ VISU_StreamLinesPL vtkFloatingPointType VISU_StreamLinesPL ::CorrectStepLength(vtkFloatingPointType theStep, - vtkDataSet* theDataSet) + vtkDataSet* theDataSet) { vtkFloatingPointType aMinStep = GetMinStepLength(theDataSet); if(theStep < aMinStep) @@ -652,8 +652,8 @@ VISU_StreamLinesPL vtkFloatingPointType aPropagationTime = GetBasePropagationTime(aDataSet); vtkFloatingPointType aStepLength = GetBaseStepLength(aDataSet); SetParams(anIntStep, - aPropagationTime, - aStepLength); + aPropagationTime, + aStepLength); } @@ -665,8 +665,8 @@ VISU_StreamLinesPL Superclass::Build(); VISU::CellDataToPoint(myStream, - myCellDataToPointData, - GetMergedInput()); + myCellDataToPointData, + GetMergedInput()); myGeomFilter->SetInput(myStream->GetOutput()); myGeomFilter->ExtentClippingOn(); diff --git a/src/PIPELINE/VISU_StreamLinesPL.hxx b/src/PIPELINE/VISU_StreamLinesPL.hxx index 96d0b608..d2ec3a86 100644 --- a/src/PIPELINE/VISU_StreamLinesPL.hxx +++ b/src/PIPELINE/VISU_StreamLinesPL.hxx @@ -56,11 +56,11 @@ public: virtual size_t SetParams(vtkFloatingPointType theIntStep, - vtkFloatingPointType thePropogationTime, - vtkFloatingPointType theStepLength, - vtkPointSet* theSource = NULL, - vtkFloatingPointType thePercents = 0.3, - int theDirection = VTK_INTEGRATE_BOTH_DIRECTIONS); + vtkFloatingPointType thePropogationTime, + vtkFloatingPointType theStepLength, + vtkPointSet* theSource = NULL, + vtkFloatingPointType thePercents = 0.3, + int theDirection = VTK_INTEGRATE_BOTH_DIRECTIONS); virtual vtkPointSet* @@ -156,11 +156,11 @@ public: static vtkFloatingPointType GetMinIntegrationStep(vtkDataSet* theDataSet, - vtkFloatingPointType thePercents = 0.3); + vtkFloatingPointType thePercents = 0.3); static vtkFloatingPointType GetBaseIntegrationStep(vtkDataSet* theDataSet, - vtkFloatingPointType thePercents = 0.3); + vtkFloatingPointType thePercents = 0.3); static vtkFloatingPointType @@ -193,7 +193,7 @@ public: static size_t IsPossible(vtkPointSet* theDataSet, - vtkFloatingPointType thePercents = 0.3); + vtkFloatingPointType thePercents = 0.3); protected: VISU_StreamLinesPL(); @@ -204,37 +204,37 @@ protected: virtual void DoShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput); + bool theIsCopyInput); static size_t GetNecasseryMemorySize(vtkIdType theNbOfPoints, - vtkFloatingPointType theStepLength, - vtkFloatingPointType thePropogationTime, - vtkFloatingPointType thePercents = 0.3); + vtkFloatingPointType theStepLength, + vtkFloatingPointType thePropogationTime, + vtkFloatingPointType thePercents = 0.3); static size_t FindPossibleParams(vtkDataSet* theDataSet, - vtkFloatingPointType& theStepLength, - vtkFloatingPointType& thePropogationTime, - vtkFloatingPointType& thePercents); + vtkFloatingPointType& theStepLength, + vtkFloatingPointType& thePropogationTime, + vtkFloatingPointType& thePercents); static vtkFloatingPointType CorrectIntegrationStep(vtkFloatingPointType theStep, - vtkDataSet* theDataSet, - vtkFloatingPointType thePercents = 0.3); + vtkDataSet* theDataSet, + vtkFloatingPointType thePercents = 0.3); static vtkFloatingPointType CorrectPropagationTime(vtkFloatingPointType thePropagationTime, - vtkDataSet* theDataSet); + vtkDataSet* theDataSet); static vtkFloatingPointType CorrectStepLength(vtkFloatingPointType theStep, - vtkDataSet* theDataSet); + vtkDataSet* theDataSet); vtkStreamLine* myStream; vtkPointSet* mySource; diff --git a/src/PIPELINE/VISU_VectorsPL.cxx b/src/PIPELINE/VISU_VectorsPL.cxx index e6871f90..4c0f2ebd 100644 --- a/src/PIPELINE/VISU_VectorsPL.cxx +++ b/src/PIPELINE/VISU_VectorsPL.cxx @@ -44,9 +44,9 @@ vtkStandardNewMacro(VISU_VectorsPL); //---------------------------------------------------------------------------- template void ToCellCenters( TOutputFilter *theOutputFilter, - vtkCellCenters *theCellCenters, - vtkDataSet* theDataSet, - VISU_UsedPointsFilter* theUsedPointsFilter ) + vtkCellCenters *theCellCenters, + vtkDataSet* theDataSet, + VISU_UsedPointsFilter* theUsedPointsFilter ) { if ( VISU::IsDataOnCells( theDataSet ) ) { theCellCenters->SetInput( theDataSet ); @@ -120,7 +120,7 @@ VISU_VectorsPL void VISU_VectorsPL ::DoShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput) + bool theIsCopyInput) { Superclass::DoShallowCopy(thePipeLine, theIsCopyInput); @@ -239,9 +239,9 @@ VISU_VectorsPL Superclass::Build(); ToCellCenters( myTransformFilter, - myCenters, - GetMergedInput(), - myUsedPointsFilter ); + myCenters, + GetMergedInput(), + myUsedPointsFilter ); myGlyph->SetInput( myTransformFilter->GetOutput() ); myGlyph->SetVectorModeToUseVector(); diff --git a/src/PIPELINE/VISU_VectorsPL.hxx b/src/PIPELINE/VISU_VectorsPL.hxx index 7621f725..d96cfdb8 100644 --- a/src/PIPELINE/VISU_VectorsPL.hxx +++ b/src/PIPELINE/VISU_VectorsPL.hxx @@ -131,7 +131,7 @@ protected: virtual void DoShallowCopy(VISU_PipeLine *thePipeLine, - bool theIsCopyInput); + bool theIsCopyInput); GlyphType myTypeGlyph; GlyphPos myPosGlyph; diff --git a/src/PIPELINE/VISU_WidgetCtrl.cxx b/src/PIPELINE/VISU_WidgetCtrl.cxx index 9f86db00..055ad249 100644 --- a/src/PIPELINE/VISU_WidgetCtrl.cxx +++ b/src/PIPELINE/VISU_WidgetCtrl.cxx @@ -68,21 +68,21 @@ VISU_WidgetCtrl::VISU_WidgetCtrl() int i; for (i=0; iAddObserver(vtkCommand::EnableEvent, - myEventCallbackCommand, - myPriority); + myEventCallbackCommand, + myPriority); myWidgets[i]->AddObserver(vtkCommand::DisableEvent, - myEventCallbackCommand, - myPriority); + myEventCallbackCommand, + myPriority); myWidgets[i]->AddObserver(vtkCommand::EndInteractionEvent, - myEventCallbackCommand, - myPriority); + myEventCallbackCommand, + myPriority); myWidgets[i]->AddObserver(vtkCommand::StartInteractionEvent, - myEventCallbackCommand, - myPriority); + myEventCallbackCommand, + myPriority); myWidgets[i]->AddObserver(vtkCommand::InteractionEvent, - myEventCallbackCommand, - myPriority); + myEventCallbackCommand, + myPriority); } } //================================================================== @@ -130,8 +130,8 @@ void VISU_WidgetCtrl::SetEnabled(int theFlag) if (theFlag) {//enabling if (HasActiveIndex()) { for (i=0; iSetEnabled(iFlag); + iFlag=(i==myActiveIndex) ? 1 : 0; + myWidgets[i]->SetEnabled(iFlag); } } } @@ -149,9 +149,9 @@ void VISU_WidgetCtrl::SetEnabled(int theFlag) // purpose : //================================================================== void VISU_WidgetCtrl::ProcessEvents(vtkObject* vtkNotUsed(theObject), - unsigned long theEvent, - void* theClientData, - void* vtkNotUsed(theCallData)) + unsigned long theEvent, + void* theClientData, + void* vtkNotUsed(theCallData)) { VISU_WidgetCtrl *aSelf = reinterpret_cast(theClientData); switch(theEvent){ @@ -323,7 +323,7 @@ vtkImplicitFunction* VISU_WidgetCtrl::ImplicitFunction() } //================================================================== -vtkFloatingPointType +vtkFloatingPointType VISU_WidgetCtrl ::EvaluateFunction(vtkFloatingPointType theX[3]) { @@ -335,10 +335,10 @@ VISU_WidgetCtrl } //================================================================== -void +void VISU_WidgetCtrl ::EvaluateGradient(vtkFloatingPointType theX[3], - vtkFloatingPointType theG[3]) + vtkFloatingPointType theG[3]) { theG[0] = theG[1] = theG[2] = 0.0; if(VISU_ImplicitFunctionWidget* aWidget = GetActiveWidget()){ diff --git a/src/PIPELINE/VISU_WidgetCtrl.hxx b/src/PIPELINE/VISU_WidgetCtrl.hxx index 7024e145..7faa4c1f 100644 --- a/src/PIPELINE/VISU_WidgetCtrl.hxx +++ b/src/PIPELINE/VISU_WidgetCtrl.hxx @@ -52,13 +52,13 @@ public: vtkImplicitFunction* ImplicitFunction(); virtual - vtkFloatingPointType + vtkFloatingPointType EvaluateFunction(vtkFloatingPointType theX[3]); virtual - void + void EvaluateGradient(vtkFloatingPointType theX[3], - vtkFloatingPointType theG[3]); + vtkFloatingPointType theG[3]); virtual unsigned long @@ -97,9 +97,9 @@ public: VISU_SphereWidget * GetSphereWidget(); // static void ProcessEvents(vtkObject* theObject, - unsigned long theEvent, - void* theClientData, - void* theCalldata); + unsigned long theEvent, + void* theClientData, + void* theCalldata); // protected: VISU_WidgetCtrl(); diff --git a/src/PIPELINE/VISU_XYPlotActor.hxx b/src/PIPELINE/VISU_XYPlotActor.hxx index 1647a846..c9d86edc 100644 --- a/src/PIPELINE/VISU_XYPlotActor.hxx +++ b/src/PIPELINE/VISU_XYPlotActor.hxx @@ -118,7 +118,7 @@ class vtkTextProperty; * VISU_XYPLOT_RIGHT - the right bottom corner (X axis is directed to the top, Y - to the left) */ enum VISU_XYPlotLocation { VISU_XYPLOT_BOTTOM = 0, - VISU_XYPLOT_TOP, VISU_XYPLOT_LEFT, VISU_XYPLOT_RIGHT }; + VISU_XYPLOT_TOP, VISU_XYPLOT_LEFT, VISU_XYPLOT_RIGHT }; // RKV : End class VISU_PIPELINE_EXPORT VISU_XYPlotActor : public vtkActor2D diff --git a/src/VISUGUI/VisuGUI.h b/src/VISUGUI/VisuGUI.h index 53b8064d..90205718 100644 --- a/src/VISUGUI/VisuGUI.h +++ b/src/VISUGUI/VisuGUI.h @@ -55,7 +55,7 @@ class VisuGUI: public SalomeApp_Module public: enum PanelId { SelectionPanelId = 0, - FeatureEdgesPanelId, + FeatureEdgesPanelId, ClippingPlanesPanelId }; public: @@ -79,7 +79,7 @@ public: virtual SUIT_ViewManager* getViewManager(const QString& theType, - const bool theIsCreate); + const bool theIsCreate); VISU::TViewToPrs3d& getScalarBarsMap(); diff --git a/src/VISUGUI/VisuGUI_BasePanel.cxx b/src/VISUGUI/VisuGUI_BasePanel.cxx index 6b49e5c5..2db8ded0 100755 --- a/src/VISUGUI/VisuGUI_BasePanel.cxx +++ b/src/VISUGUI/VisuGUI_BasePanel.cxx @@ -80,7 +80,7 @@ public: \param theParent parent widget */ VisuGUI_BasePanel::VisuGUI_BasePanel( const QString& theName, - QWidget* theParent, + QWidget* theParent, const int theBtns ) : QGroupBox( theName, theParent ), myOK( 0 ), diff --git a/src/VISUGUI/VisuGUI_BuildProgressDlg.cxx b/src/VISUGUI/VisuGUI_BuildProgressDlg.cxx index 5a96a705..1ac19ffd 100644 --- a/src/VISUGUI/VisuGUI_BuildProgressDlg.cxx +++ b/src/VISUGUI/VisuGUI_BuildProgressDlg.cxx @@ -287,11 +287,11 @@ void VisuGUI_BuildProgressDlg::onHelp() app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); } else { - QString platform; + QString platform; #ifdef WIN32 - platform = "winapplication"; + platform = "winapplication"; #else - platform = "application"; + platform = "application"; #endif SUIT_MessageBox::warning(0, ("WRN_WARNING"), tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). @@ -329,7 +329,7 @@ void VisuGUI_BuildProgressDlg::onTimer() { myTime = myTime.addMSecs( 100 ); if( myTime.minute() > 9 && myTimeLCDNumber->numDigits() < 9 ) - myTimeLCDNumber->setNumDigits( 9 ); + myTimeLCDNumber->setNumDigits( 9 ); myTimeLCDNumber->display( myTime.toString( "m:ss.zzz" ) ); bool isEntitiesDone = myResult->IsEntitiesDone(); @@ -349,25 +349,25 @@ void VisuGUI_BuildProgressDlg::onTimer() if( aBuildAtOnce ) { - updateButton( myBuildEntitiesButton, true ); - updateButton( myBuildFieldsButton, true ); - updateButton( myBuildMinMaxButton, true ); - updateButton( myBuildGroupsButton, true ); - - QApplication::restoreOverrideCursor(); - - QTime aTime; - int mSecs = ( int )( 1000 * ( vtkTimerLog::GetCurrentTime() - myCurrentTime ) ); - aTime = aTime.addMSecs( mSecs ); - if( aTime.minute() > 9 ) - myTimeLCDNumber->setNumDigits( 9 ); - myTimeLCDNumber->display( aTime.toString( "m:ss.zzz" ) ); + updateButton( myBuildEntitiesButton, true ); + updateButton( myBuildFieldsButton, true ); + updateButton( myBuildMinMaxButton, true ); + updateButton( myBuildGroupsButton, true ); + + QApplication::restoreOverrideCursor(); + + QTime aTime; + int mSecs = ( int )( 1000 * ( vtkTimerLog::GetCurrentTime() - myCurrentTime ) ); + aTime = aTime.addMSecs( mSecs ); + if( aTime.minute() > 9 ) + myTimeLCDNumber->setNumDigits( 9 ); + myTimeLCDNumber->display( aTime.toString( "m:ss.zzz" ) ); } if( myCloseCheckBox->isChecked() ) - done( 0 ); + done( 0 ); else - SUIT_MessageBox::warning( this, + SUIT_MessageBox::warning( this, tr( "INF_VISU" ), tr( "IMPORT_DONE" ), tr( "BUT_OK" ) ); diff --git a/src/VISUGUI/VisuGUI_CacheDlg.cxx b/src/VISUGUI/VisuGUI_CacheDlg.cxx index 050ee390..e4b5748f 100644 --- a/src/VISUGUI/VisuGUI_CacheDlg.cxx +++ b/src/VISUGUI/VisuGUI_CacheDlg.cxx @@ -52,7 +52,7 @@ using namespace std; VisuGUI_CacheDlg::VisuGUI_CacheDlg( VISU::ColoredPrs3dCache_var theCache, - SalomeApp_Module* theModule ) + SalomeApp_Module* theModule ) : QDialog( VISU::GetDesktop( theModule ), Qt::WindowTitleHint | Qt::WindowSystemMenuHint ), myCache( theCache ) { @@ -72,11 +72,11 @@ VisuGUI_CacheDlg::VisuGUI_CacheDlg( VISU::ColoredPrs3dCache_var theCache, double anUsedMemory = myCache->GetMemorySize(); double aLimitedMemoryMax = #ifdef WNT - max + max #else - std::max + std::max #endif - (anUsedMemory + aFreeMemory, aLimitedMemory); + (anUsedMemory + aFreeMemory, aLimitedMemory); // Settings QButtonGroup* aMemoryGroup = new QButtonGroup( this ); @@ -202,7 +202,7 @@ void VisuGUI_CacheDlg::onHelp() LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); if (app) app->onHelpContextModule(app->activeModule() ? - app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName); + app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName); else { SUIT_MessageBox::warning(0, tr("WRN_WARNING"), tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). diff --git a/src/VISUGUI/VisuGUI_CacheDlg.h b/src/VISUGUI/VisuGUI_CacheDlg.h index dee67dab..2413f59f 100644 --- a/src/VISUGUI/VisuGUI_CacheDlg.h +++ b/src/VISUGUI/VisuGUI_CacheDlg.h @@ -44,7 +44,7 @@ class VisuGUI_CacheDlg : public QDialog public: VisuGUI_CacheDlg( VISU::ColoredPrs3dCache_var aCache, - SalomeApp_Module* theModule ); + SalomeApp_Module* theModule ); virtual ~VisuGUI_CacheDlg(); public: diff --git a/src/VISUGUI/VisuGUI_ClippingDlg.cxx b/src/VISUGUI/VisuGUI_ClippingDlg.cxx index 0312ffd7..31bf08c8 100644 --- a/src/VISUGUI/VisuGUI_ClippingDlg.cxx +++ b/src/VISUGUI/VisuGUI_ClippingDlg.cxx @@ -960,31 +960,31 @@ void VisuGUI_ClippingDlg::SetCurrentPlaneParam() vtkFloatingPointType aDel = aDataSet->GetLength()/2.0; vtkFloatingPointType aDelta[2][3] = {{aDir[0][0]*aDel, aDir[0][1]*aDel, aDir[0][2]*aDel}, - {aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}}; + {aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}}; vtkFloatingPointType aParam, aPnt0[3], aPnt1[3], aPnt2[3]; vtkFloatingPointType aPnt01[3] = {aPnt[0] - aDelta[0][0] - aDelta[1][0], - aPnt[1] - aDelta[0][1] - aDelta[1][1], - aPnt[2] - aDelta[0][2] - aDelta[1][2]}; + aPnt[1] - aDelta[0][1] - aDelta[1][1], + aPnt[2] - aDelta[0][2] - aDelta[1][2]}; vtkFloatingPointType aPnt02[3] = {aPnt01[0] + aNormal[0], - aPnt01[1] + aNormal[1], - aPnt01[2] + aNormal[2]}; + aPnt01[1] + aNormal[1], + aPnt01[2] + aNormal[2]}; vtkPlane::IntersectWithLine(aPnt01,aPnt02,aNormal,anOrigin,aParam,aPnt0); vtkFloatingPointType aPnt11[3] = {aPnt[0] - aDelta[0][0] + aDelta[1][0], - aPnt[1] - aDelta[0][1] + aDelta[1][1], - aPnt[2] - aDelta[0][2] + aDelta[1][2]}; + aPnt[1] - aDelta[0][1] + aDelta[1][1], + aPnt[2] - aDelta[0][2] + aDelta[1][2]}; vtkFloatingPointType aPnt12[3] = {aPnt11[0] + aNormal[0], - aPnt11[1] + aNormal[1], - aPnt11[2] + aNormal[2]}; + aPnt11[1] + aNormal[1], + aPnt11[2] + aNormal[2]}; vtkPlane::IntersectWithLine(aPnt11,aPnt12,aNormal,anOrigin,aParam,aPnt1); vtkFloatingPointType aPnt21[3] = {aPnt[0] + aDelta[0][0] - aDelta[1][0], - aPnt[1] + aDelta[0][1] - aDelta[1][1], - aPnt[2] + aDelta[0][2] - aDelta[1][2]}; + aPnt[1] + aDelta[0][1] - aDelta[1][1], + aPnt[2] + aDelta[0][2] - aDelta[1][2]}; vtkFloatingPointType aPnt22[3] = {aPnt21[0] + aNormal[0], - aPnt21[1] + aNormal[1], - aPnt21[2] + aNormal[2]}; + aPnt21[1] + aNormal[1], + aPnt21[2] + aNormal[2]}; vtkPlane::IntersectWithLine(aPnt21,aPnt22,aNormal,anOrigin,aParam,aPnt2); vtkPlaneSource* aPlaneSource = aPlane->myPlaneSource; @@ -1123,7 +1123,7 @@ void VisuGUI_ClippingDlg::setIJKByNonStructured() double dot = normal * dir; //ENK: 23.11.2006 - PAL13176 if(i==0){ - maxDot = dot; + maxDot = dot; gridDir = dir; values = curValues; gridAxId = i; @@ -1198,7 +1198,7 @@ void VisuGUI_ClippingDlg::onIJKAxisChanged(int axisId) gp_Dir dir; CORBA::String_var aMeshName = myPrs3d->GetMeshName(); const vector * indices = result->GetAxisInfo(aMeshName.in(), - axis, dir); + axis, dir); if (indices) maxIndex = indices->size() - 1; } diff --git a/src/VISUGUI/VisuGUI_ClippingDlg.h b/src/VISUGUI/VisuGUI_ClippingDlg.h index bf1f1fd3..aabea300 100644 --- a/src/VISUGUI/VisuGUI_ClippingDlg.h +++ b/src/VISUGUI/VisuGUI_ClippingDlg.h @@ -122,7 +122,7 @@ class VisuGUI_ClippingDlg : public QDialog public: VisuGUI_ClippingDlg( VisuGUI* theModule, - bool modal = false ); + bool modal = false ); float getDistance() { return (float)SpinBoxDistance->value(); } void setDistance(const float theDistance) { SpinBoxDistance->setValue(theDistance); } diff --git a/src/VISUGUI/VisuGUI_ClippingPanel.cxx b/src/VISUGUI/VisuGUI_ClippingPanel.cxx index 0b1252bd..2aa3ed50 100644 --- a/src/VISUGUI/VisuGUI_ClippingPanel.cxx +++ b/src/VISUGUI/VisuGUI_ClippingPanel.cxx @@ -89,8 +89,8 @@ void AdjustBounds(const double bounds[6], double newBounds[6], double center[3]) //**************************************************************** //PreviewPlane::PreviewPlane(SVTK_ViewWindow* theWindow, const PlaneDef& thePlane, const double* theBounds): PreviewPlane::PreviewPlane(SVTK_ViewWindow* theWindow, - VISU_CutPlaneFunction* thePlane, - const double* theBounds): + VISU_CutPlaneFunction* thePlane, + const double* theBounds): myWindow(theWindow), myBounds(theBounds) { @@ -106,8 +106,8 @@ PreviewPlane::PreviewPlane(SVTK_ViewWindow* theWindow, myBox->SetDimensions(2, 2, 2); myBox->SetOrigin(aBound[0],aBound[2],aBound[4]); myBox->SetSpacing((aBound[1]-aBound[0]), - (aBound[3]-aBound[2]), - (aBound[5]-aBound[4])); + (aBound[3]-aBound[2]), + (aBound[5]-aBound[4])); myCutter = vtkCutter::New(); myCutter->SetInput(myBox); @@ -275,13 +275,13 @@ VisuGUI_ClippingPanel::VisuGUI_ClippingPanel( VisuGUI* theModule, QWidget* thePa // fillPlanesList(); connect(myModule, SIGNAL(presentationCreated(VISU::Prs3d_i*)), - this, SLOT(onPresentationCreate(VISU::Prs3d_i*))); + this, SLOT(onPresentationCreate(VISU::Prs3d_i*))); connect(myModule, SIGNAL(beforeObjectDelete(QString)), - this, SLOT(onObjectDelete(QString))); + this, SLOT(onObjectDelete(QString))); SUIT_Desktop* aDesktop = VISU::GetDesktop(myModule); connect(aDesktop, SIGNAL(windowActivated(SUIT_ViewWindow*)), - this, SLOT(onWindowActivated(SUIT_ViewWindow*))); + this, SLOT(onWindowActivated(SUIT_ViewWindow*))); } @@ -332,7 +332,7 @@ QString VisuGUI_ClippingPanel::getPrsName(VISU::Prs3d_i* thePrs) while (!aFather->_is_nil()) { QString aFName = aFather->GetName(); aPath.append(aFName); - if (aFName == "Post-Pro") break; + if (aFName == "Post-Pro") break; aFather = aFather->GetFather(); } aObjName = aSObject->GetName(); @@ -342,13 +342,13 @@ QString VisuGUI_ClippingPanel::getPrsName(VISU::Prs3d_i* thePrs) _PTR(Study) aStudy = VISU::GetCStudy(VISU::GetAppStudy(myModule)); _PTR(SObject) aSObjPtr = aStudy->FindObjectID(aColPrs->GetHolderEntry().c_str()); if (aSObjPtr) { - _PTR(SObject) aFather = aSObjPtr->GetFather(); - while (aFather) { - QString aFName(aFather->GetName().c_str()); - aPath.append(aFName); - if (aFName == "Post-Pro") break; - aFather = aFather->GetFather(); - } + _PTR(SObject) aFather = aSObjPtr->GetFather(); + while (aFather) { + QString aFName(aFather->GetName().c_str()); + aPath.append(aFName); + if (aFName == "Post-Pro") break; + aFather = aFather->GetFather(); + } } aObjName = aSObjPtr->GetName().c_str(); } @@ -361,7 +361,7 @@ QString VisuGUI_ClippingPanel::getPrsName(VISU::Prs3d_i* thePrs) //************************************************************************* QStringList VisuGUI_ClippingPanel::getPrsList(_PTR(Study) theStudy, - _PTR(SObject) theObject) + _PTR(SObject) theObject) { //QList aList; QStringList aList; @@ -372,16 +372,16 @@ QStringList VisuGUI_ClippingPanel::getPrsList(_PTR(Study) theStudy, for (int i = 0; i < aSTLList.size(); i++) { VISU::Prs3d_i* aPrs = aSTLList[i]; if (!aList.contains(aPrs->GetEntry().c_str())) - aList.append(aPrs->GetEntry().c_str()); + aList.append(aPrs->GetEntry().c_str()); } if (aList.size() == 0) { //QList aSubList = getPrsList(theStudy, aSObject); QStringList aSubList = getPrsList(theStudy, aSObject); for (int i = 0; i < aSubList.size(); i++) { - //VISU::Prs3d_i* aPrs = aSubList[i]; - QString aPrsEntry = aSubList[i]; - if (!aList.contains(aPrsEntry)) - aList.append(aPrsEntry); + //VISU::Prs3d_i* aPrs = aSubList[i]; + QString aPrsEntry = aSubList[i]; + if (!aList.contains(aPrsEntry)) + aList.append(aPrsEntry); } } } @@ -407,7 +407,7 @@ void VisuGUI_ClippingPanel::fillPlanesList() QTableWidgetItem* aItem = new QTableWidgetItem(aPlane->getName().c_str()); QTableWidgetItem* aCheckItem = new QTableWidgetItem(); aCheckItem->setCheckState((myNonActivePlanes->checkState() == Qt::Checked)? - Qt::Unchecked : Qt::Checked); + Qt::Unchecked : Qt::Checked); if (aPlane->isAuto()) { // If this is Auto plane aItem->setFlags(0); aItem->setCheckState(Qt::Checked); @@ -416,8 +416,8 @@ void VisuGUI_ClippingPanel::fillPlanesList() // Check current presentation int aPrsNum = myPrsList->currentRow(); if (aPrsNum >= 0) { - if (VISU_ClippingPlaneMgr::ContainsPlane(getPrs(myPresentations.at(aPrsNum)), aPlane)) - aItem->setCheckState(Qt::Checked); + if (VISU_ClippingPlaneMgr::ContainsPlane(getPrs(myPresentations.at(aPrsNum)), aPlane)) + aItem->setCheckState(Qt::Checked); } } myPlanesList->setItem(i, 0, aItem); @@ -443,32 +443,32 @@ void VisuGUI_ClippingPanel::fillPlanesList() aCheckItem->setCheckState((myNonActivePlanes->checkState() == Qt::Checked)? Qt::Unchecked : Qt::Checked); if (aNewPlane.isAuto) { // If this is Auto plane - aItem->setFlags(0); - // apply to all presentations - aItem->setCheckState(Qt::Checked); - foreach(QString aPrsEntry, myPresentations) { - getPrs(aPrsEntry)->AddClippingPlane(aNewPlane.plane); - } + aItem->setFlags(0); + // apply to all presentations + aItem->setCheckState(Qt::Checked); + foreach(QString aPrsEntry, myPresentations) { + getPrs(aPrsEntry)->AddClippingPlane(aNewPlane.plane); + } } else { // if it is not auto - foreach(QString aPrsEntry, myPresentations) { - _PTR(ChildIterator) aRefIter = aStudy->NewChildIterator(aSObject); - for (; aRefIter->More(); aRefIter->Next()) { - _PTR(SObject) aObj = aRefIter->Value(); - _PTR(SObject) aRefPrsObject; - if (aObj->ReferencedObject(aRefPrsObject)) { // If it is referenced on current plane - if (QString(aRefPrsObject->GetID().c_str()) == aPrsEntry) { - getPrs(aPrsEntry)->AddClippingPlane(aNewPlane.plane); - } - } - } - } - aItem->setCheckState(Qt::Unchecked); - // Check current presentation - int aPrsNum = myPrsList->currentRow(); - if (aPrsNum >= 0) { - if (containsPlane(getPrs(myPresentations.at(aPrsNum)), aNewPlane)) - aItem->setCheckState(Qt::Checked); - } + foreach(QString aPrsEntry, myPresentations) { + _PTR(ChildIterator) aRefIter = aStudy->NewChildIterator(aSObject); + for (; aRefIter->More(); aRefIter->Next()) { + _PTR(SObject) aObj = aRefIter->Value(); + _PTR(SObject) aRefPrsObject; + if (aObj->ReferencedObject(aRefPrsObject)) { // If it is referenced on current plane + if (QString(aRefPrsObject->GetID().c_str()) == aPrsEntry) { + getPrs(aPrsEntry)->AddClippingPlane(aNewPlane.plane); + } + } + } + } + aItem->setCheckState(Qt::Unchecked); + // Check current presentation + int aPrsNum = myPrsList->currentRow(); + if (aPrsNum >= 0) { + if (containsPlane(getPrs(myPresentations.at(aPrsNum)), aNewPlane)) + aItem->setCheckState(Qt::Checked); + } } myPlanesList->setItem(i, 0, aItem); myPlanesList->setItem(i, 1, aCheckItem); @@ -588,7 +588,7 @@ void VisuGUI_ClippingPanel::onNewPlane() QTableWidgetItem* aItem = new QTableWidgetItem(aPlane->getName().c_str()); QTableWidgetItem* aCheckItem = new QTableWidgetItem(); aCheckItem->setCheckState((myNonActivePlanes->checkState() == Qt::Checked)? - Qt::Unchecked : Qt::Checked); + Qt::Unchecked : Qt::Checked); //aNewPlane.plane->setActive(myNonActivePlanes->checkState() != Qt::Checked); aPlane->setActive(myNonActivePlanes->checkState() != Qt::Checked); //if (aNewPlane.isAuto) { @@ -650,7 +650,7 @@ void VisuGUI_ClippingPanel::onPlaneEdited() int aPrsNum = myPrsList->currentRow(); if (aPrsNum >= 0) { if (VISU_ClippingPlaneMgr::ContainsPlane(getPrs(myPresentations.at(aPrsNum)), aPlane)) - aItem->setCheckState(Qt::Checked); + aItem->setCheckState(Qt::Checked); } } @@ -715,23 +715,23 @@ void VisuGUI_ClippingPanel::onPlaneDelete() VISU_CutPlaneFunction* aPlane = aMgr.GetClippingPlane(aRow); QMessageBox::StandardButton aRes = QMessageBox::warning(VISU::GetDesktop(myModule), - tr("TIT_DELETE_PLANE"), - tr("MSG_DELETE_PLANE").arg(aPlane->getName().c_str()), - QMessageBox::Yes | QMessageBox::No, - QMessageBox::No); + tr("TIT_DELETE_PLANE"), + tr("MSG_DELETE_PLANE").arg(aPlane->getName().c_str()), + QMessageBox::Yes | QMessageBox::No, + QMessageBox::No); if (aRes == QMessageBox::Yes) { aMgr.DeleteClippingPlane(aRow); /* short aTag1 = aPlane.plane->getPlaneObject()->Tag(); for (int i = 0; i < myPresentations.size(); i++) { VISU::Prs3d_i* aPrs = getPrs(myPresentations.at(i)); for (int j = aPrs->GetNumberOfClippingPlanes()-1; j > -1; j--) { - CutPlaneFunction* aPln = dynamic_cast(aPrs->GetClippingPlane(j)); - if (aPln) { - short aTag2 = aPln->getPlaneObject()->Tag(); - if (aTag1 == aTag2) { - aPrs->RemoveClippingPlane(j); - } - } + CutPlaneFunction* aPln = dynamic_cast(aPrs->GetClippingPlane(j)); + if (aPln) { + short aTag2 = aPln->getPlaneObject()->Tag(); + if (aTag1 == aTag2) { + aPrs->RemoveClippingPlane(j); + } + } } } @@ -918,30 +918,30 @@ void VisuGUI_ClippingPanel::applyPlaneToPrs(int thePlaneNum, int thePrsNum, bool aPrs->AddClippingPlane(aPlane.plane); if(!aStudy->GetProperties()->IsLocked()) { - _PTR(SObject) aNewObj = aBuilder->NewObject(aSObject); - aBuilder->Addreference(aNewObj, aPrsSObj); + _PTR(SObject) aNewObj = aBuilder->NewObject(aSObject); + aBuilder->Addreference(aNewObj, aPrsSObj); } } } else { for (int i = 0; i < aPrs->GetNumberOfClippingPlanes(); i++) { if (aPrs->GetClippingPlane(i) == aPlane.plane.GetPointer()) { - aPrs->RemoveClippingPlane(i); - break; + aPrs->RemoveClippingPlane(i); + break; } } if(!aStudy->GetProperties()->IsLocked()) { _PTR(ChildIterator) aIter = aStudy->NewChildIterator(aSObject); for (; aIter->More(); aIter->Next()) { - _PTR(SObject) aRefObj = aIter->Value(); - if(aRefObj) { - _PTR(SObject) aRefPrsObject; - if (aRefObj->ReferencedObject(aRefPrsObject)) { - if (QString(aRefPrsObject->GetID().c_str()) == QString(aPrs->GetEntry().c_str())) { - VISU::DeleteSObject(myModule, aStudy, aRefObj); - break; - } - } - } + _PTR(SObject) aRefObj = aIter->Value(); + if(aRefObj) { + _PTR(SObject) aRefPrsObject; + if (aRefObj->ReferencedObject(aRefPrsObject)) { + if (QString(aRefPrsObject->GetID().c_str()) == QString(aPrs->GetEntry().c_str())) { + VISU::DeleteSObject(myModule, aStudy, aRefObj); + break; + } + } + } } } }*/ @@ -970,9 +970,9 @@ void VisuGUI_ClippingPanel::onObjectDelete(QString theEntry) if (aPrs) { QString aID(aPrs->GetEntry().c_str()); if (aID == theEntry) { - myPresentations.removeAt(i); - myPrsList->takeItem(i); - break; + myPresentations.removeAt(i); + myPrsList->takeItem(i); + break; } i++; } @@ -996,7 +996,7 @@ void VisuGUI_ClippingPanel::onPrsSelected(int thePrs) VISU_CutPlaneFunction* aPlane = aMgr.GetClippingPlane(i); if (!aPlane->isAuto()) aItem->setCheckState(VISU_ClippingPlaneMgr::ContainsPlane(aPrs, aPlane)? - Qt::Checked : Qt::Unchecked); + Qt::Checked : Qt::Unchecked); } /* for (aIt = myPlanes.begin(), i = 0; aIt != myPlanes.end(); ++aIt, i++) { QTableWidgetItem* aItem = myPlanesList->item(i, 0); @@ -1018,7 +1018,7 @@ bool VisuGUI_ClippingPanel::isAutoApply() const VISU::Prs3d_i* VisuGUI_ClippingPanel::getPrs(QString theEntry) { VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(VISU::GetAppStudy(myModule), - qPrintable(theEntry)); + qPrintable(theEntry)); return VISU::GetPrs3dFromBase(anObjectInfo.myBase); } diff --git a/src/VISUGUI/VisuGUI_ClippingPlaneDlg.cxx b/src/VISUGUI/VisuGUI_ClippingPlaneDlg.cxx index 62e2938a..b3a4f662 100644 --- a/src/VISUGUI/VisuGUI_ClippingPlaneDlg.cxx +++ b/src/VISUGUI/VisuGUI_ClippingPlaneDlg.cxx @@ -186,9 +186,9 @@ VisuGUI_ClippingPlaneDlg::~VisuGUI_ClippingPlaneDlg() //**************************************************************** void VisuGUI_ClippingPlaneDlg::ProcessEvents(vtkObject* theObject, - unsigned long theEvent, - void* theClientData, - void* vtkNotUsed(theCallData)) + unsigned long theEvent, + void* theClientData, + void* vtkNotUsed(theCallData)) { vtkImplicitPlaneWidget* aWidget = vtkImplicitPlaneWidget::SafeDownCast(theObject); if (aWidget == NULL) return; @@ -261,8 +261,8 @@ vtkImplicitPlaneWidget* VisuGUI_ClippingPlaneDlg::createPreviewWidget() //aPlaneWgt->OutlineTranslationOff(); //aPlaneWgt->ScaleEnabledOn(); aPlaneWgt->AddObserver(vtkCommand::InteractionEvent, - myCallback.GetPointer(), - 0.); + myCallback.GetPointer(), + 0.); return aPlaneWgt; } @@ -332,15 +332,15 @@ void VisuGUI_ClippingPlaneDlg::accept() VISU_ClippingPlaneMgr& aMgr = VISU::GetVisuGen(myModule)->GetClippingPlaneMgr(); if (myPlaneId == -1) { // Create a New plane myPlaneId = aMgr.CreateClippingPlane(myXOrigin->value(), myYOrigin->value(), myZOrigin->value(), - myXDir->value(), myYDir->value(), myZDir->value(), - myAutoApply->checkState() == Qt::Checked, - qPrintable(myNameEdt->text())); + myXDir->value(), myYDir->value(), myZDir->value(), + myAutoApply->checkState() == Qt::Checked, + qPrintable(myNameEdt->text())); } else { // Edit Plane aMgr.EditClippingPlane(myPlaneId, - myXOrigin->value(), myYOrigin->value(), myZOrigin->value(), - myXDir->value(), myYDir->value(), myZDir->value(), - myAutoApply->checkState() == Qt::Checked, - qPrintable(myNameEdt->text())); + myXOrigin->value(), myYOrigin->value(), myZOrigin->value(), + myXDir->value(), myYDir->value(), myZDir->value(), + myAutoApply->checkState() == Qt::Checked, + qPrintable(myNameEdt->text())); } VISU::UpdateObjBrowser(myModule); } @@ -350,7 +350,7 @@ void VisuGUI_ClippingPlaneDlg::accept() if (VISU::getClippingPlanesFolder(aStudy, aFolder)) { _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder(); if (myPlaneObj == 0) { // Create a New plane - myPlaneObj = aBuilder->NewObject(aFolder); + myPlaneObj = aBuilder->NewObject(aFolder); } // Save Name _PTR(GenericAttribute) anAttr; @@ -370,11 +370,11 @@ void VisuGUI_ClippingPlaneDlg::accept() anAttr = aBuilder->FindOrCreateAttribute(myPlaneObj,"AttributeSequenceOfReal"); _PTR(AttributeSequenceOfReal) aArray(anAttr); if (aArray->Length() == 6) { - for (int i = 0; i < 6; i++) - aArray->ChangeValue(i+1, aParams[i]); + for (int i = 0; i < 6; i++) + aArray->ChangeValue(i+1, aParams[i]); } else { - for (int i = 0; i < 6; i++) - aArray->Add(aParams[i]); + for (int i = 0; i < 6; i++) + aArray->Add(aParams[i]); } // Save Bool Flag anAttr = aBuilder->FindOrCreateAttribute(myPlaneObj,"AttributeInteger"); diff --git a/src/VISUGUI/VisuGUI_ClippingPlaneDlg.h b/src/VISUGUI/VisuGUI_ClippingPlaneDlg.h index 16b6ca37..91aa434c 100644 --- a/src/VISUGUI/VisuGUI_ClippingPlaneDlg.h +++ b/src/VISUGUI/VisuGUI_ClippingPlaneDlg.h @@ -66,7 +66,7 @@ private slots: static void ProcessEvents(vtkObject* theObject, unsigned long theEvent, - void* theClientData, void* theCallData); + void* theClientData, void* theCallData); VisuGUI* myModule; SVTK_ViewWindow* myViewWindow; diff --git a/src/VISUGUI/VisuGUI_CursorDlg.cxx b/src/VISUGUI/VisuGUI_CursorDlg.cxx index 755986e5..a3d1b0d6 100644 --- a/src/VISUGUI/VisuGUI_CursorDlg.cxx +++ b/src/VISUGUI/VisuGUI_CursorDlg.cxx @@ -149,8 +149,8 @@ void VisuGUI_CursorDlg::onHelp() #endif SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)). - arg(helpFileName) ); + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)). + arg(helpFileName) ); } } diff --git a/src/VISUGUI/VisuGUI_CutLinesDlg.cxx b/src/VISUGUI/VisuGUI_CutLinesDlg.cxx index 04128685..365f4e0b 100644 --- a/src/VISUGUI/VisuGUI_CutLinesDlg.cxx +++ b/src/VISUGUI/VisuGUI_CutLinesDlg.cxx @@ -347,7 +347,7 @@ VisuGUI_CutLinesDlg::~VisuGUI_CutLinesDlg() //------------------------------------------------------------------------------ void VisuGUI_CutLinesDlg::initFromPrsObject ( VISU::ColoredPrs3d_i* thePrs, - bool theInit ) + bool theInit ) { if( theInit ) myPrsCopy = VISU::TSameAsFactory().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish); @@ -396,14 +396,14 @@ int VisuGUI_CutLinesDlg::storeToPrsObject (VISU::ColoredPrs3d_i* thePrs) anIsOk &= GetScalarPane()->storeToPrsObject( myPrsCopy ); myPrsCopy->SetOrientation(getOrientaion(), - myRotXSpn->value()*PI/180., - myRotYSpn->value()*PI/180.); + myRotXSpn->value()*PI/180., + myRotYSpn->value()*PI/180.); myPrsCopy->SetDisplacement(myPosSpn->value()); myPrsCopy->SetNbLines((int)myNbSpn->value()); myPrsCopy->SetOrientation2(getOrientaion(false), - myRotXSpn2->value()*PI/180., - myRotYSpn2->value()*PI/180.); + myRotXSpn2->value()*PI/180., + myRotYSpn2->value()*PI/180.); myPrsCopy->SetDisplacement2(myPosSpn2->value()); if (!myCBSetDef->isChecked()) @@ -423,7 +423,7 @@ int VisuGUI_CutLinesDlg::storeToPrsObject (VISU::ColoredPrs3d_i* thePrs) myPrsCopy->SetLinePosition( i, aVar.toDouble() ); } else - myPrsCopy->SetDefaultPosition(i); + myPrsCopy->SetDefaultPosition(i); } } @@ -596,7 +596,7 @@ void VisuGUI_CutLinesDlg::DrawTable() if (aItem->checkState() != Qt::Checked ) { QVariant aVar = aModel->index( i, 0 ).data(); - myCutLines->SetLinePosition(i, aVar.toDouble()); + myCutLines->SetLinePosition(i, aVar.toDouble()); } } @@ -840,8 +840,8 @@ void VisuGUI_CutLinesDlg::onValueChanged (int theRow, int theCol) { if (myPreviewCheck->isChecked()) { - deletePlanes(); - createPlanes(); + deletePlanes(); + createPlanes(); } } } @@ -853,11 +853,11 @@ void VisuGUI_CutLinesDlg::onValueChanged (int theRow, int theCol) SVTK_ViewWindow* aView = VISU::GetActiveViewWindow(); if (aView) { - if (myPreviewCheck->isChecked()) + if (myPreviewCheck->isChecked()) { - deletePlanes(); - createPlanes(); - } + deletePlanes(); + createPlanes(); + } } aModel->setData( anIndex, myCutLines->GetLinePosition(theRow), Qt::DisplayRole ); myPosTable->item( theRow, 0 )->setFlags( myPosTable->item( theRow, 0 )->flags() | Qt::ItemIsEnabled ); @@ -892,10 +892,10 @@ void VisuGUI_CutLinesDlg::onValueChanged (int theRow, int theCol) //Update Preview if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow()) { - //myCutLines->GetPipeLine()->Update(); - deletePlanes(); - createPlanes(); - //vf->Repaint(); + //myCutLines->GetPipeLine()->Update(); + deletePlanes(); + createPlanes(); + //vf->Repaint(); } } } diff --git a/src/VISUGUI/VisuGUI_CutLinesDlg.h b/src/VISUGUI/VisuGUI_CutLinesDlg.h index a0e5565c..647381e0 100644 --- a/src/VISUGUI/VisuGUI_CutLinesDlg.h +++ b/src/VISUGUI/VisuGUI_CutLinesDlg.h @@ -51,7 +51,7 @@ public: ~VisuGUI_CutLinesDlg(); virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs, - bool theInit ); + bool theInit ); virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs); diff --git a/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx b/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx index 482514dd..5b48ab40 100644 --- a/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx +++ b/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx @@ -249,10 +249,10 @@ void VisuGUI_CutPlanesPane::initFromPrsObject (VISU::CutPlanes_i* thePrs) GDeformation->setChecked(true); int idx = myVectorialFieldCombo->findText(thePrs->GetVectorialFieldName()); if (idx >= 0) - myVectorialFieldCombo->setCurrentIndex(idx); + myVectorialFieldCombo->setCurrentIndex(idx); else { - myVectorialFieldCombo->addItem(thePrs->GetVectorialFieldName()); - myVectorialFieldCombo->setCurrentIndex(myVectorialFieldCombo->count()-1); + myVectorialFieldCombo->addItem(thePrs->GetVectorialFieldName()); + myVectorialFieldCombo->setCurrentIndex(myVectorialFieldCombo->count()-1); } } } @@ -516,7 +516,7 @@ void VisuGUI_CutPlanesPane::DrawTable() QTableWidgetItem* aItem = myPosTable->item( i, 1 ); if (aItem == 0) break; if (aItem->checkState() != Qt::Checked ) - myCutPlanes->SetPlanePosition(i, myPosTable->item(i, 0)->text().toDouble()); + myCutPlanes->SetPlanePosition(i, myPosTable->item(i, 0)->text().toDouble()); } if (aNbPlanes > aNbRows) @@ -625,10 +625,10 @@ void VisuGUI_CutPlanesPane::onValueChanged (int theRow, int theCol) //Update Preview if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow()) { - myCutPlanes->GetPipeLine()->Update(); - deletePlanes(); - createPlanes(); - vf->Repaint(); + myCutPlanes->GetPipeLine()->Update(); + deletePlanes(); + createPlanes(); + vf->Repaint(); } } } @@ -671,11 +671,11 @@ void VisuGUI_CutPlanesPane::onValueChanged (int theRow, int theCol) if (myPreviewCheck->isChecked()) { //Update Preview if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow()) { - myCutPlanes->SetPlanePosition( theRow, anIndex.data().toDouble()); - myCutPlanes->GetPipeLine()->Update(); - deletePlanes(); - createPlanes(); - vf->Repaint(); + myCutPlanes->SetPlanePosition( theRow, anIndex.data().toDouble()); + myCutPlanes->GetPipeLine()->Update(); + deletePlanes(); + createPlanes(); + vf->Repaint(); } } } else { @@ -694,13 +694,13 @@ void VisuGUI_CutPlanesPane::onValueChanged (int theRow, int theCol) aModel->setData( anIndex, myCutPlanes->GetPlanePosition(theRow), Qt::DisplayRole ); anItem->setFlags( anItem->flags() | Qt::ItemIsEnabled ); if (myPreviewCheck->isChecked()) { - if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow()) { - //Update Preview - myCutPlanes->GetPipeLine()->Update(); - deletePlanes(); - createPlanes(); - vf->Repaint(); - } + if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow()) { + //Update Preview + myCutPlanes->GetPipeLine()->Update(); + deletePlanes(); + createPlanes(); + vf->Repaint(); + } } } //myPosTable->item(theRow, 0)->setEnabled(!isDefault); @@ -745,7 +745,7 @@ void VisuGUI_CutPlanesPane::onPreviewCheck (bool thePreview) myCutPlanes->GetPipeLine()->Update(); createPlanes(); if(VISU::GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)) { - vf->onFitAll(); + vf->onFitAll(); } } else { deletePlanes(); @@ -816,7 +816,7 @@ VisuGUI_CutPlanesDlg::~VisuGUI_CutPlanesDlg() {} void VisuGUI_CutPlanesDlg::initFromPrsObject ( VISU::ColoredPrs3d_i* thePrs, - bool theInit ) + bool theInit ) { if( theInit ) myPrsCopy = VISU::TSameAsFactory().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish); diff --git a/src/VISUGUI/VisuGUI_CutPlanesDlg.h b/src/VISUGUI/VisuGUI_CutPlanesDlg.h index ce9e43f4..dd668ec8 100644 --- a/src/VISUGUI/VisuGUI_CutPlanesDlg.h +++ b/src/VISUGUI/VisuGUI_CutPlanesDlg.h @@ -139,7 +139,7 @@ public: ~VisuGUI_CutPlanesDlg(); virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs, - bool theInit ); + bool theInit ); virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs); diff --git a/src/VISUGUI/VisuGUI_CutSegmentDlg.cxx b/src/VISUGUI/VisuGUI_CutSegmentDlg.cxx index 34ec4ca3..56ba80ce 100644 --- a/src/VISUGUI/VisuGUI_CutSegmentDlg.cxx +++ b/src/VISUGUI/VisuGUI_CutSegmentDlg.cxx @@ -213,7 +213,7 @@ VisuGUI_CutSegmentDlg::~VisuGUI_CutSegmentDlg() //------------------------------------------------------------------------------ void VisuGUI_CutSegmentDlg::initFromPrsObject ( VISU::ColoredPrs3d_i* thePrs, - bool theInit ) + bool theInit ) { if( theInit ) myPrsCopy = VISU::TSameAsFactory().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish); diff --git a/src/VISUGUI/VisuGUI_CutSegmentDlg.h b/src/VISUGUI/VisuGUI_CutSegmentDlg.h index b57762f1..439e62da 100644 --- a/src/VISUGUI/VisuGUI_CutSegmentDlg.h +++ b/src/VISUGUI/VisuGUI_CutSegmentDlg.h @@ -50,7 +50,7 @@ public: ~VisuGUI_CutSegmentDlg(); virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs, - bool theInit ); + bool theInit ); virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs); diff --git a/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.cxx b/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.cxx index 4d65681c..9f778170 100644 --- a/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.cxx +++ b/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.cxx @@ -168,7 +168,7 @@ VisuGUI_DeformedShapeAndScalarMapDlg::~VisuGUI_DeformedShapeAndScalarMapDlg() } void VisuGUI_DeformedShapeAndScalarMapDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs, - bool theInit ) + bool theInit ) { if( theInit ) myPrsCopy = VISU::TSameAsFactory().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish); @@ -177,8 +177,8 @@ void VisuGUI_DeformedShapeAndScalarMapDlg::initFromPrsObject( VISU::ColoredPrs3d CORBA::String_var aFieldName(myPrsCopy->GetScalarFieldName()); QString aIteration = GetFloatValueOfTimeStamp(myPrsCopy->GetScalarEntity(), - aFieldName.in(), - myPrsCopy->GetScalarTimeStampNumber()); + aFieldName.in(), + myPrsCopy->GetScalarTimeStampNumber()); if (myEntity2Fields.size() == 0) { // find all fields and time stamps on it @@ -189,42 +189,42 @@ void VisuGUI_DeformedShapeAndScalarMapDlg::initFromPrsObject( VISU::ColoredPrs3d if (selected.Extent() > 0) { Handle(SALOME_InteractiveObject) aIO = selected.First(); if (aIO->hasEntry()) { - _PTR(SObject) aSObject = aActiveStudy->FindObjectID(aIO->getEntry()); - VISU::VISUType aType = VISU::Storable::SObject2Type( aSObject ); - switch(aType){ - case VISU::TTIMESTAMP: { - aSObject = aSObject->GetFather(); - aSObject = aSObject->GetFather(); - break; - } - case VISU::TFIELD: { - _PTR(SObject) newSObject; - if(aSObject->ReferencedObject(newSObject)) aSObject = newSObject; - aSObject = aSObject->GetFather(); - break; - } - case VISU::TANIMATION: { - _PTR(ChildIterator) aTmpIter = aActiveStudy->NewChildIterator(aSObject); - for (aTmpIter->InitEx(true); aTmpIter->More(); aTmpIter->Next()) { - _PTR(SObject) aTmpChildSObj = aTmpIter->Value(); - _PTR(SObject) newSObject; - if(aTmpChildSObj->ReferencedObject(newSObject)){ - aSObject = newSObject; - aSObject->GetFather(); - break; - } - } - break; - }} - - aSObject = aSObject->GetFather(); - aSObject = aSObject->GetFather(); - - mySelectionObj = aSObject; - CORBA::Object_var anObject = VISU::ClientSObjectToObject(mySelectionObj); - if (CORBA::is_nil(anObject)) { - mySelectionObj = mySelectionObj->GetFather(); - } + _PTR(SObject) aSObject = aActiveStudy->FindObjectID(aIO->getEntry()); + VISU::VISUType aType = VISU::Storable::SObject2Type( aSObject ); + switch(aType){ + case VISU::TTIMESTAMP: { + aSObject = aSObject->GetFather(); + aSObject = aSObject->GetFather(); + break; + } + case VISU::TFIELD: { + _PTR(SObject) newSObject; + if(aSObject->ReferencedObject(newSObject)) aSObject = newSObject; + aSObject = aSObject->GetFather(); + break; + } + case VISU::TANIMATION: { + _PTR(ChildIterator) aTmpIter = aActiveStudy->NewChildIterator(aSObject); + for (aTmpIter->InitEx(true); aTmpIter->More(); aTmpIter->Next()) { + _PTR(SObject) aTmpChildSObj = aTmpIter->Value(); + _PTR(SObject) newSObject; + if(aTmpChildSObj->ReferencedObject(newSObject)){ + aSObject = newSObject; + aSObject->GetFather(); + break; + } + } + break; + }} + + aSObject = aSObject->GetFather(); + aSObject = aSObject->GetFather(); + + mySelectionObj = aSObject; + CORBA::Object_var anObject = VISU::ClientSObjectToObject(mySelectionObj); + if (CORBA::is_nil(anObject)) { + mySelectionObj = mySelectionObj->GetFather(); + } } } @@ -233,31 +233,31 @@ void VisuGUI_DeformedShapeAndScalarMapDlg::initFromPrsObject( VISU::ColoredPrs3d for (aIter->InitEx(true); aIter->More(); aIter->Next()) { _PTR(SObject) aChildSObj = aIter->Value(); - VISU::Storable::TRestoringMap aRestoringMap = VISU::Storable::GetStorableMap(aChildSObj); + VISU::Storable::TRestoringMap aRestoringMap = VISU::Storable::GetStorableMap(aChildSObj); if (!aRestoringMap.empty()) { - VISU::VISUType aType = VISU::Storable::RestoringMap2Type(aRestoringMap); - if (aType == VISU::TTIMESTAMP) { - QString aMeshName = aRestoringMap["myMeshName"]; - CORBA::String_var aName = myPrsCopy->GetMeshName(); - if (aMeshName != aName.in()) - continue; - QString aFieldName = aRestoringMap["myFieldName"]; - QString aTimeIter = aRestoringMap["myTimeStampId"]; - QString aEntity = aRestoringMap["myEntityId"]; - VISU::Entity anEntity; - switch (aEntity.toInt()) { - case 0: anEntity = VISU::NODE; break; - case 1: anEntity = VISU::EDGE; break; - case 2: anEntity = VISU::FACE; break; - case 3: anEntity = VISU::CELL; break; - } - TFieldName2TimeStamps& aFieldName2TimeStamps = myEntity2Fields[anEntity]; - TTimeStampNumber2Time& aTimeStampNumber2Time = aFieldName2TimeStamps[aFieldName]; - aTimeStampNumber2Time[aTimeIter.toInt()] = - GetFloatValueOfTimeStamp(anEntity, - aFieldName.toLatin1().constData(), - aTimeIter.toInt()); - } + VISU::VISUType aType = VISU::Storable::RestoringMap2Type(aRestoringMap); + if (aType == VISU::TTIMESTAMP) { + QString aMeshName = aRestoringMap["myMeshName"]; + CORBA::String_var aName = myPrsCopy->GetMeshName(); + if (aMeshName != aName.in()) + continue; + QString aFieldName = aRestoringMap["myFieldName"]; + QString aTimeIter = aRestoringMap["myTimeStampId"]; + QString aEntity = aRestoringMap["myEntityId"]; + VISU::Entity anEntity; + switch (aEntity.toInt()) { + case 0: anEntity = VISU::NODE; break; + case 1: anEntity = VISU::EDGE; break; + case 2: anEntity = VISU::FACE; break; + case 3: anEntity = VISU::CELL; break; + } + TFieldName2TimeStamps& aFieldName2TimeStamps = myEntity2Fields[anEntity]; + TTimeStampNumber2Time& aTimeStampNumber2Time = aFieldName2TimeStamps[aFieldName]; + aTimeStampNumber2Time[aTimeIter.toInt()] = + GetFloatValueOfTimeStamp(anEntity, + aFieldName.toLatin1().constData(), + aTimeIter.toInt()); + } } } } @@ -324,8 +324,8 @@ VisuGUI_DeformedShapeAndScalarMapDlg myPrsCopy->SetScale(getFactor()); myPrsCopy->SetScalarField(myPrsCopy->GetScalarEntity(), - getCurrentScalarFieldName().toLatin1().constData(), - myTimeStampID[ myTimeStampsCombo->currentIndex() ]); + getCurrentScalarFieldName().toLatin1().constData(), + myTimeStampID[ myTimeStampsCombo->currentIndex() ]); if(myUpdateScalars) SetScalarField( false ); @@ -359,8 +359,8 @@ VisuGUI_DeformedShapeAndScalarMapDlg for(; aFieldIter != aFieldName2TimeStamps.end(); aFieldIter++){ const QString& aFieldName = aFieldIter->first; if (aFieldName == myFieldsCombo->currentText()) { - anEntity = anIter->first; - break; + anEntity = anIter->first; + break; } } } @@ -374,8 +374,8 @@ void VisuGUI_DeformedShapeAndScalarMapDlg::SetScalarField( const bool save_scala void VisuGUI_DeformedShapeAndScalarMapDlg ::SetScalarField(int theIter, - QString theFieldName, - const bool save_scalar_pane ) + QString theFieldName, + const bool save_scalar_pane ) { QApplication::setOverrideCursor(Qt::WaitCursor); @@ -393,8 +393,8 @@ VisuGUI_DeformedShapeAndScalarMapDlg try { myPrsCopy->SetScalarField(anEntity, - aFieldName.toLatin1().constData(), - theIter); + aFieldName.toLatin1().constData(), + theIter); if( save_scalar_pane ) UpdateScalarField(); myIsScalarFieldValid = true; @@ -444,7 +444,7 @@ void VisuGUI_DeformedShapeAndScalarMapDlg::AddAllTimes(const QString& theFieldNa for(; aFieldIter != aFieldName2TimeStamps.end(); aFieldIter++){ const QString& aFieldName = aFieldIter->first; if(theFieldName != aFieldName) - continue; + continue; myTimeStampID.clear(); myTimeStampsCombo->clear(); @@ -452,11 +452,11 @@ void VisuGUI_DeformedShapeAndScalarMapDlg::AddAllTimes(const QString& theFieldNa const TTimeStampNumber2Time& aTimeStampNumber2Time = aFieldIter->second; TTimeStampNumber2Time::const_iterator aTimeStampIter = aTimeStampNumber2Time.begin(); for(; aTimeStampIter != aTimeStampNumber2Time.end(); aTimeStampIter++){ - int aTimeStampNumber = aTimeStampIter->first; - myTimeStampID.push_back(aTimeStampNumber); + int aTimeStampNumber = aTimeStampIter->first; + myTimeStampID.push_back(aTimeStampNumber); - QString aTimeStampTime = aTimeStampIter->second; - myTimeStampsCombo->addItem(aTimeStampTime); + QString aTimeStampTime = aTimeStampIter->second; + myTimeStampsCombo->addItem(aTimeStampTime); } if(currentTimeStampId >= myTimeStampID.size()) currentTimeStampId = myTimeStampID.size()-1; @@ -484,16 +484,16 @@ void VisuGUI_DeformedShapeAndScalarMapDlg::UpdateScalarField(){ QString VisuGUI_DeformedShapeAndScalarMapDlg ::GetFloatValueOfTimeStamp(VISU::Entity theEntity, - const std::string& theFieldName, - int theTimeStampNumber) + const std::string& theFieldName, + int theTimeStampNumber) { QString aTime(""); VISU::TEntity anEntity = VISU::TEntity(theEntity); VISU::Result_i* theResult = myPrsCopy->GetCResult(); VISU::Result_i::PInput anInput = theResult->GetInput(); VISU::PField aField = anInput->GetField(myPrsCopy->GetCMeshName(), - anEntity, - theFieldName); + anEntity, + theFieldName); if(!aField) return aTime; diff --git a/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.h b/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.h index 51dfa3f3..f26b1ef4 100644 --- a/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.h +++ b/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.h @@ -59,7 +59,7 @@ public: void setFactor(double theFactor); virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs, - bool theInit ); + bool theInit ); virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs); @@ -113,8 +113,8 @@ protected: void AddAllFieldNames(); void AddAllTimes(const QString& theFieldName); QString GetFloatValueOfTimeStamp(VISU::Entity theEntity, - const std::string& theFieldName, - int theTimeStampNumber); + const std::string& theFieldName, + int theTimeStampNumber); void updateControls(); }; diff --git a/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx b/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx index b7e41e4d..03f87a4c 100644 --- a/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx +++ b/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx @@ -223,8 +223,8 @@ void VisuGUI_DeformedShapeDlg::updatePrsCopy() INFOS(exc.what()); SUIT_MessageBox::warning(VISU::GetDesktop(myModule), - tr("WRN_VISU"), - tr("ERR_CANT_BUILD_PRESENTATION") + ": " + exc.what()); + tr("WRN_VISU"), + tr("ERR_CANT_BUILD_PRESENTATION") + ": " + exc.what()); } aViewWindow->Repaint(); } @@ -275,47 +275,47 @@ VISU::Prs3d_i* VisuGUI_DeformedShapeDlg::CreatePrs3d(VisuGUI* theModule) VISU::Storable::TRestoringMap aRestoringMap = VISU::Storable::GetStorableMap(aTimeStamp); VISU::VISUType aType = VISU::Storable::RestoringMap2Type(aRestoringMap); if ( aType == VISU::TTIMESTAMP ) - { + { - QString aMeshName = aRestoringMap["myMeshName"]; - QString anEntity = aRestoringMap["myEntityId"]; - QString aFieldName = aRestoringMap["myFieldName"]; - QString aTimeStampId = aRestoringMap["myTimeStampId"]; - - //typedef VISU::DeformedShape_i TPrs3d_i; - - aPrs3d = - VISU::CreatePrs3dFromFactory(theModule, - aTimeStamp, - aMeshName.toLatin1().data(), - (VISU::Entity)anEntity.toInt(), - aFieldName.toLatin1().data(), - aTimeStampId.toInt(), - aPublishInStudyMode); - - if (aPrs3d) { - VisuGUI_DeformedShapeDlg* aDlg = new VisuGUI_DeformedShapeDlg (theModule); - aDlg->initFromPrsObject(aPrs3d, true); - aDlg->UseMagn->setChecked(true); - VisuGUI_DialogRunner r(aDlg); - int dlgResult = r.run( false ); - - if ( dlgResult == 0 ) - DeletePrs3d(theModule,aPrs3d); - else { - aDlg->storeToPrsObject( aPrs3d ); - SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow(); - PublishInView(theModule, aPrs3d, aViewWindow); - if(VISU::GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)) - aViewWindow->onFitAll(); - int aPos = VISU::GetFreePositionOfDefaultScalarBar(theModule, aViewWindow); - VISU::AddScalarBarPosition(theModule, aViewWindow, aPrs3d, aPos); - } - - VISU::UpdateObjBrowser(theModule, true, aTimeStamp); - delete aDlg; - } - } + QString aMeshName = aRestoringMap["myMeshName"]; + QString anEntity = aRestoringMap["myEntityId"]; + QString aFieldName = aRestoringMap["myFieldName"]; + QString aTimeStampId = aRestoringMap["myTimeStampId"]; + + //typedef VISU::DeformedShape_i TPrs3d_i; + + aPrs3d = + VISU::CreatePrs3dFromFactory(theModule, + aTimeStamp, + aMeshName.toLatin1().data(), + (VISU::Entity)anEntity.toInt(), + aFieldName.toLatin1().data(), + aTimeStampId.toInt(), + aPublishInStudyMode); + + if (aPrs3d) { + VisuGUI_DeformedShapeDlg* aDlg = new VisuGUI_DeformedShapeDlg (theModule); + aDlg->initFromPrsObject(aPrs3d, true); + aDlg->UseMagn->setChecked(true); + VisuGUI_DialogRunner r(aDlg); + int dlgResult = r.run( false ); + + if ( dlgResult == 0 ) + DeletePrs3d(theModule,aPrs3d); + else { + aDlg->storeToPrsObject( aPrs3d ); + SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow(); + PublishInView(theModule, aPrs3d, aViewWindow); + if(VISU::GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)) + aViewWindow->onFitAll(); + int aPos = VISU::GetFreePositionOfDefaultScalarBar(theModule, aViewWindow); + VISU::AddScalarBarPosition(theModule, aViewWindow, aPrs3d, aPos); + } + + VISU::UpdateObjBrowser(theModule, true, aTimeStamp); + delete aDlg; + } + } } return aPrs3d; } @@ -335,8 +335,8 @@ void VisuGUI_DeformedShapeDlg::EditPrs3d(VisuGUI* theModule, VISU::Prs3d_i* theP SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow(theModule); if (aViewWindow) if (VISU_Actor* anActor = FindActor(aViewWindow, thePrs3d)) - if (anActor->GetVisibility()) - anActor->VisibilityOff(); + if (anActor->GetVisibility()) + anActor->VisibilityOff(); VisuGUI_DialogRunner r(aDlg); int dlgResult = r.run( false ); @@ -352,14 +352,14 @@ void VisuGUI_DeformedShapeDlg::EditPrs3d(VisuGUI* theModule, VISU::Prs3d_i* theP INFOS(exc.what()); SUIT_MessageBox::warning - (VISU::GetDesktop(theModule), QObject::tr("WRN_VISU"), - QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what())); + (VISU::GetDesktop(theModule), QObject::tr("WRN_VISU"), + QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what())); } if (aViewWindow) if (VISU_Actor* anActor = FindActor(aViewWindow, thePrs3d)) - if (!anActor->GetVisibility()) - anActor->VisibilityOn(); + if (!anActor->GetVisibility()) + anActor->VisibilityOn(); delete aDlg; } diff --git a/src/VISUGUI/VisuGUI_DeformedShapeDlg.h b/src/VISUGUI/VisuGUI_DeformedShapeDlg.h index 7f54c00f..5589baf4 100644 --- a/src/VISUGUI/VisuGUI_DeformedShapeDlg.h +++ b/src/VISUGUI/VisuGUI_DeformedShapeDlg.h @@ -65,7 +65,7 @@ public: { return UseMagn->isChecked(); } virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs, - bool theInit ); + bool theInit ); virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs); diff --git a/src/VISUGUI/VisuGUI_DialogRunner.cxx b/src/VISUGUI/VisuGUI_DialogRunner.cxx index 11e8e316..dcae7db6 100644 --- a/src/VISUGUI/VisuGUI_DialogRunner.cxx +++ b/src/VISUGUI/VisuGUI_DialogRunner.cxx @@ -19,10 +19,10 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// File: VisuGUI_DialogRunner.cxx -// Created: Thu Oct 6 10:17:39 2005 -// Author: Alexander SOLOVYOV -// +// File: VisuGUI_DialogRunner.cxx +// Created: Thu Oct 6 10:17:39 2005 +// Author: Alexander SOLOVYOV +// // #include "VisuGUI_DialogRunner.h" diff --git a/src/VISUGUI/VisuGUI_Displayer.cxx b/src/VISUGUI/VisuGUI_Displayer.cxx index c8a65cf7..49fa883c 100644 --- a/src/VISUGUI/VisuGUI_Displayer.cxx +++ b/src/VISUGUI/VisuGUI_Displayer.cxx @@ -85,42 +85,42 @@ SALOME_Prs* VisuGUI_Displayer::buildPresentation( const QString& theEntry, SALOM //if (!aViewer) //aViewer = dynamic_cast( aView ); if( aViewer ){ - SUIT_ViewManager* aViewManager = aViewer->getViewManager(); - SUIT_ViewWindow* aWindow = aViewManager->getActiveView(); - if(SVTK_ViewWindow* aViewWindow = dynamic_cast( aWindow )){ - VISU::Prs3d_i* aPrs3d = NULL; - if(aType == VISU::TCOLOREDPRS3DHOLDER){ - VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(aBase); - VISU::ColoredPrs3d_var aColoredPrs3d = aHolder->GetDevice(); - aPrs3d = dynamic_cast(VISU::GetServant(aColoredPrs3d).in()); - }else if (aType == VISU::TPOINTMAP3D) { - VISU::PointMap3d_i* aTable3d = dynamic_cast(aBaseServant); - VISU_ActorBase* anActorBase = VISU::FindActorBase(aViewWindow, aTable3d); - if (anActorBase) { - anActorBase->SetVisibility(true); - aViewWindow->Repaint(); - } - else { - VISU_PointMap3dActor* aPointMap3dActor = aTable3d->CreateActor(); - if (aPointMap3dActor) { - aViewWindow->AddActor(aPointMap3dActor); - aPointMap3dActor->SetVisibility(true); - aViewWindow->Repaint(); - } - } - } - else - aPrs3d = dynamic_cast(aBaseServant); - - if(aPrs3d){ - buildPrs3d( aViewWindow, aPrs3d ); - Handle(SALOME_InteractiveObject) anIO = aPrs3d->GetIO(); - if(anIO->hasEntry()){ - std::string anEntry = anIO->getEntry(); - aPrs = LightApp_Displayer::buildPresentation( anEntry.c_str(), aView ); - } - } - } + SUIT_ViewManager* aViewManager = aViewer->getViewManager(); + SUIT_ViewWindow* aWindow = aViewManager->getActiveView(); + if(SVTK_ViewWindow* aViewWindow = dynamic_cast( aWindow )){ + VISU::Prs3d_i* aPrs3d = NULL; + if(aType == VISU::TCOLOREDPRS3DHOLDER){ + VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(aBase); + VISU::ColoredPrs3d_var aColoredPrs3d = aHolder->GetDevice(); + aPrs3d = dynamic_cast(VISU::GetServant(aColoredPrs3d).in()); + }else if (aType == VISU::TPOINTMAP3D) { + VISU::PointMap3d_i* aTable3d = dynamic_cast(aBaseServant); + VISU_ActorBase* anActorBase = VISU::FindActorBase(aViewWindow, aTable3d); + if (anActorBase) { + anActorBase->SetVisibility(true); + aViewWindow->Repaint(); + } + else { + VISU_PointMap3dActor* aPointMap3dActor = aTable3d->CreateActor(); + if (aPointMap3dActor) { + aViewWindow->AddActor(aPointMap3dActor); + aPointMap3dActor->SetVisibility(true); + aViewWindow->Repaint(); + } + } + } + else + aPrs3d = dynamic_cast(aBaseServant); + + if(aPrs3d){ + buildPrs3d( aViewWindow, aPrs3d ); + Handle(SALOME_InteractiveObject) anIO = aPrs3d->GetIO(); + if(anIO->hasEntry()){ + std::string anEntry = anIO->getEntry(); + aPrs = LightApp_Displayer::buildPresentation( anEntry.c_str(), aView ); + } + } + } } } @@ -128,43 +128,43 @@ SALOME_Prs* VisuGUI_Displayer::buildPresentation( const QString& theEntry, SALOM if (aView) aViewer = dynamic_cast(aView); if(!aViewer && (aType==VISU::TCURVE || aType==VISU::TCONTAINER)) if(VisuGUI* aVisuGUI = dynamic_cast(myApp->activeModule())) - aViewer = VISU::GetPlot2dViewer( (SalomeApp_Module*)aVisuGUI, true ); + aViewer = VISU::GetPlot2dViewer( (SalomeApp_Module*)aVisuGUI, true ); if(aViewer){ SUIT_ViewManager* aViewManager = aViewer->getViewManager(); SUIT_ViewWindow* aWindow = aViewManager->getActiveView(); Plot2d_ViewWindow* aViewWindow = dynamic_cast( aWindow ); if( !aViewWindow ) - return 0; + return 0; SPlot2d_Prs* aPlot2dPrs = 0; switch (aType) { case VISU::TCURVE: { - VISU::Curve_i* aCurve = dynamic_cast(aBaseServant); - aPlot2dPrs = buildCurve( aViewWindow, aCurve ); - break; + VISU::Curve_i* aCurve = dynamic_cast(aBaseServant); + aPlot2dPrs = buildCurve( aViewWindow, aCurve ); + break; } case VISU::TCONTAINER: { - VISU::Container_i* aContainer = dynamic_cast(aBaseServant); - aPlot2dPrs = buildContainer( aViewWindow, aContainer ); - break; + VISU::Container_i* aContainer = dynamic_cast(aBaseServant); + aPlot2dPrs = buildContainer( aViewWindow, aContainer ); + break; } case VISU::TPOINTMAP3D: { - VISU::Table_i* aTable = dynamic_cast(aBaseServant); - aPlot2dPrs = buildTable( aViewWindow, aTable ); - break; + VISU::Table_i* aTable = dynamic_cast(aBaseServant); + aPlot2dPrs = buildTable( aViewWindow, aTable ); + break; } case VISU::TTABLE: { - VISU::Table_i* aTable = dynamic_cast(aBaseServant); - aPlot2dPrs = buildTable( aViewWindow, aTable ); - break; + VISU::Table_i* aTable = dynamic_cast(aBaseServant); + aPlot2dPrs = buildTable( aViewWindow, aTable ); + break; }} if( aPlot2dPrs ) - aPrs = new SPlot2d_Prs( aPlot2dPrs ); + aPrs = new SPlot2d_Prs( aPlot2dPrs ); if( aPrs ) - UpdatePrs( aPrs ); + UpdatePrs( aPrs ); } } return aPrs; @@ -266,8 +266,8 @@ SPlot2d_Prs* VisuGUI_Displayer::buildTable( Plot2d_ViewWindow* wnd, VISU::Table_ CORBA::Object_ptr aCurve = VISU::Curve::_narrow( childObject ); if( !CORBA::is_nil( aCurve ) ) { - VISU::Curve_i* theCurve = dynamic_cast(VISU::GetServant(aCurve).in()); - addCurve( prs, wnd, theCurve ); + VISU::Curve_i* theCurve = dynamic_cast(VISU::GetServant(aCurve).in()); + addCurve( prs, wnd, theCurve ); } } } diff --git a/src/VISUGUI/VisuGUI_EditContainerDlg.cxx b/src/VISUGUI/VisuGUI_EditContainerDlg.cxx index abbdc0bf..d5dd350a 100644 --- a/src/VISUGUI/VisuGUI_EditContainerDlg.cxx +++ b/src/VISUGUI/VisuGUI_EditContainerDlg.cxx @@ -52,67 +52,67 @@ using namespace std; /* XPM */ static const char * left_xpm[] = { "24 24 61 1", -" c None", -". c #323232", -"+ c #010101", -"@ c #4A4A4A", -"# c #040404", -"$ c #979797", -"% c #7B7B7B", -"& c #939393", -"* c #EEEEEE", -"= c #686868", -"- c #030303", -"; c #9C9C9C", -"> c #FFFFFF", -", c #B1B1B1", -"' c #5E5E5E", -") c #060606", -"! c #C1C1C1", -"~ c #626262", -"{ c #000000", -"] c #989898", -"^ c #A1A1A1", -"/ c #A5A5A5", -"( c #909090", -"_ c #868686", -": c #616161", -"< c #959595", -"[ c #919191", -"} c #848484", -"| c #606060", -"1 c #0B0B0B", -"2 c #545454", -"3 c #727272", -"4 c #A2A2A2", -"5 c #969696", -"6 c #838383", -"7 c #5F5F5F", -"8 c #101010", -"9 c #434343", -"0 c #6B6B6B", -"a c #858585", -"b c #8E8E8E", -"c c #373737", -"d c #696969", -"e c #8D8D8D", -"f c #B5B5B5", -"g c #111111", -"h c #393939", -"i c #898989", -"j c #B0B0B0", -"k c #191919", -"l c #3A3A3A", -"m c #646464", -"n c #535353", -"o c #050505", -"p c #353535", -"q c #585858", -"r c #4C4C4C", -"s c #0D0D0D", -"t c #3E3E3E", -"u c #020202", -"v c #0A0A0A", +" c None", +". c #323232", +"+ c #010101", +"@ c #4A4A4A", +"# c #040404", +"$ c #979797", +"% c #7B7B7B", +"& c #939393", +"* c #EEEEEE", +"= c #686868", +"- c #030303", +"; c #9C9C9C", +"> c #FFFFFF", +", c #B1B1B1", +"' c #5E5E5E", +") c #060606", +"! c #C1C1C1", +"~ c #626262", +"{ c #000000", +"] c #989898", +"^ c #A1A1A1", +"/ c #A5A5A5", +"( c #909090", +"_ c #868686", +": c #616161", +"< c #959595", +"[ c #919191", +"} c #848484", +"| c #606060", +"1 c #0B0B0B", +"2 c #545454", +"3 c #727272", +"4 c #A2A2A2", +"5 c #969696", +"6 c #838383", +"7 c #5F5F5F", +"8 c #101010", +"9 c #434343", +"0 c #6B6B6B", +"a c #858585", +"b c #8E8E8E", +"c c #373737", +"d c #696969", +"e c #8D8D8D", +"f c #B5B5B5", +"g c #111111", +"h c #393939", +"i c #898989", +"j c #B0B0B0", +"k c #191919", +"l c #3A3A3A", +"m c #646464", +"n c #535353", +"o c #050505", +"p c #353535", +"q c #585858", +"r c #4C4C4C", +"s c #0D0D0D", +"t c #3E3E3E", +"u c #020202", +"v c #0A0A0A", " ", " ", " .+ .+ ", @@ -143,49 +143,49 @@ static QPixmap MYLeftPix(left_xpm); static const char * right_xpm[] = { "24 24 43 1", -" g None", -". g #323232", -"+ g #5D5D5D", -"@ g #000000", -"# g #C4C4C4", -"$ g #313131", -"% g #C5C5C5", -"& g #E4E4E4", -"* g #2D2D2D", -"= g #B7B7B7", -"- g #EFEFEF", -"; g #DCDCDC", -"> g #282828", -", g #AFAFAF", -"' g #E0E0E0", -") g #242424", -"! g #C7C7C7", -"~ g #9A9A9A", -"{ g #8E8E8E", -"] g #1F1F1F", -"^ g #A5A5A5", -"/ g #989898", -"( g #888888", -"_ g #1B1B1B", -": g #ADADAD", -"< g #858585", -"[ g #838383", -"} g #868686", -"| g #929292", -"1 g #C1C1C1", -"2 g #161616", -"3 g #909090", -"4 g #747474", -"5 g #3A3A3A", -"6 g #121212", -"7 g #0D0D0D", -"8 g #7A7A7A", -"9 g #8A8A8A", -"0 g #090909", -"a g #040404", -"b g #707070", -"c g #6E6E6E", -"d g #3F3F3F", +" g None", +". g #323232", +"+ g #5D5D5D", +"@ g #000000", +"# g #C4C4C4", +"$ g #313131", +"% g #C5C5C5", +"& g #E4E4E4", +"* g #2D2D2D", +"= g #B7B7B7", +"- g #EFEFEF", +"; g #DCDCDC", +"> g #282828", +", g #AFAFAF", +"' g #E0E0E0", +") g #242424", +"! g #C7C7C7", +"~ g #9A9A9A", +"{ g #8E8E8E", +"] g #1F1F1F", +"^ g #A5A5A5", +"/ g #989898", +"( g #888888", +"_ g #1B1B1B", +": g #ADADAD", +"< g #858585", +"[ g #838383", +"} g #868686", +"| g #929292", +"1 g #C1C1C1", +"2 g #161616", +"3 g #909090", +"4 g #747474", +"5 g #3A3A3A", +"6 g #121212", +"7 g #0D0D0D", +"8 g #7A7A7A", +"9 g #8A8A8A", +"0 g #090909", +"a g #040404", +"b g #707070", +"c g #6E6E6E", +"d g #3F3F3F", " ", " ", " .. .. ", @@ -366,12 +366,12 @@ void VisuGUI_EditContainerDlg::initFromPrsObject (VISU::Container_i* theContaine VISU::Base_var aVisuObj = VISU::Base::_narrow(anObject); if (!CORBA::is_nil(aVisuObj)) { if (aVisuObj->GetType() == VISU::TCURVE) { - _PTR(SObject) aTableSO = aSObject->GetFather(); - CurveStruct aEntry; - aEntry.TableName = getSObjectName(aTableSO); - aEntry.CurveName = getSObjectName(aSObject); - aEntry.CurveEntry = aSObject->GetID().c_str(); - aStudyCurves.append(aEntry); + _PTR(SObject) aTableSO = aSObject->GetFather(); + CurveStruct aEntry; + aEntry.TableName = getSObjectName(aTableSO); + aEntry.CurveName = getSObjectName(aSObject); + aEntry.CurveEntry = aSObject->GetID().c_str(); + aStudyCurves.append(aEntry); } } } @@ -382,7 +382,7 @@ void VisuGUI_EditContainerDlg::initFromPrsObject (VISU::Container_i* theContaine for (it = aStudyCurves.begin(); it != aStudyCurves.end(); ++it) { for (it2 = aContainerCurves.begin(); it2 != aContainerCurves.end(); ++it2) { if (isExist = ((*it).CurveEntry == (*it2).CurveEntry)) - break; + break; } if (!isExist) { @@ -410,8 +410,8 @@ void VisuGUI_EditContainerDlg::storeToPrsObject (VISU::Container_i* theContainer if (aCurveSO) { CORBA::Object_var aObject = VISU::ClientSObjectToObject(aCurveSO); if (!CORBA::is_nil(aObject)) { - VISU::Curve_i* aCurve = dynamic_cast(VISU::GetServant(aObject).in()); - if (aCurve) theContainer->AddCurve(aCurve->_this()); + VISU::Curve_i* aCurve = dynamic_cast(VISU::GetServant(aObject).in()); + if (aCurve) theContainer->AddCurve(aCurve->_this()); } } } diff --git a/src/VISUGUI/VisuGUI_FeatureEdgesPanel.cxx b/src/VISUGUI/VisuGUI_FeatureEdgesPanel.cxx index 7162c691..9e0c33c8 100644 --- a/src/VISUGUI/VisuGUI_FeatureEdgesPanel.cxx +++ b/src/VISUGUI/VisuGUI_FeatureEdgesPanel.cxx @@ -81,7 +81,7 @@ VisuGUI_FeatureEdgesPanel::VisuGUI_FeatureEdgesPanel( VisuGUI* theModule, QWidge aTopLayout->addWidget( myGrp ); connect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), - this, SLOT( onSelectionEvent() ) ); + this, SLOT( onSelectionEvent() ) ); } VisuGUI_FeatureEdgesPanel::~VisuGUI_FeatureEdgesPanel() @@ -145,9 +145,9 @@ void VisuGUI_FeatureEdgesPanel::onSelectionEvent() anIsManifoldEdges = false, anIsNonManifoldEdges = false; myActor->GetFeatureEdgesFlags( anIsFeatureEdges, - anIsBoundaryEdges, - anIsManifoldEdges, - anIsNonManifoldEdges ); + anIsBoundaryEdges, + anIsManifoldEdges, + anIsNonManifoldEdges ); //float aColoring = myActor->GetFeatureEdgesColoring(); @@ -165,9 +165,9 @@ void VisuGUI_FeatureEdgesPanel::onApply() { myActor->SetFeatureEdgesAngle( myAngleSpinBox->value() ); myActor->SetFeatureEdgesFlags( myFeatureEdgesCB->isChecked(), - myBoundaryEdgesCB->isChecked(), - myManifoldEdgesCB->isChecked(), - myNonManifoldEdgesCB->isChecked() ); + myBoundaryEdgesCB->isChecked(), + myManifoldEdgesCB->isChecked(), + myNonManifoldEdgesCB->isChecked() ); //myActor->SetFeatureEdgesColoring( myColoringCB->isChecked() ); myActor->Update(); } @@ -218,15 +218,15 @@ void VisuGUI_FeatureEdgesPanel::keyPressEvent( QKeyEvent* e ) void VisuGUI_FeatureEdgesPanel::onModuleActivated() { disconnect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), - this, SLOT( onSelectionEvent() ) ); + this, SLOT( onSelectionEvent() ) ); connect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), - this, SLOT( onSelectionEvent() ) ); + this, SLOT( onSelectionEvent() ) ); VisuGUI_Panel::onModuleActivated(); } void VisuGUI_FeatureEdgesPanel::onModuleDeactivated() { disconnect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), - this, SLOT( onSelectionEvent() ) ); + this, SLOT( onSelectionEvent() ) ); VisuGUI_Panel::onModuleDeactivated(); } diff --git a/src/VISUGUI/VisuGUI_FileDlg.cxx b/src/VISUGUI/VisuGUI_FileDlg.cxx index 485e6b4d..d37e8e06 100644 --- a/src/VISUGUI/VisuGUI_FileDlg.cxx +++ b/src/VISUGUI/VisuGUI_FileDlg.cxx @@ -42,9 +42,9 @@ bool VisuGUI_FileDlg::IsBuild = false; Constructor */ VisuGUI_FileDlg::VisuGUI_FileDlg (QWidget* parent, - bool open, - bool showQuickDir, - bool modal) : + bool open, + bool showQuickDir, + bool modal) : SUIT_FileDlg(parent, open, showQuickDir, modal) { myCBuildAll = new QCheckBox (tr("FULL_LOAD"), this); @@ -77,16 +77,16 @@ bool VisuGUI_FileDlg::processPath( const QString& path ) if ( fi.isFile() ) { setDirectory( fi.absoluteDir().absolutePath() ); - selectFile( fi.fileName() ); + selectFile( fi.fileName() ); } else if ( fi.isDir() ) - setDirectory( path ); + setDirectory( path ); return true; } else { if ( QFileInfo( fi.absoluteDir().absolutePath() ).exists() ) { - setDirectory( fi.absoluteDir().absolutePath() ); - return true; + setDirectory( fi.absoluteDir().absolutePath() ); + return true; } } } @@ -97,10 +97,10 @@ bool VisuGUI_FileDlg::processPath( const QString& path ) Returns the file name for Open/Save [ static ] */ QString VisuGUI_FileDlg::getFileName( QWidget* parent, - const QString& initial, - const QStringList& filters, - const QString& caption, - bool open, + const QString& initial, + const QStringList& filters, + const QString& caption, + bool open, bool showQuickDir, SUIT_FileValidator* validator ) { diff --git a/src/VISUGUI/VisuGUI_FileDlg.h b/src/VISUGUI/VisuGUI_FileDlg.h index 3e2dba25..3c236a6b 100644 --- a/src/VISUGUI/VisuGUI_FileDlg.h +++ b/src/VISUGUI/VisuGUI_FileDlg.h @@ -36,20 +36,20 @@ class VisuGUI_FileDlg : public SUIT_FileDlg Q_OBJECT; public: VisuGUI_FileDlg( QWidget* parent, - bool open, - bool showQuickDir = true, - bool modal = true ); + bool open, + bool showQuickDir = true, + bool modal = true ); ~VisuGUI_FileDlg(); public: static bool IsBuild; static QString getFileName( QWidget* parent, - const QString& initial, - const QStringList& filters, - const QString& caption, - bool open, - bool showQuickDir = true, - SUIT_FileValidator* validator = 0); + const QString& initial, + const QStringList& filters, + const QString& caption, + bool open, + bool showQuickDir = true, + SUIT_FileValidator* validator = 0); private: QCheckBox* myCBuildAll; diff --git a/src/VISUGUI/VisuGUI_FilterScalarsDlg.cxx b/src/VISUGUI/VisuGUI_FilterScalarsDlg.cxx index cdb1932d..ed42002c 100644 --- a/src/VISUGUI/VisuGUI_FilterScalarsDlg.cxx +++ b/src/VISUGUI/VisuGUI_FilterScalarsDlg.cxx @@ -114,17 +114,17 @@ void VisuGUI_FilterScalarsDlg::onSelectionEvent() VISU::TSelectionItem aSelectionItem = aSelectionInfo.front(); if ( VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase ) { if ( VISU::ColoredPrs3d_i* aColoredPrs3d = dynamic_cast< VISU::ColoredPrs3d_i* >( aBase ) ) { - myColoredPrs3d = aColoredPrs3d; + myColoredPrs3d = aColoredPrs3d; } else if (VISU::ColoredPrs3dHolder_i* aHolder = - dynamic_cast< VISU::ColoredPrs3dHolder_i* >( aBase )) { - myColoredPrs3d = aHolder->GetPrs3dDevice(); + dynamic_cast< VISU::ColoredPrs3dHolder_i* >( aBase )) { + myColoredPrs3d = aHolder->GetPrs3dDevice(); } if (myColoredPrs3d.get() != NULL) { - myRangeBox->setChecked( myColoredPrs3d->IsScalarFilterUsed() ); - myMinEdit->setText( QString::number( myColoredPrs3d->GetScalarFilterMin() ) ); - myMaxEdit->setText( QString::number( myColoredPrs3d->GetScalarFilterMax() ) ); - setEnabled( true ); - return; + myRangeBox->setChecked( myColoredPrs3d->IsScalarFilterUsed() ); + myMinEdit->setText( QString::number( myColoredPrs3d->GetScalarFilterMin() ) ); + myMaxEdit->setText( QString::number( myColoredPrs3d->GetScalarFilterMax() ) ); + setEnabled( true ); + return; } } } diff --git a/src/VISUGUI/VisuGUI_FindPane.cxx b/src/VISUGUI/VisuGUI_FindPane.cxx index e6c279f4..07b2cdc8 100644 --- a/src/VISUGUI/VisuGUI_FindPane.cxx +++ b/src/VISUGUI/VisuGUI_FindPane.cxx @@ -67,12 +67,12 @@ VisuGUI_FindPane::VisuGUI_FindPane( QWidget* theParent ) : myConditionBox = new QComboBox( this ); myConditionBox->addItems( QStringList() - << tr( "MINIMUM" ) - << tr( "MAXIMUM" ) - << "=" - << "<=" - << ">=" - << tr( "BETWEEN" ) ); + << tr( "MINIMUM" ) + << tr( "MAXIMUM" ) + << "=" + << "<=" + << ">=" + << tr( "BETWEEN" ) ); connect( myConditionBox, SIGNAL( currentIndexChanged( int ) ), this, SLOT( onConditionChanged( int ) ) ); @@ -218,15 +218,15 @@ void VisuGUI_FindPane::onApply() { if( VISU_GaussPtsAct* aGaussPtsAct = dynamic_cast( myActor ) ) { - VISU::TGaussPointID aGaussPointID = aGaussPtsAct->GetGaussPointsPL()->GetObjID( aVTKId ); - anId.first = aGaussPointID.first; - anId.second = aGaussPointID.second; + VISU::TGaussPointID aGaussPointID = aGaussPtsAct->GetGaussPointsPL()->GetObjID( aVTKId ); + anId.first = aGaussPointID.first; + anId.second = aGaussPointID.second; } } //printf( "(%d) <%d - %d> %f\n", aVTKId, anId.first, anId.second, aValue ); if( anId.first < 0 || - anId.second < 0 && mySelectionMode == GaussPointSelection ) + anId.second < 0 && mySelectionMode == GaussPointSelection ) continue; bool ok = false; @@ -259,8 +259,8 @@ void VisuGUI_FindPane::onApply() { if( aCondition <= 1 && fabs( aValue - anExtremum ) > eps ) { - anExtremum = aValue; - myIdsList.clear(); + anExtremum = aValue; + myIdsList.clear(); } if( !myIdsList.contains( anId ) ) myIdsList.append( anId ); @@ -290,13 +290,13 @@ void VisuGUI_FindPane::onIdChanged() aStr.remove( ']' ); aFirstId = aStr.section( ' ', 0, 0 ).toInt( &ok ); if( !ok ) - aFirstId = -1; + aFirstId = -1; else { - ok = false; - aSecondId = aStr.section( ' ', 1, 1 ).toInt( &ok ); - if( !ok ) - aSecondId = -1; + ok = false; + aSecondId = aStr.section( ' ', 1, 1 ).toInt( &ok ); + if( !ok ) + aSecondId = -1; } } } @@ -348,8 +348,8 @@ void VisuGUI_FindPane::displayIds() myPrevBtn->setEnabled( myCurrentPage != 0 ); myNextBtn->setEnabled( ( myCurrentPage + 1 ) * PAGE_SIZE < aSize ); myPageLabel->setText( QString( "Page %1/%2" ) - .arg( aSize > 0 ? myCurrentPage + 1 : 0 ) - .arg( aSize > 0 ? ( aSize - 1 ) / PAGE_SIZE + 1 : 0 ) ); + .arg( aSize > 0 ? myCurrentPage + 1 : 0 ) + .arg( aSize > 0 ? ( aSize - 1 ) / PAGE_SIZE + 1 : 0 ) ); int aFirstIndex = myCurrentPage * PAGE_SIZE; int aLastIndex = aFirstIndex + PAGE_SIZE - 1; diff --git a/src/VISUGUI/VisuGUI_GaussPointsDlg.h b/src/VISUGUI/VisuGUI_GaussPointsDlg.h index f7742c7e..1222f148 100644 --- a/src/VISUGUI/VisuGUI_GaussPointsDlg.h +++ b/src/VISUGUI/VisuGUI_GaussPointsDlg.h @@ -137,7 +137,7 @@ public: //! Initializing dialog from the Gauss Points presentation. virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs, - bool theInit ); + bool theInit ); //! Update Gauss Points presentation using parameters from the dialog. virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs); diff --git a/src/VISUGUI/VisuGUI_GaussPointsSelectionPane.cxx b/src/VISUGUI/VisuGUI_GaussPointsSelectionPane.cxx index 972065d0..7ae3c886 100644 --- a/src/VISUGUI/VisuGUI_GaussPointsSelectionPane.cxx +++ b/src/VISUGUI/VisuGUI_GaussPointsSelectionPane.cxx @@ -88,29 +88,29 @@ namespace SVTK_RenderWindowInteractor* anInteractor = NULL; if( SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow( myModule ) ) - //if( SVTK_MainWindow* aMainWindow = aViewWindow->getMainWindow() ) - anInteractor = aViewWindow->GetInteractor(); + //if( SVTK_MainWindow* aMainWindow = aViewWindow->getMainWindow() ) + anInteractor = aViewWindow->GetInteractor(); if ( !anInteractor ) - return aResult; + return aResult; mySelector = anInteractor->GetSelector(); if ( !mySelector ) - return aResult; + return aResult; const SALOME_ListIO& aListIO = mySelector->StoredIObjects(); if ( aListIO.Extent() != 1 ) - return aResult; + return aResult; myIO = aListIO.First(); if ( mySelector->HasIndex( myIO ) ) - mySelector->GetIndex(myIO, myMapIndex); - + mySelector->GetIndex(myIO, myMapIndex); + VTK::ActorCollectionCopy aCopy(anInteractor->getRenderer()->GetActors()); myActor = SVTK::Find(aCopy.GetActors(), - SVTK::TIsSameIObject( myIO )); + SVTK::TIsSameIObject( myIO )); if ( !myActor ) - return aResult; + return aResult; myPipeLine = myActor->GetGaussPointsPL(); @@ -132,7 +132,7 @@ namespace { public: GaussPtsIDValidator( const SalomeApp_Module* theModule, - QObject * theParent ): + QObject * theParent ): QIntValidator( 0, VTK_LARGE_ID, theParent ), myHelper(theModule) {} @@ -142,10 +142,10 @@ namespace validate ( QString & theInput, int & thePos ) const { if ( QIntValidator::validate( theInput, thePos ) == QValidator::Invalid) - return QValidator::Invalid; + return QValidator::Invalid; if ( !myHelper.get() ) - return QValidator::Invalid; + return QValidator::Invalid; return QValidator::Acceptable; } @@ -159,8 +159,8 @@ namespace { public: GaussCellIDValidator( QLineEdit* theLocalPointLabel, - const SalomeApp_Module* theModule, - QObject * theParent ): + const SalomeApp_Module* theModule, + QObject * theParent ): GaussPtsIDValidator( theModule, theParent ), myLocalPointLineEdit( theLocalPointLabel ) {} @@ -170,16 +170,16 @@ namespace validate ( QString & theInput, int & thePos ) const { if( theInput.isEmpty() ) - return QValidator::Acceptable; + return QValidator::Acceptable; if ( GaussPtsIDValidator::validate( theInput, thePos ) == QValidator::Invalid) - return QValidator::Invalid; + return QValidator::Invalid; VISU::TCellID aCellID = theInput.toInt(); VISU::TLocalPntID aLocalPntID = myLocalPointLineEdit->text().toInt(); VISU::PGaussPtsIDMapper anIDMapper = myHelper.myPipeLine->GetGaussPtsIDMapper(); if ( anIDMapper->GetVTKID( VISU::TGaussPointID( aCellID, aLocalPntID ) ) < 0 ) - return QValidator::Intermediate; + return QValidator::Intermediate; return QValidator::Acceptable; } @@ -193,8 +193,8 @@ namespace { public: GaussLocalPointIDValidator( QLineEdit* theParentElementLineEdit, - const SalomeApp_Module* theModule, - QObject * theParent ): + const SalomeApp_Module* theModule, + QObject * theParent ): GaussPtsIDValidator( theModule, theParent ), myParentElementLineEdit( theParentElementLineEdit ) {} @@ -204,16 +204,16 @@ namespace validate ( QString & theInput, int & thePos ) const { if( theInput.isEmpty() ) - return QValidator::Acceptable; + return QValidator::Acceptable; if ( GaussPtsIDValidator::validate( theInput, thePos ) == QValidator::Invalid) - return QValidator::Invalid; + return QValidator::Invalid; VISU::TLocalPntID aLocalPntID = theInput.toInt(); VISU::TCellID aCellID = myParentElementLineEdit->text().toInt(); VISU::PGaussPtsIDMapper anIDMapper = myHelper.myPipeLine->GetGaussPtsIDMapper(); if ( anIDMapper->GetVTKID( VISU::TGaussPointID( aCellID, aLocalPntID ) ) < 0 ) - return QValidator::Intermediate; + return QValidator::Intermediate; return QValidator::Acceptable; } @@ -254,7 +254,7 @@ void VisuGUI_ValidatedLineEdit::MarkValidated( const QString& theText ) //--------------------------------------------------------------------------------- VisuGUI_GaussPointsSelectionPane::VisuGUI_GaussPointsSelectionPane( const SalomeApp_Module* theModule, - QWidget* theParent ) : + QWidget* theParent ) : QWidget( theParent ), myModule( theModule ), myEventCallbackCommand( vtkCallbackCommand::New() ) @@ -341,16 +341,16 @@ void VisuGUI_GaussPointsSelectionPane::setInteractor( SVTK_RenderWindowInteracto //printf( "AddObserver(vtkCommand::KeyPressEvent)\n" ); aDevice->AddObserver(vtkCommand::KeyPressEvent, - myEventCallbackCommand.GetPointer(), - myPriority); + myEventCallbackCommand.GetPointer(), + myPriority); if( aDevice->HasObserver(vtkCommand::EndPickEvent) ) aDevice->RemoveObservers(vtkCommand::EndPickEvent); //printf( "AddObserver(vtkCommand::EndPickEvent)\n" ); aDevice->AddObserver(vtkCommand::EndPickEvent, - myEventCallbackCommand.GetPointer(), - myPriority); + myEventCallbackCommand.GetPointer(), + myPriority); } SVTK_RenderWindowInteractor* VisuGUI_GaussPointsSelectionPane::getInteractor() @@ -367,9 +367,9 @@ SVTK_RenderWindowInteractor* VisuGUI_GaussPointsSelectionPane::getInteractor() } void VisuGUI_GaussPointsSelectionPane::ProcessEvents(vtkObject* vtkNotUsed(theObject), - unsigned long theEvent, - void* theClientData, - void* vtkNotUsed(theCallData)) + unsigned long theEvent, + void* theClientData, + void* vtkNotUsed(theCallData)) { VisuGUI_GaussPointsSelectionPane* self = reinterpret_cast(theClientData); @@ -495,10 +495,10 @@ void VisuGUI_GaussPointsSelectionPane::Help() platform = "application"; #endif SUIT_MessageBox::warning( 0, - QObject::tr("WRN_WARNING"), - QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName), - QObject::tr("BUT_OK")); + QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName), + QObject::tr("BUT_OK")); } } diff --git a/src/VISUGUI/VisuGUI_GaussPointsSelectionPane.h b/src/VISUGUI/VisuGUI_GaussPointsSelectionPane.h index 860f907a..a6d52eaf 100644 --- a/src/VISUGUI/VisuGUI_GaussPointsSelectionPane.h +++ b/src/VISUGUI/VisuGUI_GaussPointsSelectionPane.h @@ -86,9 +86,9 @@ private slots: private: static void ProcessEvents(vtkObject* theObject, - unsigned long theEvent, - void* theClientData, - void* theCallData); + unsigned long theEvent, + void* theClientData, + void* theCallData); void KeyPressed(); void SelectionEvent(); diff --git a/src/VISUGUI/VisuGUI_InputPane.cxx b/src/VISUGUI/VisuGUI_InputPane.cxx index cfa7c2af..cf6197ef 100644 --- a/src/VISUGUI/VisuGUI_InputPane.cxx +++ b/src/VISUGUI/VisuGUI_InputPane.cxx @@ -76,8 +76,8 @@ class VisuGUI_ListWidget: public QListWidget //--------------------------------------------------------------- VisuGUI_InputPane::VisuGUI_InputPane( VISU::VISUType theType, - SalomeApp_Module* theModule, - VisuGUI_Prs3dDlg* theDialog ) : + SalomeApp_Module* theModule, + VisuGUI_Prs3dDlg* theDialog ) : QGroupBox( theDialog ), myModule( theModule ), myDialog( theDialog ), @@ -239,8 +239,8 @@ VisuGUI_InputPane::~VisuGUI_InputPane() if (myFieldFilter) { - aSelectionMgr->removeFilter(myFieldFilter); - delete myFieldFilter; + aSelectionMgr->removeFilter(myFieldFilter); + delete myFieldFilter; } // Restore initial selection @@ -344,7 +344,7 @@ void VisuGUI_InputPane::onListDoubleClicked( QListWidgetItem* theItem ) { QList aList = mySelectedGroups->findItems( theItem->text(), Qt::MatchExactly ); if ( aList.isEmpty() ) - mySelectedGroups->insertItem( mySelectedGroups->count(), theItem->text() ); + mySelectedGroups->insertItem( mySelectedGroups->count(), theItem->text() ); } else if (aListWidget == mySelectedGroups) delete theItem; @@ -404,20 +404,20 @@ void VisuGUI_InputPane::onSelectionChanged() { _PTR(SObject) aChildObj = aIter->Value(); if( !aChildObj ) - return; + return; if( anEntityName.isNull() ) { - _PTR(SObject) aRefObj; - if( aChildObj->ReferencedObject( aRefObj ) ) - anEntityName = aRefObj->GetName().c_str(); + _PTR(SObject) aRefObj; + if( aChildObj->ReferencedObject( aRefObj ) ) + anEntityName = aRefObj->GetName().c_str(); } VISU::Storable::TRestoringMap aRestoringMap = VISU::Storable::GetStorableMap(aChildObj); if( aRestoringMap["myComment"] == "TIMESTAMP" ) { - aTimeStampName = aChildObj->GetName().c_str(); - myTimeStamps->addItem( aTimeStampName ); + aTimeStampName = aChildObj->GetName().c_str(); + myTimeStamps->addItem( aTimeStampName ); } } diff --git a/src/VISUGUI/VisuGUI_InputPane.h b/src/VISUGUI/VisuGUI_InputPane.h index aa592c6f..ae807c85 100644 --- a/src/VISUGUI/VisuGUI_InputPane.h +++ b/src/VISUGUI/VisuGUI_InputPane.h @@ -58,8 +58,8 @@ class VisuGUI_InputPane : public QGroupBox public: VisuGUI_InputPane( VISU::VISUType theType, - SalomeApp_Module* theModule, - VisuGUI_Prs3dDlg* theDialog ); + SalomeApp_Module* theModule, + VisuGUI_Prs3dDlg* theDialog ); virtual ~VisuGUI_InputPane(); public: diff --git a/src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx b/src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx index fcf2963c..7ab8e93a 100644 --- a/src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx +++ b/src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx @@ -60,7 +60,7 @@ using namespace std; VisuGUI_IsoSurfPane::VisuGUI_IsoSurfPane (QWidget* parent, - VisuGUI_ScalarBarPane* theScalarPane) + VisuGUI_ScalarBarPane* theScalarPane) : QWidget(parent), myScalarPane(theScalarPane) { @@ -310,7 +310,7 @@ void VisuGUI_IsoSurfacesDlg::accept() } void VisuGUI_IsoSurfacesDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs, - bool theInit ) + bool theInit ) { if( theInit ) myPrsCopy = VISU::TSameAsFactory().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish); diff --git a/src/VISUGUI/VisuGUI_IsoSurfacesDlg.h b/src/VISUGUI/VisuGUI_IsoSurfacesDlg.h index a57ccbcd..e7bb0245 100644 --- a/src/VISUGUI/VisuGUI_IsoSurfacesDlg.h +++ b/src/VISUGUI/VisuGUI_IsoSurfacesDlg.h @@ -53,7 +53,7 @@ public: public: VisuGUI_IsoSurfPane (QWidget* parent, - VisuGUI_ScalarBarPane* theScalarPane); + VisuGUI_ScalarBarPane* theScalarPane); ~VisuGUI_IsoSurfPane() {}; void initFromPrsObject(VISU::IsoSurfaces_i* thePrs); @@ -91,7 +91,7 @@ public: ~VisuGUI_IsoSurfacesDlg(); virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs, - bool theInit ); + bool theInit ); virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs); diff --git a/src/VISUGUI/VisuGUI_Module.cxx b/src/VISUGUI/VisuGUI_Module.cxx index 1e9b560c..5beb580f 100644 --- a/src/VISUGUI/VisuGUI_Module.cxx +++ b/src/VISUGUI/VisuGUI_Module.cxx @@ -162,7 +162,7 @@ namespace VISU //--------------------------------------------------------------- typedef void (SUIT_ViewWindow::* TViewVisibility)(); void SetViewVisibility(SalomeApp_Application* app, - TViewVisibility theViewVisibility) + TViewVisibility theViewVisibility) { ViewManagerList l; //app->viewManagers( VVTK_Viewer::Type(), l ); @@ -171,13 +171,13 @@ namespace VISU for( ; anIt!=aLast; anIt++ ) if( SUIT_ViewManager* aViewManager = *anIt ) { - QVector aViews = aViewManager->getViews(); - int aSize = aViews.size(); - for(int anId = 0; anId < aSize; anId++) - { - if(SUIT_ViewWindow* aView = aViews[anId]) - (aView->* theViewVisibility)(); - } + QVector aViews = aViewManager->getViews(); + int aSize = aViews.size(); + for(int anId = 0; anId < aSize; anId++) + { + if(SUIT_ViewWindow* aView = aViews[anId]) + (aView->* theViewVisibility)(); + } } } } @@ -205,23 +205,23 @@ void VisuGUI_Module::initialize( CAM_Application* theApp ) // "Save VISU State" command is moved from SalomeApp_Applicaiton createAction( SAVE_VISU_STATE, tr( "TOT_DESK_FILE_SAVE_GUI_STATE" ), QIcon(), - tr( "MEN_DESK_FILE_SAVE_GUI_STATE" ), tr( "PRP_DESK_FILE_SAVE_GUI_STATE" ), - 0, getApp()->desktop(), false, getApp(), SLOT( onSaveGUIState() ) ); + tr( "MEN_DESK_FILE_SAVE_GUI_STATE" ), tr( "PRP_DESK_FILE_SAVE_GUI_STATE" ), + 0, getApp()->desktop(), false, getApp(), SLOT( onSaveGUIState() ) ); int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1 ); createMenu( SAVE_VISU_STATE, fileMenu, 9, -1 ); QPixmap aPixmap; /* aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_GAUSS_NEW_VIEWER")); createAction( GAUSS_NEW_VIEWER, - tr("MEN_GAUSS_NEW_VIEWER"), - aPixmap, + tr("MEN_GAUSS_NEW_VIEWER"), + aPixmap, tr("MEN_GAUSS_NEW_VIEWER"), - tr("MEN_GAUSS_NEW_VIEWER"), - Qt::ALT+Qt::Key_S, - this, - false, + tr("MEN_GAUSS_NEW_VIEWER"), + Qt::ALT+Qt::Key_S, + this, + false, this, - SLOT(onCreateViewManager())); + SLOT(onCreateViewManager())); int windowMenu = createMenu( tr( "MEN_DESK_WINDOW" ), -1, 100 ); int newWinMenu = createMenu( tr( "MEN_DESK_NEWWINDOW" ), windowMenu, -1, 0 ); createMenu( action( GAUSS_NEW_VIEWER ), newWinMenu, -1 ); @@ -258,10 +258,10 @@ void VisuGUI_Module::initialize( CAM_Application* theApp ) this, SLOT(OnCreateGaussPoints())); mgr->insert( action( GAUSS_CREATE_PRS ), -1, 0, -1 ); mgr->setRule( action( GAUSS_CREATE_PRS ), - "client='ObjectBrowser' and selcount=1 " - "and type in {'VISU::TTIMESTAMP' 'VISU::TFIELD'} " - "and $medEntity in {'EDGE_ENTITY' 'FACE_ENTITY' 'CELL_ENTITY'} " - "and $medSource in {'eImportFile' 'eCopyAndImportFile'}" ); + "client='ObjectBrowser' and selcount=1 " + "and type in {'VISU::TTIMESTAMP' 'VISU::TFIELD'} " + "and $medEntity in {'EDGE_ENTITY' 'FACE_ENTITY' 'CELL_ENTITY'} " + "and $medSource in {'eImportFile' 'eCopyAndImportFile'}" ); createMenu( action( GAUSS_CREATE_PRS ), createMenu( tr( "MEN_VISUALISATION" ), -1 ), -1 ); createTool( GAUSS_CREATE_PRS, createTool( tr( "TOOL_VISUALISATION" ) ), -1 ); @@ -348,7 +348,7 @@ void VisuGUI_Module::initialize( CAM_Application* theApp ) aRule + " and ({true} in $canBeDisplayed)" );*/ createAction( GAUSS_RENAME_CONFIGURATION, VisuGUI::tr("MEN_RENAME"), QIcon(), - VisuGUI::tr("MEN_RENAME"), "", 0, this, false, + VisuGUI::tr("MEN_RENAME"), "", 0, this, false, this, SLOT(OnRename())); mgr->insert( action( GAUSS_RENAME_CONFIGURATION ), -1, -1, -1 ); mgr->setRule( action( GAUSS_RENAME_CONFIGURATION ), "selcount=1 and type='VISU::TGAUSSVIEW'" ); @@ -406,13 +406,13 @@ void VisuGUI_Module::initialize( CAM_Application* theApp ) // aViewer->setBackgroundColor( aResourceMgr->colorValue( "VTKViewer", "background", aViewer->backgroundColor() ) ); // aViewer->setProjectionMode( aResourceMgr->integerValue( "VTKViewer", "projection_mode", aViewer->projectionMode() ) ); // aViewer->setTrihedronSize( aResourceMgr->integerValue( "VTKViewer", "trihedron_size", aViewer->trihedronSize() ), -// aResourceMgr->booleanValue( "VTKViewer", "relative_size", aViewer->trihedronRelative() ) ); +// aResourceMgr->booleanValue( "VTKViewer", "relative_size", aViewer->trihedronRelative() ) ); // aViewer->setIncrementalSpeed( aResourceMgr->integerValue( "VTKViewer", "speed_value", aViewer->incrementalSpeed() ), -// aResourceMgr->integerValue( "VTKViewer", "speed_mode", aViewer->incrementalSpeedMode() ) ); +// aResourceMgr->integerValue( "VTKViewer", "speed_mode", aViewer->incrementalSpeedMode() ) ); // aViewer->setInteractionStyle( aResourceMgr->integerValue( "VTKViewer", "navigation_mode", aViewer->interactionStyle() ) ); // aViewer->setSpacemouseButtons( aResourceMgr->integerValue( "VTKViewer", "spacemouse_func1_btn", aViewer->spacemouseBtn(1) ), -// aResourceMgr->integerValue( "VTKViewer", "spacemouse_func2_btn", aViewer->spacemouseBtn(1) ), -// aResourceMgr->integerValue( "VTKViewer", "spacemouse_func5_btn", aViewer->spacemouseBtn(1) ) ); +// aResourceMgr->integerValue( "VTKViewer", "spacemouse_func2_btn", aViewer->spacemouseBtn(1) ), +// aResourceMgr->integerValue( "VTKViewer", "spacemouse_func5_btn", aViewer->spacemouseBtn(1) ) ); // new LightApp_VTKSelector( aViewer, anApp->selectionMgr() ); @@ -444,7 +444,7 @@ void VisuGUI_Module::createGaussPointsPreferences() setPreferenceProperty( primitiveGr, "columns", 2 ); int primitiveTypePref = addPreference( tr( "VISU_GAUSS_PREF_PRIMITIVE_TYPE" ), primitiveGr, - LightApp_Preferences::Selector, "VISU", + LightApp_Preferences::Selector, "VISU", "point_sprite_primitive_type" ); QStringList values; @@ -459,30 +459,30 @@ void VisuGUI_Module::createGaussPointsPreferences() setPreferenceProperty( primitiveTypePref, "indexes", indices ); int clampPref = addPreference( tr( "VISU_GAUSS_PREF_CLAMP" ), primitiveGr, - LightApp_Preferences::IntSpin, "VISU", "point_sprite_clamp" ); + LightApp_Preferences::IntSpin, "VISU", "point_sprite_clamp" ); setPreferenceProperty( clampPref, "min", 1 ); setPreferenceProperty( clampPref, "max", 512 ); addPreference( tr( "VISU_GAUSS_PREF_MAIN_TEXTURE" ), primitiveGr, - LightApp_Preferences::File, "VISU", "point_sprite_main_texture" ); + LightApp_Preferences::File, "VISU", "point_sprite_main_texture" ); addPreference( tr( "VISU_GAUSS_PREF_ALPHA_TEXTURE" ), primitiveGr, - LightApp_Preferences::File, "VISU", "point_sprite_alpha_texture" ); + LightApp_Preferences::File, "VISU", "point_sprite_alpha_texture" ); int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr, - LightApp_Preferences::DblSpin, "VISU", + LightApp_Preferences::DblSpin, "VISU", "point_sprite_alpha_threshold" ); setPreferenceProperty( alphaThresholdPref, "min", 0.0 ); setPreferenceProperty( alphaThresholdPref, "max", 1.0 ); setPreferenceProperty( alphaThresholdPref, "step", 0.1 ); int resolutionPref = addPreference( tr( "VISU_GAUSS_PREF_RESOLUTION" ), primitiveGr, - LightApp_Preferences::IntSpin, "VISU", "geom_sphere_resolution" ); + LightApp_Preferences::IntSpin, "VISU", "geom_sphere_resolution" ); setPreferenceProperty( resolutionPref, "min", 3 ); setPreferenceProperty( resolutionPref, "max", 100 ); int faceLimitPref = addPreference( tr( "VISU_GAUSS_PREF_FACE_LIMIT" ), primitiveGr, - LightApp_Preferences::IntSpin, "VISU", "geom_sphere_face_limit" ); + LightApp_Preferences::IntSpin, "VISU", "geom_sphere_face_limit" ); setPreferenceProperty( faceLimitPref, "min", 10 ); setPreferenceProperty( faceLimitPref, "max", 1000000 ); @@ -490,23 +490,23 @@ void VisuGUI_Module::createGaussPointsPreferences() setPreferenceProperty( sizeGr, "columns", 2 ); int minSizePref = addPreference( tr( "VISU_GAUSS_PREF_MIN_SIZE" ), sizeGr, - LightApp_Preferences::IntSpin, "VISU", "point_sprite_min_size" ); + LightApp_Preferences::IntSpin, "VISU", "point_sprite_min_size" ); setPreferenceProperty( minSizePref, "min", 1 ); setPreferenceProperty( minSizePref, "max", 100 ); int maxSizePref = addPreference( tr( "VISU_GAUSS_PREF_MAX_SIZE" ), sizeGr, - LightApp_Preferences::IntSpin, "VISU", "point_sprite_max_size" ); + LightApp_Preferences::IntSpin, "VISU", "point_sprite_max_size" ); setPreferenceProperty( maxSizePref, "min", 1 ); setPreferenceProperty( maxSizePref, "max", 100 ); int magnificationPref = addPreference( tr( "VISU_GAUSS_PREF_MAGNIFICATION" ), sizeGr, - LightApp_Preferences::IntSpin, "VISU", + LightApp_Preferences::IntSpin, "VISU", "point_sprite_magnification" ); setPreferenceProperty( magnificationPref, "min", 10 ); setPreferenceProperty( magnificationPref, "max", 1000 ); int incrementPref = addPreference( tr( "VISU_GAUSS_PREF_INCREMENT" ), sizeGr, - LightApp_Preferences::DblSpin, "VISU", "point_sprite_increment" ); + LightApp_Preferences::DblSpin, "VISU", "point_sprite_increment" ); setPreferenceProperty( incrementPref, "min", 0.01 ); setPreferenceProperty( incrementPref, "max", 10 ); setPreferenceProperty( incrementPref, "step", 0.1 ); @@ -515,19 +515,19 @@ void VisuGUI_Module::createGaussPointsPreferences() setPreferenceProperty( geomGr, "columns", 2 ); int sizePref = addPreference( tr( "VISU_GAUSS_PREF_SIZE" ), geomGr, - LightApp_Preferences::IntSpin, "VISU", "point_sprite_size" ); + LightApp_Preferences::IntSpin, "VISU", "point_sprite_size" ); setPreferenceProperty( sizePref, "min", 1 ); setPreferenceProperty( sizePref, "max", 100 ); addPreference( tr( "VISU_GAUSS_PREF_COLOR" ), geomGr, - LightApp_Preferences::Color, "VISU", "point_sprite_color" ); + LightApp_Preferences::Color, "VISU", "point_sprite_color" ); // ScalarBar Preferences int scalarBarGr = addPreference( tr( "VISU_GAUSS_SCALAR_BAR_PREF_GROUP_TTL" ), gaussTab ); setPreferenceProperty( scalarBarGr, "columns", 2 ); int activeBarPref = addPreference( tr( "VISU_GAUSS_PREF_ACTIVE_BAR" ), scalarBarGr, - LightApp_Preferences::Selector, "VISU", "scalar_bar_active_local" ); + LightApp_Preferences::Selector, "VISU", "scalar_bar_active_local" ); values.clear(); values.append( tr( "VISU_GAUSS_PREF_LOCAL" ) ); @@ -539,10 +539,10 @@ void VisuGUI_Module::createGaussPointsPreferences() setPreferenceProperty( activeBarPref, "indexes", indices ); addPreference( tr( "VISU_GAUSS_PREF_DISPLAY_GLOBAL" ), scalarBarGr, - LightApp_Preferences::Bool, "VISU", "scalar_bar_display_global" ); + LightApp_Preferences::Bool, "VISU", "scalar_bar_display_global" ); int colorPref = addPreference( tr( "VISU_GAUSS_PREF_SCALAR_BAR_MODE" ), scalarBarGr, - LightApp_Preferences::Selector, "VISU", "scalar_bar_bicolor" ); + LightApp_Preferences::Selector, "VISU", "scalar_bar_bicolor" ); values.clear(); values.append( tr( "VISU_GAUSS_PREF_BICOLOR" ) ); @@ -554,7 +554,7 @@ void VisuGUI_Module::createGaussPointsPreferences() setPreferenceProperty( colorPref, "indexes", indices ); int spacingPref = addPreference( tr( "VISU_GAUSS_PREF_SPACING" ), scalarBarGr, - LightApp_Preferences::DblSpin, "VISU", "scalar_bar_spacing" ); + LightApp_Preferences::DblSpin, "VISU", "scalar_bar_spacing" ); setPreferenceProperty( spacingPref, "min", 0.01 ); setPreferenceProperty( spacingPref, "max", 1.0 ); setPreferenceProperty( spacingPref, "step", 0.01 ); @@ -623,31 +623,31 @@ void VisuGUI_Module::createInsideCursorPreferences() setPreferenceProperty( primitiveTypePref, "indexes", indices ); int clampPref = addPreference( tr( "VISU_GAUSS_PREF_CLAMP" ), primitiveGr, - LightApp_Preferences::IntSpin, "VISU", "inside_point_sprite_clamp" ); + LightApp_Preferences::IntSpin, "VISU", "inside_point_sprite_clamp" ); setPreferenceProperty( clampPref, "min", 1 ); setPreferenceProperty( clampPref, "max", 512 ); addPreference( tr( "VISU_GAUSS_PREF_MAIN_TEXTURE" ), primitiveGr, - LightApp_Preferences::File, "VISU", "inside_point_sprite_main_texture" ); + LightApp_Preferences::File, "VISU", "inside_point_sprite_main_texture" ); addPreference( tr( "VISU_GAUSS_PREF_ALPHA_TEXTURE" ), primitiveGr, - LightApp_Preferences::File, "VISU", "inside_point_sprite_alpha_texture" ); + LightApp_Preferences::File, "VISU", "inside_point_sprite_alpha_texture" ); int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr, - LightApp_Preferences::DblSpin, "VISU", + LightApp_Preferences::DblSpin, "VISU", "inside_point_sprite_alpha_threshold" ); setPreferenceProperty( alphaThresholdPref, "min", 0.0 ); setPreferenceProperty( alphaThresholdPref, "max", 1.0 ); setPreferenceProperty( alphaThresholdPref, "step", 0.1 ); int resolutionPref = addPreference( tr( "VISU_GAUSS_PREF_RESOLUTION" ), primitiveGr, - LightApp_Preferences::IntSpin, "VISU", + LightApp_Preferences::IntSpin, "VISU", "inside_geom_sphere_resolution" ); setPreferenceProperty( resolutionPref, "min", 3 ); setPreferenceProperty( resolutionPref, "max", 100 ); int faceLimitPref = addPreference( tr( "VISU_GAUSS_PREF_FACE_LIMIT" ), primitiveGr, - LightApp_Preferences::IntSpin, "VISU", + LightApp_Preferences::IntSpin, "VISU", "inside_geom_sphere_face_limit" ); setPreferenceProperty( faceLimitPref, "min", 10 ); setPreferenceProperty( faceLimitPref, "max", 1000000 ); @@ -656,13 +656,13 @@ void VisuGUI_Module::createInsideCursorPreferences() setPreferenceProperty( sizeGr, "columns", 4 ); int minSizePref = addPreference( tr( "VISU_GAUSS_PREF_MIN_SIZE" ), sizeGr, - LightApp_Preferences::IntSpin, "VISU", + LightApp_Preferences::IntSpin, "VISU", "inside_point_sprite_min_size" ); setPreferenceProperty( minSizePref, "min", 1 ); setPreferenceProperty( minSizePref, "max", 100 ); int maxSizePref = addPreference( tr( "VISU_GAUSS_PREF_MAX_SIZE" ), sizeGr, - LightApp_Preferences::IntSpin, "VISU", + LightApp_Preferences::IntSpin, "VISU", "inside_point_sprite_max_size" ); setPreferenceProperty( maxSizePref, "min", 1 ); setPreferenceProperty( maxSizePref, "max", 100 ); @@ -671,13 +671,13 @@ void VisuGUI_Module::createInsideCursorPreferences() setPreferenceProperty( magnificationGr, "columns", 4 ); int magnificationPref = addPreference( tr( "VISU_GAUSS_PREF_MAGNIFICATION" ), magnificationGr, - LightApp_Preferences::IntSpin, "VISU", + LightApp_Preferences::IntSpin, "VISU", "inside_point_sprite_magnification" ); setPreferenceProperty( magnificationPref, "min", 10 ); setPreferenceProperty( magnificationPref, "max", 1000 ); int incrementPref = addPreference( tr( "VISU_GAUSS_PREF_INCREMENT" ), magnificationGr, - LightApp_Preferences::DblSpin, "VISU", + LightApp_Preferences::DblSpin, "VISU", "inside_point_sprite_increment" ); setPreferenceProperty( incrementPref, "min", 0.01 ); setPreferenceProperty( incrementPref, "max", 10 ); @@ -709,31 +709,31 @@ void VisuGUI_Module::createOutsideCursorPreferences() setPreferenceProperty( primitiveTypePref, "indexes", indices ); int clampPref = addPreference( tr( "VISU_GAUSS_PREF_CLAMP" ), primitiveGr, - LightApp_Preferences::IntSpin, "VISU", "outside_point_sprite_clamp" ); + LightApp_Preferences::IntSpin, "VISU", "outside_point_sprite_clamp" ); setPreferenceProperty( clampPref, "min", 1 ); setPreferenceProperty( clampPref, "max", 512 ); addPreference( tr( "VISU_GAUSS_PREF_MAIN_TEXTURE" ), primitiveGr, - LightApp_Preferences::File, "VISU", "outside_point_sprite_main_texture" ); + LightApp_Preferences::File, "VISU", "outside_point_sprite_main_texture" ); addPreference( tr( "VISU_GAUSS_PREF_ALPHA_TEXTURE" ), primitiveGr, - LightApp_Preferences::File, "VISU", "outside_point_sprite_alpha_texture" ); + LightApp_Preferences::File, "VISU", "outside_point_sprite_alpha_texture" ); int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr, - LightApp_Preferences::DblSpin, "VISU", + LightApp_Preferences::DblSpin, "VISU", "outside_point_sprite_alpha_threshold" ); setPreferenceProperty( alphaThresholdPref, "min", 0.0 ); setPreferenceProperty( alphaThresholdPref, "max", 1.0 ); setPreferenceProperty( alphaThresholdPref, "step", 0.1 ); int resolutionPref = addPreference( tr( "VISU_GAUSS_PREF_RESOLUTION" ), primitiveGr, - LightApp_Preferences::IntSpin, "VISU", + LightApp_Preferences::IntSpin, "VISU", "outside_geom_sphere_resolution" ); setPreferenceProperty( resolutionPref, "min", 3 ); setPreferenceProperty( resolutionPref, "max", 100 ); int faceLimitPref = addPreference( tr( "VISU_GAUSS_PREF_FACE_LIMIT" ), primitiveGr, - LightApp_Preferences::IntSpin, "VISU", + LightApp_Preferences::IntSpin, "VISU", "outside_geom_sphere_face_limit" ); setPreferenceProperty( faceLimitPref, "min", 10 ); setPreferenceProperty( faceLimitPref, "max", 1000000 ); @@ -742,7 +742,7 @@ void VisuGUI_Module::createOutsideCursorPreferences() setPreferenceProperty( sizeGr, "columns", 2 ); int sizePref = addPreference( tr( "VISU_GAUSS_PREF_SIZE" ), sizeGr, - LightApp_Preferences::IntSpin, "VISU", "outside_point_sprite_size" ); + LightApp_Preferences::IntSpin, "VISU", "outside_point_sprite_size" ); setPreferenceProperty( sizePref, "min", 1 ); setPreferenceProperty( sizePref, "max", 100 ); @@ -750,10 +750,10 @@ void VisuGUI_Module::createOutsideCursorPreferences() setPreferenceProperty( colorGr, "columns", 2 ); addPreference( tr( "VISU_GAUSS_PREF_UNIFORM_COLOR" ), colorGr, - LightApp_Preferences::Bool, "VISU", "outside_point_sprite_uniform" ); + LightApp_Preferences::Bool, "VISU", "outside_point_sprite_uniform" ); addPreference( tr( "VISU_GAUSS_PREF_COLOR" ), colorGr, - LightApp_Preferences::Color, "VISU", "outside_point_sprite_color" ); + LightApp_Preferences::Color, "VISU", "outside_point_sprite_color" ); } @@ -773,7 +773,7 @@ void VisuGUI_Module::createPickingPreferences() setPreferenceProperty( cursorSizePref, "step", 0.1 ); int pyramidHeightPref = addPreference( tr( "VISU_PICKING_PREF_PYRAMID_HEIGHT" ), cursorGr, - LightApp_Preferences::DblSpin, "VISU", "picking_pyramid_height" ); + LightApp_Preferences::DblSpin, "VISU", "picking_pyramid_height" ); setPreferenceProperty( pyramidHeightPref, "min", 1 ); setPreferenceProperty( pyramidHeightPref, "max", 100 ); @@ -796,17 +796,17 @@ void VisuGUI_Module::createPickingPreferences() setPreferenceProperty( infoWindowGr, "columns", 2 ); int infoWindowPref = addPreference( tr( "VISU_PICKING_PREF_INFO_WINDOW" ), infoWindowGr, - LightApp_Preferences::Bool, "VISU", "picking_info_window" ); + LightApp_Preferences::Bool, "VISU", "picking_info_window" ); setPreferenceProperty( infoWindowPref, "columns", 2 ); int transparencyPref = addPreference( tr( "VISU_PICKING_PREF_TRANSPARENCY" ), infoWindowGr, - LightApp_Preferences::IntSpin, "VISU", "picking_transparency" ); + LightApp_Preferences::IntSpin, "VISU", "picking_transparency" ); setPreferenceProperty( transparencyPref, "min", 0 ); setPreferenceProperty( transparencyPref, "max", 100 ); setPreferenceProperty( transparencyPref, "step", 10 ); int positionPref = addPreference( tr( "VISU_PICKING_PREF_POSITION" ), infoWindowGr, - LightApp_Preferences::Selector, "VISU", "picking_position" ); + LightApp_Preferences::Selector, "VISU", "picking_position" ); QStringList values; values.append( tr( "VISU_PICKING_PREF_BELOW_POINT" ) ); values.append( tr( "VISU_PICKING_PREF_TOP_LEFT_CORNER" ) ); @@ -821,17 +821,17 @@ void VisuGUI_Module::createPickingPreferences() setPreferenceProperty( cameraGr, "columns", 2 ); int cameraPref = addPreference( tr( "VISU_PICKING_PREF_CAMERA_MOVEMENT" ), cameraGr, - LightApp_Preferences::Bool, "VISU", "picking_camera_movement" ); + LightApp_Preferences::Bool, "VISU", "picking_camera_movement" ); setPreferenceProperty( cameraPref, "columns", 2 ); int zoomFactorPref = addPreference( tr( "VISU_PICKING_PREF_ZOOM_FACTOR" ), cameraGr, - LightApp_Preferences::DblSpin, "VISU", "picking_zoom_factor" ); + LightApp_Preferences::DblSpin, "VISU", "picking_zoom_factor" ); setPreferenceProperty( zoomFactorPref, "min", 0.1 ); setPreferenceProperty( zoomFactorPref, "max", 10.0 ); setPreferenceProperty( zoomFactorPref, "step", 0.1 ); int stepNumberPref = addPreference( tr( "VISU_PICKING_PREF_STEP_NUMBER" ), cameraGr, - LightApp_Preferences::IntSpin, "VISU", "picking_step_number" ); + LightApp_Preferences::IntSpin, "VISU", "picking_step_number" ); setPreferenceProperty( stepNumberPref, "min", 1 ); setPreferenceProperty( stepNumberPref, "max", 100 ); @@ -840,7 +840,7 @@ void VisuGUI_Module::createPickingPreferences() setPreferenceProperty( parentMeshGr, "columns", 1 ); addPreference( tr( "VISU_PICKING_PREF_DISPLAY_PARENT_MESH" ), parentMeshGr, - LightApp_Preferences::Bool, "VISU", "picking_display_parent_mesh" ); + LightApp_Preferences::Bool, "VISU", "picking_display_parent_mesh" ); } @@ -931,7 +931,7 @@ void VisuGUI_Module::createRecorderPreferences() setPreferenceProperty( recorderGr, "columns", 2 ); int modePref = addPreference( tr( "VISU_RECORDER_PREF_RECORDING_MODE" ), recorderGr, - LightApp_Preferences::Selector, "VISU", "recorder_mode" ); + LightApp_Preferences::Selector, "VISU", "recorder_mode" ); QStringList values; values.append( tr( "VISU_RECORDER_PREF_SKIPPED_FRAMES" ) ); values.append( tr( "VISU_RECORDER_PREF_ALL_DISLPAYED_FRAMES" ) ); @@ -942,17 +942,17 @@ void VisuGUI_Module::createRecorderPreferences() setPreferenceProperty( modePref, "indexes", indices ); int fpsPref = addPreference( tr( "VISU_RECORDER_PREF_FPS" ), recorderGr, - LightApp_Preferences::DblSpin, "VISU", "recorder_fps" ); + LightApp_Preferences::DblSpin, "VISU", "recorder_fps" ); setPreferenceProperty( fpsPref, "min", 0.1 ); setPreferenceProperty( fpsPref, "max", 100 ); int qualityPref = addPreference( tr( "VISU_RECORDER_PREF_QUALITY" ), recorderGr, - LightApp_Preferences::IntSpin, "VISU", "recorder_quality" ); + LightApp_Preferences::IntSpin, "VISU", "recorder_quality" ); setPreferenceProperty( qualityPref, "min", 1 ); setPreferenceProperty( qualityPref, "max", 100 ); addPreference( tr( "VISU_RECORDER_PREF_PROGRESSIVE" ), recorderGr, - LightApp_Preferences::Bool, "VISU", "recorder_progressive" ); + LightApp_Preferences::Bool, "VISU", "recorder_progressive" ); } @@ -965,7 +965,7 @@ void VisuGUI_Module::OnCreateGaussPoints() if (aPrs) emit presentationCreated(aPrs); INFOS( "VisuGUI_Module::OnCreateGaussPoints() : Gauss Points created in " << - vtkTimerLog::GetCPUTime() - initialTime << " seconds" ); + vtkTimerLog::GetCPUTime() - initialTime << " seconds" ); } // void VisuGUI_Module::OnViewManagerAdded(SUIT_ViewManager* viewMgr) @@ -1038,8 +1038,8 @@ void VisuGUI_Module::preferencesChanged( const QString& group, const QString& pr VisuGUI::preferencesChanged(group,pref); // if ( group == "VISU" && ( pref == "speed_increment" || pref == "spacemouse_func1_btn" || -// pref == "spacemouse_func2_btn" || pref == "spacemouse_func3_btn" || -// pref == "spacemouse_func4_btn" || pref == "spacemouse_func5_btn" ) ) { +// pref == "spacemouse_func2_btn" || pref == "spacemouse_func3_btn" || +// pref == "spacemouse_func4_btn" || pref == "spacemouse_func5_btn" ) ) { // // update properties of VVTK view windows // SUIT_ViewManager* vm = getApp()->getViewManager( VVTK_Viewer::Type(), false ); @@ -1088,8 +1088,8 @@ void VisuGUI_Module::OnEditGaussPoints() namespace { /* void GetViewParams(VVTK_MainWindow* theViewWindow, - const char* theSuffix, - std::ostringstream& theStr) + const char* theSuffix, + std::ostringstream& theStr) { vtkFloatingPointType aColor[3]; vtkRenderer* aRenderer = theViewWindow->getRenderer(); @@ -1129,8 +1129,8 @@ namespace */ //--------------------------------------------------------------- /* void SetViewParams(VVTK_MainWindow* theViewWindow, - const char* theSuffix, - const Storable::TRestoringMap& theMap) + const char* theSuffix, + const Storable::TRestoringMap& theMap) { vtkFloatingPointType aColor[3]; aColor[0] = Storable::FindValue(theMap,std::string("myColor") + theSuffix + ".R").toDouble(); @@ -1170,7 +1170,7 @@ namespace */ //--------------------------------------------------------------- /* void GetViewParams(VVTK_MainWindow1* theViewWindow, - std::ostringstream& theStr) + std::ostringstream& theStr) { GetViewParams(theViewWindow,"1",theStr); @@ -1178,35 +1178,35 @@ namespace if(aWidgetCtrl->GetEnabled()){ std::string aSegmentationMode; if(aWidgetCtrl->IsPlanesActive()){ - VISU_PlanesWidget *aPlanesWidget = aWidgetCtrl->GetPlanesWidget(); - vtkFloatingPointType anOrigin[3]; - aPlanesWidget->GetOrigin(anOrigin); - Storable::DataToStream(theStr,"myCursorOrigin[0]",anOrigin[0]); - Storable::DataToStream(theStr,"myCursorOrigin[1]",anOrigin[1]); - Storable::DataToStream(theStr,"myCursorOrigin[2]",anOrigin[2]); - - vtkFloatingPointType aNormal[3]; - aPlanesWidget->GetNormal(aNormal); - Storable::DataToStream(theStr,"myCursorNormal[0]",aNormal[0]); - Storable::DataToStream(theStr,"myCursorNormal[1]",aNormal[1]); - Storable::DataToStream(theStr,"myCursorNormal[2]",aNormal[2]); - - vtkFloatingPointType aDepth = aPlanesWidget->Distance(); - Storable::DataToStream(theStr,"myCursorDepth",aDepth); - - aSegmentationMode = "Planes"; + VISU_PlanesWidget *aPlanesWidget = aWidgetCtrl->GetPlanesWidget(); + vtkFloatingPointType anOrigin[3]; + aPlanesWidget->GetOrigin(anOrigin); + Storable::DataToStream(theStr,"myCursorOrigin[0]",anOrigin[0]); + Storable::DataToStream(theStr,"myCursorOrigin[1]",anOrigin[1]); + Storable::DataToStream(theStr,"myCursorOrigin[2]",anOrigin[2]); + + vtkFloatingPointType aNormal[3]; + aPlanesWidget->GetNormal(aNormal); + Storable::DataToStream(theStr,"myCursorNormal[0]",aNormal[0]); + Storable::DataToStream(theStr,"myCursorNormal[1]",aNormal[1]); + Storable::DataToStream(theStr,"myCursorNormal[2]",aNormal[2]); + + vtkFloatingPointType aDepth = aPlanesWidget->Distance(); + Storable::DataToStream(theStr,"myCursorDepth",aDepth); + + aSegmentationMode = "Planes"; }else if(aWidgetCtrl->IsSphereActive()){ - VISU_SphereWidget *aSphereWidget = aWidgetCtrl->GetSphereWidget(); - vtkFloatingPointType aCenter[3]; - aSphereWidget->GetCenter(aCenter); - Storable::DataToStream(theStr,"mySphereCursorCenter[0]",aCenter[0]); - Storable::DataToStream(theStr,"mySphereCursorCenter[1]",aCenter[1]); - Storable::DataToStream(theStr,"mySphereCursorCenter[2]",aCenter[2]); + VISU_SphereWidget *aSphereWidget = aWidgetCtrl->GetSphereWidget(); + vtkFloatingPointType aCenter[3]; + aSphereWidget->GetCenter(aCenter); + Storable::DataToStream(theStr,"mySphereCursorCenter[0]",aCenter[0]); + Storable::DataToStream(theStr,"mySphereCursorCenter[1]",aCenter[1]); + Storable::DataToStream(theStr,"mySphereCursorCenter[2]",aCenter[2]); - vtkFloatingPointType aRadius = aSphereWidget->GetRadius(); - Storable::DataToStream(theStr,"mySphereCursorRaduis",aRadius); + vtkFloatingPointType aRadius = aSphereWidget->GetRadius(); + Storable::DataToStream(theStr,"mySphereCursorRaduis",aRadius); - aSegmentationMode = "Sphere"; + aSegmentationMode = "Sphere"; } Storable::DataToStream(theStr,"mySegmentationMode",aSegmentationMode.c_str()); @@ -1215,7 +1215,7 @@ namespace */ //--------------------------------------------------------------- /*void SetViewParams(VVTK_MainWindow1* theViewWindow, - const Storable::TRestoringMap& theMap) + const Storable::TRestoringMap& theMap) { SetViewParams(theViewWindow,"1",theMap); } @@ -1223,13 +1223,13 @@ namespace */ //--------------------------------------------------------------- /*void GetViewParams(VVTK_MainWindow2* theViewWindow, - std::ostringstream& theStr) + std::ostringstream& theStr) { GetViewParams(theViewWindow,"2",theStr); } void SetViewParams(VVTK_MainWindow2* theViewWindow, - const Storable::TRestoringMap& theMap) + const Storable::TRestoringMap& theMap) { SetViewParams(theViewWindow,"2",theMap); } @@ -1279,21 +1279,21 @@ namespace void operator()(VISU_GaussPtsAct* theActor) { if(theActor->GetVisibility()){ - const Handle(SALOME_InteractiveObject)& anIO = theActor->getIO(); - myVisibleEntries.insert(TVisibleEntries::value_type(anIO->getEntry(),TSelection())); + const Handle(SALOME_InteractiveObject)& anIO = theActor->getIO(); + myVisibleEntries.insert(TVisibleEntries::value_type(anIO->getEntry(),TSelection())); } } }; /*void GetGaussPointsSelection(SVTK_ViewWindow* theViewWindow, - TVisibleEntries& theVisibleEntries) + TVisibleEntries& theVisibleEntries) { // First find all visible Gauss Points presentations vtkRenderer* aRenderer = theViewWindow->getRenderer(); vtkActorCollection* anActors = aRenderer->GetActors(); TGetVisibleEntries aGetVisibleEntries(theVisibleEntries); SVTK::ForEach(anActors, - aGetVisibleEntries); + aGetVisibleEntries); // Next, find the sub-ids for the visible Gauss Points presentations SVTK_Selector* aSelector = theViewWindow->GetSelector(); @@ -1304,14 +1304,14 @@ namespace std::string anEntry = anIO->getEntry(); TVisibleEntries::iterator anEntriesIter = theVisibleEntries.find(anEntry); if(anEntriesIter != theVisibleEntries.end()){ - TSelection& aSelection = anEntriesIter->second; - aSelection.myIsSelected = true; - TColStd_IndexedMapOfInteger anIndexes; - aSelector->GetIndex(anIO,anIndexes); - if(anIndexes.Extent() > 0){ - aSelection.myHasSubId = true; - aSelection.mySubId = anIndexes(1); - } + TSelection& aSelection = anEntriesIter->second; + aSelection.myIsSelected = true; + TColStd_IndexedMapOfInteger anIndexes; + aSelector->GetIndex(anIO,anIndexes); + if(anIndexes.Extent() > 0){ + aSelection.myHasSubId = true; + aSelection.mySubId = anIndexes(1); + } } } } @@ -1319,10 +1319,10 @@ namespace //--------------------------------------------------------------- inline void CreateReference(_PTR(Study) theStudyDocument, - _PTR(StudyBuilder) theStudyBuilder, - _PTR(SObject) theFatherSObject, - const string& theRefEntry, - const TSelection& theSelection) + _PTR(StudyBuilder) theStudyBuilder, + _PTR(SObject) theFatherSObject, + const string& theRefEntry, + const TSelection& theSelection) { _PTR(SObject) aNewObj = theStudyBuilder->NewObject(theFatherSObject); _PTR(SObject) aRefSObj = theStudyDocument->FindObjectID(theRefEntry); @@ -1342,9 +1342,9 @@ namespace //--------------------------------------------------------------- /*void SetGaussPointsSelection(VisuGUI* theModule, - SVTK_ViewWindow* theViewWindow, - _PTR(Study) theCStudy, - _PTR(SObject) theSObject) + SVTK_ViewWindow* theViewWindow, + _PTR(Study) theCStudy, + _PTR(SObject) theSObject) { SVTK_Selector* aSelector = theViewWindow->GetSelector(); aSelector->ClearIObjects(); @@ -1355,29 +1355,29 @@ namespace _PTR(SObject) aChildSObject = aChildIter->Value(); _PTR(SObject) aSObject; if(aChildSObject->ReferencedObject(aSObject)){ - CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject); - PortableServer::ServantBase_var aServant = VISU::GetServant(anObject); - if(VISU::Prs3d_i* aPrs3d = dynamic_cast(aServant.in())){ - // To set visiblity - VISU::UpdateViewer(theModule, aPrs3d, anIsFirst, false); - anIsFirst = false; - - // To update selection - Storable::TRestoringMap aMap = Storable::GetStorableMap(aChildSObject); - if(!aMap.empty()){ - bool anIsSelected = aMap["myIsSelected"].toInt(); - bool aHasSubId = aMap["myHasSubId"].toInt(); - int aSubId = aMap["mySubId"].toInt(); - - if(anIsSelected){ - std::string anEntry = aSObject->GetID(); - Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject(anEntry.c_str(),""); - aSelector->AddIObject(anIO); - if(aHasSubId) - aSelector->AddOrRemoveIndex(anIO,aSubId,false); - } - } - } + CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject); + PortableServer::ServantBase_var aServant = VISU::GetServant(anObject); + if(VISU::Prs3d_i* aPrs3d = dynamic_cast(aServant.in())){ + // To set visiblity + VISU::UpdateViewer(theModule, aPrs3d, anIsFirst, false); + anIsFirst = false; + + // To update selection + Storable::TRestoringMap aMap = Storable::GetStorableMap(aChildSObject); + if(!aMap.empty()){ + bool anIsSelected = aMap["myIsSelected"].toInt(); + bool aHasSubId = aMap["myHasSubId"].toInt(); + int aSubId = aMap["mySubId"].toInt(); + + if(anIsSelected){ + std::string anEntry = aSObject->GetID(); + Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject(anEntry.c_str(),""); + aSelector->AddIObject(anIO); + if(aHasSubId) + aSelector->AddOrRemoveIndex(anIO,aSubId,false); + } + } + } } } @@ -1387,7 +1387,7 @@ namespace //--------------------------------------------------------------- /*void OnStoreConfiguration(SalomeApp_Module* theModule, - bool theIsNew) + bool theIsNew) { _PTR(Study) aCStudy = GetCStudy(GetAppStudy(theModule)); if (CheckLock(aCStudy,GetDesktop(theModule))) @@ -1409,66 +1409,66 @@ namespace std::string aValue = GetViewParams(aViewWindow); if(theIsNew){ - _PTR(SComponent) aSComponent = ClientFindOrCreateVisuComponent(aCStudy); - - static int myNbConfigs = 0; - std::string aName = VISU::GenerateName("Config.", ++myNbConfigs).toLatin1().data(); - - std::string aSComponentEntry = aSComponent->GetID(); - anEntry = CreateAttributes(aCStudy, - aSComponentEntry.c_str(), - "", - "", - aName.c_str(), - "", - aValue.c_str()); + _PTR(SComponent) aSComponent = ClientFindOrCreateVisuComponent(aCStudy); + + static int myNbConfigs = 0; + std::string aName = VISU::GenerateName("Config.", ++myNbConfigs).toLatin1().data(); + + std::string aSComponentEntry = aSComponent->GetID(); + anEntry = CreateAttributes(aCStudy, + aSComponentEntry.c_str(), + "", + "", + aName.c_str(), + "", + aValue.c_str()); }else{ - SALOME_ListIO aListIO; - aSelectionMgr->selectedObjects(aListIO); - SALOME_ListIteratorOfListIO aListIter( aListIO ); - for(; aListIter.More(); aListIter.Next()){ - Handle(SALOME_InteractiveObject) anIO = aListIter.Value(); - _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry()); - _PTR(GenericAttribute) anAttr; - if(aSObject->FindAttribute(anAttr,"AttributeString")){ - _PTR(AttributeString) aComment(anAttr); - std::string aCommentValue(aComment->Value()); - if(aCommentValue.compare("myComment=GAUSSVIEW") >= 0){ - aComment->SetValue(aValue.c_str()); - anEntry = aSObject->GetID(); - - _PTR(ChildIterator) aChildIter = aCStudy->NewChildIterator(aSObject); - for (; aChildIter->More(); aChildIter->Next()) { - _PTR(SObject) aChildSObject = aChildIter->Value(); - aStudyBuilder->RemoveObject(aChildSObject); - } - break; - } - } - } + SALOME_ListIO aListIO; + aSelectionMgr->selectedObjects(aListIO); + SALOME_ListIteratorOfListIO aListIter( aListIO ); + for(; aListIter.More(); aListIter.Next()){ + Handle(SALOME_InteractiveObject) anIO = aListIter.Value(); + _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry()); + _PTR(GenericAttribute) anAttr; + if(aSObject->FindAttribute(anAttr,"AttributeString")){ + _PTR(AttributeString) aComment(anAttr); + std::string aCommentValue(aComment->Value()); + if(aCommentValue.compare("myComment=GAUSSVIEW") >= 0){ + aComment->SetValue(aValue.c_str()); + anEntry = aSObject->GetID(); + + _PTR(ChildIterator) aChildIter = aCStudy->NewChildIterator(aSObject); + for (; aChildIter->More(); aChildIter->Next()) { + _PTR(SObject) aChildSObject = aChildIter->Value(); + aStudyBuilder->RemoveObject(aChildSObject); + } + break; + } + } + } } if(anEntry != ""){ - TVisibleEntries aVisibleEntries; - GetGaussPointsSelection(aViewWindow, - aVisibleEntries); - - _PTR(SObject) aSObject = aCStudy->FindObjectID(anEntry); - _PTR(StudyBuilder) aStudyBuilder = aCStudy->NewBuilder(); - TVisibleEntries::const_iterator anIter = aVisibleEntries.begin(); - for(; anIter != aVisibleEntries.end(); anIter++){ - const std::string& anEntry = anIter->first; - const TSelection& aSelection = anIter->second; - - CreateReference(aCStudy, - aStudyBuilder, - aSObject, - anEntry, - aSelection); - } - - //UpdateObjBrowser(theModule,true,aSObject); - UpdateObjBrowser(theModule,true); + TVisibleEntries aVisibleEntries; + GetGaussPointsSelection(aViewWindow, + aVisibleEntries); + + _PTR(SObject) aSObject = aCStudy->FindObjectID(anEntry); + _PTR(StudyBuilder) aStudyBuilder = aCStudy->NewBuilder(); + TVisibleEntries::const_iterator anIter = aVisibleEntries.begin(); + for(; anIter != aVisibleEntries.end(); anIter++){ + const std::string& anEntry = anIter->first; + const TSelection& aSelection = anIter->second; + + CreateReference(aCStudy, + aStudyBuilder, + aSObject, + anEntry, + aSelection); + } + + //UpdateObjBrowser(theModule,true,aSObject); + UpdateObjBrowser(theModule,true); } } }*/ @@ -1477,9 +1477,9 @@ namespace //--------------------------------------------------------------- /* template void SetMainWindowParams(VisuGUI* theModule, - _PTR(SObject) theSObject, - VVTK_ViewWindow* theViewWindow, - TMainWindow* theMainWindow) + _PTR(SObject) theSObject, + VVTK_ViewWindow* theViewWindow, + TMainWindow* theMainWindow) { _PTR(Study) aCStudy = GetCStudy(GetAppStudy(theModule)); @@ -1531,60 +1531,60 @@ namespace std::string aSegmentationMode; if(VVTK_MainWindow1* aMainWindow = aViewWindow->getMainWindow1()){ - aMainWindow->SetPlanesSegementation(false); - aMainWindow->SetSphereSegementation(false); - VISU_WidgetCtrl* aWidgetCtrl = aMainWindow->GetWidgetCtrl(); - aSegmentationMode = Storable::FindValue(aMap,"mySegmentationMode").toLatin1().data(); - - if(aSegmentationMode == "Planes"){ - VISU_PlanesWidget *aPlanesWidget = aWidgetCtrl->GetPlanesWidget(); - vtkFloatingPointType anOrigin[3]; - anOrigin[0] = Storable::FindValue(aMap,"myCursorOrigin[0]").toDouble(); - anOrigin[1] = Storable::FindValue(aMap,"myCursorOrigin[1]").toDouble(); - anOrigin[2] = Storable::FindValue(aMap,"myCursorOrigin[2]").toDouble(); - aPlanesWidget->SetOrigin(anOrigin); - - vtkFloatingPointType aNormal[3]; - aNormal[0] = Storable::FindValue(aMap,"myCursorNormal[0]").toDouble(); - aNormal[1] = Storable::FindValue(aMap,"myCursorNormal[1]").toDouble(); - aNormal[2] = Storable::FindValue(aMap,"myCursorNormal[2]").toDouble(); - aPlanesWidget->SetNormal(aNormal); - - vtkFloatingPointType aDepth = Storable::FindValue(aMap,"myCursorDepth").toDouble(); - aPlanesWidget->SetDistance(aDepth); - - aMainWindow->SetPlanesSegementation(true); - }else if(aSegmentationMode == "Sphere"){ - VISU_SphereWidget *aSphereWidget = aWidgetCtrl->GetSphereWidget(); - vtkFloatingPointType aCenter[3]; - aCenter[0] = Storable::FindValue(aMap,"mySphereCursorCenter[0]").toDouble(); - aCenter[1] = Storable::FindValue(aMap,"mySphereCursorCenter[1]").toDouble(); - aCenter[2] = Storable::FindValue(aMap,"mySphereCursorCenter[2]").toDouble(); - aSphereWidget->SetCenter(aCenter); - - vtkFloatingPointType aRadius = Storable::FindValue(aMap,"mySphereCursorRaduis").toDouble(); - aSphereWidget->SetRadius(aRadius); - - aMainWindow->SetSphereSegementation(true); - } + aMainWindow->SetPlanesSegementation(false); + aMainWindow->SetSphereSegementation(false); + VISU_WidgetCtrl* aWidgetCtrl = aMainWindow->GetWidgetCtrl(); + aSegmentationMode = Storable::FindValue(aMap,"mySegmentationMode").toLatin1().data(); + + if(aSegmentationMode == "Planes"){ + VISU_PlanesWidget *aPlanesWidget = aWidgetCtrl->GetPlanesWidget(); + vtkFloatingPointType anOrigin[3]; + anOrigin[0] = Storable::FindValue(aMap,"myCursorOrigin[0]").toDouble(); + anOrigin[1] = Storable::FindValue(aMap,"myCursorOrigin[1]").toDouble(); + anOrigin[2] = Storable::FindValue(aMap,"myCursorOrigin[2]").toDouble(); + aPlanesWidget->SetOrigin(anOrigin); + + vtkFloatingPointType aNormal[3]; + aNormal[0] = Storable::FindValue(aMap,"myCursorNormal[0]").toDouble(); + aNormal[1] = Storable::FindValue(aMap,"myCursorNormal[1]").toDouble(); + aNormal[2] = Storable::FindValue(aMap,"myCursorNormal[2]").toDouble(); + aPlanesWidget->SetNormal(aNormal); + + vtkFloatingPointType aDepth = Storable::FindValue(aMap,"myCursorDepth").toDouble(); + aPlanesWidget->SetDistance(aDepth); + + aMainWindow->SetPlanesSegementation(true); + }else if(aSegmentationMode == "Sphere"){ + VISU_SphereWidget *aSphereWidget = aWidgetCtrl->GetSphereWidget(); + vtkFloatingPointType aCenter[3]; + aCenter[0] = Storable::FindValue(aMap,"mySphereCursorCenter[0]").toDouble(); + aCenter[1] = Storable::FindValue(aMap,"mySphereCursorCenter[1]").toDouble(); + aCenter[2] = Storable::FindValue(aMap,"mySphereCursorCenter[2]").toDouble(); + aSphereWidget->SetCenter(aCenter); + + vtkFloatingPointType aRadius = Storable::FindValue(aMap,"mySphereCursorRaduis").toDouble(); + aSphereWidget->SetRadius(aRadius); + + aMainWindow->SetSphereSegementation(true); + } } if(VVTK_MainWindow1* aMainWindow = aViewWindow->getMainWindow1()){ - SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor(); - if(anInteractor->isVisible()){ - SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow); - }else - anInteractor->installEventFilter(this); + SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor(); + if(anInteractor->isVisible()){ + SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow); + }else + anInteractor->installEventFilter(this); } if(aSegmentationMode != ""){ - if(VVTK_MainWindow2* aMainWindow = aViewWindow->getMainWindow2()){ - SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor(); - if(anInteractor->isVisible()) - SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow); - else - anInteractor->installEventFilter(this); - } + if(VVTK_MainWindow2* aMainWindow = aViewWindow->getMainWindow2()){ + SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor(); + if(anInteractor->isVisible()) + SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow); + else + anInteractor->installEventFilter(this); + } } SetGaussPointsSelection(this,aViewWindow,aCStudy,aSObject); @@ -1602,18 +1602,18 @@ namespace // SUIT_ViewWindow* aWindow = aViewManager->getActiveView(); // VVTK_ViewWindow* aViewWindow = dynamic_cast(aWindow); // if(VVTK_MainWindow1* aMainWindow = aViewWindow->getMainWindow1()){ -// SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor(); -// if(theWatched == anInteractor){ -// SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow); -// anInteractor->removeEventFilter(this); -// } +// SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor(); +// if(theWatched == anInteractor){ +// SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow); +// anInteractor->removeEventFilter(this); +// } // } // if(VVTK_MainWindow2* aMainWindow = aViewWindow->getMainWindow2()){ -// SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor(); -// if(theWatched == aMainWindow->GetInteractor()){ -// SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow); -// anInteractor->removeEventFilter(this); -// } +// SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor(); +// if(theWatched == aMainWindow->GetInteractor()){ +// SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow); +// anInteractor->removeEventFilter(this); +// } // } // } // } @@ -1664,7 +1664,7 @@ void VisuGUI_Module::storeVisualParameters(int savePoint) vwin->getVisualParameters().toLatin1().data() ); if ( application()->desktop()->activeWindow() == vwin ) - ip->setProperty( "ActiveGaussViewer", QString::number( vvtkViewers ).toLatin1().data() ); + ip->setProperty( "ActiveGaussViewer", QString::number( vvtkViewers ).toLatin1().data() ); vvtkViewers++; } } @@ -1690,152 +1690,152 @@ void VisuGUI_Module::storeVisualParameters(int savePoint) // saving VTK actors' properties if ( vType == SVTK_Viewer::Type() /*|| // processing SVTK and VVTK viewers in the same - vType == VVTK_Viewer::Type()*/ ) { // way (VVTK_ViewWindow inherits SVTK_ViewWindow) + vType == VVTK_Viewer::Type()*/ ) { // way (VVTK_ViewWindow inherits SVTK_ViewWindow) QVector views = vman->getViews(); for ( int i = 0, iEnd = vman->getViewsCount(); i < iEnd; i++ ) { - if ( SVTK_ViewWindow* vtkView = dynamic_cast( views[i] ) ) { - VTK::ActorCollectionCopy aCopy(vtkView->getRenderer()->GetActors()); - vtkActorCollection* allActors = aCopy.GetActors(); - allActors->InitTraversal(); - while ( vtkActor* actor = allActors->GetNextActor() ) { - if ( actor->GetVisibility() ) { // store only visible actors - if ( VISU_Actor* vActor = VISU_Actor::SafeDownCast( actor ) ) { - if ( vActor->hasIO() ) { // actor corresponds to existing obj - - Handle(SALOME_InteractiveObject) io = vActor->getIO(); - // entry is "ecoded" = it does NOT contain component adress, since it is a - // subject to change on next component loading - std::string entry = ip->encodeEntry( io->getEntry(), componentName ); - - std::string param, vtkParam = vType.toLatin1().data(); + if ( SVTK_ViewWindow* vtkView = dynamic_cast( views[i] ) ) { + VTK::ActorCollectionCopy aCopy(vtkView->getRenderer()->GetActors()); + vtkActorCollection* allActors = aCopy.GetActors(); + allActors->InitTraversal(); + while ( vtkActor* actor = allActors->GetNextActor() ) { + if ( actor->GetVisibility() ) { // store only visible actors + if ( VISU_Actor* vActor = VISU_Actor::SafeDownCast( actor ) ) { + if ( vActor->hasIO() ) { // actor corresponds to existing obj + + Handle(SALOME_InteractiveObject) io = vActor->getIO(); + // entry is "ecoded" = it does NOT contain component adress, since it is a + // subject to change on next component loading + std::string entry = ip->encodeEntry( io->getEntry(), componentName ); + + std::string param, vtkParam = vType.toLatin1().data(); vtkParam += gSeparator; - vtkParam += QString::number( *viewsCounter ).toLatin1().data(); + vtkParam += QString::number( *viewsCounter ).toLatin1().data(); vtkParam += gSeparator; - param = vtkParam + "Visibility"; - ip->setParameter( entry, param, "On" ); - param = vtkParam + "Name"; - ip->setParameter( entry, param, vActor->getName() ); - param = vtkParam + "RepresentationMode"; - ip->setParameter( entry, param, QString::number( vActor->GetRepresentation() ).toLatin1().data() ); + param = vtkParam + "Visibility"; + ip->setParameter( entry, param, "On" ); + param = vtkParam + "Name"; + ip->setParameter( entry, param, vActor->getName() ); + param = vtkParam + "RepresentationMode"; + ip->setParameter( entry, param, QString::number( vActor->GetRepresentation() ).toLatin1().data() ); param = vtkParam + "Quadratic2DRepresentation"; ip->setParameter( entry, param, QString::number( vActor->GetQuadratic2DRepresentation() ).toLatin1().data() ); - param = vtkParam + "Opacity"; - ip->setParameter( entry, param, QString::number( vActor->GetOpacity() ).toLatin1().data() ); - vtkFloatingPointType r, g, b; - vActor->GetColor(r, g, b); - QString colorStr = QString::number( r ); colorStr += gDigitsSep; - colorStr += QString::number( g ); colorStr += gDigitsSep; + param = vtkParam + "Opacity"; + ip->setParameter( entry, param, QString::number( vActor->GetOpacity() ).toLatin1().data() ); + vtkFloatingPointType r, g, b; + vActor->GetColor(r, g, b); + QString colorStr = QString::number( r ); colorStr += gDigitsSep; + colorStr += QString::number( g ); colorStr += gDigitsSep; colorStr += QString::number( b ); - param = vtkParam + "Color"; - ip->setParameter( entry, param, colorStr.toLatin1().data() ); - param = vtkParam + "LineWidth"; - ip->setParameter( entry, param, QString::number( vActor->GetLineWidth() ).toLatin1().data() ); - if ( vActor->IsShrunkable() && vActor->IsShrunk() ) { - param = vtkParam + "ShrinkMode"; - ip->setParameter( entry, param, "On" ); - param = vtkParam + "ShrinkFactor"; - ip->setParameter( entry, param, QString::number( vActor->GetShrinkFactor() ).toLatin1().data() ); - } - VISU_ScalarMapAct* scalarMapActor = dynamic_cast( vActor ); - if ( scalarMapActor && scalarMapActor->IsShading() ) { - param = vtkParam + "Shading"; - ip->setParameter( entry, param, "On" ); - } - if ( const VISU::Prs3d_i* vPrs = vActor->GetPrs3d() ) { - param = vtkParam + "ClippingPlane"; - int nPlanes = vPrs->GetNumberOfClippingPlanes(); - if ( !nPlanes ) - ip->setParameter( entry, param, "Off" ); - for ( int p = 0; p < nPlanes; p++ ) { - vtkPlane* plane = vPrs->GetClippingPlane( p ); - vtkFloatingPointType normal[3], origin[3]; - plane->GetNormal( normal ); - plane->GetOrigin( origin ); - std::string planeValue = QString::number( normal[0] ).toLatin1().data(); planeValue += gDigitsSep; - planeValue += QString::number( normal[1] ).toLatin1().data(); planeValue += gDigitsSep; - planeValue += QString::number( normal[2] ).toLatin1().data(); planeValue += gDigitsSep; - planeValue += QString::number( origin[0] ).toLatin1().data(); planeValue += gDigitsSep; - planeValue += QString::number( origin[1] ).toLatin1().data(); planeValue += gDigitsSep; - planeValue += QString::number( origin[2] ).toLatin1().data(); - param = QString( "%1ClippingPlane_%2" ).arg( vtkParam.c_str() ).arg( p+1 ).toLatin1().data(); - ip->setParameter( entry, param, planeValue ); - } - } - - } // hasIO - } // salome_actor successfull downcast to the VISU_Actor - else if ( VISU_PointMap3dActor* vActor = VISU_PointMap3dActor::SafeDownCast( actor ) ) { // PointMap3D - if ( vActor->hasIO() ) { // actor corresponds to existing obj - Handle(SALOME_InteractiveObject) io = vActor->getIO(); - // entry is "ecoded" = it does NOT contain component adress, since it is a - // subject to change on next component loading - std::string entry = ip->encodeEntry( io->getEntry(), componentName ); - std::string param, vtkParam = vType.toLatin1().data(); + param = vtkParam + "Color"; + ip->setParameter( entry, param, colorStr.toLatin1().data() ); + param = vtkParam + "LineWidth"; + ip->setParameter( entry, param, QString::number( vActor->GetLineWidth() ).toLatin1().data() ); + if ( vActor->IsShrunkable() && vActor->IsShrunk() ) { + param = vtkParam + "ShrinkMode"; + ip->setParameter( entry, param, "On" ); + param = vtkParam + "ShrinkFactor"; + ip->setParameter( entry, param, QString::number( vActor->GetShrinkFactor() ).toLatin1().data() ); + } + VISU_ScalarMapAct* scalarMapActor = dynamic_cast( vActor ); + if ( scalarMapActor && scalarMapActor->IsShading() ) { + param = vtkParam + "Shading"; + ip->setParameter( entry, param, "On" ); + } + if ( const VISU::Prs3d_i* vPrs = vActor->GetPrs3d() ) { + param = vtkParam + "ClippingPlane"; + int nPlanes = vPrs->GetNumberOfClippingPlanes(); + if ( !nPlanes ) + ip->setParameter( entry, param, "Off" ); + for ( int p = 0; p < nPlanes; p++ ) { + vtkPlane* plane = vPrs->GetClippingPlane( p ); + vtkFloatingPointType normal[3], origin[3]; + plane->GetNormal( normal ); + plane->GetOrigin( origin ); + std::string planeValue = QString::number( normal[0] ).toLatin1().data(); planeValue += gDigitsSep; + planeValue += QString::number( normal[1] ).toLatin1().data(); planeValue += gDigitsSep; + planeValue += QString::number( normal[2] ).toLatin1().data(); planeValue += gDigitsSep; + planeValue += QString::number( origin[0] ).toLatin1().data(); planeValue += gDigitsSep; + planeValue += QString::number( origin[1] ).toLatin1().data(); planeValue += gDigitsSep; + planeValue += QString::number( origin[2] ).toLatin1().data(); + param = QString( "%1ClippingPlane_%2" ).arg( vtkParam.c_str() ).arg( p+1 ).toLatin1().data(); + ip->setParameter( entry, param, planeValue ); + } + } + + } // hasIO + } // salome_actor successfull downcast to the VISU_Actor + else if ( VISU_PointMap3dActor* vActor = VISU_PointMap3dActor::SafeDownCast( actor ) ) { // PointMap3D + if ( vActor->hasIO() ) { // actor corresponds to existing obj + Handle(SALOME_InteractiveObject) io = vActor->getIO(); + // entry is "ecoded" = it does NOT contain component adress, since it is a + // subject to change on next component loading + std::string entry = ip->encodeEntry( io->getEntry(), componentName ); + std::string param, vtkParam = vType.toLatin1().data(); vtkParam += gSeparator; - vtkParam += QString::number( *viewsCounter ).toLatin1().data(); + vtkParam += QString::number( *viewsCounter ).toLatin1().data(); vtkParam += gSeparator; - param = vtkParam + "Visibility"; - ip->setParameter( entry, param, "On" ); - param = vtkParam + "Name"; - ip->setParameter( entry, param, vActor->getName() ); - param = vtkParam + "RepresentationMode"; - ip->setParameter( entry, param, QString::number( vActor->GetRepresentation() ).toLatin1().data() ); - param = vtkParam + "Opacity"; - ip->setParameter( entry, param, QString::number( vActor->GetOpacity() ).toLatin1().data() ); - vtkFloatingPointType r, g, b; - vActor->GetColor(r, g, b); - QString colorStr = QString::number( r ); colorStr += gDigitsSep; - colorStr += QString::number( g ); colorStr += gDigitsSep; - colorStr += QString::number( b ); - param = vtkParam + "Color"; - ip->setParameter( entry, param, colorStr.toLatin1().data() ); - param = vtkParam + "LineWidth"; - ip->setParameter( entry, param, QString::number( vActor->GetLineWidth() ).toLatin1().data() ); - if ( vActor->IsShrunkable() && vActor->IsShrunk() ) { - param = vtkParam + "ShrinkMode"; - ip->setParameter( entry, param, "On" ); - param = vtkParam + "ShrinkFactor"; - ip->setParameter( entry, param, QString::number( vActor->GetShrinkFactor() ).toLatin1().data() ); - } - } - } // salome actor is downcasted to the VISU_PointMap3dActor - } // isVisible - } // end of ..while.. actors traversal - } // if ( vtkView ) + param = vtkParam + "Visibility"; + ip->setParameter( entry, param, "On" ); + param = vtkParam + "Name"; + ip->setParameter( entry, param, vActor->getName() ); + param = vtkParam + "RepresentationMode"; + ip->setParameter( entry, param, QString::number( vActor->GetRepresentation() ).toLatin1().data() ); + param = vtkParam + "Opacity"; + ip->setParameter( entry, param, QString::number( vActor->GetOpacity() ).toLatin1().data() ); + vtkFloatingPointType r, g, b; + vActor->GetColor(r, g, b); + QString colorStr = QString::number( r ); colorStr += gDigitsSep; + colorStr += QString::number( g ); colorStr += gDigitsSep; + colorStr += QString::number( b ); + param = vtkParam + "Color"; + ip->setParameter( entry, param, colorStr.toLatin1().data() ); + param = vtkParam + "LineWidth"; + ip->setParameter( entry, param, QString::number( vActor->GetLineWidth() ).toLatin1().data() ); + if ( vActor->IsShrunkable() && vActor->IsShrunk() ) { + param = vtkParam + "ShrinkMode"; + ip->setParameter( entry, param, "On" ); + param = vtkParam + "ShrinkFactor"; + ip->setParameter( entry, param, QString::number( vActor->GetShrinkFactor() ).toLatin1().data() ); + } + } + } // salome actor is downcasted to the VISU_PointMap3dActor + } // isVisible + } // end of ..while.. actors traversal + } // if ( vtkView ) } // for ( views ) (*viewsCounter)++; } // if ( SVTK view model ) else if ( vType == SPlot2d_Viewer::Type() ) { // processing Plot2d viewers QVector views = vman->getViews(); for ( int i = 0, iEnd = vman->getViewsCount(); i < iEnd; i++ ) { - if ( Plot2d_ViewWindow* plotView = dynamic_cast( views[i] ) ) { - Plot2d_ViewFrame* plotVF = plotView->getViewFrame(); - QList curves; + if ( Plot2d_ViewWindow* plotView = dynamic_cast( views[i] ) ) { + Plot2d_ViewFrame* plotVF = plotView->getViewFrame(); + QList curves; QList::Iterator itCurve; - plotVF->getCurves( curves ); - - //Plot2d_Curve* curve; - for ( itCurve = curves.begin(); itCurve != curves.end(); itCurve++ ) { - if ( SPlot2d_Curve* sCurve = dynamic_cast( *itCurve ) ) { - if ( sCurve->hasIO() ) { - - Handle(SALOME_InteractiveObject) io = sCurve->getIO(); - // entry is "ecoded" = it does NOT contain component adress, since it is a - // subject to change on next component loading - std::string entry = ip->encodeEntry( io->getEntry(), componentName ); - - std::string param, plotParam = vType.toLatin1().data(); plotParam += gSeparator; - plotParam += QString::number( *viewsCounter ).toLatin1().data(); plotParam += gSeparator; - - param = plotParam + "Visibility"; - ip->setParameter( entry, param, "On" ); - } - } - } // for curves - } // if ( plotView ) + plotVF->getCurves( curves ); + + //Plot2d_Curve* curve; + for ( itCurve = curves.begin(); itCurve != curves.end(); itCurve++ ) { + if ( SPlot2d_Curve* sCurve = dynamic_cast( *itCurve ) ) { + if ( sCurve->hasIO() ) { + + Handle(SALOME_InteractiveObject) io = sCurve->getIO(); + // entry is "ecoded" = it does NOT contain component adress, since it is a + // subject to change on next component loading + std::string entry = ip->encodeEntry( io->getEntry(), componentName ); + + std::string param, plotParam = vType.toLatin1().data(); plotParam += gSeparator; + plotParam += QString::number( *viewsCounter ).toLatin1().data(); plotParam += gSeparator; + + param = plotParam + "Visibility"; + ip->setParameter( entry, param, "On" ); + } + } + } // for curves + } // if ( plotView ) } // for ( views ) (*viewsCounter)++; } // if ( SPlot2d view model ) @@ -1890,15 +1890,15 @@ void VisuGUI_Module::restoreVisualParameters(int savePoint) // if ( *entIt == "GaussViewer" ) { // // parameter names are view window's captions, values - visual parameters. // for ( ; namesIt != paramNames.end(); ++namesIt, ++valuesIt ) { -// SUIT_ViewManager* vman = onCreateViewManager(); -// SUIT_ViewWindow* vwin = vman->getActiveView(); -// vwin->setWindowTitle( (*namesIt).c_str() ); +// SUIT_ViewManager* vman = onCreateViewManager(); +// SUIT_ViewWindow* vwin = vman->getActiveView(); +// vwin->setWindowTitle( (*namesIt).c_str() ); -// // wait untill the window is really shown. This step fixes MANY bugs.. -// while ( !vwin->isVisible() ) -// qApp->processEvents(); +// // wait untill the window is really shown. This step fixes MANY bugs.. +// while ( !vwin->isVisible() ) +// qApp->processEvents(); -// vwin->setVisualParameters( (*valuesIt).c_str() ); +// vwin->setVisualParameters( (*valuesIt).c_str() ); // } // continue; // skip to next entry // } @@ -1919,127 +1919,127 @@ void VisuGUI_Module::restoreVisualParameters(int savePoint) std::string viewIndexStr = ::getParam( *namesIt, ViewIndex ); int viewIndex = QString( viewIndexStr.c_str() ).toUInt( &ok ); if ( !ok ) // bad conversion of view index to integer - continue; + continue; // cout << " -- " << viewerType << ": entry = " << entry.latin1() << ", paramName = " << paramName << endl; if ( viewerType == SVTK_Viewer::Type().toLatin1().data() /*|| - viewerType == VVTK_Viewer::Type().toLatin1().data()*/ ) { - - // used as inner map key for locating the actor. - QString viewerTypeIndex = QString( viewerType.c_str() ) + QString::number( viewIndex ); - - if ( paramName == "Visibility" && displayer() ) { - // if VVTK, then we must create viewer first, because - - QList lst; - getApp()->viewManagers( viewerType.c_str(), lst ); - - // SVTK/VVTK ViewManager always has 1 ViewWindow, so view index is index of view manager - if ( viewIndex >= 0 && viewIndex < lst.count() ) { - SUIT_ViewManager* vman = lst.at( viewIndex ); - SUIT_ViewModel* vmodel = vman->getViewModel(); - // both SVTK and VVTK view models can be casted to SALOME_View - displayer()->Display( entry, true, dynamic_cast( vmodel ) ); - - // store displayed actor in a temporary map for quicker access later when restoring other parameters - SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) vman->getActiveView(); - QMap viewActorMap; - if ( vtkActors.contains( entry ) ) - viewActorMap = vtkActors[ entry ]; - viewActorMap[ viewerTypeIndex ] = FindActor( GetAppStudy(this), vtkView, entry ); - vtkActors[ entry ] = viewActorMap; - } - } - else { // the rest properties "work" with VISU_Actor, so we initialize it at first - VISU_Actor* vActor = 0; - if ( vtkActors.contains( entry ) ) { - QMap viewActorMap = vtkActors[ entry ]; - if ( viewActorMap.contains( viewerTypeIndex ) ) - vActor = viewActorMap[ viewerTypeIndex ]; - } - if ( !vActor ) - continue; - - QString val( (*valuesIt).c_str() ); - - if ( paramName == "Name" ) - vActor->setName( val.toLatin1().data() ); - - else if ( paramName == "RepresentationMode" ) - vActor->SetRepresentation( val.toInt() ); + viewerType == VVTK_Viewer::Type().toLatin1().data()*/ ) { + + // used as inner map key for locating the actor. + QString viewerTypeIndex = QString( viewerType.c_str() ) + QString::number( viewIndex ); + + if ( paramName == "Visibility" && displayer() ) { + // if VVTK, then we must create viewer first, because + + QList lst; + getApp()->viewManagers( viewerType.c_str(), lst ); + + // SVTK/VVTK ViewManager always has 1 ViewWindow, so view index is index of view manager + if ( viewIndex >= 0 && viewIndex < lst.count() ) { + SUIT_ViewManager* vman = lst.at( viewIndex ); + SUIT_ViewModel* vmodel = vman->getViewModel(); + // both SVTK and VVTK view models can be casted to SALOME_View + displayer()->Display( entry, true, dynamic_cast( vmodel ) ); + + // store displayed actor in a temporary map for quicker access later when restoring other parameters + SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) vman->getActiveView(); + QMap viewActorMap; + if ( vtkActors.contains( entry ) ) + viewActorMap = vtkActors[ entry ]; + viewActorMap[ viewerTypeIndex ] = FindActor( GetAppStudy(this), vtkView, entry ); + vtkActors[ entry ] = viewActorMap; + } + } + else { // the rest properties "work" with VISU_Actor, so we initialize it at first + VISU_Actor* vActor = 0; + if ( vtkActors.contains( entry ) ) { + QMap viewActorMap = vtkActors[ entry ]; + if ( viewActorMap.contains( viewerTypeIndex ) ) + vActor = viewActorMap[ viewerTypeIndex ]; + } + if ( !vActor ) + continue; + + QString val( (*valuesIt).c_str() ); + + if ( paramName == "Name" ) + vActor->setName( val.toLatin1().data() ); + + else if ( paramName == "RepresentationMode" ) + vActor->SetRepresentation( val.toInt() ); else if (paramName == "Quadratic2DRepresentation") vActor->SetQuadratic2DRepresentation(VISU_Actor::EQuadratic2DRepresentation(val.toInt())); - else if ( paramName == "Opacity" ) - vActor->SetOpacity( val.toFloat() ); - - else if ( paramName == "Color" ) { - QStringList colors = val.split( gDigitsSep, QString::SkipEmptyParts ); - if ( colors.count() == 3 ) - vActor->SetColor( colors[0].toFloat(), colors[1].toFloat(), colors[2].toFloat() ); - } - - else if ( paramName == "LineWidth" ) - vActor->SetLineWidth( val.toFloat() ); - - else if ( paramName == "ShrinkMode" ) { - vActor->SetShrinkable( true ); - vActor->SetShrink(); - } - - else if ( paramName == "ShrunkFactor" ) - vActor->SetShrinkFactor( val.toFloat() ); - - else if ( paramName == "Shading" ) { - if ( VISU_ScalarMapAct* scalarMapActor = dynamic_cast( vActor ) ) - scalarMapActor->SetShading(); - } - - else if ( paramName.find( "ClippingPlane" ) != std::string::npos ) { - VISU::Prs3d_i* prs = vActor->GetPrs3d(); - if ( !prs ) - continue; - - //prs->RemoveAllClippingPlanes(); - for (int i = prs->GetNumberOfClippingPlanes() - 1; i >= 0 ; i--) { - OrientedPlane* aPlane = dynamic_cast(prs->GetClippingPlane(i)); - if (aPlane) - prs->RemoveClippingPlane(i); - } - if ( val != "Off" ) { - QStringList vals = val.split( gDigitsSep, QString::SkipEmptyParts ); - if ( vals.count() == 6 ) { // format check: 6 float values - vtkFloatingPointType normal[3], origin[3]; - for (int x = 0; x < 3; x++ ) { - normal[x] = vals[x].toFloat(); - origin[x] = vals[x+3].toFloat(); - } - OrientedPlane* plane = OrientedPlane::New(); - plane->SetNormal( normal ); - plane->SetOrigin( origin ); - prs->AddClippingPlane( plane ); - plane->Delete(); - } - } - } - } // else .. + else if ( paramName == "Opacity" ) + vActor->SetOpacity( val.toFloat() ); + + else if ( paramName == "Color" ) { + QStringList colors = val.split( gDigitsSep, QString::SkipEmptyParts ); + if ( colors.count() == 3 ) + vActor->SetColor( colors[0].toFloat(), colors[1].toFloat(), colors[2].toFloat() ); + } + + else if ( paramName == "LineWidth" ) + vActor->SetLineWidth( val.toFloat() ); + + else if ( paramName == "ShrinkMode" ) { + vActor->SetShrinkable( true ); + vActor->SetShrink(); + } + + else if ( paramName == "ShrunkFactor" ) + vActor->SetShrinkFactor( val.toFloat() ); + + else if ( paramName == "Shading" ) { + if ( VISU_ScalarMapAct* scalarMapActor = dynamic_cast( vActor ) ) + scalarMapActor->SetShading(); + } + + else if ( paramName.find( "ClippingPlane" ) != std::string::npos ) { + VISU::Prs3d_i* prs = vActor->GetPrs3d(); + if ( !prs ) + continue; + + //prs->RemoveAllClippingPlanes(); + for (int i = prs->GetNumberOfClippingPlanes() - 1; i >= 0 ; i--) { + OrientedPlane* aPlane = dynamic_cast(prs->GetClippingPlane(i)); + if (aPlane) + prs->RemoveClippingPlane(i); + } + if ( val != "Off" ) { + QStringList vals = val.split( gDigitsSep, QString::SkipEmptyParts ); + if ( vals.count() == 6 ) { // format check: 6 float values + vtkFloatingPointType normal[3], origin[3]; + for (int x = 0; x < 3; x++ ) { + normal[x] = vals[x].toFloat(); + origin[x] = vals[x+3].toFloat(); + } + OrientedPlane* plane = OrientedPlane::New(); + plane->SetNormal( normal ); + plane->SetOrigin( origin ); + prs->AddClippingPlane( plane ); + plane->Delete(); + } + } + } + } // else .. } // if SVTK else if ( viewerType == SPlot2d_Viewer::Type().toLatin1().data() ) { - if ( paramName == "Visibility" && displayer() ) { - QList lst; - getApp()->viewManagers( viewerType.c_str(), lst ); + if ( paramName == "Visibility" && displayer() ) { + QList lst; + getApp()->viewManagers( viewerType.c_str(), lst ); - if ( viewIndex >= 0 && viewIndex < lst.count() ) { - SUIT_ViewManager* vman = lst.at( viewIndex ); - SUIT_ViewModel* vmodel = vman->getViewModel(); - // SVTK and VVTK view models can be casted to SALOME_View - displayer()->Display( entry, true, dynamic_cast( vmodel ) ); - } - } + if ( viewIndex >= 0 && viewIndex < lst.count() ) { + SUIT_ViewManager* vman = lst.at( viewIndex ); + SUIT_ViewModel* vmodel = vman->getViewModel(); + // SVTK and VVTK view models can be casted to SALOME_View + displayer()->Display( entry, true, dynamic_cast( vmodel ) ); + } + } } // if SPlot2d @@ -2054,7 +2054,7 @@ void VisuGUI_Module::restoreVisualParameters(int savePoint) if ( !vmodel ) continue; if ( vmodel->getType() == SVTK_Viewer::Type() /*|| // processing SVTK and VVTK viewers - vmodel->getType() == VVTK_Viewer::Type()*/ ) { // in the same way + vmodel->getType() == VVTK_Viewer::Type()*/ ) { // in the same way SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) (*it)->getActiveView(); vtkView->getRenderer()->ResetCameraClippingRange(); vtkView->Repaint(); @@ -2089,8 +2089,8 @@ void VisuGUI_Module::restoreVisualParameters(int savePoint) // if ( activeGaussViewer >= 0 && activeGaussViewer < lst.count() ) { // SUIT_ViewWindow* activeView = lst.at( activeGaussViewer )->getActiveView(); // if ( activeView ) { -// activeView->activateWindow(); -// //activeView->setFocus(); +// activeView->activateWindow(); +// //activeView->setFocus(); // } // } // } diff --git a/src/VISUGUI/VisuGUI_Module.h b/src/VISUGUI/VisuGUI_Module.h index 9d811a51..52ccb936 100644 --- a/src/VISUGUI/VisuGUI_Module.h +++ b/src/VISUGUI/VisuGUI_Module.h @@ -70,7 +70,7 @@ public: virtual SUIT_ViewManager* getViewManager(const QString& theType, - const bool theIsCreate); + const bool theIsCreate); virtual void diff --git a/src/VISUGUI/VisuGUI_NameDlg.cxx b/src/VISUGUI/VisuGUI_NameDlg.cxx index 9175303e..8c6300f8 100644 --- a/src/VISUGUI/VisuGUI_NameDlg.cxx +++ b/src/VISUGUI/VisuGUI_NameDlg.cxx @@ -49,7 +49,7 @@ using namespace std; */ VisuGUI_NameDlg::VisuGUI_NameDlg( QWidget* parent ) : QDialog( parent ? parent : SUIT_Session::session()->activeApplication()->desktop(), - Qt::WindowTitleHint | Qt::WindowSystemMenuHint )//,WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) + Qt::WindowTitleHint | Qt::WindowSystemMenuHint )//,WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) { setWindowTitle( tr("TLT_RENAME") ); setSizeGripEnabled( TRUE ); diff --git a/src/VISUGUI/VisuGUI_OffsetDlg.cxx b/src/VISUGUI/VisuGUI_OffsetDlg.cxx index ec2f95ee..1049e4c5 100644 --- a/src/VISUGUI/VisuGUI_OffsetDlg.cxx +++ b/src/VISUGUI/VisuGUI_OffsetDlg.cxx @@ -168,9 +168,9 @@ void VisuGUI_OffsetDlg::onSelectionChanged(){ QString anEntry(anIO->getEntry()); VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, anEntry.toLatin1().constData()); if(VISU::Prs3d_i* aPrsObject = VISU::GetPrs3dFromBase(anObjectInfo.myBase)) - addPresentation(aPrsObject); + addPresentation(aPrsObject); else if (VISU::PointMap3d_i* aPrs = dynamic_cast(anObjectInfo.myBase)) { - addPointMapPresentation(aPrs); + addPointMapPresentation(aPrs); } } } @@ -264,7 +264,7 @@ void VisuGUI_OffsetDlg::updateOffset (VISU::Prs3d_i* thePrs, vtkFloatingPointTyp if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) { if (SVTK_ViewWindow* vw = dynamic_cast(aViewWindow)) { if (VISU_Actor* anActor = VISU::FindActor(vw, thePrs)) { - anActor->SetPosition(theOffset); + anActor->SetPosition(theOffset); vw->onAdjustTrihedron(); vw->getRenderer()->ResetCameraClippingRange(); vw->Repaint(); @@ -292,11 +292,11 @@ void VisuGUI_OffsetDlg::updatePointMapOffset (VISU::PointMap3d_i* thePrs, vtkFlo for (int i = 0, iEnd = aViews.size(); i < iEnd; i++) { if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) { if (SVTK_ViewWindow* vw = dynamic_cast(aViewWindow)) { - vw->onAdjustTrihedron(); + vw->onAdjustTrihedron(); if (VISU_ActorBase* anActor = VISU::FindActorBase(vw, thePrs)) { anActor->SetPosition(theOffset); - vw->highlight(thePrs->GetIO(), 1); + vw->highlight(thePrs->GetIO(), 1); vw->getRenderer()->ResetCameraClippingRange(); vw->Repaint(); } diff --git a/src/VISUGUI/VisuGUI_OffsetDlg.h b/src/VISUGUI/VisuGUI_OffsetDlg.h index 82ec2534..71e034d0 100644 --- a/src/VISUGUI/VisuGUI_OffsetDlg.h +++ b/src/VISUGUI/VisuGUI_OffsetDlg.h @@ -45,8 +45,8 @@ struct OffsetStruct } OffsetStruct(vtkFloatingPointType theX, - vtkFloatingPointType theY, - vtkFloatingPointType theZ) + vtkFloatingPointType theY, + vtkFloatingPointType theZ) { myOffset[0] = theX; myOffset[1] = theY; diff --git a/src/VISUGUI/VisuGUI_Panel.cxx b/src/VISUGUI/VisuGUI_Panel.cxx index bf02fc76..85d15da6 100755 --- a/src/VISUGUI/VisuGUI_Panel.cxx +++ b/src/VISUGUI/VisuGUI_Panel.cxx @@ -83,9 +83,9 @@ public: \param theBtns panel buttons */ VisuGUI_Panel::VisuGUI_Panel( const QString& theName, - VisuGUI* theModule, - QWidget* theParent, - const int theBtns ) + VisuGUI* theModule, + QWidget* theParent, + const int theBtns ) : QtxDockWidget( true, theParent ), myModule( theModule ), myOK( 0 ), diff --git a/src/VISUGUI/VisuGUI_Panel.h b/src/VISUGUI/VisuGUI_Panel.h index 05f33c80..e7eedb4b 100755 --- a/src/VISUGUI/VisuGUI_Panel.h +++ b/src/VISUGUI/VisuGUI_Panel.h @@ -50,9 +50,9 @@ public: public: VisuGUI_Panel( const QString& theName, - VisuGUI* theModule, - QWidget* theParent = 0, - const int theBtns = AllBtn ); + VisuGUI* theModule, + QWidget* theParent = 0, + const int theBtns = AllBtn ); virtual ~VisuGUI_Panel(); virtual bool isValid( QString& theMessage ); diff --git a/src/VISUGUI/VisuGUI_Plot3DDlg.cxx b/src/VISUGUI/VisuGUI_Plot3DDlg.cxx index 23ac13b5..98954c00 100644 --- a/src/VISUGUI/VisuGUI_Plot3DDlg.cxx +++ b/src/VISUGUI/VisuGUI_Plot3DDlg.cxx @@ -652,7 +652,7 @@ void VisuGUI_Plot3DDlg::reject() //purpose : //======================================================================= void VisuGUI_Plot3DDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs, - bool theInit ) + bool theInit ) { if( theInit ) myPrsCopy = VISU::TSameAsFactory().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish); diff --git a/src/VISUGUI/VisuGUI_Plot3DDlg.h b/src/VISUGUI/VisuGUI_Plot3DDlg.h index e7acada1..c4823ef7 100644 --- a/src/VISUGUI/VisuGUI_Plot3DDlg.h +++ b/src/VISUGUI/VisuGUI_Plot3DDlg.h @@ -107,7 +107,7 @@ class VisuGUI_Plot3DDlg : public VisuGUI_ScalarBarBaseDlg ~VisuGUI_Plot3DDlg(); virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs, - bool theInit ); + bool theInit ); virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs); diff --git a/src/VISUGUI/VisuGUI_Prs3dDlg.h b/src/VISUGUI/VisuGUI_Prs3dDlg.h index be4b12d7..a0939bcf 100644 --- a/src/VISUGUI/VisuGUI_Prs3dDlg.h +++ b/src/VISUGUI/VisuGUI_Prs3dDlg.h @@ -105,9 +105,9 @@ class VisuGUI_BarPrefDlg: public QDialog ~VisuGUI_BarPrefDlg() {}; void setRatios(int titleRatioSize, int labelRatioWidth, - int barRatioWidth, int barRatioHeight); + int barRatioWidth, int barRatioHeight); void getRatios(int& titleRatioSize, int& labelRatioWidth, - int& barRatioWidth, int& barRatioHeight); + int& barRatioWidth, int& barRatioHeight); void setUnitsVisible(bool isVisible); bool isUnitsVisible(); @@ -262,7 +262,7 @@ class VisuGUI_Prs3dDlg : public QDialog ~VisuGUI_Prs3dDlg() {} virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs, - bool theInit ) = 0; + bool theInit ) = 0; virtual int storeToPrsObject( VISU::ColoredPrs3d_i* thePrs ) = 0; @@ -287,7 +287,7 @@ class VisuGUI_ScalarBarBaseDlg : public VisuGUI_Prs3dDlg ~VisuGUI_ScalarBarBaseDlg(); virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs, - bool theInit ); + bool theInit ); protected slots: void accept(); void reject(); diff --git a/src/VISUGUI/VisuGUI_Prs3dTools.h b/src/VISUGUI/VisuGUI_Prs3dTools.h index 96aab243..7fa0e657 100644 --- a/src/VISUGUI/VisuGUI_Prs3dTools.h +++ b/src/VISUGUI/VisuGUI_Prs3dTools.h @@ -47,44 +47,44 @@ namespace VISU template void EditPrs3d(VisuGUI* theModule, - Handle(SALOME_InteractiveObject)& theIO, - VISU::Prs3d_i* thePrs3d, - SVTK_ViewWindow* theViewWindow) + Handle(SALOME_InteractiveObject)& theIO, + VISU::Prs3d_i* thePrs3d, + SVTK_ViewWindow* theViewWindow) { if (TPrs3d_i* aPrs3d = dynamic_cast(thePrs3d)) { bool isModal = TIsDlgModal; if( ColoredPrs3d_i* aColoredPrs3d = dynamic_cast(aPrs3d) ) - if( !aColoredPrs3d->IsTimeStampFixed() ) - isModal = 0; + if( !aColoredPrs3d->IsTimeStampFixed() ) + isModal = 0; TDlg* aDlg = new TDlg (theModule); aDlg->initFromPrsObject(aPrs3d, true); if (runAndWait(aDlg,isModal)) { - if (!(aDlg->storeToPrsObject(aPrs3d))) { - delete aDlg; - return; - } - try { - aPrs3d->UpdateActors(); - } catch (std::runtime_error& exc) { - aPrs3d->RemoveActors(); - - INFOS(exc.what()); - SUIT_MessageBox::warning - (GetDesktop(theModule), QObject::tr("WRN_VISU"), - QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()) ); - } - if (theViewWindow) { - theViewWindow->getRenderer()->ResetCameraClippingRange(); - theViewWindow->Repaint(); - } - // Optionally, create table and curves for cut lines - QApplication::setOverrideCursor(Qt::WaitCursor); - CreateCurves( theModule, - dynamic_cast( aPrs3d ), - aDlg, - false ); // in edition mode - QApplication::restoreOverrideCursor(); + if (!(aDlg->storeToPrsObject(aPrs3d))) { + delete aDlg; + return; + } + try { + aPrs3d->UpdateActors(); + } catch (std::runtime_error& exc) { + aPrs3d->RemoveActors(); + + INFOS(exc.what()); + SUIT_MessageBox::warning + (GetDesktop(theModule), QObject::tr("WRN_VISU"), + QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()) ); + } + if (theViewWindow) { + theViewWindow->getRenderer()->ResetCameraClippingRange(); + theViewWindow->Repaint(); + } + // Optionally, create table and curves for cut lines + QApplication::setOverrideCursor(Qt::WaitCursor); + CreateCurves( theModule, + dynamic_cast( aPrs3d ), + aDlg, + false ); // in edition mode + QApplication::restoreOverrideCursor(); } delete aDlg; } @@ -95,9 +95,9 @@ namespace VISU template void EditPrs3d(VisuGUI* theModule, - Handle(SALOME_InteractiveObject)& theIO, - VISU::Prs3d_i* thePrs3d, - SVTK_ViewWindow* theViewWindow = NULL) + Handle(SALOME_InteractiveObject)& theIO, + VISU::Prs3d_i* thePrs3d, + SVTK_ViewWindow* theViewWindow = NULL) { SVTK_ViewWindow* aViewWindow = theViewWindow; if (!aViewWindow) @@ -113,79 +113,79 @@ namespace VISU template TPrs3d_i* CreatePrs3dFromFactory(VisuGUI* theModule, - _PTR(SObject) theTimeStamp, - const char* theMeshName, - VISU::Entity theEntity, - const char* theFieldName, - int theTimeId, - ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode) + _PTR(SObject) theTimeStamp, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + int theTimeId, + ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode) { VISU::Result_var aResult; if (CheckResult(theModule, theTimeStamp, aResult)){ QApplication::setOverrideCursor(Qt::WaitCursor); TPrs3d_i* aPrs3d = NULL; if(thePublishInStudyMode == VISU::ColoredPrs3d_i::EPublishUnderTimeStamp) - aPrs3d = VISU::CreatePrs3d(aResult, - theMeshName, - theEntity, - theFieldName, - theTimeId); + aPrs3d = VISU::CreatePrs3d(aResult, + theMeshName, + theEntity, + theFieldName, + theTimeId); else { - CORBA::Float anUsedMemory = 0.0; - CORBA::Float aRequiredMemory = 0.0; - VISU::ColoredPrs3dCache::EnlargeType anEnlargeType = - VISU::GetRequiredCacheMemory(aResult, - theMeshName, - theEntity, - theFieldName, - theTimeId, - anUsedMemory, - aRequiredMemory); - - if( anEnlargeType == VISU::ColoredPrs3dCache::IMPOSSIBLE ) - { - size_t aMb = 1024 * 1024; - double aFreeMemory = double(VISU_PipeLine::GetAvailableMemory(8192*aMb)) / double(aMb); - - CORBA::Float aNecessaryMemory = aRequiredMemory - aFreeMemory - anUsedMemory; - SUIT_MessageBox::warning(GetDesktop(theModule), - QObject::tr("WRN_VISU"), - QObject::tr("ERR_NO_MEMORY_TO_BUILD").arg(aNecessaryMemory) ); - QApplication::restoreOverrideCursor(); - return NULL; - } - else - { - if( anEnlargeType == VISU::ColoredPrs3dCache::ENLARGE ) - { - if(SUIT_MessageBox::information(GetDesktop(theModule), - QObject::tr("WRN_VISU"), - QObject::tr("WRN_EXTRA_MEMORY_REQUIRED").arg(aRequiredMemory), - QObject::tr("&OK"), QObject::tr("&Cancel"), - 0, 1) == 1) - { - QApplication::restoreOverrideCursor(); - return NULL; - } - } - aPrs3d = VISU::CreateHolder2GetDeviceByType(aResult, - theMeshName, - theEntity, - theFieldName, - theTimeId, - anEnlargeType, - aRequiredMemory); - } + CORBA::Float anUsedMemory = 0.0; + CORBA::Float aRequiredMemory = 0.0; + VISU::ColoredPrs3dCache::EnlargeType anEnlargeType = + VISU::GetRequiredCacheMemory(aResult, + theMeshName, + theEntity, + theFieldName, + theTimeId, + anUsedMemory, + aRequiredMemory); + + if( anEnlargeType == VISU::ColoredPrs3dCache::IMPOSSIBLE ) + { + size_t aMb = 1024 * 1024; + double aFreeMemory = double(VISU_PipeLine::GetAvailableMemory(8192*aMb)) / double(aMb); + + CORBA::Float aNecessaryMemory = aRequiredMemory - aFreeMemory - anUsedMemory; + SUIT_MessageBox::warning(GetDesktop(theModule), + QObject::tr("WRN_VISU"), + QObject::tr("ERR_NO_MEMORY_TO_BUILD").arg(aNecessaryMemory) ); + QApplication::restoreOverrideCursor(); + return NULL; + } + else + { + if( anEnlargeType == VISU::ColoredPrs3dCache::ENLARGE ) + { + if(SUIT_MessageBox::information(GetDesktop(theModule), + QObject::tr("WRN_VISU"), + QObject::tr("WRN_EXTRA_MEMORY_REQUIRED").arg(aRequiredMemory), + QObject::tr("&OK"), QObject::tr("&Cancel"), + 0, 1) == 1) + { + QApplication::restoreOverrideCursor(); + return NULL; + } + } + aPrs3d = VISU::CreateHolder2GetDeviceByType(aResult, + theMeshName, + theEntity, + theFieldName, + theTimeId, + anEnlargeType, + aRequiredMemory); + } } QApplication::restoreOverrideCursor(); if(aPrs3d) - return aPrs3d; + return aPrs3d; } SUIT_MessageBox::warning(GetDesktop(theModule), - QObject::tr("WRN_VISU"), - QObject::tr("ERR_CANT_BUILD_PRESENTATION") ); + QObject::tr("WRN_VISU"), + QObject::tr("ERR_CANT_BUILD_PRESENTATION") ); return NULL; } @@ -195,8 +195,8 @@ namespace VISU template TPrs3d_i* CreateAndEditPrs3d(VisuGUI* theModule, - _PTR(SObject) theTimeStamp, - ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode) + _PTR(SObject) theTimeStamp, + ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode) { Storable::TRestoringMap aRestoringMap = Storable::GetStorableMap(theTimeStamp); VISU::VISUType aType = VISU::Storable::RestoringMap2Type(aRestoringMap); @@ -220,55 +220,55 @@ namespace VISU TPrs3d_i* aPrs3d = CreatePrs3dFromFactory(theModule, - theTimeStamp, - (const char*)aMeshName.toLatin1(), - (Entity)anEntity.toInt(), - (const char*)aFieldName.toLatin1(), - aTimeStampId.toInt(), - thePublishInStudyMode); + theTimeStamp, + (const char*)aMeshName.toLatin1(), + (Entity)anEntity.toInt(), + (const char*)aFieldName.toLatin1(), + aTimeStampId.toInt(), + thePublishInStudyMode); QApplication::restoreOverrideCursor(); if (aPrs3d) { SUIT_ResourceMgr* aResourceMgr = GetResourceMgr(); int aValue = aResourceMgr->integerValue("VISU","BuildDefaultPrs3d",0); if(aResourceMgr->booleanValue("VISU","display_only",false)){ - theModule->OnEraseAll(); - } + theModule->OnEraseAll(); + } if (!aValue) { - if (TDlg* aDlg = new TDlg(theModule)) { // dialog box in creation mode - aDlg->initFromPrsObject(aPrs3d, true); - if (runAndWait(aDlg,IsDlgModal) && (aDlg->storeToPrsObject(aPrs3d))) { - if(aResourceMgr->booleanValue("VISU","display_only",false)){ - if(SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(theModule, false)) aPlot2d->EraseAll(); - } - // Optionally, create table and curves for cut lines - QApplication::setOverrideCursor(Qt::WaitCursor); - CreateCurves( theModule, - dynamic_cast( aPrs3d ), - aDlg, - true ); // in creation mode - UpdateObjBrowser(theModule,true,theTimeStamp); - QApplication::restoreOverrideCursor(); - delete aDlg; - } else { - if ( theModule->application() ) - DeletePrs3d(theModule,aPrs3d); - QApplication::restoreOverrideCursor(); - delete aDlg; - return NULL; - } - } + if (TDlg* aDlg = new TDlg(theModule)) { // dialog box in creation mode + aDlg->initFromPrsObject(aPrs3d, true); + if (runAndWait(aDlg,IsDlgModal) && (aDlg->storeToPrsObject(aPrs3d))) { + if(aResourceMgr->booleanValue("VISU","display_only",false)){ + if(SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(theModule, false)) aPlot2d->EraseAll(); + } + // Optionally, create table and curves for cut lines + QApplication::setOverrideCursor(Qt::WaitCursor); + CreateCurves( theModule, + dynamic_cast( aPrs3d ), + aDlg, + true ); // in creation mode + UpdateObjBrowser(theModule,true,theTimeStamp); + QApplication::restoreOverrideCursor(); + delete aDlg; + } else { + if ( theModule->application() ) + DeletePrs3d(theModule,aPrs3d); + QApplication::restoreOverrideCursor(); + delete aDlg; + return NULL; + } + } } // aViewWindow = GetViewWindow(theModule); IPAL 20125 dmv // Display created presentation. if (aViewWindow) { - PublishInView(theModule, aPrs3d, aViewWindow); + PublishInView(theModule, aPrs3d, aViewWindow); if(GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)){ - aViewWindow->onFitAll(); - } + aViewWindow->onFitAll(); + } - AddScalarBarPosition(theModule, aViewWindow, aPrs3d, aPos); + AddScalarBarPosition(theModule, aViewWindow, aPrs3d, aPos); } return aPrs3d; @@ -282,8 +282,8 @@ namespace VISU template TPrs3d_i* CreatePrs3dInViewer(VisuGUI* theModule, - _PTR(SObject) theTimeStampSObj, - ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode) + _PTR(SObject) theTimeStampSObj, + ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode) { TPrs3d_i* aPrs = 0; // Create new TViewWindow instance, if it does not exist. @@ -303,7 +303,7 @@ namespace VISU template TPrs3d_i* CreatePrs3d(VisuGUI* theModule, - const QString& theDesiredViewerType = QString()) + const QString& theDesiredViewerType = QString()) { TPrs3d_i* aPrs = 0; if (CheckLock(GetCStudy(GetAppStudy(theModule)),GetDesktop(theModule))) @@ -317,28 +317,28 @@ namespace VISU if(/*aPublishInStudyMode == */VISU::ColoredPrs3d_i::EPublishIndependently){ // CreatePrs3dInViewer - // (theModule,aTimeStampSObj,aPublishInStudyMode); + // (theModule,aTimeStampSObj,aPublishInStudyMode); aPrs = CreatePrs3dInViewer - (theModule,aTimeStampSObj,aPublishInStudyMode); + (theModule,aTimeStampSObj,aPublishInStudyMode); return aPrs; }else{ if(theDesiredViewerType.isNull()){ - if (/*SUIT_ViewManager* aViewManager = */theModule->getApp()->activeViewManager()) - /*if (aViewManager->getType() == VVTK_Viewer::Type()){ - aPrs = CreatePrs3dInViewer - (theModule,aTimeStampSObj,aPublishInStudyMode); - return aPrs; - }*/ - aPrs = CreatePrs3dInViewer - (theModule,aTimeStampSObj,aPublishInStudyMode); + if (/*SUIT_ViewManager* aViewManager = */theModule->getApp()->activeViewManager()) + /*if (aViewManager->getType() == VVTK_Viewer::Type()){ + aPrs = CreatePrs3dInViewer + (theModule,aTimeStampSObj,aPublishInStudyMode); + return aPrs; + }*/ + aPrs = CreatePrs3dInViewer + (theModule,aTimeStampSObj,aPublishInStudyMode); }else{ - /*if(theDesiredViewerType == VVTK_Viewer::Type()) { - aPrs = CreatePrs3dInViewer - (theModule,aTimeStampSObj,aPublishInStudyMode); - } else {*/ - aPrs = CreatePrs3dInViewer - (theModule,aTimeStampSObj,aPublishInStudyMode); - //} + /*if(theDesiredViewerType == VVTK_Viewer::Type()) { + aPrs = CreatePrs3dInViewer + (theModule,aTimeStampSObj,aPublishInStudyMode); + } else {*/ + aPrs = CreatePrs3dInViewer + (theModule,aTimeStampSObj,aPublishInStudyMode); + //} } } return aPrs; diff --git a/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx b/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx index 551e2b06..5bf97d0a 100644 --- a/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx +++ b/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx @@ -131,7 +131,7 @@ QString VisuGUI_ScalarBarDlg::GetContextHelpFilePath() Initialize dialog from the presentation */ void VisuGUI_ScalarBarDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs, - bool theInit ) + bool theInit ) { if( theInit ) myPrsCopy = VISU::TSameAsFactory().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish); diff --git a/src/VISUGUI/VisuGUI_ScalarBarDlg.h b/src/VISUGUI/VisuGUI_ScalarBarDlg.h index b5446e86..f7440805 100644 --- a/src/VISUGUI/VisuGUI_ScalarBarDlg.h +++ b/src/VISUGUI/VisuGUI_ScalarBarDlg.h @@ -49,7 +49,7 @@ class VisuGUI_ScalarBarDlg : public VisuGUI_ScalarBarBaseDlg ~VisuGUI_ScalarBarDlg(); virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs, - bool theInit ); + bool theInit ); virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs); diff --git a/src/VISUGUI/VisuGUI_Selection.cxx b/src/VISUGUI/VisuGUI_Selection.cxx index 381ad9bc..949679cf 100644 --- a/src/VISUGUI/VisuGUI_Selection.cxx +++ b/src/VISUGUI/VisuGUI_Selection.cxx @@ -301,15 +301,15 @@ QString VisuGUI_Selection::medSource( const int ind ) const Result_i::ECreationId aCreationId = aResult->GetCreationId(); switch(aCreationId){ case Result_i::eImportFile : - return "eImportFile"; + return "eImportFile"; case Result_i::eCopyAndImportFile : - return "eCopyAndImportFile"; + return "eCopyAndImportFile"; case Result_i::eImportMed : - return "eImportMed"; + return "eImportMed"; case Result_i::eImportMedField : - return "eImportMedField"; + return "eImportMedField"; default: - return QString(); + return QString(); } } } @@ -340,13 +340,13 @@ struct TPopupDispatcher { QString operator()(const SalomeApp_Module* theModule, - const QString& theEntry) + const QString& theEntry) { if(SUIT_ViewManager* aViewManager = theModule->getApp()->activeViewManager()){ QString aType = aViewManager->getType(); TPopupFunctor aFunctor; if(aType == SVTK_Viewer::Type()) - return aFunctor.template Get(theModule, theEntry); + return aFunctor.template Get(theModule, theEntry); //else if(aType == VVTK_Viewer::Type()) //return aFunctor.template Get(theModule, theEntry); } @@ -359,10 +359,10 @@ struct TPopupDispatcher template bool GetPrs3dSelectionInfo(const SalomeApp_Module* theModule, - const QString& theEntry, - VISU::Prs3d_i*& thePrs3d, - SVTK_ViewWindow*& theViewWindow, - VISU_Actor*& thenActor) + const QString& theEntry, + VISU::Prs3d_i*& thePrs3d, + SVTK_ViewWindow*& theViewWindow, + VISU_Actor*& thenActor) { VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(theModule), (const char*)theEntry.toLatin1()); thePrs3d = GetPrs3dFromBase(anObjectInfo.myBase); @@ -401,7 +401,7 @@ struct TViewFunctor aViewWindow = GetActiveViewWindow(theModule); VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(theModule); if ( aSelectionInfo.empty() ) - return QString(); + return QString(); VISU::TSelectionItem aSelectionItem = aSelectionInfo.front(); aPointMap3d = dynamic_cast(aSelectionItem.myObjectInfo.myBase); anActorBase = VISU::FindActorBase(aViewWindow, aPointMap3d); @@ -421,8 +421,8 @@ struct TViewFunctor QString virtual getPointMap(VISU::PointMap3d_i* thePrs3d, - SVTK_ViewWindow* theViewWindow, - VISU_ActorBase* theActor) + SVTK_ViewWindow* theViewWindow, + VISU_ActorBase* theActor) { return QString(); } @@ -453,14 +453,14 @@ struct TGetRepesentationFunctor: TViewFunctor QString virtual getPointMap(VISU::PointMap3d_i* thePrs3d, - SVTK_ViewWindow* theViewWindow, - VISU_ActorBase* theActorBase) + SVTK_ViewWindow* theViewWindow, + VISU_ActorBase* theActorBase) { QString aResStr = ""; if (theActorBase) { switch (theActorBase->GetRepresentation()) { - ENUM2STRING( aResStr, VISU::WIREFRAME ); // = 1 - ENUM2STRING( aResStr, VISU::SHADED ); // = 2 + ENUM2STRING( aResStr, VISU::WIREFRAME ); // = 1 + ENUM2STRING( aResStr, VISU::SHADED ); // = 2 } } return aResStr; @@ -492,9 +492,9 @@ int VisuGUI_Selection::nbChild( const int ind, const bool named ) const _PTR(SObject) SO = aStudy->FindObjectID( (const char*)entry( ind ).toLatin1() ); if ( SO ){ for ( _PTR(ChildIterator) Iter = aStudy->NewChildIterator( SO ); Iter->More(); Iter->Next() ) { - _PTR(SObject) refSO; - if ( !Iter->Value()->ReferencedObject( refSO ) && ( !named || Iter->Value()->GetName().size() ) ) - cnt++; + _PTR(SObject) refSO; + if ( !Iter->Value()->ReferencedObject( refSO ) && ( !named || Iter->Value()->GetName().size() ) ) + cnt++; } } } @@ -548,8 +548,8 @@ struct TIsShrunkFunctor: TViewFunctor QString virtual getPointMap(VISU::PointMap3d_i* thePointMap, - SVTK_ViewWindow* theViewWindow, - VISU_ActorBase* theActorBase) + SVTK_ViewWindow* theViewWindow, + VISU_ActorBase* theActorBase) { if (theActorBase) return theActorBase->IsShrunk() ? "1" : "0"; @@ -663,17 +663,17 @@ bool VisuGUI_Selection::findDisplayedCurves( const int ind, bool findHidden ) co _PTR(SObject) SO = aStudy->FindObjectID( (const char*) entry( ind ).toLatin1() ); if ( SO ){ for ( _PTR(ChildIterator) Iter = aStudy->NewChildIterator( SO ); Iter->More(); Iter->Next() ) { - _PTR(SObject) refSO; - if ( Iter->Value()->ReferencedObject(refSO) ) - entryId = refSO->GetID().c_str(); - else - entryId = Iter->Value()->GetID().c_str(); - - LightApp_Displayer* displayer = LightApp_Displayer::FindDisplayer( myModule->moduleName(), false ); - if ( displayer->IsDisplayed( entryId ) && findHidden == false ) - return true; - else if ( !displayer->IsDisplayed( entryId ) && findHidden == true ) - return true; + _PTR(SObject) refSO; + if ( Iter->Value()->ReferencedObject(refSO) ) + entryId = refSO->GetID().c_str(); + else + entryId = Iter->Value()->GetID().c_str(); + + LightApp_Displayer* displayer = LightApp_Displayer::FindDisplayer( myModule->moduleName(), false ); + if ( displayer->IsDisplayed( entryId ) && findHidden == false ) + return true; + else if ( !displayer->IsDisplayed( entryId ) && findHidden == true ) + return true; } } } @@ -693,19 +693,19 @@ bool VisuGUI_Selection::hasCurves( const int ind ) const _PTR(SObject) SO = aStudy->FindObjectID( (const char*) entry( ind ).toLatin1() ); if ( SO ){ for ( _PTR(ChildIterator) Iter = aStudy->NewChildIterator( SO ); Iter->More(); Iter->Next() ) { - _PTR(SObject) refSO; - if ( Iter->Value()->ReferencedObject(refSO) ) { - // reference on curve - } - else - refSO = Iter->Value(); - - CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(refSO); - if(!CORBA::is_nil(aCORBAObject)){ - PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject); - if(dynamic_cast(aServant.in())) - return true; - } + _PTR(SObject) refSO; + if ( Iter->Value()->ReferencedObject(refSO) ) { + // reference on curve + } + else + refSO = Iter->Value(); + + CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(refSO); + if(!CORBA::is_nil(aCORBAObject)){ + PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject); + if(dynamic_cast(aServant.in())) + return true; + } } } } @@ -722,9 +722,9 @@ bool VisuGUI_Selection::Plot2dViewerType( const int ind ) const if( SUIT_ViewManager* vman = sApp->activeViewManager() ) if( SUIT_ViewModel* vmod = vman->getViewModel() ) { viewerType = vmod->getType(); - if (viewerType ==SPlot2d_Viewer::Type()) - return true; - } + if (viewerType ==SPlot2d_Viewer::Type()) + return true; + } return false; } diff --git a/src/VISUGUI/VisuGUI_SelectionPanel.cxx b/src/VISUGUI/VisuGUI_SelectionPanel.cxx index 6413a1d8..943acf03 100644 --- a/src/VISUGUI/VisuGUI_SelectionPanel.cxx +++ b/src/VISUGUI/VisuGUI_SelectionPanel.cxx @@ -268,7 +268,7 @@ VisuGUI_SelectionPanel::VisuGUI_SelectionPanel( VisuGUI* theModule, QWidget* the { int aColumnId = aColumnIter.next(); if( aColumnId >= 0 && aColumnId < aColumnHeaders.size() ) - aHorizontalHeaderLabels << aColumnHeaders[ aColumnId ]; + aHorizontalHeaderLabels << aColumnHeaders[ aColumnId ]; } aTable->setColumnCount( aHorizontalHeaderLabels.size() ); aTable->setHorizontalHeaderLabels( aHorizontalHeaderLabels ); @@ -278,7 +278,7 @@ VisuGUI_SelectionPanel::VisuGUI_SelectionPanel( VisuGUI* theModule, QWidget* the aTable->resizeColumnsToContents(); connect( aTable, SIGNAL( doubleClicked( const QModelIndex& ) ), - this, SLOT( onDoubleClicked( const QModelIndex& ) ) ); + this, SLOT( onDoubleClicked( const QModelIndex& ) ) ); } // Actor Pane @@ -341,7 +341,7 @@ VisuGUI_SelectionPanel::VisuGUI_SelectionPanel( VisuGUI* theModule, QWidget* the TopLayout->addWidget( aPrefBtn ); connect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), - this, SLOT( onSelectionEvent() ) ); + this, SLOT( onSelectionEvent() ) ); connect( this, SIGNAL( selectionModeChanged( int ) ), myModule, SLOT( OnSwitchSelectionMode( int ) ) ); @@ -486,7 +486,7 @@ template TValueData getValueData( TPointID thePointVTKID, VISU_Acto } TPointData getPointData( TPointID thePointVTKID, VISU_Actor* theActor, const VISU::PIDMapper& theMapper, - bool theIsValueData ) + bool theIsValueData ) { TPointData aPointData; @@ -559,8 +559,8 @@ void VisuGUI_SelectionPanel::onSelectionEvent() { if (aSObject) { VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(aSObject); if (!aMap.empty()) { - aMeshName = VISU::Storable::FindValue(aMap, "myMeshName"); - aFieldName = VISU::Storable::FindValue(aMap, "myFieldName"); + aMeshName = VISU::Storable::FindValue(aMap, "myMeshName"); + aFieldName = VISU::Storable::FindValue(aMap, "myFieldName"); } } @@ -599,69 +599,69 @@ void VisuGUI_SelectionPanel::onSelectionEvent() { int anID = aMapIndex(ind); switch( aType ) - { + { case 1: - { - if( aSingleSelection ) - myCellIDValLbl->setText( QString::number( anID ) ); + { + if( aSingleSelection ) + myCellIDValLbl->setText( QString::number( anID ) ); vtkCell* aCell = anVISUActor->GetElemCell( anID ); - int aCellVTKID = anVISUActor->GetElemVTKID( anID ); + int aCellVTKID = anVISUActor->GetElemVTKID( anID ); if( !aCell || aCellVTKID < 0 ) - break; - - int aNbOfPoints = aCell->GetNumberOfPoints(); - if( aNbOfPoints < 1 ) - break; - - TPointDataMap aPointDataMap; - - vtkIdList* aPointList = aCell->GetPointIds(); - for( int i = 0; i < aNbOfPoints; i++ ) - { - int aPointVTKID = aPointList->GetId(i); - - TPointID aPointID = anVISUActor->GetNodeObjId( aPointVTKID ); - TPointData aPointData = getPointData( aPointVTKID, anVISUActor, aMapper, true ); - aPointDataMap[ aPointID ] = aPointData; - aGlobalPointDataMap[ aPointID ] = aPointData; - } - - TCellToPointData aCellToPointData; - aCellToPointData.CellData = getValueData( aCellVTKID, anVISUActor, aDataSet->GetCellData() ); - aCellToPointData.PointDataMap = aPointDataMap; - aCellToPointDataMap[ anID ] = aCellToPointData; - break; + break; + + int aNbOfPoints = aCell->GetNumberOfPoints(); + if( aNbOfPoints < 1 ) + break; + + TPointDataMap aPointDataMap; + + vtkIdList* aPointList = aCell->GetPointIds(); + for( int i = 0; i < aNbOfPoints; i++ ) + { + int aPointVTKID = aPointList->GetId(i); + + TPointID aPointID = anVISUActor->GetNodeObjId( aPointVTKID ); + TPointData aPointData = getPointData( aPointVTKID, anVISUActor, aMapper, true ); + aPointDataMap[ aPointID ] = aPointData; + aGlobalPointDataMap[ aPointID ] = aPointData; + } + + TCellToPointData aCellToPointData; + aCellToPointData.CellData = getValueData( aCellVTKID, anVISUActor, aDataSet->GetCellData() ); + aCellToPointData.PointDataMap = aPointDataMap; + aCellToPointDataMap[ anID ] = aCellToPointData; + break; } case 2: { - if( aSingleSelection ) - myIDValLbl->setText( QString::number( anID ) ); - - int aPointVTKID = anVISUActor->GetNodeVTKID( anID ); - if( aPointVTKID < 0 ) - break; - - TCellDataMap aCellDataMap; - - VISU::TElnoPoints anElnoPoints = VISU::GetElnoPoints( aDataSet, anID ); - VISU::TElnoPoints::iterator anElnoIter = anElnoPoints.begin(); - for( ; anElnoIter != anElnoPoints.end(); anElnoIter++ ) - { - VISU::TElnoPointID anElnoPointID = *anElnoIter; - VISU::TVTKPointID aVTKPointID = anElnoPointID.first; - VISU::TVTKCellID aVTKCellID = anElnoPointID.second; - - TCellID aCellID = anVISUActor->GetElemObjId( aVTKCellID ); - TValueData aValueData = getValueData( aVTKPointID, anVISUActor, aDataSet->GetPointData() ); - aCellDataMap[ aCellID ] = aValueData; - } - - TPointToCellData aPointToCellData; - aPointToCellData.PointData = getPointData( aPointVTKID, anVISUActor, aMapper, !isElno ); - aPointToCellData.CellDataMap = aCellDataMap; - aPointToCellDataMap[ anID ] = aPointToCellData; - break; + if( aSingleSelection ) + myIDValLbl->setText( QString::number( anID ) ); + + int aPointVTKID = anVISUActor->GetNodeVTKID( anID ); + if( aPointVTKID < 0 ) + break; + + TCellDataMap aCellDataMap; + + VISU::TElnoPoints anElnoPoints = VISU::GetElnoPoints( aDataSet, anID ); + VISU::TElnoPoints::iterator anElnoIter = anElnoPoints.begin(); + for( ; anElnoIter != anElnoPoints.end(); anElnoIter++ ) + { + VISU::TElnoPointID anElnoPointID = *anElnoIter; + VISU::TVTKPointID aVTKPointID = anElnoPointID.first; + VISU::TVTKCellID aVTKCellID = anElnoPointID.second; + + TCellID aCellID = anVISUActor->GetElemObjId( aVTKCellID ); + TValueData aValueData = getValueData( aVTKPointID, anVISUActor, aDataSet->GetPointData() ); + aCellDataMap[ aCellID ] = aValueData; + } + + TPointToCellData aPointToCellData; + aPointToCellData.PointData = getPointData( aPointVTKID, anVISUActor, aMapper, !isElno ); + aPointToCellData.CellDataMap = aCellDataMap; + aPointToCellDataMap[ anID ] = aPointToCellData; + break; } } } @@ -671,197 +671,197 @@ void VisuGUI_SelectionPanel::onSelectionEvent() { switch( aType ) { case 1: - if( isElno ) - aTableIds.append( CellElno ); - else - { - aTableIds.append( CellStdCell ); - aTableIds.append( CellStdPoint ); - } - break; + if( isElno ) + aTableIds.append( CellElno ); + else + { + aTableIds.append( CellStdCell ); + aTableIds.append( CellStdPoint ); + } + break; case 2: - aTableIds.append( isElno ? PointElno : PointStd ); - break; + aTableIds.append( isElno ? PointElno : PointStd ); + break; } QListIterator aTableIter( aTableIds ); while( aTableIter.hasNext() ) { - int aTableId = aTableIter.next(); - if( !myTables.contains( aTableId ) ) - continue; - - QTableWidget* aTable = myTables[ aTableId ]; - if( !aTable ) - continue; - - int aRow = -1; - switch( aTableId ) - { - case CellStdPoint: - { - int aRowCount = aGlobalPointDataMap.size(); - aTable->setRowCount( aRowCount ); - - TPointDataMap::const_iterator aPointIter = aGlobalPointDataMap.begin(); - for( ; aPointIter != aGlobalPointDataMap.end(); aPointIter++ ) - { - aRow++; - TPointID aPointID = aPointIter.key(); - const TPointData& aPointData = aPointIter.value(); - const TValueData& aValueData = aPointData.ValueData; - - setData( aTableId, aRow, Point, aPointID ); - setData( aTableId, aRow, X, aPointData.X ); - setData( aTableId, aRow, Y, aPointData.Y ); - setData( aTableId, aRow, Z, aPointData.Z ); - setData( aTableId, aRow, I, aPointData.I ); - setData( aTableId, aRow, J, aPointData.J ); - setData( aTableId, aRow, K, aPointData.K ); - setData( aTableId, aRow, Scalar, aValueData.Scalar ); - setData( aTableId, aRow, Vector, aValueData.Vector ); - } - break; - } - case CellStdCell: - case CellElno: - { - int aRowCount = 0; - TCellToPointDataMap::const_iterator aCellToPointIter = aCellToPointDataMap.begin(); - for( ; aCellToPointIter != aCellToPointDataMap.end(); aCellToPointIter++ ) - { - if( aTableId == CellStdCell ) - aRowCount++; - else if( aTableId == CellElno ) - { - const TCellToPointData& aCellToPointData = aCellToPointIter.value(); - const TPointDataMap& aPointDataMap = aCellToPointData.PointDataMap; - int aNbPoints = aPointDataMap.size(); - - aRowCount += aNbPoints; - } - } - aTable->setRowCount( aRowCount ); - - aCellToPointIter = aCellToPointDataMap.begin(); - for( ; aCellToPointIter != aCellToPointDataMap.end(); aCellToPointIter++ ) - { - aRow++; - - TCellID aCellID = aCellToPointIter.key(); - const TCellToPointData& aCellToPointData = aCellToPointIter.value(); - const TValueData& aCellData = aCellToPointData.CellData; - - setData( aTableId, aRow, Cell, aCellID ); - if( aTableId == CellStdCell ) - { - setData( aTableId, aRow, Scalar, aCellData.Scalar ); - setData( aTableId, aRow, Vector, aCellData.Vector ); - } - else if( aTableId == CellElno ) - { - const TPointDataMap& aPointDataMap = aCellToPointData.PointDataMap; - int aNbPoints = aPointDataMap.size(); - if( aNbPoints > 1 ) - setRowSpan( aTableId, aRow, Cell, aNbPoints ); - - TPointDataMap::const_iterator aPointIter = aPointDataMap.begin(); - for( aRow--; aPointIter != aPointDataMap.end(); aPointIter++ ) - { - aRow++; - TPointID aPointID = aPointIter.key(); - const TPointData& aPointData = aPointIter.value(); - const TValueData& aValueData = aPointData.ValueData; - - setData( aTableId, aRow, Point, aPointID ); - setData( aTableId, aRow, X, aPointData.X ); - setData( aTableId, aRow, Y, aPointData.Y ); - setData( aTableId, aRow, Z, aPointData.Z ); - setData( aTableId, aRow, I, aPointData.I ); - setData( aTableId, aRow, J, aPointData.J ); - setData( aTableId, aRow, K, aPointData.K ); - setData( aTableId, aRow, Scalar, aValueData.Scalar ); - setData( aTableId, aRow, Vector, aValueData.Vector ); - } - } - } - break; - } - case PointStd: - case PointElno: - { - int aRowCount = 0; - TPointToCellDataMap::const_iterator aPointToCellIter = aPointToCellDataMap.begin(); - for( ; aPointToCellIter != aPointToCellDataMap.end(); aPointToCellIter++ ) - { - const TPointToCellData& aPointToCellData = aPointToCellIter.value(); - const TCellDataMap& aCellDataMap = aPointToCellData.CellDataMap; - int aNbCells = aCellDataMap.size(); - if( aNbCells > 1 ) - aRowCount += aNbCells; - else - aRowCount++; - } - aTable->setRowCount( aRowCount ); - - aPointToCellIter = aPointToCellDataMap.begin(); - for( ; aPointToCellIter != aPointToCellDataMap.end(); aPointToCellIter++ ) - { - aRow++; - - TPointID aPointID = aPointToCellIter.key(); - const TPointToCellData& aPointToCellData = aPointToCellIter.value(); - const TPointData& aPointData = aPointToCellData.PointData; - - setData( aTableId, aRow, Point, aPointID ); - setData( aTableId, aRow, X, aPointData.X ); - setData( aTableId, aRow, Y, aPointData.Y ); - setData( aTableId, aRow, Z, aPointData.Z ); - setData( aTableId, aRow, I, aPointData.I ); - setData( aTableId, aRow, J, aPointData.J ); - setData( aTableId, aRow, K, aPointData.K ); - - if( aTableId == PointElno ) - { - const TCellDataMap& aCellDataMap = aPointToCellData.CellDataMap; - int aNbCells = aCellDataMap.size(); - if( aNbCells > 1 ) - for( int aColumnId = Point; aColumnId <= K; aColumnId++ ) - setRowSpan( aTableId, aRow, aColumnId, aNbCells ); - - TCellDataMap::const_iterator aCellIter = aCellDataMap.begin(); - for( aRow--; aCellIter != aCellDataMap.end(); aCellIter++ ) - { - aRow++; - TCellID aCellID = aCellIter.key(); - const TValueData& aCellData = aCellIter.value(); - - setData( aTableId, aRow, Cell, aCellID ); - setData( aTableId, aRow, Scalar, aCellData.Scalar ); - setData( aTableId, aRow, Vector, aCellData.Vector ); - } - } - else - { - const TValueData& aValueData = aPointData.ValueData; - setData( aTableId, aRow, Scalar, aValueData.Scalar ); - setData( aTableId, aRow, Vector, aValueData.Vector ); - } - } - break; - } - } - - for( int aCol = column( aTableId, I ), aLastCol = column( aTableId, K ); aCol <= aLastCol; aCol++ ) - if( aCol != -1 ) - aTable->setColumnHidden( aCol, !isStructured ); - aTable->resizeColumnsToContents(); + int aTableId = aTableIter.next(); + if( !myTables.contains( aTableId ) ) + continue; + + QTableWidget* aTable = myTables[ aTableId ]; + if( !aTable ) + continue; + + int aRow = -1; + switch( aTableId ) + { + case CellStdPoint: + { + int aRowCount = aGlobalPointDataMap.size(); + aTable->setRowCount( aRowCount ); + + TPointDataMap::const_iterator aPointIter = aGlobalPointDataMap.begin(); + for( ; aPointIter != aGlobalPointDataMap.end(); aPointIter++ ) + { + aRow++; + TPointID aPointID = aPointIter.key(); + const TPointData& aPointData = aPointIter.value(); + const TValueData& aValueData = aPointData.ValueData; + + setData( aTableId, aRow, Point, aPointID ); + setData( aTableId, aRow, X, aPointData.X ); + setData( aTableId, aRow, Y, aPointData.Y ); + setData( aTableId, aRow, Z, aPointData.Z ); + setData( aTableId, aRow, I, aPointData.I ); + setData( aTableId, aRow, J, aPointData.J ); + setData( aTableId, aRow, K, aPointData.K ); + setData( aTableId, aRow, Scalar, aValueData.Scalar ); + setData( aTableId, aRow, Vector, aValueData.Vector ); + } + break; + } + case CellStdCell: + case CellElno: + { + int aRowCount = 0; + TCellToPointDataMap::const_iterator aCellToPointIter = aCellToPointDataMap.begin(); + for( ; aCellToPointIter != aCellToPointDataMap.end(); aCellToPointIter++ ) + { + if( aTableId == CellStdCell ) + aRowCount++; + else if( aTableId == CellElno ) + { + const TCellToPointData& aCellToPointData = aCellToPointIter.value(); + const TPointDataMap& aPointDataMap = aCellToPointData.PointDataMap; + int aNbPoints = aPointDataMap.size(); + + aRowCount += aNbPoints; + } + } + aTable->setRowCount( aRowCount ); + + aCellToPointIter = aCellToPointDataMap.begin(); + for( ; aCellToPointIter != aCellToPointDataMap.end(); aCellToPointIter++ ) + { + aRow++; + + TCellID aCellID = aCellToPointIter.key(); + const TCellToPointData& aCellToPointData = aCellToPointIter.value(); + const TValueData& aCellData = aCellToPointData.CellData; + + setData( aTableId, aRow, Cell, aCellID ); + if( aTableId == CellStdCell ) + { + setData( aTableId, aRow, Scalar, aCellData.Scalar ); + setData( aTableId, aRow, Vector, aCellData.Vector ); + } + else if( aTableId == CellElno ) + { + const TPointDataMap& aPointDataMap = aCellToPointData.PointDataMap; + int aNbPoints = aPointDataMap.size(); + if( aNbPoints > 1 ) + setRowSpan( aTableId, aRow, Cell, aNbPoints ); + + TPointDataMap::const_iterator aPointIter = aPointDataMap.begin(); + for( aRow--; aPointIter != aPointDataMap.end(); aPointIter++ ) + { + aRow++; + TPointID aPointID = aPointIter.key(); + const TPointData& aPointData = aPointIter.value(); + const TValueData& aValueData = aPointData.ValueData; + + setData( aTableId, aRow, Point, aPointID ); + setData( aTableId, aRow, X, aPointData.X ); + setData( aTableId, aRow, Y, aPointData.Y ); + setData( aTableId, aRow, Z, aPointData.Z ); + setData( aTableId, aRow, I, aPointData.I ); + setData( aTableId, aRow, J, aPointData.J ); + setData( aTableId, aRow, K, aPointData.K ); + setData( aTableId, aRow, Scalar, aValueData.Scalar ); + setData( aTableId, aRow, Vector, aValueData.Vector ); + } + } + } + break; + } + case PointStd: + case PointElno: + { + int aRowCount = 0; + TPointToCellDataMap::const_iterator aPointToCellIter = aPointToCellDataMap.begin(); + for( ; aPointToCellIter != aPointToCellDataMap.end(); aPointToCellIter++ ) + { + const TPointToCellData& aPointToCellData = aPointToCellIter.value(); + const TCellDataMap& aCellDataMap = aPointToCellData.CellDataMap; + int aNbCells = aCellDataMap.size(); + if( aNbCells > 1 ) + aRowCount += aNbCells; + else + aRowCount++; + } + aTable->setRowCount( aRowCount ); + + aPointToCellIter = aPointToCellDataMap.begin(); + for( ; aPointToCellIter != aPointToCellDataMap.end(); aPointToCellIter++ ) + { + aRow++; + + TPointID aPointID = aPointToCellIter.key(); + const TPointToCellData& aPointToCellData = aPointToCellIter.value(); + const TPointData& aPointData = aPointToCellData.PointData; + + setData( aTableId, aRow, Point, aPointID ); + setData( aTableId, aRow, X, aPointData.X ); + setData( aTableId, aRow, Y, aPointData.Y ); + setData( aTableId, aRow, Z, aPointData.Z ); + setData( aTableId, aRow, I, aPointData.I ); + setData( aTableId, aRow, J, aPointData.J ); + setData( aTableId, aRow, K, aPointData.K ); + + if( aTableId == PointElno ) + { + const TCellDataMap& aCellDataMap = aPointToCellData.CellDataMap; + int aNbCells = aCellDataMap.size(); + if( aNbCells > 1 ) + for( int aColumnId = Point; aColumnId <= K; aColumnId++ ) + setRowSpan( aTableId, aRow, aColumnId, aNbCells ); + + TCellDataMap::const_iterator aCellIter = aCellDataMap.begin(); + for( aRow--; aCellIter != aCellDataMap.end(); aCellIter++ ) + { + aRow++; + TCellID aCellID = aCellIter.key(); + const TValueData& aCellData = aCellIter.value(); + + setData( aTableId, aRow, Cell, aCellID ); + setData( aTableId, aRow, Scalar, aCellData.Scalar ); + setData( aTableId, aRow, Vector, aCellData.Vector ); + } + } + else + { + const TValueData& aValueData = aPointData.ValueData; + setData( aTableId, aRow, Scalar, aValueData.Scalar ); + setData( aTableId, aRow, Vector, aValueData.Vector ); + } + } + break; + } + } + + for( int aCol = column( aTableId, I ), aLastCol = column( aTableId, K ); aCol <= aLastCol; aCol++ ) + if( aCol != -1 ) + aTable->setColumnHidden( aCol, !isStructured ); + aTable->resizeColumnsToContents(); } int stackId = isElno ? ElnoMesh : StdMesh; QStackedWidget* aStackedWg = aType == 1 ? myCellStackedWg : aType == 2 ? myPointStackedWg : 0; if( aStackedWg ) - aStackedWg->setCurrentIndex( stackId ); + aStackedWg->setCurrentIndex( stackId ); } } myFl = false; @@ -901,7 +901,7 @@ typedef vtkIdType (VISU_PipeLine::* TGetVTKIdMethod)(vtkIdType theID); bool onIdEdit (const QString& theText, TGetVTKIdMethod theMethod, bool theIsCell, - const SalomeApp_Module* theModule, + const SalomeApp_Module* theModule, QLabel* theMeshName, QString theValue, QLabel* theFieldName) @@ -943,7 +943,7 @@ bool onIdEdit (const QString& theText, { int aVTKId = (aPipeLine->*theMethod)(anObjId); if(aVTKId < 0) - return false; + return false; TColStd_MapOfInteger newIndices; newIndices.Add(anObjId); @@ -955,7 +955,7 @@ bool onIdEdit (const QString& theText, SVTK_RenderWindowInteractor* anInteractor = aViewWindow->GetInteractor(); VTK::ActorCollectionCopy aCopy(anInteractor->getRenderer()->GetActors()); VISU_Actor* anActor = SVTK::Find(aCopy.GetActors(), - SVTK::TIsSameIObject( anIO )); + SVTK::TIsSameIObject( anIO )); anActor->Highlight( anIO ); return true; @@ -972,12 +972,12 @@ void VisuGUI_SelectionPanel::onPointIdEdit () if (myFl) return; TGetVTKIdMethod aMethod = &VISU_PipeLine::GetNodeVTKID; bool anIsSelected = onIdEdit(myIDValLbl->text(), - aMethod, - false, - myModule, - myMeshName, - tr("WRN_NO_AVAILABLE_DATA"), - myFieldName); + aMethod, + false, + myModule, + myMeshName, + tr("WRN_NO_AVAILABLE_DATA"), + myFieldName); if (anIsSelected) // as selection manager doesn't send signal currentSelectionChanged() onSelectionEvent(); @@ -990,12 +990,12 @@ void VisuGUI_SelectionPanel::onCellIdEdit () if (myFl) return; TGetVTKIdMethod aMethod = &VISU_PipeLine::GetElemVTKID; bool anIsSelected = onIdEdit(myCellIDValLbl->text(), - aMethod, - true, - myModule, - myMeshName, - tr("WRN_NO_AVAILABLE_DATA"), - myFieldName); + aMethod, + true, + myModule, + myMeshName, + tr("WRN_NO_AVAILABLE_DATA"), + myFieldName); if (anIsSelected) // as selection manager doesn't send signal currentSelectionChanged() onSelectionEvent(); @@ -1136,15 +1136,15 @@ void VisuGUI_SelectionPanel::keyPressEvent( QKeyEvent* e ) void VisuGUI_SelectionPanel::onModuleActivated() { disconnect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), - this, SLOT( onSelectionEvent() ) ); + this, SLOT( onSelectionEvent() ) ); connect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), - this, SLOT( onSelectionEvent() ) ); + this, SLOT( onSelectionEvent() ) ); VisuGUI_Panel::onModuleActivated(); } void VisuGUI_SelectionPanel::onModuleDeactivated() { disconnect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), - this, SLOT( onSelectionEvent() ) ); + this, SLOT( onSelectionEvent() ) ); VisuGUI_Panel::onModuleDeactivated(); } diff --git a/src/VISUGUI/VisuGUI_SelectionPrefDlg.cxx b/src/VISUGUI/VisuGUI_SelectionPrefDlg.cxx index 6022b9b3..9615a047 100644 --- a/src/VISUGUI/VisuGUI_SelectionPrefDlg.cxx +++ b/src/VISUGUI/VisuGUI_SelectionPrefDlg.cxx @@ -56,7 +56,7 @@ using namespace std; */ VisuGUI_SelectionPrefDlg::VisuGUI_SelectionPrefDlg( QWidget* parent ) : QDialog( parent ? parent : SUIT_Session::session()->activeApplication()->desktop(), - Qt::WindowTitleHint | Qt::WindowSystemMenuHint ) + Qt::WindowTitleHint | Qt::WindowSystemMenuHint ) { setWindowTitle( tr("TLT_SELECTION_PREFERENCES") ); setSizeGripEnabled( TRUE ); @@ -222,8 +222,8 @@ void VisuGUI_SelectionPrefDlg::update() vtkFloatingPointType* aColor = aPickingSettings->GetColor(); mySelectionColorButton->setColor( QColor( ( int )( aColor[0] * 255.0 ), - ( int )( aColor[1] * 255.0 ), - ( int )( aColor[2] * 255.0 ) ) ); + ( int )( aColor[1] * 255.0 ), + ( int )( aColor[2] * 255.0 ) ) ); myInfoWindowGroup->setChecked( aPickingSettings->GetInfoWindowEnabled() ); myTransparencySpinBox->setValue( int(aPickingSettings->GetInfoWindowTransparency() * 100.0) ); diff --git a/src/VISUGUI/VisuGUI_SetupPlot2dDlg.cxx b/src/VISUGUI/VisuGUI_SetupPlot2dDlg.cxx index 878aea29..a12fad46 100644 --- a/src/VISUGUI/VisuGUI_SetupPlot2dDlg.cxx +++ b/src/VISUGUI/VisuGUI_SetupPlot2dDlg.cxx @@ -137,39 +137,39 @@ VisuGUI_SetupPlot2dDlg::VisuGUI_SetupPlot2dDlg( _PTR(SObject) object, QWidget* p tblIntAttr = anAttr; if ( tblIntAttr ) { try { - int nbRows = tblIntAttr->GetNbRows() ; - vector rowTitles = tblIntAttr->GetRowTitles(); - vector rowUnits = tblIntAttr->GetRowUnits(); - QStringList rows; - for ( int i = 0; i < nbRows; i++ ) - rows.append( rowTitles[i].c_str() ); - - for ( int i = 0; i < nbRows; i++ ) { - VisuGUI_ItemContainer* item = new VisuGUI_ItemContainer( this ); - item->createWidgets( frame, rows ); - frameLayout->addWidget( item->myHBtn, row, 0 ); - frameLayout->addWidget( item->myVBtn, row, 1 ); - frameLayout->addWidget( item->myAssigned, row, 3 ); - - frameLayout->addWidget( item->myTitleLab, row, 5 ); - if ( rowTitles.size() > 0 ) - item->myTitleLab->setText( QString( rowTitles[ i ].c_str() ) ); - frameLayout->addWidget( item->myUnitLab, row, 7 ); - if ( rowUnits.size() > 0 ) - item->myUnitLab->setText( QString( rowUnits[ i ].c_str() ) ); - frameLayout->addWidget( item->myAutoCheck, row, 9 ); - frameLayout->addWidget( item->myLineCombo, row, 10 ); - frameLayout->addWidget( item->myLineSpin, row, 11 ); - frameLayout->addWidget( item->myMarkerCombo, row, 12 ); - frameLayout->addWidget( item->myColorBtn, row, 13 ); - connect( item, SIGNAL( horToggled( bool ) ), this, SLOT( onHBtnToggled( bool ) ) ); - connect( item, SIGNAL( verToggled( bool ) ), this, SLOT( onVBtnToggled( bool ) ) ); - myItems.append( item ); - row++; - } + int nbRows = tblIntAttr->GetNbRows() ; + vector rowTitles = tblIntAttr->GetRowTitles(); + vector rowUnits = tblIntAttr->GetRowUnits(); + QStringList rows; + for ( int i = 0; i < nbRows; i++ ) + rows.append( rowTitles[i].c_str() ); + + for ( int i = 0; i < nbRows; i++ ) { + VisuGUI_ItemContainer* item = new VisuGUI_ItemContainer( this ); + item->createWidgets( frame, rows ); + frameLayout->addWidget( item->myHBtn, row, 0 ); + frameLayout->addWidget( item->myVBtn, row, 1 ); + frameLayout->addWidget( item->myAssigned, row, 3 ); + + frameLayout->addWidget( item->myTitleLab, row, 5 ); + if ( rowTitles.size() > 0 ) + item->myTitleLab->setText( QString( rowTitles[ i ].c_str() ) ); + frameLayout->addWidget( item->myUnitLab, row, 7 ); + if ( rowUnits.size() > 0 ) + item->myUnitLab->setText( QString( rowUnits[ i ].c_str() ) ); + frameLayout->addWidget( item->myAutoCheck, row, 9 ); + frameLayout->addWidget( item->myLineCombo, row, 10 ); + frameLayout->addWidget( item->myLineSpin, row, 11 ); + frameLayout->addWidget( item->myMarkerCombo, row, 12 ); + frameLayout->addWidget( item->myColorBtn, row, 13 ); + connect( item, SIGNAL( horToggled( bool ) ), this, SLOT( onHBtnToggled( bool ) ) ); + connect( item, SIGNAL( verToggled( bool ) ), this, SLOT( onVBtnToggled( bool ) ) ); + myItems.append( item ); + row++; + } } catch( ... ) { - MESSAGE("VisuGUI_SetupPlot2dDlg::VisuGUI_SetupPlot2dDlg : Exception has been caught (int)!!!"); + MESSAGE("VisuGUI_SetupPlot2dDlg::VisuGUI_SetupPlot2dDlg : Exception has been caught (int)!!!"); } } } @@ -178,39 +178,39 @@ VisuGUI_SetupPlot2dDlg::VisuGUI_SetupPlot2dDlg( _PTR(SObject) object, QWidget* p tblRealAttr = anAttr; if ( tblRealAttr ) { try { - int nbRows = tblRealAttr->GetNbRows() ; - vector rowTitles = tblRealAttr->GetRowTitles(); - vector rowUnits = tblRealAttr->GetRowUnits(); - QStringList rows; - for ( int i = 0; i < nbRows; i++ ) - rows.append( rowTitles[i].c_str() ); - - for ( int i = 0; i < nbRows; i++ ) { - VisuGUI_ItemContainer* item = new VisuGUI_ItemContainer( this ); - item->createWidgets( frame, rows ); - frameLayout->addWidget( item->myHBtn, row, 0 ); - frameLayout->addWidget( item->myVBtn, row, 1 ); - frameLayout->addWidget( item->myAssigned, row, 3 ); - - frameLayout->addWidget( item->myTitleLab, row, 5 ); - if ( rowTitles.size() > 0 ) - item->myTitleLab->setText( QString( rowTitles[ i ].c_str() ) ); - frameLayout->addWidget( item->myUnitLab, row, 7 ); - if ( rowUnits.size() > 0 ) - item->myUnitLab->setText( QString( rowUnits[ i ].c_str() ) ); - frameLayout->addWidget( item->myAutoCheck, row, 9 ); - frameLayout->addWidget( item->myLineCombo, row, 10 ); - frameLayout->addWidget( item->myLineSpin, row, 11 ); - frameLayout->addWidget( item->myMarkerCombo, row, 12 ); - frameLayout->addWidget( item->myColorBtn, row, 13 ); - connect( item, SIGNAL( horToggled( bool ) ), this, SLOT( onHBtnToggled( bool ) ) ); - connect( item, SIGNAL( verToggled( bool ) ), this, SLOT( onVBtnToggled( bool ) ) ); - myItems.append( item ); - row++; - } + int nbRows = tblRealAttr->GetNbRows() ; + vector rowTitles = tblRealAttr->GetRowTitles(); + vector rowUnits = tblRealAttr->GetRowUnits(); + QStringList rows; + for ( int i = 0; i < nbRows; i++ ) + rows.append( rowTitles[i].c_str() ); + + for ( int i = 0; i < nbRows; i++ ) { + VisuGUI_ItemContainer* item = new VisuGUI_ItemContainer( this ); + item->createWidgets( frame, rows ); + frameLayout->addWidget( item->myHBtn, row, 0 ); + frameLayout->addWidget( item->myVBtn, row, 1 ); + frameLayout->addWidget( item->myAssigned, row, 3 ); + + frameLayout->addWidget( item->myTitleLab, row, 5 ); + if ( rowTitles.size() > 0 ) + item->myTitleLab->setText( QString( rowTitles[ i ].c_str() ) ); + frameLayout->addWidget( item->myUnitLab, row, 7 ); + if ( rowUnits.size() > 0 ) + item->myUnitLab->setText( QString( rowUnits[ i ].c_str() ) ); + frameLayout->addWidget( item->myAutoCheck, row, 9 ); + frameLayout->addWidget( item->myLineCombo, row, 10 ); + frameLayout->addWidget( item->myLineSpin, row, 11 ); + frameLayout->addWidget( item->myMarkerCombo, row, 12 ); + frameLayout->addWidget( item->myColorBtn, row, 13 ); + connect( item, SIGNAL( horToggled( bool ) ), this, SLOT( onHBtnToggled( bool ) ) ); + connect( item, SIGNAL( verToggled( bool ) ), this, SLOT( onVBtnToggled( bool ) ) ); + myItems.append( item ); + row++; + } } catch( ... ) { - MESSAGE("VisuGUI_SetupPlot2dDlg::VisuGUI_SetupPlot2dDlg : Exception has been caught (real)!!!"); + MESSAGE("VisuGUI_SetupPlot2dDlg::VisuGUI_SetupPlot2dDlg : Exception has been caught (real)!!!"); } } } @@ -263,7 +263,7 @@ VisuGUI_SetupPlot2dDlg::~VisuGUI_SetupPlot2dDlg() Gets curves info ( indexes of row data in the table for horizontal and verical axes ) */ void VisuGUI_SetupPlot2dDlg::getCurvesSource( int& horIndex, QList& verIndexes, - QList& zIndices ) + QList& zIndices ) { /* collecting horizontal and vertical axis items */ horIndex = -1; @@ -283,11 +283,11 @@ void VisuGUI_SetupPlot2dDlg::getCurvesSource( int& horIndex, QList& verInde Gets curve attributes */ bool VisuGUI_SetupPlot2dDlg::getCurveAttributes( const int vIndex, - bool& isAuto, - int& marker, - int& line, - int& lineWidth, - QColor& color) + bool& isAuto, + int& marker, + int& line, + int& lineWidth, + QColor& color) { if ( vIndex >= 0 && vIndex < myItems.count() ) { isAuto = myItems.at( vIndex )->isAutoAssign(); @@ -324,52 +324,52 @@ void VisuGUI_SetupPlot2dDlg::getCurves( QList& container ) tblIntAttr = anAttr; if ( tblIntAttr ) { try { - int nbCols = tblIntAttr->GetNbColumns() ; - vector rowTitles = tblIntAttr->GetRowTitles(); - vector rowUnits = tblIntAttr->GetRowUnits(); - - for ( i = 0; i < verIndex.count(); i++ ) { - SPlot2d_Curve* curve = new SPlot2d_Curve(); - // curve titles - if ( rowTitles.size() > 0 ) { - curve->setHorTitle( QString( rowTitles[ horIndex ].c_str() ) ); - curve->setVerTitle( QString( rowTitles[ verIndex[i] ].c_str() ) ); - } - // curve units - if ( rowUnits.size() > 0 ) { - curve->setHorUnits( QString( rowUnits[ horIndex ].c_str() ) ); - curve->setVerUnits( QString( rowUnits[ verIndex[i] ].c_str() ) ); - } - // curve data - int nbPoints = 0; - for ( j = 1; j <= nbCols; j++ ) { - if ( tblIntAttr->HasValue( horIndex+1, j ) && tblIntAttr->HasValue( verIndex[i]+1, j ) ) - nbPoints++; - } - if ( nbPoints > 0 ) { - double* xList = new double[ nbPoints ]; - double* yList = new double[ nbPoints ]; - QStringList zList; - for ( j = 1; j <= nbCols; j++ ) { - if ( tblIntAttr->HasValue( horIndex+1, j ) && tblIntAttr->HasValue( verIndex[i]+1, j ) ) { - xList[j-1] = tblIntAttr->GetValue( horIndex +1, j ); - yList[j-1] = tblIntAttr->GetValue( verIndex[i]+1, j ); - zList.append( QString( "%1" ).arg( tblIntAttr->GetValue( zIndices[i]+1, j ) ) ); - } - } - curve->setData( xList, yList, nbPoints, zList ); - } - // curve attributes - curve->setLine( (Plot2d::LineType)myItems.at( verIndex[i] )->getLine(), myItems.at( verIndex[i] )->getLineWidth() ); - curve->setMarker( (Plot2d::MarkerType)myItems.at( verIndex[i] )->getMarker() ); - curve->setColor( myItems.at( verIndex[i] )->getColor() ); - curve->setAutoAssign( myItems.at( verIndex[i] )->isAutoAssign() ); - // add curve into container - container.append( curve ); - } + int nbCols = tblIntAttr->GetNbColumns() ; + vector rowTitles = tblIntAttr->GetRowTitles(); + vector rowUnits = tblIntAttr->GetRowUnits(); + + for ( i = 0; i < verIndex.count(); i++ ) { + SPlot2d_Curve* curve = new SPlot2d_Curve(); + // curve titles + if ( rowTitles.size() > 0 ) { + curve->setHorTitle( QString( rowTitles[ horIndex ].c_str() ) ); + curve->setVerTitle( QString( rowTitles[ verIndex[i] ].c_str() ) ); + } + // curve units + if ( rowUnits.size() > 0 ) { + curve->setHorUnits( QString( rowUnits[ horIndex ].c_str() ) ); + curve->setVerUnits( QString( rowUnits[ verIndex[i] ].c_str() ) ); + } + // curve data + int nbPoints = 0; + for ( j = 1; j <= nbCols; j++ ) { + if ( tblIntAttr->HasValue( horIndex+1, j ) && tblIntAttr->HasValue( verIndex[i]+1, j ) ) + nbPoints++; + } + if ( nbPoints > 0 ) { + double* xList = new double[ nbPoints ]; + double* yList = new double[ nbPoints ]; + QStringList zList; + for ( j = 1; j <= nbCols; j++ ) { + if ( tblIntAttr->HasValue( horIndex+1, j ) && tblIntAttr->HasValue( verIndex[i]+1, j ) ) { + xList[j-1] = tblIntAttr->GetValue( horIndex +1, j ); + yList[j-1] = tblIntAttr->GetValue( verIndex[i]+1, j ); + zList.append( QString( "%1" ).arg( tblIntAttr->GetValue( zIndices[i]+1, j ) ) ); + } + } + curve->setData( xList, yList, nbPoints, zList ); + } + // curve attributes + curve->setLine( (Plot2d::LineType)myItems.at( verIndex[i] )->getLine(), myItems.at( verIndex[i] )->getLineWidth() ); + curve->setMarker( (Plot2d::MarkerType)myItems.at( verIndex[i] )->getMarker() ); + curve->setColor( myItems.at( verIndex[i] )->getColor() ); + curve->setAutoAssign( myItems.at( verIndex[i] )->isAutoAssign() ); + // add curve into container + container.append( curve ); + } } catch( ... ) { - MESSAGE("VisuGUI_SetupPlot2dDlg::getCurves : Exception has been caught (int)!!!"); + MESSAGE("VisuGUI_SetupPlot2dDlg::getCurves : Exception has been caught (int)!!!"); } } } @@ -378,52 +378,52 @@ void VisuGUI_SetupPlot2dDlg::getCurves( QList& container ) tblRealAttr = anAttr; if ( tblRealAttr ) { try { - int nbCols = tblRealAttr->GetNbColumns() ; - vector rowTitles = tblRealAttr->GetRowTitles(); - vector rowUnits = tblRealAttr->GetRowUnits(); - - for ( i = 0; i < verIndex.count(); i++ ) { - SPlot2d_Curve* curve = new SPlot2d_Curve(); - // curve titles - if ( rowTitles.size() > 0 ) { - curve->setHorTitle( QString( rowTitles[ horIndex ].c_str() ) ); - curve->setVerTitle( QString( rowTitles[ verIndex[i] ].c_str() ) ); - } - // curve units - if ( rowUnits.size() > 0 ) { - curve->setHorUnits( QString( rowUnits[ horIndex ].c_str() ) ); - curve->setVerUnits( QString( rowUnits[ verIndex[i] ].c_str() ) ); - } - // curve data - int nbPoints = 0; - for ( j = 1; j <= nbCols; j++ ) { - if ( tblRealAttr->HasValue( horIndex+1, j ) && tblRealAttr->HasValue( verIndex[i]+1, j ) ) - nbPoints++; - } - if ( nbPoints > 0 ) { - double* xList = new double[ nbPoints ]; - double* yList = new double[ nbPoints ]; - QStringList zList; - for ( j = 1; j <= nbCols; j++ ) { - if ( tblRealAttr->HasValue( horIndex+1, j ) && tblRealAttr->HasValue( verIndex[i]+1, j ) ) { - xList[j-1] = tblRealAttr->GetValue( horIndex +1, j ); - yList[j-1] = tblRealAttr->GetValue( verIndex[i]+1, j ); - zList.append( QString( "%1" ).arg( tblIntAttr->GetValue( zIndices[i]+1, j ) ) ); - } - } - curve->setData( xList, yList, nbPoints, zList ); - } - // curve attributes - curve->setLine( (Plot2d::LineType)myItems.at( verIndex[i] )->getLine(), myItems.at( verIndex[i] )->getLineWidth() ); - curve->setMarker( (Plot2d::MarkerType)myItems.at( verIndex[i] )->getMarker() ); - curve->setColor( myItems.at( verIndex[i] )->getColor() ); - curve->setAutoAssign( myItems.at( verIndex[i] )->isAutoAssign() ); - // add curve into container - container.append( curve ); - } + int nbCols = tblRealAttr->GetNbColumns() ; + vector rowTitles = tblRealAttr->GetRowTitles(); + vector rowUnits = tblRealAttr->GetRowUnits(); + + for ( i = 0; i < verIndex.count(); i++ ) { + SPlot2d_Curve* curve = new SPlot2d_Curve(); + // curve titles + if ( rowTitles.size() > 0 ) { + curve->setHorTitle( QString( rowTitles[ horIndex ].c_str() ) ); + curve->setVerTitle( QString( rowTitles[ verIndex[i] ].c_str() ) ); + } + // curve units + if ( rowUnits.size() > 0 ) { + curve->setHorUnits( QString( rowUnits[ horIndex ].c_str() ) ); + curve->setVerUnits( QString( rowUnits[ verIndex[i] ].c_str() ) ); + } + // curve data + int nbPoints = 0; + for ( j = 1; j <= nbCols; j++ ) { + if ( tblRealAttr->HasValue( horIndex+1, j ) && tblRealAttr->HasValue( verIndex[i]+1, j ) ) + nbPoints++; + } + if ( nbPoints > 0 ) { + double* xList = new double[ nbPoints ]; + double* yList = new double[ nbPoints ]; + QStringList zList; + for ( j = 1; j <= nbCols; j++ ) { + if ( tblRealAttr->HasValue( horIndex+1, j ) && tblRealAttr->HasValue( verIndex[i]+1, j ) ) { + xList[j-1] = tblRealAttr->GetValue( horIndex +1, j ); + yList[j-1] = tblRealAttr->GetValue( verIndex[i]+1, j ); + zList.append( QString( "%1" ).arg( tblIntAttr->GetValue( zIndices[i]+1, j ) ) ); + } + } + curve->setData( xList, yList, nbPoints, zList ); + } + // curve attributes + curve->setLine( (Plot2d::LineType)myItems.at( verIndex[i] )->getLine(), myItems.at( verIndex[i] )->getLineWidth() ); + curve->setMarker( (Plot2d::MarkerType)myItems.at( verIndex[i] )->getMarker() ); + curve->setColor( myItems.at( verIndex[i] )->getColor() ); + curve->setAutoAssign( myItems.at( verIndex[i] )->isAutoAssign() ); + // add curve into container + container.append( curve ); + } } catch( ... ) { - MESSAGE("VisuGUI_SetupPlot2dDlg::getCurves : Exception has been caught (real)!!!"); + MESSAGE("VisuGUI_SetupPlot2dDlg::getCurves : Exception has been caught (real)!!!"); } } } @@ -437,7 +437,7 @@ void VisuGUI_SetupPlot2dDlg::onHBtnToggled( bool on ) if ( on ) { for ( int i = 0; i < myItems.count(); i++ ) { if ( myItems.at( i ) != item ) - myItems.at( i )->setHorizontalOn( false ); + myItems.at( i )->setHorizontalOn( false ); } } enableControls(); @@ -456,19 +456,19 @@ void VisuGUI_SetupPlot2dDlg::onVBtnToggled( bool on ) int totalOn = 0; for ( i = 0; i < myItems.count(); i++ ) { if ( myItems.at( i ) != item && !myItems.at( i )->isHorizontalOn() ) { - if ( myItems.at( i )->myUnitLab->text() == item->myUnitLab->text() ) { - if ( myItems.at( i )->isVerticalOn() ) - totalOn++; - else - itemList.append( myItems.at( i ) ); - } - else { - myItems.at( i )->setVerticalOn( false ); - } + if ( myItems.at( i )->myUnitLab->text() == item->myUnitLab->text() ) { + if ( myItems.at( i )->isVerticalOn() ) + totalOn++; + else + itemList.append( myItems.at( i ) ); + } + else { + myItems.at( i )->setVerticalOn( false ); + } } } if ( totalOn == 0 && !itemList.isEmpty() && - SUIT_MessageBox::information( this, + SUIT_MessageBox::information( this, this->windowTitle(), tr( "QUE_WANT_SAME_UNITS" ), tr( "BUT_YES" ), @@ -476,9 +476,9 @@ void VisuGUI_SetupPlot2dDlg::onVBtnToggled( bool on ) 1, 1 ) == 0 ) { for ( i = 0; i < itemList.count(); i++ ) { - itemList.at( i )->blockSignals( true ); - itemList.at( i )->setVerticalOn( true ); - itemList.at( i )->blockSignals( false ); + itemList.at( i )->blockSignals( true ); + itemList.at( i )->setVerticalOn( true ); + itemList.at( i )->blockSignals( false ); } } } @@ -496,11 +496,11 @@ void VisuGUI_SetupPlot2dDlg::onHelp() app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); } else { - QString platform; + QString platform; #ifdef WIN32 - platform = "winapplication"; + platform = "winapplication"; #else - platform = "application"; + platform = "application"; #endif SUIT_MessageBox::warning(0, tr("WRN_WARNING"), tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). @@ -762,9 +762,9 @@ void VisuGUI_ItemContainer::onHVToggled( bool on ) if ( snd == myHBtn ) { if ( on ) { if ( myVBtn->isChecked() ) { -// blockSignals( true ); - myVBtn->setChecked( false ); -// blockSignals( false ); +// blockSignals( true ); + myVBtn->setChecked( false ); +// blockSignals( false ); } } emit horToggled( on ); @@ -772,9 +772,9 @@ void VisuGUI_ItemContainer::onHVToggled( bool on ) else { if ( on ) { if ( myHBtn->isChecked() ) { -// blockSignals( true ); - myHBtn->setChecked( false ); -// blockSignals( false ); +// blockSignals( true ); + myHBtn->setChecked( false ); +// blockSignals( false ); } } emit verToggled( on ); diff --git a/src/VISUGUI/VisuGUI_ShrinkFactorDlg.cxx b/src/VISUGUI/VisuGUI_ShrinkFactorDlg.cxx index 32f2b0fc..1037bb3a 100644 --- a/src/VISUGUI/VisuGUI_ShrinkFactorDlg.cxx +++ b/src/VISUGUI/VisuGUI_ShrinkFactorDlg.cxx @@ -150,10 +150,10 @@ void VisuGUI_ShrinkFactorDlg::help() platform = "application"; #endif SUIT_MessageBox::warning( this, - tr( "WRN_WARNING" ), - tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ). - arg( app->resourceMgr()->stringValue( "ExternalBrowser", platform ) ).arg( aHelpFileName ), - tr( "BUT_OK" ) ); + tr( "WRN_WARNING" ), + tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ). + arg( app->resourceMgr()->stringValue( "ExternalBrowser", platform ) ).arg( aHelpFileName ), + tr( "BUT_OK" ) ); } } @@ -176,7 +176,7 @@ void VisuGUI_ShrinkFactorDlg::setShrinkFactor() Handle(SALOME_InteractiveObject) anIO = anIter.Value(); VISU_Actor* anActor = VISU::FindActor( VISU::GetAppStudy( myModule ), myViewWindow, anIO->getEntry() ); if ( anActor && anActor->IsShrunkable() ) - anActor->SetShrinkFactor( shrink ); + anActor->SetShrinkFactor( shrink ); } myViewWindow->Repaint(); } @@ -198,38 +198,38 @@ void VisuGUI_ShrinkFactorDlg::onSelectionChanged() if ( aList.Extent() == 1 ) { Handle(SALOME_InteractiveObject) FirstIOS = aList.First(); if ( !FirstIOS.IsNull() ) { - VISU_Actor* anActor = VISU::FindActor( VISU::GetAppStudy( myModule ), myViewWindow, FirstIOS->getEntry() ); - if ( anActor ) { - shrinkable = anActor->IsShrunkable(); - if ( shrinkable ) - shrink = int( anActor->GetShrinkFactor() * 100. + 0.5 ); - } + VISU_Actor* anActor = VISU::FindActor( VISU::GetAppStudy( myModule ), myViewWindow, FirstIOS->getEntry() ); + if ( anActor ) { + shrinkable = anActor->IsShrunkable(); + if ( shrinkable ) + shrink = int( anActor->GetShrinkFactor() * 100. + 0.5 ); + } } } else if ( aList.Extent() > 1 ) { SALOME_ListIteratorOfListIO It( aList ); int setShr = -1; for ( ; It.More(); It.Next() ) { - Handle(SALOME_InteractiveObject) IO = It.Value(); - if (!IO.IsNull()) { - VISU_Actor* anActor = VISU::FindActor( VISU::GetAppStudy( myModule ), myViewWindow, IO->getEntry() ); - if ( anActor ) { - bool lshrinkable = anActor->IsShrunkable(); - shrinkable = shrinkable || lshrinkable; - if ( lshrinkable ) { - int shr = int( anActor->GetShrinkFactor() * 100. + 0.5 ); - if ( setShr < 0 ) - setShr = shr; - else if ( setShr != shr ) { - setShr = DEFAULT_SHRINK; - break; - } - } - } - } + Handle(SALOME_InteractiveObject) IO = It.Value(); + if (!IO.IsNull()) { + VISU_Actor* anActor = VISU::FindActor( VISU::GetAppStudy( myModule ), myViewWindow, IO->getEntry() ); + if ( anActor ) { + bool lshrinkable = anActor->IsShrunkable(); + shrinkable = shrinkable || lshrinkable; + if ( lshrinkable ) { + int shr = int( anActor->GetShrinkFactor() * 100. + 0.5 ); + if ( setShr < 0 ) + setShr = shr; + else if ( setShr != shr ) { + setShr = DEFAULT_SHRINK; + break; + } + } + } + } } if ( setShr >= 0 ) - shrink = setShr; + shrink = setShr; } ValueSpin->blockSignals( true ); ValueSpin->setValue( shrink ); diff --git a/src/VISUGUI/VisuGUI_ShrinkFactorDlg.h b/src/VISUGUI/VisuGUI_ShrinkFactorDlg.h index b4bf4b55..b221a81e 100644 --- a/src/VISUGUI/VisuGUI_ShrinkFactorDlg.h +++ b/src/VISUGUI/VisuGUI_ShrinkFactorDlg.h @@ -49,7 +49,7 @@ class VisuGUI_ShrinkFactorDlg : public QDialog public: VisuGUI_ShrinkFactorDlg( VisuGUI* = 0, - bool modal = false ); + bool modal = false ); ~VisuGUI_ShrinkFactorDlg(); diff --git a/src/VISUGUI/VisuGUI_Slider.cxx b/src/VISUGUI/VisuGUI_Slider.cxx index 54f3ec69..e32654e7 100644 --- a/src/VISUGUI/VisuGUI_Slider.cxx +++ b/src/VISUGUI/VisuGUI_Slider.cxx @@ -76,8 +76,8 @@ using namespace std; Constructor */ VisuGUI_Slider::VisuGUI_Slider( VisuGUI* theModule, - QMainWindow* theParent, - LightApp_SelectionMgr* theSelectionMgr ) + QMainWindow* theParent, + LightApp_SelectionMgr* theSelectionMgr ) : QWidget( theParent ) , myViewManager( VISU::GetVisuGen( theModule )->GetViewManager() ) , mySelectionMgr( theSelectionMgr ) @@ -101,67 +101,67 @@ VisuGUI_Slider::VisuGUI_Slider( VisuGUI* theModule, { QGridLayout* aGridLayout = new QGridLayout( aParent ); { - myFirstTimeStamp = new QLabel( aParent ); - myFirstTimeStamp->setAlignment( Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter ); - myFirstTimeStamp->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); - aGridLayout->addWidget( myFirstTimeStamp, 0, 0, 1, 1 ); - - mySlider = new QSlider( aParent ); - mySlider->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); - mySlider->setFocusPolicy( Qt::StrongFocus ); - mySlider->setOrientation( Qt::Horizontal ); - mySlider->setTracking( false ); - mySlider->setMinimum( 0 ); - aGridLayout->addWidget( mySlider, 0, 1, 1, 3 ); - - myLastTimeStamp = new QLabel( aParent ); - aGridLayout->addWidget( myLastTimeStamp, 0, 4, 1, 1 ); + myFirstTimeStamp = new QLabel( aParent ); + myFirstTimeStamp->setAlignment( Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter ); + myFirstTimeStamp->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); + aGridLayout->addWidget( myFirstTimeStamp, 0, 0, 1, 1 ); + + mySlider = new QSlider( aParent ); + mySlider->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); + mySlider->setFocusPolicy( Qt::StrongFocus ); + mySlider->setOrientation( Qt::Horizontal ); + mySlider->setTracking( false ); + mySlider->setMinimum( 0 ); + aGridLayout->addWidget( mySlider, 0, 1, 1, 3 ); + + myLastTimeStamp = new QLabel( aParent ); + aGridLayout->addWidget( myLastTimeStamp, 0, 4, 1, 1 ); } { - myFirstButton = new QToolButton( aParent ); - myFirstButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_FIRST" ) ) ); - myFirstButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); - aGridLayout->addWidget( myFirstButton, 1, 0, 1, 1 ); - - myPreviousButton = new QToolButton( aParent ); - myPreviousButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PREVIOUS" ) ) ); - myPreviousButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); - aGridLayout->addWidget( myPreviousButton, 1, 1, 1, 1 ); - - myPlayButton = new QToolButton( aParent ); - myPlayButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PLAY" ) ) ); - myPlayButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); - myPlayButton->setCheckable( true ); - aGridLayout->addWidget( myPlayButton, 1, 2, 1, 1 ); - - myNextButton = new QToolButton( aParent ); - myNextButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_NEXT" ) ) ); - myNextButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); - aGridLayout->addWidget( myNextButton, 1, 3, 1, 1 ); - - myLastButton = new QToolButton( aParent ); - myLastButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_LAST" ) ) ); - myLastButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); - aGridLayout->addWidget( myLastButton, 1, 4, 1, 1 ); + myFirstButton = new QToolButton( aParent ); + myFirstButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_FIRST" ) ) ); + myFirstButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); + aGridLayout->addWidget( myFirstButton, 1, 0, 1, 1 ); + + myPreviousButton = new QToolButton( aParent ); + myPreviousButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PREVIOUS" ) ) ); + myPreviousButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); + aGridLayout->addWidget( myPreviousButton, 1, 1, 1, 1 ); + + myPlayButton = new QToolButton( aParent ); + myPlayButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PLAY" ) ) ); + myPlayButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); + myPlayButton->setCheckable( true ); + aGridLayout->addWidget( myPlayButton, 1, 2, 1, 1 ); + + myNextButton = new QToolButton( aParent ); + myNextButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_NEXT" ) ) ); + myNextButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); + aGridLayout->addWidget( myNextButton, 1, 3, 1, 1 ); + + myLastButton = new QToolButton( aParent ); + myLastButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_LAST" ) ) ); + myLastButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); + aGridLayout->addWidget( myLastButton, 1, 4, 1, 1 ); } { - myTimeStampIndexes = new QComboBox( aParent ); - myTimeStampIndexes->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); - myTimeStampIndexes->setFocusPolicy( Qt::StrongFocus ); - aGridLayout->addWidget( myTimeStampIndexes, 2, 0, 1, 2 ); - - myIsCycled = new QToolButton( aParent ); - myIsCycled->setText( tr( "IS_CYCLED" ) ); - myIsCycled->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); - myIsCycled->setLayoutDirection( Qt::LeftToRight ); - myIsCycled->setCheckable( true ); - //myIsCycled->setEnabled( false ); - aGridLayout->addWidget( myIsCycled, 2, 2, 1, 1 ); - - myTimeStampStrings = new QComboBox( aParent ); - myTimeStampStrings->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); - myTimeStampStrings->setFocusPolicy( Qt::StrongFocus ); - aGridLayout->addWidget( myTimeStampStrings, 2, 3, 1, 2 ); + myTimeStampIndexes = new QComboBox( aParent ); + myTimeStampIndexes->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); + myTimeStampIndexes->setFocusPolicy( Qt::StrongFocus ); + aGridLayout->addWidget( myTimeStampIndexes, 2, 0, 1, 2 ); + + myIsCycled = new QToolButton( aParent ); + myIsCycled->setText( tr( "IS_CYCLED" ) ); + myIsCycled->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); + myIsCycled->setLayoutDirection( Qt::LeftToRight ); + myIsCycled->setCheckable( true ); + //myIsCycled->setEnabled( false ); + aGridLayout->addWidget( myIsCycled, 2, 2, 1, 1 ); + + myTimeStampStrings = new QComboBox( aParent ); + myTimeStampStrings->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); + myTimeStampStrings->setFocusPolicy( Qt::StrongFocus ); + aGridLayout->addWidget( myTimeStampStrings, 2, 3, 1, 2 ); } } @@ -174,72 +174,72 @@ VisuGUI_Slider::VisuGUI_Slider( VisuGUI* theModule, { QVBoxLayout* aVBoxLayout = new QVBoxLayout( aParent ); { - QHBoxLayout* aHBoxLayout = new QHBoxLayout(); - - myMinimalMemoryButton = new QRadioButton( tr( "MINIMAL_MEMORY" ), aParent ); - aHBoxLayout->addWidget( myMinimalMemoryButton ); - - QSpacerItem* aSpacerItem = new QSpacerItem( 16, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - aHBoxLayout->addItem( aSpacerItem ); - - myLimitedMemoryButton = new QRadioButton( tr( "LIMITED_MEMORY" ), aParent ); - myLimitedMemoryButton->setChecked( true ); - aHBoxLayout->addWidget( myLimitedMemoryButton ); - - myLimitedMemory = new QtxDoubleSpinBox( aParent ); - myLimitedMemory->setMaximum( 10000 ); - myLimitedMemory->setValue( 512 ); - aHBoxLayout->addWidget( myLimitedMemory ); - - QLabel* aMemoryDimensionLabel = new QLabel( aParent ); - aMemoryDimensionLabel->setText( tr( "MEMORY_UNITS" ) ); - aHBoxLayout->addWidget( aMemoryDimensionLabel ); - - aVBoxLayout->addLayout( aHBoxLayout ); + QHBoxLayout* aHBoxLayout = new QHBoxLayout(); + + myMinimalMemoryButton = new QRadioButton( tr( "MINIMAL_MEMORY" ), aParent ); + aHBoxLayout->addWidget( myMinimalMemoryButton ); + + QSpacerItem* aSpacerItem = new QSpacerItem( 16, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + aHBoxLayout->addItem( aSpacerItem ); + + myLimitedMemoryButton = new QRadioButton( tr( "LIMITED_MEMORY" ), aParent ); + myLimitedMemoryButton->setChecked( true ); + aHBoxLayout->addWidget( myLimitedMemoryButton ); + + myLimitedMemory = new QtxDoubleSpinBox( aParent ); + myLimitedMemory->setMaximum( 10000 ); + myLimitedMemory->setValue( 512 ); + aHBoxLayout->addWidget( myLimitedMemory ); + + QLabel* aMemoryDimensionLabel = new QLabel( aParent ); + aMemoryDimensionLabel->setText( tr( "MEMORY_UNITS" ) ); + aHBoxLayout->addWidget( aMemoryDimensionLabel ); + + aVBoxLayout->addLayout( aHBoxLayout ); } { - QHBoxLayout* aHBoxLayout = new QHBoxLayout(); - - QLabel* aUsedMemoryLabel = new QLabel( tr( "USED_BY_CACHE" ), aParent ); - aUsedMemoryLabel->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); - aHBoxLayout->addWidget( aUsedMemoryLabel ); - - myUsedMemory = new QLineEdit( aParent ); - myUsedMemory->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed ); - //myUsedMemory->setEnabled( false ); - aHBoxLayout->addWidget( myUsedMemory ); - - QSpacerItem* aSpacerItem = new QSpacerItem( 16, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - aHBoxLayout->addItem( aSpacerItem ); - - QLabel* aFreeMemoryLabel = new QLabel( tr( "AVAILABLE_MEMORY" ), aParent ); - aHBoxLayout->addWidget( aFreeMemoryLabel ); + QHBoxLayout* aHBoxLayout = new QHBoxLayout(); + + QLabel* aUsedMemoryLabel = new QLabel( tr( "USED_BY_CACHE" ), aParent ); + aUsedMemoryLabel->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); + aHBoxLayout->addWidget( aUsedMemoryLabel ); + + myUsedMemory = new QLineEdit( aParent ); + myUsedMemory->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed ); + //myUsedMemory->setEnabled( false ); + aHBoxLayout->addWidget( myUsedMemory ); + + QSpacerItem* aSpacerItem = new QSpacerItem( 16, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + aHBoxLayout->addItem( aSpacerItem ); + + QLabel* aFreeMemoryLabel = new QLabel( tr( "AVAILABLE_MEMORY" ), aParent ); + aHBoxLayout->addWidget( aFreeMemoryLabel ); - myFreeMemory = new QLineEdit( aParent ); - myFreeMemory->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed ); - //myFreeMemory->setEnabled( false ); - aHBoxLayout->addWidget( myFreeMemory ); + myFreeMemory = new QLineEdit( aParent ); + myFreeMemory->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed ); + //myFreeMemory->setEnabled( false ); + aHBoxLayout->addWidget( myFreeMemory ); - aVBoxLayout->addLayout( aHBoxLayout ); + aVBoxLayout->addLayout( aHBoxLayout ); } { - QHBoxLayout* aHBoxLayout = new QHBoxLayout(); - - QLabel* aLabel = new QLabel( tr( "SPEED" ), aParent ); - aLabel->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); - aHBoxLayout->addWidget( aLabel ); + QHBoxLayout* aHBoxLayout = new QHBoxLayout(); + + QLabel* aLabel = new QLabel( tr( "SPEED" ), aParent ); + aLabel->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); + aHBoxLayout->addWidget( aLabel ); - mySpeedSlider = new QSlider( aParent ); - mySpeedSlider->setMinimum( 1 ); - mySpeedSlider->setMaximum( 100 ); - mySpeedSlider->setValue( mySpeedSlider->maximum() / 2 ); - mySpeedSlider->setPageStep( mySpeedSlider->maximum() / 5 ); - mySpeedSlider->setTickInterval( mySpeedSlider->pageStep() ); - mySpeedSlider->setOrientation( Qt::Horizontal ); - mySpeedSlider->setTickPosition( QSlider::TicksBelow ); - aHBoxLayout->addWidget( mySpeedSlider ); - - aVBoxLayout->addLayout( aHBoxLayout ); + mySpeedSlider = new QSlider( aParent ); + mySpeedSlider->setMinimum( 1 ); + mySpeedSlider->setMaximum( 100 ); + mySpeedSlider->setValue( mySpeedSlider->maximum() / 2 ); + mySpeedSlider->setPageStep( mySpeedSlider->maximum() / 5 ); + mySpeedSlider->setTickInterval( mySpeedSlider->pageStep() ); + mySpeedSlider->setOrientation( Qt::Horizontal ); + mySpeedSlider->setTickPosition( QSlider::TicksBelow ); + aHBoxLayout->addWidget( mySpeedSlider ); + + aVBoxLayout->addLayout( aHBoxLayout ); } aTabWidget->addTab( aParent, tr( "PROPERTIES_TAB" ) ); @@ -409,7 +409,7 @@ void VisuGUI_Slider::enableControls( bool on ) myTimeStampIndexes->addItem( QString::number( aNumber ) ); if( aNumber == aTimeStampNumber ) - a_current_index = an_index; + a_current_index = an_index; } // work around - to update controls' sizes myTimeStampStrings->setFont(myTimeStampStrings->font()); @@ -494,15 +494,15 @@ void VisuGUI_Slider::onSelectionChanged() aSObject = aStudy->FindObjectID(anIO->getEntry()); if (aSObject) { - CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject); + CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject); if (!CORBA::is_nil(anObject)) { - VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject); + VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject); - if(!CORBA::is_nil(aHolder)) - { - //cout << "ColoredPrs3dHolder" << endl; - myHolderList.push_back(aHolder); - } + if(!CORBA::is_nil(aHolder)) + { + //cout << "ColoredPrs3dHolder" << endl; + myHolderList.push_back(aHolder); + } } } } diff --git a/src/VISUGUI/VisuGUI_Slider.h b/src/VISUGUI/VisuGUI_Slider.h index db42f03e..40c69bc5 100644 --- a/src/VISUGUI/VisuGUI_Slider.h +++ b/src/VISUGUI/VisuGUI_Slider.h @@ -62,8 +62,8 @@ class VisuGUI_Slider : public QWidget public: VisuGUI_Slider( VisuGUI* theModule, - QMainWindow* theParent, - LightApp_SelectionMgr* theSelectionMgr ); + QMainWindow* theParent, + LightApp_SelectionMgr* theSelectionMgr ); virtual ~VisuGUI_Slider(); diff --git a/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx b/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx index c8dd07a6..55d9c652 100644 --- a/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx +++ b/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx @@ -309,7 +309,7 @@ VisuGUI_StreamLinesDlg::~VisuGUI_StreamLinesDlg() {} void VisuGUI_StreamLinesDlg::initFromPrsObject ( VISU::ColoredPrs3d_i* thePrs, - bool theInit ) + bool theInit ) { if( theInit ) myPrsCopy = VISU::TSameAsFactory().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish); @@ -448,11 +448,11 @@ int VisuGUI_StreamLinesDlg::storeToPrsObject (VISU::ColoredPrs3d_i* thePrs) } } anIsOk &= myPrsCopy->SetParams(myIntegStepLen->value(), - myPropTime->value(), - myStepLen->value(), - aPrs, - myPntPercent->value(), - aDirection); + myPropTime->value(), + myStepLen->value(), + aPrs, + myPntPercent->value(), + aDirection); } VISU::TSameAsFactory().Copy(myPrsCopy, thePrs); diff --git a/src/VISUGUI/VisuGUI_StreamLinesDlg.h b/src/VISUGUI/VisuGUI_StreamLinesDlg.h index a9997da7..1242475f 100644 --- a/src/VISUGUI/VisuGUI_StreamLinesDlg.h +++ b/src/VISUGUI/VisuGUI_StreamLinesDlg.h @@ -53,7 +53,7 @@ public: ~VisuGUI_StreamLinesDlg(); virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs, - bool theInit ); + bool theInit ); virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs); diff --git a/src/VISUGUI/VisuGUI_Sweep.cxx b/src/VISUGUI/VisuGUI_Sweep.cxx index b8870ce6..d5f5a904 100644 --- a/src/VISUGUI/VisuGUI_Sweep.cxx +++ b/src/VISUGUI/VisuGUI_Sweep.cxx @@ -63,8 +63,8 @@ Constructor */ VisuGUI_Sweep::VisuGUI_Sweep( VisuGUI* theModule, - QMainWindow* theParent, - LightApp_SelectionMgr* theSelectionMgr ) + QMainWindow* theParent, + LightApp_SelectionMgr* theSelectionMgr ) : QWidget( theParent ) , myModule( theModule ) , myViewWindow( NULL ) @@ -86,74 +86,74 @@ VisuGUI_Sweep::VisuGUI_Sweep( VisuGUI* theModule, { QVBoxLayout* aVBoxLayout = new QVBoxLayout( aNavigationTab ); { - QHBoxLayout* aHBoxLayout = new QHBoxLayout(); - - QLabel* aStartSweepPosition = new QLabel( aNavigationTab ); - aStartSweepPosition->setText( tr( "START_SWEEP_POSITION" ) ); - aHBoxLayout->addWidget( aStartSweepPosition ); + QHBoxLayout* aHBoxLayout = new QHBoxLayout(); + + QLabel* aStartSweepPosition = new QLabel( aNavigationTab ); + aStartSweepPosition->setText( tr( "START_SWEEP_POSITION" ) ); + aHBoxLayout->addWidget( aStartSweepPosition ); - mySweepSlider = new QSlider( aNavigationTab ); - mySweepSlider->setOrientation( Qt::Horizontal ); - mySweepSlider->setMinimum( 0 ); - aHBoxLayout->addWidget( mySweepSlider ); - - QLabel* anEndSweepPosition = new QLabel( aNavigationTab ); - anEndSweepPosition->setText( tr( "END_SWEEP_POSITION" ) ); - aHBoxLayout->addWidget( anEndSweepPosition ); - - aVBoxLayout->addLayout( aHBoxLayout ); + mySweepSlider = new QSlider( aNavigationTab ); + mySweepSlider->setOrientation( Qt::Horizontal ); + mySweepSlider->setMinimum( 0 ); + aHBoxLayout->addWidget( mySweepSlider ); + + QLabel* anEndSweepPosition = new QLabel( aNavigationTab ); + anEndSweepPosition->setText( tr( "END_SWEEP_POSITION" ) ); + aHBoxLayout->addWidget( anEndSweepPosition ); + + aVBoxLayout->addLayout( aHBoxLayout ); } { - QHBoxLayout* aHBoxLayout = new QHBoxLayout(); + QHBoxLayout* aHBoxLayout = new QHBoxLayout(); - myFirstButton = new QToolButton( aNavigationTab ); - myFirstButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_FIRST" ) ) ); - myFirstButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); - connect( myFirstButton, SIGNAL( clicked() ), SLOT( onFirst() ) ); - aHBoxLayout->addWidget( myFirstButton ); - - myPreviousButton = new QToolButton( aNavigationTab ); - myPreviousButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PREVIOUS" ) ) ); - myPreviousButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); - connect( myPreviousButton, SIGNAL( clicked() ), SLOT( onPrevious() ) ); - aHBoxLayout->addWidget( myPreviousButton ); - - myPlayButton = new QToolButton( aNavigationTab ); - myPlayButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PLAY" ) ) ); - myPlayButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); - myPlayButton->setCheckable( true ); - aHBoxLayout->addWidget( myPlayButton ); - - myNextButton = new QToolButton( aNavigationTab ); - myNextButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_NEXT" ) ) ); - myNextButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); - connect( myNextButton, SIGNAL( clicked() ), SLOT( onNext() ) ); - aHBoxLayout->addWidget( myNextButton ); - - myLastButton = new QToolButton( aNavigationTab ); - myLastButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_LAST" ) ) ); - myLastButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); - connect( myLastButton, SIGNAL( clicked() ), SLOT( onLast() ) ); - aHBoxLayout->addWidget( myLastButton ); - - aVBoxLayout->addLayout( aHBoxLayout ); + myFirstButton = new QToolButton( aNavigationTab ); + myFirstButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_FIRST" ) ) ); + myFirstButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); + connect( myFirstButton, SIGNAL( clicked() ), SLOT( onFirst() ) ); + aHBoxLayout->addWidget( myFirstButton ); + + myPreviousButton = new QToolButton( aNavigationTab ); + myPreviousButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PREVIOUS" ) ) ); + myPreviousButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); + connect( myPreviousButton, SIGNAL( clicked() ), SLOT( onPrevious() ) ); + aHBoxLayout->addWidget( myPreviousButton ); + + myPlayButton = new QToolButton( aNavigationTab ); + myPlayButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PLAY" ) ) ); + myPlayButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); + myPlayButton->setCheckable( true ); + aHBoxLayout->addWidget( myPlayButton ); + + myNextButton = new QToolButton( aNavigationTab ); + myNextButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_NEXT" ) ) ); + myNextButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); + connect( myNextButton, SIGNAL( clicked() ), SLOT( onNext() ) ); + aHBoxLayout->addWidget( myNextButton ); + + myLastButton = new QToolButton( aNavigationTab ); + myLastButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_LAST" ) ) ); + myLastButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); + connect( myLastButton, SIGNAL( clicked() ), SLOT( onLast() ) ); + aHBoxLayout->addWidget( myLastButton ); + + aVBoxLayout->addLayout( aHBoxLayout ); } { - QHBoxLayout* aHBoxLayout = new QHBoxLayout(); + QHBoxLayout* aHBoxLayout = new QHBoxLayout(); - QToolButton* aStopButton = new QToolButton( aNavigationTab ); - aStopButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SWEEP_STOP" ) ) ); - aStopButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); - aStopButton->setCheckable( false ); - connect( aStopButton, SIGNAL( clicked( ) ), SLOT( onStop( ) ) ); - aHBoxLayout->addWidget( aStopButton ); - - myIsCycled = new QCheckBox( aNavigationTab ); - myIsCycled->setText( tr( "IS_CYCLED" ) ); - myIsCycled->setChecked( false ); - aHBoxLayout->addWidget( myIsCycled ); - - aVBoxLayout->addLayout( aHBoxLayout ); + QToolButton* aStopButton = new QToolButton( aNavigationTab ); + aStopButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SWEEP_STOP" ) ) ); + aStopButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); + aStopButton->setCheckable( false ); + connect( aStopButton, SIGNAL( clicked( ) ), SLOT( onStop( ) ) ); + aHBoxLayout->addWidget( aStopButton ); + + myIsCycled = new QCheckBox( aNavigationTab ); + myIsCycled->setText( tr( "IS_CYCLED" ) ); + myIsCycled->setChecked( false ); + aHBoxLayout->addWidget( myIsCycled ); + + aVBoxLayout->addLayout( aHBoxLayout ); } aTabWidget->addTab( aNavigationTab, tr( "NAVIGATION_TAB" ) ); @@ -164,29 +164,29 @@ VisuGUI_Sweep::VisuGUI_Sweep( VisuGUI* theModule, { QGridLayout* aGridLayout = new QGridLayout( aPropertiesTab ); { - QHBoxLayout* aHBoxLayout = new QHBoxLayout(); - - QLabel* aModeAnnotation = new QLabel( aPropertiesTab ); - aModeAnnotation->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Preferred ); - aModeAnnotation->setText( tr( "MODE" ) ); - aHBoxLayout->addWidget( aModeAnnotation ); - - mySweepMode = new QComboBox( aPropertiesTab ); - mySweepMode->insertItems( 0, QStringList() - << tr( "LINEAR" ) - << tr( "COSINUSOIDAL" ) - << tr( "SINUSOIDAL" ) ); - mySweepMode->setCurrentIndex( aResourceMgr->integerValue( "VISU", "sweeping_modes", 0 ) ); - aHBoxLayout->addWidget( mySweepMode ); - - myIntervals = new QComboBox( aPropertiesTab ); - myIntervals->insertItems( 0, QStringList() - << tr( "[ 0, +PI ]" ) - << tr( "[ -PI, +PI ]" ) ); - myIntervals->setCurrentIndex( aResourceMgr->integerValue( "VISU", "sweeping_is2PI", 0 ) ); - aHBoxLayout->addWidget( myIntervals ); - - aGridLayout->addLayout( aHBoxLayout, 0, 0, 1, 2 ); + QHBoxLayout* aHBoxLayout = new QHBoxLayout(); + + QLabel* aModeAnnotation = new QLabel( aPropertiesTab ); + aModeAnnotation->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Preferred ); + aModeAnnotation->setText( tr( "MODE" ) ); + aHBoxLayout->addWidget( aModeAnnotation ); + + mySweepMode = new QComboBox( aPropertiesTab ); + mySweepMode->insertItems( 0, QStringList() + << tr( "LINEAR" ) + << tr( "COSINUSOIDAL" ) + << tr( "SINUSOIDAL" ) ); + mySweepMode->setCurrentIndex( aResourceMgr->integerValue( "VISU", "sweeping_modes", 0 ) ); + aHBoxLayout->addWidget( mySweepMode ); + + myIntervals = new QComboBox( aPropertiesTab ); + myIntervals->insertItems( 0, QStringList() + << tr( "[ 0, +PI ]" ) + << tr( "[ -PI, +PI ]" ) ); + myIntervals->setCurrentIndex( aResourceMgr->integerValue( "VISU", "sweeping_is2PI", 0 ) ); + aHBoxLayout->addWidget( myIntervals ); + + aGridLayout->addLayout( aHBoxLayout, 0, 0, 1, 2 ); } QLabel* aNumberOfStepsAnnotation = new QLabel( aPropertiesTab ); diff --git a/src/VISUGUI/VisuGUI_Sweep.h b/src/VISUGUI/VisuGUI_Sweep.h index 9b3c9b78..5b1c1539 100644 --- a/src/VISUGUI/VisuGUI_Sweep.h +++ b/src/VISUGUI/VisuGUI_Sweep.h @@ -65,8 +65,8 @@ class VisuGUI_Sweep : public QWidget public: VisuGUI_Sweep( VisuGUI* theModule, - QMainWindow* theParent, - LightApp_SelectionMgr* theSelectionMgr ); + QMainWindow* theParent, + LightApp_SelectionMgr* theSelectionMgr ); virtual ~VisuGUI_Sweep(); diff --git a/src/VISUGUI/VisuGUI_Table3dDlg.cxx b/src/VISUGUI/VisuGUI_Table3dDlg.cxx index 01224f5a..a90fccc5 100644 --- a/src/VISUGUI/VisuGUI_Table3dDlg.cxx +++ b/src/VISUGUI/VisuGUI_Table3dDlg.cxx @@ -423,10 +423,10 @@ void VisuGUI_TableScalarBarPane::initFromPrsObject( VISU::PointMap3d_i* thePrs ) myBarPrs->GetTitleColor( R, G, B ); setPosAndSize( myBarPrs->GetPosX(), - myBarPrs->GetPosY(), - myBarPrs->GetWidth(), - myBarPrs->GetHeight(), - myBarPrs->GetBarOrientation() ); + myBarPrs->GetPosY(), + myBarPrs->GetWidth(), + myBarPrs->GetHeight(), + myBarPrs->GetBarOrientation() ); myVerTS = myBarPrs->GetTitleSize(); myVerLS = myBarPrs->GetLabelSize(); @@ -438,19 +438,19 @@ void VisuGUI_TableScalarBarPane::initFromPrsObject( VISU::PointMap3d_i* thePrs ) myBarDlg->setUnitsVisible( myBarPrs->IsUnitsVisible() ); myTextDlg->myTitleFont->SetData( QColor( (int)(R*255.), (int)(G*255.), (int)(B*255.) ), - myBarPrs->GetTitFontType(), - myBarPrs->IsBoldTitle(), - myBarPrs->IsItalicTitle(), - myBarPrs->IsShadowTitle() ); + myBarPrs->GetTitFontType(), + myBarPrs->IsBoldTitle(), + myBarPrs->IsItalicTitle(), + myBarPrs->IsShadowTitle() ); // "Labels" myBarPrs->GetLabelColor( R, G, B ); myTextDlg->myLabelFont->SetData( QColor( (int)(R*255.), (int)(G*255.), (int)(B*255.) ), myBarPrs->GetLblFontType(), - myBarPrs->IsBoldLabel(), - myBarPrs->IsItalicLabel(), - myBarPrs->IsShadowLabel() ); + myBarPrs->IsBoldLabel(), + myBarPrs->IsItalicLabel(), + myBarPrs->IsShadowLabel() ); } //---------------------------------------------------------------------------- @@ -505,8 +505,8 @@ int VisuGUI_TableScalarBarPane::storeToPrsObject( VISU::PointMap3d_i* thePrs ) { myBarPrs->SetShadowTitle( isTitleShadow ); myBarPrs->SetTitFontType( aTitleFontFamily ); myBarPrs->SetTitleColor( aTitColor.red()/255., - aTitColor.green()/255., - aTitColor.blue()/255. ); + aTitColor.green()/255., + aTitColor.blue()/255. ); // "Label" QColor aLblColor( 255, 255, 255 ); @@ -522,8 +522,8 @@ int VisuGUI_TableScalarBarPane::storeToPrsObject( VISU::PointMap3d_i* thePrs ) { myBarPrs->SetShadowLabel( isLabelShadow ); myBarPrs->SetLblFontType( aLabelFontFamily ); myBarPrs->SetLabelColor( aLblColor.red()/255., - aLblColor.green()/255., - aLblColor.blue()/255. ); + aLblColor.green()/255., + aLblColor.blue()/255. ); // myIsStoreTextProp = false; } return 1; @@ -667,7 +667,7 @@ bool VisuGUI_TableScalarBarPane::check() if ( RBIrange->isChecked() ) { if (minVal >= maxVal) { SUIT_MessageBox::warning( this,tr("WRN_VISU"), - tr("MSG_MINMAX_VALUES") ); + tr("MSG_MINMAX_VALUES") ); return false; } } @@ -676,20 +676,20 @@ bool VisuGUI_TableScalarBarPane::check() if ( CBLog->isChecked() ) { if ( minVal <= 0.0 || maxVal <= 0.0) { if ( RBIrange->isChecked() ) { - SUIT_MessageBox::warning( this, - tr("WRN_VISU"), - tr("WRN_LOGARITHMIC_RANGE") ); + SUIT_MessageBox::warning( this, + tr("WRN_VISU"), + tr("WRN_LOGARITHMIC_RANGE") ); } else { - if ( minVal == 0) - SUIT_MessageBox::warning( this, - tr("WRN_VISU"), - tr("WRN_LOGARITHMIC_RANGE") ); - else - SUIT_MessageBox::warning( this, - tr("WRN_VISU"), - tr("WRN_LOGARITHMIC_FIELD_RANGE") ); - RBIrange->setChecked(true); - changeRange(1); + if ( minVal == 0) + SUIT_MessageBox::warning( this, + tr("WRN_VISU"), + tr("WRN_LOGARITHMIC_RANGE") ); + else + SUIT_MessageBox::warning( this, + tr("WRN_VISU"), + tr("WRN_LOGARITHMIC_FIELD_RANGE") ); + RBIrange->setChecked(true); + changeRange(1); } return false; } @@ -801,8 +801,8 @@ void VisuGUI_Table3DDlg::onHelp() platform = "application"; #endif SUIT_MessageBox::warning( this, QObject::tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName) ); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName) ); } } diff --git a/src/VISUGUI/VisuGUI_TimeAnimation.cxx b/src/VISUGUI/VisuGUI_TimeAnimation.cxx index c0a9c0e5..00192d5a 100644 --- a/src/VISUGUI/VisuGUI_TimeAnimation.cxx +++ b/src/VISUGUI/VisuGUI_TimeAnimation.cxx @@ -162,8 +162,8 @@ ArrangeDlg::ArrangeDlg(QWidget* theParent, VISU_TimeAnimation* theAnimator) } ArrangeDlg::ArrangeDlg(QWidget* theParent, - const SalomeApp_Module* theModule, - SVTK_ViewWindow* theViewWindow) + const SalomeApp_Module* theModule, + SVTK_ViewWindow* theViewWindow) : QDialog(theParent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ), myAnimator(NULL), myViewWindow(theViewWindow) @@ -178,52 +178,52 @@ ArrangeDlg::ArrangeDlg(QWidget* theParent, while(vtkActor* anActor = aCollection->GetNextActor()){ if (VISU_Actor* anVISUActor = dynamic_cast(anActor)) { if(anVISUActor->GetVisibility() != 0){ - if (VISU::Prs3d_i* aPrs = anVISUActor->GetPrs3d()){ - if(!myPrsMap.contains(aPrs)){ - Handle(SALOME_InteractiveObject) anIO = aPrs->GetIO(); - if(!anIO->hasEntry()) - continue; - SalomeApp_Study* aStudy = VISU::GetAppStudy(theModule); - VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, anIO->getEntry()); - if(_PTR(SObject) aSObject = anObjectInfo.mySObject){ - _PTR(GenericAttribute) anAttr; - if (aSObject->FindAttribute(anAttr, "AttributeName")) { - _PTR(AttributeName) aName(anAttr); - QString strIn(aName->Value().c_str()); - aPrsNames.append(strIn); - myPrsMap[aPrs] = myOffsets.count(); - Offset aOffs; - anVISUActor->GetPosition(aOffs.myOffset); - myOffsets.append(aOffs); - } - } - } - } + if (VISU::Prs3d_i* aPrs = anVISUActor->GetPrs3d()){ + if(!myPrsMap.contains(aPrs)){ + Handle(SALOME_InteractiveObject) anIO = aPrs->GetIO(); + if(!anIO->hasEntry()) + continue; + SalomeApp_Study* aStudy = VISU::GetAppStudy(theModule); + VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, anIO->getEntry()); + if(_PTR(SObject) aSObject = anObjectInfo.mySObject){ + _PTR(GenericAttribute) anAttr; + if (aSObject->FindAttribute(anAttr, "AttributeName")) { + _PTR(AttributeName) aName(anAttr); + QString strIn(aName->Value().c_str()); + aPrsNames.append(strIn); + myPrsMap[aPrs] = myOffsets.count(); + Offset aOffs; + anVISUActor->GetPosition(aOffs.myOffset); + myOffsets.append(aOffs); + } + } + } + } } } else { //if PointMap3d Actor if (VISU_ActorBase* anActorBase = dynamic_cast(anActor)) - if(anActorBase->GetVisibility() != 0) - if (VISU::PointMap3d_i* aPrs = dynamic_cast(anActorBase->GetFactory())) { - if(!myPointMapPrsMap.contains(aPrs)){ - Handle(SALOME_InteractiveObject) anIO = aPrs->GetIO(); - if(!anIO->hasEntry()) - continue; - SalomeApp_Study* aStudy = VISU::GetAppStudy(theModule); - VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, anIO->getEntry()); - if(_PTR(SObject) aSObject = anObjectInfo.mySObject){ - _PTR(GenericAttribute) anAttr; - if (aSObject->FindAttribute(anAttr, "AttributeName")) { - _PTR(AttributeName) aName(anAttr); - QString strIn(aName->Value().c_str()); - aPrsNames.append(strIn); - myPointMapPrsMap[aPrs] = myOffsets.count(); - Offset aOffs; - anActorBase->GetPosition(aOffs.myOffset); - myOffsets.append(aOffs); - } - } - } - } + if(anActorBase->GetVisibility() != 0) + if (VISU::PointMap3d_i* aPrs = dynamic_cast(anActorBase->GetFactory())) { + if(!myPointMapPrsMap.contains(aPrs)){ + Handle(SALOME_InteractiveObject) anIO = aPrs->GetIO(); + if(!anIO->hasEntry()) + continue; + SalomeApp_Study* aStudy = VISU::GetAppStudy(theModule); + VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, anIO->getEntry()); + if(_PTR(SObject) aSObject = anObjectInfo.mySObject){ + _PTR(GenericAttribute) anAttr; + if (aSObject->FindAttribute(anAttr, "AttributeName")) { + _PTR(AttributeName) aName(anAttr); + QString strIn(aName->Value().c_str()); + aPrsNames.append(strIn); + myPointMapPrsMap[aPrs] = myOffsets.count(); + Offset aOffs; + anActorBase->GetPosition(aOffs.myOffset); + myOffsets.append(aOffs); + } + } + } + } } } myFieldLst->addItems(aPrsNames); @@ -307,7 +307,7 @@ void ArrangeDlg::init() myFieldLst = new QListWidget(aManualPane); aHLay->addWidget( myFieldLst ); connect( myFieldLst, SIGNAL( currentRowChanged(int) ), - this, SLOT( onFieldChange(int) ) ); + this, SLOT( onFieldChange(int) ) ); QWidget* aCoordPane = new QWidget( aManualPane); aHLay->addWidget( aCoordPane ); @@ -477,8 +477,8 @@ void ArrangeDlg::acceptViewWindow() if (VISU_Actor* anActor = VISU::FindActor(myViewWindow, aPrs)) anActor->SetPosition(aOffs.myOffset); if (mySaveChk) - if (mySaveChk->isChecked()) - aPrs->SetOffset(aOffs.myOffset[0],aOffs.myOffset[1],aOffs.myOffset[2]); + if (mySaveChk->isChecked()) + aPrs->SetOffset(aOffs.myOffset[0],aOffs.myOffset[1],aOffs.myOffset[2]); } QMap::Iterator itt; for (itt = myPointMapPrsMap.begin(); itt != myPointMapPrsMap.end(); ++itt) { @@ -487,8 +487,8 @@ void ArrangeDlg::acceptViewWindow() if (VISU_ActorBase* anActor = VISU::FindActorBase(myViewWindow, aPrs)) anActor->SetPosition(aOffs.myOffset); if (mySaveChk) - if (mySaveChk->isChecked()) - aPrs->SetOffset(aOffs.myOffset[0],aOffs.myOffset[1],aOffs.myOffset[2]); + if (mySaveChk->isChecked()) + aPrs->SetOffset(aOffs.myOffset[0],aOffs.myOffset[1],aOffs.myOffset[2]); } } else { vtkFloatingPointType aDist = 0; @@ -500,26 +500,26 @@ void ArrangeDlg::acceptViewWindow() for (it = myPrsMap.begin(); it != myPrsMap.end(); ++it, i++) { VISU::Prs3d_i* aPrs = it.key(); if (VISU_Actor* aActor = VISU::FindActor(myViewWindow, aPrs)) { - int aAxis = getAxis(); + int aAxis = getAxis(); - vtkFloatingPointType aZeroOffset[3]; + vtkFloatingPointType aZeroOffset[3]; aZeroOffset[0] = aZeroOffset[1] = aZeroOffset[2] = 0; - aActor->SetPosition(aZeroOffset); + aActor->SetPosition(aZeroOffset); aActor->GetMapper()->Update(); - vtkFloatingPointType aBounds[6]; - aActor->GetBounds(aBounds); - switch (aAxis) { - case XAxis: - aDist = fabs(aBounds[1] - aBounds[0]); - break; - case YAxis: - aDist = fabs(aBounds[3] - aBounds[2]); - break; - case ZAxis: - aDist = fabs(aBounds[5] - aBounds[4]); - } - vtkFloatingPointType aOffset[3]; + vtkFloatingPointType aBounds[6]; + aActor->GetBounds(aBounds); + switch (aAxis) { + case XAxis: + aDist = fabs(aBounds[1] - aBounds[0]); + break; + case YAxis: + aDist = fabs(aBounds[3] - aBounds[2]); + break; + case ZAxis: + aDist = fabs(aBounds[5] - aBounds[4]); + } + vtkFloatingPointType aOffset[3]; aOffset[0] = aOffset[1] = aOffset[2] = 0; aOffset[aAxis] = (aBounds[2*aAxis+1] < aBounds[2*aAxis]) ? -aBounds[2*aAxis+1] : -aBounds[2*aAxis]; @@ -561,14 +561,14 @@ void ArrangeDlg::acceptViewWindow() aShift = aPrevShift + aPrevDist/2.0 + aCCDist*getDistance() - aDist/2.0; } - aOffset[aAxis] += aShift; - aActor->SetPosition(aOffset); - if (mySaveChk) - if (mySaveChk->isChecked()) - aPrs->SetOffset(aOffset[0],aOffset[1],aOffset[2]); + aOffset[aAxis] += aShift; + aActor->SetPosition(aOffset); + if (mySaveChk) + if (mySaveChk->isChecked()) + aPrs->SetOffset(aOffset[0],aOffset[1],aOffset[2]); - aPrevDist = aDist; - aPrevShift = aShift; + aPrevDist = aDist; + aPrevShift = aShift; } } // end of myPrsMap loop // Loop in PointMap3D the same as previous loop @@ -576,26 +576,26 @@ void ArrangeDlg::acceptViewWindow() for (itt = myPointMapPrsMap.begin(); itt != myPointMapPrsMap.end(); ++itt, i++) { VISU::PointMap3d_i* aPrs = itt.key(); if (VISU_ActorBase* aActor = VISU::FindActorBase(myViewWindow, aPrs)) { - int aAxis = getAxis(); + int aAxis = getAxis(); - vtkFloatingPointType aZeroOffset[3]; - aZeroOffset[0] = aZeroOffset[1] = aZeroOffset[2] = 0; - aActor->SetPosition(aZeroOffset); + vtkFloatingPointType aZeroOffset[3]; + aZeroOffset[0] = aZeroOffset[1] = aZeroOffset[2] = 0; + aActor->SetPosition(aZeroOffset); aActor->GetMapper()->Update(); - vtkFloatingPointType aBounds[6]; - aActor->GetBounds(aBounds); - switch (aAxis) { - case XAxis: - aDist = fabs(aBounds[1] - aBounds[0]); - break; - case YAxis: - aDist = fabs(aBounds[3] - aBounds[2]); - break; - case ZAxis: - aDist = fabs(aBounds[5] - aBounds[4]); - } - vtkFloatingPointType aOffset[3]; + vtkFloatingPointType aBounds[6]; + aActor->GetBounds(aBounds); + switch (aAxis) { + case XAxis: + aDist = fabs(aBounds[1] - aBounds[0]); + break; + case YAxis: + aDist = fabs(aBounds[3] - aBounds[2]); + break; + case ZAxis: + aDist = fabs(aBounds[5] - aBounds[4]); + } + vtkFloatingPointType aOffset[3]; aOffset[0] = aOffset[1] = aOffset[2] = 0; aOffset[aAxis] = (aBounds[2*aAxis+1] < aBounds[2*aAxis]) ? -aBounds[2*aAxis+1] : -aBounds[2*aAxis]; @@ -623,14 +623,14 @@ void ArrangeDlg::acceptViewWindow() aShift = aPrevShift + aPrevDist/2.0 + aCCDist*getDistance() - aDist/2.0; } - aOffset[aAxis] += aShift; - aActor->SetPosition(aOffset); - if (mySaveChk) - if (mySaveChk->isChecked()) - aPrs->SetOffset(aOffset[0],aOffset[1],aOffset[2]); + aOffset[aAxis] += aShift; + aActor->SetPosition(aOffset); + if (mySaveChk) + if (mySaveChk->isChecked()) + aPrs->SetOffset(aOffset[0],aOffset[1],aOffset[2]); - aPrevDist = aDist; - aPrevShift = aShift; + aPrevDist = aDist; + aPrevShift = aShift; } } // end of myPointMapPrsMap loop } @@ -670,10 +670,10 @@ protected: //------------------------------------------------------------------------ SetupDlg::SetupDlg (QWidget* theParent, - VisuGUI* theModule, - VISU_TimeAnimation* theAnimator) : + VisuGUI* theModule, + VISU_TimeAnimation* theAnimator) : QDialog(theParent, - Qt::WindowTitleHint | Qt::WindowSystemMenuHint), + Qt::WindowTitleHint | Qt::WindowSystemMenuHint), myAnimator(theAnimator), myModule(theModule), myIsRegenerate( false ) @@ -703,7 +703,7 @@ SetupDlg::SetupDlg (QWidget* theParent, aStep = (aMaxTime - aMinTime) / (myAnimator->getFieldData(0).myNbTimes - 1); else { // successive animation mode std::pair aLastFieldFrame(myAnimator->getNbFields() - 1, - myAnimator->getFieldData(myAnimator->getNbFields() - 1).myNbTimes - 1); + myAnimator->getFieldData(myAnimator->getNbFields() - 1).myNbTimes - 1); aStep = (aMaxTime - aMinTime) / myAnimator->getAbsoluteFrameNumber(aLastFieldFrame); } } @@ -719,11 +719,11 @@ SetupDlg::SetupDlg (QWidget* theParent, myMinVal->setText( QString::number( aMinTime ) ); // connect(myMinVal, SIGNAL( valueChanged(double)), - // this, SLOT( onMinValue(double) )); + // this, SLOT( onMinValue(double) )); connect( myMinVal, SIGNAL( returnPressed() ), this, SLOT( onMinValue() ) ); connect( myMinVal, SIGNAL( editingFinished() ), this, SLOT( onMinValue() ) ); // connect( myMinVal, SIGNAL( textChanged(const QString&)), -// this, SLOT( onMinValueEdit(const QString&) )); +// this, SLOT( onMinValueEdit(const QString&) )); aRangeLayout->addWidget(myMinVal); QLabel* aMaxLbl = new QLabel("To", myUseRangeBox); @@ -737,15 +737,15 @@ SetupDlg::SetupDlg (QWidget* theParent, myMaxVal->setText( QString::number( aMaxTime ) ); // connect(myMaxVal, SIGNAL( valueChanged(double)), - // this, SLOT( onMaxValue(double) )); + // this, SLOT( onMaxValue(double) )); connect( myMaxVal, SIGNAL( returnPressed() ), this, SLOT( onMaxValue() ) ); connect( myMaxVal, SIGNAL( editingFinished() ), this, SLOT( onMaxValue() ) ); // connect(myMaxVal, SIGNAL( textChanged(const QString&)), -// this, SLOT( onMaxValueEdit(const QString&) )); +// this, SLOT( onMaxValueEdit(const QString&) )); aRangeLayout->addWidget(myMaxVal); connect(myUseRangeBox, SIGNAL( toggled(bool)), - this, SLOT( onRangeCheck(bool) )); + this, SLOT( onRangeCheck(bool) )); aMainLayout->addWidget(myUseRangeBox); @@ -766,13 +766,13 @@ SetupDlg::SetupDlg (QWidget* theParent, myValues->setSelectionMode( QAbstractItemView::ExtendedSelection ); connect(myIndices, SIGNAL( textChanged(const QString&)), - this, SLOT( onIndicesChanged(const QString&) )); + this, SLOT( onIndicesChanged(const QString&) )); connect(myValues, SIGNAL( itemSelectionChanged() ), - this, SLOT( onValuesChanged() ) ); + this, SLOT( onValuesChanged() ) ); connect(myUseSequenceBox, SIGNAL( toggled(bool)), - this, SLOT( onSequenceCheck(bool) )); + this, SLOT( onSequenceCheck(bool) )); aUseSequenceLayout->addWidget( anIndicesLbl, 0, 0 ); aUseSequenceLayout->addWidget( myIndices, 0, 1 ); @@ -813,7 +813,7 @@ SetupDlg::SetupDlg (QWidget* theParent, if ( myAnimator->getAnimationMode() == VISU::Animation::PARALLEL ) { myFieldLst->setCurrentRow(0); connect( myFieldLst, SIGNAL( currentRowChanged(int) ), - this, SLOT( onFieldChange(int) ) ); + this, SLOT( onFieldChange(int) ) ); } else if ( myAnimator->getAnimationMode() == VISU::Animation::SUCCESSIVE ) myFieldLst->setSelectionMode(QAbstractItemView::NoSelection); @@ -832,18 +832,18 @@ SetupDlg::SetupDlg (QWidget* theParent, myTypeCombo = new QComboBox(aPropBox); aPropVBLay->addWidget( myTypeCombo ); connect( myTypeCombo, SIGNAL( activated(int) ), - this, SLOT( onTypeChanged(int) ) ); + this, SLOT( onTypeChanged(int) ) ); // QPushButton* aBarBtn = new QPushButton("Scalar Bar...", aPropBox); //connect( aBarBtn, SIGNAL( clicked() ), - // this, SLOT( onScalarBarDlg() ) ); + // this, SLOT( onScalarBarDlg() ) ); myPropBtn = new QPushButton("Properties...", aPropBox); myPropBtn->setAutoDefault( false ); aPropVBLay->addWidget( myPropBtn ); // myPropBtn->setEnabled(myAnimator->getFieldData(0).myPrsType != VISU::TSCALARMAP); connect( myPropBtn, SIGNAL( clicked() ), - this, SLOT( onPreferencesDlg() ) ); + this, SLOT( onPreferencesDlg() ) ); if (myAnimator->getNbFields() > 1 ) { if( myAnimator->getAnimationMode() == VISU::Animation::PARALLEL ) { @@ -1126,8 +1126,8 @@ namespace template void EditPrs(VisuGUI* theModule, - FieldData& theData, - VISU_TimeAnimation* theAnimator) + FieldData& theData, + VISU_TimeAnimation* theAnimator) { TDialog* aDlg = new TDialog(theModule); TPrs3d* aPrs3d = dynamic_cast(theData.myPrs[0]); @@ -1135,20 +1135,20 @@ namespace if (aDlg->exec() && aDlg->storeToPrsObject(dynamic_cast(aPrs3d))) { for (long aFrameId = 1; aFrameId < theData.myNbFrames; aFrameId++){ - VISU::ColoredPrs3d_i* aColoredPrs3d = theData.myPrs[aFrameId]; - aColoredPrs3d->SameAs(aPrs3d); + VISU::ColoredPrs3d_i* aColoredPrs3d = theData.myPrs[aFrameId]; + aColoredPrs3d->SameAs(aPrs3d); } if ( theAnimator->getAnimationMode() == VISU::Animation::SUCCESSIVE ) { - for (int aFieldId = 1; aFieldId < theAnimator->getNbFields(); aFieldId++) { - FieldData& aFieldData = theAnimator->getFieldData(aFieldId); - for (long aFrameId = 0; aFrameId < aFieldData.myNbFrames; aFrameId++) { - VISU::ColoredPrs3d_i* aColoredPrs3d = aFieldData.myPrs[aFrameId]; - std::string aTitle = aColoredPrs3d->GetCTitle(); - aColoredPrs3d->SameAs(aPrs3d); - aColoredPrs3d->SetTitle(aTitle.c_str()); - } - } + for (int aFieldId = 1; aFieldId < theAnimator->getNbFields(); aFieldId++) { + FieldData& aFieldData = theAnimator->getFieldData(aFieldId); + for (long aFrameId = 0; aFrameId < aFieldData.myNbFrames; aFrameId++) { + VISU::ColoredPrs3d_i* aColoredPrs3d = aFieldData.myPrs[aFrameId]; + std::string aTitle = aColoredPrs3d->GetCTitle(); + aColoredPrs3d->SameAs(aPrs3d); + aColoredPrs3d->SetTitle(aTitle.c_str()); + } + } } } delete aDlg; @@ -1177,7 +1177,7 @@ void SetupDlg::onPreferencesDlg() if ( myAnimator->getAnimationMode() == VISU::Animation::SUCCESSIVE ) { for (int i = 0; i < myAnimator->getNbFields(); i++) { if ( i != aRefFieldId && myAnimator->getFieldData(i).myPrs.empty() ) - myAnimator->generatePresentations(i); + myAnimator->generatePresentations(i); } } @@ -1427,16 +1427,16 @@ void SetupDlg::onValuesChanged() if( aPrevSelected ) { if( aNextSelected ) - aString = ""; + aString = ""; else - aString += ","; + aString += ","; } else { if( aNextSelected ) - aString += "-"; + aString += "-"; else - aString += ","; + aString += ","; } anIndices += aString; @@ -1462,8 +1462,8 @@ void SetupDlg::onValuesChanged() //------------------------------------------------------------------------ static const char * firstIco[] = { "18 10 2 1", -" g None", -". g #000000", +" g None", +". g #000000", " . . ", " .. .. .. ", " .. ... ... ", @@ -1478,8 +1478,8 @@ static const char * firstIco[] = { static const char * lastIco[] = { "18 10 2 1", -" g None", -". g #000000", +" g None", +". g #000000", " . . ", " .. .. .. ", " ... ... .. ", @@ -1494,8 +1494,8 @@ static const char * lastIco[] = { static const char * leftIco[] = { "11 10 2 1", -" g None", -". g #000000", +" g None", +". g #000000", " . .", " .. ..", " ... ...", @@ -1509,8 +1509,8 @@ static const char * leftIco[] = { static const char * playIco[] = { "14 14 2 1", -" g None", -". g #000000", +" g None", +". g #000000", " ", " ", " .. ", @@ -1531,8 +1531,8 @@ static QPixmap MYplayPixmap(playIco); static const char * rightIco[] = { "11 10 2 1", -" g None", -". g #000000", +" g None", +". g #000000", ". . ", ".. .. ", "... ... ", @@ -1547,8 +1547,8 @@ static const char * rightIco[] = { static const char * pauseIco[] = { "14 14 2 1", -" g None", -". g #000000", +" g None", +". g #000000", " ", " ", " .. .. ", @@ -1568,10 +1568,10 @@ static QPixmap MYpausePixmap(pauseIco); VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, - _PTR(Study) theStudy, - VISU::Animation::AnimationMode theMode) : + _PTR(Study) theStudy, + VISU::Animation::AnimationMode theMode) : QDialog(VISU::GetDesktop(theModule), - Qt::WindowTitleHint | Qt::WindowSystemMenuHint ), + Qt::WindowTitleHint | Qt::WindowSystemMenuHint ), myModule(theModule), mySetupDlg(NULL) { @@ -1586,7 +1586,7 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, myAnimator = new VISU_TimeAnimation (theStudy); myAnimator->setViewer(VISU::GetActiveViewWindow(theModule)); connect(myAnimator, SIGNAL(frameChanged(long, double)), this, SLOT(onExecution(long, double))); - connect(myAnimator, SIGNAL(stopped()), this, SLOT(onStop())); + connect(myAnimator, SIGNAL(stopped()), this, SLOT(onStop())); myAnimator->setAnimationMode(theMode); QVBoxLayout* aMainLayout = new QVBoxLayout(this); @@ -1595,12 +1595,12 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, mySetupBtn = new QPushButton("Setup Animation...", this); connect( mySetupBtn, SIGNAL( clicked() ), - this, SLOT( onSetupDlg() ) ); + this, SLOT( onSetupDlg() ) ); aMainLayout->addWidget(mySetupBtn); myGenBtn = new QPushButton("Generate frames", this); connect( myGenBtn, SIGNAL( clicked() ), - this, SLOT( createFrames() ) ); + this, SLOT( createFrames() ) ); aMainLayout->addWidget(myGenBtn); myPlayFrame = new QFrame(this); @@ -1624,38 +1624,38 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, //mySlider->setTickmarks(QSlider::Below); mySlider->setTracking(false); connect( mySlider, SIGNAL( sliderMoved(int) ), - this, SLOT( onWindowChanged(int) ) ); + this, SLOT( onWindowChanged(int) ) ); TopLayout->addWidget(mySlider, 1, 0, 1, 3); myPlayBtn = new QPushButton(myPlayFrame); myPlayBtn->setIcon(MYplayPixmap); myPlayBtn->setCheckable(true); connect( myPlayBtn, SIGNAL( clicked() ), - this, SLOT( onPlayPressed() ) ); + this, SLOT( onPlayPressed() ) ); TopLayout->addWidget(myPlayBtn, 2, 0, 1, 2); QPushButton* aBackBtn = new QPushButton(myPlayFrame); aBackBtn->setIcon(QPixmap(leftIco)); connect( aBackBtn, SIGNAL( clicked() ), - this, SLOT( onBackPressed() ) ); + this, SLOT( onBackPressed() ) ); TopLayout->addWidget(aBackBtn, 3, 0); QPushButton* aForvardBtn = new QPushButton(myPlayFrame); aForvardBtn->setIcon(QPixmap(rightIco)); connect( aForvardBtn, SIGNAL( clicked() ), - this, SLOT( onForvardPressed() ) ); + this, SLOT( onForvardPressed() ) ); TopLayout->addWidget(aForvardBtn, 3, 1); QPushButton* aFirstBtn = new QPushButton(myPlayFrame); aFirstBtn->setIcon(QPixmap(firstIco)); connect( aFirstBtn, SIGNAL( clicked() ), - this, SLOT( onFirstPressed() ) ); + this, SLOT( onFirstPressed() ) ); TopLayout->addWidget(aFirstBtn, 4, 0); QPushButton* aLastBtn = new QPushButton(myPlayFrame); aLastBtn->setIcon(QPixmap(lastIco)); connect( aLastBtn, SIGNAL( clicked() ), - this, SLOT( onLastPressed() ) ); + this, SLOT( onLastPressed() ) ); TopLayout->addWidget(aLastBtn, 4, 1); QLabel* aSpeedLbl = new QLabel("Speed", myPlayFrame); @@ -1671,9 +1671,9 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, aWheel->setRange(1, 99, 1); aWheel->setValue((int)myAnimator->getSpeed()); connect( aWheel, SIGNAL(valueChanged(double)), - aSpeedNum, SLOT(display(double)) ); + aSpeedNum, SLOT(display(double)) ); connect( aWheel, SIGNAL(valueChanged(double)), - this, SLOT(onSpeedChange(double)) ); + this, SLOT(onSpeedChange(double)) ); TopLayout->addWidget(aWheel, 1, 3, 3, 1, Qt::AlignRight); QCheckBox* aCycleCheck = new QCheckBox("Cycled animation",myPlayFrame); @@ -1719,7 +1719,7 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, connect(mySaveCheck, SIGNAL( toggled(bool)), myPicsFormat, SLOT( setEnabled(bool) )); connect(myPicsFormat, SIGNAL( activated (int)), - this, SLOT( onPicsFormatChanged())); + this, SLOT( onPicsFormatChanged())); QLabel* aPathLbl = new QLabel("Path:", aSaveBox); aPathLbl->setEnabled(false); @@ -1737,9 +1737,9 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, QPushButton* aBrowseBtn = new QPushButton("Browse...", aSaveBox); aBrowseBtn->setEnabled(false); connect(mySaveCheck, SIGNAL( toggled(bool)), - aBrowseBtn, SLOT( setEnabled(bool) )); + aBrowseBtn, SLOT( setEnabled(bool) )); connect(aBrowseBtn, SIGNAL( clicked()), - this, SLOT( onBrowse() )); + this, SLOT( onBrowse() )); mySaveCheck->setChecked(false); aSaveLay->addWidget(aBrowseBtn, 2, 2); @@ -1766,7 +1766,7 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, //connect(mySaveAVICheck, SIGNAL( toggled(bool)), // myBrowseAVIBtn, SLOT( setEnabled(bool) )); connect(myBrowseAVIBtn, SIGNAL( clicked()), - this, SLOT( onBrowseAVI() )); + this, SLOT( onBrowseAVI() )); aSaveLay->addWidget(myBrowseAVIBtn, 4, 2); mySaveAVICheck->setChecked(false); @@ -1876,18 +1876,18 @@ void VisuGUI_TimeAnimationDlg::createFrames() /* VISU::ColoredPrs3d_i* aPrs3d = dynamic_cast(aFieldData.myPrs[0]); if( !aPrs3d ) - continue; + continue; myAnimator->generatePresentations(i); aFieldData = myAnimator->getFieldData(i); for (long aFrameId = 0; aFrameId < aFieldData.myNbFrames; aFrameId++) { - VISU::ColoredPrs3d_i* aColoredPrs3d = aFieldData.myPrs[aFrameId]; - std::string aTitle = aColoredPrs3d->GetCTitle(); - aColoredPrs3d->SameAs(aPrs3d); - if ( aFrameId != 0 && myAnimator->getAnimationMode() == VISU::Animation::SUCCESSIVE ) { - aColoredPrs3d->SetTitle(aTitle.c_str()); - } + VISU::ColoredPrs3d_i* aColoredPrs3d = aFieldData.myPrs[aFrameId]; + std::string aTitle = aColoredPrs3d->GetCTitle(); + aColoredPrs3d->SameAs(aPrs3d); + if ( aFrameId != 0 && myAnimator->getAnimationMode() == VISU::Animation::SUCCESSIVE ) { + aColoredPrs3d->SetTitle(aTitle.c_str()); + } } */ } @@ -2085,7 +2085,7 @@ void VisuGUI_TimeAnimationDlg::onCheckDump(bool) onPicsFormatChanged(); onPathChanged(); if (mySaveAVICheck->isChecked()) - mySaveAVICheck->setChecked(false); + mySaveAVICheck->setChecked(false); } else { myAnimator->dumpTo(""); } @@ -2138,16 +2138,16 @@ void VisuGUI_TimeAnimationDlg::onHelp() if (app) app->onHelpContextModule(myModule ? app->moduleName(myModule->moduleName()) : QString(""), aHelpFileName); else { - QString platform; + QString platform; #ifdef WIN32 - platform = "winapplication"; + platform = "winapplication"; #else - platform = "application"; + platform = "application"; #endif SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"), - QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName), - QObject::tr("BUT_OK")); + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName), + QObject::tr("BUT_OK")); } } diff --git a/src/VISUGUI/VisuGUI_TimeAnimation.h b/src/VISUGUI/VisuGUI_TimeAnimation.h index d0aeec1f..40f40f67 100644 --- a/src/VISUGUI/VisuGUI_TimeAnimation.h +++ b/src/VISUGUI/VisuGUI_TimeAnimation.h @@ -77,11 +77,11 @@ class ArrangeDlg: public QDialog enum { XAxis, YAxis, ZAxis }; ArrangeDlg(QWidget* theParent, - VISU_TimeAnimation* theAnimator); + VISU_TimeAnimation* theAnimator); ArrangeDlg(QWidget* theParent, - const SalomeApp_Module* theModule, - SVTK_ViewWindow* theViewWindow); + const SalomeApp_Module* theModule, + SVTK_ViewWindow* theViewWindow); ~ArrangeDlg() {}; @@ -129,7 +129,7 @@ class SetupDlg : public QDialog public: SetupDlg( QWidget* theParent, VisuGUI* theModule, - VISU_TimeAnimation* theAnimator ); + VISU_TimeAnimation* theAnimator ); ~SetupDlg() {}; public: @@ -185,8 +185,8 @@ class VisuGUI_TimeAnimationDlg: public QDialog Q_OBJECT public: VisuGUI_TimeAnimationDlg(VisuGUI* theModule, - _PTR(Study) theStudy, - VISU::Animation::AnimationMode theMode = VISU::Animation::PARALLEL); + _PTR(Study) theStudy, + VISU::Animation::AnimationMode theMode = VISU::Animation::PARALLEL); ~VisuGUI_TimeAnimationDlg(); bool addField(_PTR(SObject) theField); diff --git a/src/VISUGUI/VisuGUI_Timer.cxx b/src/VISUGUI/VisuGUI_Timer.cxx index 206d3dd2..d78348b5 100644 --- a/src/VISUGUI/VisuGUI_Timer.cxx +++ b/src/VISUGUI/VisuGUI_Timer.cxx @@ -59,7 +59,7 @@ void VisuGUI_Timer::Start() SYSTEMTIME st; GetSystemTime(&st); SystemTimeToFileTime(&st, RefToInitialTMS); - time(RefToCurrentTimeB); + time(RefToCurrentTimeB); #endif } } @@ -81,8 +81,8 @@ void VisuGUI_Timer::Stop() GetSystemTime(&st); SystemTimeToFileTime(&st, RefToCurrentTMS); Cumul_user += (int)(((ULARGE_INTEGER*)(RefToCurrentTMS))->QuadPart - ((ULARGE_INTEGER*)(RefToInitialTMS))->QuadPart) / 10000000; - Cumul_sys = Cumul_user; - time(RefToCurrentTimeB); + Cumul_sys = Cumul_user; + time(RefToCurrentTimeB); #endif Stopped = 1; } diff --git a/src/VISUGUI/VisuGUI_Tools.cxx b/src/VISUGUI/VisuGUI_Tools.cxx index 4f1dbe03..665c0450 100644 --- a/src/VISUGUI/VisuGUI_Tools.cxx +++ b/src/VISUGUI/VisuGUI_Tools.cxx @@ -124,13 +124,13 @@ namespace VISU //------------------------------------------------------------ bool CheckLock( _PTR(Study) theStudy, - QWidget* theWidget ) + QWidget* theWidget ) { if(IsStudyLocked(theStudy)){ SUIT_MessageBox::warning(theWidget, QObject::tr("WRN_VISU_WARNING"), QObject::tr("WRN_STUDY_LOCKED") ); - return true; + return true; } return false; } @@ -146,8 +146,8 @@ namespace VISU //------------------------------------------------------------ LightApp_DataObject* FindDataObject(SUIT_DataObject* theDataObject, - const QString& theEntry, - int theLevel) + const QString& theEntry, + int theLevel) { int aLevel = theDataObject->level() + 2; QString aSourceEntry = theEntry.section(':',0,aLevel); @@ -156,15 +156,15 @@ namespace VISU DataObjectList::Iterator aDataObjectIter = aList.begin(); while( aDataObjectIter!= aList.end() ) { if(LightApp_DataObject* aChildDataObject = dynamic_cast(*aDataObjectIter)){ - QString anEntry = aChildDataObject->entry(); - QString aCurrentEntry = anEntry.section(':',0,aLevel); - if(aSourceEntry == aCurrentEntry){ - if(theLevel == aLevel){ - return aChildDataObject; - }else{ - return FindDataObject(aChildDataObject,theEntry,theLevel); - } - } + QString anEntry = aChildDataObject->entry(); + QString aCurrentEntry = anEntry.section(':',0,aLevel); + if(aSourceEntry == aCurrentEntry){ + if(theLevel == aLevel){ + return aChildDataObject; + }else{ + return FindDataObject(aChildDataObject,theEntry,theLevel); + } + } } aDataObjectIter++; } @@ -174,7 +174,7 @@ namespace VISU //------------------------------------------------------------ LightApp_DataObject* FindDataObject(CAM_Module* theModule, - _PTR(SObject) theSObject) + _PTR(SObject) theSObject) { CAM_DataModel* aDataModel = theModule->dataModel(); CAM_DataObject* aRootDataObject = aDataModel->root(); @@ -189,8 +189,8 @@ namespace VISU //------------------------------------------------------------ void UpdateObjBrowser(SalomeApp_Module* theModule, - bool theIsUpdateDataModel, - _PTR(SObject) theSObject) + bool theIsUpdateDataModel, + _PTR(SObject) theSObject) { LightApp_DataObject* aDataObject = NULL; if(theSObject) @@ -207,9 +207,9 @@ namespace VISU if ( theSObject ) { _PTR(GenericAttribute) anAttr; if (theSObject->FindAttribute( anAttr, "AttributeTableOfInteger" )) - return true; + return true; if (theSObject->FindAttribute( anAttr, "AttributeTableOfReal" )) - return true; + return true; } return false; } @@ -224,7 +224,7 @@ namespace VISU Engines::Component_var aComponent = aLCC.FindOrLoad_Component("FactoryServer","VISU"); VISU_Gen_var aVISU = VISU_Gen::_narrow(aComponent); if(!CORBA::is_nil(aVISU)) - aGen = VISU_Gen_i::GetVisuGenImpl(); + aGen = VISU_Gen_i::GetVisuGenImpl(); } if(aGen) @@ -264,18 +264,18 @@ namespace VISU SALOME_ListIteratorOfListIO anIter(aListIO); while(anIter.More()) { - Handle(SALOME_InteractiveObject) anIO = anIter.Value(); - if(anIO->hasEntry()) - { - TObjectInfo anObjectInfo = GetObjectByEntry(aStudy, anIO->getEntry()); - if(anObjectInfo.mySObject){ - TSelectionItem aSelectionItem; - aSelectionItem.myObjectInfo = anObjectInfo; - aSelectionItem.myIO = anIO; - aSelectionInfo.push_back(aSelectionItem); - } - } - anIter.Next(); // MULTIPR fixed + Handle(SALOME_InteractiveObject) anIO = anIter.Value(); + if(anIO->hasEntry()) + { + TObjectInfo anObjectInfo = GetObjectByEntry(aStudy, anIO->getEntry()); + if(anObjectInfo.mySObject){ + TSelectionItem aSelectionItem; + aSelectionItem.myObjectInfo = anObjectInfo; + aSelectionItem.myIO = anIO; + aSelectionInfo.push_back(aSelectionItem); + } + } + anIter.Next(); // MULTIPR fixed } } return aSelectionInfo; @@ -284,7 +284,7 @@ namespace VISU //---------------------------------------------------------------------------- TObjectInfo GetObjectByEntry(const SalomeApp_Study* theStudy, - const std::string& theEntry) + const std::string& theEntry) { TObjectInfo anObjectInfo; if(!theStudy || theEntry == "") @@ -295,7 +295,7 @@ namespace VISU anObjectInfo.mySObject = aSObject; CORBA::Object_var anObject = ClientSObjectToObject(aSObject); if(VISU::Base_i* aBase = GetServantInterface(anObject)) - anObjectInfo.myBase = aBase; + anObjectInfo.myBase = aBase; } return anObjectInfo; @@ -305,7 +305,7 @@ namespace VISU //---------------------------------------------------------------------------- VISU::Prs3d_i* GetPrs3dToModify(const SalomeApp_Module* theModule, - Base_i* theBase) + Base_i* theBase) { if (CheckLock(GetCStudy(GetAppStudy(theModule)), GetDesktop(theModule))) return NULL; @@ -330,9 +330,9 @@ namespace VISU //---------------------------------------------------------------------------- bool GetPrs3dSelectionInfo(const SalomeApp_Module* theModule, - VISU::Prs3d_i*& thePrs3d, - SVTK_ViewWindow*& theViewWindow, - VISU_Actor*& thenActor) + VISU::Prs3d_i*& thePrs3d, + SVTK_ViewWindow*& theViewWindow, + VISU_Actor*& thenActor) { VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(theModule); if(aSelectionInfo.empty()) @@ -369,7 +369,7 @@ namespace VISU //------------------------------------------------------------ void Remove(LightApp_SelectionMgr* theSelectionMgr, - const Handle(SALOME_InteractiveObject)& theIO) + const Handle(SALOME_InteractiveObject)& theIO) { if (theIO.IsNull()) return; SALOME_ListIO aListIO, aNewListIO; @@ -378,7 +378,7 @@ namespace VISU for (; anIter.More(); anIter.Next()) { Handle(SALOME_InteractiveObject) anIO = anIter.Value(); if (!anIO->isSame(theIO)) { - aNewListIO.Append(theIO); + aNewListIO.Append(theIO); } } theSelectionMgr->setSelectedObjects(aNewListIO); @@ -418,14 +418,14 @@ namespace VISU _PTR(GenericAttribute) anAttr; _PTR(AttributeString) aComment; - _PTR(SObject) aRefSObject; - if (aSObject->ReferencedObject(aRefSObject)) { - // It can be a reference on curve, published under a container. IPAL 20317 - VISU::TObjectInfo aRefObjectInfo = GetObjectByEntry(GetAppStudy(theModule), aRefSObject->GetID()); - VISU::Base_i* aRefBase = aRefObjectInfo.myBase; - if( (aRefBase && aRefBase->GetType() == VISU::TCURVE) || (aRefBase && aRefBase->GetType() == VISU::TMESH) ) - return true; - } + _PTR(SObject) aRefSObject; + if (aSObject->ReferencedObject(aRefSObject)) { + // It can be a reference on curve, published under a container. IPAL 20317 + VISU::TObjectInfo aRefObjectInfo = GetObjectByEntry(GetAppStudy(theModule), aRefSObject->GetID()); + VISU::Base_i* aRefBase = aRefObjectInfo.myBase; + if( (aRefBase && aRefBase->GetType() == VISU::TCURVE) || (aRefBase && aRefBase->GetType() == VISU::TMESH) ) + return true; + } bool isUnderVISU = false; _PTR(SObject) aFatherSObject = aSObject->GetFather(); @@ -499,8 +499,8 @@ namespace VISU //------------------------------------------------------------ void DeleteSObject(VisuGUI* theModule, - _PTR(Study) theStudy, - _PTR(SObject) theSObject) + _PTR(Study) theStudy, + _PTR(SObject) theSObject) { _PTR(ChildIterator) aChildIter = theStudy->NewChildIterator(theSObject); for (aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next()) { @@ -543,15 +543,15 @@ namespace VISU if(VISU::ColoredPrs3d_i* aColoredPrs3d = dynamic_cast(thePrs)){ std::string anEntry = aColoredPrs3d->GetHolderEntry(); if(anEntry != ""){ - VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(theModule), anEntry); - if(VISU::Base_i* aBase = anObjectInfo.myBase){ - if(aBase->GetType() == VISU::TCOLOREDPRS3DHOLDER){ - CORBA::Object_var anObject = aBase->_this(); - VISU::RemovableObject_var aRemovableObject = VISU::RemovableObject::_narrow(anObject); - aRemovableObject->RemoveFromStudy(); - return; - } - } + VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(theModule), anEntry); + if(VISU::Base_i* aBase = anObjectInfo.myBase){ + if(aBase->GetType() == VISU::TCOLOREDPRS3DHOLDER){ + CORBA::Object_var anObject = aBase->_this(); + VISU::RemovableObject_var aRemovableObject = VISU::RemovableObject::_narrow(anObject); + aRemovableObject->RemoveFromStudy(); + return; + } + } } } @@ -579,7 +579,7 @@ namespace VISU if(!aPrs3d) { aTable = dynamic_cast(aSelectionItem.myObjectInfo.myBase); if(!aTable) - return; + return; } SVTK_ViewWindow* aViewWindow = GetActiveViewWindow(theModule); @@ -589,46 +589,46 @@ namespace VISU if (aPrs3d) { anActor = FindActor(aViewWindow, aPrs3d); if(!anActor) - return; + return; } else { anActorBase = VISU::FindActorBase(aViewWindow, aTable); if(!anActorBase) - return; + return; } switch (theType) { case VISU::SHRINK: if (aPrs3d) { - bool toShrink; - if (anActor->IsShrunk()) { - anActor->UnShrink(); - toShrink = false; - } - else { - anActor->SetShrink(); - toShrink = true; - } - if (VISU::Mesh_i* aMesh = dynamic_cast(aPrs3d)) { - aMesh->SetShrink(toShrink); - } + bool toShrink; + if (anActor->IsShrunk()) { + anActor->UnShrink(); + toShrink = false; + } + else { + anActor->SetShrink(); + toShrink = true; + } + if (VISU::Mesh_i* aMesh = dynamic_cast(aPrs3d)) { + aMesh->SetShrink(toShrink); + } } else if (aTable) { - if (anActorBase->IsShrunk()) - anActorBase->UnShrink(); - else - anActorBase->SetShrink(); + if (anActorBase->IsShrunk()) + anActorBase->UnShrink(); + else + anActorBase->SetShrink(); } break; default: if (aPrs3d) { - if (VISU::Mesh_i* aMesh = dynamic_cast(aPrs3d)) { - aMesh->SetPresentationType(theType); - RecreateActor(theModule, aMesh); - } else { - anActor->SetRepresentation(theType); - } + if (VISU::Mesh_i* aMesh = dynamic_cast(aPrs3d)) { + aMesh->SetPresentationType(theType); + RecreateActor(theModule, aMesh); + } else { + anActor->SetRepresentation(theType); + } } else if (aTable) { - anActorBase->SetRepresentation(theType); + anActorBase->SetRepresentation(theType); } } aViewWindow->Repaint(); @@ -675,7 +675,7 @@ namespace VISU //------------------------------------------------------------ void SetShading ( const SalomeApp_Module* theModule, - bool theOn ) + bool theOn ) { TSelectionInfo aSelectionInfo = GetSelectedObjects(theModule); if(aSelectionInfo.empty()) @@ -706,7 +706,7 @@ namespace VISU CheckTimeStamp(const SalomeApp_Module* theModule, _PTR(SObject)& theSObject, Handle(SALOME_InteractiveObject)& theIO, - ColoredPrs3d_i::EPublishInStudyMode& thePublishInStudyMode) + ColoredPrs3d_i::EPublishInStudyMode& thePublishInStudyMode) { TSelectionInfo aSelectionInfo = GetSelectedObjects(theModule); if(!aSelectionInfo.empty()){ @@ -715,13 +715,13 @@ namespace VISU theSObject = aSelectionItem.myObjectInfo.mySObject; VISU::VISUType aType = VISU::Storable::SObject2Type(theSObject); if (VISU::TTIMESTAMP == aType){ - thePublishInStudyMode = ColoredPrs3d_i::EPublishUnderTimeStamp; + thePublishInStudyMode = ColoredPrs3d_i::EPublishUnderTimeStamp; return true; } if (VISU::TFIELD == aType){ - thePublishInStudyMode = ColoredPrs3d_i::EPublishIndependently; - if(theSObject->FindSubObject(2,theSObject)) - return true; + thePublishInStudyMode = ColoredPrs3d_i::EPublishIndependently; + if(theSObject->FindSubObject(2,theSObject)) + return true; } } SUIT_MessageBox::warning(GetDesktop(theModule), @@ -823,8 +823,8 @@ namespace VISU //------------------------------------------------------------ VISU_Actor* FindActor(const SalomeApp_Study* theStudy, - SVTK_ViewWindow* theViewWindow, - const QString& theEntry) + SVTK_ViewWindow* theViewWindow, + const QString& theEntry) { TObjectInfo anObjectInfo = GetObjectByEntry(theStudy, theEntry.toLatin1().data()); VISU::Prs3d_i* aPrs3d = GetPrs3dFromBase(anObjectInfo.myBase); @@ -834,8 +834,8 @@ namespace VISU //------------------------------------------------------------ VISU_ActorBase* FindActorBase(const SalomeApp_Study* theStudy, - SVTK_ViewWindow* theViewWindow, - const QString& theEntry) + SVTK_ViewWindow* theViewWindow, + const QString& theEntry) { TObjectInfo anObjectInfo = GetObjectByEntry(theStudy, theEntry.toLatin1().constData()); VISU::PointMap3d_i* aTable = dynamic_cast(anObjectInfo.myBase); @@ -850,7 +850,7 @@ namespace VISU QApplication::setOverrideCursor(Qt::WaitCursor); /* SALOMEDS::SObject_var aSObject = thePrs->GetSObject(); - CORBA::String_var anEntry = aSObject->GetID();*/ + CORBA::String_var anEntry = aSObject->GetID();*/ try { thePrs->UpdateActors(); @@ -870,8 +870,8 @@ namespace VISU //------------------------------------------------------------ bool ComputeVisiblePropBounds(SVTK_ViewWindow* theViewWindow, - vtkFloatingPointType allBounds[6], - const char* theActorClassName) + vtkFloatingPointType allBounds[6], + const char* theActorClassName) { vtkRenderer *aRen = theViewWindow->getRenderer(); VTK::ActorCollectionCopy aCopy(aRen->GetActors()); @@ -893,13 +893,13 @@ namespace VISU bounds[2] > -VTK_LARGE_FLOAT && bounds[3] < VTK_LARGE_FLOAT && bounds[4] > -VTK_LARGE_FLOAT && bounds[5] < VTK_LARGE_FLOAT) { - somethingVisible = true; - if (bounds[0] < allBounds[0]) allBounds[0] = bounds[0]; - if (bounds[1] > allBounds[1]) allBounds[1] = bounds[1]; - if (bounds[2] < allBounds[2]) allBounds[2] = bounds[2]; - if (bounds[3] > allBounds[3]) allBounds[3] = bounds[3]; - if (bounds[4] < allBounds[4]) allBounds[4] = bounds[4]; - if (bounds[5] > allBounds[5]) allBounds[5] = bounds[5]; + somethingVisible = true; + if (bounds[0] < allBounds[0]) allBounds[0] = bounds[0]; + if (bounds[1] > allBounds[1]) allBounds[1] = bounds[1]; + if (bounds[2] < allBounds[2]) allBounds[2] = bounds[2]; + if (bounds[3] > allBounds[3]) allBounds[3] = bounds[3]; + if (bounds[4] < allBounds[4]) allBounds[4] = bounds[4]; + if (bounds[5] > allBounds[5]) allBounds[5] = bounds[5]; }//not bogus } } @@ -1009,7 +1009,7 @@ namespace VISU //------------------------------------------------------------ void PlotRemoveCurve(const SalomeApp_Module* theModule, - VISU::Curve_i* pCrv) + VISU::Curve_i* pCrv) { // implementation moved to VISU_I package (see VISU_Tools.h) VISU::PlotRemoveCurve( theModule->getApp(), pCrv ); @@ -1054,10 +1054,10 @@ namespace VISU // Others VISU::Mesh_i* CreateMesh(VisuGUI* theModule, - const Handle(SALOME_InteractiveObject)& theIO, - SVTK_ViewWindow* theViewWindow) + const Handle(SALOME_InteractiveObject)& theIO, + SVTK_ViewWindow* theViewWindow) { - _PTR(Study) aStudy = GetCStudy(GetAppStudy(theModule)); + _PTR(Study) aStudy = GetCStudy(GetAppStudy(theModule)); //if (CheckLock(aStudy)) // return; @@ -1119,13 +1119,13 @@ namespace VISU timer.Start(); #endif if(GetResourceMgr()->booleanValue("VISU","display_only",false)){ - const VisuGUI* av = dynamic_cast(theModule); - if(av)(const_cast(av))->OnEraseAll(); - } + const VisuGUI* av = dynamic_cast(theModule); + if(av)(const_cast(av))->OnEraseAll(); + } PublishMeshInView(theModule, pPresent, theViewWindow); if(GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)){ - SetFitAll(theViewWindow); - } + SetFitAll(theViewWindow); + } #ifdef CHECKTIME timer.Stop(); MESSAGE("VisuGUI::CreateMesh() - DISPLAY MESH"); @@ -1291,7 +1291,7 @@ namespace VISU if (aViewToPrsIter != aMap.end()) { TSetPrs3d::const_iterator aPrsIter = (aViewToPrsIter->second).begin(); for (; aPrsIter != (aViewToPrsIter->second).end(); aPrsIter++) { - aIndexes.insert((*aPrsIter).second); + aIndexes.insert((*aPrsIter).second); } } std::set::const_iterator aIter = aIndexes.begin(); @@ -1320,21 +1320,21 @@ namespace VISU TSetPrs3d::iterator aIter = aMap[theViewWindow].begin(); for (; aIter != aMap[theViewWindow].end(); aIter++) if ((*aIter).first == thePrs3d) { - aMap[theViewWindow].erase(*aIter); - return; + aMap[theViewWindow].erase(*aIter); + return; } } //------------------------------------------------------------ void initSpinBox( QSpinBox* spinBox, - int min, int max, int step ) + int min, int max, int step ) { spinBox->setRange( min, max ); spinBox->setSingleStep( step ); } //------------------------------------------------------------ void initSpinBox( QDoubleSpinBox* spinBox, - double min, double max, - double step, int decimals ) + double min, double max, + double step, int decimals ) { spinBox->setRange( min, max ); spinBox->setSingleStep( step ); diff --git a/src/VISUGUI/VisuGUI_Tools.h b/src/VISUGUI/VisuGUI_Tools.h index 6e0cb98e..33c55c7b 100644 --- a/src/VISUGUI/VisuGUI_Tools.h +++ b/src/VISUGUI/VisuGUI_Tools.h @@ -77,14 +77,14 @@ namespace VISU bool IsStudyLocked( _PTR(Study) theStudy ); bool CheckLock( _PTR(Study) theStudy, - QWidget* theWidget ); + QWidget* theWidget ); //---------------------------------------------------------------------------- int runAndWait( QDialog* dlg, const bool modal ); void UpdateObjBrowser(SalomeApp_Module* theModule, - bool theIsUpdateDataModel = true, - _PTR(SObject) theSObject = _PTR(SObject)()); + bool theIsUpdateDataModel = true, + _PTR(SObject) theSObject = _PTR(SObject)()); //---------------------------------------------------------------------------- VISU_Gen_i* GetVisuGen(const CAM_Module* theModule); @@ -114,41 +114,41 @@ namespace VISU TSelectionInfo GetSelectedObjects(const SalomeApp_Module* theModule); TObjectInfo GetObjectByEntry(const SalomeApp_Study* theStudy, - const std::string& theEntry); + const std::string& theEntry); VISU::Prs3d_i* GetPrs3dToModify(const SalomeApp_Module* theModule, - Base_i* theBase); + Base_i* theBase); VISU::Prs3d_i* GetPrs3dFromBase(Base_i* theBase); bool GetPrs3dSelectionInfo( const SalomeApp_Module* theModule, - VISU::Prs3d_i*& thePrs3d, - SVTK_ViewWindow*& theViewWindow, - VISU_Actor*& thenActor ); + VISU::Prs3d_i*& thePrs3d, + SVTK_ViewWindow*& theViewWindow, + VISU_Actor*& thenActor ); //---------------------------------------------------------------------------- void Add(LightApp_SelectionMgr* theSelectionMgr, - const Handle(SALOME_InteractiveObject)& theIO); + const Handle(SALOME_InteractiveObject)& theIO); void Remove(LightApp_SelectionMgr* theSelectionMgr, - const Handle(SALOME_InteractiveObject)& theIO); + const Handle(SALOME_InteractiveObject)& theIO); bool IsRemovable (const std::string theEntry, - const SalomeApp_Module* theModule); + const SalomeApp_Module* theModule); bool IsRemovableSelected(const SalomeApp_Module* theModule); void DeleteSObject(VisuGUI* theModule, - _PTR(Study) theStudy, - _PTR(SObject) theSObject); + _PTR(Study) theStudy, + _PTR(SObject) theSObject); void DeletePrs3d(VisuGUI* theModule, - VISU::Prs3d_i* thePrs); + VISU::Prs3d_i* thePrs); // Presentation management void ChangeRepresentation (const SalomeApp_Module* theModule, - VISU::PresentationType theType); + VISU::PresentationType theType); void ChangeQuadratic2DRepresentation (const SalomeApp_Module* theModule, - VISU::Quadratic2DPresentationType theType); + VISU::Quadratic2DPresentationType theType); @@ -156,19 +156,19 @@ namespace VISU // SObject type bool CheckTimeStamp(const SalomeApp_Module* theModule, - _PTR(SObject)& theSObject, - Handle(SALOME_InteractiveObject)& theIO, - ColoredPrs3d_i::EPublishInStudyMode& thePublishInStudyMode); + _PTR(SObject)& theSObject, + Handle(SALOME_InteractiveObject)& theIO, + ColoredPrs3d_i::EPublishInStudyMode& thePublishInStudyMode); VISU::Result_i* CheckResult(const SalomeApp_Module* theModule, - _PTR(SObject) theSource, - VISU::Result_var& theResult); + _PTR(SObject) theSource, + VISU::Result_var& theResult); bool IsSObjectTable(_PTR(SObject) theSObject); /*! Display mesh presentation in given VTK view window */ VISU_Actor* PublishMeshInView(const SalomeApp_Module* theModule, - VISU::Prs3d_i* thePrs, - SVTK_ViewWindow* theViewWindow); + VISU::Prs3d_i* thePrs, + SVTK_ViewWindow* theViewWindow); /*! * \brief Repaint all SVTK view windows, where the given object is displayed. @@ -176,20 +176,20 @@ namespace VISU * \param theIObject - is supposed to be selected (is highlighted in this method). */ void RepaintViewWindows(const SalomeApp_Module* theModule, - const Handle(SALOME_InteractiveObject)& theIObject); + const Handle(SALOME_InteractiveObject)& theIObject); VISU_Actor* FindActor(const SalomeApp_Study* theStudy, - SVTK_ViewWindow* theViewWindow, - const QString& theEntry); + SVTK_ViewWindow* theViewWindow, + const QString& theEntry); VISU_ActorBase* FindActorBase(const SalomeApp_Study* theStudy, - SVTK_ViewWindow* theViewWindow, - const QString& theEntry); + SVTK_ViewWindow* theViewWindow, + const QString& theEntry); void RecreateActor(const SalomeApp_Module* theModule, - VISU::Prs3d_i* thePrs); + VISU::Prs3d_i* thePrs); bool ComputeVisiblePropBounds(SVTK_ViewWindow* theViewWindow, - vtkFloatingPointType allBounds[6], - const char* theActorClassName = "VISU_Actor"); + vtkFloatingPointType allBounds[6], + const char* theActorClassName = "VISU_Actor"); /*! * \brief Advanced FitAll, sets view projection in accordance with current view contents @@ -204,41 +204,41 @@ namespace VISU // Plot2d View SPlot2d_Viewer* GetPlot2dViewer(const SalomeApp_Module* theModule, - const bool theCreate = false); + const bool theCreate = false); void PlotTable( const SalomeApp_Module* theModule, - VISU::Table_i* table, - int theDisplaying ); + VISU::Table_i* table, + int theDisplaying ); void PlotCurve( const SalomeApp_Module* theModule, - VISU::Curve_i* curve, - int theDisplaying ); + VISU::Curve_i* curve, + int theDisplaying ); void PlotRemoveCurve(const SalomeApp_Module* theModule, - VISU::Curve_i* curve); + VISU::Curve_i* curve); void PlotContainer( const SalomeApp_Module* theModule, - VISU::Container_i* container, - int theDisplaying ); + VISU::Container_i* container, + int theDisplaying ); void CreatePlot( SalomeApp_Module* theModule, - _PTR(SObject) theSobj ); + _PTR(SObject) theSobj ); /*! Create mesh presentation and display it in \a theViewWindow. * If \a theViewWindow is NULL, no displaying will be done. */ VISU::Mesh_i* CreateMesh(VisuGUI* theModule, - const Handle(SALOME_InteractiveObject)& theIO, - SVTK_ViewWindow* theViewWindow); + const Handle(SALOME_InteractiveObject)& theIO, + SVTK_ViewWindow* theViewWindow); // Others std::vector GetPrs3dList (const SalomeApp_Module* theModule, - const Handle(SALOME_InteractiveObject)& theIO, - bool theGP = false); + const Handle(SALOME_InteractiveObject)& theIO, + bool theGP = false); std::vector GetPrs3dList (const SalomeApp_Module* theModule, - _PTR(SObject) theObject, - bool theGP = false); + _PTR(SObject) theObject, + bool theGP = false); int GetFreePositionOfDefaultScalarBar(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow); void AddScalarBarPosition(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow, - VISU::Prs3d_i* thePrs3d, int pos); + VISU::Prs3d_i* thePrs3d, int pos); void RemoveScalarBarPosition(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow, - VISU::Prs3d_i* thePrs3d); + VISU::Prs3d_i* thePrs3d); void initSpinBox( QSpinBox*, int, int, int = 1 ); void initSpinBox( QDoubleSpinBox*, double, double, double = 0.1, int = 6 ); diff --git a/src/VISUGUI/VisuGUI_TransparencyDlg.cxx b/src/VISUGUI/VisuGUI_TransparencyDlg.cxx index 7ce9dd71..0227625a 100644 --- a/src/VISUGUI/VisuGUI_TransparencyDlg.cxx +++ b/src/VISUGUI/VisuGUI_TransparencyDlg.cxx @@ -183,11 +183,11 @@ void VisuGUI_TransparencyDlg::ClickOnHelp() app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); } else { - QString platform; + QString platform; #ifdef WIN32 - platform = "winapplication"; + platform = "winapplication"; #else - platform = "application"; + platform = "application"; #endif SUIT_MessageBox::warning(0, tr("WRN_WARNING"), tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). @@ -215,9 +215,9 @@ void VisuGUI_TransparencyDlg::SetTransparency() Handle(SALOME_InteractiveObject) anIO = anIter.Value(); VISU_Actor* anActor = VISU::FindActor(VISU::GetAppStudy(myModule), myViewWindow, anIO->getEntry()); if (anActor) - anActor->SetOpacity(opacity); + anActor->SetOpacity(opacity); else { - VISU_ActorBase* anActor = VISU::FindActorBase(VISU::GetAppStudy(myModule), myViewWindow, anIO->getEntry()); + VISU_ActorBase* anActor = VISU::FindActorBase(VISU::GetAppStudy(myModule), myViewWindow, anIO->getEntry()); if (anActor) anActor->SetOpacity(opacity); } @@ -251,30 +251,30 @@ void VisuGUI_TransparencyDlg::onSelectionChanged() if (aList.Extent() == 1) { Handle(SALOME_InteractiveObject) FirstIOS = aList.First(); if (!FirstIOS.IsNull()) { - VISU_Actor* anActor = VISU::FindActor(VISU::GetAppStudy(myModule), myViewWindow, FirstIOS->getEntry()); - if (anActor) - opacity = int(anActor->GetOpacity() * 100. + 0.5); + VISU_Actor* anActor = VISU::FindActor(VISU::GetAppStudy(myModule), myViewWindow, FirstIOS->getEntry()); + if (anActor) + opacity = int(anActor->GetOpacity() * 100. + 0.5); } } else if (aList.Extent() > 1) { SALOME_ListIteratorOfListIO It (aList); int setOp = -1; for (; It.More(); It.Next()) { - Handle(SALOME_InteractiveObject) IO = It.Value(); - if (!IO.IsNull()) { - VISU_Actor* anActor = VISU::FindActor(VISU::GetAppStudy(myModule), myViewWindow, IO->getEntry()); - if (anActor) { - int op = int(anActor->GetOpacity() * 100. + 0.5); - if (setOp < 0) - setOp = op; - else if (setOp != op) { - setOp = 100; - break; - } - } - } + Handle(SALOME_InteractiveObject) IO = It.Value(); + if (!IO.IsNull()) { + VISU_Actor* anActor = VISU::FindActor(VISU::GetAppStudy(myModule), myViewWindow, IO->getEntry()); + if (anActor) { + int op = int(anActor->GetOpacity() * 100. + 0.5); + if (setOp < 0) + setOp = op; + else if (setOp != op) { + setOp = 100; + break; + } + } + } } if (setOp >= 0) - opacity = setOp; + opacity = setOp; } else { } Slider1->setValue(opacity); diff --git a/src/VISUGUI/VisuGUI_TransparencyDlg.h b/src/VISUGUI/VisuGUI_TransparencyDlg.h index 5fb54f87..9f9af30e 100644 --- a/src/VISUGUI/VisuGUI_TransparencyDlg.h +++ b/src/VISUGUI/VisuGUI_TransparencyDlg.h @@ -50,7 +50,7 @@ class VisuGUI_TransparencyDlg : public QDialog public: VisuGUI_TransparencyDlg( VisuGUI* = 0, - bool modal = false ); + bool modal = false ); ~VisuGUI_TransparencyDlg(); diff --git a/src/VISUGUI/VisuGUI_VectorsDlg.cxx b/src/VISUGUI/VisuGUI_VectorsDlg.cxx index e46f4498..640c6f13 100644 --- a/src/VISUGUI/VisuGUI_VectorsDlg.cxx +++ b/src/VISUGUI/VisuGUI_VectorsDlg.cxx @@ -232,7 +232,7 @@ VisuGUI_VectorsDlg::~VisuGUI_VectorsDlg() {} void VisuGUI_VectorsDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs, - bool theInit ) + bool theInit ) { if ( theInit ) myPrsCopy = VISU::TSameAsFactory().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish); diff --git a/src/VISUGUI/VisuGUI_VectorsDlg.h b/src/VISUGUI/VisuGUI_VectorsDlg.h index dee5ef5a..6e0562d3 100644 --- a/src/VISUGUI/VisuGUI_VectorsDlg.h +++ b/src/VISUGUI/VisuGUI_VectorsDlg.h @@ -77,7 +77,7 @@ public: void enableMagnColor( bool enable ); virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs, - bool theInit ); + bool theInit ); virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs); diff --git a/src/VISUGUI/VisuGUI_ViewExtender.cxx b/src/VISUGUI/VisuGUI_ViewExtender.cxx index 243108d9..3dff1134 100644 --- a/src/VISUGUI/VisuGUI_ViewExtender.cxx +++ b/src/VISUGUI/VisuGUI_ViewExtender.cxx @@ -97,9 +97,9 @@ void VisuGUI_ViewExtender::activate(SUIT_ViewModel* theViewer) if (!myViewers.contains(aViewer)) { SUIT_ViewManager* aMgr = aViewer->getViewManager(); connect(aMgr, SIGNAL(deleteView(SUIT_ViewWindow*)), - this, SLOT(onViewDeleted(SUIT_ViewWindow*))); + this, SLOT(onViewDeleted(SUIT_ViewWindow*))); connect(aViewer, SIGNAL(actorAdded(SVTK_ViewWindow*, VTKViewer_Actor*)), - this, SLOT(onAddActor(SVTK_ViewWindow*, VTKViewer_Actor*))); + this, SLOT(onAddActor(SVTK_ViewWindow*, VTKViewer_Actor*))); myViewers.append(aViewer); } } diff --git a/src/VISUGUI/VisuGUI_ViewTools.cxx b/src/VISUGUI/VisuGUI_ViewTools.cxx index e1339401..65aaeed9 100644 --- a/src/VISUGUI/VisuGUI_ViewTools.cxx +++ b/src/VISUGUI/VisuGUI_ViewTools.cxx @@ -39,29 +39,29 @@ namespace VISU VISU_Actor* PublishInView(VisuGUI* theModule, Prs3d_i* thePrs, - SVTK_ViewWindow* theViewWindow, - bool theIsHighlight) + SVTK_ViewWindow* theViewWindow, + bool theIsHighlight) { if (theViewWindow) { QApplication::setOverrideCursor( Qt::WaitCursor ); try { - if (VISU_Actor* anActor = thePrs->CreateActor()) { - theViewWindow->AddActor(anActor); - if (theIsHighlight) - theViewWindow->highlight(anActor->getIO(),true); - theViewWindow->getRenderer()->ResetCameraClippingRange(); - theViewWindow->Repaint(); - QApplication::restoreOverrideCursor(); - return anActor; - } + if (VISU_Actor* anActor = thePrs->CreateActor()) { + theViewWindow->AddActor(anActor); + if (theIsHighlight) + theViewWindow->highlight(anActor->getIO(),true); + theViewWindow->getRenderer()->ResetCameraClippingRange(); + theViewWindow->Repaint(); + QApplication::restoreOverrideCursor(); + return anActor; + } } catch(std::exception& exc) { - thePrs->RemoveActors(); + thePrs->RemoveActors(); - QApplication::restoreOverrideCursor(); - INFOS(exc.what()); - SUIT_MessageBox::warning - (GetDesktop(theModule), QObject::tr("WRN_VISU"), - QObject::tr("ERR_CANT_CREATE_ACTOR") + ": " + QObject::tr(exc.what())); + QApplication::restoreOverrideCursor(); + INFOS(exc.what()); + SUIT_MessageBox::warning + (GetDesktop(theModule), QObject::tr("WRN_VISU"), + QObject::tr("ERR_CANT_CREATE_ACTOR") + ": " + QObject::tr(exc.what())); } } return NULL; @@ -73,7 +73,7 @@ namespace VISU UpdateViewer(VisuGUI* theModule, VISU::Prs3d_i* thePrs, bool theDispOnly, - const bool theIsHighlight) + const bool theIsHighlight) { if (SVTK_ViewWindow* aViewWindow = GetActiveViewWindow(theModule)) { vtkRenderer *aRen = aViewWindow->getRenderer(); @@ -83,36 +83,36 @@ namespace VISU VISU_Actor* aResActor = NULL; bool isOk = true; while (vtkActor *anAct = anActColl->GetNextActor()) { - if (VISU_Actor* anActor = dynamic_cast(anAct)) { - if (VISU::Prs3d_i* aPrs3d = anActor->GetPrs3d()) { - if (thePrs == aPrs3d) { - try { - aResActor = anActor; - thePrs->UpdateActors(); - aResActor->VisibilityOn(); - } catch (std::runtime_error& exc) { - thePrs->RemoveActors(); - isOk = false; + if (VISU_Actor* anActor = dynamic_cast(anAct)) { + if (VISU::Prs3d_i* aPrs3d = anActor->GetPrs3d()) { + if (thePrs == aPrs3d) { + try { + aResActor = anActor; + thePrs->UpdateActors(); + aResActor->VisibilityOn(); + } catch (std::runtime_error& exc) { + thePrs->RemoveActors(); + isOk = false; - INFOS(exc.what()); - SUIT_MessageBox::warning - (GetDesktop(theModule), QObject::tr("WRN_VISU"), - QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()) ); - } - } else if (theDispOnly) { - anActor->VisibilityOff(); - } - } else if (theDispOnly && anActor->GetVisibility()) { - anActor->VisibilityOff(); - } - } + INFOS(exc.what()); + SUIT_MessageBox::warning + (GetDesktop(theModule), QObject::tr("WRN_VISU"), + QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()) ); + } + } else if (theDispOnly) { + anActor->VisibilityOff(); + } + } else if (theDispOnly && anActor->GetVisibility()) { + anActor->VisibilityOff(); + } + } } if (aResActor) { - if (theIsHighlight && isOk) - aViewWindow->highlight(aResActor->getIO(), true); - aViewWindow->getRenderer()->ResetCameraClippingRange(); - aViewWindow->Repaint(); - return aResActor; + if (theIsHighlight && isOk) + aViewWindow->highlight(aResActor->getIO(), true); + aViewWindow->getRenderer()->ResetCameraClippingRange(); + aViewWindow->Repaint(); + return aResActor; } return PublishInView(theModule, thePrs, aViewWindow, theIsHighlight); } @@ -124,13 +124,13 @@ namespace VISU void ErasePrs3d(VisuGUI* theModule, VISU::Prs3d_i* thePrs, - bool theDoRepaint) + bool theDoRepaint) { if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow(theModule)){ if(VISU_Actor* anActor = FindActor(aViewWindow, thePrs)){ anActor->VisibilityOff(); - if(theDoRepaint) - aViewWindow->Repaint(); + if(theDoRepaint) + aViewWindow->Repaint(); } } } @@ -138,8 +138,8 @@ namespace VISU //---------------------------------------------------------------------------- void ErasePrs(VisuGUI* theModule, - Base_i* theBase, - bool theDoRepaint) + Base_i* theBase, + bool theDoRepaint) { if(!theBase) return; @@ -147,40 +147,40 @@ namespace VISU switch (theBase->GetType()) { case VISU::TCURVE: { if (VISU::Curve_i* aCurve = dynamic_cast(theBase)) - PlotCurve(theModule, aCurve, VISU::eErase ); + PlotCurve(theModule, aCurve, VISU::eErase ); break; } case VISU::TCONTAINER: { if (VISU::Container_i* aContainer = dynamic_cast(theBase)) - PlotContainer(theModule, aContainer, VISU::eErase ); + PlotContainer(theModule, aContainer, VISU::eErase ); break; } case VISU::TTABLE: { if (VISU::Table_i* aTable = dynamic_cast(theBase)) - PlotTable(theModule, aTable, VISU::eErase ); + PlotTable(theModule, aTable, VISU::eErase ); break; } case VISU::TPOINTMAP3D: { if (VISU::PointMap3d_i* aTable3d = dynamic_cast(theBase)) { - if (SVTK_ViewWindow* aViewWindow = GetActiveViewWindow(theModule)) { - if(VISU_ActorBase* anActor = FindActorBase(aViewWindow, aTable3d)){ - anActor->VisibilityOff(); - if(theDoRepaint) - aViewWindow->Repaint(); - } - } else { - if (VISU::Table_i* aTable = dynamic_cast(theBase)) - PlotTable(theModule, aTable, VISU::eErase ); - } + if (SVTK_ViewWindow* aViewWindow = GetActiveViewWindow(theModule)) { + if(VISU_ActorBase* anActor = FindActorBase(aViewWindow, aTable3d)){ + anActor->VisibilityOff(); + if(theDoRepaint) + aViewWindow->Repaint(); + } + } else { + if (VISU::Table_i* aTable = dynamic_cast(theBase)) + PlotTable(theModule, aTable, VISU::eErase ); + } } break; } default: { if(VISU::Prs3d_i* aPrs3d = VISU::GetPrs3dFromBase(theBase)){ - if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow(theModule)){ - RemoveScalarBarPosition(theModule, aViewWindow, aPrs3d); - ErasePrs3d(theModule, aPrs3d, theDoRepaint); - } + if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow(theModule)){ + RemoveScalarBarPosition(theModule, aViewWindow, aPrs3d); + ErasePrs3d(theModule, aPrs3d, theDoRepaint); + } } }} // switch (aType) } diff --git a/src/VISUGUI/VisuGUI_ViewTools.h b/src/VISUGUI/VisuGUI_ViewTools.h index 432b7947..772d780a 100644 --- a/src/VISUGUI/VisuGUI_ViewTools.h +++ b/src/VISUGUI/VisuGUI_ViewTools.h @@ -81,17 +81,17 @@ namespace VISU typedef typename TViewer::TViewWindow TViewWindow; if (SalomeApp_Application* anApp = theModule->getApp()) { if (TViewWindow* aView = dynamic_cast(anApp->desktop()->activeWindow())) - return aView; + return aView; } SUIT_ViewManager* aViewManager = theModule->getViewManager(TViewer::Type(), /*create = */true); if (aViewManager) { if (SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView()) { - if (TViewWindow* aView = dynamic_cast(aViewWindow)) { - aViewWindow->raise(); - aViewWindow->setFocus(); - return aView; - } + if (TViewWindow* aView = dynamic_cast(aViewWindow)) { + aViewWindow->raise(); + aViewWindow->setFocus(); + return aView; + } } } return NULL; @@ -111,12 +111,12 @@ namespace VISU anApp = theModule->getApp(); else anApp = dynamic_cast - (SUIT_Session::session()->activeApplication()); + (SUIT_Session::session()->activeApplication()); if (anApp) if (SUIT_ViewManager* aViewManager = anApp->activeViewManager()) - if (SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView()) - return dynamic_cast(aViewWindow); + if (SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView()) + return dynamic_cast(aViewWindow); return NULL; } @@ -126,8 +126,8 @@ namespace VISU VISU_Actor* PublishInView(VisuGUI* theModule, Prs3d_i* thePrs, - SVTK_ViewWindow* theViewWindow, - const bool theIsHighlight = false); + SVTK_ViewWindow* theViewWindow, + const bool theIsHighlight = false); //--------------------------------------------------------------- @@ -135,7 +135,7 @@ namespace VISU UpdateViewer(VisuGUI* theModule, VISU::Prs3d_i* thePrs, bool theDispOnly = false, - const bool theIsHighlight = false); + const bool theIsHighlight = false); //--------------------------------------------------------------- @@ -148,16 +148,16 @@ namespace VISU if (TViewWindow* aViewWindow = GetActiveViewWindow(theModule)) { aViewWindow->unHighlightAll(); if (vtkRenderer *aRen = aViewWindow->getRenderer()) { - VTK::ActorCollectionCopy aCopy(aRen->GetActors()); - vtkActorCollection *aCollection = aCopy.GetActors(); - aCollection->InitTraversal(); - while (vtkActor *anAct = aCollection->GetNextActor()) { - if (anAct->GetVisibility() > 0) - if (SALOME_Actor* anActor = dynamic_cast(anAct)) { - anActor->VisibilityOff(); - } - } - aViewWindow->Repaint(); + VTK::ActorCollectionCopy aCopy(aRen->GetActors()); + vtkActorCollection *aCollection = aCopy.GetActors(); + aCollection->InitTraversal(); + while (vtkActor *anAct = aCollection->GetNextActor()) { + if (anAct->GetVisibility() > 0) + if (SALOME_Actor* anActor = dynamic_cast(anAct)) { + anActor->VisibilityOff(); + } + } + aViewWindow->Repaint(); } } } @@ -176,12 +176,12 @@ namespace VISU void ErasePrs3d(VisuGUI* theModule, VISU::Prs3d_i* thePrs, - bool theDoRepaint = true); + bool theDoRepaint = true); void ErasePrs(VisuGUI* theModule, - Base_i* theBase, - bool theDoRepaintVW); + Base_i* theBase, + bool theDoRepaintVW); } #endif diff --git a/src/VISU_I/VISU_ClippingPlaneMgr.cxx b/src/VISU_I/VISU_ClippingPlaneMgr.cxx index d9c9d40b..d1346758 100644 --- a/src/VISU_I/VISU_ClippingPlaneMgr.cxx +++ b/src/VISU_I/VISU_ClippingPlaneMgr.cxx @@ -70,15 +70,15 @@ void VISU_ClippingPlaneMgr::SetStudy(_PTR(Study) theStudy) _PTR(GenericAttribute) anAttr; if (aSObject->FindAttribute(anAttr, "AttributeSequenceOfReal")) { - _PTR(AttributeSequenceOfReal) aArray(anAttr); - aPlane->SetOrigin(aArray->Value(1), aArray->Value(2), aArray->Value(3)); - aPlane->SetNormal(aArray->Value(4), aArray->Value(5), aArray->Value(6)); + _PTR(AttributeSequenceOfReal) aArray(anAttr); + aPlane->SetOrigin(aArray->Value(1), aArray->Value(2), aArray->Value(3)); + aPlane->SetNormal(aArray->Value(4), aArray->Value(5), aArray->Value(6)); } if (aSObject->FindAttribute(anAttr, "AttributeInteger")) { - _PTR(AttributeInteger) aFlag(anAttr); - aPlane->setAuto(aFlag->Value() == 1); + _PTR(AttributeInteger) aFlag(anAttr); + aPlane->setAuto(aFlag->Value() == 1); } else - aPlane->setAuto(false); + aPlane->setAuto(false); applyPlaneToAll(aPlane); myPlanes->AddItem(aPlane); @@ -97,38 +97,38 @@ void VISU_ClippingPlaneMgr::applyPlaneToAll(VISU_CutPlaneFunction* thePlane) if(VISU::Base_i* aBase = dynamic_cast(VISU::GetServant(anObject).in())) { VISU::Prs3d_i* aPrs; if(aBase->GetType() == VISU::TCOLOREDPRS3DHOLDER){ - CORBA::Object_var anObject = aBase->_this(); - VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject); - VISU::Prs3d_var aPrs3d = aHolder->GetDevice(); - aPrs = dynamic_cast(VISU::GetServant(aPrs3d).in()); + CORBA::Object_var anObject = aBase->_this(); + VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject); + VISU::Prs3d_var aPrs3d = aHolder->GetDevice(); + aPrs = dynamic_cast(VISU::GetServant(aPrs3d).in()); } else { - aPrs = dynamic_cast(aBase); + aPrs = dynamic_cast(aBase); } if (aPrs) { - if (!ContainsPlane(aPrs, thePlane)) { - if (thePlane->isAuto()) - aPrs->AddClippingPlane(thePlane); - else { - string aPrsEntry = aPrs->GetEntry(); - if (aPrsEntry.length() == 0) { - VISU::ColoredPrs3d_i* aColPrs = dynamic_cast(aPrs); - if (aColPrs) - aPrsEntry = aColPrs->GetHolderEntry(); - } - - _PTR(SObject) aSObject = thePlane->getPlaneObject(); - _PTR(ChildIterator) aRefIter = myStudy->NewChildIterator(aSObject); - for (; aRefIter->More(); aRefIter->Next()) { - _PTR(SObject) aObj = aRefIter->Value(); - _PTR(SObject) aRefPrsObject; - if (aObj->ReferencedObject(aRefPrsObject)) { // If it is referenced on current plane - if (aRefPrsObject->GetID() == aPrsEntry) { - aPrs->AddClippingPlane(thePlane); - } - } - } - } - } + if (!ContainsPlane(aPrs, thePlane)) { + if (thePlane->isAuto()) + aPrs->AddClippingPlane(thePlane); + else { + string aPrsEntry = aPrs->GetEntry(); + if (aPrsEntry.length() == 0) { + VISU::ColoredPrs3d_i* aColPrs = dynamic_cast(aPrs); + if (aColPrs) + aPrsEntry = aColPrs->GetHolderEntry(); + } + + _PTR(SObject) aSObject = thePlane->getPlaneObject(); + _PTR(ChildIterator) aRefIter = myStudy->NewChildIterator(aSObject); + for (; aRefIter->More(); aRefIter->Next()) { + _PTR(SObject) aObj = aRefIter->Value(); + _PTR(SObject) aRefPrsObject; + if (aObj->ReferencedObject(aRefPrsObject)) { // If it is referenced on current plane + if (aRefPrsObject->GetID() == aPrsEntry) { + aPrs->AddClippingPlane(thePlane); + } + } + } + } + } } } } @@ -136,8 +136,8 @@ void VISU_ClippingPlaneMgr::applyPlaneToAll(VISU_CutPlaneFunction* thePlane) //************************************************************* long VISU_ClippingPlaneMgr::CreateClippingPlane(double X,double Y, double Z, - double dX, double dY, double dZ, - bool isAuto, const char* name) + double dX, double dY, double dZ, + bool isAuto, const char* name) { _PTR(SObject) aObjPtr = CreateClippingPlaneObject(X, Y, Z, dX, dY, dZ, isAuto, name); return myPlanes->GetNumberOfItems() - 1; @@ -146,8 +146,8 @@ long VISU_ClippingPlaneMgr::CreateClippingPlane(double X,double Y, double Z, //************************************************************* _PTR(SObject) VISU_ClippingPlaneMgr::CreateClippingPlaneObject(double X,double Y, double Z, - double dX, double dY, double dZ, - bool isAuto, const char* name) + double dX, double dY, double dZ, + bool isAuto, const char* name) { _PTR(SObject) aPlaneObj; if(!myStudy->GetProperties()->IsLocked()) { @@ -174,11 +174,11 @@ _PTR(SObject) VISU_ClippingPlaneMgr::CreateClippingPlaneObject(double X,double anAttr = aBuilder->FindOrCreateAttribute(aPlaneObj,"AttributeSequenceOfReal"); _PTR(AttributeSequenceOfReal) aArray(anAttr); if (aArray->Length() == 6) { - for (int i = 0; i < 6; i++) - aArray->ChangeValue(i+1, aParams[i]); + for (int i = 0; i < 6; i++) + aArray->ChangeValue(i+1, aParams[i]); } else { - for (int i = 0; i < 6; i++) - aArray->Add(aParams[i]); + for (int i = 0; i < 6; i++) + aArray->Add(aParams[i]); } // Save Bool Flag anAttr = aBuilder->FindOrCreateAttribute(aPlaneObj,"AttributeInteger"); @@ -202,8 +202,8 @@ _PTR(SObject) VISU_ClippingPlaneMgr::CreateClippingPlaneObject(double X,double //************************************************************* void VISU_ClippingPlaneMgr::EditClippingPlane(long id, double X,double Y, double Z, - double dX, double dY, double dZ, - bool isAuto, const char* name) + double dX, double dY, double dZ, + bool isAuto, const char* name) { VISU_CutPlaneFunction* aPlane = GetClippingPlane(id); if (aPlane != NULL) { @@ -216,31 +216,31 @@ void VISU_ClippingPlaneMgr::EditClippingPlane(long id, double X,double Y, doubl if(!myStudy->GetProperties()->IsLocked()) { _PTR(GenericAttribute) anAttr; if (aSObj->FindAttribute(anAttr, "AttributeSequenceOfReal")) { - _PTR(AttributeSequenceOfReal) aArray(anAttr); - aArray->ChangeValue(1, X); - aArray->ChangeValue(2, Y); - aArray->ChangeValue(3, Z); - aArray->ChangeValue(4, dX); - aArray->ChangeValue(5, dY); - aArray->ChangeValue(6, dZ); + _PTR(AttributeSequenceOfReal) aArray(anAttr); + aArray->ChangeValue(1, X); + aArray->ChangeValue(2, Y); + aArray->ChangeValue(3, Z); + aArray->ChangeValue(4, dX); + aArray->ChangeValue(5, dY); + aArray->ChangeValue(6, dZ); } if (aSObj->FindAttribute(anAttr, "AttributeInteger")) { - _PTR(AttributeInteger) aFlag(anAttr); - aFlag->SetValue(isAuto? 1 : 0); + _PTR(AttributeInteger) aFlag(anAttr); + aFlag->SetValue(isAuto? 1 : 0); } if (aSObj->FindAttribute(anAttr, "AttributeName")) { - _PTR(AttributeName) aName(anAttr); - aName->SetValue(name); + _PTR(AttributeName) aName(anAttr); + aName->SetValue(name); } // Remove references on presentations if it becomes Auto plane _PTR(SObject) aPlaneSObj = aPlane->getPlaneObject(); if (aPlane->isAuto()) { - _PTR(ChildIterator) aIter = myStudy->NewChildIterator(aPlaneSObj); - _PTR(StudyBuilder) aBuilder = myStudy->NewBuilder(); - for (; aIter->More(); aIter->Next()) { - _PTR(SObject) aObj = aIter->Value(); - aBuilder->RemoveObject(aObj); - } + _PTR(ChildIterator) aIter = myStudy->NewChildIterator(aPlaneSObj); + _PTR(StudyBuilder) aBuilder = myStudy->NewBuilder(); + for (; aIter->More(); aIter->Next()) { + _PTR(SObject) aObj = aIter->Value(); + aBuilder->RemoveObject(aObj); + } } } } @@ -286,40 +286,40 @@ bool VISU_ClippingPlaneMgr::DeleteClippingPlane(long id) _PTR(SComponent) aVisuSO = myStudy->FindComponent("VISU"); _PTR(ChildIterator) aChildIter = myStudy->NewChildIterator(aVisuSO); for (aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next()) { - _PTR(SObject) aSObject = aChildIter->Value(); - CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject); - if(VISU::Base_i* aBase = dynamic_cast(VISU::GetServant(anObject).in())) { - VISU::Prs3d_i* aPrs; - if(aBase->GetType() == VISU::TCOLOREDPRS3DHOLDER){ - CORBA::Object_var anObject = aBase->_this(); - VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject); - VISU::Prs3d_var aPrs3d = aHolder->GetDevice(); - aPrs = dynamic_cast(VISU::GetServant(aPrs3d).in()); - } else - aPrs = dynamic_cast(aBase); - - if (aPrs) { - if (ContainsPlane(aPrs, aPlane)) { - short aTag1 = aPlane->getPlaneObject()->Tag(); - for (int j = aPrs->GetNumberOfClippingPlanes()-1; j > -1; j--) { - VISU_CutPlaneFunction* aPln = dynamic_cast - (aPrs->GetClippingPlane(j)); - if (aPln) { - short aTag2 = aPln->getPlaneObject()->Tag(); - if (aTag1 == aTag2) { - aPrs->RemoveClippingPlane(j); - break; - } - } - } - } - } - } + _PTR(SObject) aSObject = aChildIter->Value(); + CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject); + if(VISU::Base_i* aBase = dynamic_cast(VISU::GetServant(anObject).in())) { + VISU::Prs3d_i* aPrs; + if(aBase->GetType() == VISU::TCOLOREDPRS3DHOLDER){ + CORBA::Object_var anObject = aBase->_this(); + VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject); + VISU::Prs3d_var aPrs3d = aHolder->GetDevice(); + aPrs = dynamic_cast(VISU::GetServant(aPrs3d).in()); + } else + aPrs = dynamic_cast(aBase); + + if (aPrs) { + if (ContainsPlane(aPrs, aPlane)) { + short aTag1 = aPlane->getPlaneObject()->Tag(); + for (int j = aPrs->GetNumberOfClippingPlanes()-1; j > -1; j--) { + VISU_CutPlaneFunction* aPln = dynamic_cast + (aPrs->GetClippingPlane(j)); + if (aPln) { + short aTag2 = aPln->getPlaneObject()->Tag(); + if (aTag1 == aTag2) { + aPrs->RemoveClippingPlane(j); + break; + } + } + } + } + } + } } _PTR(SObject) aSObj = aPlane->getPlaneObject(); if (aSObj) { - _PTR(StudyBuilder) aBuilder = myStudy->NewBuilder(); - aBuilder->RemoveObject(aSObj); + _PTR(StudyBuilder) aBuilder = myStudy->NewBuilder(); + aBuilder->RemoveObject(aSObj); } myPlanes->RemoveItem(id); return true; @@ -349,7 +349,7 @@ bool VISU_ClippingPlaneMgr::ContainsPlane(VISU::Prs3d_i* thePrs, VISU_CutPlaneFu VISU_CutPlaneFunction* aPlane = dynamic_cast(thePrs->GetClippingPlane(i)); if (aPlane) { if (aPlane->getPlaneObject()->GetID() == aEntry) { - return true; + return true; } } } @@ -371,16 +371,16 @@ bool VISU_ClippingPlaneMgr::ApplyClippingPlane(VISU::Prs3d_i* thePrs, long id) if (!aPlane->isAuto()) { string aEntry = thePrs->GetEntry(); if (aEntry.length() == 0) { - VISU::ColoredPrs3d_i* aColPrs = dynamic_cast(thePrs); - if (aColPrs) - aEntry = aColPrs->GetHolderEntry(); + VISU::ColoredPrs3d_i* aColPrs = dynamic_cast(thePrs); + if (aColPrs) + aEntry = aColPrs->GetHolderEntry(); } if(!myStudy->GetProperties()->IsLocked()) { - _PTR(StudyBuilder) aBuilder = myStudy->NewBuilder(); - _PTR(SObject) aPrsSObj = myStudy->FindObjectID(aEntry); - _PTR(SObject) aSObject = aPlane->getPlaneObject(); - _PTR(SObject) aNewObj = aBuilder->NewObject(aSObject); - aBuilder->Addreference(aNewObj, aPrsSObj); + _PTR(StudyBuilder) aBuilder = myStudy->NewBuilder(); + _PTR(SObject) aPrsSObj = myStudy->FindObjectID(aEntry); + _PTR(SObject) aSObject = aPlane->getPlaneObject(); + _PTR(SObject) aNewObj = aBuilder->NewObject(aSObject); + aBuilder->Addreference(aNewObj, aPrsSObj); } } return true; @@ -398,40 +398,40 @@ bool VISU_ClippingPlaneMgr::DetachClippingPlane(VISU::Prs3d_i* thePrs, long id) bool isRemoved = false; short aTag1 = aPlane->getPlaneObject()->Tag(); for (int j = thePrs->GetNumberOfClippingPlanes()-1; j > -1; j--) { - VISU_CutPlaneFunction* aPln = dynamic_cast - (thePrs->GetClippingPlane(j)); - if (aPln) { - short aTag2 = aPln->getPlaneObject()->Tag(); - if (aTag1 == aTag2) { - thePrs->RemoveClippingPlane(j); - isRemoved = true; - break; - } - } + VISU_CutPlaneFunction* aPln = dynamic_cast + (thePrs->GetClippingPlane(j)); + if (aPln) { + short aTag2 = aPln->getPlaneObject()->Tag(); + if (aTag1 == aTag2) { + thePrs->RemoveClippingPlane(j); + isRemoved = true; + break; + } + } } if(!myStudy->GetProperties()->IsLocked()) { - _PTR(SObject) aSObject = aPlane->getPlaneObject(); - _PTR(StudyBuilder) aBuilder = myStudy->NewBuilder(); - - string aEntry = thePrs->GetEntry(); - if (aEntry.length() == 0) { - VISU::ColoredPrs3d_i* aColPrs = dynamic_cast(thePrs); - if (aColPrs) - aEntry = aColPrs->GetHolderEntry(); - } - _PTR(ChildIterator) aIter = myStudy->NewChildIterator(aSObject); - for (; aIter->More(); aIter->Next()) { - _PTR(SObject) aRefObj = aIter->Value(); - if(aRefObj) { - _PTR(SObject) aRefPrsObject; - if (aRefObj->ReferencedObject(aRefPrsObject)) { - if (aRefPrsObject->GetID() == aEntry) { - aBuilder->RemoveObject(aRefObj); - break; - } - } - } - } + _PTR(SObject) aSObject = aPlane->getPlaneObject(); + _PTR(StudyBuilder) aBuilder = myStudy->NewBuilder(); + + string aEntry = thePrs->GetEntry(); + if (aEntry.length() == 0) { + VISU::ColoredPrs3d_i* aColPrs = dynamic_cast(thePrs); + if (aColPrs) + aEntry = aColPrs->GetHolderEntry(); + } + _PTR(ChildIterator) aIter = myStudy->NewChildIterator(aSObject); + for (; aIter->More(); aIter->Next()) { + _PTR(SObject) aRefObj = aIter->Value(); + if(aRefObj) { + _PTR(SObject) aRefPrsObject; + if (aRefObj->ReferencedObject(aRefPrsObject)) { + if (aRefPrsObject->GetID() == aEntry) { + aBuilder->RemoveObject(aRefObj); + break; + } + } + } + } } return isRemoved; } diff --git a/src/VISU_I/VISU_ClippingPlaneMgr.hxx b/src/VISU_I/VISU_ClippingPlaneMgr.hxx index 33dbbcd4..09ca4759 100644 --- a/src/VISU_I/VISU_ClippingPlaneMgr.hxx +++ b/src/VISU_I/VISU_ClippingPlaneMgr.hxx @@ -82,16 +82,16 @@ public: long CreateClippingPlane(double X,double Y, double Z, - double dX, double dY, double dZ, - bool isAuto, const char* name); + double dX, double dY, double dZ, + bool isAuto, const char* name); void EditClippingPlane(long id, double X,double Y, double Z, - double dX, double dY, double dZ, - bool isAuto, const char* name); + double dX, double dY, double dZ, + bool isAuto, const char* name); _PTR(SObject) CreateClippingPlaneObject(double X,double Y, double Z, - double dX, double dY, double dZ, - bool isAuto, const char* name); + double dX, double dY, double dZ, + bool isAuto, const char* name); /* Returns clipping plane by its Id */ VISU_CutPlaneFunction* GetClippingPlane(long id); diff --git a/src/VISU_I/VISU_CorbaMedConvertor.cxx b/src/VISU_I/VISU_CorbaMedConvertor.cxx index 62e12432..262d9399 100644 --- a/src/VISU_I/VISU_CorbaMedConvertor.cxx +++ b/src/VISU_I/VISU_CorbaMedConvertor.cxx @@ -114,7 +114,7 @@ namespace //--------------------------------------------------------------- int GetEntity2Geom(const VISU::TEntity& theEntity, - SALOME_MED::medGeometryElement*& theVector) + SALOME_MED::medGeometryElement*& theVector) { switch(theEntity){ case VISU::CELL_ENTITY: @@ -342,9 +342,9 @@ namespace //--------------------------------------------------------------- void GetCellsSize(vtkIdType& theNbCells, - vtkIdType& theCellsSize, - SALOME_MED::MESH_ptr theMEDMesh, - const VISU::TEntity& theVEntity) + vtkIdType& theCellsSize, + SALOME_MED::MESH_ptr theMEDMesh, + const VISU::TEntity& theVEntity) { theNbCells = theCellsSize = 0; if(MYDEBUG) MESSAGE("GetCellsSize - theVEntity = "<numberOfElements[iGeom]; if(iNumElemEnd > 0){ - if(MYDEBUG) MESSAGE("GetCellsSize - iNumElemEnd = "<nodalConnectivityLength[iGeom]; - theNbCells += iNumElemEnd; + if(MYDEBUG) MESSAGE("GetCellsSize - iNumElemEnd = "<nodalConnectivityLength[iGeom]; + theNbCells += iNumElemEnd; } } } @@ -365,8 +365,8 @@ namespace //--------------------------------------------------------------- void GetCellsSize(vtkIdType& theNbCells, - vtkIdType& theCellsSize, - SALOME_MED::FAMILY_ptr theMEDFamily) + vtkIdType& theCellsSize, + SALOME_MED::FAMILY_ptr theMEDFamily) { theNbCells = theCellsSize = 0; SALOME_MED::SUPPORT::supportInfos_var suppInfo=theMEDFamily->getSupportGlobal(); @@ -375,9 +375,9 @@ namespace for(int iGeom = 0; iGeom < iGeomEnd; iGeom++) { int iNumElemEnd = suppInfo->nbEltTypes[iGeom]; if(iNumElemEnd > 0){ - if(MYDEBUG) MESSAGE("GetCellsSize - iNumElemEnd = "<nodalConnectivityLength[iGeom]; + if(MYDEBUG) MESSAGE("GetCellsSize - iNumElemEnd = "<nodalConnectivityLength[iGeom]; } } } @@ -386,8 +386,8 @@ namespace //--------------------------------------------------------------- void GetCellsSize(VISU::PCMesh theMesh, - SALOME_MED::MESH_ptr theMEDMesh, - const VISU::TEntity& theEntity) + SALOME_MED::MESH_ptr theMEDMesh, + const VISU::TEntity& theEntity) { VISU::TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap; VISU::PCMeshOnEntity aMeshOnEntity = aMeshOnEntityMap[theEntity]; @@ -403,8 +403,8 @@ namespace //--------------------------------------------------------------- VISU::PCMeshOnEntity InitMeshOnEntity(const VISU::PCMesh& theMesh, - const VISU::TEntity& theEntity, - const VISU::PCMeshOnEntity& theMeshOnEntity) + const VISU::TEntity& theEntity, + const VISU::PCMeshOnEntity& theMeshOnEntity) { VISU::PCMeshOnEntity aMeshOnEntity; VISU::TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap; @@ -425,10 +425,10 @@ namespace VISU::PCSubProfile CrSubProfile(const VISU::PCMesh theMesh, - const VISU::PCField theField, - const VISU::TCMeshOnEntity& theMeshOnEntity, - SALOME_MED::medGeometryElement theMGeom, - int theNbElems) + const VISU::PCField theField, + const VISU::TCMeshOnEntity& theMeshOnEntity, + SALOME_MED::medGeometryElement theMGeom, + int theNbElems) { if (MYDEBUG) MESSAGE("CrSubProfile"); VISU::EGeometry aEGeom = MEDGeom2VISU(theMGeom); @@ -446,20 +446,20 @@ namespace aSubProfile->myStatus = VISU::eRemoveAll; else if(aTimeStampIter == aCellsFirstIndex.end() && theMGeom == SALOME_MED::MED_POINT1){ if(theNbElems > 0){ - aSubProfile->myName = ""; - aSubProfile->myStatus = VISU::eAddPart; - - aSubProfile->myNbCells = theNbElems; - aSubProfile->myCellsSize = aSubProfile->myNbCells; + aSubProfile->myName = ""; + aSubProfile->myStatus = VISU::eAddPart; + + aSubProfile->myNbCells = theNbElems; + aSubProfile->myCellsSize = aSubProfile->myNbCells; } }else{ - if(theNbElems > 0){ - aSubProfile->myName = ""; - aSubProfile->myStatus = VISU::eAddPart; - - aSubProfile->myNbCells = theNbElems; - aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes; - } + if(theNbElems > 0){ + aSubProfile->myName = ""; + aSubProfile->myStatus = VISU::eAddPart; + + aSubProfile->myNbCells = theNbElems; + aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes; + } } if (MYDEBUG) MESSAGE("CrSubProfile done"); @@ -468,9 +468,9 @@ namespace VISU::TProfileKey GetProfileKey(const VISU::PCMesh theMesh, - const VISU::PCField theField, - const VISU::PCValForTime theValForTime, - const VISU::TCMeshOnEntity& theMeshOnEntity) + const VISU::PCField theField, + const VISU::PCValForTime theValForTime, + const VISU::TCMeshOnEntity& theMeshOnEntity) { if (MYDEBUG) MESSAGE("GetProfileKey"); @@ -483,34 +483,34 @@ namespace if(anIter == aFirstIndex.end() && aSupport->getEntity() == SALOME_MED::MED_NODE){ SALOME_MED::medGeometryElement aMGeom = SALOME_MED::MED_POINT1; try{ - aNbElems = aSupport->getNumberOfElements(SALOME_MED::MED_NONE); - if(MYDEBUG)MESSAGE("aMGeom="<myField->getSupport()->getNumberOfElements(aMGeom);"); + MESSAGE("Error in theValForTime->myField->getSupport()->getNumberOfElements(aMGeom);"); } - + VISU::PCSubProfile aSubProfile = CrSubProfile(theMesh, - theField, - theMeshOnEntity, - aMGeom, - aNbElems); + theField, + theMeshOnEntity, + aMGeom, + aNbElems); aProfileKey.insert(aSubProfile); } for(; anIter != aFirstIndex.end(); anIter++){ SALOME_MED::medGeometryElement aMGeom = anIter->first; try{ - aNbElems = aSupport->getNumberOfElements(aMGeom); - if(MYDEBUG)MESSAGE("aMGeom="<myField->getSupport()->getNumberOfElements(aMGeom);"); - continue; + aNbElems = aSupport->getNumberOfElements(aMGeom); + if(MYDEBUG)MESSAGE("aMGeom="<myField->getSupport()->getNumberOfElements(aMGeom);"); + continue; } VISU::PCSubProfile aSubProfile = CrSubProfile(theMesh, - theField, - theMeshOnEntity, - aMGeom, - aNbElems); + theField, + theMeshOnEntity, + aMGeom, + aNbElems); aProfileKey.insert(aSubProfile); } @@ -520,18 +520,18 @@ namespace void InitProfile(VISU::PCMesh theMesh, - VISU::PCField theField, - VISU::PCValForTime theValForTime, - VISU::TCMeshOnEntity& theMeshOnEntity) + VISU::PCField theField, + VISU::PCValForTime theValForTime, + VISU::TCMeshOnEntity& theMeshOnEntity) { if (MYDEBUG) MESSAGE("InitProfile"); VISU::TProfileMap& aProfileMap = theMeshOnEntity.myProfileMap; VISU::TProfileKey aProfileKey = GetProfileKey(theMesh, - theField, - theValForTime, - theMeshOnEntity); + theField, + theValForTime, + theMeshOnEntity); VISU::TProfileMap::const_iterator anIter = aProfileMap.find(aProfileKey); if(anIter != aProfileMap.end()){ @@ -543,13 +543,13 @@ namespace VISU::TProfileKey::const_iterator anIter = aProfileKey.begin(); for(; anIter != aProfileKey.end(); anIter++){ - VISU::PCSubProfile aSubProfile(*anIter); - - if(aProfile->myIsAll && aSubProfile->myStatus != VISU::eAddAll) - aProfile->myIsAll = false; - - VISU::EGeometry aEGeom = aSubProfile->myGeom; - aGeom2SubProfile[aEGeom] = aSubProfile; + VISU::PCSubProfile aSubProfile(*anIter); + + if(aProfile->myIsAll && aSubProfile->myStatus != VISU::eAddAll) + aProfile->myIsAll = false; + + VISU::EGeometry aEGeom = aSubProfile->myGeom; + aGeom2SubProfile[aEGeom] = aSubProfile; } aProfileMap[aProfileKey] = aProfile; @@ -560,9 +560,9 @@ namespace void LoadProfile(VISU::PCMesh theMesh, - VISU::PCField theField, - VISU::PCValForTime theValForTime, - VISU::PCMeshOnEntity theMeshOnEntity) + VISU::PCField theField, + VISU::PCValForTime theValForTime, + VISU::PCMeshOnEntity theMeshOnEntity) { VISU::PCProfile aProfile = theValForTime->myProfile; if (MYDEBUG) MESSAGE("LoadProfile aProfile->myIsDone="<myIsDone); @@ -582,35 +582,35 @@ namespace SALOME_MED::long_array_var aGeom2ProfileIds; std::vector aGeom2Profile; if(!aSupport->isOnAllElements()){ - try{ - if(aMGeom == SALOME_MED::MED_POINT1) - aGeom2ProfileIds = aSupport->getNumberFromFile(SALOME_MED::MED_NONE); - else - aGeom2ProfileIds = aSupport->getNumberFromFile(aMGeom); - int aLen = aGeom2ProfileIds->length(); - if(MYDEBUG) MESSAGE_BEGIN(" - aMGeom="<" << anId); - } - if(MYDEBUG) MESSAGE_END(" "); - } catch(...) { - continue; - } + try{ + if(aMGeom == SALOME_MED::MED_POINT1) + aGeom2ProfileIds = aSupport->getNumberFromFile(SALOME_MED::MED_NONE); + else + aGeom2ProfileIds = aSupport->getNumberFromFile(aMGeom); + int aLen = aGeom2ProfileIds->length(); + if(MYDEBUG) MESSAGE_BEGIN(" - aMGeom="<" << anId); + } + if(MYDEBUG) MESSAGE_END(" "); + } catch(...) { + continue; + } } else { - SALOME_MED::medEntityMesh aMEntity = aSupport->getEntity(); - int aNbElems = theMesh->myMesh->getNumberOfElements(aMEntity,aMGeom); - for(int i = 0; i < aNbElems; i++) - aGeom2Profile.push_back(i+1); + SALOME_MED::medEntityMesh aMEntity = aSupport->getEntity(); + int aNbElems = theMesh->myMesh->getNumberOfElements(aMEntity,aMGeom); + for(int i = 0; i < aNbElems; i++) + aGeom2Profile.push_back(i+1); } if(aGeom2Profile.size()>0){ - VISU::TSubMeshID& aSubMeshID = aSubProfile->mySubMeshID; - int aSize = aGeom2Profile.size(); - aSubMeshID.resize(aSize); - for(int anId = 0; anId < aSize; anId++){ - aSubMeshID[anId] = aGeom2Profile[anId] - 1; - } + VISU::TSubMeshID& aSubMeshID = aSubProfile->mySubMeshID; + int aSize = aGeom2Profile.size(); + aSubMeshID.resize(aSize); + for(int anId = 0; anId < aSize; anId++){ + aSubMeshID[anId] = aGeom2Profile[anId] - 1; + } } } @@ -697,7 +697,7 @@ VISU_MEDFieldConvertor if(MYDEBUG) MESSAGE("VISU_MEDFieldConvertor::Build - aFieldName = '"<Value(); - theIsSuccess = (myName == aValue.in()); - if(theIsSuccess) - return TRet(SALOMEDS::SObject::_duplicate(theSObj)); + SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr); + CORBA::String_var aValue = aName->Value(); + theIsSuccess = (myName == aValue.in()); + if(theIsSuccess) + return TRet(SALOMEDS::SObject::_duplicate(theSObj)); } return TRet(); } @@ -767,13 +767,13 @@ namespace { CORBA::Object_var anObj = VISU::SObjectToObject(theSObj); if(!CORBA::is_nil(anObj)){ - SALOME_MED::MESH_var aMesh = SALOME_MED::MESH::_narrow(anObj); - if(!CORBA::is_nil(aMesh)){ - CORBA::String_var aName = aMesh->getName(); - theIsSuccess = (myName == aName.in()); - if(theIsSuccess) - return TRet(aMesh,SALOMEDS::SObject::_duplicate(theSObj)); - } + SALOME_MED::MESH_var aMesh = SALOME_MED::MESH::_narrow(anObj); + if(!CORBA::is_nil(aMesh)){ + CORBA::String_var aName = aMesh->getName(); + theIsSuccess = (myName == aName.in()); + if(theIsSuccess) + return TRet(aMesh,SALOMEDS::SObject::_duplicate(theSObj)); + } } return TRet(); } @@ -795,7 +795,7 @@ namespace SALOMEDS::SObject_var aSObj = anIter->Value(); typename TFun::TRet aRet = theFun(aSObj,theIsSuccess); if(theIsSuccess) - return aRet; + return aRet; } return typename TFun::TRet(); } @@ -829,11 +829,11 @@ VISU_MEDConvertor anIsSuccess = false; CORBA::String_var aMeshName = aMeshNames[iMesh]; TMeshByName::TRet aMeshByNameRet = - Find(aMeshesSObj,aStudy,TMeshByName(aMeshName.in()),anIsSuccess); + Find(aMeshesSObj,aStudy,TMeshByName(aMeshName.in()),anIsSuccess); if(MYDEBUG) - MESSAGE("VISU_MEDConvertor::Build - Find aMeshName('"< 0){ - if(MYDEBUG) - MESSAGE("VISU_MEDConvertor::Build - Support isOnAllElements = '"< 0){ + if(MYDEBUG) + MESSAGE("VISU_MEDConvertor::Build - Support isOnAllElements = '"<myGroupMap; - aGroupMap[aSupportName.in()] = aGroup; - } - - } + SALOMEDS::SObject_var aSupportSObj = aSupportIterator->Value(); + + CORBA::Object_var aMedSupport = VISU::SObjectToObject(aSupportSObj); + if(CORBA::is_nil(aMedSupport)) + continue; + + SALOME_MED::SUPPORT_var aMEDSupport = SALOME_MED::SUPPORT::_narrow(aMedSupport); + if(aMEDSupport->_is_nil()) + continue; + + SALOME_MED::MESH_var aMeshOnSupport = aMEDSupport->getMesh(); + SALOME_MED::medEntityMesh aMEntity = aMEDSupport->getEntity(); + VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity); + CORBA::String_var aSupportName = aMEDSupport->getName(); + + SALOME_MED::GROUP_var aMEDGroup = SALOME_MED::GROUP::_narrow(aMedSupport); + if(!aMEDGroup->_is_nil()){ + CORBA::Boolean anIsOnAllElements = aMEDSupport->isOnAllElements(); + + if(MYDEBUG) + MESSAGE("VISU_MEDConvertor::Build "<< + "- aGroup = '"<myGroupMap; + aGroupMap[aSupportName.in()] = aGroup; + } + + } } } } @@ -1030,54 +1030,54 @@ VISU_MEDConvertor if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aFieldName = '"<NewChildIterator(aFieldSObj); for(; aTimeStampIterator->More(); aTimeStampIterator->Next()){ - SALOMEDS::SObject_var aTimeStampSObj = aTimeStampIterator->Value(); - if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aTimeStampSObj = '"<_is_nil()) - continue; - - SALOME_MED::SUPPORT_var aMEDSupport = aMEDField->getSupport(); - if(aMEDSupport->_is_nil()) - continue; - - SALOME_MED::medEntityMesh aMEntity = aMEDSupport->getEntity(); - VISU::TEntity anEntity = MEDEntityToVTK(aMEntity); - SALOME_MED::MESH_var aMEDMesh = aMEDSupport->getMesh(); - if(aMEDMesh->_is_nil()) - continue; - - CORBA::String_var aMeshName = aMEDMesh->getName(); - CORBA::String_var aFieldName = aMEDField->getName(); - - VISU::TMeshMap::iterator aMeshMapIter = myMeshMap.find(aMeshName.in()); - if(aMeshMapIter == myMeshMap.end()) - continue; - - VISU::PCMesh aMesh = aMeshMapIter->second; - VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap; - VISU::TMeshOnEntityMap::iterator aMeshOnEntityMapIter = aMeshOnEntityMap.find(anEntity); - if(aMeshOnEntityMapIter == aMeshOnEntityMap.end()) - continue; - - VISU::PCMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second; - VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap; - VISU::TFieldMap::iterator aFieldMapIter = aFieldMap.find(aFieldName.in()); - VISU::PCField aField; - if(aFieldMapIter == aFieldMap.end()){ - aField = aFieldMap[aFieldName.in()](new VISU::TCField()); - aField->myId = iField; - aField->myName = aFieldName.in(); - aField->myEntity = anEntity; - aField->myMeshName = aMeshName.in(); - aField->myDataSize = aMeshOnEntity->myNbCells * aField->myNbComp; - - vtkIdType aDataType = VTK_DOUBLE; - SALOME_MED::FIELDDOUBLE_ptr aFieldDouble = SALOME_MED::FIELDDOUBLE::_narrow(aMEDField); - if(aFieldDouble->_is_nil()) { + SALOMEDS::SObject_var aTimeStampSObj = aTimeStampIterator->Value(); + if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aTimeStampSObj = '"<_is_nil()) + continue; + + SALOME_MED::SUPPORT_var aMEDSupport = aMEDField->getSupport(); + if(aMEDSupport->_is_nil()) + continue; + + SALOME_MED::medEntityMesh aMEntity = aMEDSupport->getEntity(); + VISU::TEntity anEntity = MEDEntityToVTK(aMEntity); + SALOME_MED::MESH_var aMEDMesh = aMEDSupport->getMesh(); + if(aMEDMesh->_is_nil()) + continue; + + CORBA::String_var aMeshName = aMEDMesh->getName(); + CORBA::String_var aFieldName = aMEDField->getName(); + + VISU::TMeshMap::iterator aMeshMapIter = myMeshMap.find(aMeshName.in()); + if(aMeshMapIter == myMeshMap.end()) + continue; + + VISU::PCMesh aMesh = aMeshMapIter->second; + VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap; + VISU::TMeshOnEntityMap::iterator aMeshOnEntityMapIter = aMeshOnEntityMap.find(anEntity); + if(aMeshOnEntityMapIter == aMeshOnEntityMap.end()) + continue; + + VISU::PCMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second; + VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap; + VISU::TFieldMap::iterator aFieldMapIter = aFieldMap.find(aFieldName.in()); + VISU::PCField aField; + if(aFieldMapIter == aFieldMap.end()){ + aField = aFieldMap[aFieldName.in()](new VISU::TCField()); + aField->myId = iField; + aField->myName = aFieldName.in(); + aField->myEntity = anEntity; + aField->myMeshName = aMeshName.in(); + aField->myDataSize = aMeshOnEntity->myNbCells * aField->myNbComp; + + vtkIdType aDataType = VTK_DOUBLE; + SALOME_MED::FIELDDOUBLE_ptr aFieldDouble = SALOME_MED::FIELDDOUBLE::_narrow(aMEDField); + if(aFieldDouble->_is_nil()) { // PAL18313: Mandriva 64 porting: CRASH at creating presentation on "Import Structure". if (sizeof(long) == 4 ) // Size of CORBA::Long is always 4 (see CORBA_basetypes.h) aDataType = VTK_LONG; @@ -1088,23 +1088,23 @@ VISU_MEDConvertor continue; } } - aField->Init(aMEDField->getNumberOfComponents(), aDataType); - - if(MYDEBUG) - MESSAGE("VISU_MEDConvertor::Build - aMeshOnEntity->myNbCells = "<myNbCells); - }else - aField = aFieldMapIter->second; - - VISU::TValField& aValField = aField->myValField; - int anId = aMEDField->getIterationNumber(); - VISU::PCValForTime aValForTime = aValField[anId](new VISU::TCValForTime()); - aValForTime->myId = anId; - CORBA::Double aDT = aMEDField->getTime(); - aValForTime->myTime = VISU::TTime(aDT,""); - aValForTime->myField = aMEDField; - if(MYDEBUG) - MESSAGE("VISU_MEDConvertor::Build - aMeshName = '"<myNbCells = "<myNbCells); + }else + aField = aFieldMapIter->second; + + VISU::TValField& aValField = aField->myValField; + int anId = aMEDField->getIterationNumber(); + VISU::PCValForTime aValForTime = aValField[anId](new VISU::TCValForTime()); + aValForTime->myId = anId; + CORBA::Double aDT = aMEDField->getTime(); + aValForTime->myTime = VISU::TTime(aDT,""); + aValForTime->myField = aMEDField; + if(MYDEBUG) + MESSAGE("VISU_MEDConvertor::Build - aMeshName = '"<myNbCells = "<myNbCells); + MESSAGE("VISU_MEDConvertor::Build - aMeshOnEntity->myNbCells = "<myNbCells); }else aField = aFieldMapIter->second; @@ -1220,10 +1220,10 @@ VISU_MEDConvertor aValForTime->myField = aMEDField; if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build "<< - "- aMeshName = '"<getSenderForPolygonsConnectivity(SALOME_MED::MED_NODAL, theEntity); - long int aSize; - int* aValuePtr = ReceiverFactory::getValue(aSender.in(), aSize); - myConn.assign(aValuePtr, aValuePtr + aSize); + SALOME::SenderInt_var aSender = + theMesh->getSenderForPolygonsConnectivity(SALOME_MED::MED_NODAL, theEntity); + long int aSize; + int* aValuePtr = ReceiverFactory::getValue(aSender.in(), aSize); + myConn.assign(aValuePtr, aValuePtr + aSize); } { - SALOME::SenderInt_var aSender = - theMesh->getSenderForPolygonsConnectivityIndex(SALOME_MED::MED_NODAL, theEntity); - long int aSize; - int* aValuePtr = ReceiverFactory::getValue(aSender, aSize); - myConnIndex.assign(aValuePtr, aValuePtr + aSize); + SALOME::SenderInt_var aSender = + theMesh->getSenderForPolygonsConnectivityIndex(SALOME_MED::MED_NODAL, theEntity); + long int aSize; + int* aValuePtr = ReceiverFactory::getValue(aSender, aSize); + myConnIndex.assign(aValuePtr, aValuePtr + aSize); } } @@ -1466,31 +1466,31 @@ namespace MEDPolyhedraConnectivity(SALOME_MED::MESH_var theMesh) { { - SALOME::SenderInt_var aSender = - theMesh->getSenderForPolyhedronConnectivity(SALOME_MED::MED_NODAL); - long int aSize; - int* aValuePtr = ReceiverFactory::getValue(aSender, aSize); - myConn.assign(aValuePtr, aValuePtr + aSize); + SALOME::SenderInt_var aSender = + theMesh->getSenderForPolyhedronConnectivity(SALOME_MED::MED_NODAL); + long int aSize; + int* aValuePtr = ReceiverFactory::getValue(aSender, aSize); + myConn.assign(aValuePtr, aValuePtr + aSize); } { - SALOME::SenderInt_var aSender = - theMesh->getSenderForPolyhedronIndex(SALOME_MED::MED_NODAL); - long int aSize; - int* aValuePtr = ReceiverFactory::getValue(aSender, aSize); - myConnIndex.assign(aValuePtr, aValuePtr + aSize); + SALOME::SenderInt_var aSender = + theMesh->getSenderForPolyhedronIndex(SALOME_MED::MED_NODAL); + long int aSize; + int* aValuePtr = ReceiverFactory::getValue(aSender, aSize); + myConnIndex.assign(aValuePtr, aValuePtr + aSize); } { - SALOME::SenderInt_var aSender = - theMesh->getSenderForPolyhedronFacesIndex(); - long int aSize; - int* aValuePtr = ReceiverFactory::getValue(aSender, aSize); - myFaceIndex.assign(aValuePtr, aValuePtr + aSize); + SALOME::SenderInt_var aSender = + theMesh->getSenderForPolyhedronFacesIndex(); + long int aSize; + int* aValuePtr = ReceiverFactory::getValue(aSender, aSize); + myFaceIndex.assign(aValuePtr, aValuePtr + aSize); } } int GetUniqueConn(int theId, - TConnSet& theConnSet) const + TConnSet& theConnSet) const { theConnSet.clear(); int aStartFaceId = myConnIndex[theId] - 1; @@ -1514,7 +1514,7 @@ namespace TConnSet aConnSet; int aCellSize = 0; for(int anElemId = 0; anElemId < GetNbElem(); anElemId++) - aCellSize += GetUniqueConn(anElemId, aConnSet); + aCellSize += GetUniqueConn(anElemId, aConnSet); return aCellSize; } }; @@ -1524,7 +1524,7 @@ namespace int VISU_MEDConvertor ::LoadCellsOnEntity(VISU::PCMesh theMesh, - VISU::PCMeshOnEntity theMeshOnEntity) + VISU::PCMeshOnEntity theMeshOnEntity) { if(theMeshOnEntity->myIsDone) return 0; @@ -1603,9 +1603,9 @@ VISU_MEDConvertor if (aNbElem > 0) { SALOME_MED::long_array_var aConn = aMedMesh->getConnectivity(SALOME_MED::MED_FULL_INTERLACE, - SALOME_MED::MED_NODAL, - aMEntity, - aMGeom); + SALOME_MED::MED_NODAL, + aMEntity, + aMGeom); VISU::PSubMeshImpl aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TCSubMesh()); aSubMesh->myNbCells = aNbElem; @@ -1732,8 +1732,8 @@ VISU_MEDConvertor int VISU_MEDConvertor ::LoadCellsOnFamily(VISU::PCMesh theMesh, - VISU::PCMeshOnEntity theMeshOnEntity, - VISU::PCFamily theFamily) + VISU::PCMeshOnEntity theMeshOnEntity, + VISU::PCFamily theFamily) { if(theFamily->myIsDone) return 0; @@ -1755,20 +1755,20 @@ VISU_MEDConvertor VISU::TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[aEGeom]; if(MYDEBUG) - MESSAGE("LoadCellsOnFamily "<< - "- aMGeom = "< anID || anID >= aSize){ + static QString aString; + aString.sprintf("LoadCellsOnFamily - aNbElem(%d) <= aCellNumForType[%d] = %d < 0 !!!",aNbElem,iElem,anID); + throw std::runtime_error((const char*)aString.toLatin1()); + } + aSubMeshID.push_back(anID); } } }else{ @@ -1781,7 +1781,7 @@ VISU_MEDConvertor VISU::TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[aEGeom]; int iNumElemEnd = aCell2Connect.size(); for(int iNumElem = 0; iNumElem < iNumElemEnd; iNumElem++) - aSubMeshID.push_back(iNumElem); + aSubMeshID.push_back(iNumElem); } } @@ -1792,13 +1792,13 @@ VISU_MEDConvertor template + class TContainerType> void ImportField(TContainerType& theContainer, - VISU::PCMesh theMesh, - VISU::PCField theField, - VISU::PCValForTime theValForTime, - VISU::PCMeshOnEntity theMeshOnEntity) + VISU::PCMesh theMesh, + VISU::PCField theField, + VISU::PCValForTime theValForTime, + VISU::PCMeshOnEntity theMeshOnEntity) { typedef VISU::TTCMEDMeshValue TVMeshValue; vtkIdType aNbComp = theField->myNbComp; @@ -1824,18 +1824,18 @@ ImportField(TContainerType& theContainer, const VISU::TCellsFirstIndex& aCellsFirstIndex = theMeshOnEntity->myCellsFirstIndex; VISU::TCellsFirstIndex::const_iterator aCellsFirstIndexIter = aCellsFirstIndex.find(aMGeom); if(aCellsFirstIndexIter != aCellsFirstIndex.end()){ - const VISU::TIndexAndSize& aIndexAndSize = aCellsFirstIndexIter->second; - if(MYDEBUG) - MESSAGE("ImportField - aMGeom = "<GetMeshValue(aEGeom); - TVMeshValue* aMeshValue = new TVMeshValue(); - aMeshValue->Init(aNbElem, aNbGauss, aNbComp, theContainer, aStart); - aVMeshValue.reset(aMeshValue); + const VISU::TIndexAndSize& aIndexAndSize = aCellsFirstIndexIter->second; + if(MYDEBUG) + MESSAGE("ImportField - aMGeom = "<GetMeshValue(aEGeom); + TVMeshValue* aMeshValue = new TVMeshValue(); + aMeshValue->Init(aNbElem, aNbGauss, aNbComp, theContainer, aStart); + aVMeshValue.reset(aMeshValue); } } } @@ -1844,9 +1844,9 @@ ImportField(TContainerType& theContainer, int VISU_MEDConvertor ::LoadField(VISU::PCMesh theMesh, - VISU::PCMeshOnEntity theMeshOnEntity, - VISU::PField theField, - VISU::PCValForTime theValForTime) + VISU::PCMeshOnEntity theMeshOnEntity, + VISU::PField theField, + VISU::PCValForTime theValForTime) { MESSAGE("VISU_MEDConvertor::LoadField"); //Check on loading already done @@ -1869,10 +1869,10 @@ VISU_MEDConvertor SALOME_MED::double_array_var anArray = aFieldDouble->getValue(SALOME_MED::MED_FULL_INTERLACE); if(MYDEBUG) MESSAGE("VISU_MEDConvertor::LoadField - There is FIELDDOUBLE = "<length()); ImportField(anArray, - theMesh, - theField, - theValForTime, - theMeshOnEntity); + theMesh, + theField, + theValForTime, + theMeshOnEntity); } SALOME_MED::FIELDINT_ptr aFieldInt = SALOME_MED::FIELDINT::_narrow(aMEDField); @@ -1880,10 +1880,10 @@ VISU_MEDConvertor SALOME_MED::long_array_var anArray = aFieldInt->getValue(SALOME_MED::MED_FULL_INTERLACE); if(MYDEBUG) MESSAGE("VISU_MEDConvertor::LoadField - There is FIELDINT = "<length()); ImportField(anArray, - theMesh, - theField, - theValForTime, - theMeshOnEntity); + theMesh, + theField, + theValForTime, + theMeshOnEntity); } anUnstructuredGridIDMapper->myIsVTKDone = true; diff --git a/src/VISU_I/VISU_CorbaMedConvertor.hxx b/src/VISU_I/VISU_CorbaMedConvertor.hxx index 0b9d4294..b6715c9a 100644 --- a/src/VISU_I/VISU_CorbaMedConvertor.hxx +++ b/src/VISU_I/VISU_CorbaMedConvertor.hxx @@ -34,7 +34,7 @@ #include "VISU_PointCoords.hxx" #include "VISU_MeshValue.hxx" -#include +#include namespace VISU { @@ -71,10 +71,10 @@ namespace VISU //! To initilize the class instance void Init(vtkIdType theNbElem, - vtkIdType theNbGauss, - vtkIdType theNbComp, - const TContainerType& theContainer, - vtkIdType theStartIndex) + vtkIdType theNbGauss, + vtkIdType theNbComp, + const TContainerType& theContainer, + vtkIdType theStartIndex) { TSuperClass::Init(theNbElem, theNbGauss, theNbComp, theContainer); myStartIndex = theStartIndex; @@ -207,32 +207,32 @@ class VISU_MEDConvertor: public VISU_Convertor_impl virtual int LoadMeshOnEntity(VISU::PMeshImpl theMesh, - VISU::PMeshOnEntityImpl theMeshOnEntity); + VISU::PMeshOnEntityImpl theMeshOnEntity); virtual int LoadFamilyOnEntity(VISU::PMeshImpl theMesh, - VISU::PMeshOnEntityImpl theMeshOnEntity, - VISU::PFamilyImpl theFamily); + VISU::PMeshOnEntityImpl theMeshOnEntity, + VISU::PFamilyImpl theFamily); virtual int LoadMeshOnGroup(VISU::PMeshImpl theMesh, - const VISU::TFamilySet& theFamilySet); + const VISU::TFamilySet& theFamilySet); virtual int LoadValForTimeOnMesh(VISU::PMeshImpl theMesh, - VISU::PMeshOnEntityImpl theMeshOnEntity, - VISU::PFieldImpl theField, - VISU::PValForTimeImpl theValForTime); + VISU::PMeshOnEntityImpl theMeshOnEntity, + VISU::PFieldImpl theField, + VISU::PValForTimeImpl theValForTime); virtual int LoadValForTimeOnGaussPts(VISU::PMeshImpl theMesh, - VISU::PMeshOnEntityImpl theMeshOnEntity, - VISU::PFieldImpl theField, - VISU::PValForTimeImpl theValForTime) + VISU::PMeshOnEntityImpl theMeshOnEntity, + VISU::PFieldImpl theField, + VISU::PValForTimeImpl theValForTime) { return 0; } @@ -242,22 +242,22 @@ class VISU_MEDConvertor: public VISU_Convertor_impl int LoadPointsOnFamily(VISU::PCMesh theMesh, - VISU::PCFamily theFamily) ; + VISU::PCFamily theFamily) ; int LoadCellsOnEntity(VISU::PCMesh theMesh, - VISU::PCMeshOnEntity theMeshOnEntity); + VISU::PCMeshOnEntity theMeshOnEntity); int LoadCellsOnFamily(VISU::PCMesh theMesh, - VISU::PCMeshOnEntity theMeshOnEntity, - VISU::PCFamily theFamily); + VISU::PCMeshOnEntity theMeshOnEntity, + VISU::PCFamily theFamily); int LoadField(VISU::PCMesh theMesh, - VISU::PCMeshOnEntity theMeshOnEntity, - VISU::PField theField, - VISU::PCValForTime theValForTime); + VISU::PCMeshOnEntity theMeshOnEntity, + VISU::PField theField, + VISU::PCValForTime theValForTime); }; diff --git a/src/VISU_I/VISU_TimeAnimation.cxx b/src/VISU_I/VISU_TimeAnimation.cxx index 2e0296f9..c2b29a68 100644 --- a/src/VISU_I/VISU_TimeAnimation.cxx +++ b/src/VISU_I/VISU_TimeAnimation.cxx @@ -126,7 +126,7 @@ namespace VISU void AddController(ColoredPrs3d_i* theReference, - VISU::PMinMaxController theMinMaxController) + VISU::PMinMaxController theMinMaxController) { myMinMaxContainer[ TKey( theReference ) ] = theMinMaxController; } @@ -137,8 +137,8 @@ namespace VISU { TMinMaxContainer::iterator anIter = myMinMaxContainer.find( TKey( theFromPrs3 ) ); if ( anIter != myMinMaxContainer.end() ) { - myMinMaxContainer.erase( anIter ); - myMinMaxContainer[ TKey( theToPrs3d ) ] = VISU::CreateDefaultMinMaxController( theToPrs3d ); + myMinMaxContainer.erase( anIter ); + myMinMaxContainer[ TKey( theToPrs3d ) ] = VISU::CreateDefaultMinMaxController( theToPrs3d ); } } @@ -148,11 +148,11 @@ namespace VISU { vtkFloatingPointType aMin = TMinMaxController::GetComponentMin(theCompID); if ( !myMinMaxContainer.empty() ) { - TMinMaxContainer::const_iterator anIter = myMinMaxContainer.begin(); - for(; anIter != myMinMaxContainer.end(); anIter++){ - VISU::PMinMaxController aMinMaxController = anIter->second; - aMin = std::min(aMin, aMinMaxController->GetComponentMin(theCompID)); - } + TMinMaxContainer::const_iterator anIter = myMinMaxContainer.begin(); + for(; anIter != myMinMaxContainer.end(); anIter++){ + VISU::PMinMaxController aMinMaxController = anIter->second; + aMin = std::min(aMin, aMinMaxController->GetComponentMin(theCompID)); + } } return aMin; } @@ -163,11 +163,11 @@ namespace VISU { vtkFloatingPointType aMax = TMinMaxController::GetComponentMax(theCompID); if ( !myMinMaxContainer.empty() ) { - TMinMaxContainer::const_iterator anIter = myMinMaxContainer.begin(); - for(; anIter != myMinMaxContainer.end(); anIter++){ - VISU::PMinMaxController aMinMaxController = anIter->second; - aMax = std::max(aMax, aMinMaxController->GetComponentMax(theCompID)); - } + TMinMaxContainer::const_iterator anIter = myMinMaxContainer.begin(); + for(; anIter != myMinMaxContainer.end(); anIter++){ + VISU::PMinMaxController aMinMaxController = anIter->second; + aMax = std::max(aMax, aMinMaxController->GetComponentMax(theCompID)); + } } return aMax; } @@ -297,7 +297,7 @@ bool VISU_TimeAnimation::addField (_PTR(SObject) theField) VISU::Storable::TRestoringMap aFMap = VISU::Storable::GetStorableMap(myFieldsLst.first().myField); long aNumComp = VISU::Storable::FindValue(aFMap, "myNumComponent").toLong(); if ( aNumCompCurr != aNumComp ) - return false; + return false; } if ( !myFieldsLst.isEmpty() ) @@ -345,7 +345,7 @@ void VISU_TimeAnimation::_clearData(FieldData& theData) { if (!theData.myActors.empty()) { for (int i = 0, iEnd = theData.myActors.size(); i < iEnd; i++) { if (theData.myActors[i] != 0) { - theData.myActors[i]->RemoveFromRender(aRen); + theData.myActors[i]->RemoveFromRender(aRen); } } theData.myActors.clear(); @@ -353,7 +353,7 @@ void VISU_TimeAnimation::_clearData(FieldData& theData) { if (!theData.myPrs.empty()) { for (int i = 0, iEnd = theData.myPrs.size(); i < iEnd; i++) if (theData.myPrs[i] != 0) { - theData.myPrs[i]->_remove_ref(); + theData.myPrs[i]->_remove_ref(); } theData.myPrs.clear(); } @@ -373,12 +373,12 @@ namespace template void GeneratePresentations(_PTR(Study) theStudy, - FieldData& theData, - VISU::Result_i* theResult, - bool theIsRangeDefined, - CORBA::Double theTimeMin, - CORBA::Double theTimeMax, - QList theSequence) + FieldData& theData, + VISU::Result_i* theResult, + bool theIsRangeDefined, + CORBA::Double theTimeMin, + CORBA::Double theTimeMax, + QList theSequence) { _PTR(ChildIterator) anIter = theStudy->NewChildIterator(theData.myField); anIter->Next(); // First is reference on support @@ -392,26 +392,26 @@ namespace long aSequenceIndex = 1; for(; anIter->More(); anIter->Next(), aSequenceIndex++){ if (aFrameId == theData.myNbTimes) { - MESSAGE("There are extra timestamps in field"); - return; + MESSAGE("There are extra timestamps in field"); + return; } _PTR(SObject) aTimeStamp = anIter->Value(); if(!aTimeStamp) - continue; + continue; long aSequenceId = -1; theData.myTiming[aFrameId] = VISU_TimeAnimation::getTimeValue(aTimeStamp); if (theIsRangeDefined) { - if (theData.myTiming[aFrameId] < theTimeMin) - continue; - if (theData.myTiming[aFrameId] > theTimeMax) - break; + if (theData.myTiming[aFrameId] < theTimeMin) + continue; + if (theData.myTiming[aFrameId] > theTimeMax) + break; } else if (isSequenceDefined) { - aSequenceId = theSequence.indexOf( aSequenceIndex ); - if( aSequenceId == -1 ) - continue; + aSequenceId = theSequence.indexOf( aSequenceIndex ); + if( aSequenceId == -1 ) + continue; } VISU::Storable::TRestoringMap aTimeMap = VISU::Storable::GetStorableMap(aTimeStamp); @@ -433,12 +433,12 @@ namespace #endif if(aPresent->Apply(false)){ /* - if(isSequenceDefined) - { - theData.myPrs[aSequenceId] = aPresent; - aFrameId++; - } - else + if(isSequenceDefined) + { + theData.myPrs[aSequenceId] = aPresent; + aFrameId++; + } + else */ theData.myPrs[aFrameId++] = aPresent; anIsCreated = true; @@ -452,16 +452,16 @@ namespace INFOS("Unknown exception was occured!"); } if(!anIsCreated) - aPresent->_remove_ref(); + aPresent->_remove_ref(); } theData.myNbFrames = aFrameId; if (theData.myPrsType != VISU::TGAUSSPOINTS) { for(long aFrameId = 0; aFrameId < theData.myNbFrames; aFrameId++) { - if (VISU::ScalarMap_i* aPrs = dynamic_cast(theData.myPrs[aFrameId])){ - aPrs->SetOffset(theData.myOffset); - } + if (VISU::ScalarMap_i* aPrs = dynamic_cast(theData.myPrs[aFrameId])){ + aPrs->SetOffset(theData.myOffset); + } } } } @@ -534,103 +534,103 @@ void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) switch (aData.myPrsType) { case VISU::TSCALARMAP: GeneratePresentations(myStudy, - aData, - aResult, - isRangeDefined(), - myTimeMinVal, - myTimeMaxVal, - aSequence); + aData, + aResult, + isRangeDefined(), + myTimeMinVal, + myTimeMaxVal, + aSequence); break; case VISU::TISOSURFACES: // Iso Surfaces GeneratePresentations(myStudy, - aData, - aResult, - isRangeDefined(), - myTimeMinVal, - myTimeMaxVal, - aSequence); + aData, + aResult, + isRangeDefined(), + myTimeMinVal, + myTimeMaxVal, + aSequence); break; case VISU::TCUTPLANES: // Cut Planes GeneratePresentations(myStudy, - aData, - aResult, - isRangeDefined(), - myTimeMinVal, - myTimeMaxVal, - aSequence); + aData, + aResult, + isRangeDefined(), + myTimeMinVal, + myTimeMaxVal, + aSequence); break; case VISU::TCUTLINES: // Cut Lines GeneratePresentations(myStudy, - aData, - aResult, - isRangeDefined(), - myTimeMinVal, - myTimeMaxVal, - aSequence); + aData, + aResult, + isRangeDefined(), + myTimeMinVal, + myTimeMaxVal, + aSequence); break; case VISU::TCUTSEGMENT: // Cut Segment GeneratePresentations(myStudy, - aData, - aResult, - isRangeDefined(), - myTimeMinVal, - myTimeMaxVal, - aSequence); + aData, + aResult, + isRangeDefined(), + myTimeMinVal, + myTimeMaxVal, + aSequence); break; case VISU::TPLOT3D: // Plot3d GeneratePresentations(myStudy, - aData, - aResult, - isRangeDefined(), - myTimeMinVal, - myTimeMaxVal, - aSequence); + aData, + aResult, + isRangeDefined(), + myTimeMinVal, + myTimeMaxVal, + aSequence); break; case VISU::TDEFORMEDSHAPE: // Deformed Shape GeneratePresentations(myStudy, - aData, - aResult, - isRangeDefined(), - myTimeMinVal, - myTimeMaxVal, - aSequence); + aData, + aResult, + isRangeDefined(), + myTimeMinVal, + myTimeMaxVal, + aSequence); break; case VISU::TVECTORS: // Vectors GeneratePresentations(myStudy, - aData, - aResult, - isRangeDefined(), - myTimeMinVal, - myTimeMaxVal, - aSequence); + aData, + aResult, + isRangeDefined(), + myTimeMinVal, + myTimeMaxVal, + aSequence); break; case VISU::TSTREAMLINES: // Stream Lines GeneratePresentations(myStudy, - aData, - aResult, - isRangeDefined(), - myTimeMinVal, - myTimeMaxVal, - aSequence); + aData, + aResult, + isRangeDefined(), + myTimeMinVal, + myTimeMaxVal, + aSequence); break; case VISU::TGAUSSPOINTS: // Gauss Points GeneratePresentations(myStudy, - aData, - aResult, - isRangeDefined(), - myTimeMinVal, - myTimeMaxVal, - aSequence); + aData, + aResult, + isRangeDefined(), + myTimeMinVal, + myTimeMaxVal, + aSequence); break; case VISU::TSCALARMAPONDEFORMEDSHAPE: // Scalar map on deformed shape case VISU::TDEFORMEDSHAPEANDSCALARMAP: GeneratePresentations(myStudy, - aData, - aResult, - isRangeDefined(), - myTimeMinVal, - myTimeMaxVal, - aSequence); + aData, + aResult, + isRangeDefined(), + myTimeMinVal, + myTimeMaxVal, + aSequence); break; default: MESSAGE("Not implemented for this presentation type: " << aData.myPrsType); @@ -648,32 +648,32 @@ void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) if (theFieldNum == getNbFields() - 1) { if ( aData.myPrsType != VISU::TGAUSSPOINTS && aData.myPrsType != TDEFORMEDSHAPEANDSCALARMAP && aData.myPrsType != TSCALARMAPONDEFORMEDSHAPE) { - // Initialize the MinMax controller - VISU::PCompositeMinMaxController aMinMaxController(new VISU::TCompositeMinMaxController()); - if ( myAnimationMode == VISU::Animation::PARALLEL ) { - FieldData& aFieldData = getFieldData(theFieldNum); - VISU::ColoredPrs3d_i* aPrs3d = aFieldData.myPrs[0]; - aMinMaxController->AddController( aPrs3d, VISU::CreateDefaultMinMaxController( aPrs3d ) ); - } else { - for (int aFieldId = 0; aFieldId < getNbFields(); aFieldId++) { - FieldData& aFieldData = getFieldData(aFieldId); - VISU::ColoredPrs3d_i* aPrs3d = aFieldData.myPrs[0]; - aMinMaxController->AddController( aPrs3d, VISU::CreateDefaultMinMaxController( aPrs3d ) ); - } - } - - double aMin = getMinFieldsValue(myFieldsLst); - double aMax = getMaxFieldsValue(myFieldsLst); - - for (int aFieldId = 0; aFieldId < getNbFields(); aFieldId++) { - FieldData& aFieldData = getFieldData(aFieldId); - for (long aFrameId = 0; aFrameId < aFieldData.myNbFrames; aFrameId++) { - VISU::ColoredPrs3d_i* aPrs3d = aFieldData.myPrs[aFrameId]; - aPrs3d->SetMinMaxController(aMinMaxController); - if (VISU::IsoSurfaces_i* anIsoSurfaces = dynamic_cast(aPrs3d)) - anIsoSurfaces->SetSubRange(aMin, aMax); - } - } + // Initialize the MinMax controller + VISU::PCompositeMinMaxController aMinMaxController(new VISU::TCompositeMinMaxController()); + if ( myAnimationMode == VISU::Animation::PARALLEL ) { + FieldData& aFieldData = getFieldData(theFieldNum); + VISU::ColoredPrs3d_i* aPrs3d = aFieldData.myPrs[0]; + aMinMaxController->AddController( aPrs3d, VISU::CreateDefaultMinMaxController( aPrs3d ) ); + } else { + for (int aFieldId = 0; aFieldId < getNbFields(); aFieldId++) { + FieldData& aFieldData = getFieldData(aFieldId); + VISU::ColoredPrs3d_i* aPrs3d = aFieldData.myPrs[0]; + aMinMaxController->AddController( aPrs3d, VISU::CreateDefaultMinMaxController( aPrs3d ) ); + } + } + + double aMin = getMinFieldsValue(myFieldsLst); + double aMax = getMaxFieldsValue(myFieldsLst); + + for (int aFieldId = 0; aFieldId < getNbFields(); aFieldId++) { + FieldData& aFieldData = getFieldData(aFieldId); + for (long aFrameId = 0; aFrameId < aFieldData.myNbFrames; aFrameId++) { + VISU::ColoredPrs3d_i* aPrs3d = aFieldData.myPrs[aFrameId]; + aPrs3d->SetMinMaxController(aMinMaxController); + if (VISU::IsoSurfaces_i* anIsoSurfaces = dynamic_cast(aPrs3d)) + anIsoSurfaces->SetSubRange(aMin, aMax); + } + } } } } @@ -698,17 +698,17 @@ CORBA::Boolean VISU_TimeAnimation::_generateFrames() { for (long j = 0; j < aData.myNbFrames; j++) { VISU_Actor* aActor = NULL; try{ - aData.myPrs[j]->SetOffset(aData.myOffset); - aActor = aData.myPrs[j]->CreateActor(); - myView->AddActor(aActor); - bool condition = ( myAnimationMode == VISU::Animation::PARALLEL ) ? (j == 0) : (j == 0 && i == 0); - if(condition) - aActor->VisibilityOn(); - else - aActor->VisibilityOff(); + aData.myPrs[j]->SetOffset(aData.myOffset); + aActor = aData.myPrs[j]->CreateActor(); + myView->AddActor(aActor); + bool condition = ( myAnimationMode == VISU::Animation::PARALLEL ) ? (j == 0) : (j == 0 && i == 0); + if(condition) + aActor->VisibilityOn(); + else + aActor->VisibilityOff(); }catch(...){ //catch(std::runtime_error& exc){ - aNoError = false; - myLastError += QString("%1 ").arg(aData.myTiming[j]); + aNoError = false; + myLastError += QString("%1 ").arg(aData.myTiming[j]); } aData.myActors[j] = aActor; } @@ -716,7 +716,7 @@ CORBA::Boolean VISU_TimeAnimation::_generateFrames() { myFrame = 0; myLastError += QString(" timestamp(s) cannot be created."); ProcessVoidEvent(new TVoidMemFun2ArgEvent(this, &VISU_TimeAnimation::_emitFrameChanged, - myFrame, myFieldsLst[0].myTiming[myFrame])); + myFrame, myFieldsLst[0].myTiming[myFrame])); myView->Repaint(); return aNoError; } @@ -739,9 +739,9 @@ void VISU_TimeAnimation::_clearView() { FieldData& aData = myFieldsLst[i]; if (!aData.myActors.empty()) { for (int i = 0, iEnd = aData.myActors.size(); i < iEnd; i++) { - if (aData.myActors[i] != 0) { - aData.myActors[i]->RemoveFromRender(aRen); - } + if (aData.myActors[i] != 0) { + aData.myActors[i]->RemoveFromRender(aRen); + } } aData.myActors.clear(); } @@ -832,36 +832,36 @@ void VISU_TimeAnimation::_nextFrame() { if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode for (i = 0; i < getNbFields(); i++) - if (myFieldsLst[i].myActors[myFrame] != 0) - visibilityOff(i, myFrame); + if (myFieldsLst[i].myActors[myFrame] != 0) + visibilityOff(i, myFrame); } else { //successive animation mode aPair = getRelativeFrameNumber(myFrame); aFieldId = aPair.first; aFrameId = aPair.second; if (myFieldsLst[aFieldId].myActors[aFrameId] != 0) - visibilityOff(aFieldId, aFrameId); + visibilityOff(aFieldId, aFrameId); } myFrame++; if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode for (i = 0; i < getNbFields(); i++) - if (myFieldsLst[i].myActors[myFrame] != 0) - myFieldsLst[i].myActors[myFrame]->VisibilityOn(); + if (myFieldsLst[i].myActors[myFrame] != 0) + myFieldsLst[i].myActors[myFrame]->VisibilityOn(); ProcessVoidEvent(new TVoidMemFun2ArgEvent(this, &VISU_TimeAnimation::_emitFrameChanged, - myFrame, myFieldsLst[0].myTiming[myFrame])); + myFrame, myFieldsLst[0].myTiming[myFrame])); } else { //successive animation mode aPair = getRelativeFrameNumber(myFrame); aFieldId = aPair.first; aFrameId = aPair.second; if (myFieldsLst[aFieldId].myActors[aFrameId] != 0) - myFieldsLst[aFieldId].myActors[aFrameId]->VisibilityOn(); + myFieldsLst[aFieldId].myActors[aFrameId]->VisibilityOn(); ProcessVoidEvent(new TVoidMemFun2ArgEvent(this, &VISU_TimeAnimation::_emitFrameChanged, - myFrame, myFieldsLst[aFieldId].myTiming[aFrameId])); + myFrame, myFieldsLst[aFieldId].myTiming[aFrameId])); } myView->Repaint(); } @@ -889,36 +889,36 @@ void VISU_TimeAnimation::_prevFrame() { if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode for (i = 0; i < getNbFields(); i++) - if (myFieldsLst[i].myActors[myFrame] != 0) - visibilityOff(i, myFrame); + if (myFieldsLst[i].myActors[myFrame] != 0) + visibilityOff(i, myFrame); } else { //successive animation mode aPair = getRelativeFrameNumber(myFrame); aFieldId = aPair.first; aFrameId = aPair.second; if (myFieldsLst[aFieldId].myActors[aFrameId] != 0) - visibilityOff(aFieldId, aFrameId); + visibilityOff(aFieldId, aFrameId); } myFrame--; if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode for (i = 0; i < getNbFields(); i++) - if (myFieldsLst[i].myActors[myFrame] != 0) - myFieldsLst[i].myActors[myFrame]->VisibilityOn(); + if (myFieldsLst[i].myActors[myFrame] != 0) + myFieldsLst[i].myActors[myFrame]->VisibilityOn(); ProcessVoidEvent(new TVoidMemFun2ArgEvent(this, &VISU_TimeAnimation::_emitFrameChanged, - myFrame, myFieldsLst[0].myTiming[myFrame])); + myFrame, myFieldsLst[0].myTiming[myFrame])); } else { //successive animation mode aPair = getRelativeFrameNumber(myFrame); aFieldId = aPair.first; aFrameId = aPair.second; if (myFieldsLst[aFieldId].myActors[aFrameId] != 0) - myFieldsLst[aFieldId].myActors[aFrameId]->VisibilityOn(); + myFieldsLst[aFieldId].myActors[aFrameId]->VisibilityOn(); ProcessVoidEvent(new TVoidMemFun2ArgEvent(this, &VISU_TimeAnimation::_emitFrameChanged, - myFrame, myFieldsLst[aFieldId].myTiming[aFrameId])); + myFrame, myFieldsLst[aFieldId].myTiming[aFrameId])); } myView->Repaint(); } @@ -942,8 +942,8 @@ void VISU_TimeAnimation::_firstFrame() { if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode for (i = 0; i < getNbFields(); i++) if(!myFieldsLst[i].myActors.empty()) - if (myFieldsLst[i].myActors[myFrame] != 0) - visibilityOff(i, myFrame); + if (myFieldsLst[i].myActors[myFrame] != 0) + visibilityOff(i, myFrame); } else { //successive animation mode std::pair aPair = getRelativeFrameNumber(myFrame); @@ -951,7 +951,7 @@ void VISU_TimeAnimation::_firstFrame() { long aFrameId = aPair.second; if(!myFieldsLst[aFieldId].myActors.empty()) if (myFieldsLst[aFieldId].myActors[aFrameId] != 0) - visibilityOff(aFieldId, aFrameId); + visibilityOff(aFieldId, aFrameId); } myFrame = 0; @@ -964,11 +964,11 @@ void VISU_TimeAnimation::_firstFrame() { for (i = 0; i < imax; i++) if(!myFieldsLst[i].myActors.empty()) if (myFieldsLst[i].myActors[myFrame] != 0) - myFieldsLst[i].myActors[myFrame]->VisibilityOn(); + myFieldsLst[i].myActors[myFrame]->VisibilityOn(); if(!myFieldsLst[0].myTiming.empty()){ ProcessVoidEvent(new TVoidMemFun2ArgEvent(this, &VISU_TimeAnimation::_emitFrameChanged, - myFrame, myFieldsLst[0].myTiming[myFrame])); + myFrame, myFieldsLst[0].myTiming[myFrame])); myView->Repaint(); } } @@ -995,7 +995,7 @@ void VISU_TimeAnimation::_lastFrame() { if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode for (i = 0; i < getNbFields(); i++) if (myFieldsLst[i].myActors[myFrame] != 0) - visibilityOff(i, myFrame); + visibilityOff(i, myFrame); } else { //successive animation mode aPair = getRelativeFrameNumber(myFrame); @@ -1010,20 +1010,20 @@ void VISU_TimeAnimation::_lastFrame() { if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode for (i = 0; i < getNbFields(); i++) if (myFieldsLst[i].myActors[myFrame] != 0) - myFieldsLst[i].myActors[myFrame]->VisibilityOn(); + myFieldsLst[i].myActors[myFrame]->VisibilityOn(); ProcessVoidEvent(new TVoidMemFun2ArgEvent(this, &VISU_TimeAnimation::_emitFrameChanged, - myFrame, myFieldsLst[0].myTiming[myFrame])); + myFrame, myFieldsLst[0].myTiming[myFrame])); } else { //successive animation mode aPair = getRelativeFrameNumber(myFrame); aFieldId = aPair.first; aFrameId = aPair.second; if (myFieldsLst[aFieldId].myActors[aFrameId] != 0) - myFieldsLst[aFieldId].myActors[aFrameId]->VisibilityOn(); + myFieldsLst[aFieldId].myActors[aFrameId]->VisibilityOn(); ProcessVoidEvent(new TVoidMemFun2ArgEvent(this, &VISU_TimeAnimation::_emitFrameChanged, - myFrame, myFieldsLst[aFieldId].myTiming[aFrameId])); + myFrame, myFieldsLst[aFieldId].myTiming[aFrameId])); } myView->Repaint(); @@ -1055,14 +1055,14 @@ void VISU_TimeAnimation::_gotoFrame(CORBA::Long theFrame) { if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode for (i = 0; i < getNbFields(); i++) if (myFieldsLst[i].myActors[myFrame] != 0) - visibilityOff(i, myFrame); + visibilityOff(i, myFrame); } else { //successive animation mode aPair = getRelativeFrameNumber(myFrame); aFieldId = aPair.first; aFrameId = aPair.second; if (myFieldsLst[aFieldId].myActors[aFrameId] != 0) - visibilityOff(aFieldId, aFrameId); + visibilityOff(aFieldId, aFrameId); } myFrame = theFrame; @@ -1070,20 +1070,20 @@ void VISU_TimeAnimation::_gotoFrame(CORBA::Long theFrame) { if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode for (i = 0; i < getNbFields(); i++) if (myFieldsLst[i].myActors[myFrame] != 0) - myFieldsLst[i].myActors[myFrame]->VisibilityOn(); + myFieldsLst[i].myActors[myFrame]->VisibilityOn(); ProcessVoidEvent(new TVoidMemFun2ArgEvent(this, &VISU_TimeAnimation::_emitFrameChanged, - myFrame, myFieldsLst[0].myTiming[myFrame])); + myFrame, myFieldsLst[0].myTiming[myFrame])); } else { //successive animation mode aPair = getRelativeFrameNumber(myFrame); aFieldId = aPair.first; aFrameId = aPair.second; if (myFieldsLst[aFieldId].myActors[aFrameId] != 0) - myFieldsLst[aFieldId].myActors[aFrameId]->VisibilityOn(); + myFieldsLst[aFieldId].myActors[aFrameId]->VisibilityOn(); ProcessVoidEvent(new TVoidMemFun2ArgEvent(this, &VISU_TimeAnimation::_emitFrameChanged, - myFrame, myFieldsLst[aFieldId].myTiming[aFrameId])); + myFrame, myFieldsLst[aFieldId].myTiming[aFrameId])); } myView->Repaint(); @@ -1154,9 +1154,9 @@ long VISU_TimeAnimation::getAbsoluteFrameNumber(std::pair theFieldTime } else { //successive animation mode if ( aFieldId == 0 && aFrameNum <= myFieldsAbsFrames[aFieldId] ) - aRes = aFrameNum; + aRes = aFrameNum; else if ( aFieldId && aFrameNum <= myFieldsAbsFrames[aFieldId] - myFieldsAbsFrames[aFieldId-1] ) - aRes = myFieldsAbsFrames[aFieldId-1] + aFrameNum; + aRes = myFieldsAbsFrames[aFieldId-1] + aFrameNum; } } return aRes - 1; @@ -1174,14 +1174,14 @@ std::pair VISU_TimeAnimation::getRelativeFrameNumber(long theFrame) } else { //successive animation mode for (int i = 0, iEnd = myFieldsAbsFrames.size(); i < iEnd; i++) - if ( myFieldsAbsFrames[i] >= theFrame ) { - aRes.first = i; - if ( i == 0 ) - aRes.second = theFrame - 1; - else - aRes.second = theFrame-myFieldsAbsFrames[i-1] - 1; - break; - } + if ( myFieldsAbsFrames[i] >= theFrame ) { + aRes.first = i; + if ( i == 0 ) + aRes.second = theFrame - 1; + else + aRes.second = theFrame-myFieldsAbsFrames[i-1] - 1; + break; + } } } return aRes; @@ -1205,14 +1205,14 @@ void VISU_TimeAnimation::parallelAnimation( bool& theIsDumping, QList& theI if (myExecutionState->IsActive()) { for (int i = 0; i < getNbFields(); i++) { FieldData& aData = myFieldsLst[i]; - if (aData.myNbFrames == 0) - continue; + if (aData.myNbFrames == 0) + continue; if (myFrame > 0) { if (aData.myActors[myFrame-1] != 0) visibilityOff(i, myFrame-1); } else { - if (aData.myActors[aData.myNbFrames-1] != 0) - visibilityOff(i, aData.myNbFrames-1); + if (aData.myActors[aData.myNbFrames-1] != 0) + visibilityOff(i, aData.myNbFrames-1); } if (aData.myActors[myFrame] != 0 && myView) { ProcessVoidEvent(new TVoidMemFunEvent(aData.myActors[myFrame], @@ -1220,7 +1220,7 @@ void VISU_TimeAnimation::parallelAnimation( bool& theIsDumping, QList& theI } } if (!myView) - return; + return; bool repainArg = false; ProcessVoidEvent(new TVoidMemFun1ArgEvent(myView, &SVTK_ViewWindow::Repaint, @@ -1257,10 +1257,10 @@ void VISU_TimeAnimation::parallelAnimation( bool& theIsDumping, QList& theI // We must unlock mutex for some time before grabbing to allow view updating msleep(delay); if (!myExecutionState->IsActive()) - return; + return; if (!(aFirstFieldData.myField)) // break, if field was deleted. - break; + break; saveImages( 0, aOneVal, aNbFiles, theIndexList ); } @@ -1272,10 +1272,10 @@ void VISU_TimeAnimation::parallelAnimation( bool& theIsDumping, QList& theI if (myFrame == aFirstFieldData.myNbFrames) { if (!myCycling) { aHasNextFrame = false; - myFrame--; + myFrame--; } else - myFrame = 0; + myFrame = 0; } } // while (aHasNextFrame && myExecutionState->IsActive()) } @@ -1310,11 +1310,11 @@ void VISU_TimeAnimation::successiveAnimation( bool& theIsDumping, QList& th if ( !aData.myPrs[0] ) continue; for (; aFrame < aData.myNbFrames && myExecutionState->IsActive(); aFrame++, myFrame++) { - ProcessVoidEvent(new TVoidMemFun2ArgEvent + ProcessVoidEvent(new TVoidMemFun2ArgEvent (this, &VISU_TimeAnimation::_emitFrameChanged, myFrame, myFieldsLst[aFieldId].myTiming[aFrame])); - if (myExecutionState->IsActive()) { + if (myExecutionState->IsActive()) { if (aFrame > 0) { if (aData.myActors[aFrame-1] != 0) visibilityOff(aFieldId, aFrame-1); @@ -1333,50 +1333,50 @@ void VISU_TimeAnimation::successiveAnimation( bool& theIsDumping, QList& th &VISU_Actor::VisibilityOn)); } - if (!myView) - return; + if (!myView) + return; bool repainArg = false; ProcessVoidEvent(new TVoidMemFun1ArgEvent(myView, &SVTK_ViewWindow::Repaint, repainArg)); - } - - k = 1; - if (myProportional) { - switch (aFrame) { - case 0: - break; - case 1: - if (aFirstFieldData.myNbFrames > 2) - k = (aFirstFieldData.myTiming[aFrame+1] - - aFirstFieldData.myTiming[aFrame]) / aOneVal; - break; - default: - if (aFrame < (aFirstFieldData.myNbFrames - 1)) - k = (aFirstFieldData.myTiming[aFrame+1] - - aFirstFieldData.myTiming[aFrame]) / aOneVal; - } - } - int delay = (int)(1000. * k / mySpeed); - theIsDumping = !myDumpPath.isEmpty(); - if (delay < 1 && theIsDumping) { - // We must unlock mutex for some time before grabbing to allow view updating - delay = 1; - } - msleep(delay); - - if (!myExecutionState->IsActive()) return; - - if (theIsDumping) { - // We must unlock mutex for some time before grabbing to allow view updating - msleep(delay); - if (!myExecutionState->IsActive()) return; - - if (!(myFieldsLst[aFieldId].myField)) // break, if field was deleted. - break; - - saveImages( aFieldId, aOneVal, aNbFiles, theIndexList ); - } + } + + k = 1; + if (myProportional) { + switch (aFrame) { + case 0: + break; + case 1: + if (aFirstFieldData.myNbFrames > 2) + k = (aFirstFieldData.myTiming[aFrame+1] - + aFirstFieldData.myTiming[aFrame]) / aOneVal; + break; + default: + if (aFrame < (aFirstFieldData.myNbFrames - 1)) + k = (aFirstFieldData.myTiming[aFrame+1] - + aFirstFieldData.myTiming[aFrame]) / aOneVal; + } + } + int delay = (int)(1000. * k / mySpeed); + theIsDumping = !myDumpPath.isEmpty(); + if (delay < 1 && theIsDumping) { + // We must unlock mutex for some time before grabbing to allow view updating + delay = 1; + } + msleep(delay); + + if (!myExecutionState->IsActive()) return; + + if (theIsDumping) { + // We must unlock mutex for some time before grabbing to allow view updating + msleep(delay); + if (!myExecutionState->IsActive()) return; + + if (!(myFieldsLst[aFieldId].myField)) // break, if field was deleted. + break; + + saveImages( aFieldId, aOneVal, aNbFiles, theIndexList ); + } } // for (; aFrame < aData.myNbFrames && myExecutionState->IsActive(); aFrame++, myFrame++) } // for (int aFieldId = 0; @@ -1393,8 +1393,8 @@ void VISU_TimeAnimation::successiveAnimation( bool& theIsDumping, QList& th //------------------------------------------------------------------------ void VISU_TimeAnimation::saveImages( int theFieldId, - double& theOneVal, int& theNbFiles, - QList& theIndexList ) + double& theOneVal, int& theNbFiles, + QList& theIndexList ) { if (myDumpFormat.compare("AVI") != 0) { QString aFile(myDumpPath); @@ -1418,9 +1418,9 @@ void VISU_TimeAnimation::saveImages( int theFieldId, aFile += "."; aFile += myDumpFormat.toLower(); ProcessVoidEvent(new TVoidMemFunEvent - (myView,&SVTK_ViewWindow::RefreshDumpImage)); // IPAL13602 + (myView,&SVTK_ViewWindow::RefreshDumpImage)); // IPAL13602 ProcessEvent(new TMemFun2ArgEvent - (myView,&SUIT_ViewWindow::dumpViewToFormat,aFile,myDumpFormat)); + (myView,&SUIT_ViewWindow::dumpViewToFormat,aFile,myDumpFormat)); } else { QFileInfo aFileInfo(myDumpPath); QString aDirPath = aFileInfo.absolutePath(); @@ -1434,12 +1434,12 @@ void VISU_TimeAnimation::saveImages( int theFieldId, break; default: if (myProportional) { - FieldData& aFirstFieldData = myFieldsLst[0]; - double p = (aFirstFieldData.myTiming[myFrame] - - aFirstFieldData.myTiming[myFrame-1]) / theOneVal; - myFileIndex += (long) (5*p); + FieldData& aFirstFieldData = myFieldsLst[0]; + double p = (aFirstFieldData.myTiming[myFrame] - + aFirstFieldData.myTiming[myFrame-1]) / theOneVal; + myFileIndex += (long) (5*p); } else { - myFileIndex += 5; + myFileIndex += 5; } } @@ -1459,8 +1459,8 @@ void VISU_TimeAnimation::saveImages( int theFieldId, int height = img.height(); height = (height/16)*16; QImage copy = img.copy(0, 0, width, height); if (copy.save(aFile, "JPEG")) { - theIndexList.append(myFileIndex); - theNbFiles++; + theIndexList.append(myFileIndex); + theNbFiles++; } } } @@ -1497,15 +1497,15 @@ void VISU_TimeAnimation::run() aFFile += QString("_%1.jpeg"); int aStartIndex = anIndexList[0], anEndIndex; for (int i = 1; i < anIndexList.count(); i++) { - anEndIndex = anIndexList[i]; - QString aCurFile = aFFile.arg(QString::number(aStartIndex).rightJustified(8, '0')); - QStringList aCommands; - for (int j = aStartIndex+1; j < anEndIndex; j++) { - QString aFile = aFFile.arg(QString::number(j).rightJustified(8, '0')); - aCommands.append(QString("ln -s %1 %2").arg(aCurFile).arg(aFile)); - } - system(aCommands.join(" ; \\\n").toLatin1().data()); - aStartIndex = anEndIndex; + anEndIndex = anIndexList[i]; + QString aCurFile = aFFile.arg(QString::number(aStartIndex).rightJustified(8, '0')); + QStringList aCommands; + for (int j = aStartIndex+1; j < anEndIndex; j++) { + QString aFile = aFFile.arg(QString::number(j).rightJustified(8, '0')); + aCommands.append(QString("ln -s %1 %2").arg(aCurFile).arg(aFile)); + } + system(aCommands.join(" ; \\\n").toLatin1().data()); + aStartIndex = anEndIndex; } } @@ -1626,18 +1626,18 @@ bool VISU_TimeAnimation::getIndicesFromSequence( QString theSequence, QList= aRightIndex ) - continue; + continue; for( int i = aLeftIndex; i <= aRightIndex; i++ ) - theIndices.append( i ); + theIndices.append( i ); isCorrect = true; } @@ -1732,9 +1732,9 @@ SALOMEDS::SObject_ptr VISU_TimeAnimation::publishInStudy() { if (myStudy->GetProperties()->IsLocked()) { SUIT_MessageBox::warning(0, - QObject::tr("WRN_VISU_WARNING"), - QObject::tr("WRN_STUDY_LOCKED"), - QObject::tr("BUT_OK")); + QObject::tr("WRN_VISU_WARNING"), + QObject::tr("WRN_STUDY_LOCKED"), + QObject::tr("BUT_OK")); return SALOMEDS::SObject::_nil(); } @@ -1746,18 +1746,18 @@ SALOMEDS::SObject_ptr VISU_TimeAnimation::publishInStudy() QString aComment; aComment.sprintf("myComment=ANIMATION;myTimeMinVal=%g;myTimeMaxVal=%g;mySequence=%s;myMode=%d", myTimeMinVal, - myTimeMaxVal, - mySequence.toLatin1().data(), - myAnimationMode); + myTimeMaxVal, + mySequence.toLatin1().data(), + myAnimationMode); string anEntry = VISU::CreateAttributes(myStudy, - aSComponentEntry.c_str(), - VISU::NO_ICON, - VISU::NO_IOR, + aSComponentEntry.c_str(), + VISU::NO_ICON, + VISU::NO_IOR, GenerateName().toLatin1().data(), - VISU::NO_PERFSITENT_REF, - aComment.toLatin1().data(), - true); + VISU::NO_PERFSITENT_REF, + aComment.toLatin1().data(), + true); myAnimEntry = anEntry.c_str(); _PTR(SObject) aAnimSObject = myStudy->FindObjectID(anEntry.c_str()); @@ -1775,15 +1775,15 @@ SALOMEDS::SObject_ptr VISU_TimeAnimation::publishInStudy() string aPrsComment = strOut.str(); string aPrsMyComment = aData.myPrs[0]->GetComment(); if(aPrsMyComment == "PRSMERGER") - aPrsMyComment = "SCALARMAP"; + aPrsMyComment = "SCALARMAP"; VISU::CreateAttributes(myStudy, - newObj->GetID().c_str(), - VISU::NO_ICON, - VISU::NO_IOR, - aPrsMyComment.c_str(), - VISU::NO_PERFSITENT_REF, - aPrsComment.c_str(), - true); + newObj->GetID().c_str(), + VISU::NO_ICON, + VISU::NO_IOR, + aPrsMyComment.c_str(), + VISU::NO_PERFSITENT_REF, + aPrsComment.c_str(), + true); } } aStudyBuilder->CommitCommand(); @@ -1808,9 +1808,9 @@ void VISU_TimeAnimation::saveAnimation() QString aComment; aComment.sprintf("myComment=ANIMATION;myTimeMinVal=%g;myTimeMaxVal=%g;mySequence=%s;myMode=%d", myTimeMinVal, - myTimeMaxVal, - mySequence.toLatin1().data(), - myAnimationMode); + myTimeMaxVal, + mySequence.toLatin1().data(), + myAnimationMode); _PTR(GenericAttribute) anAttr; anAttr = aStudyBuilder->FindOrCreateAttribute(aAnimSObject, "AttributeString"); @@ -1850,13 +1850,13 @@ void VISU_TimeAnimation::saveAnimation() } else { VISU::CreateAttributes(myStudy, - aRefObj->GetID().c_str(), - VISU::NO_ICON, - VISU::NO_IOR, + aRefObj->GetID().c_str(), + VISU::NO_ICON, + VISU::NO_IOR, aPrsNameTxt.c_str(), - VISU::NO_PERFSITENT_REF, - aPrsComment.c_str(), - true); + VISU::NO_PERFSITENT_REF, + aPrsComment.c_str(), + true); } } aStudyBuilder->CommitCommand(); @@ -1950,25 +1950,25 @@ void VISU_TimeAnimation::restoreFromStudy(_PTR(SObject) theField) } for (int i = 1; i < aData.myNbFrames; i++) { if (!aData.myPrs[0]) - continue; + continue; bool anIsFixedRange = false; if (aData.myPrsType != VISU::TGAUSSPOINTS) { - if (VISU::ScalarMap_i* aPrs = dynamic_cast(aData.myPrs[i])) - anIsFixedRange = aPrs->IsRangeFixed(); + if (VISU::ScalarMap_i* aPrs = dynamic_cast(aData.myPrs[i])) + anIsFixedRange = aPrs->IsRangeFixed(); } if (aData.myPrsType == VISU::TDEFORMEDSHAPEANDSCALARMAP) { - if (VISU::DeformedShapeAndScalarMap_i* aDeformedPrs = - dynamic_cast(aData.myPrs[i])) { - //Set correct time stamp number - int aTimeStampNum = aDeformedPrs->GetScalarTimeStampNumber(); - aDeformedPrs->SameAs(aData.myPrs[0]); - aDeformedPrs->SetScalarField(aDeformedPrs->GetScalarEntity(), - aDeformedPrs->GetScalarFieldName(), - aTimeStampNum); - } + if (VISU::DeformedShapeAndScalarMap_i* aDeformedPrs = + dynamic_cast(aData.myPrs[i])) { + //Set correct time stamp number + int aTimeStampNum = aDeformedPrs->GetScalarTimeStampNumber(); + aDeformedPrs->SameAs(aData.myPrs[0]); + aDeformedPrs->SetScalarField(aDeformedPrs->GetScalarEntity(), + aDeformedPrs->GetScalarFieldName(), + aTimeStampNum); + } } else - aData.myPrs[i]->SameAs(aData.myPrs[0]); + aData.myPrs[i]->SameAs(aData.myPrs[0]); } } string aStr = aAnimSObject->GetID(); @@ -1990,24 +1990,24 @@ void VISU_TimeAnimation::ApplyProperties(CORBA::Long theFieldNum, VISU::ColoredP if ( !aPrs_i ) THROW_SALOME_CORBA_EXCEPTION("Error : invalid dynamic cast of the given presentation to VISU::ColoredPrs3d_i", - SALOME::INTERNAL_ERROR); + SALOME::INTERNAL_ERROR); if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode FieldData& aData = myFieldsLst[theFieldNum]; if ( aData.myPrs.empty() ) THROW_SALOME_CORBA_EXCEPTION("Error : presentations for the given field is not yet created!", - SALOME::INTERNAL_ERROR); + SALOME::INTERNAL_ERROR); if ( aPrs_i->GetCResult() != aData.myPrs[0]->GetCResult() ) THROW_SALOME_CORBA_EXCEPTION("Error : the MED file is not the same!", - SALOME::INTERNAL_ERROR); + SALOME::INTERNAL_ERROR); for (int i = 0; i < aData.myNbFrames; i++) { bool anIsFixedRange = false; if (aData.myPrsType != VISU::TGAUSSPOINTS) { - if (VISU::ScalarMap_i* aPrs = dynamic_cast(aData.myPrs[i])) - anIsFixedRange = aPrs->IsRangeFixed(); + if (VISU::ScalarMap_i* aPrs = dynamic_cast(aData.myPrs[i])) + anIsFixedRange = aPrs->IsRangeFixed(); } aData.myPrs[i]->SameAs(aPrs_i); } @@ -2017,11 +2017,11 @@ void VISU_TimeAnimation::ApplyProperties(CORBA::Long theFieldNum, VISU::ColoredP FieldData& aData = myFieldsLst[f]; if ( aData.myPrs.empty() ) - THROW_SALOME_CORBA_EXCEPTION("Error : presentations for the given field is not yet created!", - SALOME::INTERNAL_ERROR); + THROW_SALOME_CORBA_EXCEPTION("Error : presentations for the given field is not yet created!", + SALOME::INTERNAL_ERROR); for (int i = 0; i < aData.myNbFrames; i++) { - aData.myPrs[i]->SameAs(aPrs_i); + aData.myPrs[i]->SameAs(aPrs_i); } } } diff --git a/src/VISU_I/VISU_TimeAnimation.h b/src/VISU_I/VISU_TimeAnimation.h index ee4c0601..cb485fc0 100644 --- a/src/VISU_I/VISU_TimeAnimation.h +++ b/src/VISU_I/VISU_TimeAnimation.h @@ -95,7 +95,7 @@ class VISU_I_EXPORT VISU_TimeAnimation: public QThread static double getTimeValue (_PTR(SObject) theTimestamp); VISU_TimeAnimation(_PTR(Study) theStudy, - VISU::View3D_ptr theView3D = VISU::View3D::_nil()); + VISU::View3D_ptr theView3D = VISU::View3D::_nil()); ~VISU_TimeAnimation(); virtual VISU::VISUType GetType() { return VISU::TNONE;}; diff --git a/src/VISU_I/VISU_Tools.h b/src/VISU_I/VISU_Tools.h index 50713227..bae032d8 100644 --- a/src/VISU_I/VISU_Tools.h +++ b/src/VISU_I/VISU_Tools.h @@ -47,29 +47,29 @@ namespace VISU * Parameter \a frame may be NULL, in this case there is only update without display/erase */ VISU_I_EXPORT void UpdateCurve( VISU::Curve_i*, - Plot2d_ViewFrame*, - SPlot2d_Curve*, - int theDisplaying ); + Plot2d_ViewFrame*, + SPlot2d_Curve*, + int theDisplaying ); VISU_I_EXPORT void PlotTable( SalomeApp_Study*, - Plot2d_ViewFrame*, - VISU::Table_i*, - int theDisplaying ); + Plot2d_ViewFrame*, + VISU::Table_i*, + int theDisplaying ); VISU_I_EXPORT void PlotCurve( Plot2d_ViewFrame*, - VISU::Curve_i*, - int theDisplaying ); + VISU::Curve_i*, + int theDisplaying ); VISU_I_EXPORT void PlotRemoveCurve(SalomeApp_Application*, - VISU::Curve_i* ); + VISU::Curve_i* ); VISU_I_EXPORT void PlotContainer( Plot2d_ViewFrame*, - VISU::Container_i*, - int theDisplaying ); + VISU::Container_i*, + int theDisplaying ); VISU_I_EXPORT void CreatePlot( VISU_Gen_i*, - Plot2d_ViewFrame*, - _PTR(SObject) theTableSO ); + Plot2d_ViewFrame*, + _PTR(SObject) theTableSO ); } #endif diff --git a/src/VVTK/VVTK_ImageWriter.cxx b/src/VVTK/VVTK_ImageWriter.cxx index 463eba43..326498f2 100755 --- a/src/VVTK/VVTK_ImageWriter.cxx +++ b/src/VVTK/VVTK_ImageWriter.cxx @@ -46,10 +46,10 @@ static int MYDEBUG = 0; //---------------------------------------------------------------------------- VVTK_ImageWriter ::VVTK_ImageWriter(QSemaphore* theSemaphore, - vtkImageData* theImageData, - const std::string& theName, - int theProgressive, - int theQuality): + vtkImageData* theImageData, + const std::string& theName, + int theProgressive, + int theQuality): mySemaphore(theSemaphore), myImageData(theImageData), myName(theName), @@ -106,9 +106,9 @@ VVTK_ImageWriter myImageData->Delete(); if(MYDEBUG) MESSAGE("VVTK_ImageWriter::run "<< - "- this = "<loadPixmap( "VISU", tr( "ICON_VVTK_RECORDING_START" ) ), - tr( "MNU_VVTK_RECORDING_START" ), 0, this); + theResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_RECORDING_START" ) ), + tr( "MNU_VVTK_RECORDING_START" ), 0, this); myStartAction->setStatusTip(tr("DSC_VVTK_RECORDING_START")); //myStartAction->addTo( myRecordingToolBar ); myRecordingToolBar->addAction( myStartAction ); connect( myStartAction, SIGNAL( triggered ( bool ) ), this, SLOT( OnStartRecording() ) ); myPlayAction = new QtxAction(tr("MNU_VVTK_RECORDING_PLAY"), - theResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_RECORDING_PLAY" ) ), - tr( "MNU_VVTK_RECORDING_PLAY" ), 0, this); + theResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_RECORDING_PLAY" ) ), + tr( "MNU_VVTK_RECORDING_PLAY" ), 0, this); myPlayAction->setStatusTip(tr("DSC_VVTK_RECORDING_PLAY")); myPlayAction->setEnabled( false ); //myPlayAction->addTo( myRecordingToolBar ); @@ -94,8 +94,8 @@ VVTK_MainWindow::VVTK_MainWindow(QWidget* theParent, connect( myPlayAction, SIGNAL( triggered ( bool ) ), this, SLOT( OnPlayRecording() ) ); myPauseAction = new QtxAction(tr("MNU_VVTK_RECORDING_PAUSE"), - theResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_RECORDING_PAUSE" ) ), - tr( "MNU_VVTK_RECORDING_PAUSE" ), 0, this); + theResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_RECORDING_PAUSE" ) ), + tr( "MNU_VVTK_RECORDING_PAUSE" ), 0, this); myPauseAction->setStatusTip(tr("DSC_VVTK_RECORDING_PAUSE")); myPauseAction->setEnabled( false ); //myPauseAction->addTo( myRecordingToolBar ); @@ -103,8 +103,8 @@ VVTK_MainWindow::VVTK_MainWindow(QWidget* theParent, connect( myPauseAction, SIGNAL( triggered ( bool ) ), this, SLOT( OnPauseRecording() ) ); myStopAction = new QtxAction(tr("MNU_VVTK_RECORDING_STOP"), - theResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_RECORDING_STOP" ) ), - tr( "MNU_VVTK_RECORDING_STOP" ), 0, this); + theResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_RECORDING_STOP" ) ), + tr( "MNU_VVTK_RECORDING_STOP" ), 0, this); myStopAction->setStatusTip(tr("DSC_VVTK_RECORDING_STOP")); myStopAction->setEnabled( false ); //myStopAction->addTo( myRecordingToolBar ); @@ -140,10 +140,10 @@ void VVTK_MainWindow::Initialize(SVTK_RenderWindowInteractor* theInteractor) myRecorder->SetRenderWindow(theInteractor->getRenderWindow()); disconnect( SVTK_MainWindow::action( DumpId ), SIGNAL( activated() ), - myViewWindow, SLOT( onDumpView() ) ); + myViewWindow, SLOT( onDumpView() ) ); connect( SVTK_MainWindow::action( DumpId ), SIGNAL( activated() ), - this, SLOT( onDumpView() ) ); + this, SLOT( onDumpView() ) ); SVTK_MainWindow::Initialize(theInteractor); addToolBar( Qt::LeftToolBarArea, getToolBar() ); @@ -164,8 +164,8 @@ void VVTK_MainWindow::onDumpView() SUIT_Application* app = SUIT_Session::session()->activeApplication(); QString fileName = app->getFileName( false, QString::null, - tr( "TLT_IMAGE_FILES" ), - tr( "TLT_DUMP_VIEW" ), 0 ); + tr( "TLT_IMAGE_FILES" ), + tr( "TLT_DUMP_VIEW" ), 0 ); if( fileName.isEmpty() ) return; @@ -248,9 +248,9 @@ void VVTK_MainWindow::action( const int accelAction ) //---------------------------------------------------------------------------- VVTK_MainWindow1::VVTK_MainWindow1(QSplitter* theParent, - const char* theName, - SUIT_ResourceMgr* theResourceMgr, - SUIT_ViewWindow* theViewWindow): + const char* theName, + SUIT_ResourceMgr* theResourceMgr, + SUIT_ViewWindow* theViewWindow): VVTK_MainWindow(theParent,theName,theResourceMgr,theViewWindow), mySplitter(theParent), myPickingDlg(NULL) @@ -263,12 +263,12 @@ VVTK_MainWindow1::VVTK_MainWindow1(QSplitter* theParent, aPixmap = theResourceMgr->loadPixmap("VISU",tr("ICON_VVTK_SELECTION_MODE_SWITCH")); myPickingAction = new QtxAction(tr("MNU_VVTK_SELECTION_MODE_SWITCH"), - aPixmap, - tr( "MNU_VVTK_SELECTION_MODE_SWITCH" ), - 0, - this, - //"VVTK/SVTK SelectionSwitch", - true); + aPixmap, + tr( "MNU_VVTK_SELECTION_MODE_SWITCH" ), + 0, + this, + //"VVTK/SVTK SelectionSwitch", + true); myPickingAction->setCheckable(true); myPickingAction->setStatusTip(tr("DSC_VVTK_SELECTION_MODE_SWITCH")); myPtsToolBar->addAction( myPickingAction ); @@ -279,12 +279,12 @@ VVTK_MainWindow1::VVTK_MainWindow1(QSplitter* theParent, // Plane/Sphere Segmentation aPixmap = theResourceMgr->loadPixmap("VISU",tr("ICON_VVTK_PLANE_SEGMENTATION_SWITCH")); myPlaneSegmentationAction = new QtxAction(tr("MNU_VVTK_PLANE_SEGMENTATION_SWITCH"), - aPixmap, - tr( "MNU_VVTK_PLANE_SEGMENTATION_SWITCH" ), - 0, - this, - //"VVTK/SVTK PlaneSegmentationSwitch", - true); + aPixmap, + tr( "MNU_VVTK_PLANE_SEGMENTATION_SWITCH" ), + 0, + this, + //"VVTK/SVTK PlaneSegmentationSwitch", + true); myPlaneSegmentationAction->setCheckable(true); myPlaneSegmentationAction->setStatusTip(tr("DSC_VVTK_PLANE_SEGMENTATION_SWITCH")); //myPlaneSegmentationAction->addTo( myPtsToolBar ); @@ -292,12 +292,12 @@ VVTK_MainWindow1::VVTK_MainWindow1(QSplitter* theParent, aPixmap = theResourceMgr->loadPixmap("VISU",tr("ICON_VVTK_SPHERE_SEGMENTATION_SWITCH")); mySphereSegmentationAction = new QtxAction(tr("MNU_VVTK_SPHERE_SEGMENTATION_SWITCH"), - aPixmap, - tr( "MNU_VVTK_SPHERE_SEGMENTATION_SWITCH" ), - 0, - this, - //"VVTK/SVTK SphereSegmentationSwitch", - true); + aPixmap, + tr( "MNU_VVTK_SPHERE_SEGMENTATION_SWITCH" ), + 0, + this, + //"VVTK/SVTK SphereSegmentationSwitch", + true); mySphereSegmentationAction->setCheckable(true); mySphereSegmentationAction->setStatusTip(tr("DSC_VVTK_SPHERE_SEGMENTATION_SWITCH")); //mySphereSegmentationAction->addTo( myPtsToolBar ); @@ -316,7 +316,7 @@ VVTK_MainWindow1::VVTK_MainWindow1(QSplitter* theParent, } void VVTK_MainWindow1::Initialize(SVTK_RenderWindowInteractor* theInteractor, - VVTK_Renderer1* theRenderer) + VVTK_Renderer1* theRenderer) { myRenderer = theRenderer; VVTK_MainWindow::Initialize(theInteractor); @@ -333,14 +333,14 @@ VVTK_MainWindow1::~VVTK_MainWindow1() //---------------------------------------------------------------------------- VVTK_MainWindow2* VVTK_MainWindow1::CreateMainWindow2(QWidget* theParent, - const char* theName, - SUIT_ResourceMgr* theResourceMgr, - SUIT_ViewWindow* theViewWindow) + const char* theName, + SUIT_ResourceMgr* theResourceMgr, + SUIT_ViewWindow* theViewWindow) { myMainWindow2 = new VVTK_MainWindow2(theParent, - theName, - theResourceMgr, - theViewWindow); + theName, + theResourceMgr, + theViewWindow); return myMainWindow2; } @@ -456,9 +456,9 @@ void VVTK_MainWindow1::OnSegmentationSwitch() //---------------------------------------------------------------------------- VVTK_MainWindow2::VVTK_MainWindow2(QWidget* theParent, - const char* theName, - SUIT_ResourceMgr* theResourceMgr, - SUIT_ViewWindow* theViewWindow): + const char* theName, + SUIT_ResourceMgr* theResourceMgr, + SUIT_ViewWindow* theViewWindow): VVTK_MainWindow(theParent,theName,theResourceMgr,theViewWindow) {} diff --git a/src/VVTK/VVTK_MainWindow.h b/src/VVTK/VVTK_MainWindow.h index d3e34e83..81491724 100644 --- a/src/VVTK/VVTK_MainWindow.h +++ b/src/VVTK/VVTK_MainWindow.h @@ -54,9 +54,9 @@ class VVTK_EXPORT VVTK_MainWindow: public SVTK_MainWindow public: //! Construct instance of the class VVTK_MainWindow(QWidget* theParent, - const char* theName, - SUIT_ResourceMgr* theResourceMgr, - SUIT_ViewWindow* theViewWindow); + const char* theName, + SUIT_ResourceMgr* theResourceMgr, + SUIT_ViewWindow* theViewWindow); //! Reimplement SVTK_MainWindow::Initialize virtual void Initialize(SVTK_RenderWindowInteractor* theInteractor); @@ -104,13 +104,13 @@ class VVTK_EXPORT VVTK_MainWindow1: public VVTK_MainWindow public: //! Construct instance of the class VVTK_MainWindow1(QSplitter* theParent, - const char* theName, - SUIT_ResourceMgr* theResourceMgr, - SUIT_ViewWindow* theViewWindow); + const char* theName, + SUIT_ResourceMgr* theResourceMgr, + SUIT_ViewWindow* theViewWindow); //! Reimplement VVTK_MainWindow::Initialize virtual void Initialize(SVTK_RenderWindowInteractor* theInteractor, - VVTK_Renderer1* theRenderer); + VVTK_Renderer1* theRenderer); //! Destroy instance of the class virtual ~VVTK_MainWindow1(); @@ -121,9 +121,9 @@ public: So, it is necessary to synhronize them through sharing some common pointers. */ VVTK_MainWindow2* CreateMainWindow2(QWidget* theParent, - const char* theName, - SUIT_ResourceMgr* theResourceMgr, - SUIT_ViewWindow* theViewWindow); + const char* theName, + SUIT_ResourceMgr* theResourceMgr, + SUIT_ViewWindow* theViewWindow); VISU_WidgetCtrl* GetWidgetCtrl(); @@ -181,9 +181,9 @@ class VVTK_EXPORT VVTK_MainWindow2: public VVTK_MainWindow //! Construct instance of the class VVTK_MainWindow2(QWidget* theParent, - const char* theName, - SUIT_ResourceMgr* theResourceMgr, - SUIT_ViewWindow* theViewWindow); + const char* theName, + SUIT_ResourceMgr* theResourceMgr, + SUIT_ViewWindow* theViewWindow); public: //! Destroy instance of the class virtual ~VVTK_MainWindow2(); diff --git a/src/VVTK/VVTK_PickingDlg.cxx b/src/VVTK/VVTK_PickingDlg.cxx index 4f7a33cb..37730f7f 100644 --- a/src/VVTK/VVTK_PickingDlg.cxx +++ b/src/VVTK/VVTK_PickingDlg.cxx @@ -88,25 +88,25 @@ namespace myActor = NULL; if ( !myInteractor ) - return aResult; + return aResult; mySelector = myInteractor->GetSelector(); if ( !mySelector ) - return aResult; + return aResult; const SALOME_ListIO& aListIO = mySelector->StoredIObjects(); if ( aListIO.Extent() != 1 ) - return aResult; + return aResult; myIO = aListIO.First(); if ( mySelector->HasIndex( myIO ) ) - mySelector->GetIndex(myIO, myMapIndex); - + mySelector->GetIndex(myIO, myMapIndex); + VTK::ActorCollectionCopy aCopy(myInteractor->getRenderer()->GetActors()); myActor = SVTK::Find(aCopy.GetActors(), - SVTK::TIsSameIObject( myIO )); + SVTK::TIsSameIObject( myIO )); if ( !myActor ) - return aResult; + return aResult; myPipeLine = myActor->GetGaussPointsPL(); @@ -128,7 +128,7 @@ namespace { public: GaussPtsIDValidator( SVTK_RenderWindowInteractor* theInteractor, - QObject * theParent ): + QObject * theParent ): QIntValidator( 0, VTK_LARGE_ID, theParent ), myHelper(theInteractor) {} @@ -138,10 +138,10 @@ namespace validate ( QString & theInput, int & thePos ) const { if ( QIntValidator::validate( theInput, thePos ) == QValidator::Invalid) - return QValidator::Invalid; + return QValidator::Invalid; if ( !myHelper.get() ) - return QValidator::Invalid; + return QValidator::Invalid; return QValidator::Acceptable; } @@ -155,8 +155,8 @@ namespace { public: GaussCellIDValidator( QLineEdit* theLocalPointLabel, - SVTK_RenderWindowInteractor* theInteractor, - QObject * theParent ): + SVTK_RenderWindowInteractor* theInteractor, + QObject * theParent ): GaussPtsIDValidator( theInteractor, theParent ), myLocalPointLineEdit( theLocalPointLabel ) {} @@ -166,13 +166,13 @@ namespace validate ( QString & theInput, int & thePos ) const { if ( GaussPtsIDValidator::validate( theInput, thePos ) == QValidator::Invalid) - return QValidator::Invalid; + return QValidator::Invalid; VISU::TCellID aCellID = theInput.toInt(); VISU::TLocalPntID aLocalPntID = myLocalPointLineEdit->text().toInt(); VISU::PGaussPtsIDMapper anIDMapper = myHelper.myPipeLine->GetGaussPtsIDMapper(); if ( anIDMapper->GetVTKID( VISU::TGaussPointID( aCellID, aLocalPntID ) ) < 0 ) - return QValidator::Intermediate; + return QValidator::Intermediate; return QValidator::Acceptable; } @@ -186,8 +186,8 @@ namespace { public: GaussLocalPointIDValidator( QLineEdit* theParentElementLineEdit, - SVTK_RenderWindowInteractor* theInteractor, - QObject * theParent ): + SVTK_RenderWindowInteractor* theInteractor, + QObject * theParent ): GaussPtsIDValidator( theInteractor, theParent ), myParentElementLineEdit( theParentElementLineEdit ) {} @@ -197,13 +197,13 @@ namespace validate ( QString & theInput, int & thePos ) const { if ( GaussPtsIDValidator::validate( theInput, thePos ) == QValidator::Invalid) - return QValidator::Invalid; + return QValidator::Invalid; VISU::TLocalPntID aLocalPntID = theInput.toInt(); VISU::TCellID aCellID = myParentElementLineEdit->text().toInt(); VISU::PGaussPtsIDMapper anIDMapper = myHelper.myPipeLine->GetGaussPtsIDMapper(); if ( anIDMapper->GetVTKID( VISU::TGaussPointID( aCellID, aLocalPntID ) ) < 0 ) - return QValidator::Intermediate; + return QValidator::Intermediate; return QValidator::Acceptable; } @@ -244,11 +244,11 @@ void VVTK_ValidatedLineEdit::MarkValidated( const QString& theText ) //--------------------------------------------------------------------------------- VVTK_PickingDlg::VVTK_PickingDlg(QtxAction* theAction, - SVTK_MainWindow* theParent, - const char* theName): + SVTK_MainWindow* theParent, + const char* theName): SVTK_DialogBase(theAction, - theParent, - theName), + theParent, + theName), myEventCallbackCommand( vtkCallbackCommand::New() ), myPickingSettings( VISU_PickingSettings::New() ) { @@ -492,13 +492,13 @@ void VVTK_PickingDlg::Update() //QPalette aPalette( mySelectionColorButton->palette() ); /*aPalette.setColor( mySelectionColorButton->backgroundRole(), - QColor( ( int )( aColor[0] * 255.0 ), - ( int )( aColor[1] * 255.0 ), - ( int )( aColor[2] * 255.0 ) ) ); + QColor( ( int )( aColor[0] * 255.0 ), + ( int )( aColor[1] * 255.0 ), + ( int )( aColor[2] * 255.0 ) ) ); mySelectionColorButton->setPalette( aPalette );*/ mySelectionColorButton->setColor( QColor( ( int )( aColor[0] * 255.0 ), - ( int )( aColor[1] * 255.0 ), + ( int )( aColor[1] * 255.0 ), ( int )( aColor[2] * 255.0 ) ) ); return; @@ -577,11 +577,11 @@ void VVTK_PickingDlg::SetInteractor( SVTK_RenderWindowInteractor* theInteractor myInteractor = theInteractor; theInteractor->GetDevice()->AddObserver(vtkCommand::KeyPressEvent, - myEventCallbackCommand.GetPointer(), - myPriority); + myEventCallbackCommand.GetPointer(), + myPriority); theInteractor->GetDevice()->AddObserver(vtkCommand::EndPickEvent, - myEventCallbackCommand.GetPointer(), - myPriority); + myEventCallbackCommand.GetPointer(), + myPriority); { QValidator* aValidator = new GaussCellIDValidator( myLocalPointLineEdit, theInteractor, myParentElementLineEdit ); myParentElementLineEdit->setValidator( aValidator ); @@ -593,9 +593,9 @@ void VVTK_PickingDlg::SetInteractor( SVTK_RenderWindowInteractor* theInteractor } void VVTK_PickingDlg::ProcessEvents(vtkObject* vtkNotUsed(theObject), - unsigned long theEvent, - void* theClientData, - void* vtkNotUsed(theCallData)) + unsigned long theEvent, + void* theClientData, + void* vtkNotUsed(theCallData)) { VVTK_PickingDlg* self = reinterpret_cast(theClientData); @@ -675,17 +675,17 @@ void VVTK_PickingDlg::onClickHelp() if (app) app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName); else { - QString platform; + QString platform; #ifdef WIN32 - platform = "winapplication"; + platform = "winapplication"; #else - platform = "application"; + platform = "application"; #endif - SUIT_MessageBox::warning( 0, - QObject::tr("WRN_WARNING"), - QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName), - QObject::tr("BUT_OK")); + SUIT_MessageBox::warning( 0, + QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName), + QObject::tr("BUT_OK")); } } @@ -698,7 +698,7 @@ void VVTK_PickingDlg::onClickHelp() if( aColor.isValid() ) { aPalette.setColor( mySelectionColorButton->backgroundRole(), - aColor ); + aColor ); mySelectionColorButton->setPalette( aPalette ); } }*/ diff --git a/src/VVTK/VVTK_PickingDlg.h b/src/VVTK/VVTK_PickingDlg.h index b01dc9ba..0b06abae 100644 --- a/src/VVTK/VVTK_PickingDlg.h +++ b/src/VVTK/VVTK_PickingDlg.h @@ -65,8 +65,8 @@ class VVTK_PickingDlg : public SVTK_DialogBase public: VVTK_PickingDlg(QtxAction* theAction, - SVTK_MainWindow* theParent, - const char* theName); + SVTK_MainWindow* theParent, + const char* theName); ~VVTK_PickingDlg(); @@ -92,9 +92,9 @@ protected slots: private: static void ProcessEvents(vtkObject* theObject, - unsigned long theEvent, - void* theClientData, - void* theCallData); + unsigned long theEvent, + void* theClientData, + void* theCallData); void KeyPressed(); void keyPressEvent( QKeyEvent* e ); diff --git a/src/VVTK/VVTK_PrimitiveBox.cxx b/src/VVTK/VVTK_PrimitiveBox.cxx index 21245b4f..67023c5c 100644 --- a/src/VVTK/VVTK_PrimitiveBox.cxx +++ b/src/VVTK/VVTK_PrimitiveBox.cxx @@ -345,9 +345,9 @@ void VVTK_PrimitiveBox::onBrowseMainTexture() { QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/"; QString aFileName = QFileDialog::getOpenFileName( this, - 0, - aRootDir, - "Bitmap (*.bmp *.jpg *.png)" ); + 0, + aRootDir, + "Bitmap (*.bmp *.jpg *.png)" ); if( aFileName.isNull() ) return; @@ -360,9 +360,9 @@ void VVTK_PrimitiveBox::onBrowseAlphaTexture() { QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/"; QString aFileName = QFileDialog::getOpenFileName( this, - 0, - aRootDir, - "Bitmap (*.bmp *.jpg *.png)" ); + 0, + aRootDir, + "Bitmap (*.bmp *.jpg *.png)" ); if( aFileName.isNull() ) return; diff --git a/src/VVTK/VVTK_Recorder.cxx b/src/VVTK/VVTK_Recorder.cxx index 049fc56c..9ef0f6dc 100755 --- a/src/VVTK/VVTK_Recorder.cxx +++ b/src/VVTK/VVTK_Recorder.cxx @@ -66,8 +66,8 @@ namespace inline void GetNameJPEG(const std::string& thePreffix, - const int theIndex, - std::string& theName) + const int theIndex, + std::string& theName) { using namespace std; ostringstream aStream; @@ -247,16 +247,16 @@ VVTK_Recorder void VVTK_Recorder ::ProcessEvents(vtkObject* vtkNotUsed(theObject), - unsigned long theEvent, - void* theClientData, - void* vtkNotUsed(theCallData)) + unsigned long theEvent, + void* theClientData, + void* vtkNotUsed(theCallData)) { if(vtkObject* anObj = reinterpret_cast(theClientData)){ if(VVTK_Recorder* aSelf = dynamic_cast(anObj)){ if(theEvent==vtkCommand::EndEvent){ - if(aSelf->State() == VVTK_Recorder::VVTK_Recorder_Record){ - aSelf->DoRecord(); - } + if(aSelf->State() == VVTK_Recorder::VVTK_Recorder_Record){ + aSelf->DoRecord(); + } } } } @@ -328,7 +328,7 @@ VVTK_Recorder inline int GetFrameIndex(double theStartTime, - double theFPS) + double theFPS) { double aTimeNow = vtkTimerLog::GetCurrentTime(); double aDelta = aTimeNow - theStartTime; @@ -356,8 +356,8 @@ VVTK_Recorder myFrameIndexes.back() = abs(myFrameIndexes.back()); double aPauseTime = fabs((double)(aFrameIndex - myFrameIndex - 1)) / myNbFPS; if(MYDEBUG) - MESSAGE("VVTK_Recorder::DoRecord - aFrameIndex = "<onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName); else { - QString platform; + QString platform; #ifdef WIN32 - platform = "winapplication"; + platform = "winapplication"; #else - platform = "application"; + platform = "application"; #endif SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"), - QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName) ); + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName) ); } } @@ -193,7 +193,7 @@ bool VVTK_RecorderDlg::onBrowseFile() aFilter.append( tr( "FLT_ALL_FILES" ) ); QString aFileName = SUIT_FileDlg::getFileName( this, getenv( "HOME" ), aFilter, - tr( "FILE_NAME" ), false ); + tr( "FILE_NAME" ), false ); if( aFileName.isNull() ) return false; diff --git a/src/VVTK/VVTK_Renderer.cxx b/src/VVTK/VVTK_Renderer.cxx index a9528508..23cc1c54 100644 --- a/src/VVTK/VVTK_Renderer.cxx +++ b/src/VVTK/VVTK_Renderer.cxx @@ -112,18 +112,18 @@ VISU_FPSActor size_t aNumberOfCells = 0; VTK::ActorCollectionCopy aCopy(aRenderer->GetActors()); if(vtkActorCollection *anActorCollection = aCopy.GetActors()){ - anActorCollection->InitTraversal(); - while(vtkActor *anActor = anActorCollection->GetNextActor()){ - if(anActor->GetVisibility()){ - if(SALOME_Actor *aSActor = dynamic_cast(anActor)){ - if(vtkMapper *aMapper = aSActor->GetMapper()){ - if(vtkDataSet *aDataSet = aMapper->GetInput()){ - aNumberOfCells += aDataSet->GetNumberOfCells(); - } - } - } - } - } + anActorCollection->InitTraversal(); + while(vtkActor *anActor = anActorCollection->GetNextActor()){ + if(anActor->GetVisibility()){ + if(SALOME_Actor *aSActor = dynamic_cast(anActor)){ + if(vtkMapper *aMapper = aSActor->GetMapper()){ + if(vtkDataSet *aDataSet = aMapper->GetInput()){ + aNumberOfCells += aDataSet->GetNumberOfCells(); + } + } + } + } + } } std::ostringstream aStr; float aFPS = 1.0 / aLastRenderTimeInSeconds; @@ -297,13 +297,13 @@ VVTK_Renderer1 VISU_PlanesWidget *aPlanesWidget = myWidgetCtrl->GetPlanesWidget(); aPlanesWidget->InitialPlaceWidget(myBndBox); aPlanesWidget->SetOrigin(0.5*(myBndBox[1] + myBndBox[0]), - 0.5*(myBndBox[3] + myBndBox[2]), - 0.5*(myBndBox[5] + myBndBox[4])); + 0.5*(myBndBox[3] + myBndBox[2]), + 0.5*(myBndBox[5] + myBndBox[4])); // VISU_SphereWidget *aSphereWidget = myWidgetCtrl->GetSphereWidget(); aSphereWidget->SetCenter(0.5*(myBndBox[1] + myBndBox[0]), - 0.5*(myBndBox[3] + myBndBox[2]), - 0.5*(myBndBox[5] + myBndBox[4])); + 0.5*(myBndBox[3] + myBndBox[2]), + 0.5*(myBndBox[5] + myBndBox[4])); float aMinLength = VTK_LARGE_FLOAT; for (int i=0; i<3; ++i) { @@ -317,7 +317,7 @@ VVTK_Renderer1 void VVTK_Renderer1 ::Initialize(vtkRenderWindowInteractor* theInteractor, - SVTK_Selector* theSelector) + SVTK_Selector* theSelector) { SVTK_Renderer::Initialize(theInteractor,theSelector); myWidgetCtrl->SetInteractor(theInteractor); @@ -374,23 +374,23 @@ VVTK_Renderer2 void VVTK_Renderer2::SetWidgetCtrl(VISU_WidgetCtrl* theWidgetCtrl) { theWidgetCtrl->AddObserver(vtkCommand::EndInteractionEvent, - myEventCallbackCommand.GetPointer(), - myPriority); + myEventCallbackCommand.GetPointer(), + myPriority); theWidgetCtrl->AddObserver(vtkCommand::EnableEvent, - myEventCallbackCommand.GetPointer(), - myPriority); + myEventCallbackCommand.GetPointer(), + myPriority); theWidgetCtrl->AddObserver(vtkCommand::DisableEvent, - myEventCallbackCommand.GetPointer(), - myPriority); + myEventCallbackCommand.GetPointer(), + myPriority); myWidgetCtrl = theWidgetCtrl; } void VVTK_Renderer2 ::ProcessEvents(vtkObject* vtkNotUsed(theObject), - unsigned long theEvent, - void* theClientData, - void* vtkNotUsed(theCallData)) + unsigned long theEvent, + void* theClientData, + void* vtkNotUsed(theCallData)) { VVTK_Renderer2* self = reinterpret_cast(theClientData); @@ -417,8 +417,8 @@ void VVTK_Renderer2::AddActor(VTKViewer_Actor* theActor) if(VISU_GaussPtsAct1* anActor = dynamic_cast(theActor)){ if(VISU::TGaussPtsActorFactory* aFactory = anActor->GetGaussPtsFactory()){ if(VISU_GaussPtsAct2* anActor2 = aFactory->CloneActor(anActor)){ - anActor2->SetWidgetCtrl(myWidgetCtrl); - Superclass::AddActor(anActor2); + anActor2->SetWidgetCtrl(myWidgetCtrl); + Superclass::AddActor(anActor2); } } } diff --git a/src/VVTK/VVTK_Renderer.h b/src/VVTK/VVTK_Renderer.h index 0bb4f818..ae558db2 100644 --- a/src/VVTK/VVTK_Renderer.h +++ b/src/VVTK/VVTK_Renderer.h @@ -95,7 +95,7 @@ class VVTK_EXPORT VVTK_Renderer1 : public VVTK_Renderer virtual void Initialize(vtkRenderWindowInteractor* theInteractor, - SVTK_Selector* theSelector); + SVTK_Selector* theSelector); //! Reimplement VVTK_Renderer::AddActor to apply to the actor additional settings virtual @@ -162,9 +162,9 @@ class VVTK_EXPORT VVTK_Renderer2 : public VVTK_Renderer static void ProcessEvents(vtkObject* theObject, - unsigned long theEvent, - void* theClientData, - void* theCallData); + unsigned long theEvent, + void* theClientData, + void* theCallData); //! Used to process VTK events vtkSmartPointer myEventCallbackCommand; diff --git a/src/VVTK/VVTK_SegmentationCursorDlg.cxx b/src/VVTK/VVTK_SegmentationCursorDlg.cxx index a752d1b7..5b927c7e 100644 --- a/src/VVTK/VVTK_SegmentationCursorDlg.cxx +++ b/src/VVTK/VVTK_SegmentationCursorDlg.cxx @@ -75,7 +75,7 @@ //---------------------------------------------------------------- VVTK_SegmentationCursorDlg::VVTK_SegmentationCursorDlg( QWidget* parent, const char* name ) :QDialog( parent, - Qt::WindowTitleHint | Qt::WindowSystemMenuHint ), + Qt::WindowTitleHint | Qt::WindowSystemMenuHint ), myEventCallbackCommand( vtkCallbackCommand::New() ), myInsideCursorSettings( VISU_InsideCursorSettings::New() ), myOutsideCursorSettings( VISU_OutsideCursorSettings::New() ), @@ -91,8 +91,8 @@ VVTK_SegmentationCursorDlg::VVTK_SegmentationCursorDlg( QWidget* parent, const c myEventCallbackCommand->SetCallback(VVTK_SegmentationCursorDlg::ProcessEvents); myInsideCursorSettings->AddObserver(VISU::UpdateFromSettingsEvent, - myEventCallbackCommand.GetPointer(), - myPriority); + myEventCallbackCommand.GetPointer(), + myPriority); setWindowTitle( tr( "SEGMENTATION_CURSOR_DLG_TITLE" ) ); setSizeGripEnabled(TRUE); @@ -399,14 +399,14 @@ void VVTK_SegmentationCursorDlg::SetWidgetCtrl( VISU_WidgetCtrl* theWidgetCtrl ) if(theWidgetCtrl) theWidgetCtrl->AddObserver(vtkCommand::EndInteractionEvent, - myEventCallbackCommand.GetPointer(), - myPriority); + myEventCallbackCommand.GetPointer(), + myPriority); } void VVTK_SegmentationCursorDlg::ProcessEvents(vtkObject* vtkNotUsed(theObject), - unsigned long theEvent, - void* theClientData, - void* vtkNotUsed(theCallData)) + unsigned long theEvent, + void* theClientData, + void* vtkNotUsed(theCallData)) { VVTK_SegmentationCursorDlg* self = reinterpret_cast(theClientData); @@ -562,8 +562,8 @@ void VVTK_SegmentationCursorDlg::UpdateOutsideGaussPoints() vtkFloatingPointType* aColor = myOutsideCursorSettings->GetColor(); myOutsideSizeBox->setColor( QColor( ( int )( aColor[0] * 255.0 ), - ( int )( aColor[1] * 255.0 ), - ( int )( aColor[2] * 255.0 ) ) ); + ( int )( aColor[1] * 255.0 ), + ( int )( aColor[2] * 255.0 ) ) ); return; } @@ -615,8 +615,8 @@ VISU_OutsideCursorSettings* VVTK_SegmentationCursorDlg::GetOutsideCursorSettings VISU::TTextureValue VVTK_SegmentationCursorDlg ::MakeImageData( bool theInside, - const QString& theMainTexture, - const QString& theAlphaTexture ) + const QString& theMainTexture, + const QString& theAlphaTexture ) { if( theInside ) { @@ -640,7 +640,7 @@ VVTK_SegmentationCursorDlg } return VISU::GetTexture( (const char*)theMainTexture.toLatin1(), - (const char*)theAlphaTexture.toLatin1()); + (const char*)theAlphaTexture.toLatin1()); } void VVTK_SegmentationCursorDlg::onClickApply() @@ -654,7 +654,7 @@ void VVTK_SegmentationCursorDlg::onClickApply() aWarning.append( "Can you please confirm that you want to continue anyway?" ); bool toApply = CheckNumberOfFaces() || SUIT_MessageBox::warning( this, tr( "Warning" ), aWarning, - tr( "&OK" ), tr( "&Cancel" ), 0, 1, 1 ) == 0; + tr( "&OK" ), tr( "&Cancel" ), 0, 1, 1 ) == 0; if( toApply ) { @@ -783,16 +783,16 @@ void VVTK_SegmentationCursorDlg::onClickHelp() if (app) app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName); else { - QString platform; + QString platform; #ifdef WIN32 - platform = "winapplication"; + platform = "winapplication"; #else - platform = "application"; + platform = "application"; #endif SUIT_MessageBox::warning( 0, QObject::tr("WRN_WARNING"), - QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName), - QObject::tr("BUT_OK")); + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName), + QObject::tr("BUT_OK")); } } @@ -840,9 +840,9 @@ bool VVTK_SegmentationCursorDlg::CheckNumberOfFaces() aNumberOfPoints += aGaussActor->GetInput()->GetNumberOfCells(); } return !( myInsidePrimitiveBox->getPrimitiveType() == VISU_OpenGLPointSpriteMapper::GeomSphere && - aNumberOfPoints * myInsidePrimitiveBox->getFaceNumber() * 2 > myInsidePrimitiveBox->getFaceLimit() || - myOutsidePrimitiveBox->getPrimitiveType() == VISU_OpenGLPointSpriteMapper::GeomSphere && - aNumberOfPoints * myOutsidePrimitiveBox->getFaceNumber() > myOutsidePrimitiveBox->getFaceLimit() ); + aNumberOfPoints * myInsidePrimitiveBox->getFaceNumber() * 2 > myInsidePrimitiveBox->getFaceLimit() || + myOutsidePrimitiveBox->getPrimitiveType() == VISU_OpenGLPointSpriteMapper::GeomSphere && + aNumberOfPoints * myOutsidePrimitiveBox->getFaceNumber() > myOutsidePrimitiveBox->getFaceLimit() ); } void VVTK_SegmentationCursorDlg::keyPressEvent( QKeyEvent* e ) diff --git a/src/VVTK/VVTK_SegmentationCursorDlg.h b/src/VVTK/VVTK_SegmentationCursorDlg.h index c2f2f504..960d0218 100644 --- a/src/VVTK/VVTK_SegmentationCursorDlg.h +++ b/src/VVTK/VVTK_SegmentationCursorDlg.h @@ -114,14 +114,14 @@ protected: VISU::TTextureValue MakeImageData( bool theInside, - const QString& theMainTexture, - const QString& theAlphaTexture ); + const QString& theMainTexture, + const QString& theAlphaTexture ); private: static void ProcessEvents(vtkObject* theObject, - unsigned long theEvent, - void* theClientData, - void* theCallData); + unsigned long theEvent, + void* theClientData, + void* theCallData); void keyPressEvent( QKeyEvent* e ); diff --git a/src/VVTK/VVTK_ViewManager.cxx b/src/VVTK/VVTK_ViewManager.cxx index fedcca71..2c9f8512 100644 --- a/src/VVTK/VVTK_ViewManager.cxx +++ b/src/VVTK/VVTK_ViewManager.cxx @@ -29,7 +29,7 @@ int VVTK_ViewManager::_VVTKViewMgr_Id = 0; //*************************************************************** VVTK_ViewManager ::VVTK_ViewManager( SUIT_Study* study, - SUIT_Desktop* theDesktop ) + SUIT_Desktop* theDesktop ) : SVTK_ViewManager( study, theDesktop ) { myId = ++_VVTKViewMgr_Id; diff --git a/src/VVTK/VVTK_ViewModel.cxx b/src/VVTK/VVTK_ViewModel.cxx index c8286570..a06b2ca3 100644 --- a/src/VVTK/VVTK_ViewModel.cxx +++ b/src/VVTK/VVTK_ViewModel.cxx @@ -70,16 +70,16 @@ void VVTK_Viewer::Display(const SALOME_VTKPrs* thePrs) if(vtkActorCollection* aCollection = aPrs->GetObjects()){ aCollection->InitTraversal(); while(VISU_ActorBase* anActor = dynamic_cast(aCollection->GetNextActor())){ - if(!anActor->GetFactory()->GetActiveState()) - continue; - QVector aViews = myViewManager->getViews(); - for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){ - if(SVTK_ViewWindow* aViewWindow = dynamic_cast(aViews.at(i))){ - if(SVTK_View* aView = aViewWindow->getView()){ - aView->Display(anActor, false); - } - } - } + if(!anActor->GetFactory()->GetActiveState()) + continue; + QVector aViews = myViewManager->getViews(); + for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){ + if(SVTK_ViewWindow* aViewWindow = dynamic_cast(aViews.at(i))){ + if(SVTK_View* aView = aViewWindow->getView()){ + aView->Display(anActor, false); + } + } + } } } } @@ -100,7 +100,7 @@ namespace VVTK operator()(SALOME_Actor* theActor) { if(!myResult) - myResult = theActor->GetVisibility(); + myResult = theActor->GetVisibility(); } }; } @@ -115,8 +115,8 @@ bool VVTK_Viewer::isVisible( const Handle(SALOME_InteractiveObject)& theIO ) VVTK::TIsOneActorVisibleAction anAction(aResult); VTK::ActorCollectionCopy aCopy(aViewWindow->getRenderer()->GetActors()); SVTK::ForEachIf(aCopy.GetActors(), - SVTK::TIsSameIObject(theIO), - anAction); + SVTK::TIsSameIObject(theIO), + anAction); return anAction.myResult; } diff --git a/src/VVTK/VVTK_ViewWindow.cxx b/src/VVTK/VVTK_ViewWindow.cxx index 100bf767..1d5be16b 100755 --- a/src/VVTK/VVTK_ViewWindow.cxx +++ b/src/VVTK/VVTK_ViewWindow.cxx @@ -70,19 +70,19 @@ void VVTK_ViewWindow::Initialize(SVTK_ViewModelBase* theModel) SVTK_Selector* aSelector = SVTK_Selector::New(); { myMainWindow1 = new VVTK_MainWindow1(s, - "VVTK_MainWindow", - aResourceMgr, - this); + "VVTK_MainWindow", + aResourceMgr, + this); anInsideCursorSettings = myMainWindow1->GetInsideCursorSettings(); anOutsideCursorSettings = myMainWindow1->GetOutsideCursorSettings(); aPickingSettings = myMainWindow1->GetPickingSettings(); SVTK_RenderWindowInteractor* anIteractor = - new SVTK_RenderWindowInteractor(myMainWindow1,"SVTK_RenderWindowInteractor1"); + new SVTK_RenderWindowInteractor(myMainWindow1,"SVTK_RenderWindowInteractor1"); SVTK_GenericRenderWindowInteractor* aDevice = - SVTK_GenericRenderWindowInteractor::New(); + SVTK_GenericRenderWindowInteractor::New(); aDevice->SetRenderWidget(anIteractor); aDevice->SetSelector(aSelector); @@ -114,14 +114,14 @@ void VVTK_ViewWindow::Initialize(SVTK_ViewModelBase* theModel) } { myMainWindow2 = myMainWindow1->CreateMainWindow2(s, - "VVTK_SegmantationWindow", - aResourceMgr, - this); + "VVTK_SegmantationWindow", + aResourceMgr, + this); SVTK_RenderWindowInteractor* anIteractor = - new SVTK_RenderWindowInteractor(myMainWindow2,"SVTK_RenderWindowInteractor1"); + new SVTK_RenderWindowInteractor(myMainWindow2,"SVTK_RenderWindowInteractor1"); SVTK_GenericRenderWindowInteractor* aDevice = - SVTK_GenericRenderWindowInteractor::New(); + SVTK_GenericRenderWindowInteractor::New(); aDevice->SetRenderWidget(anIteractor); aDevice->SetSelector(aSelector); @@ -190,7 +190,7 @@ VVTK_ViewWindow void VVTK_ViewWindow ::AddActor(VTKViewer_Actor* theActor, - bool theIsUpdate) + bool theIsUpdate) { myMainWindow1->AddActor(theActor,theIsUpdate); myMainWindow2->AddActor(theActor,theIsUpdate); @@ -200,7 +200,7 @@ VVTK_ViewWindow void VVTK_ViewWindow ::RemoveActor(VTKViewer_Actor* theActor, - bool theIsUpdate) + bool theIsUpdate) { myMainWindow1->RemoveActor(theActor,theIsUpdate); myMainWindow2->RemoveActor(theActor,theIsUpdate); @@ -228,8 +228,8 @@ VVTK_ViewWindow void VVTK_ViewWindow ::highlight(const Handle(SALOME_InteractiveObject)& theIO, - bool theIsHighlight, - bool theIsUpdate ) + bool theIsHighlight, + bool theIsUpdate ) { if(GetSelector()->AddIObject(theIO)) GetSelector()->EndPickCallback(); @@ -286,17 +286,17 @@ VVTK_ViewWindow if( myMainWindow1->GetInteractor()->hasFocus() ) { if ( myMainWindow1->getToolBar()->testAttribute(Qt::WA_UnderMouse) || myDumpImage.isNull() ) - return myMainWindow1->dumpView(); + return myMainWindow1->dumpView(); else - return myDumpImage; + return myDumpImage; } if( myMainWindow2->GetInteractor()->hasFocus() ) { if ( myMainWindow1->getToolBar()->testAttribute(Qt::WA_UnderMouse) || myDumpImage.isNull() ) - return myMainWindow2->dumpView(); + return myMainWindow2->dumpView(); else - return myDumpImage; + return myDumpImage; } return QImage(); diff --git a/src/VVTK/VVTK_ViewWindow.h b/src/VVTK/VVTK_ViewWindow.h index eb267c68..bedf4b44 100755 --- a/src/VVTK/VVTK_ViewWindow.h +++ b/src/VVTK/VVTK_ViewWindow.h @@ -76,13 +76,13 @@ public: virtual void AddActor(VTKViewer_Actor* theActor, - bool theIsUpdate = false); + bool theIsUpdate = false); //! Redefine SVTK_ViewWindow::RemoveActor method virtual void RemoveActor(VTKViewer_Actor* theActor, - bool theIsUpdate = false); + bool theIsUpdate = false); //! Redefine SVTK_ViewWindow::Repaint method virtual @@ -95,8 +95,8 @@ public: virtual void highlight(const Handle(SALOME_InteractiveObject)& theIO, - bool theIsHighlight = true, - bool theIsUpdate = true); + bool theIsHighlight = true, + bool theIsUpdate = true); //! Redefine SVTK_ViewWindow::unHighlightAll method virtual -- 2.39.2