Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 155974 | Differences between
and this patch

Collapse All | Expand All

(-)VISU_SRC_3.2.2/idl/VISU_Gen.idl (+22 lines)
Lines 964-969 Link Here
964
     * Gets the number of cut lines.
964
     * Gets the number of cut lines.
965
     */
965
     */
966
    long GetNbLines();
966
    long GetNbLines();
967
968
    /*! Invert all curves of corresponding table
969
     * \param theInvert - Invert all curves, if value is TRUE, else not.
970
     */
971
    void SetAllCurvesInverted(in boolean theInvert);
972
973
    /*! Checks the orientation of all curves
974
     * \retval TRUE - if all curves are inverted, else FALSE
975
     */
976
    boolean IsAllCurvesInverted();
977
978
    /*! Sets values which cutlines would be shown: aboslute or relative values
979
     * \param theAbsLength - boolean value, TRUE or false.
980
     */
981
    void SetUseAbsoluteLength(in boolean theAbsLength);
982
983
    /*! Checks values of cutlines: using aboslute or relative values
984
     */
985
    boolean IsUseAbsoluteLength();
967
  };
986
  };
968
987
969
  /*! \brief Interface of the stream lines representation
988
  /*! \brief Interface of the stream lines representation
Lines 1302-1307 Link Here
1302
     */
1321
     */
1303
    void setCycling(in boolean theCycle);
1322
    void setCycling(in boolean theCycle);
1304
1323
1324
    boolean isCleaningMemoryAtEachFrame();
1325
    void setCleaningMemoryAtEachFrame(in boolean theCycle);
1326
1305
    SALOMEDS::SObject publishInStudy();
1327
    SALOMEDS::SObject publishInStudy();
1306
1328
1307
    void saveAnimation();
1329
    void saveAnimation();
(-)VISU_SRC_3.2.2/resources/SalomeApp.xml (-2 / +8 lines)
Lines 4-11 Link Here
4
    <parameter name="name" value="Post-Pro"/>
4
    <parameter name="name" value="Post-Pro"/>
5
    <parameter name="icon" value="ModuleVisu.png"/>
5
    <parameter name="icon" value="ModuleVisu.png"/>
6
    <!-- Other module preferences -->
6
    <!-- Other module preferences -->
7
    <parameter name="use_build_progress" value="false"/>
7
    <parameter name="display_only"             value="false"/>
8
    <parameter name="full_med_loading"   value="false"/>
8
    <parameter name="show_preview"             value="false"/>
9
    <parameter name="invert_all_curves"        value="false"/>
10
    <parameter name="use_absolute_length"      value="false"/>
11
    <parameter name="generate_data_table"      value="true"/>
12
    <parameter name="generate_curves"          value="true"/>
13
    <parameter name="use_build_progress"       value="false"/>
14
    <parameter name="full_med_loading"         value="false"/>
9
    <parameter name="mesh_represent"           value="2"/>
15
    <parameter name="mesh_represent"           value="2"/>
10
    <parameter name="mesh_shrink"              value="false"/>
16
    <parameter name="mesh_shrink"              value="false"/>
11
    <parameter name="scalar_map_represent"     value="2"/>
17
    <parameter name="scalar_map_represent"     value="2"/>
(-)VISU_SRC_3.2.2/src/CONVERTOR/VISU_Convertor_impl.cxx (-25 / +30 lines)
Lines 1485-1501 Link Here
1485
  
1485
  
1486
  
1486
  
1487
  //---------------------------------------------------------------
1487
  //---------------------------------------------------------------
1488
  void
1488
  bool
1489
  GetMeshOnProfile(const PMeshImpl& theMesh,
1489
  GetMeshOnProfile(const PMeshImpl& theMesh,
1490
		   const PMeshOnEntityImpl& theMeshOnEntity,
1490
		   const PMeshOnEntityImpl& theMeshOnEntity,
1491
		   const PProfileImpl& theProfile)
1491
		   const PProfileImpl& theProfile)
1492
  {
1492
  {
1493
    INITMSG(MYDEBUG,"GetMeshOnProfile - anEntity = "<<theMeshOnEntity->myEntity<<endl);
1493
    INITMSG(MYDEBUG,"GetMeshOnProfile - anEntity = "<<theMeshOnEntity->myEntity<<endl);
1494
1494
1495
    if(theProfile->myMeshOnEntity && theProfile->myMeshOnEntity != theMeshOnEntity.get())
1496
      return false;
1497
      
1495
    if(theProfile->myIsVTKDone)
1498
    if(theProfile->myIsVTKDone)
1496
      return;
1499
      return true;
1497
    
1500
   
1498
    theProfile->myMeshOnEntity = theMeshOnEntity.get();
1499
    const TVTKAppendFilter& anAppendFilter = theProfile->GetFilter();
1501
    const TVTKAppendFilter& anAppendFilter = theProfile->GetFilter();
1500
    anAppendFilter->SetPoints(GetPoints(theMesh));
1502
    anAppendFilter->SetPoints(GetPoints(theMesh));
1501
1503
Lines 1533-1541 Link Here
1533
      }
1535
      }
1534
    }
1536
    }
1535
    anAppendFilter->Update(); // Fix on VTK
1537
    anAppendFilter->Update(); // Fix on VTK
1538
    theProfile->myMeshOnEntity = theMeshOnEntity.get();
1536
    theProfile->myNamedPointCoords = theMesh->myNamedPointCoords;
1539
    theProfile->myNamedPointCoords = theMesh->myNamedPointCoords;
1537
    
1540
    
1538
    theProfile->myIsVTKDone = true;
1541
    theProfile->myIsVTKDone = true;
1542
    return true;
1539
  }
1543
  }
1540
  
1544
  
1541
  
1545
  
Lines 2073-2087 Link Here
2073
			const VISU::PProfileImpl& theProfile,
2077
			const VISU::PProfileImpl& theProfile,
2074
			const VISU::TEntity& theEntity)
2078
			const VISU::TEntity& theEntity)
2075
{
2079
{
2076
  LoadMeshOnEntity(theMesh,theMeshOnEntity);
2080
  TVTKOutput* anOutput = NULL;
2077
  GetMeshOnEntity(theMeshOnEntity->myMeshName,theMeshOnEntity->myEntity);
2081
  try{
2078
  GetMeshOnProfile(theMesh,theMeshOnEntity,theProfile);
2082
    LoadMeshOnEntity(theMesh,theMeshOnEntity);
2079
2083
    GetMeshOnEntity(theMeshOnEntity->myMeshName,theMeshOnEntity->myEntity);
2080
  theIDMapperFilter->myIDMapper = theProfile;
2084
    if(GetMeshOnProfile(theMesh,theMeshOnEntity,theProfile)){
2081
  TVTKOutput* anOutput = theIDMapperFilter->GetVTKOutput();
2085
      theIDMapperFilter->myIDMapper = theProfile;
2082
  const TVTKSource& aSource = theIDMapperFilter->mySource.GetSource();
2086
      anOutput = theIDMapperFilter->GetVTKOutput();
2083
  ::GetTimeStampOnProfile(aSource,theField,theValForTime,theEntity);
2087
      const TVTKSource& aSource = theIDMapperFilter->mySource.GetSource();
2084
2088
      ::GetTimeStampOnProfile(aSource,theField,theValForTime,theEntity);
2089
    }
2090
  }catch(std::exception& exc){
2091
    MSG(MYDEBUG,"Follow exception was occured :\n"<<exc.what());
2092
    return NULL;
2093
  }
2085
  return anOutput;
2094
  return anOutput;
2086
}
2095
}
2087
2096
Lines 2121-2137 Link Here
2121
    if(!anIDMapperFilter->myIsVTKDone){
2130
    if(!anIDMapperFilter->myIsVTKDone){
2122
      LoadValForTimeOnMesh(aMesh,aMeshOnEntity,aField,aValForTime);
2131
      LoadValForTimeOnMesh(aMesh,aMeshOnEntity,aField,aValForTime);
2123
2132
2124
      TVTKOutput* anOutput;
2133
      TVTKOutput* anOutput = GetTimeStampOnProfile(aMesh,
2125
      try{
2134
						   aVTKMeshOnEntity,
2126
	anOutput = GetTimeStampOnProfile(aMesh,
2135
						   aField,
2127
					 aVTKMeshOnEntity,
2136
						   aValForTime,
2128
					 aField,
2137
						   anIDMapperFilter,
2129
					 aValForTime,
2138
						   aValForTime->myProfile,
2130
					 anIDMapperFilter,
2139
						   aMeshOnEntity->myEntity);
2131
					 aValForTime->myProfile,
2140
      if(!anOutput)
2132
					 aMeshOnEntity->myEntity);
2133
      }catch(std::exception& exc){
2134
	MSG(MYDEBUG,"Follow exception was occured :\n"<<exc.what());
2135
	anOutput = GetTimeStampOnProfile(aMesh,
2141
	anOutput = GetTimeStampOnProfile(aMesh,
2136
					 aMeshOnEntity,
2142
					 aMeshOnEntity,
2137
					 aField,
2143
					 aField,
Lines 2139-2145 Link Here
2139
					 anIDMapperFilter,
2145
					 anIDMapperFilter,
2140
					 aValForTime->myProfile,
2146
					 aValForTime->myProfile,
2141
					 aVTKMeshOnEntity->myEntity);
2147
					 aVTKMeshOnEntity->myEntity);
2142
      }
2143
2148
2144
      anIDMapperFilter->myIsVTKDone = true;
2149
      anIDMapperFilter->myIsVTKDone = true;
2145
2150
(-)VISU_SRC_3.2.2/src/CONVERTOR/VISU_MedConvertor.cxx (-59 / +49 lines)
Lines 71-78 Link Here
71
#define _LOAD_FAMILIES_
71
#define _LOAD_FAMILIES_
72
#define _EDF_NODE_IDS_
72
#define _EDF_NODE_IDS_
73
73
74
namespace
74
//namespace
75
{
75
//{
76
  //---------------------------------------------------------------
76
  //---------------------------------------------------------------
77
  vtkIdType
77
  vtkIdType
78
  MEDGeom2NbNodes(MED::EGeometrieElement theMEDGeomType)
78
  MEDGeom2NbNodes(MED::EGeometrieElement theMEDGeomType)
Lines 1132-1138 Link Here
1132
    }
1132
    }
1133
1133
1134
  };
1134
  };
1135
}
1135
//}
1136
1136
1137
1137
1138
//---------------------------------------------------------------
1138
//---------------------------------------------------------------
Lines 1141-1156 Link Here
1141
CreateConvertor(const string& theFileName)
1141
CreateConvertor(const string& theFileName)
1142
{
1142
{
1143
  if(MED::PWrapper aMed = MED::CrWrapper(theFileName,true))
1143
  if(MED::PWrapper aMed = MED::CrWrapper(theFileName,true))
1144
    return new VISU_MedConvertor(theFileName);
1144
    return new VISU_MedConvertor(theFileName, aMed);
1145
  return NULL;
1145
  return NULL;
1146
}
1146
}
1147
1147
1148
VISU_MedConvertor
1148
VISU_MedConvertor
1149
::VISU_MedConvertor(const string& theFileName):
1149
::VISU_MedConvertor(const string& theFileName, MED::PWrapper theMed):
1150
  myIsEntitiesDone(false),
1150
  myIsEntitiesDone(false),
1151
  myIsFieldsDone(false),
1151
  myIsFieldsDone(false),
1152
  myIsGroupsDone(false),
1152
  myIsGroupsDone(false),
1153
  myIsMinMaxDone(false)
1153
  myIsMinMaxDone(false),
1154
  myMed(theMed)
1154
{
1155
{
1155
  myFileInfo.setFile(QString(theFileName.c_str()));
1156
  myFileInfo.setFile(QString(theFileName.c_str()));
1156
  myName = myFileInfo.baseName().latin1();
1157
  myName = myFileInfo.baseName().latin1();
Lines 1167-1175 Link Here
1167
1168
1168
  TSetIsDone aSetIsDone(myIsEntitiesDone);
1169
  TSetIsDone aSetIsDone(myIsEntitiesDone);
1169
  TTimerLog aTimerLog(MYDEBUG,"BuildEntities");
1170
  TTimerLog aTimerLog(MYDEBUG,"BuildEntities");
1170
  MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
1171
1171
1172
  TInt aNbMeshes = aMed->GetNbMeshes();
1172
  TInt aNbMeshes = myMed->GetNbMeshes();
1173
  TMeshMap& aMeshMap = myMeshMap;
1173
  TMeshMap& aMeshMap = myMeshMap;
1174
1174
1175
  INITMSG(MYDEBUG,"BuildEntities aNbMeshes = "<<aNbMeshes<<"\n");
1175
  INITMSG(MYDEBUG,"BuildEntities aNbMeshes = "<<aNbMeshes<<"\n");
Lines 1180-1186 Link Here
1180
#endif
1180
#endif
1181
      TTimerLog aTimerLog(MYDEBUG,"GetPMeshInfo");
1181
      TTimerLog aTimerLog(MYDEBUG,"GetPMeshInfo");
1182
1182
1183
      MED::PMeshInfo aMeshInfo = aMed->GetPMeshInfo(iMesh);
1183
      MED::PMeshInfo aMeshInfo = myMed->GetPMeshInfo(iMesh);
1184
      std::string aMeshName = aMeshInfo->GetName();
1184
      std::string aMeshName = aMeshInfo->GetName();
1185
      TInt aDim = aMeshInfo->GetDim();
1185
      TInt aDim = aMeshInfo->GetDim();
1186
      MED::EMaillage aType = aMeshInfo->GetType();
1186
      MED::EMaillage aType = aMeshInfo->GetType();
Lines 1198-1205 Link Here
1198
1198
1199
      if(aType == MED::eNON_STRUCTURE){
1199
      if(aType == MED::eNON_STRUCTURE){
1200
1200
1201
	if(MED::PNodeInfo aNodeInfo = aMed->GetPNodeInfo(aMeshInfo)){
1201
	if(MED::PNodeInfo aNodeInfo = myMed->GetPNodeInfo(aMeshInfo)){
1202
	  MED::TEntityInfo anEntityInfo = aMed->GetEntityInfo(aMeshInfo);
1202
	  MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo);
1203
1203
1204
	  aMesh->myNbPoints = aNodeInfo->GetNbElem();
1204
	  aMesh->myNbPoints = aNodeInfo->GetNbElem();
1205
	  aMesh->myEntityInfo = anEntityInfo;
1205
	  aMesh->myEntityInfo = anEntityInfo;
Lines 1215-1221 Link Here
1215
	    BuildMeshOnEntityMap(aMesh,
1215
	    BuildMeshOnEntityMap(aMesh,
1216
				 anEntityInfo,
1216
				 anEntityInfo,
1217
				 aNodeInfo,
1217
				 aNodeInfo,
1218
			       aMed);
1218
			         myMed);
1219
	    
1219
	    
1220
#ifndef _DEXCEPT_
1220
#ifndef _DEXCEPT_
1221
	  }catch(std::exception& exc){
1221
	  }catch(std::exception& exc){
Lines 1227-1233 Link Here
1227
	}
1227
	}
1228
      } // NON STRUCTURED MESH
1228
      } // NON STRUCTURED MESH
1229
      else {
1229
      else {
1230
 	MED::PGrilleInfo aGrilleInfo = aMed->GetPGrilleInfo(aMeshInfo);
1230
 	MED::PGrilleInfo aGrilleInfo = myMed->GetPGrilleInfo(aMeshInfo);
1231
1231
1232
	MED::TEntityInfo anEntityInfo;
1232
	MED::TEntityInfo anEntityInfo;
1233
	anEntityInfo[MED::eNOEUD][MED::ePOINT1] = aGrilleInfo->GetNbNodes();
1233
	anEntityInfo[MED::eNOEUD][MED::ePOINT1] = aGrilleInfo->GetNbNodes();
Lines 1244-1250 Link Here
1244
	  BuildMeshGrilleOnEntityMap(aMesh,
1244
	  BuildMeshGrilleOnEntityMap(aMesh,
1245
				     anEntityInfo,
1245
				     anEntityInfo,
1246
				     aGrilleInfo,
1246
				     aGrilleInfo,
1247
				     aMed);
1247
				     myMed);
1248
	  
1248
	  
1249
#ifndef _DEXCEPT_
1249
#ifndef _DEXCEPT_
1250
	}catch(std::exception& exc){
1250
	}catch(std::exception& exc){
Lines 1279-1287 Link Here
1279
1279
1280
  TSetIsDone aSetIsDone(myIsFieldsDone);
1280
  TSetIsDone aSetIsDone(myIsFieldsDone);
1281
  TTimerLog aTimerLog(MYDEBUG,"BuildFields");
1281
  TTimerLog aTimerLog(MYDEBUG,"BuildFields");
1282
  MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
1283
1282
1284
  TInt aNbMeshes = aMed->GetNbMeshes();
1283
  TInt aNbMeshes = myMed->GetNbMeshes();
1285
  TMeshMap& aMeshMap = myMeshMap;
1284
  TMeshMap& aMeshMap = myMeshMap;
1286
1285
1287
  INITMSG(MYDEBUG,"BuildFields - aNbMeshes = "<<aNbMeshes<<"\n");
1286
  INITMSG(MYDEBUG,"BuildFields - aNbMeshes = "<<aNbMeshes<<"\n");
Lines 1292-1298 Link Here
1292
#endif
1291
#endif
1293
      TTimerLog aTimerLog(MYDEBUG,"GetPMeshInfo");
1292
      TTimerLog aTimerLog(MYDEBUG,"GetPMeshInfo");
1294
1293
1295
      MED::PMeshInfo aMeshInfo = aMed->GetPMeshInfo(iMesh);
1294
      MED::PMeshInfo aMeshInfo = myMed->GetPMeshInfo(iMesh);
1296
      std::string aMeshName = aMeshInfo->GetName();
1295
      std::string aMeshName = aMeshInfo->GetName();
1297
      
1296
      
1298
      TMeshMap::const_iterator anIter = aMeshMap.find(aMeshName);
1297
      TMeshMap::const_iterator anIter = aMeshMap.find(aMeshName);
Lines 1304-1314 Link Here
1304
#ifndef _DEXCEPT_
1303
#ifndef _DEXCEPT_
1305
      try{
1304
      try{
1306
#endif
1305
#endif
1307
	MED::TEntityInfo anEntityInfo = aMed->GetEntityInfo(aMeshInfo);
1306
	MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo);
1308
1307
1309
	BuildFieldMap(aMesh,
1308
	BuildFieldMap(aMesh,
1310
		      anEntityInfo,
1309
		      anEntityInfo,
1311
		      aMed);
1310
		      myMed);
1312
#ifndef _DEXCEPT_
1311
#ifndef _DEXCEPT_
1313
      }catch(std::exception& exc){
1312
      }catch(std::exception& exc){
1314
	MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
1313
	MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
Lines 1340-1351 Link Here
1340
1339
1341
  TSetIsDone aSetIsDone(myIsMinMaxDone);
1340
  TSetIsDone aSetIsDone(myIsMinMaxDone);
1342
  TTimerLog aTimerLog(MYDEBUG,"BuildMinMax");
1341
  TTimerLog aTimerLog(MYDEBUG,"BuildMinMax");
1343
  MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
1344
1342
1345
  MED::TKey2Gauss aKey2Gauss = MED::GetKey2Gauss(aMed);
1343
  MED::TKey2Gauss aKey2Gauss = MED::GetKey2Gauss(myMed);
1346
  MED::TMKey2Profile aMKey2Profile = MED::GetMKey2Profile(aMed);
1344
  MED::TMKey2Profile aMKey2Profile = MED::GetMKey2Profile(myMed);
1347
1345
1348
  TInt aNbMeshes = aMed->GetNbMeshes();
1346
  TInt aNbMeshes = myMed->GetNbMeshes();
1349
  TMeshMap& aMeshMap = myMeshMap;
1347
  TMeshMap& aMeshMap = myMeshMap;
1350
1348
1351
  INITMSG(MYDEBUG,"BuildMinMax - aNbMeshes = "<<aNbMeshes<<"\n");
1349
  INITMSG(MYDEBUG,"BuildMinMax - aNbMeshes = "<<aNbMeshes<<"\n");
Lines 1356-1362 Link Here
1356
#endif
1354
#endif
1357
      TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPMeshInfo");
1355
      TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPMeshInfo");
1358
1356
1359
      MED::PMeshInfo aMeshInfo = aMed->GetPMeshInfo(iMesh);
1357
      MED::PMeshInfo aMeshInfo = myMed->GetPMeshInfo(iMesh);
1360
      std::string aMeshName = aMeshInfo->GetName();
1358
      std::string aMeshName = aMeshInfo->GetName();
1361
      
1359
      
1362
      TMeshMap::const_iterator anIter = aMeshMap.find(aMeshName);
1360
      TMeshMap::const_iterator anIter = aMeshMap.find(aMeshName);
Lines 1367-1389 Link Here
1367
#ifndef _DEXCEPT_
1365
#ifndef _DEXCEPT_
1368
      try{
1366
      try{
1369
#endif
1367
#endif
1370
	TInt aNbFields = aMed->GetNbFields(); 
1368
	TInt aNbFields = myMed->GetNbFields(); 
1371
1369
1372
	INITMSG(MYDEBUG,
1370
	INITMSG(MYDEBUG,
1373
		"- aMeshName = '"<<aMeshName<<"'"<<
1371
		"- aMeshName = '"<<aMeshName<<"'"<<
1374
		"; aNbFields = "<<aNbFields<<"\n");
1372
		"; aNbFields = "<<aNbFields<<"\n");
1375
1373
1376
	MED::TEntityInfo anEntityInfo = aMed->GetEntityInfo(aMeshInfo);
1374
	MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo);
1377
1375
1378
	for(TInt iField = 1; iField <= aNbFields; iField++){
1376
	for(TInt iField = 1; iField <= aNbFields; iField++){
1379
	  TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPFieldInfo()");
1377
	  TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPFieldInfo()");
1380
	  MED::PFieldInfo aFieldInfo = aMed->GetPFieldInfo(aMeshInfo,iField);
1378
	  MED::PFieldInfo aFieldInfo = myMed->GetPFieldInfo(aMeshInfo,iField);
1381
	  std::string aFieldName = aFieldInfo->GetName();
1379
	  std::string aFieldName = aFieldInfo->GetName();
1382
	  INITMSG(MYDEBUG,"- aFieldName = '"<<aFieldName<<"'\n");
1380
	  INITMSG(MYDEBUG,"- aFieldName = '"<<aFieldName<<"'\n");
1383
	  
1381
	  
1384
	  MED::TGeom2Size aGeom2Size;
1382
	  MED::TGeom2Size aGeom2Size;
1385
	  MED::EEntiteMaillage aMEntity;
1383
	  MED::EEntiteMaillage aMEntity;
1386
	  TInt aNbTimeStamps = aMed->GetNbTimeStamps(aFieldInfo,
1384
	  TInt aNbTimeStamps = myMed->GetNbTimeStamps(aFieldInfo,
1387
						     anEntityInfo,
1385
						     anEntityInfo,
1388
						     aMEntity,
1386
						     aMEntity,
1389
						     aGeom2Size);
1387
						     aGeom2Size);
Lines 1417-1428 Link Here
1417
              try{
1415
              try{
1418
#endif
1416
#endif
1419
#endif
1417
#endif
1420
		MED::PTimeStampInfo aTimeStampInfo = aMed->GetPTimeStampInfo(aFieldInfo,
1418
		MED::PTimeStampInfo aTimeStampInfo = myMed->GetPTimeStampInfo(aFieldInfo,
1421
									     aMEntity,
1419
									     aMEntity,
1422
									     aGeom2Size,
1420
									     aGeom2Size,
1423
									     iTimeStamp);
1421
									     iTimeStamp);
1424
		
1422
		
1425
		MED::PTimeStampVal aTimeStampVal = aMed->GetPTimeStampVal(aTimeStampInfo,
1423
		MED::PTimeStampVal aTimeStampVal = myMed->GetPTimeStampVal(aTimeStampInfo,
1426
									  aMKey2Profile,
1424
									  aMKey2Profile,
1427
									  aKey2Gauss);
1425
									  aKey2Gauss);
1428
		
1426
		
Lines 1543-1551 Link Here
1543
1541
1544
  TSetIsDone aSetIsDone(myIsGroupsDone);
1542
  TSetIsDone aSetIsDone(myIsGroupsDone);
1545
  TTimerLog aTimerLog(MYDEBUG,"BuildGroups");
1543
  TTimerLog aTimerLog(MYDEBUG,"BuildGroups");
1546
  MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
1547
1544
1548
  TInt aNbMeshes = aMed->GetNbMeshes();
1545
  TInt aNbMeshes = myMed->GetNbMeshes();
1549
  TMeshMap& aMeshMap = myMeshMap;
1546
  TMeshMap& aMeshMap = myMeshMap;
1550
1547
1551
  INITMSG(MYDEBUG,"BuildGroups - aNbMeshes = "<<aNbMeshes<<"\n");
1548
  INITMSG(MYDEBUG,"BuildGroups - aNbMeshes = "<<aNbMeshes<<"\n");
Lines 1556-1562 Link Here
1556
#endif
1553
#endif
1557
      TTimerLog aTimerLog(MYDEBUG,"GetPMeshInfo");
1554
      TTimerLog aTimerLog(MYDEBUG,"GetPMeshInfo");
1558
1555
1559
      MED::PMeshInfo aMeshInfo = aMed->GetPMeshInfo(iMesh);
1556
      MED::PMeshInfo aMeshInfo = myMed->GetPMeshInfo(iMesh);
1560
      std::string aMeshName = aMeshInfo->GetName();      
1557
      std::string aMeshName = aMeshInfo->GetName();      
1561
1558
1562
      TMeshMap::const_iterator anIter = aMeshMap.find(aMeshName);
1559
      TMeshMap::const_iterator anIter = aMeshMap.find(aMeshName);
Lines 1568-1594 Link Here
1568
1565
1569
      MED::EMaillage aType = aMeshInfo->GetType();
1566
      MED::EMaillage aType = aMeshInfo->GetType();
1570
      
1567
      
1571
      MED::TEntityInfo anEntityInfo = aMed->GetEntityInfo(aMeshInfo);
1568
      MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo);
1572
      
1569
      
1573
      MED::TEntity2TGeom2ElemInfo anEntity2TGeom2ElemInfo = 
1570
      MED::TEntity2TGeom2ElemInfo anEntity2TGeom2ElemInfo = 
1574
	MED::GetEntity2TGeom2ElemInfo(aMed,aMeshInfo,anEntityInfo);
1571
	MED::GetEntity2TGeom2ElemInfo(myMed,aMeshInfo,anEntityInfo);
1575
      
1572
      
1576
#ifndef _DEXCEPT_
1573
#ifndef _DEXCEPT_
1577
      try{
1574
      try{
1578
#endif
1575
#endif
1579
	MED::TFamilyInfoSet aFamilyInfoSet = MED::GetFamilyInfoSet(aMed,aMeshInfo);
1576
	MED::TFamilyInfoSet aFamilyInfoSet = MED::GetFamilyInfoSet(myMed,aMeshInfo);
1580
	
1577
	
1581
	if(aType == MED::eNON_STRUCTURE)
1578
	if(aType == MED::eNON_STRUCTURE)
1582
	  BuildFamilyMap(aMesh,
1579
	  BuildFamilyMap(aMesh,
1583
			 anEntityInfo,
1580
			 anEntityInfo,
1584
			 anEntity2TGeom2ElemInfo,
1581
			 anEntity2TGeom2ElemInfo,
1585
			 aFamilyInfoSet,
1582
			 aFamilyInfoSet,
1586
			 aMed);
1583
			 myMed);
1587
	else
1584
	else
1588
	  BuildGrilleFamilyMap(aMesh,
1585
	  BuildGrilleFamilyMap(aMesh,
1589
			       anEntityInfo,
1586
			       anEntityInfo,
1590
			       aFamilyInfoSet,
1587
			       aFamilyInfoSet,
1591
			       aMed);
1588
			       myMed);
1592
	
1589
	
1593
	BuildGroupMap(aMesh,
1590
	BuildGroupMap(aMesh,
1594
		      aFamilyInfoSet);
1591
		      aFamilyInfoSet);
Lines 1622-1636 Link Here
1622
  TTimerLog aTimerLog(MYDEBUG,"LoadMeshOnEntity");
1619
  TTimerLog aTimerLog(MYDEBUG,"LoadMeshOnEntity");
1623
  INITMSG(MYDEBUG,"LoadMeshOnEntity"<<endl);
1620
  INITMSG(MYDEBUG,"LoadMeshOnEntity"<<endl);
1624
1621
1625
  MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
1626
  const TEntity& anEntity = theMeshOnEntity->myEntity;
1622
  const TEntity& anEntity = theMeshOnEntity->myEntity;
1627
1623
1628
  int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
1624
  int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
1629
  if(anEntity == NODE_ENTITY){
1625
  if(anEntity == NODE_ENTITY){
1630
    isPointsUpdated += LoadPoints(aMed,theMesh);
1626
    isPointsUpdated += LoadPoints(myMed,theMesh);
1631
  }else{
1627
  }else{
1632
    isPointsUpdated += LoadPoints(aMed,theMesh);
1628
    isPointsUpdated += LoadPoints(myMed,theMesh);
1633
    isCellsOnEntityUpdated += LoadCellsOnEntity(aMed,theMesh,theMeshOnEntity);
1629
    isCellsOnEntityUpdated += LoadCellsOnEntity(myMed,theMesh,theMeshOnEntity);
1634
  }
1630
  }
1635
1631
1636
  return (isPointsUpdated || isCellsOnEntityUpdated);
1632
  return (isPointsUpdated || isCellsOnEntityUpdated);
Lines 1647-1661 Link Here
1647
  TTimerLog aTimerLog(MYDEBUG,"LoadFamilyOnEntity");
1643
  TTimerLog aTimerLog(MYDEBUG,"LoadFamilyOnEntity");
1648
  INITMSG(MYDEBUG,"LoadFamilyOnEntity"<<endl);
1644
  INITMSG(MYDEBUG,"LoadFamilyOnEntity"<<endl);
1649
1645
1650
  MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
1651
  const TEntity& anEntity = theMeshOnEntity->myEntity;
1646
  const TEntity& anEntity = theMeshOnEntity->myEntity;
1652
1647
1653
  int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
1648
  int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
1654
  if(anEntity == NODE_ENTITY){
1649
  if(anEntity == NODE_ENTITY){
1655
    isPointsUpdated += LoadPointsOnFamily(aMed,theMesh,theFamily);
1650
    isPointsUpdated += LoadPointsOnFamily(myMed,theMesh,theFamily);
1656
  }else{
1651
  }else{
1657
    isPointsUpdated += LoadPoints(aMed,theMesh);
1652
    isPointsUpdated += LoadPoints(myMed,theMesh);
1658
    isCellsOnEntityUpdated += LoadCellsOnFamily(aMed,theMesh,theMeshOnEntity,theFamily);
1653
    isCellsOnEntityUpdated += LoadCellsOnFamily(myMed,theMesh,theMeshOnEntity,theFamily);
1659
  }
1654
  }
1660
1655
1661
  return (isPointsUpdated || isCellsOnEntityUpdated);
1656
  return (isPointsUpdated || isCellsOnEntityUpdated);
Lines 1671-1688 Link Here
1671
  TTimerLog aTimerLog(MYDEBUG,"LoadMeshOnGroup");
1666
  TTimerLog aTimerLog(MYDEBUG,"LoadMeshOnGroup");
1672
  INITMSG(MYDEBUG,"LoadMeshOnGroup"<<endl);
1667
  INITMSG(MYDEBUG,"LoadMeshOnGroup"<<endl);
1673
1668
1674
  MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
1675
  int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
1669
  int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
1676
  TFamilySet::const_iterator aFamilyIter = theFamilySet.begin();
1670
  TFamilySet::const_iterator aFamilyIter = theFamilySet.begin();
1677
  for(; aFamilyIter != theFamilySet.end(); aFamilyIter++){
1671
  for(; aFamilyIter != theFamilySet.end(); aFamilyIter++){
1678
    PMEDFamily aFamily = *aFamilyIter;
1672
    PMEDFamily aFamily = *aFamilyIter;
1679
    const TEntity& anEntity = aFamily->myEntity;
1673
    const TEntity& anEntity = aFamily->myEntity;
1680
    const PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[anEntity];
1674
    const PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[anEntity];
1681
    isPointsUpdated += LoadPoints(aMed,theMesh);
1675
    isPointsUpdated += LoadPoints(myMed,theMesh);
1682
    if(anEntity == NODE_ENTITY){
1676
    if(anEntity == NODE_ENTITY){
1683
      isPointsUpdated += LoadPointsOnFamily(aMed,theMesh,aFamily);
1677
      isPointsUpdated += LoadPointsOnFamily(myMed,theMesh,aFamily);
1684
    }else{
1678
    }else{
1685
      isCellsOnEntityUpdated += LoadCellsOnFamily(aMed,theMesh,aMeshOnEntity,aFamily);
1679
      isCellsOnEntityUpdated += LoadCellsOnFamily(myMed,theMesh,aMeshOnEntity,aFamily);
1686
    }
1680
    }
1687
  }
1681
  }
1688
1682
Lines 1701-1714 Link Here
1701
  TTimerLog aTimerLog(MYDEBUG,"LoadValForTimeOnMesh");
1695
  TTimerLog aTimerLog(MYDEBUG,"LoadValForTimeOnMesh");
1702
  INITMSG(MYDEBUG,"LoadValForTimeOnMesh"<<endl);
1696
  INITMSG(MYDEBUG,"LoadValForTimeOnMesh"<<endl);
1703
1697
1704
  MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
1705
1706
  const TEntity& anEntity = theMeshOnEntity->myEntity;
1698
  const TEntity& anEntity = theMeshOnEntity->myEntity;
1707
  int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
1699
  int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
1708
  isPointsUpdated += LoadPoints(aMed,theMesh);
1700
  isPointsUpdated += LoadPoints(myMed,theMesh);
1709
  if(anEntity != NODE_ENTITY)
1701
  if(anEntity != NODE_ENTITY)
1710
    isCellsOnEntityUpdated += LoadCellsOnEntity(aMed,theMesh,theMeshOnEntity);
1702
    isCellsOnEntityUpdated += LoadCellsOnEntity(myMed,theMesh,theMeshOnEntity);
1711
  int isFieldUpdated = LoadValForTimeOnMesh(aMed,theMesh,theMeshOnEntity,theField,theValForTime);
1703
  int isFieldUpdated = LoadValForTimeOnMesh(myMed,theMesh,theMeshOnEntity,theField,theValForTime);
1712
  
1704
  
1713
  return (isPointsUpdated || isCellsOnEntityUpdated || isFieldUpdated);
1705
  return (isPointsUpdated || isCellsOnEntityUpdated || isFieldUpdated);
1714
}
1706
}
Lines 1725-1737 Link Here
1725
  TTimerLog aTimerLog(MYDEBUG,"LoadValForTimeOnGaussPts");
1717
  TTimerLog aTimerLog(MYDEBUG,"LoadValForTimeOnGaussPts");
1726
  INITMSG(MYDEBUG,"LoadValForTimeOnGaussPts"<<endl);
1718
  INITMSG(MYDEBUG,"LoadValForTimeOnGaussPts"<<endl);
1727
1719
1728
  MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
1729
1730
  const TEntity& anEntity = theMeshOnEntity->myEntity;
1720
  const TEntity& anEntity = theMeshOnEntity->myEntity;
1731
  int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
1721
  int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
1732
  if(anEntity != NODE_ENTITY)
1722
  if(anEntity != NODE_ENTITY)
1733
    isCellsOnEntityUpdated += LoadCellsOnEntity(aMed,theMesh,theMeshOnEntity);
1723
    isCellsOnEntityUpdated += LoadCellsOnEntity(myMed,theMesh,theMeshOnEntity);
1734
  int isFieldUpdated = LoadValForTimeOnGaussPts(aMed,theMesh,theMeshOnEntity,theField,theValForTime);
1724
  int isFieldUpdated = LoadValForTimeOnGaussPts(myMed,theMesh,theMeshOnEntity,theField,theValForTime);
1735
  
1725
  
1736
  return (isPointsUpdated || isCellsOnEntityUpdated || isFieldUpdated);
1726
  return (isPointsUpdated || isCellsOnEntityUpdated || isFieldUpdated);
1737
}
1727
}
(-)VISU_SRC_3.2.2/src/CONVERTOR/VISU_MedConvertor.hxx (-1 / +3 lines)
Lines 21-26 Link Here
21
21
22
#include "VISU_Convertor_impl.hxx"
22
#include "VISU_Convertor_impl.hxx"
23
23
24
#include "MED_Wrapper.hxx"
24
#include "MED_Common.hxx"
25
#include "MED_Common.hxx"
25
#include "MED_Structures.hxx"
26
#include "MED_Structures.hxx"
26
27
Lines 201-207 Link Here
201
  bool myIsMinMaxDone;
202
  bool myIsMinMaxDone;
202
203
203
public:
204
public:
204
  VISU_MedConvertor(const std::string& theFileName);
205
  VISU_MedConvertor(const std::string& theFileName, MED::PWrapper theMed);
205
206
206
  virtual
207
  virtual
207
  VISU_Convertor* 
208
  VISU_Convertor* 
Lines 221-226 Link Here
221
222
222
protected:
223
protected:
223
  QFileInfo myFileInfo;
224
  QFileInfo myFileInfo;
225
  MED::PWrapper myMed; // mpv : bug 13568: one med per converter
224
226
225
  virtual
227
  virtual
226
  int
228
  int
(-)VISU_SRC_3.2.2/src/VISUGUI/VISU_msg_en.po (-1 / +28 lines)
Lines 147-152 Link Here
147
msgid "VISU_SWEEPING_PREF"
147
msgid "VISU_SWEEPING_PREF"
148
msgstr "Sweeping preferences"
148
msgstr "Sweeping preferences"
149
149
150
msgid "VISU_LINEAR_SWEEP"
151
msgstr "Linear" 
152
153
msgid "VISU_U_SWEEP"
154
msgstr "Periodic"
155
156
msgid "VISU_SWEEPING_MODES"
157
msgstr "Mode of the sweeping "
158
159
msgid "VISU_IS2PI"
160
msgstr "Parameter varies:"
161
162
msgid "PERIOD_2PI"
163
msgstr "From -PI to PI"
164
165
msgid "PERIOD_PI"
166
msgstr "From 0 to PI"
167
150
msgid "VISU_TIME_STEP"
168
msgid "VISU_TIME_STEP"
151
msgstr "Time step(second)"
169
msgstr "Time step(second)"
152
170
Lines 156-161 Link Here
156
msgid "VISU_NB_STEPS"
174
msgid "VISU_NB_STEPS"
157
msgstr "Number of steps"
175
msgstr "Number of steps"
158
176
177
msgid "VISU_CUTLINE_PREF"
178
msgstr "CutLine preferences"
179
159
msgid "VISU_PREF_MED_IMPORT"
180
msgid "VISU_PREF_MED_IMPORT"
160
msgstr "MED files import"
181
msgstr "MED files import"
161
182
Lines 168-173 Link Here
168
msgid "VISU_USE_SHADING"
189
msgid "VISU_USE_SHADING"
169
msgstr "Use Shading"
190
msgstr "Use Shading"
170
191
192
msgid "VISU_DISP_ONLY"
193
msgstr "Display only on creation"
194
171
msgid "VISU_SHRINK"
195
msgid "VISU_SHRINK"
172
msgstr "Shrink"
196
msgstr "Shrink"
173
197
Lines 460-465 Link Here
460
msgid "VisuGUI_CutLinesDlg::LBL_INVERT_CURVES"
484
msgid "VisuGUI_CutLinesDlg::LBL_INVERT_CURVES"
461
msgstr "Invert all curves"
485
msgstr "Invert all curves"
462
486
487
msgid "VisuGUI_CutLinesDlg::LBL_ABSOLUTE_LENGTH"
488
msgstr "Use absolute length"
489
463
msgid "VisuGUI_CutLinesDlg::LBL_GENERATE_CURVES"
490
msgid "VisuGUI_CutLinesDlg::LBL_GENERATE_CURVES"
464
msgstr "Generate Curves"
491
msgstr "Generate Curves"
465
492
Lines 2099-2102 Link Here
2099
msgstr "Plot3D"
2126
msgstr "Plot3D"
2100
2127
2101
msgid "VISU_SCALAR_MAP_ON_DEFORMED_SHAPE"
2128
msgid "VISU_SCALAR_MAP_ON_DEFORMED_SHAPE"
2102
msgstr "Scalar Map on Def. Shape"
2129
msgstr "Scalar Map on Def. Shape"
(-)VISU_SRC_3.2.2/src/VISUGUI/VisuGUI.cxx (-8 / +54 lines)
Lines 1608-1619 Link Here
1608
  int aCycles = aResourceMgr->integerValue("VISU", "sweeping_number_cycles", 1);
1608
  int aCycles = aResourceMgr->integerValue("VISU", "sweeping_number_cycles", 1);
1609
  int aSteps  = aResourceMgr->integerValue("VISU", "sweeping_number_steps", 40);
1609
  int aSteps  = aResourceMgr->integerValue("VISU", "sweeping_number_steps", 40);
1610
1610
1611
  int aMode = aResourceMgr->integerValue("VISU", "sweeping_modes", 0);
1612
1613
  int is2Pi = aResourceMgr->integerValue("VISU", "sweeping_is2PI", 0);
1614
1611
  // Sweep
1615
  // Sweep
1612
  QApplication::setOverrideCursor(Qt::waitCursor);
1616
  QApplication::setOverrideCursor(Qt::waitCursor);
1617
1613
  for (int j = 0; j < aCycles; j++) {
1618
  for (int j = 0; j < aCycles; j++) {
1614
    for (int i = 0; i <= aSteps; i++) {
1619
    for (int i = 0; i <= aSteps; i++) {
1615
      try {
1620
      try {
1616
        float aPercents = float(i)/aSteps;
1621
        float aPercents;
1622
        if( aMode == 1 ){  //if selected Periodic mode of sweeping
1623
	  float aT = ( is2Pi == 1 ? -PI + 2. * PI * float(i)/aSteps : PI * float(i)/aSteps );
1624
          //This is necessary in order for animation to retrun to the initial picture
1625
          aPercents = (1.+sin( aT - PI/2. ))/2.;
1626
        }
1627
        else //if selected Linear mode of sweeping
1628
          aPercents = float(i)/aSteps;
1617
        aPrsObject->SetMapScale(aPercents);
1629
        aPrsObject->SetMapScale(aPercents);
1618
        aPrsObject->UpdateActor(aActor);
1630
        aPrsObject->UpdateActor(aActor);
1619
        vw->getRenderWindow()->Render();
1631
        vw->getRenderWindow()->Render();
Lines 1690-1698 Link Here
1690
1702
1691
  VISU::Storable::TRestoringMap aMap;
1703
  VISU::Storable::TRestoringMap aMap;
1692
  _PTR(GenericAttribute) anAttr;
1704
  _PTR(GenericAttribute) anAttr;
1693
  if (!aSObj->FindAttribute(anAttr, "AttributeComment")) return;
1705
  if (!aSObj->FindAttribute(anAttr, "AttributeString")) return;
1694
1706
1695
  _PTR(AttributeComment) aComment (anAttr);
1707
  _PTR(AttributeString) aComment (anAttr);
1696
  string aComm = aComment->Value();
1708
  string aComm = aComment->Value();
1697
  QString strIn (aComm.c_str());
1709
  QString strIn (aComm.c_str());
1698
  VISU::Storable::StrToMap(strIn, aMap);
1710
  VISU::Storable::StrToMap(strIn, aMap);
Lines 2655-2662 Link Here
2655
      CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSObject);
2667
      CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSObject);
2656
      if (CORBA::is_nil(aCORBAObject)) {
2668
      if (CORBA::is_nil(aCORBAObject)) {
2657
        _PTR(GenericAttribute) anAttr;
2669
        _PTR(GenericAttribute) anAttr;
2658
        if (aSObject->FindAttribute(anAttr, "AttributeComment")) {
2670
        if (aSObject->FindAttribute(anAttr, "AttributeString")) {
2659
          _PTR(AttributeComment) aComment (anAttr);
2671
          _PTR(AttributeString) aComment (anAttr);
2660
          string aComm = aComment->Value();
2672
          string aComm = aComment->Value();
2661
          QString strIn (aComm.c_str());
2673
          QString strIn (aComm.c_str());
2662
          VISU::Storable::TRestoringMap pMap;
2674
          VISU::Storable::TRestoringMap pMap;
Lines 2695-2702 Link Here
2695
      if ( !aSObject )
2707
      if ( !aSObject )
2696
	continue;
2708
	continue;
2697
      _PTR(GenericAttribute) anAttr;
2709
      _PTR(GenericAttribute) anAttr;
2698
      if (aSObject->FindAttribute(anAttr, "AttributeComment")) {
2710
      if (aSObject->FindAttribute(anAttr, "AttributeString")) {
2699
        _PTR(AttributeComment) aComment (anAttr);
2711
        _PTR(AttributeString) aComment (anAttr);
2700
        string aComm = aComment->Value();
2712
        string aComm = aComment->Value();
2701
        QString strIn (aComm.c_str());
2713
        QString strIn (aComm.c_str());
2702
        VISU::Storable::TRestoringMap pMap;
2714
        VISU::Storable::TRestoringMap pMap;
Lines 3026-3031 Link Here
3026
  // group: "Sweeping preferences"
3038
  // group: "Sweeping preferences"
3027
  int sweepGr = addPreference( tr( "VISU_SWEEPING_PREF" ), srangeTab );
3039
  int sweepGr = addPreference( tr( "VISU_SWEEPING_PREF" ), srangeTab );
3028
  setPreferenceProperty( sweepGr, "columns", 1 );
3040
  setPreferenceProperty( sweepGr, "columns", 1 );
3041
  
3042
  int modeSw = addPreference( tr( "VISU_SWEEPING_MODES" ), sweepGr, LightApp_Preferences::Selector, "VISU", "sweeping_modes" );
3043
  QStringList sweep_modes;
3044
  sweep_modes.append( tr( "VISU_LINEAR_SWEEP" ) );
3045
  sweep_modes.append( tr( "VISU_U_SWEEP" ) );
3046
  indices.clear();
3047
  indices.append( 0 );
3048
  indices.append( 1 );
3049
  setPreferenceProperty( modeSw, "strings", sweep_modes );
3050
  setPreferenceProperty( modeSw, "indexes", indices );
3029
3051
3030
  int timestep   = addPreference( tr( "VISU_TIME_STEP" ), sweepGr,
3052
  int timestep   = addPreference( tr( "VISU_TIME_STEP" ), sweepGr,
3031
                                  LightApp_Preferences::DblSpin, "VISU", "sweeping_time_step" );
3053
                                  LightApp_Preferences::DblSpin, "VISU", "sweeping_time_step" );
Lines 3033-3043 Link Here
3033
                                  LightApp_Preferences::IntSpin, "VISU", "sweeping_number_cycles" );
3055
                                  LightApp_Preferences::IntSpin, "VISU", "sweeping_number_cycles" );
3034
  int nbsteps    = addPreference( tr( "VISU_NB_STEPS" ),  sweepGr,
3056
  int nbsteps    = addPreference( tr( "VISU_NB_STEPS" ),  sweepGr,
3035
                                  LightApp_Preferences::IntSpin, "VISU", "sweeping_number_steps" );
3057
                                  LightApp_Preferences::IntSpin, "VISU", "sweeping_number_steps" );
3058
  int rangeSw = addPreference( tr( "VISU_IS2PI" ), sweepGr, LightApp_Preferences::Selector, "VISU", "sweeping_is2PI" );
3059
  QStringList ranges;
3060
  ranges.append( tr( "PERIOD_PI" ) );
3061
  ranges.append( tr( "PERIOD_2PI" ) );
3062
  indices.clear();
3063
  indices.append( 0 );
3064
  indices.append( 1 );
3065
  setPreferenceProperty( rangeSw, "strings", ranges );
3066
  setPreferenceProperty( rangeSw, "indexes", indices );
3067
3036
  setPreferenceProperty( timestep, "min",  0.1 );
3068
  setPreferenceProperty( timestep, "min",  0.1 );
3037
  setPreferenceProperty( timestep, "step", 0.1 );
3069
  setPreferenceProperty( timestep, "step", 0.1 );
3038
  setPreferenceProperty( timestep, "max",  1000 );
3070
  setPreferenceProperty( timestep, "max",  1000 );
3039
  setPreferenceProperty( nbcycles, "max",  100  );
3071
  setPreferenceProperty( nbcycles, "max",  100  );
3040
  setPreferenceProperty( nbsteps,  "max",  200  );
3072
  setPreferenceProperty( nbsteps,  "max",  200  );  
3073
3074
  // group: "CutLines preferences"
3075
  int cutLineTab = addPreference( tr( "CutLines" ) );
3076
  int cutLineGr = addPreference( tr( "VISU_CUTLINE_PREF" ), cutLineTab );
3077
  setPreferenceProperty( cutLineGr, "columns", 1 );
3078
  addPreference( tr( "Show preview" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "show_preview" );
3079
  addPreference( tr( "Invert all curves" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "invert_all_curves" );
3080
  addPreference( tr( "Use absolute length" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "use_absolute_length" );
3081
  addPreference( tr( "Generate data table" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "generate_data_table" );
3082
  addPreference( tr( "Generate curves" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "generate_curves" );
3041
3083
3042
  // group: "MED files import"
3084
  // group: "MED files import"
3043
  int importGr = addPreference( tr( "MED files import" ), srangeTab );
3085
  int importGr = addPreference( tr( "MED files import" ), srangeTab );
Lines 3136-3141 Link Here
3136
  
3178
  
3137
  addPreference( tr( "VISU_USE_SHADING" ), representGr,
3179
  addPreference( tr( "VISU_USE_SHADING" ), representGr,
3138
                 LightApp_Preferences::Bool, "VISU", "represent_shading" );
3180
                 LightApp_Preferences::Bool, "VISU", "represent_shading" );
3181
  addPreference( "", representGr, LightApp_Preferences::Space );
3182
3183
  addPreference( tr( "VISU_DISP_ONLY" ), representGr,
3184
                 LightApp_Preferences::Bool, "VISU", "display_only" );
3139
}
3185
}
3140
3186
3141
void VisuGUI::preferencesChanged( const QString& a, const QString& b)
3187
void VisuGUI::preferencesChanged( const QString& a, const QString& b)
(-)VISU_SRC_3.2.2/src/VISUGUI/VisuGUI.h (-1 / +2 lines)
Lines 78-83 Link Here
78
public slots:
78
public slots:
79
  virtual bool deactivateModule( SUIT_Study* );
79
  virtual bool deactivateModule( SUIT_Study* );
80
  virtual bool activateModule( SUIT_Study* );
80
  virtual bool activateModule( SUIT_Study* );
81
  virtual void OnEraseAll();
81
82
82
protected slots:
83
protected slots:
83
  void OnImportFromFile();
84
  void OnImportFromFile();
Lines 111-117 Link Here
111
  virtual void OnDisplayPrs();
112
  virtual void OnDisplayPrs();
112
  virtual void OnDisplayOnlyPrs();
113
  virtual void OnDisplayOnlyPrs();
113
  virtual void OnErasePrs();
114
  virtual void OnErasePrs();
114
  virtual void OnEraseAll();
115
  //  virtual void OnEraseAll();
115
116
116
  void OnMakeSurfaceframe();
117
  void OnMakeSurfaceframe();
117
  void OnMakeInsideframe();
118
  void OnMakeInsideframe();
(-)VISU_SRC_3.2.2/src/VISUGUI/VisuGUI_CutLinesDlg.cxx (-92 / +17 lines)
Lines 62-70 Link Here
62
62
63
using namespace std;
63
using namespace std;
64
64
65
bool VisuGUI_CutLinesDlg::MYGenerateTable = true;
66
bool VisuGUI_CutLinesDlg::MYGenerateCurve = true;
67
68
VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (SalomeApp_Module* theModule)
65
VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (SalomeApp_Module* theModule)
69
     : QDialog(VISU::GetDesktop(theModule), "VisuGUI_CutLinesDlg", false,
66
     : QDialog(VISU::GetDesktop(theModule), "VisuGUI_CutLinesDlg", false,
70
               WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
67
               WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
Lines 135-142 Link Here
135
  myAllCurvesInvertedCheck->setChecked(false);
132
  myAllCurvesInvertedCheck->setChecked(false);
136
  aPlaneLayout->addWidget(myAllCurvesInvertedCheck);
133
  aPlaneLayout->addWidget(myAllCurvesInvertedCheck);
137
134
135
  myUseAbsoluteLengthCheck = new QCheckBox(tr("LBL_ABSOLUTE_LENGTH"), aPlanePane);
136
  myUseAbsoluteLengthCheck->setChecked(false);
137
  aPlaneLayout->addWidget(myUseAbsoluteLengthCheck);
138
138
  myCreateTable = new QCheckBox (tr("LBL_GENERATE_TABLE"), aPlanePane);
139
  myCreateTable = new QCheckBox (tr("LBL_GENERATE_TABLE"), aPlanePane);
139
  myCreateTable->setChecked(MYGenerateTable);
140
  myCreateTable->setChecked(true);
140
  aPlaneLayout->addWidget( myCreateTable );
141
  aPlaneLayout->addWidget( myCreateTable );
141
142
142
  QHBox* aCheckPane = new QHBox(aPlanePane);
143
  QHBox* aCheckPane = new QHBox(aPlanePane);
Lines 144-151 Link Here
144
  aCheckPane->setStretchFactor(aLbl, 0);
145
  aCheckPane->setStretchFactor(aLbl, 0);
145
  myCurvesCheck = new QCheckBox(tr("LBL_GENERATE_CURVES"), aCheckPane);
146
  myCurvesCheck = new QCheckBox(tr("LBL_GENERATE_CURVES"), aCheckPane);
146
  aCheckPane->setStretchFactor(aCheckPane, 0);
147
  aCheckPane->setStretchFactor(aCheckPane, 0);
147
  myCurvesCheck->setChecked(MYGenerateCurve);
148
  myCurvesCheck->setChecked(true);
148
  myCurvesCheck->setEnabled(MYGenerateTable);
149
  myCurvesCheck->setEnabled(true);
149
  QLabel* aLbl2 = new QLabel("   ", aCheckPane);
150
  QLabel* aLbl2 = new QLabel("   ", aCheckPane);
150
  aCheckPane->setStretchFactor(aLbl2, 1);
151
  aCheckPane->setStretchFactor(aLbl2, 1);
151
  aPlaneLayout->addWidget( aCheckPane );
152
  aPlaneLayout->addWidget( aCheckPane );
Lines 289-294 Link Here
289
  myPrs = thePrs;
290
  myPrs = thePrs;
290
  myScalarPane->initFromPrsObject(thePrs);
291
  myScalarPane->initFromPrsObject(thePrs);
291
292
293
  SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
294
  myPreviewCheck->setChecked( aResourceMgr->booleanValue("VISU", "show_preview", false) );
295
  myCreateTable->setChecked( aResourceMgr->booleanValue("VISU", "generate_data_table", true) );
296
  myCurvesCheck->setChecked( aResourceMgr->booleanValue("VISU", "generate_curves", true) );
297
  myCurvesCheck->setEnabled( aResourceMgr->booleanValue("VISU", "generate_curves", true) );
298
292
  myRotXSpn->setValue(thePrs->GetRotateX()*180./PI);
299
  myRotXSpn->setValue(thePrs->GetRotateX()*180./PI);
293
  myRotYSpn->setValue(thePrs->GetRotateY()*180./PI);
300
  myRotYSpn->setValue(thePrs->GetRotateY()*180./PI);
294
  myPosSpn->setValue(thePrs->GetDisplacement());
301
  myPosSpn->setValue(thePrs->GetDisplacement());
Lines 303-310 Link Here
303
  hasInit = true;
310
  hasInit = true;
304
  myCutLines = new VISU::CutLines_i(thePrs->GetResult(),false);
311
  myCutLines = new VISU::CutLines_i(thePrs->GetResult(),false);
305
  myCutLines->SameAs(thePrs);
312
  myCutLines->SameAs(thePrs);
306
  myCutLines->CopyCurvesInverted(thePrs->GetCurvesInverted());
313
  myAllCurvesInvertedCheck->setChecked(myCutLines->IsAllCurvesInverted());
307
  if (myCutLines->IsAllCurvesInverted()) myAllCurvesInvertedCheck->setChecked(true);
314
  myUseAbsoluteLengthCheck->setChecked(myCutLines->IsUseAbsoluteLength());
308
  myBasePlanePos->setText( QString::number(myCutLines->GetBasePlanePosition()) );
315
  myBasePlanePos->setText( QString::number(myCutLines->GetBasePlanePosition()) );
309
  myCBSetDef->setChecked(thePrs->IsDefault());
316
  myCBSetDef->setChecked(thePrs->IsDefault());
310
  DrawTable();
317
  DrawTable();
Lines 342-347 Link Here
342
  }
349
  }
343
  if (myAllCurvesInvertedCheck->isChecked())
350
  if (myAllCurvesInvertedCheck->isChecked())
344
    thePrs->SetAllCurvesInverted(true);
351
    thePrs->SetAllCurvesInverted(true);
352
353
  thePrs->SetUseAbsoluteLength(myUseAbsoluteLengthCheck->isChecked());
345
  return 1;
354
  return 1;
346
}
355
}
347
356
Lines 751-843 Link Here
751
760
752
void VisuGUI_CutLinesDlg::accept()
761
void VisuGUI_CutLinesDlg::accept()
753
{
762
{
754
  //if ( !VisuGUI::CheckActiveStudyLock() ) {
755
  //  reject();
756
  //  return;
757
  //}
758
  MYGenerateTable = myCreateTable->isChecked();
759
  MYGenerateCurve = myCurvesCheck->isChecked();
760
  //  if (myScalarPane->check()) {
761
    /*jfa tmp:((QWidget*)sender())->setDisabled(true);
762
    storeToPrsObject(myPrs);
763
    if (myIsCreation) {
764
      if (isGenerateTable()) {
765
	visuGUI->GetVisuGen()->CreateTable(myPrs->GetEntry());
766
	if (isGenerateCurves()) {
767
	  SALOMEDSClient_Study* aStudy = study()->studyDS();
768
	  SALOMEDSClient_SObject* aSObject = aStudy->FindObjectID(myPrs->GetEntry());
769
	  if( aSObject ) {
770
	    SALOMEDSClient_ChildIterator* aIter = aStudy->NewChildIterator( aSObject );
771
	    SALOMEDSClient_StudyBuilder* aBuilder = aStudy->NewBuilder();
772
	    for ( ;aIter->More(); aIter->Next()) {
773
	      SALOMEDSClient_SObject* aTblObj = aIter->Value();
774
	      if ( aTblObj ) {
775
		SALOMEDSClient_GenericAttribute* anAttr;
776
		if (aTblObj->FindAttribute(anAttr, "AttributeName")) {
777
		  visuGUI->CreatePlot(aTblObj);
778
		}
779
	      }
780
	    }
781
	  }
782
	}
783
      }
784
      if (GET_VTK_VIEWWINDOW(myMgr)) {
785
	try {
786
	  visuGUI->CreateActor(myPrs);
787
	} catch (...) {
788
	  reject();
789
	  return;
790
	}
791
	GET_VTK_VIEWWINDOW(myMgr)->onFitAll();
792
      }
793
    } else {
794
      visuGUI->RecreateActor(myPrs);
795
      if (VTKViewer_ViewWindow* vf = GET_VTK_VIEWWINDOW(myMgr)) {
796
	if (vf->getRenderer()->GetActors()->GetNumberOfItems() > 0) {
797
	  vf->getRenderer()->ResetCameraClippingRange();
798
	  vf->Repaint();
799
	}
800
      }
801
      // Remove old Table
802
      SALOMEDSClient_Study* aStudy = study()->studyDS();
803
      SALOMEDSClient_SObject* aSObject = aStudy->FindObjectID(myPrs->GetEntry());
804
      if( aSObject ) {
805
	SALOMEDSClient_ChildIterator* aIter = aStudy->NewChildIterator( aSObject );
806
	SALOMEDSClient_StudyBuilder* aBuilder = aStudy->NewBuilder();
807
	for ( ;aIter->More(); aIter->Next()) {
808
	  SALOMEDSClient_SObject* aTblObj = aIter->Value();
809
	  if ( aTblObj ) {
810
	    SALOMEDSClient_GenericAttribute* anAttr;
811
	    if (aTblObj->FindAttribute(anAttr, "AttributeName")) {
812
	      aBuilder->RemoveObjectWithChildren(aIter->Value()); // We should have only one child
813
	      break;
814
	    }
815
	  }
816
	}
817
	if (isGenerateTable()) {
818
	  visuGUI->GetVisuGen()->CreateTable(aSObject->GetID().c_str());
819
	  if (isGenerateCurves()) {
820
	    SALOMEDSClient_Study* aStudy = study()->studyDS();
821
	    SALOMEDSClient_ChildIterator* aIter = aStudy->NewChildIterator( aSObject );
822
	    SALOMEDSClient_StudyBuilder* aBuilder = aStudy->NewBuilder();
823
	    for ( ;aIter->More(); aIter->Next()) {
824
	      SALOMEDSClient_SObject* aTblObj = aIter->Value();
825
	      if ( aTblObj ) {
826
		SALOMEDSClient_GenericAttribute* anAttr;
827
		if (aTblObj->FindAttribute(anAttr, "AttributeName")) {
828
		  visuGUI->CreatePlot(aTblObj);
829
		}
830
	      }
831
	    }
832
	  }
833
	}
834
      }
835
    }
836
    VisuGUI::application()->objectBrowser()->updateTree();*/
837
    myScalarPane->deletePreview();
763
    myScalarPane->deletePreview();
838
    deletePlanes();
764
    deletePlanes();
839
    QDialog::accept();
765
    QDialog::accept();
840
    //  }
841
}
766
}
842
767
843
void VisuGUI_CutLinesDlg::reject()
768
void VisuGUI_CutLinesDlg::reject()
(-)VISU_SRC_3.2.2/src/VISUGUI/VisuGUI_CutLinesDlg.h (+1 lines)
Lines 110-115 Link Here
110
  SALOME_Actor* myPreviewActorGlyphs;
110
  SALOME_Actor* myPreviewActorGlyphs;
111
  QCheckBox* myPreviewCheck;
111
  QCheckBox* myPreviewCheck;
112
  QCheckBox* myAllCurvesInvertedCheck;
112
  QCheckBox* myAllCurvesInvertedCheck;
113
  QCheckBox* myUseAbsoluteLengthCheck;
113
114
114
  VISU::CutLines_i* myPrs;
115
  VISU::CutLines_i* myPrs;
115
116
(-)VISU_SRC_3.2.2/src/VISUGUI/VisuGUI_Module.cxx (-10 / +10 lines)
Lines 1315-1322 Link Here
1315
    Storable::DataToStream(aStream,"mySubId",theSelection.mySubId);
1315
    Storable::DataToStream(aStream,"mySubId",theSelection.mySubId);
1316
1316
1317
    _PTR(GenericAttribute) anAttr;
1317
    _PTR(GenericAttribute) anAttr;
1318
    anAttr = theStudyBuilder->FindOrCreateAttribute(aNewObj,"AttributeComment");
1318
    anAttr = theStudyBuilder->FindOrCreateAttribute(aNewObj,"AttributeString");
1319
    _PTR(AttributeComment) aComment(anAttr);
1319
    _PTR(AttributeString) aComment(anAttr);
1320
    aComment->SetValue(aStream.str());
1320
    aComment->SetValue(aStream.str());
1321
  }
1321
  }
1322
1322
Lines 1346-1353 Link Here
1346
	  
1346
	  
1347
	  // To update selection
1347
	  // To update selection
1348
	  _PTR(GenericAttribute) anAttr;
1348
	  _PTR(GenericAttribute) anAttr;
1349
	  if(aChildSObject->FindAttribute(anAttr,"AttributeComment")){
1349
	  if(aChildSObject->FindAttribute(anAttr,"AttributeString")){
1350
	    _PTR(AttributeComment) aComment(anAttr);
1350
	    _PTR(AttributeString) aComment(anAttr);
1351
	    
1351
	    
1352
	    QString aStream(aComment->Value().c_str());
1352
	    QString aStream(aComment->Value().c_str());
1353
	    Storable::TRestoringMap aMap;
1353
	    Storable::TRestoringMap aMap;
Lines 1419-1426 Link Here
1419
	  Handle(SALOME_InteractiveObject) anIO = aListIter.Value();
1419
	  Handle(SALOME_InteractiveObject) anIO = aListIter.Value();
1420
	  _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
1420
	  _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
1421
	  _PTR(GenericAttribute) anAttr;
1421
	  _PTR(GenericAttribute) anAttr;
1422
	  if(aSObject->FindAttribute(anAttr,"AttributeComment")){
1422
	  if(aSObject->FindAttribute(anAttr,"AttributeString")){
1423
	    _PTR(AttributeComment) aComment(anAttr);
1423
	    _PTR(AttributeString) aComment(anAttr);
1424
	    std::string aCommentValue(aComment->Value());
1424
	    std::string aCommentValue(aComment->Value());
1425
	    if(aCommentValue.compare("myComment=GAUSSVIEW") >= 0){
1425
	    if(aCommentValue.compare("myComment=GAUSSVIEW") >= 0){
1426
	      aComment->SetValue(aValue.c_str());
1426
	      aComment->SetValue(aValue.c_str());
Lines 1474-1481 Link Here
1474
    _PTR(Study) aCStudy = GetCStudy(GetAppStudy(theModule));
1474
    _PTR(Study) aCStudy = GetCStudy(GetAppStudy(theModule));
1475
1475
1476
    _PTR(GenericAttribute) anAttr;
1476
    _PTR(GenericAttribute) anAttr;
1477
    if(theSObject->FindAttribute(anAttr,"AttributeComment")){
1477
    if(theSObject->FindAttribute(anAttr,"AttributeString")){
1478
      _PTR(AttributeComment) aComment(anAttr);
1478
      _PTR(AttributeString) aComment(anAttr);
1479
      QString aStream(aComment->Value().c_str());
1479
      QString aStream(aComment->Value().c_str());
1480
      Storable::TRestoringMap aMap;
1480
      Storable::TRestoringMap aMap;
1481
      Storable::StrToMap(aStream,aMap);
1481
      Storable::StrToMap(aStream,aMap);
Lines 1521-1528 Link Here
1521
    _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
1521
    _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
1522
    myConfigSObject = aSObject;
1522
    myConfigSObject = aSObject;
1523
    _PTR(GenericAttribute) anAttr;
1523
    _PTR(GenericAttribute) anAttr;
1524
    if(aSObject->FindAttribute(anAttr,"AttributeComment")){
1524
    if(aSObject->FindAttribute(anAttr,"AttributeString")){
1525
      _PTR(AttributeComment) aComment(anAttr);
1525
      _PTR(AttributeString) aComment(anAttr);
1526
      QString aStream(aComment->Value().c_str());
1526
      QString aStream(aComment->Value().c_str());
1527
      Storable::TRestoringMap aMap;
1527
      Storable::TRestoringMap aMap;
1528
      Storable::StrToMap(aStream,aMap);
1528
      Storable::StrToMap(aStream,aMap);
(-)VISU_SRC_3.2.2/src/VISUGUI/VisuGUI_Prs3dTools.h (+3 lines)
Lines 203-208 Link Here
203
      aViewWindow = GetViewWindow<TViewer>(theModule);
203
      aViewWindow = GetViewWindow<TViewer>(theModule);
204
      // Display created presentation.
204
      // Display created presentation.
205
      if (aViewWindow) {
205
      if (aViewWindow) {
206
        if(aResourceMgr->booleanValue("VISU","display_only",false)){
207
	  theModule->OnEraseAll();
208
	}
206
	PublishInView(theModule, aPrs3d, aViewWindow, /*highlight = */true);
209
	PublishInView(theModule, aPrs3d, aViewWindow, /*highlight = */true);
207
	aViewWindow->onFitAll();
210
	aViewWindow->onFitAll();
208
211
(-)VISU_SRC_3.2.2/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx (-5 / +5 lines)
Lines 47-53 Link Here
47
47
48
#include "SALOME_ListIO.hxx"
48
#include "SALOME_ListIO.hxx"
49
49
50
#include "SALOMEDSClient_AttributeComment.hxx"
50
#include "SALOMEDSClient_AttributeString.hxx"
51
#include "SALOMEDSClient_AttributeName.hxx"
51
#include "SALOMEDSClient_AttributeName.hxx"
52
52
53
#include <qlayout.h>
53
#include <qlayout.h>
Lines 188-195 Link Here
188
	_PTR(SObject) aSObject = aActiveStudy->FindObjectID(aIO->getEntry());
188
	_PTR(SObject) aSObject = aActiveStudy->FindObjectID(aIO->getEntry());
189
189
190
	_PTR(GenericAttribute) anTmpAttr;
190
	_PTR(GenericAttribute) anTmpAttr;
191
	if (aSObject->FindAttribute(anTmpAttr, "AttributeComment")) {
191
	if (aSObject->FindAttribute(anTmpAttr, "AttributeString")) {
192
	  _PTR(AttributeComment) aTmpComment (anTmpAttr);
192
	  _PTR(AttributeString) aTmpComment (anTmpAttr);
193
	  string aTmpComm = aTmpComment->Value();
193
	  string aTmpComm = aTmpComment->Value();
194
	  QString aTmpstrIn (aTmpComm.c_str());
194
	  QString aTmpstrIn (aTmpComm.c_str());
195
	  VISU::Storable::TRestoringMap aTmpaMap;
195
	  VISU::Storable::TRestoringMap aTmpaMap;
Lines 247-254 Link Here
247
        CORBA::Object_var aChildObject = VISU::ClientSObjectToObject(aChildSObj);
247
        CORBA::Object_var aChildObject = VISU::ClientSObjectToObject(aChildSObj);
248
248
249
        _PTR(GenericAttribute) anAttr;
249
        _PTR(GenericAttribute) anAttr;
250
        if (aChildSObj->FindAttribute(anAttr, "AttributeComment")) {
250
        if (aChildSObj->FindAttribute(anAttr, "AttributeString")) {
251
          _PTR(AttributeComment) aComment (anAttr);
251
          _PTR(AttributeString) aComment (anAttr);
252
          string aComm = aComment->Value();
252
          string aComm = aComment->Value();
253
          QString strIn (aComm.c_str());
253
          QString strIn (aComm.c_str());
254
          VISU::Storable::TRestoringMap aMap;
254
          VISU::Storable::TRestoringMap aMap;
(-)VISU_SRC_3.2.2/src/VISUGUI/VisuGUI_Selection.cxx (-2 / +2 lines)
Lines 397-404 Link Here
397
    VISU::Storable::TRestoringMap aMap;
397
    VISU::Storable::TRestoringMap aMap;
398
    if (aSObject) {
398
    if (aSObject) {
399
      _PTR(GenericAttribute) anAttr;
399
      _PTR(GenericAttribute) anAttr;
400
      if (aSObject->FindAttribute(anAttr, "AttributeComment")) {
400
      if (aSObject->FindAttribute(anAttr, "AttributeString")) {
401
        _PTR(AttributeComment) aComment (anAttr);
401
        _PTR(AttributeString) aComment (anAttr);
402
        std::string aString = aComment->Value();
402
        std::string aString = aComment->Value();
403
        QString strIn( aString.c_str() );
403
        QString strIn( aString.c_str() );
404
        VISU::Storable::StrToMap(strIn, aMap);
404
        VISU::Storable::StrToMap(strIn, aMap);
(-)VISU_SRC_3.2.2/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx (-6 / +6 lines)
Lines 108-115 Link Here
108
      _PTR(SObject) aSObject = aActiveStudy->FindObjectID(aIO->getEntry());
108
      _PTR(SObject) aSObject = aActiveStudy->FindObjectID(aIO->getEntry());
109
109
110
      _PTR(GenericAttribute) anTmpAttr;
110
      _PTR(GenericAttribute) anTmpAttr;
111
      if (aSObject->FindAttribute(anTmpAttr, "AttributeComment")) {
111
      if (aSObject->FindAttribute(anTmpAttr, "AttributeString")) {
112
        _PTR(AttributeComment) aTmpComment (anTmpAttr);
112
        _PTR(AttributeString) aTmpComment (anTmpAttr);
113
        string aTmpComm = aTmpComment->Value();
113
        string aTmpComm = aTmpComment->Value();
114
        QString aTmpstrIn (aTmpComm.c_str());
114
        QString aTmpstrIn (aTmpComm.c_str());
115
        VISU::Storable::TRestoringMap aTmpaMap;
115
        VISU::Storable::TRestoringMap aTmpaMap;
Lines 183-190 Link Here
183
      }
183
      }
184
184
185
      _PTR(GenericAttribute) anAttr;
185
      _PTR(GenericAttribute) anAttr;
186
      if (aChildSObj->FindAttribute(anAttr, "AttributeComment")) {
186
      if (aChildSObj->FindAttribute(anAttr, "AttributeString")) {
187
        _PTR(AttributeComment) aComment (anAttr);
187
        _PTR(AttributeString) aComment (anAttr);
188
        string aComm = aComment->Value();
188
        string aComm = aComment->Value();
189
        QString strIn (aComm.c_str());
189
        QString strIn (aComm.c_str());
190
        VISU::Storable::TRestoringMap aMap;
190
        VISU::Storable::TRestoringMap aMap;
Lines 539-546 Link Here
539
  for (aIter->InitEx(true); aIter->More(); aIter->Next() ) {
539
  for (aIter->InitEx(true); aIter->More(); aIter->Next() ) {
540
    SALOMEDSClient_SObject* aChildSObj = aIter->Value();
540
    SALOMEDSClient_SObject* aChildSObj = aIter->Value();
541
    SALOMEDSClient_GenericAttribute* anAttr;
541
    SALOMEDSClient_GenericAttribute* anAttr;
542
    if (aChildSObj->FindAttribute(anAttr, "AttributeComment")) {
542
    if (aChildSObj->FindAttribute(anAttr, "AttributeString")) {
543
      SALOMEDSClient_AttributeComment* aComment = dynamic_cast<SALOMEDSClient_AttributeComment*>( anAttr );
543
      SALOMEDSClient_AttributeString* aComment = dynamic_cast<SALOMEDSClient_AttributeString*>( anAttr );
544
      CORBA::String_var aComm = aComment->Value().c_str();
544
      CORBA::String_var aComm = aComment->Value().c_str();
545
      QString strIn(aComm.in());
545
      QString strIn(aComm.in());
546
      aMap.clear();
546
      aMap.clear();
(-)VISU_SRC_3.2.2/src/VISUGUI/VisuGUI_TimeAnimation.cxx (+5 lines)
Lines 1185-1190 Link Here
1185
1185
1186
  TopLayout->addMultiCellWidget(aSaveBox, 7, 7, 0, 3);
1186
  TopLayout->addMultiCellWidget(aSaveBox, 7, 7, 0, 3);
1187
1187
1188
  QCheckBox* aCleanMemCheck = new QCheckBox("Clean memory at each frame",myPlayFrame);
1189
  aCleanMemCheck->setChecked(myAnimator->isCleaningMemoryAtEachFrame());
1190
  connect(aCleanMemCheck, SIGNAL(toggled(bool)), myAnimator, SLOT(setCleaningMemoryAtEachFrameSlot(bool)));
1191
  TopLayout->addMultiCellWidget(aCleanMemCheck, 8, 8, 0, 3);
1192
1188
  aMainLayout->addWidget(myPlayFrame);
1193
  aMainLayout->addWidget(myPlayFrame);
1189
1194
1190
  // Animation publishing in study
1195
  // Animation publishing in study
(-)VISU_SRC_3.2.2/src/VISUGUI/VisuGUI_Tools.cxx (-11 / +11 lines)
Lines 224-231 Link Here
224
    VISU::Storable::TRestoringMap aMap;
224
    VISU::Storable::TRestoringMap aMap;
225
    if (theSObject) {
225
    if (theSObject) {
226
      _PTR(GenericAttribute) anAttr;
226
      _PTR(GenericAttribute) anAttr;
227
      if (theSObject->FindAttribute(anAttr, "AttributeComment")) {
227
      if (theSObject->FindAttribute(anAttr, "AttributeString")) {
228
	_PTR(AttributeComment) aComment (anAttr);
228
	_PTR(AttributeString) aComment (anAttr);
229
	std::string aValue = aComment->Value();
229
	std::string aValue = aComment->Value();
230
	QString aString (aValue.c_str());
230
	QString aString (aValue.c_str());
231
	VISU::Storable::StrToMap(aString, aMap);
231
	VISU::Storable::StrToMap(aString, aMap);
Lines 257-264 Link Here
257
    _PTR(SObject) aSObject = aStudy->FindObjectID(theEntry.latin1());
257
    _PTR(SObject) aSObject = aStudy->FindObjectID(theEntry.latin1());
258
    if (aSObject) {
258
    if (aSObject) {
259
      _PTR(GenericAttribute) anAttr;
259
      _PTR(GenericAttribute) anAttr;
260
      if (theMap && aSObject->FindAttribute(anAttr,"AttributeComment")) {
260
      if (theMap && aSObject->FindAttribute(anAttr,"AttributeString")) {
261
	_PTR(AttributeComment) aComment (anAttr);
261
	_PTR(AttributeString) aComment (anAttr);
262
	std::string aValue = aComment->Value();
262
	std::string aValue = aComment->Value();
263
	QString aString (aValue.c_str());
263
	QString aString (aValue.c_str());
264
	VISU::Storable::StrToMap(aString, *theMap);
264
	VISU::Storable::StrToMap(aString, *theMap);
Lines 388-399 Link Here
388
            // (first sub-level) or is a child of such an object
388
            // (first sub-level) or is a child of such an object
389
            string aNAME, aVisuNAME = GetVisuGen(theModule)->ComponentDataType();
389
            string aNAME, aVisuNAME = GetVisuGen(theModule)->ComponentDataType();
390
            _PTR(GenericAttribute) anAttr;
390
            _PTR(GenericAttribute) anAttr;
391
            _PTR(AttributeComment) aComment;
391
            _PTR(AttributeString) aComment;
392
392
393
            bool isUnderVISU = false;
393
            bool isUnderVISU = false;
394
            _PTR(SObject) aFatherSObject = aSObject->GetFather();
394
            _PTR(SObject) aFatherSObject = aSObject->GetFather();
395
            if (aFatherSObject->FindAttribute(anAttr, "AttributeComment")) {
395
            if (aFatherSObject->FindAttribute(anAttr, "AttributeString")) {
396
              _PTR(AttributeComment) aComment (anAttr);
396
              _PTR(AttributeString) aComment (anAttr);
397
              aNAME = aComment->Value();
397
              aNAME = aComment->Value();
398
              if (aNAME == aVisuNAME) {
398
              if (aNAME == aVisuNAME) {
399
                isUnderVISU = true;
399
                isUnderVISU = true;
Lines 409-416 Link Here
409
409
410
              isUnderVISU = false;
410
              isUnderVISU = false;
411
              aFatherSObject = aFatherSObject->GetFather();
411
              aFatherSObject = aFatherSObject->GetFather();
412
              if (aFatherSObject->FindAttribute(anAttr, "AttributeComment")) {
412
              if (aFatherSObject->FindAttribute(anAttr, "AttributeString")) {
413
                _PTR(AttributeComment) aComment (anAttr);
413
                _PTR(AttributeString) aComment (anAttr);
414
                aNAME = aComment->Value();
414
                aNAME = aComment->Value();
415
                if (aNAME == aVisuNAME) {
415
                if (aNAME == aVisuNAME) {
416
                  isUnderVISU = true;
416
                  isUnderVISU = true;
Lines 1199-1206 Link Here
1199
      }
1199
      }
1200
    } else {
1200
    } else {
1201
      _PTR(GenericAttribute) anAttr;
1201
      _PTR(GenericAttribute) anAttr;
1202
      if (theObject->FindAttribute(anAttr, "AttributeComment")) {
1202
      if (theObject->FindAttribute(anAttr, "AttributeString")) {
1203
        _PTR(AttributeComment) aComment (anAttr);
1203
        _PTR(AttributeString) aComment (anAttr);
1204
        string aComm = aComment->Value();
1204
        string aComm = aComment->Value();
1205
        QString strIn (aComm.c_str());
1205
        QString strIn (aComm.c_str());
1206
        VISU::Storable::TRestoringMap pMap;
1206
        VISU::Storable::TRestoringMap pMap;
(-)VISU_SRC_3.2.2/src/VISU_I/Makefile.in (+1 lines)
Lines 61-66 Link Here
61
	VISU_TimeAnimation.h
61
	VISU_TimeAnimation.h
62
62
63
LIB_SERVER_IDL = \
63
LIB_SERVER_IDL = \
64
	MED_Gen.idl \
64
	MED.idl \
65
	MED.idl \
65
	VISU_Gen.idl \
66
	VISU_Gen.idl \
66
	SALOME_Component.idl \
67
	SALOME_Component.idl \
(-)VISU_SRC_3.2.2/src/VISU_I/VISUConfig.cc (-6 / +6 lines)
Lines 265-272 Link Here
265
    SALOMEDS::SObject_var aFieldSO;
265
    SALOMEDS::SObject_var aFieldSO;
266
    for(;anIter->More();anIter->Next()) {
266
    for(;anIter->More();anIter->Next()) {
267
      SALOMEDS::GenericAttribute_var anAttr;
267
      SALOMEDS::GenericAttribute_var anAttr;
268
      if (anIter->Value()->FindAttribute(anAttr,"AttributeComment")) {
268
      if (anIter->Value()->FindAttribute(anAttr,"AttributeString")) {
269
	SALOMEDS::AttributeComment_var aCmnt = SALOMEDS::AttributeComment::_narrow(anAttr);
269
	SALOMEDS::AttributeString_var aCmnt = SALOMEDS::AttributeString::_narrow(anAttr);
270
	CORBA::String_var aString = aCmnt->Value();
270
	CORBA::String_var aString = aCmnt->Value();
271
	string aValue(aString);
271
	string aValue(aString);
272
	if (aValue == theComment) {
272
	if (aValue == theComment) {
Lines 308-315 Link Here
308
      aPRef->SetValue(thePersistentRef);
308
      aPRef->SetValue(thePersistentRef);
309
    }
309
    }
310
    if(strcmp(theComment,"") != 0){
310
    if(strcmp(theComment,"") != 0){
311
      anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeComment");
311
      anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeString");
312
      SALOMEDS::AttributeComment_var aCmnt = SALOMEDS::AttributeComment::_narrow(anAttr);
312
      SALOMEDS::AttributeString_var aCmnt = SALOMEDS::AttributeString::_narrow(anAttr);
313
      aCmnt->SetValue(theComment);
313
      aCmnt->SetValue(theComment);
314
      if(MYDEBUG) INFOS("CreateAttributes - Comment = "<<theComment);
314
      if(MYDEBUG) INFOS("CreateAttributes - Comment = "<<theComment);
315
    }
315
    }
Lines 355-362 Link Here
355
      aPRef->SetValue(thePersistentRef);
355
      aPRef->SetValue(thePersistentRef);
356
    }
356
    }
357
    if (strcmp(theComment, "") != 0) {
357
    if (strcmp(theComment, "") != 0) {
358
      anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeComment");
358
      anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeString");
359
      _PTR(AttributeComment) aCmnt (anAttr);
359
      _PTR(AttributeString) aCmnt (anAttr);
360
      aCmnt->SetValue(theComment);
360
      aCmnt->SetValue(theComment);
361
      if (MYDEBUG) INFOS("CreateAttributes - Comment = " << theComment);
361
      if (MYDEBUG) INFOS("CreateAttributes - Comment = " << theComment);
362
    }
362
    }
(-)VISU_SRC_3.2.2/src/VISU_I/VISU_CorbaMedConvertor.cxx (-45 / +334 lines)
Lines 173-178 Link Here
173
    return VISU::eNONE;
173
    return VISU::eNONE;
174
  }
174
  }
175
  
175
  
176
  //---------------------------------------------------------------
177
  medGeometryElement 
178
  VISUGeomToMED(int theGeom)
179
  { 
180
    switch(theGeom){
181
    case VISU::ePOINT1: return MED_POINT1;
182
    case VISU::eSEG2: return MED_SEG2;
183
    case VISU::eTRIA3: return MED_TRIA3;
184
    case VISU::eQUAD4: return MED_QUAD4;
185
    case VISU::eTETRA4: return MED_TETRA4;
186
    case VISU::eHEXA8: return MED_HEXA8;
187
    case VISU::ePENTA6: return MED_PENTA6;
188
    case VISU::ePYRA5: return MED_PYRA5;
189
190
    case VISU::eSEG3: return MED_SEG3;
191
    case VISU::eTRIA6: return MED_TRIA6;
192
    case VISU::eQUAD8: return MED_QUAD8;
193
    case VISU::eTETRA10: return MED_TETRA10;
194
    case VISU::eHEXA20: return MED_HEXA20;
195
    case VISU::ePENTA15: return MED_PENTA15;
196
    case VISU::ePYRA13: return MED_PYRA13;
197
    }
198
    return medGeometryElement(-1);
199
  }
176
200
177
  //---------------------------------------------------------------
201
  //---------------------------------------------------------------
178
  medGeometryElement 
202
  medGeometryElement 
Lines 317-323 Link Here
317
341
318
    return aMeshOnEntity;
342
    return aMeshOnEntity;
319
  }
343
  }
320
 
344
345
  
346
  PCSubProfile
347
  CrSubProfile(const VISU::PCMesh theMesh,
348
	       const VISU::PCField theField,
349
	       const VISU::TCMeshOnEntity& theMeshOnEntity,
350
	       SALOME_MED::medGeometryElement theMGeom,
351
	       //	       SALOME_MED::long_array_var theGeom2Profile)
352
	       int nbElts)
353
  {
354
    if (MYDEBUG) MESSAGE("CrSubProfile");
355
    VISU::EGeometry aEGeom = MEDGeom2VISU(theMGeom);
356
    vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom);
357
358
    PCSubProfile aSubProfile(new TCSubProfile());
359
    aSubProfile->myGeom = aEGeom;
360
    aSubProfile->myMGeom = theMGeom;
361
    aSubProfile->myStatus = eAddAll;
362
    if(MYDEBUG) MESSAGE("theMGeom = "<<theMGeom);
363
    TCellsFirstIndex::const_iterator aTimeStampIter = (theMeshOnEntity.myCellsFirstIndex).find(theMGeom);
364
    if(aTimeStampIter == (theMeshOnEntity.myCellsFirstIndex).end() && 
365
       theMGeom != SALOME_MED::MED_POINT1)
366
      aSubProfile->myStatus = eRemoveAll;
367
    else if( aTimeStampIter == (theMeshOnEntity.myCellsFirstIndex).end() && 
368
	     theMGeom == SALOME_MED::MED_POINT1)
369
      {
370
	if(nbElts>0){
371
	  aSubProfile->myName = "";
372
	  aSubProfile->myStatus = eAddPart;
373
	  
374
	  aSubProfile->myNbCells = nbElts;
375
	  aSubProfile->myCellsSize = aSubProfile->myNbCells;
376
	}
377
      }
378
    else
379
      {
380
	if(nbElts>0){
381
	  aSubProfile->myName = "";
382
	  aSubProfile->myStatus = eAddPart;
383
	  
384
	  aSubProfile->myNbCells = nbElts;
385
	  aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes;
386
	}
387
      }
388
    
389
    if (MYDEBUG) MESSAGE("CrSubProfile done");
390
    return aSubProfile;
391
  }
392
393
  TProfileKey
394
  GetProfileKey(const VISU::PCMesh theMesh,
395
		const VISU::PCField theField,
396
		const VISU::PCValForTime theValForTime,
397
		const VISU::TCMeshOnEntity& theMeshOnEntity)
398
  {
399
    if (MYDEBUG) MESSAGE("GetProfileKey");
400
401
    TProfileKey aProfileKey;
402
403
    const TCellsFirstIndex& aFirstIndex = theMeshOnEntity.myCellsFirstIndex;
404
    TCellsFirstIndex::const_iterator anIter = aFirstIndex.begin();
405
    int aNbElts = 0;
406
    if(anIter==aFirstIndex.end() && 
407
       (theValForTime->myField->getSupport()->getEntity() == SALOME_MED::MED_NODE))
408
      {
409
	SALOME_MED::medGeometryElement aMGeom = SALOME_MED::MED_POINT1;
410
	
411
	try{
412
	  aNbElts = theValForTime->myField->getSupport()->getNumberOfElements(SALOME_MED::MED_NONE);
413
	  if(MYDEBUG)MESSAGE("aMGeom="<<aMGeom<<"   aNbElts="<<aNbElts);
414
	}	catch(...){
415
	  MESSAGE("Error in theValForTime->myField->getSupport()->getNumberOfElements(aMGeom);");
416
	}
417
	
418
	PCSubProfile aSubProfile = CrSubProfile(theMesh,
419
						theField,
420
						theMeshOnEntity,
421
						aMGeom,
422
						aNbElts);
423
	aProfileKey.insert(aSubProfile);
424
      }
425
    
426
    for(; anIter != aFirstIndex.end(); anIter++){
427
      SALOME_MED::medGeometryElement aMGeom = anIter->first;
428
      try{
429
	aNbElts = theValForTime->myField->getSupport()->getNumberOfElements(aMGeom);
430
	if(MYDEBUG)MESSAGE("aMGeom="<<aMGeom<<"   aNbElts="<<aNbElts);
431
      }	catch(...){
432
	MESSAGE("Error in theValForTime->myField->getSupport()->getNumberOfElements(aMGeom);");
433
	continue;
434
      }
435
      PCSubProfile aSubProfile = CrSubProfile(theMesh,
436
					      theField,
437
					      theMeshOnEntity,
438
					      aMGeom,
439
					      aNbElts);
440
      aProfileKey.insert(aSubProfile);
441
    }
442
443
    if (MYDEBUG) MESSAGE("GetProfileKey done");
444
    return aProfileKey;
445
  }
446
  
447
  void
448
  InitProfile(VISU::PCMesh theMesh,
449
	      VISU::PCField theField,
450
	      VISU::PCValForTime theValForTime,
451
	      VISU::TCMeshOnEntity& theMeshOnEntity)
452
  {
453
    if (MYDEBUG) MESSAGE("InitProfile");
454
    
455
    TProfileMap& aProfileMap = theMeshOnEntity.myProfileMap;
456
457
    TProfileKey  aProfileKey = GetProfileKey(theMesh,
458
					     theField,
459
					     theValForTime,
460
					     theMeshOnEntity);
461
462
    TProfileMap::const_iterator anIter = aProfileMap.find(aProfileKey);
463
    if(anIter != aProfileMap.end()){
464
      theValForTime->myProfile = anIter->second;
465
      if(MYDEBUG) MESSAGE("aProfileMap.find(aProfileKey) aProfile->myGeom=");
466
    }else{
467
      PCProfile aProfile(new TCProfile());
468
      TGeom2SubProfile& aGeom2SubProfile = aProfile->myGeom2SubProfile;
469
      
470
      TProfileKey::const_iterator anIter = aProfileKey.begin();
471
      for(; anIter != aProfileKey.end(); anIter++){
472
	PCSubProfile aSubProfile(*anIter);
473
	
474
	if(aProfile->myIsAll && aSubProfile->myStatus != eAddAll)
475
	  aProfile->myIsAll = false;
476
	
477
	VISU::EGeometry aEGeom = aSubProfile->myGeom;
478
	aGeom2SubProfile[aEGeom] = aSubProfile;
479
      }
480
      
481
      aProfileMap[aProfileKey] = aProfile;
482
      theValForTime->myProfile = aProfile;
483
    }
484
    if (MYDEBUG) MESSAGE("InitProfile done");
485
  }
486
487
  void
488
  LoadProfile(VISU::PCMesh theMesh,
489
	      VISU::PCField theField,
490
	      VISU::PCValForTime theValForTime,
491
	      VISU::PCMeshOnEntity theMeshOnEntity)
492
  {
493
    PCProfile aProfile = theValForTime->myProfile;
494
    if (MYDEBUG) MESSAGE("LoadProfile aProfile->myIsDone="<<aProfile->myIsDone);
495
    if(aProfile->myIsDone)
496
      return;
497
    
498
    const TGeom2SubProfile& aGeom2SubProfile = aProfile->myGeom2SubProfile;
499
    TGeom2SubProfile::const_iterator aGeom2SubProfileIter = aGeom2SubProfile.begin();
500
    if(aGeom2SubProfileIter==aGeom2SubProfile.end()){
501
      MESSAGE("Warning! No geom 2 sub profile");
502
    }
503
    for(;aGeom2SubProfileIter!=aGeom2SubProfile.end();aGeom2SubProfileIter++){
504
      VISU::EGeometry        aEGeom = aGeom2SubProfileIter->first;
505
      medGeometryElement     aMGeom = VISUGeomToMED(aEGeom);
506
      PCSubProfile      aSubProfile = aGeom2SubProfileIter->second;
507
      SALOME_MED::long_array_var aGeom2ProfileIds;
508
      std::vector<int> aGeom2Profile;
509
      if(!theValForTime->myField->getSupport()->isOnAllElements()){
510
	cout << __LINE__ << endl;
511
	try{
512
	  if(aMGeom == SALOME_MED::MED_POINT1)
513
	    aGeom2ProfileIds = theValForTime->myField->getSupport()->getNumberFromFile(SALOME_MED::MED_NONE);
514
	  else
515
	    aGeom2ProfileIds = theValForTime->myField->getSupport()->getNumberFromFile(aMGeom);
516
	  int aLen = aGeom2ProfileIds->length();
517
	  if(MYDEBUG) MESSAGE(" - aMGeom="<<aMGeom<<"; aNbCells="<<aLen);
518
	  for(int i=0;i<aLen;i++){
519
	    int anId = aGeom2ProfileIds[i];
520
	    aGeom2Profile.push_back(anId);
521
	    cout << "------------------------------->" << anId << endl;
522
	  }
523
	  cout << endl;
524
	} catch(...) {
525
	  continue;
526
	}
527
      } else {
528
	cout << __LINE__ << endl;
529
	SALOME_MED::medEntityMesh aMEntity = theValForTime->myField->getSupport()->getEntity();
530
	int aNbElts = theMesh->myMesh->getNumberOfElements(aMEntity,aMGeom);
531
	for(int i=0;i<aNbElts;i++) aGeom2Profile.push_back(i+1);
532
      }
533
      if(aGeom2Profile.size()>0){
534
	TSubMeshID& aSubMeshID = aSubProfile->mySubMeshID;
535
	int aSize = aGeom2Profile.size();
536
	aSubMeshID.resize(aSize);
537
	
538
	
539
	for(int anId = 0; anId < aSize; anId++){
540
	  aSubMeshID[anId] = aGeom2Profile[anId]-1; // ENKENKENKENKENEKENKENKN
541
	}
542
      }
543
      
544
    }
545
    
546
    
547
    aProfile->myIsDone = true;
548
    if (MYDEBUG) MESSAGE("LoadProfile done");
549
  }
321
}
550
}
322
551
323
552
Lines 1014-1019 Link Here
1014
1243
1015
  TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
1244
  TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
1016
  aCell2Connect.resize(aNbElem);
1245
  aCell2Connect.resize(aNbElem);
1246
  if(MYDEBUG) MESSAGE("LoadPoints - aNbElem="<<aNbElem);
1017
  for(int iElem = 0; iElem < aNbElem; iElem++)
1247
  for(int iElem = 0; iElem < aNbElem; iElem++)
1018
    aCell2Connect[iElem] = TConnect(1,iElem);
1248
    aCell2Connect[iElem] = TConnect(1,iElem);
1019
  
1249
  
Lines 1184-1191 Link Here
1184
      }
1414
      }
1185
      //Workaround for MED Component data structure
1415
      //Workaround for MED Component data structure
1186
      int aSize = aCell2Connect.size();
1416
      int aSize = aCell2Connect.size();
1187
      if(MYDEBUG) MESSAGE("LoadCellsOnEntity - aCounter = "<<aCounter<<"; aSize = "<<aSize);
1417
      if(MYDEBUG) MESSAGE("LoadCellsOnEntity - aCounter = "<<aCounter<<"; aSize = "<<aSize<<"; aMGeom = "<<aMGeom);
1188
      theMeshOnEntity->myCellsFirstIndex[aMGeom] = TCMeshOnEntity::TIndexAndSize(aCounter,aSize);
1418
      theMeshOnEntity->myCellsFirstIndex[aMGeom] = TIndexAndSize(aCounter,aSize);
1189
      aCounter += aSize;
1419
      aCounter += aSize;
1190
    }
1420
    }
1191
  }
1421
  }
Lines 1267-1319 Link Here
1267
	    VISU::PCValForTime theValForTime,
1497
	    VISU::PCValForTime theValForTime,
1268
	    VISU::PCMeshOnEntity theMeshOnEntity)
1498
	    VISU::PCMeshOnEntity theMeshOnEntity)
1269
{
1499
{
1500
  if(MYDEBUG) MESSAGE("ImportField");
1501
1270
  int aNbComp = theField->myNbComp;
1502
  int aNbComp = theField->myNbComp;
1271
  if(theField->myEntity == NODE_ENTITY){
1503
  
1272
    VISU::EGeometry aEGeom = VISU::ePOINT1;
1504
  if(MYDEBUG) MESSAGE("- aNbComp = "<<aNbComp);
1273
    int aNbGauss = theValForTime->GetNbGauss(aEGeom);
1505
1274
    const TNamedPointCoords& aCoords = theMesh->myNamedPointCoords;
1506
  CORBA::String_var aSupportName = theMeshOnEntity->mySupport->getName();
1275
    int aNbElem = aCoords.GetNbPoints();
1507
  
1276
1508
  if(theMeshOnEntity->mySupport->isOnAllElements() &&
1277
    if(MYDEBUG) MESSAGE("ImportField - aNbElem = "<<aNbElem);
1509
     strcmp(aSupportName.in(),"SupportOnAll_MED_") > 0){
1278
1510
1279
    TMeshValue& aMeshValue = theValForTime->GetMeshValue(VISU::ePOINT1);
1511
    if(theField->myEntity == NODE_ENTITY){
1280
    aMeshValue.Init(aNbElem,aNbGauss,aNbComp);
1512
      VISU::EGeometry aEGeom = VISU::ePOINT1;
1281
    for(int iElem = 0, anId = 0; iElem < aNbElem; iElem++){
1513
      int aNbGauss = theValForTime->GetNbGauss(aEGeom);
1282
      TValueSliceArr aValueSliceArr = aMeshValue.GetGaussValueSliceArr(iElem);
1514
      const TNamedPointCoords& aCoords = theMesh->myNamedPointCoords;
1283
      for(int iGauss = 0; iGauss < aNbGauss; iGauss++){
1515
      int aNbElem = aCoords.GetNbPoints();
1284
	TValueSlice& aValueSlice = aValueSliceArr[iGauss];
1516
      
1285
	for(int iComp = 0; iComp < aNbComp; iComp++){
1517
      if(MYDEBUG) MESSAGE("ImportField - aNbElem = "<<aNbElem);
1286
	  aValueSlice[iComp] = theArray[anId++];
1518
      
1519
      TMeshValue& aMeshValue = theValForTime->GetMeshValue(VISU::ePOINT1);
1520
      aMeshValue.Init(aNbElem,aNbGauss,aNbComp);
1521
      for(int iElem = 0, anId = 0; iElem < aNbElem; iElem++){
1522
	TValueSliceArr aValueSliceArr = aMeshValue.GetGaussValueSliceArr(iElem);
1523
	for(int iGauss = 0; iGauss < aNbGauss; iGauss++){
1524
	  TValueSlice& aValueSlice = aValueSliceArr[iGauss];
1525
	  for(int iComp = 0; iComp < aNbComp; iComp++){
1526
	    aValueSlice[iComp] = theArray[anId++];
1527
	  }
1528
	}
1529
      }
1530
    } else  {
1531
      SALOME_MED::medGeometryElement* aGeomElems;
1532
      const TEntity& aVEntity = theField->myEntity;
1533
      int iGeomEnd = GetEntity2Geom(aVEntity,aGeomElems);
1534
      for(int iGeom = 0; iGeom < iGeomEnd; iGeom++){
1535
	SALOME_MED::medGeometryElement aMGeom = aGeomElems[iGeom];
1536
	VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
1537
	int aNbGauss = theValForTime->GetNbGauss(aEGeom);
1538
	const TCellsFirstIndex& aCellsFirstIndex = theMeshOnEntity->myCellsFirstIndex;
1539
	TCellsFirstIndex::const_iterator aCellsFirstIndexIter = aCellsFirstIndex.find(aMGeom);
1540
	if(aCellsFirstIndexIter != aCellsFirstIndex.end()){
1541
	  const TIndexAndSize& aIndexAndSize = aCellsFirstIndexIter->second;
1542
	  if(MYDEBUG) 
1543
	    MESSAGE("ImportField - aMGeom = "<<aMGeom<<
1544
		    "; aIndexAndSize = {"<<aIndexAndSize.first<<
1545
		    ","<<aIndexAndSize.second<<"}");
1546
	  
1547
	  int aNbElem = aIndexAndSize.second;
1548
	  int aStart = aIndexAndSize.first*aNbComp;
1549
	  TMeshValue& aMeshValue = theValForTime->GetMeshValue(aEGeom);
1550
	  aMeshValue.Init(aNbElem,aNbGauss,aNbComp);
1551
	  for(int iElem = 0, anId = 0; iElem < aNbElem; iElem++, anId += aNbComp){
1552
	    TValueSliceArr aValueSliceArr = aMeshValue.GetGaussValueSliceArr(iElem);
1553
	    for(int iGauss = 0; iGauss < aNbGauss; iGauss++){
1554
	      TValueSlice& aValueSlice = aValueSliceArr[iGauss];
1555
	      for(int iComp = 0; iComp < aNbComp; iComp++)
1556
		aValueSlice[iComp] = theArray[aStart+anId+iComp];
1557
	    }
1558
	  }
1287
	}
1559
	}
1288
      }
1560
      }
1289
    }
1561
    }
1290
  }else{
1562
    return 1;
1291
    SALOME_MED::medGeometryElement* aGeomElems;
1563
  }
1292
    const TEntity& aVEntity = theField->myEntity;
1564
  
1293
    int iGeomEnd = GetEntity2Geom(aVEntity,aGeomElems);
1565
  if(MYDEBUG) MESSAGE("Loading profile");
1294
    for(int iGeom = 0; iGeom < iGeomEnd; iGeom++){
1566
  theField->myDataSize = 0;
1295
      SALOME_MED::medGeometryElement aMGeom = aGeomElems[iGeom];
1567
  
1296
      VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
1568
  InitProfile(theMesh,theField,theValForTime,theMeshOnEntity);
1569
  
1570
  LoadProfile(theMesh,theField,theValForTime,theMeshOnEntity);
1571
  
1572
  PCProfile aProfile = theValForTime->myProfile;
1573
  TGeom2SubProfile& aGeom2SubProfile = aProfile->myGeom2SubProfile;
1574
  
1575
  TGeom2SubProfile::const_iterator anIter = aGeom2SubProfile.begin();
1576
  for(; anIter != aGeom2SubProfile.end(); anIter++){
1577
    VISU::EGeometry aEGeom = anIter->first;
1578
    PCSubProfile aSubProfile(anIter->second);
1579
    
1580
    int aNbElem = aSubProfile->myNbCells;
1581
    theField->myDataSize += aNbElem*aNbComp;
1582
    
1583
    if(aSubProfile->myStatus != eRemoveAll){
1297
      int aNbGauss = theValForTime->GetNbGauss(aEGeom);
1584
      int aNbGauss = theValForTime->GetNbGauss(aEGeom);
1298
      const TCMeshOnEntity::TCellsFirstIndex& aCellsFirstIndex = theMeshOnEntity->myCellsFirstIndex;
1585
      
1299
      TCMeshOnEntity::TCellsFirstIndex::const_iterator aCellsFirstIndexIter = aCellsFirstIndex.find(aMGeom);
1586
      if(MYDEBUG) MESSAGE("- aEGeom = "<<aEGeom<<
1300
      if(aCellsFirstIndexIter != aCellsFirstIndex.end()){
1587
			  "; aNbElem = "<<aNbElem<<
1301
	const TCMeshOnEntity::TIndexAndSize& aIndexAndSize = aCellsFirstIndexIter->second;
1588
			  "; aNbGauss = "<<aNbGauss);
1302
	if(MYDEBUG) 
1589
      
1303
	  MESSAGE("ImportField - aMGeom = "<<aMGeom<<
1590
      TMeshValue& aVMeshValue = theValForTime->GetMeshValue(aEGeom);
1304
		  "; aIndexAndSize = {"<<aIndexAndSize.first<<
1591
      aVMeshValue.Init(aNbElem,aNbGauss,aNbComp);
1305
		  ","<<aIndexAndSize.second<<"}");
1592
      
1306
1593
      for(int iElem = 0, anId = 0; iElem < aNbElem; iElem++){
1307
	int aNbElem = aIndexAndSize.second;
1594
	TValueSliceArr aVValueSliceArr = aVMeshValue.GetGaussValueSliceArr(iElem);
1308
	int aStart = aIndexAndSize.first*aNbComp;
1595
	for(int iGauss = 0; iGauss < aNbGauss; iGauss++){
1309
	TMeshValue& aMeshValue = theValForTime->GetMeshValue(aEGeom);
1596
	  TValueSlice& aVValueSlice = aVValueSliceArr[iGauss];
1310
	aMeshValue.Init(aNbElem,aNbGauss,aNbComp);
1597
	  for(int iComp = 0; iComp < aNbComp; iComp++){
1311
	for(int iElem = 0, anId = 0; iElem < aNbElem; iElem++, anId += aNbComp){
1598
	    aVValueSlice[iComp] = theArray[anId++];
1312
	  TValueSliceArr aValueSliceArr = aMeshValue.GetGaussValueSliceArr(iElem);
1313
	  for(int iGauss = 0; iGauss < aNbGauss; iGauss++){
1314
	    TValueSlice& aValueSlice = aValueSliceArr[iGauss];
1315
	    for(int iComp = 0; iComp < aNbComp; iComp++)
1316
	      aValueSlice[iComp] = theArray[aStart+anId+iComp];
1317
	  }
1599
	  }
1318
	}
1600
	}
1319
      }
1601
      }
Lines 1329-1334 Link Here
1329
	    VISU::PField theField, 
1611
	    VISU::PField theField, 
1330
	    VISU::PCValForTime theValForTime)
1612
	    VISU::PCValForTime theValForTime)
1331
{
1613
{
1614
  MESSAGE("VISU_MEDConvertor::LoadField");
1332
  //Check on loading already done
1615
  //Check on loading already done
1333
  PIDMapperFilter anIDMapperFilter = theValForTime->myIDMapperFilter;
1616
  PIDMapperFilter anIDMapperFilter = theValForTime->myIDMapperFilter;
1334
  if(anIDMapperFilter->myIsVTKDone) 
1617
  if(anIDMapperFilter->myIsVTKDone) 
Lines 1339-1344 Link Here
1339
  theValForTime->myProfile = aProfile;
1622
  theValForTime->myProfile = aProfile;
1340
1623
1341
  SALOME_MED::FIELD_var aMEDField = theValForTime->myField;
1624
  SALOME_MED::FIELD_var aMEDField = theValForTime->myField;
1625
1626
  SALOME_MED::SUPPORT_var aMEDSupport = aMEDField->getSupport();
1627
1628
  if(aMEDSupport->isOnAllElements()) aProfile->myIsDone = true;
1629
  
1342
  SALOME_MED::FIELDDOUBLE_ptr aFieldDouble = SALOME_MED::FIELDDOUBLE::_narrow(aMEDField);
1630
  SALOME_MED::FIELDDOUBLE_ptr aFieldDouble = SALOME_MED::FIELDDOUBLE::_narrow(aMEDField);
1343
  if(!aFieldDouble->_is_nil()){
1631
  if(!aFieldDouble->_is_nil()){
1344
    SALOME_MED::double_array_var anArray = aFieldDouble->getValue(SALOME_MED::MED_FULL_INTERLACE);
1632
    SALOME_MED::double_array_var anArray = aFieldDouble->getValue(SALOME_MED::MED_FULL_INTERLACE);
Lines 1354-1358 Link Here
1354
1642
1355
  anIDMapperFilter->myIsVTKDone = true;
1643
  anIDMapperFilter->myIsVTKDone = true;
1356
1644
1645
  MESSAGE("VISU_MEDConvertor::LoadField done");
1357
  return 1;
1646
  return 1;
1358
}
1647
}
(-)VISU_SRC_3.2.2/src/VISU_I/VISU_CorbaMedConvertor.hxx (-3 / +27 lines)
Lines 37-42 Link Here
37
37
38
namespace VISU
38
namespace VISU
39
{
39
{
40
  typedef std::pair<int,int> TIndexAndSize; // 
41
  typedef std::map<SALOME_MED::medGeometryElement,TIndexAndSize> TCellsFirstIndex; // key: SALOME_MED::medGeometryElement
40
  //---------------------------------------------------------------
42
  //---------------------------------------------------------------
41
  struct TCMesh: virtual TMeshImpl
43
  struct TCMesh: virtual TMeshImpl
42
  {
44
  {
Lines 44-59 Link Here
44
  };
46
  };
45
  typedef SharedPtr<TCMesh> PCMesh;
47
  typedef SharedPtr<TCMesh> PCMesh;
46
48
49
  //---------------------------------------------------------------
50
  struct TCSubProfile: virtual TSubProfileImpl
51
  {
52
    SALOME_MED::medGeometryElement myMGeom;
53
  };
54
  typedef SharedPtr<TCSubProfile> PCSubProfile;
47
55
48
  //---------------------------------------------------------------
56
  //---------------------------------------------------------------
49
  struct TCProfile: virtual TProfileImpl
57
  struct TCProfile: virtual TProfileImpl
50
  {};
58
  {};
51
  typedef SharedPtr<TCProfile> PCProfile;
59
  typedef SharedPtr<TCProfile> PCProfile;
52
60
61
  //---------------------------------------------------------------
62
  struct TCGauss: virtual TGaussImpl
63
  {
64
  };
65
  typedef SharedPtr<TCGauss> PCGauss;
66
  
67
  struct TCGaussSubMesh: virtual TGaussSubMeshImpl
68
  {
69
  };
70
  typedef SharedPtr<TCGaussSubMesh> PCGaussSubMesh;
71
53
72
54
  //---------------------------------------------------------------
73
  //---------------------------------------------------------------
55
  struct TCSubMesh: virtual TSubMeshImpl
74
  struct TCGaussMesh: virtual TGaussMeshImpl
56
  {};
75
  {};
76
  typedef SharedPtr<TCGaussMesh> PCGaussMesh;
77
78
79
  //---------------------------------------------------------------
80
  struct TCSubMesh: virtual TSubMeshImpl
81
  {
82
  };
57
  typedef SharedPtr<TCSubMesh> PCSubMesh;
83
  typedef SharedPtr<TCSubMesh> PCSubMesh;
58
84
59
85
Lines 61-68 Link Here
61
  struct TCMeshOnEntity: virtual TMeshOnEntityImpl
87
  struct TCMeshOnEntity: virtual TMeshOnEntityImpl
62
  {
88
  {
63
    SALOME_MED::SUPPORT_var mySupport;
89
    SALOME_MED::SUPPORT_var mySupport;
64
    typedef std::pair<int,int> TIndexAndSize;
65
    typedef std::map<int,TIndexAndSize> TCellsFirstIndex;
66
    TCellsFirstIndex myCellsFirstIndex;
90
    TCellsFirstIndex myCellsFirstIndex;
67
  };
91
  };
68
  typedef SharedPtr<TCMeshOnEntity> PCMeshOnEntity;
92
  typedef SharedPtr<TCMeshOnEntity> PCMeshOnEntity;
(-)VISU_SRC_3.2.2/src/VISU_I/VISU_CutLines_i.cc (-6 / +38 lines)
Lines 67-73 Link Here
67
  Prs3d_i(theResult,theAddToStudy),
67
  Prs3d_i(theResult,theAddToStudy),
68
  ColoredPrs3d_i(theResult,theAddToStudy),
68
  ColoredPrs3d_i(theResult,theAddToStudy),
69
  ScalarMap_i(theResult,theAddToStudy),
69
  ScalarMap_i(theResult,theAddToStudy),
70
  myCutLinesPL(NULL)
70
  myCutLinesPL(NULL),
71
  myUseAbsLength(false)
71
{}
72
{}
72
73
73
74
Lines 78-84 Link Here
78
  Prs3d_i(theResult,theSObject),
79
  Prs3d_i(theResult,theSObject),
79
  ColoredPrs3d_i(theResult,theSObject),
80
  ColoredPrs3d_i(theResult,theSObject),
80
  ScalarMap_i(theResult,theSObject),
81
  ScalarMap_i(theResult,theSObject),
81
  myCutLinesPL(NULL)
82
  myCutLinesPL(NULL),
83
  myUseAbsLength(false)
82
{
84
{
83
}
85
}
84
86
Lines 93-99 Link Here
93
VISU::Storable* VISU::CutLines_i::Create(const char* theMeshName, VISU::Entity theEntity, 
95
VISU::Storable* VISU::CutLines_i::Create(const char* theMeshName, VISU::Entity theEntity, 
94
					 const char* theFieldName, int theIteration)
96
					 const char* theFieldName, int theIteration)
95
{
97
{
96
  return ScalarMap_i::Create(theMeshName,theEntity,theFieldName,theIteration);
98
  TSuperClass::Create(theMeshName,theEntity,theFieldName,theIteration);
99
  SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
100
  SetAllCurvesInverted( aResourceMgr->booleanValue("VISU", "invert_all_curves", false) );
101
  SetUseAbsoluteLength( aResourceMgr->booleanValue("VISU", "use_absolute_length", false) );
102
103
  return this;
97
}
104
}
98
105
99
106
Lines 110-115 Link Here
110
  SetOrientation2(CutPlanes::Orientation(VISU::Storable::FindValue(theMap,"myBasePlane[1]").toInt()),
117
  SetOrientation2(CutPlanes::Orientation(VISU::Storable::FindValue(theMap,"myBasePlane[1]").toInt()),
111
		  Storable::FindValue(theMap,"aRot[1][0]").toDouble(),
118
		  Storable::FindValue(theMap,"aRot[1][0]").toDouble(),
112
		  Storable::FindValue(theMap,"aRot[1][1]").toDouble());
119
		  Storable::FindValue(theMap,"aRot[1][1]").toDouble());
120
  SetUseAbsoluteLength(VISU::Storable::FindValue(theMap,"myUseAbsLength").toInt());
121
113
  if (VISU::Storable::FindValue(theMap,"myBasePlaneCondition").toInt())
122
  if (VISU::Storable::FindValue(theMap,"myBasePlaneCondition").toInt())
114
    SetDefault();
123
    SetDefault();
115
  else
124
  else
Lines 161-168 Link Here
161
    aStrPos.append(QString::number(GetLinePosition(i)) + "|");
170
    aStrPos.append(QString::number(GetLinePosition(i)) + "|");
162
    aStrCon.append(QString::number(IsDefaultPosition(i)) + "|");
171
    aStrCon.append(QString::number(IsDefaultPosition(i)) + "|");
163
  }
172
  }
173
164
  Storable::DataToStream( theStr, "myLinePosition",  aStrPos.latin1());
174
  Storable::DataToStream( theStr, "myLinePosition",  aStrPos.latin1());
165
  Storable::DataToStream( theStr, "myLineCondition", aStrCon.latin1());
175
  Storable::DataToStream( theStr, "myLineCondition", aStrCon.latin1());
176
  Storable::DataToStream( theStr,"myUseAbsLength", IsUseAbsoluteLength());
166
177
167
  // Storing the map - \a myMapCurvesInverted
178
  // Storing the map - \a myMapCurvesInverted
168
  QString aStrCurvesInverted;
179
  QString aStrCurvesInverted;
Lines 284-289 Link Here
284
  myMapCurvesInverted[theCurveNumber] = theInvert;
295
  myMapCurvesInverted[theCurveNumber] = theInvert;
285
}
296
}
286
297
298
/*! It control the way the length of cutlines is shown: using aboslute or relative values
299
* \param theAbsLength - boolean value, TRUE or false.
300
*/
301
void VISU::CutLines_i::SetUseAbsoluteLength(CORBA::Boolean theAbsLength){
302
  myUseAbsLength = theAbsLength;
303
}
304
287
/*! Checks orientation of curve.
305
/*! Checks orientation of curve.
288
 * \param theCurveNumber - integer value, number of cut line.
306
 * \param theCurveNumber - integer value, number of cut line.
289
 * \retval TRUE - if line in the table is inverted, else FALSE.
307
 * \retval TRUE - if line in the table is inverted, else FALSE.
Lines 369-375 Link Here
369
      if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal iLine = "<<iLine<<"; aNbPoints = "<<aNbPoints);
387
      if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal iLine = "<<iLine<<"; aNbPoints = "<<aNbPoints);
370
      aLineIdCont[iLine] = jLine++;
388
      aLineIdCont[iLine] = jLine++;
371
      TXYMap& aXYMap = aXYMapCont[iLine];
389
      TXYMap& aXYMap = aXYMapCont[iLine];
372
      vtkFloatingPointType aPnt[3], aVect[3], aDist;
390
      vtkFloatingPointType aPnt[3], aVect[3], aDist, aTopBnd;
391
      aTopBnd = aBoundPrjLn[2];
392
      if( !IsUseAbsoluteLength() ){
393
        aTopBnd = 1.0;
394
      }
373
      for(int i = 0; i < aNbPoints; i++){
395
      for(int i = 0; i < aNbPoints; i++){
374
	aDataSet->GetPoint(i,aPnt);
396
	aDataSet->GetPoint(i,aPnt);
375
	Sub(aPnt,aBasePnt,aVect);
397
	Sub(aPnt,aBasePnt,aVect);
Lines 377-386 Link Here
377
	  aDist = 0.5;
399
	  aDist = 0.5;
378
	else
400
	else
379
	  {
401
	  {
380
	    aDist = vtkMath::Dot(aVect,aDirLn) / aBoundPrjLn[2];
402
	    aDist = vtkMath::Dot(aVect,aDirLn)/aTopBnd; 
381
	    // the workaround
403
	    // the workaround
382
	    if(aDist < 0.0) aDist = 0.0; 
404
	    if(aDist < 0.0) aDist = 0.0; 
383
	    if(aDist > 1.0) aDist = 1.0;
405
	    if(aDist > aTopBnd) aDist = aTopBnd;
384
	  }
406
	  }
385
	aXYMap[aDist] = aScalars->GetTuple1(i);
407
	aXYMap[aDist] = aScalars->GetTuple1(i);
386
      }
408
      }
Lines 502-504 Link Here
502
    INFOS("Unknown exception was occured !!!");
524
    INFOS("Unknown exception was occured !!!");
503
  }
525
  }
504
}
526
}
527
528
void VISU::CutLines_i::SameAs(const Prs3d_i* theOrigin){
529
  TSuperClass::SameAs(theOrigin);
530
  if(const CutLines_i* aPrs3d = dynamic_cast<const CutLines_i*>(theOrigin)){
531
    CutLines_i* anOrigin = const_cast<CutLines_i*>(aPrs3d);
532
    myUseAbsLength = anOrigin->IsUseAbsoluteLength();
533
    CopyCurvesInverted(anOrigin->GetCurvesInverted());
534
  }
535
}
536
(-)VISU_SRC_3.2.2/src/VISU_I/VISU_CutLines_i.hh (+5 lines)
Lines 89-94 Link Here
89
    virtual void SetCurveInverted(CORBA::Long theCurveNumber,CORBA::Boolean theInvert);
89
    virtual void SetCurveInverted(CORBA::Long theCurveNumber,CORBA::Boolean theInvert);
90
    virtual CORBA::Boolean IsCurveInverted(CORBA::Long theCurveNumber);
90
    virtual CORBA::Boolean IsCurveInverted(CORBA::Long theCurveNumber);
91
91
92
    virtual void SetUseAbsoluteLength(CORBA::Boolean theAbsLength);
93
    virtual CORBA::Boolean IsUseAbsoluteLength() {return myUseAbsLength;}
94
92
    virtual void SetNbLines(CORBA::Long theNb);
95
    virtual void SetNbLines(CORBA::Long theNb);
93
    virtual CORBA::Long GetNbLines();
96
    virtual CORBA::Long GetNbLines();
94
    typedef VISU::CutLines TInterface;
97
    typedef VISU::CutLines TInterface;
Lines 103-108 Link Here
103
106
104
    VISU_CutLinesPL *myCutLinesPL;
107
    VISU_CutLinesPL *myCutLinesPL;
105
    TCurvesInv myMapCurvesInverted;
108
    TCurvesInv myMapCurvesInverted;
109
    CORBA::Boolean myUseAbsLength;
106
110
107
  public:
111
  public:
108
    static int IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
112
    static int IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
Lines 113-118 Link Here
113
    virtual void ToStream(std::ostringstream& theStr);
117
    virtual void ToStream(std::ostringstream& theStr);
114
118
115
    virtual Storable* Restore(const Storable::TRestoringMap& theMap);
119
    virtual Storable* Restore(const Storable::TRestoringMap& theMap);
120
    virtual void SameAs( const Prs3d_i* Origin );
116
121
117
    virtual 
122
    virtual 
118
    VISU_Actor* 
123
    VISU_Actor* 
(-)VISU_SRC_3.2.2/src/VISU_I/VISU_DumpPython.cc (-9 / +15 lines)
Lines 299-307 Link Here
299
  {
299
  {
300
    SALOMEDS::GenericAttribute_var anAttr;
300
    SALOMEDS::GenericAttribute_var anAttr;
301
    SALOMEDS::SObject_var aFatherSObject = theSObject->GetFather();
301
    SALOMEDS::SObject_var aFatherSObject = theSObject->GetFather();
302
    if(aFatherSObject->FindAttribute(anAttr,"AttributeComment")){
302
    if(aFatherSObject->FindAttribute(anAttr,"AttributeString")){
303
      SALOMEDS::AttributeComment_var aComment =
303
      SALOMEDS::AttributeString_var aComment =
304
	SALOMEDS::AttributeComment::_narrow(anAttr);
304
	SALOMEDS::AttributeString::_narrow(anAttr);
305
      CORBA::String_var aValue = aComment->Value();
305
      CORBA::String_var aValue = aComment->Value();
306
      Storable::TRestoringMap aMap;
306
      Storable::TRestoringMap aMap;
307
      Storable::StrToMap(aValue.in(),aMap);
307
      Storable::StrToMap(aValue.in(),aMap);
Lines 1013-1021 Link Here
1013
        case VISU::TTABLE:
1013
        case VISU::TTABLE:
1014
          if(dynamic_cast<Table_i*>(GetServant(anObj).in())){
1014
          if(dynamic_cast<Table_i*>(GetServant(anObj).in())){
1015
	    SALOMEDS::GenericAttribute_var anAttr;
1015
	    SALOMEDS::GenericAttribute_var anAttr;
1016
	    if(theSObject->FindAttribute(anAttr,"AttributeComment")){
1016
	    if(theSObject->FindAttribute(anAttr,"AttributeString")){
1017
	      using namespace SALOMEDS;
1017
	      using namespace SALOMEDS;
1018
	      AttributeComment_var aComment = AttributeComment::_narrow(anAttr);
1018
	      AttributeString_var aComment = AttributeString::_narrow(anAttr);
1019
	      CORBA::String_var aValue = aComment->Value();
1019
	      CORBA::String_var aValue = aComment->Value();
1020
	      Storable::TRestoringMap aMap;
1020
	      Storable::TRestoringMap aMap;
1021
	      Storable::StrToMap(aValue.in(),aMap);
1021
	      Storable::StrToMap(aValue.in(),aMap);
Lines 1100-1108 Link Here
1100
      }
1100
      }
1101
    } else { /*if(!CORBA::is_nil(anObj))*/
1101
    } else { /*if(!CORBA::is_nil(anObj))*/
1102
      SALOMEDS::GenericAttribute_var anAttr;
1102
      SALOMEDS::GenericAttribute_var anAttr;
1103
      if (theSObject->FindAttribute(anAttr,"AttributeComment")) {
1103
      if (theSObject->FindAttribute(anAttr,"AttributeString")) {
1104
	SALOMEDS::AttributeComment_var aComment =
1104
	SALOMEDS::AttributeString_var aComment =
1105
	  SALOMEDS::AttributeComment::_narrow(anAttr);
1105
	  SALOMEDS::AttributeString::_narrow(anAttr);
1106
	CORBA::String_var aValue = aComment->Value();
1106
	CORBA::String_var aValue = aComment->Value();
1107
	Storable::TRestoringMap aMap;
1107
	Storable::TRestoringMap aMap;
1108
	Storable::StrToMap(aValue.in(),aMap);
1108
	Storable::StrToMap(aValue.in(),aMap);
Lines 1141-1147 Link Here
1141
	    theStr<<thePrefix<<"anAttr = aBuilder.FindOrCreateAttribute("<<aName<<",'AttributeName')"<<endl;
1141
	    theStr<<thePrefix<<"anAttr = aBuilder.FindOrCreateAttribute("<<aName<<",'AttributeName')"<<endl;
1142
	    theStr<<thePrefix<<"anAttr.SetValue('"<<aName<<"')"<<endl;
1142
	    theStr<<thePrefix<<"anAttr.SetValue('"<<aName<<"')"<<endl;
1143
1143
1144
	    theStr<<thePrefix<<"anAttr = aBuilder.FindOrCreateAttribute("<<aName<<",'AttributeComment')"<<endl;
1144
	    theStr<<thePrefix<<"anAttr = aBuilder.FindOrCreateAttribute("<<aName<<",'AttributeString')"<<endl;
1145
	    theStr<<thePrefix<<"anAttr.SetValue('"<<aValue.in()<<"')"<<endl;
1145
	    theStr<<thePrefix<<"anAttr.SetValue('"<<aValue.in()<<"')"<<endl;
1146
1146
1147
	    theStr<<thePrefix<<"pass"<<endl<<endl;
1147
	    theStr<<thePrefix<<"pass"<<endl<<endl;
Lines 1293-1298 Link Here
1293
	     CORBA::Boolean theIsPublished,
1293
	     CORBA::Boolean theIsPublished,
1294
	     CORBA::Boolean& theIsValidScript)
1294
	     CORBA::Boolean& theIsValidScript)
1295
  {
1295
  {
1296
    theIsValidScript = false;
1297
1296
    SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow(theStudy);
1298
    SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow(theStudy);
1297
    if(CORBA::is_nil(aStudy))
1299
    if(CORBA::is_nil(aStudy))
1298
      return new Engines::TMPFile(0);
1300
      return new Engines::TMPFile(0);
Lines 1337-1342 Link Here
1337
    }
1339
    }
1338
1340
1339
    aStr<<aPrefix<<"pass"<<endl;
1341
    aStr<<aPrefix<<"pass"<<endl;
1342
    // theIsValidScript currently is not used by internal dump methods (DumpChildrenToPython(), etc.)
1343
    // If the situation changes, then the following line should be removed, and theIsValidScript
1344
    // should be set properly by those internal methods
1345
    theIsValidScript = true;
1340
1346
1341
#ifndef COUT
1347
#ifndef COUT
1342
    std::string aResult = aStr.str();
1348
    std::string aResult = aStr.str();
(-)VISU_SRC_3.2.2/src/VISU_I/VISU_Gen_i.cc (-6 / +37 lines)
Lines 68-73 Link Here
68
#include <omnithread.h>
68
#include <omnithread.h>
69
#include CORBA_SERVER_HEADER(SALOME_Session)
69
#include CORBA_SERVER_HEADER(SALOME_Session)
70
#include CORBA_SERVER_HEADER(SALOME_ModuleCatalog)
70
#include CORBA_SERVER_HEADER(SALOME_ModuleCatalog)
71
#include CORBA_SERVER_HEADER(MED_Gen)
71
72
72
// QT Includes
73
// QT Includes
73
#include <qstring.h>
74
#include <qstring.h>
Lines 291-301 Link Here
291
    if(MYDEBUG) MESSAGE("VISU_Gen_i::~VISU_Gen_i");
292
    if(MYDEBUG) MESSAGE("VISU_Gen_i::~VISU_Gen_i");
292
  }
293
  }
293
294
294
  void CorrectSObjectType(SALOMEDS::SObject_ptr theSObject)
295
  void CorrectSObjectType(SALOMEDS::SObject_ptr theSObject, SALOMEDS::StudyBuilder_ptr theBuilder)
295
  {
296
  {
296
    SALOMEDS::GenericAttribute_var anAttr;
297
    SALOMEDS::GenericAttribute_var anAttr;
297
    if ( theSObject->FindAttribute(anAttr, "AttributeComment") ) {
298
    bool isAttrStringFound = false;
298
      SALOMEDS::AttributeComment_var aAttComment = SALOMEDS::AttributeComment::_narrow(anAttr);
299
300
    if( theSObject->FindAttribute(anAttr, "AttributeComment") ) {
301
      //SRN: Replace an AttributeComment with AttributeString
302
      SALOMEDS::AttributeComment_var aComment = SALOMEDS::AttributeComment::_narrow(anAttr);
303
      string aValue = aComment->Value();
304
      theBuilder->RemoveAttribute(theSObject, "AttributeComment");
305
      anAttr = theBuilder->FindOrCreateAttribute(theSObject, "AttributeString");
306
      SALOMEDS::AttributeString_var aStringAttr = SALOMEDS::AttributeString::_narrow(anAttr);
307
      aStringAttr->SetValue(aValue.c_str());
308
      isAttrStringFound = true;
309
310
    }
311
312
    if ( isAttrStringFound || theSObject->FindAttribute(anAttr, "AttributeString") ) {
313
      SALOMEDS::AttributeString_var aAttComment = SALOMEDS::AttributeString::_narrow(anAttr);
299
      if ( aAttComment ) {
314
      if ( aAttComment ) {
300
	string aValue = aAttComment->Value();
315
	string aValue = aAttComment->Value();
301
	if ( aValue.compare("") ) {
316
	if ( aValue.compare("") ) {
Lines 360-371 Link Here
360
    SALOMEDS::Study_var aStudy = theComponent->GetStudy();
375
    SALOMEDS::Study_var aStudy = theComponent->GetStudy();
361
376
362
    SALOMEDS::ChildIterator_var anIter = aStudy->NewChildIterator(theComponent);
377
    SALOMEDS::ChildIterator_var anIter = aStudy->NewChildIterator(theComponent);
378
    SALOMEDS::StudyBuilder_var  aStudyBuilder = aStudy->NewBuilder();
379
363
    for (anIter->InitEx(true); anIter->More(); anIter->Next()) {
380
    for (anIter->InitEx(true); anIter->More(); anIter->Next()) {
364
      SALOMEDS::SObject_var aSObject = anIter->Value();
381
      SALOMEDS::SObject_var aSObject = anIter->Value();
365
      CorrectSObjectType(aSObject);      
382
      CorrectSObjectType(aSObject, aStudyBuilder);      
366
    }
383
    }
367
384
368
    SALOMEDS::StudyBuilder_var  aStudyBuilder = aStudy->NewBuilder();
385
   
369
    string aDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir();
386
    string aDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir();
370
    TCollection_AsciiString aTmpDir (const_cast<char*>(aDir.c_str()));
387
    TCollection_AsciiString aTmpDir (const_cast<char*>(aDir.c_str()));
371
    VisuTmpDir = aTmpDir.ToCString();
388
    VisuTmpDir = aTmpDir.ToCString();
Lines 593-598 Link Here
593
      myStudyDocument = SALOMEDS::Study::_duplicate(theStudy);
610
      myStudyDocument = SALOMEDS::Study::_duplicate(theStudy);
594
611
595
      ProcessVoidEvent(new TEvent(aStudyName));
612
      ProcessVoidEvent(new TEvent(aStudyName));
613
614
      // Load MED component if necessary
615
      if(!myStudyDocument->FindComponent("MED")->_is_nil())
616
	{
617
	  SALOME_LifeCycleCORBA aLCC(SalomeApp_Application::namingService());
618
	  Engines::Component_var aComponent = aLCC.FindOrLoad_Component("FactoryServer","MED");
619
	  SALOME_MED::MED_Gen_var aMedEngine = SALOME_MED::MED_Gen::_narrow(aComponent);
620
	  
621
	  if(!CORBA::is_nil(aMedEngine))
622
	    {
623
	      SALOMEDS::StudyBuilder_var aStudyBuilder = myStudyDocument->NewBuilder();
624
	      aStudyBuilder->LoadWith( myStudyDocument->FindComponent( "MED" ), aMedEngine );
625
	    }
626
	}
596
    } else {
627
    } else {
597
      INFOS("CORBA::is_nil(theStudy)");
628
      INFOS("CORBA::is_nil(theStudy)");
598
    }
629
    }
Lines 1173-1179 Link Here
1173
      aResultSO = SALOMEDS::SObject::_duplicate(theObject);
1204
      aResultSO = SALOMEDS::SObject::_duplicate(theObject);
1174
1205
1175
    //Just for Result::Restore to find the Comment attribute :(
1206
    //Just for Result::Restore to find the Comment attribute :(
1176
    SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeComment");
1207
    SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeString");
1177
1208
1178
    Storable* aStorable = Storable::Create(aResultSO,aFileName,aString);
1209
    Storable* aStorable = Storable::Create(aResultSO,aFileName,aString);
1179
1210
(-)VISU_SRC_3.2.2/src/VISU_I/VISU_Prs3d_i.cc (-33 / +68 lines)
Lines 91-108 Link Here
91
  }
91
  }
92
}
92
}
93
93
94
struct TRemoveActorsFromRendererEvent: public SALOME_Event
95
{
96
  typedef boost::signal0<void> TRemoveActorsFromRendererSignalType;
97
  const TRemoveActorsFromRendererSignalType& myRemoveActorsFromRendererSignalVar;
98
99
  TRemoveActorsFromRendererEvent
100
  (const TRemoveActorsFromRendererSignalType& theRemoveActorsFromRendererSignalVar):
101
    myRemoveActorsFromRendererSignalVar(theRemoveActorsFromRendererSignalVar)
102
  {}
103
104
  virtual
105
  void
106
  Execute()
107
  {
108
    myRemoveActorsFromRendererSignalVar();
109
  }
110
};
111
94
VISU::Prs3d_i
112
VISU::Prs3d_i
95
::~Prs3d_i() 
113
::~Prs3d_i()
96
{
114
{
97
  if(MYDEBUG) MESSAGE("Prs3d_i::~Prs3d_i - this = "<<this);
115
  if(MYDEBUG) MESSAGE("Prs3d_i::~Prs3d_i - this = "<<this);
98
  myRemoveActorsFromRendererSignal();
116
  ProcessVoidEvent(new TRemoveActorsFromRendererEvent(myRemoveActorsFromRendererSignal));
99
  myPipeLine->Delete();
117
  myPipeLine->Delete();
100
  myResult->Destroy();
118
  myResult->Destroy();
101
}
119
}
102
120
103
121
104
//----------------------------------------------------------------------------
122
//----------------------------------------------------------------------------
105
VISU::Storable* 
123
VISU::Storable*
106
VISU::Prs3d_i
124
VISU::Prs3d_i
107
::Restore(const Storable::TRestoringMap& theMap)
125
::Restore(const Storable::TRestoringMap& theMap)
108
{
126
{
Lines 125-131 Link Here
125
143
126
144
127
//----------------------------------------------------------------------------
145
//----------------------------------------------------------------------------
128
SALOMEDS::SObject_var 
146
SALOMEDS::SObject_var
129
VISU::Prs3d_i
147
VISU::Prs3d_i
130
::GetSObject()
148
::GetSObject()
131
{
149
{
Lines 137-161 Link Here
137
  return mySObject;
155
  return mySObject;
138
}
156
}
139
157
140
Result_i* 
158
Result_i*
141
VISU::Prs3d_i
159
VISU::Prs3d_i
142
::GetResult() const 
160
::GetResult() const
143
{ 
161
{
144
  return myResult;
162
  return myResult;
145
}
163
}
146
164
147
const std::string& 
165
const std::string&
148
VISU::Prs3d_i
166
VISU::Prs3d_i
149
::GetMeshName() const 
167
::GetMeshName() const
150
{ 
168
{
151
  return myMeshName; 
169
  return myMeshName;
152
}
170
}
153
171
154
172
155
//----------------------------------------------------------------------------
173
//----------------------------------------------------------------------------
156
void
174
void
157
VISU::Prs3d_i
175
VISU::Prs3d_i
158
::Update() 
176
::Update()
159
{
177
{
160
  if(MYDEBUG) MESSAGE("Prs3d_i::Update - this = "<<this);
178
  if(MYDEBUG) MESSAGE("Prs3d_i::Update - this = "<<this);
161
  try{
179
  try{
Lines 169-175 Link Here
169
//----------------------------------------------------------------------------
187
//----------------------------------------------------------------------------
170
void
188
void
171
VISU::Prs3d_i
189
VISU::Prs3d_i
172
::CheckDataSet() 
190
::CheckDataSet()
173
{
191
{
174
  vtkMapper *aMapper = myPipeLine->GetMapper();
192
  vtkMapper *aMapper = myPipeLine->GetMapper();
175
  vtkDataSet *aDataSet = aMapper->GetInput();
193
  vtkDataSet *aDataSet = aMapper->GetInput();
Lines 185-191 Link Here
185
203
186
void
204
void
187
VISU::Prs3d_i
205
VISU::Prs3d_i
188
::RemoveFromStudy() 
206
::RemoveFromStudy()
189
{
207
{
190
  struct TRemoveFromStudy: public SALOME_Event
208
  struct TRemoveFromStudy: public SALOME_Event
191
  {
209
  {
Lines 198-204 Link Here
198
      myRemovable(theRemovable),
216
      myRemovable(theRemovable),
199
      myRemoveFromStudySignal(theRemoveFromStudySignal)
217
      myRemoveFromStudySignal(theRemoveFromStudySignal)
200
    {}
218
    {}
201
    
219
202
    virtual
220
    virtual
203
    void
221
    void
204
    Execute()
222
    Execute()
Lines 213-233 Link Here
213
231
214
232
215
//----------------------------------------------------------------------------
233
//----------------------------------------------------------------------------
216
VISU_PipeLine* 
234
VISU_PipeLine*
217
VISU::Prs3d_i
235
VISU::Prs3d_i
218
::GetPipeLine()
236
::GetPipeLine()
219
{
237
{
220
  return GetPL();
238
  return GetPL();
221
}
239
}
222
240
223
VISU_PipeLine* 
241
VISU_PipeLine*
224
VISU::Prs3d_i
242
VISU::Prs3d_i
225
::GetPL()
243
::GetPL()
226
{
244
{
227
  return myPipeLine;
245
  return myPipeLine;
228
}
246
}
229
247
230
vtkUnstructuredGrid* 
248
vtkUnstructuredGrid*
231
VISU::Prs3d_i::
249
VISU::Prs3d_i::
232
GetInput()
250
GetInput()
233
{
251
{
Lines 274-280 Link Here
274
292
275
void
293
void
276
VISU::Prs3d_i
294
VISU::Prs3d_i
277
::RemoveActor(VISU_Actor* theActor) 
295
::RemoveActor(VISU_Actor* theActor)
278
{
296
{
279
  if(MYDEBUG) MESSAGE("Prs3d_i::RemoveActor - this = "<<this<<"; theActor = "<<theActor);
297
  if(MYDEBUG) MESSAGE("Prs3d_i::RemoveActor - this = "<<this<<"; theActor = "<<theActor);
280
  myActorCollection->RemoveItem(theActor);
298
  myActorCollection->RemoveItem(theActor);
Lines 285-297 Link Here
285
::RemoveActors()
303
::RemoveActors()
286
{
304
{
287
  if(MYDEBUG) MESSAGE("Prs3d_i::RemoveActors - this = "<<this);
305
  if(MYDEBUG) MESSAGE("Prs3d_i::RemoveActors - this = "<<this);
288
  myRemoveActorsFromRendererSignal();
306
  ProcessVoidEvent(new TRemoveActorsFromRendererEvent(myRemoveActorsFromRendererSignal));
289
  myActorCollection->RemoveAllItems();
307
  myActorCollection->RemoveAllItems();
290
}
308
}
291
309
292
void
310
void
293
VISU::Prs3d_i
311
VISU::Prs3d_i
294
::UpdateActor(VISU_Actor* theActor) 
312
::UpdateActor(VISU_Actor* theActor)
295
{
313
{
296
  if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActor - this = "<<this<<"; theActor = "<<theActor);
314
  if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActor - this = "<<this<<"; theActor = "<<theActor);
297
  theActor->ShallowCopyPL(myPipeLine);
315
  theActor->ShallowCopyPL(myPipeLine);
Lines 303-312 Link Here
303
VISU::Prs3d_i
321
VISU::Prs3d_i
304
::UpdateActors()
322
::UpdateActors()
305
{
323
{
324
  struct TUpdateActorsEvent: public SALOME_Event
325
  {
326
    typedef boost::signal0<void> TUpdateActorsSignalType;
327
    const TUpdateActorsSignalType& myUpdateActorsSignalVar;
328
329
    TUpdateActorsEvent(const TUpdateActorsSignalType& theUpdateActorsSignalVar):
330
      myUpdateActorsSignalVar(theUpdateActorsSignalVar)
331
    {}
332
333
    virtual
334
    void
335
    Execute()
336
    {
337
      myUpdateActorsSignalVar();
338
    }
339
  };
340
306
  if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActors - this = "<<this);
341
  if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActors - this = "<<this);
307
  Update();
342
  Update();
308
  CheckDataSet();
343
  CheckDataSet();
309
  myUpdateActorsSignal();
344
  ProcessVoidEvent(new TUpdateActorsEvent(myUpdateActorsSignal));
310
}
345
}
311
346
312
347
Lines 333-339 Link Here
333
  return myPipeLine->GetNumberOfClippingPlanes();
368
  return myPipeLine->GetNumberOfClippingPlanes();
334
}
369
}
335
370
336
vtkPlane* 
371
vtkPlane*
337
VISU::Prs3d_i::
372
VISU::Prs3d_i::
338
GetClippingPlane(vtkIdType theID) const
373
GetClippingPlane(vtkIdType theID) const
339
{
374
{
Lines 342-350 Link Here
342
377
343
void
378
void
344
VISU::Prs3d_i
379
VISU::Prs3d_i
345
::SetPlaneParam (vtkFloatingPointType theDir[3], 
380
::SetPlaneParam (vtkFloatingPointType theDir[3],
346
		 vtkFloatingPointType theDist, 
381
		 vtkFloatingPointType theDist,
347
		 vtkPlane* thePlane) 
382
		 vtkPlane* thePlane)
348
{
383
{
349
  myPipeLine->SetPlaneParam(theDir, theDist, thePlane);
384
  myPipeLine->SetPlaneParam(theDir, theDist, thePlane);
350
}
385
}
Lines 358-364 Link Here
358
  myPipeLine->GetMapper()->GetBounds(aBounds);
393
  myPipeLine->GetMapper()->GetBounds(aBounds);
359
}
394
}
360
395
361
void 
396
void
362
VISU::Prs3d_i
397
VISU::Prs3d_i
363
::SetOffset(const CORBA::Float* theOffsets)
398
::SetOffset(const CORBA::Float* theOffsets)
364
{
399
{
Lines 369-376 Link Here
369
404
370
void
405
void
371
VISU::Prs3d_i
406
VISU::Prs3d_i
372
::SetOffset(CORBA::Float theDx, 
407
::SetOffset(CORBA::Float theDx,
373
	    CORBA::Float theDy, 
408
	    CORBA::Float theDy,
374
	    CORBA::Float theDz)
409
	    CORBA::Float theDz)
375
{
410
{
376
  myOffset[0] = theDx;
411
  myOffset[0] = theDx;
Lines 387-396 Link Here
387
  theOffsets[2] = myOffset[2];
422
  theOffsets[2] = myOffset[2];
388
}
423
}
389
424
390
void 
425
void
391
VISU::Prs3d_i
426
VISU::Prs3d_i
392
::GetOffset(CORBA::Float& theDx, 
427
::GetOffset(CORBA::Float& theDx,
393
	    CORBA::Float& theDy, 
428
	    CORBA::Float& theDy,
394
	    CORBA::Float& theDz)
429
	    CORBA::Float& theDz)
395
{
430
{
396
  theDx = myOffset[0];
431
  theDx = myOffset[0];
Lines 400-406 Link Here
400
435
401
436
402
//----------------------------------------------------------------------------
437
//----------------------------------------------------------------------------
403
VISU::Result_i* 
438
VISU::Result_i*
404
VISU::GetResult(SALOMEDS::SObject_ptr theSObject)
439
VISU::GetResult(SALOMEDS::SObject_ptr theSObject)
405
{
440
{
406
  VISU::Result_var aResult = FindResult(theSObject);
441
  VISU::Result_var aResult = FindResult(theSObject);
(-)VISU_SRC_3.2.2/src/VISU_I/VISU_Result_i.cc (-7 / +7 lines)
Lines 247-254 Link Here
247
      aName->SetValue(theName);
247
      aName->SetValue(theName);
248
    }
248
    }
249
    if (theComment != "") {
249
    if (theComment != "") {
250
      anAttr = aStudyBuilder->FindOrCreateAttribute(aNewObj, "AttributeComment");
250
      anAttr = aStudyBuilder->FindOrCreateAttribute(aNewObj, "AttributeString");
251
      _PTR(AttributeComment) aCmnt (anAttr);
251
      _PTR(AttributeString) aCmnt (anAttr);
252
      aCmnt->SetValue(theComment);
252
      aCmnt->SetValue(theComment);
253
    }
253
    }
254
    return aNewObj->GetID();
254
    return aNewObj->GetID();
Lines 281-288 Link Here
281
      aName->SetValue(theName);
281
      aName->SetValue(theName);
282
    }
282
    }
283
    if (theComment != "") {
283
    if (theComment != "") {
284
      anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeComment");
284
      anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeString");
285
      _PTR(AttributeComment) aCmnt (anAttr);
285
      _PTR(AttributeString) aCmnt (anAttr);
286
      aCmnt->SetValue(theComment);
286
      aCmnt->SetValue(theComment);
287
    }
287
    }
288
  }
288
  }
Lines 1365-1373 Link Here
1365
		       GetComment(), VISU::TRESULT, myFileInfo.filePath().latin1(),
1365
		       GetComment(), VISU::TRESULT, myFileInfo.filePath().latin1(),
1366
		       myInitFileName.c_str()); // Restoring of Python dump
1366
		       myInitFileName.c_str()); // Restoring of Python dump
1367
      SALOMEDS::GenericAttribute_var anAttr;
1367
      SALOMEDS::GenericAttribute_var anAttr;
1368
      if (!theSObject->FindAttribute(anAttr, "AttributeComment"))
1368
      if (!theSObject->FindAttribute(anAttr, "AttributeString"))
1369
	throw std::runtime_error("Build - There is no AttributeComment for the SObject !!!");
1369
	throw std::runtime_error("Build - There is no AttributeString for the SObject !!!");
1370
      SALOMEDS::AttributeComment_var aCmnt = SALOMEDS::AttributeComment::_narrow(anAttr);
1370
      SALOMEDS::AttributeString_var aCmnt = SALOMEDS::AttributeString::_narrow(anAttr);
1371
      aCmnt->SetValue(aComment.latin1());
1371
      aCmnt->SetValue(aComment.latin1());
1372
    }
1372
    }
1373
    bool anIsBuildAll = VISU::GetResourceMgr()->booleanValue("VISU", "full_med_loading", false);
1373
    bool anIsBuildAll = VISU::GetResourceMgr()->booleanValue("VISU", "full_med_loading", false);
(-)VISU_SRC_3.2.2/src/VISU_I/VISU_Table_i.cc (-5 / +5 lines)
Lines 180-188 Link Here
180
	else{
180
	else{
181
	  aComment.sprintf("myComment=%s;myType=%d;mySourceId=TableAttr",GetComment(),VISU::TTABLE);
181
	  aComment.sprintf("myComment=%s;myType=%d;mySourceId=TableAttr",GetComment(),VISU::TTABLE);
182
	  SALOMEDS::SObject_var aFatherSObject = SO->GetFather();
182
	  SALOMEDS::SObject_var aFatherSObject = SO->GetFather();
183
	  if(aFatherSObject->FindAttribute(anAttr,"AttributeComment")){
183
	  if(aFatherSObject->FindAttribute(anAttr,"AttributeString")){
184
	    SALOMEDS::AttributeComment_var aCommentAttr =
184
	    SALOMEDS::AttributeString_var aCommentAttr =
185
	      SALOMEDS::AttributeComment::_narrow(anAttr);
185
	      SALOMEDS::AttributeString::_narrow(anAttr);
186
	    CORBA::String_var aValue = aCommentAttr->Value();
186
	    CORBA::String_var aValue = aCommentAttr->Value();
187
	    Storable::TRestoringMap aMap;
187
	    Storable::TRestoringMap aMap;
188
	    Storable::StrToMap(aValue.in(),aMap);
188
	    Storable::StrToMap(aValue.in(),aMap);
Lines 1248-1255 Link Here
1248
  SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
1248
  SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
1249
  QFileInfo aFileInfo(theFileName);
1249
  QFileInfo aFileInfo(theFileName);
1250
  aName->SetValue(aFileInfo.fileName().latin1());
1250
  aName->SetValue(aFileInfo.fileName().latin1());
1251
  anAttr = aStudyBuilder->FindOrCreateAttribute(aFileObject, "AttributeComment");
1251
  anAttr = aStudyBuilder->FindOrCreateAttribute(aFileObject, "AttributeString");
1252
  SALOMEDS::AttributeComment_var aComment = SALOMEDS::AttributeComment::_narrow(anAttr);
1252
  SALOMEDS::AttributeString_var aComment = SALOMEDS::AttributeString::_narrow(anAttr);
1253
  QString aString;
1253
  QString aString;
1254
  aString.sprintf("myComment=ImportTables;myFileName=%s",
1254
  aString.sprintf("myComment=ImportTables;myFileName=%s",
1255
		  aFileInfo.absFilePath().latin1());
1255
		  aFileInfo.absFilePath().latin1());
(-)VISU_SRC_3.2.2/src/VISU_I/VISU_TimeAnimation.cxx (-51 / +175 lines)
Lines 55-61 Link Here
55
#include "SUIT_Session.h"
55
#include "SUIT_Session.h"
56
#include "SUIT_Study.h"
56
#include "SUIT_Study.h"
57
57
58
#include "SALOMEDSClient_AttributeComment.hxx"
58
#include "SALOMEDSClient_AttributeString.hxx"
59
#include "SALOMEDSClient_AttributeName.hxx"
59
#include "SALOMEDSClient_AttributeName.hxx"
60
60
61
#include <qpixmap.h>
61
#include <qpixmap.h>
Lines 102-107 Link Here
102
  myTimeMax = 0;
102
  myTimeMax = 0;
103
  myLastError = "";
103
  myLastError = "";
104
  myCycling = false;
104
  myCycling = false;
105
  myCleaningMemoryAtEachFrame = false;
105
106
106
  myAnimEntry = "";
107
  myAnimEntry = "";
107
108
Lines 202-208 Link Here
202
  myView->update();
203
  myView->update();
203
}
204
}
204
205
205
206
namespace
206
namespace
207
{
207
{
208
  //------------------------------------------------------------------------
208
  //------------------------------------------------------------------------
Lines 406-412 Link Here
406
406
407
407
408
//------------------------------------------------------------------------
408
//------------------------------------------------------------------------
409
CORBA::Boolean VISU_TimeAnimation::generateFrames() {
409
CORBA::Boolean VISU_TimeAnimation::_generateFrames() {
410
  if (!myView) {
410
  if (!myView) {
411
    MESSAGE("Viewer is not defined for animation");
411
    MESSAGE("Viewer is not defined for animation");
412
    return false;
412
    return false;
Lines 445-451 Link Here
445
}
445
}
446
446
447
//------------------------------------------------------------------------
447
//------------------------------------------------------------------------
448
void VISU_TimeAnimation::clearView() {
448
CORBA::Boolean VISU_TimeAnimation::generateFrames()
449
{
450
  return ProcessEvent(new TMemFunEvent<VISU_TimeAnimation,bool>
451
                      (this,&VISU_TimeAnimation::_generateFrames));
452
}
453
454
//------------------------------------------------------------------------
455
void VISU_TimeAnimation::_clearView() {
449
  if (!myView) {
456
  if (!myView) {
450
    MESSAGE("Viewer is not defined for animation");
457
    MESSAGE("Viewer is not defined for animation");
451
    return;
458
    return;
Lines 466-477 Link Here
466
}
473
}
467
474
468
//------------------------------------------------------------------------
475
//------------------------------------------------------------------------
469
void VISU_TimeAnimation::stopAnimation() {
476
void VISU_TimeAnimation::clearView()
477
{
478
  ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>
479
                   (this,&VISU_TimeAnimation::_clearView));
480
}
481
482
//------------------------------------------------------------------------
483
void VISU_TimeAnimation::visibilityOff(int num_field, int num_frame) {
484
  FieldData& aData = myFieldsLst[num_field];
485
  VISU_Actor* aActor = aData.myActors[num_frame];
486
  if (! myCleaningMemoryAtEachFrame) {
487
    //
488
    // Usual behaviour : VisibilityOff()
489
    // Problem : It don't clean the memory so if there is
490
    //           a lot of frames, the memory grows dramatically
491
    //
492
    aActor->VisibilityOff();
493
  } else {
494
    //
495
    // myCleaningMemoryAtEachFrame behaviour:
496
    // Delete the actor and re-creation it with VisibilityOff()
497
    // since it takes memory only at VisibilityOn()
498
    //
499
    // Delete the actor
500
    aActor->RemoveFromRender(myView->getRenderer());
501
    //aActor->Delete();
502
    // Re-create the actor
503
    aActor = aData.myPrs[num_frame]->CreateActor();
504
    myView->AddActor(aActor);
505
    aActor->VisibilityOff();
506
    aData.myActors[num_frame] = aActor;
507
  }
508
}
509
510
//------------------------------------------------------------------------
511
void VISU_TimeAnimation::_stopAnimation() {
470
  myIsActive = false;
512
  myIsActive = false;
471
}
513
}
472
514
473
//------------------------------------------------------------------------
515
//------------------------------------------------------------------------
474
void VISU_TimeAnimation::startAnimation() {
516
void VISU_TimeAnimation::stopAnimation()
517
{
518
  ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>
519
                   (this,&VISU_TimeAnimation::_stopAnimation));
520
}
521
522
//------------------------------------------------------------------------
523
void VISU_TimeAnimation::_startAnimation() {
475
  if (!myIsActive) {
524
  if (!myIsActive) {
476
    myIsActive = true;
525
    myIsActive = true;
477
    QThread::start();
526
    QThread::start();
Lines 479-485 Link Here
479
}
528
}
480
529
481
//------------------------------------------------------------------------
530
//------------------------------------------------------------------------
482
void VISU_TimeAnimation::nextFrame() {
531
void VISU_TimeAnimation::startAnimation()
532
{
533
  ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>
534
                   (this,&VISU_TimeAnimation::_startAnimation));
535
}
536
537
538
//------------------------------------------------------------------------
539
void VISU_TimeAnimation::_nextFrame() {
483
  if (!myView) {
540
  if (!myView) {
484
    MESSAGE("Viewer is not defined for animation");
541
    MESSAGE("Viewer is not defined for animation");
485
    return;
542
    return;
Lines 489-495 Link Here
489
    int i;
546
    int i;
490
    for (i = 0; i < getNbFields(); i++)
547
    for (i = 0; i < getNbFields(); i++)
491
      if (myFieldsLst[i].myActors[myFrame] != 0)
548
      if (myFieldsLst[i].myActors[myFrame] != 0)
492
	myFieldsLst[i].myActors[myFrame]->VisibilityOff();
549
	//myFieldsLst[i].myActors[myFrame]->VisibilityOff();
550
    	visibilityOff(i, myFrame);
493
551
494
    myFrame++;
552
    myFrame++;
495
    for (i = 0; i < getNbFields(); i++)
553
    for (i = 0; i < getNbFields(); i++)
Lines 502-508 Link Here
502
}
560
}
503
561
504
//------------------------------------------------------------------------
562
//------------------------------------------------------------------------
505
void VISU_TimeAnimation::prevFrame() {
563
void VISU_TimeAnimation::nextFrame()
564
{
565
  ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>
566
                   (this,&VISU_TimeAnimation::_nextFrame));
567
}
568
569
//------------------------------------------------------------------------
570
void VISU_TimeAnimation::_prevFrame() {
506
  if (!myView) {
571
  if (!myView) {
507
    MESSAGE("Viewer is not defined for animation");
572
    MESSAGE("Viewer is not defined for animation");
508
    return;
573
    return;
Lines 512-518 Link Here
512
    int i;
577
    int i;
513
    for (i = 0; i < getNbFields(); i++)
578
    for (i = 0; i < getNbFields(); i++)
514
      if (myFieldsLst[i].myActors[myFrame] != 0)
579
      if (myFieldsLst[i].myActors[myFrame] != 0)
515
	myFieldsLst[i].myActors[myFrame]->VisibilityOff();
580
	//myFieldsLst[i].myActors[myFrame]->VisibilityOff();
581
	visibilityOff(i, myFrame);
516
582
517
    myFrame--;
583
    myFrame--;
518
    for (i = 0; i < getNbFields(); i++)
584
    for (i = 0; i < getNbFields(); i++)
Lines 525-531 Link Here
525
}
591
}
526
592
527
//------------------------------------------------------------------------
593
//------------------------------------------------------------------------
528
void VISU_TimeAnimation::firstFrame() {
594
void VISU_TimeAnimation::prevFrame()
595
{
596
  ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>
597
                   (this,&VISU_TimeAnimation::_prevFrame));
598
}
599
600
//------------------------------------------------------------------------
601
void VISU_TimeAnimation::_firstFrame() {
529
  if (!myView) {
602
  if (!myView) {
530
    MESSAGE("Viewer is not defined for animation");
603
    MESSAGE("Viewer is not defined for animation");
531
    return;
604
    return;
Lines 535-541 Link Here
535
  for (i = 0; i < getNbFields(); i++)
608
  for (i = 0; i < getNbFields(); i++)
536
    if(!myFieldsLst[i].myActors.empty())
609
    if(!myFieldsLst[i].myActors.empty())
537
      if (myFieldsLst[i].myActors[myFrame] != 0)
610
      if (myFieldsLst[i].myActors[myFrame] != 0)
538
	myFieldsLst[i].myActors[myFrame]->VisibilityOff();
611
	//myFieldsLst[i].myActors[myFrame]->VisibilityOff();
612
	visibilityOff(i, myFrame);
539
  myFrame = 0;
613
  myFrame = 0;
540
  for (i = 0; i < getNbFields(); i++)
614
  for (i = 0; i < getNbFields(); i++)
541
    if(!myFieldsLst[i].myActors.empty())
615
    if(!myFieldsLst[i].myActors.empty())
Lines 548-554 Link Here
548
}
622
}
549
623
550
//------------------------------------------------------------------------
624
//------------------------------------------------------------------------
551
void VISU_TimeAnimation::lastFrame() {
625
void VISU_TimeAnimation::firstFrame()
626
{
627
  ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>
628
                   (this,&VISU_TimeAnimation::_firstFrame));
629
}
630
631
//------------------------------------------------------------------------
632
void VISU_TimeAnimation::_lastFrame() {
552
  if (!myView) {
633
  if (!myView) {
553
    MESSAGE("Viewer is not defined for animation");
634
    MESSAGE("Viewer is not defined for animation");
554
    return;
635
    return;
Lines 557-563 Link Here
557
  int i;
638
  int i;
558
  for (i = 0; i < getNbFields(); i++)
639
  for (i = 0; i < getNbFields(); i++)
559
   if (myFieldsLst[i].myActors[myFrame] != 0)
640
   if (myFieldsLst[i].myActors[myFrame] != 0)
560
      myFieldsLst[i].myActors[myFrame]->VisibilityOff();
641
     //myFieldsLst[i].myActors[myFrame]->VisibilityOff();
642
     visibilityOff(i, myFrame);
561
643
562
  myFrame = myFieldsLst[0].myNbFrames-1;
644
  myFrame = myFieldsLst[0].myNbFrames-1;
563
  for (i = 0; i < getNbFields(); i++)
645
  for (i = 0; i < getNbFields(); i++)
Lines 568-577 Link Here
568
  myView->Repaint();
650
  myView->Repaint();
569
}
651
}
570
652
653
//------------------------------------------------------------------------
654
void VISU_TimeAnimation::lastFrame()
655
{
656
  ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>
657
                   (this,&VISU_TimeAnimation::_lastFrame));
658
}
659
571
660
572
//------------------------------------------------------------------------
661
//------------------------------------------------------------------------
573
// For Batchmode using
662
// For Batchmode using
574
void VISU_TimeAnimation::gotoFrame(CORBA::Long theFrame) {
663
void VISU_TimeAnimation::_gotoFrame(CORBA::Long theFrame) {
575
  if (!myView) {
664
  if (!myView) {
576
    MESSAGE("Viewer is not defined for animation");
665
    MESSAGE("Viewer is not defined for animation");
577
    return;
666
    return;
Lines 579-590 Link Here
579
  if ((theFrame < 0) || (theFrame > (getNbFrames()-1)))
668
  if ((theFrame < 0) || (theFrame > (getNbFrames()-1)))
580
    return;
669
    return;
581
  stopAnimation();
670
  stopAnimation();
582
  qApp->lock();
671
  //qApp->lock();
583
  qApp->syncX();
672
  //qApp->syncX();
584
  int i;
673
  int i;
585
  for (i = 0; i < getNbFields(); i++)
674
  for (i = 0; i < getNbFields(); i++)
586
    if (myFieldsLst[i].myActors[myFrame] != 0)
675
    if (myFieldsLst[i].myActors[myFrame] != 0)
587
      myFieldsLst[i].myActors[myFrame]->VisibilityOff();
676
      //myFieldsLst[i].myActors[myFrame]->VisibilityOff();
677
      visibilityOff(i, myFrame);
588
678
589
  myFrame = theFrame;
679
  myFrame = theFrame;
590
  for (i = 0; i < getNbFields(); i++)
680
  for (i = 0; i < getNbFields(); i++)
Lines 593-601 Link Here
593
683
594
  emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
684
  emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
595
  myView->Repaint();
685
  myView->Repaint();
596
  qApp->flushX();
686
  //qApp->flushX();
597
  qApp->processEvents(3);
687
  //qApp->processEvents(3);
598
  qApp->unlock();
688
  //qApp->unlock();
689
}
690
691
//------------------------------------------------------------------------
692
void VISU_TimeAnimation::gotoFrame(CORBA::Long theFrame)
693
{
694
  ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_TimeAnimation,CORBA::Long>
695
                   (this,&VISU_TimeAnimation::_gotoFrame,theFrame));
599
}
696
}
600
697
601
698
Lines 640-649 Link Here
640
      FieldData& aData = myFieldsLst[i];
737
      FieldData& aData = myFieldsLst[i];
641
      if (myFrame > 0) {
738
      if (myFrame > 0) {
642
	if (aData.myActors[myFrame-1] != 0)
739
	if (aData.myActors[myFrame-1] != 0)
643
	  aData.myActors[myFrame-1]->VisibilityOff();
740
	  //aData.myActors[myFrame-1]->VisibilityOff();
741
	  visibilityOff(i, myFrame-1);
644
      } else {
742
      } else {
645
	if (aData.myActors[aData.myNbFrames-1] != 0)
743
	if (aData.myActors[aData.myNbFrames-1] != 0)
646
	  aData.myActors[aData.myNbFrames-1]->VisibilityOff();
744
	  //aData.myActors[aData.myNbFrames-1]->VisibilityOff();
745
	  visibilityOff(i, aData.myNbFrames-1);
647
      }
746
      }
648
      if (aData.myActors[myFrame] != 0) {
747
      if (aData.myActors[myFrame] != 0) {
649
	aData.myActors[myFrame]->VisibilityOn();
748
	aData.myActors[myFrame]->VisibilityOn();
Lines 675-686 Link Here
675
    }
774
    }
676
    qApp->unlock();
775
    qApp->unlock();
677
    msleep(delay);
776
    msleep(delay);
777
    if (!myIsActive) {
778
      emit stopped();
779
      return;
780
    }
678
    qApp->lock();
781
    qApp->lock();
679
782
680
    if (isDumping) {
783
    if (isDumping) {
681
      // We must unlock mutex for some time before grabbing to allow view updating
784
      // We must unlock mutex for some time before grabbing to allow view updating
682
      qApp->unlock();
785
      qApp->unlock();
683
      msleep(delay);
786
      msleep(delay);
787
      if (!myIsActive) { // this check was taken from WP_DEB branch
788
	emit stopped();
789
	return;
790
      }
684
      qApp->lock();
791
      qApp->lock();
685
      if(!(myFieldsLst[0].myField)) // break, if field was deleted.
792
      if(!(myFieldsLst[0].myField)) // break, if field was deleted.
686
	break;
793
	break;
Lines 823-830 Link Here
823
  VISU::Storable::TRestoringMap aMap;
930
  VISU::Storable::TRestoringMap aMap;
824
  if (theSObject) {
931
  if (theSObject) {
825
    _PTR(GenericAttribute) anAttr;
932
    _PTR(GenericAttribute) anAttr;
826
    if (theSObject->FindAttribute(anAttr, "AttributeComment")) {
933
    if (theSObject->FindAttribute(anAttr, "AttributeString")) {
827
      _PTR(AttributeComment) aComment (anAttr);
934
      _PTR(AttributeString) aComment (anAttr);
828
      std::string aString = aComment->Value();
935
      std::string aString = aComment->Value();
829
      QString strIn (aString.c_str());
936
      QString strIn (aString.c_str());
830
      VISU::Storable::StrToMap(strIn, aMap);
937
      VISU::Storable::StrToMap(strIn, aMap);
Lines 990-997 Link Here
990
                   VISU::TANIMATION,myTimeMinVal,myTimeMaxVal);
1097
                   VISU::TANIMATION,myTimeMinVal,myTimeMaxVal);
991
1098
992
  _PTR(GenericAttribute) anAttr;
1099
  _PTR(GenericAttribute) anAttr;
993
  anAttr = aStudyBuilder->FindOrCreateAttribute(aAnimSObject, "AttributeComment");
1100
  anAttr = aStudyBuilder->FindOrCreateAttribute(aAnimSObject, "AttributeString");
994
  _PTR(AttributeComment) aCmnt (anAttr);
1101
  _PTR(AttributeString) aCmnt (anAttr);
995
  aCmnt->SetValue(aComment.latin1());
1102
  aCmnt->SetValue(aComment.latin1());
996
1103
997
  _PTR(ChildIterator) anIter = myStudy->NewChildIterator(aAnimSObject);
1104
  _PTR(ChildIterator) anIter = myStudy->NewChildIterator(aAnimSObject);
Lines 1016-1023 Link Here
1016
1123
1017
    if (anPrsIter->More()) {
1124
    if (anPrsIter->More()) {
1018
      _PTR(SObject) aPrsObj = anPrsIter->Value();
1125
      _PTR(SObject) aPrsObj = anPrsIter->Value();
1019
      anAttr = aStudyBuilder->FindOrCreateAttribute(aPrsObj, "AttributeComment");
1126
      anAttr = aStudyBuilder->FindOrCreateAttribute(aPrsObj, "AttributeString");
1020
      aCmnt = _PTR(AttributeComment)(anAttr);
1127
      aCmnt = _PTR(AttributeString)(anAttr);
1021
      aCmnt->SetValue(aPrsComment.c_str());
1128
      aCmnt->SetValue(aPrsComment.c_str());
1022
1129
1023
      anAttr = aStudyBuilder->FindOrCreateAttribute(aPrsObj, "AttributeName");
1130
      anAttr = aStudyBuilder->FindOrCreateAttribute(aPrsObj, "AttributeName");
Lines 1045-1053 Link Here
1045
1152
1046
  VISU::Storable::TRestoringMap aMap;
1153
  VISU::Storable::TRestoringMap aMap;
1047
  _PTR(GenericAttribute) anAttr;
1154
  _PTR(GenericAttribute) anAttr;
1048
  if (!aAnimSObject->FindAttribute(anAttr, "AttributeComment")) return;
1155
  if (!aAnimSObject->FindAttribute(anAttr, "AttributeString")) return;
1049
1156
1050
  _PTR(AttributeComment) aComment (anAttr);
1157
  _PTR(AttributeString) aComment (anAttr);
1051
  string aComm = aComment->Value();
1158
  string aComm = aComment->Value();
1052
  QString strIn (aComm.c_str());
1159
  QString strIn (aComm.c_str());
1053
  VISU::Storable::StrToMap(strIn,aMap);
1160
  VISU::Storable::StrToMap(strIn,aMap);
Lines 1098-1105 Link Here
1098
      continue;
1205
      continue;
1099
    generatePresentations(getNbFields()-1);
1206
    generatePresentations(getNbFields()-1);
1100
1207
1101
    if (!aPrsObj->FindAttribute(anAttr, "AttributeComment")) continue;
1208
    if (!aPrsObj->FindAttribute(anAttr, "AttributeString")) continue;
1102
    _PTR(AttributeComment) aPrsComment (anAttr);
1209
    _PTR(AttributeString) aPrsComment (anAttr);
1103
    string aPrsComm = aPrsComment->Value();
1210
    string aPrsComm = aPrsComment->Value();
1104
    if (aPrsComm.length() > 0) {
1211
    if (aPrsComm.length() > 0) {
1105
      QString strPrsIn (aPrsComm.c_str());
1212
      QString strPrsIn (aPrsComm.c_str());
Lines 1183-1190 Link Here
1183
1290
1184
CORBA::Boolean VISU_TimeAnimation_i::generateFrames()
1291
CORBA::Boolean VISU_TimeAnimation_i::generateFrames()
1185
{
1292
{
1186
  return ProcessEvent(new TMemFunEvent<VISU_TimeAnimation,bool>
1293
  //return ProcessEvent(new TMemFunEvent<VISU_TimeAnimation,bool>
1187
                      (myAnim,&VISU_TimeAnimation::generateFrames));
1294
  //                    (myAnim,&VISU_TimeAnimation::generateFrames));
1295
  return myAnim->generateFrames();
1188
}
1296
}
1189
1297
1190
void VISU_TimeAnimation_i::generatePresentations (CORBA::Long theFieldNum)
1298
void VISU_TimeAnimation_i::generatePresentations (CORBA::Long theFieldNum)
Lines 1194-1243 Link Here
1194
1302
1195
void VISU_TimeAnimation_i::clearView()
1303
void VISU_TimeAnimation_i::clearView()
1196
{
1304
{
1197
  ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>
1305
  //ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>
1198
                   (myAnim,&VISU_TimeAnimation::clearView));
1306
  //                 (myAnim,&VISU_TimeAnimation::clearView));
1307
  myAnim->clearView();
1199
}
1308
}
1200
1309
1201
void VISU_TimeAnimation_i::stopAnimation()
1310
void VISU_TimeAnimation_i::stopAnimation()
1202
{
1311
{
1203
  ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>
1312
  //ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>
1204
                   (myAnim,&VISU_TimeAnimation::stopAnimation));
1313
  //                 (myAnim,&VISU_TimeAnimation::stopAnimation));
1314
  myAnim->stopAnimation();
1205
}
1315
}
1206
1316
1207
void VISU_TimeAnimation_i::startAnimation()
1317
void VISU_TimeAnimation_i::startAnimation()
1208
{
1318
{
1209
  ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>
1319
  //ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>
1210
                   (myAnim,&VISU_TimeAnimation::startAnimation));
1320
  //                 (myAnim,&VISU_TimeAnimation::startAnimation));
1321
  myAnim->startAnimation();
1211
}
1322
}
1212
1323
1213
void VISU_TimeAnimation_i::nextFrame()
1324
void VISU_TimeAnimation_i::nextFrame()
1214
{
1325
{
1215
  ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>
1326
  //ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>
1216
                   (myAnim,&VISU_TimeAnimation::nextFrame));
1327
  //                 (myAnim,&VISU_TimeAnimation::nextFrame));
1328
  myAnim->nextFrame();
1217
}
1329
}
1218
1330
1219
void VISU_TimeAnimation_i::prevFrame()
1331
void VISU_TimeAnimation_i::prevFrame()
1220
{
1332
{
1221
  ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>
1333
  //ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>
1222
                   (myAnim,&VISU_TimeAnimation::prevFrame));
1334
  //                 (myAnim,&VISU_TimeAnimation::prevFrame));
1335
  myAnim->prevFrame();
1223
}
1336
}
1224
1337
1225
void VISU_TimeAnimation_i::firstFrame()
1338
void VISU_TimeAnimation_i::firstFrame()
1226
{
1339
{
1227
  ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>
1340
  //ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>
1228
                   (myAnim,&VISU_TimeAnimation::firstFrame));
1341
  //                 (myAnim,&VISU_TimeAnimation::firstFrame));
1342
  myAnim->firstFrame();
1229
}
1343
}
1230
1344
1231
void VISU_TimeAnimation_i::lastFrame()
1345
void VISU_TimeAnimation_i::lastFrame()
1232
{
1346
{
1233
  ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>
1347
  //ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>
1234
                   (myAnim,&VISU_TimeAnimation::lastFrame));
1348
  //                 (myAnim,&VISU_TimeAnimation::lastFrame));
1349
  myAnim->lastFrame();
1235
}
1350
}
1236
1351
1237
void VISU_TimeAnimation_i::gotoFrame(CORBA::Long theFrame)
1352
void VISU_TimeAnimation_i::gotoFrame(CORBA::Long theFrame)
1238
{
1353
{
1239
  ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_TimeAnimation,CORBA::Long>
1354
  //ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_TimeAnimation,CORBA::Long>
1240
                   (myAnim,&VISU_TimeAnimation::gotoFrame,theFrame));
1355
  //                 (myAnim,&VISU_TimeAnimation::gotoFrame,theFrame));
1356
  myAnim->gotoFrame(theFrame);
1241
}
1357
}
1242
1358
1243
CORBA::Long VISU_TimeAnimation_i::getNbFields()
1359
CORBA::Long VISU_TimeAnimation_i::getNbFields()
Lines 1329-1334 Link Here
1329
  return myAnim->isCycling();
1445
  return myAnim->isCycling();
1330
}
1446
}
1331
1447
1448
CORBA::Boolean VISU_TimeAnimation_i::isCleaningMemoryAtEachFrame(){
1449
  return myAnim->isCleaningMemoryAtEachFrame();
1450
}
1451
1332
CORBA::Double VISU_TimeAnimation_i::getMinTime()
1452
CORBA::Double VISU_TimeAnimation_i::getMinTime()
1333
{
1453
{
1334
  return myAnim->getMinTime();
1454
  return myAnim->getMinTime();
Lines 1349-1354 Link Here
1349
  myAnim->setCycling(theCycle);
1469
  myAnim->setCycling(theCycle);
1350
}
1470
}
1351
1471
1472
void VISU_TimeAnimation_i::setCleaningMemoryAtEachFrame(CORBA::Boolean theCycle){
1473
  myAnim->setCleaningMemoryAtEachFrame(theCycle);
1474
}
1475
1352
SALOMEDS::SObject_ptr VISU_TimeAnimation_i::publishInStudy()
1476
SALOMEDS::SObject_ptr VISU_TimeAnimation_i::publishInStudy()
1353
{
1477
{
1354
  return myAnim->publishInStudy();
1478
  return myAnim->publishInStudy();
(-)VISU_SRC_3.2.2/src/VISU_I/VISU_TimeAnimation.h (+20 lines)
Lines 57-62 Link Here
57
class VISU_TimeAnimation: public QObject, public QThread
57
class VISU_TimeAnimation: public QObject, public QThread
58
{
58
{
59
  Q_OBJECT;
59
  Q_OBJECT;
60
61
 private:
62
  // PAL8166
63
  CORBA::Boolean _generateFrames();
64
  void _clearView();
65
  void _stopAnimation();
66
  void _startAnimation();
67
  void _nextFrame();
68
  void _prevFrame();
69
  void _firstFrame();
70
  void _lastFrame();
71
  void _gotoFrame(CORBA::Long theFrame);
72
60
 public:
73
 public:
61
  //static VISU::Result_i* createPresent (SALOMEDS::SObject_var theField);
74
  //static VISU::Result_i* createPresent (SALOMEDS::SObject_var theField);
62
  //static VISU::Storable::TRestoringMap getMapOfValue (SALOMEDS::SObject_var theSObject);
75
  //static VISU::Storable::TRestoringMap getMapOfValue (SALOMEDS::SObject_var theSObject);
Lines 84-89 Link Here
84
  void clearData(FieldData& theData);
97
  void clearData(FieldData& theData);
85
  void clearFieldData() { myFieldsLst.clear();};
98
  void clearFieldData() { myFieldsLst.clear();};
86
99
100
  void visibilityOff(int num_field, int num_frame);
87
  void stopAnimation();
101
  void stopAnimation();
88
  void startAnimation();
102
  void startAnimation();
89
  void nextFrame();
103
  void nextFrame();
Lines 123-134 Link Here
123
  QString getLastErrorMsg() { return myLastError; }
137
  QString getLastErrorMsg() { return myLastError; }
124
138
125
  CORBA::Boolean isCycling() { return myCycling; }
139
  CORBA::Boolean isCycling() { return myCycling; }
140
  CORBA::Boolean isCleaningMemoryAtEachFrame() { return myCleaningMemoryAtEachFrame; }
126
141
127
  CORBA::Double getMinTime() { return myTimeMin;}
142
  CORBA::Double getMinTime() { return myTimeMin;}
128
  CORBA::Double getMaxTime() { return myTimeMax;}
143
  CORBA::Double getMaxTime() { return myTimeMax;}
129
144
130
  void setProportional(CORBA::Boolean theProp) { myProportional = theProp; }
145
  void setProportional(CORBA::Boolean theProp) { myProportional = theProp; }
131
  void setCycling(CORBA::Boolean theCycle) { myCycling = theCycle; }
146
  void setCycling(CORBA::Boolean theCycle) { myCycling = theCycle; }
147
  void setCleaningMemoryAtEachFrame(CORBA::Boolean theCycle) { myCleaningMemoryAtEachFrame = theCycle; }
132
148
133
  SALOMEDS::SObject_ptr publishInStudy();
149
  SALOMEDS::SObject_ptr publishInStudy();
134
  void restoreFromStudy(SALOMEDS::SObject_ptr theField);
150
  void restoreFromStudy(SALOMEDS::SObject_ptr theField);
Lines 139-144 Link Here
139
 public slots:
155
 public slots:
140
  void setProportionalSlot(bool theProp) { myProportional = theProp; }
156
  void setProportionalSlot(bool theProp) { myProportional = theProp; }
141
  void setCyclingSlot(bool theCycle) { myCycling = theCycle; }
157
  void setCyclingSlot(bool theCycle) { myCycling = theCycle; }
158
  void setCleaningMemoryAtEachFrameSlot(bool theCycle) { myCleaningMemoryAtEachFrame = theCycle; }
142
159
143
 signals:
160
 signals:
144
  void frameChanged(long theNewFrame, double theTime);
161
  void frameChanged(long theNewFrame, double theTime);
Lines 160-165 Link Here
160
  int mySpeed;
177
  int mySpeed;
161
  bool myProportional;
178
  bool myProportional;
162
  bool myCycling;
179
  bool myCycling;
180
  bool myCleaningMemoryAtEachFrame;
163
  _PTR(Study) myStudy;
181
  _PTR(Study) myStudy;
164
182
165
  double myTimeMinVal, myTimeMaxVal; //!< Range of time stams, set by user
183
  double myTimeMinVal, myTimeMaxVal; //!< Range of time stams, set by user
Lines 228-239 Link Here
228
  virtual char* setDumpFormat(const char* theFormat);
246
  virtual char* setDumpFormat(const char* theFormat);
229
247
230
  virtual CORBA::Boolean isCycling();
248
  virtual CORBA::Boolean isCycling();
249
  virtual CORBA::Boolean isCleaningMemoryAtEachFrame();
231
250
232
  virtual CORBA::Double getMinTime();
251
  virtual CORBA::Double getMinTime();
233
  virtual CORBA::Double getMaxTime();
252
  virtual CORBA::Double getMaxTime();
234
253
235
  virtual void setProportional(CORBA::Boolean theProp);
254
  virtual void setProportional(CORBA::Boolean theProp);
236
  virtual void setCycling(CORBA::Boolean theCycle);
255
  virtual void setCycling(CORBA::Boolean theCycle);
256
  virtual void setCleaningMemoryAtEachFrame(CORBA::Boolean theCycle);
237
257
238
  virtual SALOMEDS::SObject_ptr publishInStudy();
258
  virtual SALOMEDS::SObject_ptr publishInStudy();
239
  virtual void restoreFromStudy(SALOMEDS::SObject_ptr theField);
259
  virtual void restoreFromStudy(SALOMEDS::SObject_ptr theField);
(-)VISU_SRC_3.2.2/src/VISU_I/VISU_View_i.cc (-4 / +4 lines)
Lines 1610-1617 Link Here
1610
	_PTR(SObject) anObj = aList[i];
1610
	_PTR(SObject) anObj = aList[i];
1611
	string anEntry = anObj->GetID();
1611
	string anEntry = anObj->GetID();
1612
	if(MYDEBUG) MESSAGE("View3D_i::SaveViewParams - anEntry = " << anEntry);
1612
	if(MYDEBUG) MESSAGE("View3D_i::SaveViewParams - anEntry = " << anEntry);
1613
	if (anObj->FindAttribute(anAttr, "AttributeComment")) {
1613
	if (anObj->FindAttribute(anAttr, "AttributeString")) {
1614
	  _PTR(AttributeComment) aCmnt (anAttr);
1614
	  _PTR(AttributeString) aCmnt (anAttr);
1615
	  string aComm (aCmnt->Value());
1615
	  string aComm (aCmnt->Value());
1616
	  if (MYDEBUG) MESSAGE("View3D_i::SaveViewPoint - aComm = " << aComm);
1616
	  if (MYDEBUG) MESSAGE("View3D_i::SaveViewPoint - aComm = " << aComm);
1617
	  if (aComm.compare(View3D_i::myComment) >= 0) {
1617
	  if (aComm.compare(View3D_i::myComment) >= 0) {
Lines 1671-1678 Link Here
1671
      _PTR(SObject) anObj = aList[i];
1671
      _PTR(SObject) anObj = aList[i];
1672
      string anEntry = anObj->GetID();
1672
      string anEntry = anObj->GetID();
1673
      if (MYDEBUG) MESSAGE("View3D_i::RestoreViewPoint - anEntry = " << anEntry);
1673
      if (MYDEBUG) MESSAGE("View3D_i::RestoreViewPoint - anEntry = " << anEntry);
1674
      if (anObj->FindAttribute(anAttr, "AttributeComment")) {
1674
      if (anObj->FindAttribute(anAttr, "AttributeString")) {
1675
	_PTR(AttributeComment) aCmnt (anAttr);
1675
	_PTR(AttributeString) aCmnt (anAttr);
1676
	QString strIn(aCmnt->Value().c_str());
1676
	QString strIn(aCmnt->Value().c_str());
1677
	Storable::TRestoringMap aMap;
1677
	Storable::TRestoringMap aMap;
1678
	Storable::StrToMap(strIn, aMap);
1678
	Storable::StrToMap(strIn, aMap);
(-)VISU_SRC_3.2.2/src/VISU_I/VISU_View_i.hh (-1 / +1 lines)
Lines 259-265 Link Here
259
    static  void SetFocalPoint (SUIT_ViewWindow* theViewWindow, const CORBA::Double theFocalPnt[3]);
259
    static  void SetFocalPoint (SUIT_ViewWindow* theViewWindow, const CORBA::Double theFocalPnt[3]);
260
    virtual void SetFocalPoint (const VISU::View3D::XYZ theCoord);
260
    virtual void SetFocalPoint (const VISU::View3D::XYZ theCoord);
261
261
262
    static  void View3D_i::GetFocalPoint (SUIT_ViewWindow* theViewWindow, CORBA::Double theFocalPnt[3]);
262
    static  void GetFocalPoint (SUIT_ViewWindow* theViewWindow, CORBA::Double theFocalPnt[3]);
263
    virtual VISU::View3D::XYZ_slice* GetFocalPoint();
263
    virtual VISU::View3D::XYZ_slice* GetFocalPoint();
264
264
265
    static  void SetParallelScale (SUIT_ViewWindow* theViewWindow, CORBA::Double theScale);
265
    static  void SetParallelScale (SUIT_ViewWindow* theViewWindow, CORBA::Double theScale);
(-)VISU_SRC_3.2.2/src/VISU_SWIG/visu.py (-4 / +4 lines)
Lines 463-470 Link Here
463
                    aFieldName = anAttr.Value()
463
                    aFieldName = anAttr.Value()
464
                    print "      ", aFieldName
464
                    print "      ", aFieldName
465
                    
465
                    
466
                    anAttr = aFieldSObj.FindAttribute("AttributeComment")[1]
466
                    anAttr = aFieldSObj.FindAttribute("AttributeString")[1]
467
                    anAttr = anAttr._narrow(SALOMEDS.AttributeComment);
467
                    anAttr = anAttr._narrow(SALOMEDS.AttributeString);
468
                    aFieldComment = anAttr.Value()
468
                    aFieldComment = anAttr.Value()
469
                    aMap = StrToMap(aFieldComment)
469
                    aMap = StrToMap(aFieldComment)
470
                    
470
                    
Lines 479-486 Link Here
479
                            aTimeStampName = anAttr.Value()
479
                            aTimeStampName = anAttr.Value()
480
                            print "        ", aTimeStampName
480
                            print "        ", aTimeStampName
481
                            
481
                            
482
                            anAttr = aTimeStampSObj.FindAttribute("AttributeComment")[1]
482
                            anAttr = aTimeStampSObj.FindAttribute("AttributeString")[1]
483
                            anAttr = anAttr._narrow(SALOMEDS.AttributeComment);
483
                            anAttr = anAttr._narrow(SALOMEDS.AttributeString);
484
                            aTimeStampComment = anAttr.Value()
484
                            aTimeStampComment = anAttr.Value()
485
                            aMap = StrToMap(aTimeStampComment)
485
                            aMap = StrToMap(aTimeStampComment)
486
                            aMeshName = aMap["myMeshName"]
486
                            aMeshName = aMap["myMeshName"]

Return to bug 155974