#include "VISU_Convertor_impl.hxx"
#include "VISU_TableReader.hxx"
-#include <fstream>
+#include <fstream>
#include <strstream>
-#include <memory>
+#include <memory>
#include <vtkCellType.h>
#include <vtkUnstructuredGrid.h>
//Import fields
aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
- const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
- const VISU::PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
- const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
- VISU::TFieldMap::const_reverse_iterator aFieldMapIter = aFieldMap.rbegin();
- for(; aFieldMapIter != aFieldMap.rend(); aFieldMapIter++){
- const string& aFieldName = aFieldMapIter->first;
- const VISU::PField& aField = aFieldMapIter->second;
- const VISU::TValField& aValField = aField->myValField;
- VISU::TValField::const_iterator aValFieldIter = aValField.begin();
- for(; aValFieldIter != aValField.end(); aValFieldIter++){
- int aTimeStamp = aValFieldIter->first;
-
- if(anEntity != VISU::NODE_ENTITY){
- VISU::PGaussPtsIDMapper aGaussMesh =
- aCon->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp);
+ const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
+ const VISU::PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
+ const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
+ VISU::TFieldMap::const_reverse_iterator aFieldMapIter = aFieldMap.rbegin();
+ for(; aFieldMapIter != aFieldMap.rend(); aFieldMapIter++){
+ const string& aFieldName = aFieldMapIter->first;
+ const VISU::PField& aField = aFieldMapIter->second;
+ const VISU::TValField& aValField = aField->myValField;
+ VISU::TValField::const_iterator aValFieldIter = aValField.begin();
+ for(; aValFieldIter != aValField.end(); aValFieldIter++){
+ int aTimeStamp = aValFieldIter->first;
+
+ if(anEntity != VISU::NODE_ENTITY){
+ VISU::PGaussPtsIDMapper aGaussMesh =
+ aCon->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp);
#ifdef _DEBUG_ID_MAPPING_
- vtkDataSet* aDataSet = aGaussMesh->GetOutput();
- aDataSet->Update();
- int aNbCells = aDataSet->GetNumberOfCells();
- MESSAGE("aNbCells = "<<aNbCells);
- for(int anCellId = 0; anCellId < aNbCells; anCellId++){
- VISU::TGaussPointID anObjID = aGaussMesh->GetObjID(anCellId);
- cout<<anObjID.first<<"; "<<anObjID.second<<"; "<<aGaussMesh->GetNodeVTKID(anObjID.first)<<endl;
- vtkFloatingPointType* aCoord = aGaussMesh->GetNodeCoord(anCellId);
- cout<<aCoord[0]<<"; "<<aCoord[1]<<"; "<<aCoord[2]<<endl;
- }
+ vtkDataSet* aDataSet = aGaussMesh->GetOutput();
+ aDataSet->Update();
+ int aNbCells = aDataSet->GetNumberOfCells();
+ MESSAGE("aNbCells = "<<aNbCells);
+ for(int anCellId = 0; anCellId < aNbCells; anCellId++){
+ VISU::TGaussPointID anObjID = aGaussMesh->GetObjID(anCellId);
+ cout<<anObjID.first<<"; "<<anObjID.second<<"; "<<aGaussMesh->GetNodeVTKID(anObjID.first)<<endl;
+ vtkFloatingPointType* aCoord = aGaussMesh->GetNodeCoord(anCellId);
+ cout<<aCoord[0]<<"; "<<aCoord[1]<<"; "<<aCoord[2]<<endl;
+ }
#endif
- }else{
- //continue;
- VISU::PIDMapper anIDMapper =
- aCon->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
+ }else{
+ //continue;
+ VISU::PIDMapper anIDMapper =
+ aCon->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
#ifdef _DEBUG_ID_MAPPING_
- vtkDataSet* aDataSet = anIDMapper->GetOutput();
- aDataSet->Update();
- int aNbCells = aDataSet->GetNumberOfCells();
- for(int anCellId = 0; anCellId < aNbCells; anCellId++){
- int anObjID = anIDMapper->GetElemObjID(anCellId);
- int aVTKID = anIDMapper->GetElemVTKID(anObjID);
- cout<<anObjID<<"; "<<aVTKID<<endl;
- }
+ vtkDataSet* aDataSet = anIDMapper->GetOutput();
+ aDataSet->Update();
+ int aNbCells = aDataSet->GetNumberOfCells();
+ for(int anCellId = 0; anCellId < aNbCells; anCellId++){
+ int anObjID = anIDMapper->GetElemObjID(anCellId);
+ int aVTKID = anIDMapper->GetElemVTKID(anObjID);
+ cout<<anObjID<<"; "<<aVTKID<<endl;
+ }
#endif
- }
- //goto OK;
- }
- }
+ }
+ //goto OK;
+ }
+ }
}
//Importing groups
const VISU::TGroupMap& aGroupMap = aMesh->myGroupMap;
VISU::TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin();
for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){
- const string& aGroupName = aGroupMapIter->first;
- aCon->GetMeshOnGroup(aMeshName,aGroupName);
+ const string& aGroupName = aGroupMapIter->first;
+ aCon->GetMeshOnGroup(aMeshName,aGroupName);
}
//continue;
//Import mesh on entity
aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
- const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
- VISU::PIDMapper anIDMapper = aCon->GetMeshOnEntity(aMeshName,anEntity);
+ const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
+ VISU::PIDMapper anIDMapper = aCon->GetMeshOnEntity(aMeshName,anEntity);
#ifdef _DEBUG_ID_MAPPING_
- vtkDataSet* aDataSet = anIDMapper->GetOutput();
- int aNbCells, anCellId, anObjID, aVTKID;
- aNbCells = aDataSet->GetNumberOfCells();
- for(anCellId = 0; anCellId < aNbCells; anCellId++){
- anObjID = anIDMapper->GetElemObjID(anCellId);
- aVTKID = anIDMapper->GetElemVTKID(anObjID);
- MESSAGE(anObjID<<"; "<<aVTKID);
- }
+ vtkDataSet* aDataSet = anIDMapper->GetOutput();
+ int aNbCells, anCellId, anObjID, aVTKID;
+ aNbCells = aDataSet->GetNumberOfCells();
+ for(anCellId = 0; anCellId < aNbCells; anCellId++){
+ anObjID = anIDMapper->GetElemObjID(anCellId);
+ aVTKID = anIDMapper->GetElemVTKID(anObjID);
+ MESSAGE(anObjID<<"; "<<aVTKID);
+ }
#endif
}
//Import families
aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
- const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
- const VISU::PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
- //aCon->GetMeshOnEntity(aMeshName,anEntity);
- const VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
- VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
- for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
- const string& aFamilyName = aFamilyMapIter->first;
- aCon->GetFamilyOnEntity(aMeshName,anEntity,aFamilyName);
- }
+ const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
+ const VISU::PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
+ //aCon->GetMeshOnEntity(aMeshName,anEntity);
+ const VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
+ VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
+ for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
+ const string& aFamilyName = aFamilyMapIter->first;
+ aCon->GetFamilyOnEntity(aMeshName,anEntity,aFamilyName);
+ }
}
}
OK:
QFileInfo aFileInfo( argv[1] );
for ( int i = 0; i < 1; i++ ) {
if ( aFileInfo.exists() ) {
- if ( aFileInfo.isDir() ) {
- QDir aDir( aFileInfo.absoluteFilePath() );
- QStringList wildcards; wildcards << "*.med";
- QStringList aStringList = aDir.entryList( wildcards, QDir::Files );
- int jEnd = aStringList.count();
- for ( int j = 0; j < jEnd; j++ ) {
- ParseMEDFile( aDir.filePath( aStringList[j] ).toLatin1().data() );
- }
- } else {
- QString anExtension = aFileInfo.suffix();
- if ( anExtension == "med" )
- ParseMEDFile( argv[1] );
- else if ( anExtension == "xls" || anExtension == "txt" )
- ParseXLSFile( argv[1] );
- }
+ if ( aFileInfo.isDir() ) {
+ QDir aDir( aFileInfo.absoluteFilePath() );
+ QStringList wildcards; wildcards << "*.med";
+ QStringList aStringList = aDir.entryList( wildcards, QDir::Files );
+ int jEnd = aStringList.count();
+ for ( int j = 0; j < jEnd; j++ ) {
+ ParseMEDFile( aDir.filePath( aStringList[j] ).toLatin1().data() );
+ }
+ } else {
+ QString anExtension = aFileInfo.suffix();
+ if ( anExtension == "med" )
+ ParseMEDFile( argv[1] );
+ else if ( anExtension == "xls" || anExtension == "txt" )
+ ParseXLSFile( argv[1] );
+ }
}
}
return 0;
int
VISU_AppendFilter
::RequestData(vtkInformation *theRequest,
- vtkInformationVector **theInputVector,
- vtkInformationVector *theOutputVector)
+ vtkInformationVector **theInputVector,
+ vtkInformationVector *theOutputVector)
{
bool anIsExecuted = false;
if( IsMergingInputs() || IsMappingInputs() )
anIsExecuted = VISU::UnstructuredGridRequestData(theInputVector,
- GetNumberOfInputConnections( 0 ),
- theOutputVector,
- GetSharedPointSet(),
- IsMergingInputs(),
- IsMappingInputs());
+ GetNumberOfInputConnections( 0 ),
+ theOutputVector,
+ GetSharedPointSet(),
+ IsMergingInputs(),
+ IsMappingInputs());
if( !anIsExecuted )
anIsExecuted = Superclass::RequestData(theRequest,
- theInputVector,
- theOutputVector);
+ theInputVector,
+ theOutputVector);
return anIsExecuted;
}
//---------------------------------------------------------------
void
DoMergingInputs(vtkCellData *theCellData,
- TInputId theInputId,
- TObject2InputIdMap& theResult)
+ TInputId theInputId,
+ TObject2InputIdMap& theResult)
{
if(vtkDataArray *aDataArray = theCellData->GetArray("VISU_CELLS_MAPPER")){
if(vtkIntArray *anIntArray = dynamic_cast<vtkIntArray*>(aDataArray)){
int *aPointer = anIntArray->GetPointer(0);
int aNbCells = anIntArray->GetNumberOfTuples();
- for(vtkIdType aCellId = 0; aCellId < aNbCells; aCellId++){
+ for(vtkIdType aCellId = 0; aCellId < aNbCells; aCellId++){
int aObjId = *aPointer++;
int anEntity = *aPointer++;
- TObjectId anObjectId(aObjId, anEntity);
- TObject2InputIdMap::iterator anIter = theResult.find(anObjectId);
- if(anIter != theResult.end())
- continue;
- TInputCellId anInputCellId(theInputId, aCellId);
- theResult.insert(anIter, TObject2InputIdMap::value_type(anObjectId, anInputCellId));
- }
+ TObjectId anObjectId(aObjId, anEntity);
+ TObject2InputIdMap::iterator anIter = theResult.find(anObjectId);
+ if(anIter != theResult.end())
+ continue;
+ TInputCellId anInputCellId(theInputId, aCellId);
+ theResult.insert(anIter, TObject2InputIdMap::value_type(anObjectId, anInputCellId));
+ }
}
}
}
{
vtkCellData *aCellData = theDataSet->GetCellData();
if(myIsFirstCellData){
- myFieldList.InitializeFieldList(aCellData);
- myIsFirstCellData = false;
+ myFieldList.InitializeFieldList(aCellData);
+ myIsFirstCellData = false;
}else{
- myFieldList.IntersectFieldList(aCellData);
+ myFieldList.IntersectFieldList(aCellData);
}
}
template<class TFunctor>
void
ForEachInput(vtkInformationVector **theInputVector,
- vtkIdType theNumberOfInputConnections,
- TFunctor& theFunctor)
+ vtkIdType theNumberOfInputConnections,
+ TFunctor& theFunctor)
{
for(vtkIdType anInputId = 0; anInputId < theNumberOfInputConnections; anInputId++)
if(vtkDataSet *aDataSet = VISU::GetInput(theInputVector, anInputId))
- if(aDataSet->GetNumberOfPoints() > 0 && aDataSet->GetNumberOfCells() > 0)
- theFunctor(anInputId, aDataSet);
+ if(aDataSet->GetNumberOfPoints() > 0 && aDataSet->GetNumberOfCells() > 0)
+ theFunctor(anInputId, aDataSet);
}
template<class TDataSet>
bool
RequestData(vtkInformationVector **theInputVector,
- vtkIdType theNumberOfInputConnections,
- vtkInformationVector *theOutputVector,
- vtkPointSet* theSharedPointSet,
- bool theIsMergingInputs,
- bool theIsMappingInputs)
+ vtkIdType theNumberOfInputConnections,
+ vtkInformationVector *theOutputVector,
+ vtkPointSet* theSharedPointSet,
+ bool theIsMergingInputs,
+ bool theIsMappingInputs)
{
if ( theNumberOfInputConnections == 1 ) {
// get the input and ouptut
vtkDataSet* anOutput = VISU::GetOutput( theOutputVector );
if ( anInput->GetDataObjectType() != anOutput->GetDataObjectType() )
- return false;
+ return false;
// This has to be here because it initialized all field datas.
anOutput->CopyStructure( anInput );
if ( theSharedPointSet ) {
vtkPoints* aPoints = theSharedPointSet->GetPoints();
if(aPoints->GetNumberOfPoints() < 1)
- return true;
+ return true;
TDataSet* anOutput = TDataSet::SafeDownCast(VISU::GetOutput(theOutputVector));
vtkIdType anNbInputs = theNumberOfInputConnections;
if ( theIsMergingInputs ) {
- TCellIdMerger aFunctor(anNbInputs);
- ForEachInput<TCellIdMerger>(theInputVector, anNbInputs, aFunctor);
-
- vtkDataSetAttributes::FieldList& aFieldList = aFunctor.myFieldList;
- TObject2InputIdMap& anObject2InputIdMap = aFunctor.myObject2InputIdMap;
- vtkIdType aNbCells = aFunctor.GetNbCells();
- if(aNbCells < 1)
- return true;
+ TCellIdMerger aFunctor(anNbInputs);
+ ForEachInput<TCellIdMerger>(theInputVector, anNbInputs, aFunctor);
+
+ vtkDataSetAttributes::FieldList& aFieldList = aFunctor.myFieldList;
+ TObject2InputIdMap& anObject2InputIdMap = aFunctor.myObject2InputIdMap;
+ vtkIdType aNbCells = aFunctor.GetNbCells();
+ if(aNbCells < 1)
+ return true;
- // Now can allocate memory
- anOutput->Allocate(aNbCells);
- vtkCellData *anOutputCellData = anOutput->GetCellData();
- anOutputCellData->CopyAllocate(aFieldList, aNbCells);
+ // Now can allocate memory
+ anOutput->Allocate(aNbCells);
+ vtkCellData *anOutputCellData = anOutput->GetCellData();
+ anOutputCellData->CopyAllocate(aFieldList, aNbCells);
- // Append each input dataset together
- // 1.points
- anOutput->SetPoints(theSharedPointSet->GetPoints());
- anOutput->GetPointData()->PassData(theSharedPointSet->GetPointData());
+ // Append each input dataset together
+ // 1.points
+ anOutput->SetPoints(theSharedPointSet->GetPoints());
+ anOutput->GetPointData()->PassData(theSharedPointSet->GetPointData());
- // 2.cells
- vtkIdList *anIdList = vtkIdList::New();
- anIdList->Allocate(VTK_CELL_SIZE);
- TObject2InputIdMap::const_iterator anIter = anObject2InputIdMap.begin();
- TObject2InputIdMap::const_iterator anEndIter = anObject2InputIdMap.end();
- for(; anIter != anEndIter; anIter++){
- //TObjectId anObjectId = anIter->first;
- const TInputCellId& anInputCellId = anIter->second;
- TInputId anInputId = anInputCellId.first;
- if(vtkDataSet *aDataSet = VISU::GetInput(theInputVector, anInputId)){
- TCellId aCellId = anInputCellId.second;
- aDataSet->GetCellPoints(aCellId, anIdList);
-
- vtkIdType aCellType = aDataSet->GetCellType(aCellId);
- vtkIdType aNewCellId = anOutput->InsertNextCell(aCellType, anIdList);
-
- vtkCellData *aCellData = aDataSet->GetCellData();
- anOutputCellData->CopyData(aFieldList, aCellData, anInputId, aCellId, aNewCellId);
- }
- }
- anIdList->Delete();
-
- if(theIsMappingInputs){
- vtkIntArray *aDataArray = vtkIntArray::New();
- aDataArray->SetName("VISU_INPUTS_MAPPER");
- aDataArray->SetNumberOfComponents(2);
- aDataArray->SetNumberOfTuples(aNbCells);
-
- vtkIdType aTupleId = 0;
- TObject2InputIdMap::const_iterator anIter = anObject2InputIdMap.begin();
- TObject2InputIdMap::const_iterator anEndIter = anObject2InputIdMap.end();
- for(vtkIdType aCellId = 0; anIter != anEndIter; anIter++, aCellId++){
- const TInputCellId& anInputCellId = anIter->second;
- TInputId anInputId = anInputCellId.first;
- /*TCellId*/ aCellId = anInputCellId.second;
- aDataArray->SetValue(aTupleId++, anInputId);
- aDataArray->SetValue(aTupleId++, aCellId);
- }
-
- anOutputCellData->AddArray(aDataArray);
- aDataArray->Delete();
- }
-
- return true;
+ // 2.cells
+ vtkIdList *anIdList = vtkIdList::New();
+ anIdList->Allocate(VTK_CELL_SIZE);
+ TObject2InputIdMap::const_iterator anIter = anObject2InputIdMap.begin();
+ TObject2InputIdMap::const_iterator anEndIter = anObject2InputIdMap.end();
+ for(; anIter != anEndIter; anIter++){
+ //TObjectId anObjectId = anIter->first;
+ const TInputCellId& anInputCellId = anIter->second;
+ TInputId anInputId = anInputCellId.first;
+ if(vtkDataSet *aDataSet = VISU::GetInput(theInputVector, anInputId)){
+ TCellId aCellId = anInputCellId.second;
+ aDataSet->GetCellPoints(aCellId, anIdList);
+
+ vtkIdType aCellType = aDataSet->GetCellType(aCellId);
+ vtkIdType aNewCellId = anOutput->InsertNextCell(aCellType, anIdList);
+
+ vtkCellData *aCellData = aDataSet->GetCellData();
+ anOutputCellData->CopyData(aFieldList, aCellData, anInputId, aCellId, aNewCellId);
+ }
+ }
+ anIdList->Delete();
+
+ if(theIsMappingInputs){
+ vtkIntArray *aDataArray = vtkIntArray::New();
+ aDataArray->SetName("VISU_INPUTS_MAPPER");
+ aDataArray->SetNumberOfComponents(2);
+ aDataArray->SetNumberOfTuples(aNbCells);
+
+ vtkIdType aTupleId = 0;
+ TObject2InputIdMap::const_iterator anIter = anObject2InputIdMap.begin();
+ TObject2InputIdMap::const_iterator anEndIter = anObject2InputIdMap.end();
+ for(vtkIdType aCellId = 0; anIter != anEndIter; anIter++, aCellId++){
+ const TInputCellId& anInputCellId = anIter->second;
+ TInputId anInputId = anInputCellId.first;
+ /*TCellId*/ aCellId = anInputCellId.second;
+ aDataArray->SetValue(aTupleId++, anInputId);
+ aDataArray->SetValue(aTupleId++, aCellId);
+ }
+
+ anOutputCellData->AddArray(aDataArray);
+ aDataArray->Delete();
+ }
+
+ return true;
}else{
- TCellCounter aFunctor(anNbInputs);
- ForEachInput<TCellCounter>(theInputVector, anNbInputs, aFunctor);
-
- vtkDataSetAttributes::FieldList& aFieldList = aFunctor.myFieldList;
- vtkIdType aNbCells = aFunctor.GetNbCells();
- if(aNbCells < 1)
- return true;
-
- // Now can allocate memory
- anOutput->Allocate(aNbCells);
- vtkCellData *anOutputCellData = anOutput->GetCellData();
- anOutputCellData->CopyAllocate(aFieldList, aNbCells);
-
- // Append each input dataset together
- // 1.points
- anOutput->SetPoints(theSharedPointSet->GetPoints());
- anOutput->GetPointData()->PassData(theSharedPointSet->GetPointData());
-
- // 2.cells
- vtkIdList *anIdList = vtkIdList::New();
- anIdList->Allocate(VTK_CELL_SIZE);
- for(vtkIdType anInputId = 0; anInputId < anNbInputs; anInputId++){
- if(vtkDataSet *aDataSet = VISU::GetInput(theInputVector, anInputId)){
- vtkIdType aNbCells = aDataSet->GetNumberOfCells();
- vtkCellData *aCellData = aDataSet->GetCellData();
- // copy cell and cell data
- for(vtkIdType aCellId = 0; aCellId < aNbCells; aCellId++){
- aDataSet->GetCellPoints(aCellId, anIdList);
-
- vtkIdType aCellType = aDataSet->GetCellType(aCellId);
- vtkIdType aNewCellId = anOutput->InsertNextCell(aCellType, anIdList);
-
- anOutputCellData->CopyData(aFieldList, aCellData, anInputId, aCellId, aNewCellId);
- }
- }
- }
- anIdList->Delete();
-
- if(theIsMappingInputs){
- vtkIntArray *aDataArray = vtkIntArray::New();
- aDataArray->SetName("VISU_INPUTS_MAPPER");
- aDataArray->SetNumberOfComponents(2);
- aDataArray->SetNumberOfTuples(aNbCells);
-
- vtkIdType aTupleId = 0;
- for(vtkIdType anInputId = 0; anInputId < anNbInputs; anInputId++){
- if(vtkDataSet *aDataSet = VISU::GetInput(theInputVector, anInputId)){
- vtkIdType aNbCells = aDataSet->GetNumberOfCells();
- for(vtkIdType aCellId = 0; aCellId < aNbCells; aCellId++){
- aDataArray->SetValue(aTupleId++, aCellId);
- aDataArray->SetValue(aTupleId++, anInputId);
- }
- }
- }
-
- anOutputCellData->AddArray(aDataArray);
- aDataArray->Delete();
- }
- return true;
+ TCellCounter aFunctor(anNbInputs);
+ ForEachInput<TCellCounter>(theInputVector, anNbInputs, aFunctor);
+
+ vtkDataSetAttributes::FieldList& aFieldList = aFunctor.myFieldList;
+ vtkIdType aNbCells = aFunctor.GetNbCells();
+ if(aNbCells < 1)
+ return true;
+
+ // Now can allocate memory
+ anOutput->Allocate(aNbCells);
+ vtkCellData *anOutputCellData = anOutput->GetCellData();
+ anOutputCellData->CopyAllocate(aFieldList, aNbCells);
+
+ // Append each input dataset together
+ // 1.points
+ anOutput->SetPoints(theSharedPointSet->GetPoints());
+ anOutput->GetPointData()->PassData(theSharedPointSet->GetPointData());
+
+ // 2.cells
+ vtkIdList *anIdList = vtkIdList::New();
+ anIdList->Allocate(VTK_CELL_SIZE);
+ for(vtkIdType anInputId = 0; anInputId < anNbInputs; anInputId++){
+ if(vtkDataSet *aDataSet = VISU::GetInput(theInputVector, anInputId)){
+ vtkIdType aNbCells = aDataSet->GetNumberOfCells();
+ vtkCellData *aCellData = aDataSet->GetCellData();
+ // copy cell and cell data
+ for(vtkIdType aCellId = 0; aCellId < aNbCells; aCellId++){
+ aDataSet->GetCellPoints(aCellId, anIdList);
+
+ vtkIdType aCellType = aDataSet->GetCellType(aCellId);
+ vtkIdType aNewCellId = anOutput->InsertNextCell(aCellType, anIdList);
+
+ anOutputCellData->CopyData(aFieldList, aCellData, anInputId, aCellId, aNewCellId);
+ }
+ }
+ }
+ anIdList->Delete();
+
+ if(theIsMappingInputs){
+ vtkIntArray *aDataArray = vtkIntArray::New();
+ aDataArray->SetName("VISU_INPUTS_MAPPER");
+ aDataArray->SetNumberOfComponents(2);
+ aDataArray->SetNumberOfTuples(aNbCells);
+
+ vtkIdType aTupleId = 0;
+ for(vtkIdType anInputId = 0; anInputId < anNbInputs; anInputId++){
+ if(vtkDataSet *aDataSet = VISU::GetInput(theInputVector, anInputId)){
+ vtkIdType aNbCells = aDataSet->GetNumberOfCells();
+ for(vtkIdType aCellId = 0; aCellId < aNbCells; aCellId++){
+ aDataArray->SetValue(aTupleId++, aCellId);
+ aDataArray->SetValue(aTupleId++, anInputId);
+ }
+ }
+ }
+
+ anOutputCellData->AddArray(aDataArray);
+ aDataArray->Delete();
+ }
+ return true;
}
}
//---------------------------------------------------------------
bool
UnstructuredGridRequestData(vtkInformationVector **theInputVector,
- vtkIdType theNumberOfInputConnections,
- vtkInformationVector *theOutputVector,
- vtkPointSet* theSharedPointSet,
- bool theIsMergingInputs,
- bool theIsMappingInputs)
+ vtkIdType theNumberOfInputConnections,
+ vtkInformationVector *theOutputVector,
+ vtkPointSet* theSharedPointSet,
+ bool theIsMergingInputs,
+ bool theIsMappingInputs)
{
return RequestData<vtkUnstructuredGrid>(theInputVector,
- theNumberOfInputConnections,
- theOutputVector,
- theSharedPointSet,
- theIsMergingInputs,
- theIsMappingInputs);
+ theNumberOfInputConnections,
+ theOutputVector,
+ theSharedPointSet,
+ theIsMergingInputs,
+ theIsMappingInputs);
}
//---------------------------------------------------------------
bool
PolyDataRequestData(vtkInformationVector **theInputVector,
- vtkIdType theNumberOfInputConnections,
- vtkInformationVector *theOutputVector,
- vtkPointSet* theSharedPointSet,
- bool theIsMergingInputs,
- bool theIsMappingInputs)
+ vtkIdType theNumberOfInputConnections,
+ vtkInformationVector *theOutputVector,
+ vtkPointSet* theSharedPointSet,
+ bool theIsMergingInputs,
+ bool theIsMappingInputs)
{
return RequestData<vtkPolyData>(theInputVector,
- theNumberOfInputConnections,
- theOutputVector,
- theSharedPointSet,
- theIsMergingInputs,
- theIsMappingInputs);
+ theNumberOfInputConnections,
+ theOutputVector,
+ theSharedPointSet,
+ theIsMergingInputs,
+ theIsMappingInputs);
}
TAppendFilterHelper(TAppendFilterHelper&);
public:
- void
+ void
SetSharedPointSet(vtkPointSet* thePointSet);
vtkPointSet*
//---------------------------------------------------------------
bool
UnstructuredGridRequestData(vtkInformationVector **theInputVector,
- vtkIdType theNumberOfInputConnections,
- vtkInformationVector *theOutputVector,
- vtkPointSet* theSharedPointSet,
- bool theIsMergingInputs,
- bool theIsMappingInputs);
+ vtkIdType theNumberOfInputConnections,
+ vtkInformationVector *theOutputVector,
+ vtkPointSet* theSharedPointSet,
+ bool theIsMergingInputs,
+ bool theIsMappingInputs);
//---------------------------------------------------------------
bool
PolyDataRequestData(vtkInformationVector **theInputVector,
- vtkIdType theNumberOfInputConnections,
- vtkInformationVector *theOutputVector,
- vtkPointSet* theSharedPointSet,
- bool theIsMergingInputs,
- bool theIsMappingInputs);
+ vtkIdType theNumberOfInputConnections,
+ vtkInformationVector *theOutputVector,
+ vtkPointSet* theSharedPointSet,
+ bool theIsMergingInputs,
+ bool theIsMappingInputs);
}
#endif
int
VISU_AppendPolyData
::RequestData(vtkInformation *theRequest,
- vtkInformationVector **theInputVector,
- vtkInformationVector *theOutputVector)
+ vtkInformationVector **theInputVector,
+ vtkInformationVector *theOutputVector)
{
bool anIsExecuted = false;
if(GetNumberOfInputConnections(0) > 1 || IsMergingInputs() || IsMappingInputs())
anIsExecuted = VISU::PolyDataRequestData(theInputVector,
- this->GetNumberOfInputConnections(0),
- theOutputVector,
- GetSharedPointSet(),
- IsMergingInputs(),
- IsMappingInputs());
+ this->GetNumberOfInputConnections(0),
+ theOutputVector,
+ GetSharedPointSet(),
+ IsMergingInputs(),
+ IsMappingInputs());
if(!anIsExecuted)
anIsExecuted = Superclass::RequestData(theRequest,
- theInputVector,
- theOutputVector);
+ theInputVector,
+ theOutputVector);
return anIsExecuted;
}
/*! \brief This class used same as vtkAppendFilter. See documentation on VTK for more information.
*/
class VISU_AppendPolyData : public vtkAppendPolyData,
- public VISU::TAppendFilterHelper
+ public VISU::TAppendFilterHelper
{
public:
/*! \fn static VTKViewer_AppendFilter *New()
//anOutput->GetPointData()->GetArray("VISU_CELLS_MAPPER")->SetName("VISU_POINTS_MAPPER");
// apply VISU_POINTS_MAPPER
- int anEntity = int(VISU::NODE_ENTITY);
+ int anEntity = int(VISU::NODE_ENTITY);
vtkIntArray* aNewPointsIdsArray = vtkIntArray::New();
aNewPointsIdsArray->SetName("VISU_POINTS_MAPPER");
aNewPointsIdsArray->SetNumberOfComponents(2);
aNewPointsIdsArray->SetNumberOfTuples(aPointIdsForCopy->GetNumberOfIds());
- int *aPtr = aNewPointsIdsArray->GetPointer(0);
+ int *aPtr = aNewPointsIdsArray->GetPointer(0);
for(int i = 0; i < aPointIdsForCopy->GetNumberOfIds(); i++){
- *aPtr++ = aPointIdsForCopy->GetId(i);
- *aPtr++ = anEntity;
- }
+ *aPtr++ = aPointIdsForCopy->GetId(i);
+ *aPtr++ = anEntity;
+ }
anOutput->GetPointData()->AddArray(aNewPointsIdsArray);
std::string
VISU_Convertor
::GenerateName(const std::string& theName,
- unsigned int theTimeId)
+ unsigned int theTimeId)
{
static QString aName;
aName = QString(theName.c_str()).simplified();
virtual
VISU::PNamedIDMapper
GetMeshOnEntity(const std::string& theMeshName,
- const VISU::TEntity& theEntity) = 0;
+ const VISU::TEntity& theEntity) = 0;
//! Get amount of memory to build mesh for corresponding MED ENTITY
virtual
size_t
GetMeshOnEntitySize(const std::string& theMeshName,
- const VISU::TEntity& theEntity) = 0;
+ const VISU::TEntity& theEntity) = 0;
//! Get mesh for corresponding MED FAMILY
virtual
VISU::PUnstructuredGridIDMapper
GetFamilyOnEntity(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFamilyName) = 0;
+ const VISU::TEntity& theEntity,
+ const std::string& theFamilyName) = 0;
//! Get amount of memory to build mesh for corresponding MED FAMILY
virtual
size_t
GetFamilyOnEntitySize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFamilyName) = 0;
+ const VISU::TEntity& theEntity,
+ const std::string& theFamilyName) = 0;
//! Get mesh for corresponding MED GROUP
virtual
VISU::PUnstructuredGridIDMapper
GetMeshOnGroup(const std::string& theMeshName,
- const std::string& theGroupName) = 0;
+ const std::string& theGroupName) = 0;
//! Get amount of memory to build mesh for corresponding MED GROUP
virtual
size_t
GetMeshOnGroupSize(const std::string& theMeshName,
- const std::string& theGroupName) = 0;
+ const std::string& theGroupName) = 0;
//! Get mesh with attached values for corresponding MED TIMESTAMP
virtual
VISU::PUnstructuredGridIDMapper
GetTimeStampOnMesh(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber) = 0;
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber) = 0;
//! Get Gauss Points mesh with attached values for corresponding MED TIMESTAMP
virtual
VISU::PGaussPtsIDMapper
GetTimeStampOnGaussPts(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber) = 0;
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber) = 0;
//! Get amount of memory to build vtkDataSet for corresponding MED TIMESTAMP on mesh
virtual
size_t
GetTimeStampOnMeshSize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber,
- bool& theIsEstimated) = 0;
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber,
+ bool& theIsEstimated) = 0;
//! Get amount of memory to build vtkDataSet for corresponding MED TIMESTAMP on Gauss Points
virtual
size_t
GetTimeStampOnGaussPtsSize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber,
- bool& theIsEstimated) = 0;
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber,
+ bool& theIsEstimated) = 0;
//! Get amount of memory to build all MED TIMESTAMPS for corresponding MED FIELD
virtual
size_t
GetFieldOnMeshSize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName) = 0;
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName) = 0;
//! Find MED FIELD container
virtual
const VISU::PField
GetField(const std::string& theMeshName,
- VISU::TEntity theEntity,
- const std::string& theFieldName) = 0;
+ VISU::TEntity theEntity,
+ const std::string& theFieldName) = 0;
//! Find MED TIMESTAMP container
virtual
const VISU::PValForTime
GetTimeStamp(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber) = 0;
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber) = 0;
//! Allow to generate pretty name for MED TIMESTAMP
static
//---------------------------------------------------------------
//! Defines VISU enumeration of geometrical types
enum EGeometry {ePOINT1=1, eSEG2=102, eSEG3=103, eTRIA3=203,
- eQUAD4=204, eTRIA6=206,eQUAD8=208, eTETRA4=304,
- ePYRA5=305, ePENTA6=306, eHEXA8=308, eTETRA10=310,
- ePYRA13=313, ePENTA15=315, eHEXA20=320,
- ePOLYGONE=400, ePOLYEDRE=500, eNONE=-1};
+ eQUAD4=204, eTRIA6=206,eQUAD8=208, eTETRA4=304,
+ ePYRA5=305, ePENTA6=306, eHEXA8=308, eTETRA10=310,
+ ePYRA13=313, ePENTA15=315, eHEXA20=320,
+ ePOLYGONE=400, ePOLYEDRE=500, eNONE=-1};
//---------------------------------------------------------------
//---------------------------------------------------------------
void
WriteToFile(vtkUnstructuredGrid* theDataSet,
- const std::string& theFileName)
+ const std::string& theFileName)
{
vtkUnstructuredGridWriter* aWriter = vtkUnstructuredGridWriter::New();
//aWriter->SetFileType(VTK_BINARY);
//---------------------------------------------------------------
void
WriteToFile(vtkPolyData* theDataSet,
- const std::string& theFileName)
+ const std::string& theFileName)
{
vtkPolyDataWriter* aWriter = vtkPolyDataWriter::New();
//aWriter->SetFileType(VTK_BINARY);
if ( vtkDataSetAttributes *aDataSetAttributes = theDataSet->GetCellData() )
if ( aDataSetAttributes->GetArray( "ELNO_FIELD" ) != NULL )
- return true;
+ return true;
if ( vtkDataSetAttributes *aDataSetAttributes = theDataSet->GetPointData() )
if ( aDataSetAttributes->GetArray( "ELNO_POINT_COORDS" ) != NULL )
- return true;
+ return true;
return false;
}
int aNbTuples = anIntArray->GetNumberOfTuples();
int* aPointer = anIntArray->GetPointer(0);
for(int aTupleId = 0; aTupleId < aNbTuples; aTupleId++){
- if(*aPointer == theID && *(aPointer + 1) == theEntity){
- return aTupleId;
- }
- aPointer += 2;
+ if(*aPointer == theID && *(aPointer + 1) == theEntity){
+ return aTupleId;
+ }
+ aPointer += 2;
}
}
return -1;
vtkDataSetAttributes *aDataSetAttributes = theDataSet->GetCellData();
if(vtkDataArray *aDataArray = aDataSetAttributes->GetArray("VISU_CELLS_MAPPER")){
if(theEntity < 0){
- {
- vtkIdType anID = GetVTKID(aDataArray, theID, VISU::CELL_ENTITY);
- if(anID != -1)
- return anID;
- }
- {
- vtkIdType anID = GetVTKID(aDataArray, theID, VISU::FACE_ENTITY);
- if(anID != -1)
- return anID;
- }
- {
- vtkIdType anID = GetVTKID(aDataArray, theID, VISU::EDGE_ENTITY);
- if(anID != -1)
- return anID;
- }
- {
- vtkIdType anID = GetVTKID(aDataArray, theID, VISU::NODE_ENTITY);
- if(anID != -1)
- return anID;
- }
+ {
+ vtkIdType anID = GetVTKID(aDataArray, theID, VISU::CELL_ENTITY);
+ if(anID != -1)
+ return anID;
+ }
+ {
+ vtkIdType anID = GetVTKID(aDataArray, theID, VISU::FACE_ENTITY);
+ if(anID != -1)
+ return anID;
+ }
+ {
+ vtkIdType anID = GetVTKID(aDataArray, theID, VISU::EDGE_ENTITY);
+ if(anID != -1)
+ return anID;
+ }
+ {
+ vtkIdType anID = GetVTKID(aDataArray, theID, VISU::NODE_ENTITY);
+ if(anID != -1)
+ return anID;
+ }
}else
- return GetVTKID(aDataArray, theID, theEntity);
+ return GetVTKID(aDataArray, theID, theEntity);
}
return -1;
}
vtkDataSetAttributes *aDataSetAttributes = theDataSet->GetCellData();
if(vtkDataArray *aDataArray = aDataSetAttributes->GetArray("VISU_CELLS_MAPPER")){
if(vtkIntArray *anIntArray = dynamic_cast<vtkIntArray*>(aDataArray)){
- vtkIdType anID = 2 * theID;
- TCellID aCellID = anIntArray->GetValue(anID);
- TLocalPntID aLocalPntID = anIntArray->GetValue(anID + 1);
- return TGaussPointID(aCellID, aLocalPntID);
+ vtkIdType anID = 2 * theID;
+ TCellID aCellID = anIntArray->GetValue(anID);
+ TLocalPntID aLocalPntID = anIntArray->GetValue(anID + 1);
+ return TGaussPointID(aCellID, aLocalPntID);
}
}
return TGaussPointID();
vtkDataSetAttributes *aDataSetAttributes = theDataSet->GetCellData();
if(vtkDataArray *aDataArray = aDataSetAttributes->GetArray("VISU_INPUTS_MAPPER")){
if(vtkIntArray *anIntArray = dynamic_cast<vtkIntArray*>(aDataArray)){
- vtkIdType aVTKID = GetElemVTKID(theDataSet, theObjID);
- vtkIdType aTupleID = 2 * aVTKID;
- TCellID aCellID = anIntArray->GetValue(aTupleID);
- TInputID anInputID = anIntArray->GetValue(aTupleID + 1);
- return TInputCellID(anInputID, aCellID);
+ vtkIdType aVTKID = GetElemVTKID(theDataSet, theObjID);
+ vtkIdType aTupleID = 2 * aVTKID;
+ TCellID aCellID = anIntArray->GetValue(aTupleID);
+ TInputID anInputID = anIntArray->GetValue(aTupleID + 1);
+ return TInputCellID(anInputID, aCellID);
}
}
return TInputCellID();
//---------------------------------------------------------------
vtkDataSet*
GetInput(vtkInformationVector **theInputVector,
- vtkIdType theInputId)
+ vtkIdType theInputId)
{
if(vtkInformation* anInformation = theInputVector[0]->GetInformationObject(theInputId))
return vtkDataSet::SafeDownCast(anInformation->Get(vtkDataObject::DATA_OBJECT()));
//---------------------------------------------------------------
TTimerLog
::TTimerLog(int theIsDebug,
- const std::string& theName):
+ const std::string& theName):
myIsDebug(MYDEBUG + theIsDebug),
myTimerLog(vtkTimerLog::New()),
myPrefixPrinter(myIsDebug == 1),
VISU_CONVERTOR_EXPORT
void
WriteToFile(vtkUnstructuredGrid* theDataSet,
- const std::string& theFileName);
+ const std::string& theFileName);
//---------------------------------------------------------------
VISU_CONVERTOR_EXPORT
void
WriteToFile(vtkPolyData* theDataSet,
- const std::string& theFileName);
+ const std::string& theFileName);
//---------------------------------------------------------------
VISU_CONVERTOR_EXPORT
vtkDataSet*
GetInput(vtkInformationVector **theInputVector,
- vtkIdType theInputId = 0);
+ vtkIdType theInputId = 0);
VISU_CONVERTOR_EXPORT
vtkDataSet*
public:
TTimerLog(int theIsDebug,
- const std::string& theName);
+ const std::string& theName);
~TTimerLog();
};
inline
void
PrintCells( vtkCellArray* theConnectivity,
- const VISU::TConnect& theVector)
+ const VISU::TConnect& theVector)
{
theConnectivity->InsertNextCell( theVector.size(), &theVector[ 0 ] );
}
//---------------------------------------------------------------
void
GetCellsOnSubMesh(const VISU::PUnstructuredGrid& theSource,
- const VISU::PMeshOnEntityImpl& theMeshOnEntity,
- const VISU::PSubMeshImpl& theSubMesh,
- const vtkIdType theGeom)
+ const VISU::PMeshOnEntityImpl& theMeshOnEntity,
+ const VISU::PSubMeshImpl& theSubMesh,
+ const vtkIdType theGeom)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"GetCellsOnSubMesh");
const VISU::TCell2Connect& anArray = theSubMesh->myCell2Connect;
vtkIdType aCellsSize = theSubMesh->myCellsSize;
vtkIdType aNbCells = theSubMesh->myNbCells;
INITMSG(MYDEBUG,"GetCellsOnSubMesh "<<
- "- theGeom = "<<theGeom<<
- "; aNbCells = "<<aNbCells<<
- endl);
+ "- theGeom = "<<theGeom<<
+ "; aNbCells = "<<aNbCells<<
+ endl);
vtkCellArray* aConnectivity = vtkCellArray::New();
aDataArray->SetNumberOfTuples(aNbTuples);
int *aDataArrayPtr = aDataArray->GetPointer(0);
for(int aTupleId = 0; aTupleId < aNbTuples; aTupleId++){
- int anObjID = theSubMesh->GetElemObjID(aTupleId);
+ int anObjID = theSubMesh->GetElemObjID(aTupleId);
*aDataArrayPtr++ = anObjID;
*aDataArrayPtr++ = anEntity;
}
//---------------------------------------------------------------
void
GetCellsOnFamily(const VISU::PUnstructuredGrid& theSource,
- const VISU::PMeshOnEntityImpl& theMeshOnEntity,
- const VISU::PFamilyImpl& theFamily)
+ const VISU::PMeshOnEntityImpl& theMeshOnEntity,
+ const VISU::PFamilyImpl& theFamily)
{
INITMSG(MYDEBUG,"GetCellsOnFamily"<<endl);
const VISU::TGeom2SubMeshID& aGeom2SubMeshID = theFamily->myGeom2SubMeshID;
if(aGeom2SubMeshID.empty())
- EXCEPTION(std::runtime_error,"GetCells >> There is no elements on the family !!!");
+ EXCEPTION(std::runtime_error,"GetCells >> There is no elements on the family !!!");
VISU::TGeom2SubMeshID::const_iterator aGeom2SubMeshIDIter = aGeom2SubMeshID.find(aEGeom);
if(aGeom2SubMeshIDIter == aGeom2SubMeshID.end())
- continue;
+ continue;
const VISU::TSubMeshID& aSubMeshID = aGeom2SubMeshIDIter->second;
INITMSG(MYDEBUG,
- " - aEGeom = "<<aEGeom<<
- "; aVGeom = "<<aVGeom<<
- "; aSubMeshID.size() = "<<aSubMeshID.size()<<
- endl);
+ " - aEGeom = "<<aEGeom<<
+ "; aVGeom = "<<aVGeom<<
+ "; aSubMeshID.size() = "<<aSubMeshID.size()<<
+ endl);
VISU::TSubMeshID::const_iterator aSubMeshIDIter = aSubMeshID.begin();
for(; aSubMeshIDIter != aSubMeshID.end(); aSubMeshIDIter++, aCellId++){
- vtkIdType anID = *aSubMeshIDIter;
- PrintCells( aConnectivity, anArray[ anID ] );
- aCellTypesArray->SetValue(aCellId, (unsigned char)aVGeom);
- vtkIdType anObjID = aSubMesh.GetElemObjID(anID);
- anElemObj2VTKID[anObjID] = aCellId;
- aMeshID[aCellId] = anObjID;
+ vtkIdType anID = *aSubMeshIDIter;
+ PrintCells( aConnectivity, anArray[ anID ] );
+ aCellTypesArray->SetValue(aCellId, (unsigned char)aVGeom);
+ vtkIdType anObjID = aSubMesh.GetElemObjID(anID);
+ anElemObj2VTKID[anObjID] = aCellId;
+ aMeshID[aCellId] = anObjID;
*aDataArrayPtr++ = anObjID;
*aDataArrayPtr++ = anEntity;
}
//---------------------------------------------------------------
void
GetCells(const VISU::PUnstructuredGrid& theSource,
- const VISU::PSubProfileImpl& theSubProfile,
- const VISU::PProfileImpl& theProfile,
- const VISU::PMeshOnEntityImpl& theMeshOnEntity)
+ const VISU::PSubProfileImpl& theSubProfile,
+ const VISU::PProfileImpl& theProfile,
+ const VISU::PMeshOnEntityImpl& theMeshOnEntity)
{
vtkIdType aNbCells = theSubProfile->myNbCells;
vtkIdType aCellsSize = theSubProfile->myCellsSize;
if(theSubProfile->myStatus == VISU::eAddAll){
VISU::TCell2Connect::const_iterator anIter = aCell2Connect.begin();
for(vtkIdType anId = 0, aConnId = 0; anIter != aCell2Connect.end(); anIter++){
- const VISU::TConnect& anArray = aCell2Connect[anId];
- PrintCells( aConnectivity, anArray );
- aCellTypesArray->SetValue(anId,(unsigned char)aVGeom);
- aConnId += aNbNodes;
- anId++;
+ const VISU::TConnect& anArray = aCell2Connect[anId];
+ PrintCells( aConnectivity, anArray );
+ aCellTypesArray->SetValue(anId,(unsigned char)aVGeom);
+ aConnId += aNbNodes;
+ anId++;
}
}else{
VISU::TSubMeshID::const_iterator anIter = aSubMeshID.begin();
for(vtkIdType anId = 0, aConnId = 0; anIter != aSubMeshID.end(); anIter++){
- vtkIdType aSubId = *anIter;
- const VISU::TConnect& anArray = aCell2Connect[aSubId];
- PrintCells( aConnectivity, anArray );
- aCellTypesArray->SetValue(anId,(unsigned char)aVGeom);
- aConnId += aNbNodes;
- anId++;
+ vtkIdType aSubId = *anIter;
+ const VISU::TConnect& anArray = aCell2Connect[aSubId];
+ PrintCells( aConnectivity, anArray );
+ aCellTypesArray->SetValue(anId,(unsigned char)aVGeom);
+ aConnId += aNbNodes;
+ anId++;
}
}
aDataArray->SetNumberOfTuples(aNbTuples);
int *aDataArrayPtr = aDataArray->GetPointer(0);
for(int aTupleId = 0; aTupleId < aNbTuples; aTupleId++){
- int anObjID = theSubProfile->GetElemObjID(aTupleId);
+ int anObjID = theSubProfile->GetElemObjID(aTupleId);
*aDataArrayPtr++ = anObjID;
*aDataArrayPtr++ = anEntity;
}
//---------------------------------------------------------------
void
GetMeshOnSubProfile(const VISU::PMeshImpl& theMesh,
- const VISU::PMeshOnEntityImpl& theMeshOnEntity,
- const VISU::PProfileImpl& theProfile,
- const VISU::PSubProfileImpl& theSubProfile)
+ const VISU::PMeshOnEntityImpl& theMeshOnEntity,
+ const VISU::PProfileImpl& theProfile,
+ const VISU::PSubProfileImpl& theSubProfile)
{
INITMSG(MYDEBUG,"GetMeshOnSubProfile - aEGeom = "<<theSubProfile->myGeom<<endl);
//---------------------------------------------------------------
bool
GetMeshOnProfile(const VISU::PMeshImpl& theMesh,
- const VISU::PMeshOnEntityImpl& theMeshOnEntity,
- const VISU::PProfileImpl& theProfile)
+ const VISU::PMeshOnEntityImpl& theMeshOnEntity,
+ const VISU::PProfileImpl& theProfile)
{
- //rnv fix for bug IPAL18514 4x (CRASH after trying to build of presentation):
+ //rnv fix for bug IPAL18514 4x (CRASH after trying to build of presentation):
// throw exection in case if pointer on profile =0
if(!theProfile.get())
EXCEPTION(std::runtime_error,"GetMeshOnProfile: theProfile.get() == NULL");
VISU::TGeom2SubProfile::const_iterator anIter = aGeom2SubProfile.begin();
for(vtkIdType anInputID = 0, aCellID = 0; anIter != aGeom2SubProfile.end(); anIter++){
- VISU::PSubProfileImpl aSubProfile = anIter->second;
- if(aSubProfile->myStatus == VISU::eRemoveAll)
- continue;
-
- GetMeshOnSubProfile(theMesh,
- theMeshOnEntity,
- theProfile,
- aSubProfile);
-
- const VISU::PUnstructuredGrid& aSource = aSubProfile->GetSource();
- anAppendFilter->AddInput(aSource.GetPointer());
-
- vtkIdType aNbCells = aSource->GetNumberOfCells();
- for(vtkIdType aCell = 0; aCell < aNbCells; aCell++, aCellID++){
- vtkIdType anObjID = aSubProfile->GetElemObjID(aCell);
- anElemObj2VTKID[anObjID] = aCellID;
- }
-
- aSubProfileArr[anInputID++] = aSubProfile;
+ VISU::PSubProfileImpl aSubProfile = anIter->second;
+ if(aSubProfile->myStatus == VISU::eRemoveAll)
+ continue;
+
+ GetMeshOnSubProfile(theMesh,
+ theMeshOnEntity,
+ theProfile,
+ aSubProfile);
+
+ const VISU::PUnstructuredGrid& aSource = aSubProfile->GetSource();
+ anAppendFilter->AddInput(aSource.GetPointer());
+
+ vtkIdType aNbCells = aSource->GetNumberOfCells();
+ for(vtkIdType aCell = 0; aCell < aNbCells; aCell++, aCellID++){
+ vtkIdType anObjID = aSubProfile->GetElemObjID(aCell);
+ anElemObj2VTKID[anObjID] = aCellID;
+ }
+
+ aSubProfileArr[anInputID++] = aSubProfile;
}
}
anAppendFilter->Update(); // Fix on VTK
//---------------------------------------------------------------
void
GetGaussSubMeshSource(const VISU::PPolyData& theSource,
- const VISU::PGaussSubMeshImpl& theGaussSubMesh,
- const VISU::PMeshOnEntityImpl& theMeshOnEntity)
+ const VISU::PGaussSubMeshImpl& theGaussSubMesh,
+ const VISU::PMeshOnEntityImpl& theMeshOnEntity)
{
vtkCellArray* aConnectivity = vtkCellArray::New();
vtkIdType aCellsSize = theGaussSubMesh->myCellsSize;
aDataArray->SetNumberOfTuples(aNbTuples);
int *aDataArrayPtr = aDataArray->GetPointer(0);
for(vtkIdType aTupleId = 0; aTupleId < aNbTuples; aTupleId++){
- vtkIdType aGlobalID = theGaussSubMesh->GetGlobalID(aTupleId);
- *aDataArrayPtr++ = aGlobalID;
- *aDataArrayPtr++ = 0;
+ vtkIdType aGlobalID = theGaussSubMesh->GetGlobalID(aTupleId);
+ *aDataArrayPtr++ = aGlobalID;
+ *aDataArrayPtr++ = 0;
}
aSource->GetPointData()->AddArray(aDataArray);
aDataArray->Delete();
aDataArray->SetNumberOfTuples(aNbTuples);
int *aDataArrayPtr = aDataArray->GetPointer(0);
for(vtkIdType aTupleId = 0; aTupleId < aNbTuples; aTupleId++){
- VISU::TGaussPointID aGaussPointID = theGaussSubMesh->GetObjID(aTupleId);
- *aDataArrayPtr++ = aGaussPointID.first;
- *aDataArrayPtr++ = aGaussPointID.second;
+ VISU::TGaussPointID aGaussPointID = theGaussSubMesh->GetObjID(aTupleId);
+ *aDataArrayPtr++ = aGaussPointID.first;
+ *aDataArrayPtr++ = aGaussPointID.second;
}
aSource->GetCellData()->AddArray(aDataArray);
aDataArray->Delete();
//---------------------------------------------------------------
void
GetGaussSubMesh(const VISU::PMeshImpl& theMesh,
- const VISU::PMeshOnEntityImpl& theMeshOnEntity,
- const VISU::PGaussMeshImpl& theGaussMesh,
- const VISU::PGaussSubMeshImpl& theGaussSubMesh)
+ const VISU::PMeshOnEntityImpl& theMeshOnEntity,
+ const VISU::PGaussMeshImpl& theGaussMesh,
+ const VISU::PGaussSubMeshImpl& theGaussSubMesh)
{
VISU::PGaussImpl aGauss = theGaussSubMesh->myGauss;
//---------------------------------------------------------------
void
BuildGaussMesh(const VISU::PMeshImpl& theMesh,
- const VISU::PMeshOnEntityImpl& theMeshOnEntity,
- const VISU::PGaussMeshImpl& theGaussMesh)
+ const VISU::PMeshOnEntityImpl& theMeshOnEntity,
+ const VISU::PGaussMeshImpl& theGaussMesh)
{
if(theGaussMesh->myIsVTKDone)
return;
for(vtkIdType aStartID = 0; anIter != aGeom2GaussSubMesh.end(); anIter++){
VISU::PGaussSubMeshImpl aGaussSubMesh = anIter->second;
if(aGaussSubMesh->myStatus == VISU::eRemoveAll)
- continue;
+ continue;
aGaussSubMesh->myStartID = aStartID;
GetGaussSubMesh(theMesh,
- theMeshOnEntity,
- theGaussMesh,
- aGaussSubMesh);
+ theMeshOnEntity,
+ theGaussMesh,
+ aGaussSubMesh);
const VISU::PPolyData& aSource = aGaussSubMesh->GetSource();
aStartID += aSource->GetNumberOfCells();
VISU::PNamedIDMapper
VISU_Convertor_impl
::GetMeshOnEntity(const std::string& theMeshName,
- const VISU::TEntity& theEntity)
+ const VISU::TEntity& theEntity)
{
INITMSG(MYDEBUG,"GetMeshOnEntity"<<
- "; theMeshName = '"<<theMeshName<<"'"<<
- "; theEntity = "<<theEntity<<
- endl);
+ "; theMeshName = '"<<theMeshName<<"'"<<
+ "; theEntity = "<<theEntity<<
+ endl);
//Cheching possibility do the query
TFindMeshOnEntity aFindMeshOnEntity =
aSubMeshArr.resize(aGeom2SubMesh.size());
for(vtkIdType anID = 0, aCellID = 0; anIter != aGeom2SubMesh.end(); anIter++, anID++){
- VISU::EGeometry aEGeom = anIter->first;
- vtkIdType aVGeom = VISUGeom2VTK(aEGeom);
- VISU::PSubMeshImpl aSubMesh = anIter->second;
+ VISU::EGeometry aEGeom = anIter->first;
+ vtkIdType aVGeom = VISUGeom2VTK(aEGeom);
+ VISU::PSubMeshImpl aSubMesh = anIter->second;
- aSubMesh->CopyStructure( aMesh );
+ aSubMesh->CopyStructure( aMesh );
- aSubMesh->myStartID = aCellID;
+ aSubMesh->myStartID = aCellID;
- const VISU::PUnstructuredGrid& aSource = aSubMesh->GetSource();
- GetCellsOnSubMesh(aSource, aMeshOnEntity, aSubMesh, aVGeom);
- anAppendFilter->AddInput(aSource.GetPointer());
-
- vtkIdType aNbCells = aSource->GetNumberOfCells();
- for(vtkIdType aCell = 0; aCell < aNbCells; aCell++, aCellID++){
- vtkIdType anObjID = aSubMesh->GetElemObjID(aCell);
- anElemObj2VTKID[anObjID] = aCellID;
- }
+ const VISU::PUnstructuredGrid& aSource = aSubMesh->GetSource();
+ GetCellsOnSubMesh(aSource, aMeshOnEntity, aSubMesh, aVGeom);
+ anAppendFilter->AddInput(aSource.GetPointer());
+
+ vtkIdType aNbCells = aSource->GetNumberOfCells();
+ for(vtkIdType aCell = 0; aCell < aNbCells; aCell++, aCellID++){
+ vtkIdType anObjID = aSubMesh->GetElemObjID(aCell);
+ anElemObj2VTKID[anObjID] = aCellID;
+ }
- aSubMeshArr[anID] = aSubMesh;
+ aSubMeshArr[anID] = aSubMesh;
}
aMeshOnEntity->CopyStructure( aMesh );
aMeshOnEntity->myIsVTKDone = true;
if(MYDEBUGWITHFILES){
- std::string aMeshName = (const char*)QString(theMeshName.c_str()).simplified().toLatin1();
- std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-";
- aFileName += aMeshName + dtos("-%d-",int(theEntity)) + "-MeshOnEntity.vtk";
- VISU::WriteToFile(anAppendFilter->GetOutput(),aFileName);
+ std::string aMeshName = (const char*)QString(theMeshName.c_str()).simplified().toLatin1();
+ std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-";
+ aFileName += aMeshName + dtos("-%d-",int(theEntity)) + "-MeshOnEntity.vtk";
+ VISU::WriteToFile(anAppendFilter->GetOutput(),aFileName);
}
if(MYVTKDEBUG){
- GetMeshOnEntitySize(theMeshName,theEntity);
- PrintMemorySize(anAppendFilter->GetOutput());
+ GetMeshOnEntitySize(theMeshName,theEntity);
+ PrintMemorySize(anAppendFilter->GetOutput());
}
}
VISU::PUnstructuredGridIDMapper
VISU_Convertor_impl
::GetFamilyOnEntity(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFamilyName)
+ const VISU::TEntity& theEntity,
+ const std::string& theFamilyName)
{
INITMSG(MYDEBUG,"GetFamilyOnEntity"<<
- "; theMeshName = '"<<theMeshName<<"'"<<
- "; theEntity = "<<theEntity<<
- "; theFamilyName = '"<<theFamilyName<<"'"<<
- endl);
+ "; theMeshName = '"<<theMeshName<<"'"<<
+ "; theEntity = "<<theEntity<<
+ "; theFamilyName = '"<<theFamilyName<<"'"<<
+ endl);
//Cheching possibility do the query
TFindFamilyOnEntity aFindFamilyOnEntity =
aFamily->myIsVTKDone = true;
if(MYDEBUGWITHFILES){
- std::string aMeshName = (const char*)QString(theMeshName.c_str()).simplified().toLatin1();
- std::string aFamilyName = (const char*)QString(theFamilyName.c_str()).simplified().toLatin1();
- std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-";
- aFileName += aMeshName + dtos("-%d-",int(theEntity)) + aFamilyName + "-FamilyOnEntity.vtk";
- VISU::WriteToFile(aSource.GetPointer(),aFileName);
+ std::string aMeshName = (const char*)QString(theMeshName.c_str()).simplified().toLatin1();
+ std::string aFamilyName = (const char*)QString(theFamilyName.c_str()).simplified().toLatin1();
+ std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-";
+ aFileName += aMeshName + dtos("-%d-",int(theEntity)) + aFamilyName + "-FamilyOnEntity.vtk";
+ VISU::WriteToFile(aSource.GetPointer(),aFileName);
}
if(MYVTKDEBUG){
- GetFamilyOnEntitySize(theMeshName,theEntity,theFamilyName);
- PrintMemorySize(aSource.GetPointer());
+ GetFamilyOnEntitySize(theMeshName,theEntity,theFamilyName);
+ PrintMemorySize(aSource.GetPointer());
}
}
VISU::PUnstructuredGridIDMapper
VISU_Convertor_impl
::GetMeshOnGroup(const std::string& theMeshName,
- const std::string& theGroupName)
+ const std::string& theGroupName)
{
INITMSG(MYDEBUG,"GetMeshOnGroup\n");
INITMSGA(MYDEBUG,0,
- "- theMeshName = '"<<theMeshName<<
- "'; theGroupName = '"<<theGroupName<<"'"<<
- endl);
+ "- theMeshName = '"<<theMeshName<<
+ "'; theGroupName = '"<<theGroupName<<"'"<<
+ endl);
//Cheching possibility do the query
TFindMeshOnGroup aFindMeshOnGroup = FindMeshOnGroup(theMeshName,theGroupName);
aFamilyArr.resize(aFamilySet.size());
for(vtkIdType anID = 0; anIter != aFamilySet.end(); anIter++, anID++){
- VISU::PFamilyImpl aFamily = *anIter;
- const std::string& aFamilyName = aFamily->myName;
- const VISU::TEntity& anEntity = aFamily->myEntity;
-
- VISU::PIDMapper anIDMapper = GetFamilyOnEntity(theMeshName,anEntity,aFamilyName);
- vtkDataSet* anOutput = anIDMapper->GetOutput();
- anAppendFilter->AddInput(anOutput);
-
- vtkIdType aStartID = anElemObj2VTKID.size();
- vtkIdType aNbCells = anOutput->GetNumberOfCells();
- for(vtkIdType aCellID = 0; aCellID < aNbCells; aCellID++){
- anElemObj2VTKID[aFamily->GetElemObjID(aCellID)] = aStartID + aCellID;
- }
- aFamilyArr[anID] = aFamily;
+ VISU::PFamilyImpl aFamily = *anIter;
+ const std::string& aFamilyName = aFamily->myName;
+ const VISU::TEntity& anEntity = aFamily->myEntity;
+
+ VISU::PIDMapper anIDMapper = GetFamilyOnEntity(theMeshName,anEntity,aFamilyName);
+ vtkDataSet* anOutput = anIDMapper->GetOutput();
+ anAppendFilter->AddInput(anOutput);
+
+ vtkIdType aStartID = anElemObj2VTKID.size();
+ vtkIdType aNbCells = anOutput->GetNumberOfCells();
+ for(vtkIdType aCellID = 0; aCellID < aNbCells; aCellID++){
+ anElemObj2VTKID[aFamily->GetElemObjID(aCellID)] = aStartID + aCellID;
+ }
+ aFamilyArr[anID] = aFamily;
}
aGroup->CopyStructure( aMesh );
aGroup->myIsVTKDone = true;
if(MYDEBUGWITHFILES){
- std::string aMeshName = (const char*)QString(theMeshName.c_str()).simplified().toLatin1();
- std::string aGroupName = (const char*)QString(theGroupName.c_str()).simplified().toLatin1();
- std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-";
- aFileName += aMeshName + "-" + aGroupName + "-MeshOnGroup.vtk";
- VISU::WriteToFile(anAppendFilter->GetOutput(),aFileName);
+ std::string aMeshName = (const char*)QString(theMeshName.c_str()).simplified().toLatin1();
+ std::string aGroupName = (const char*)QString(theGroupName.c_str()).simplified().toLatin1();
+ std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-";
+ aFileName += aMeshName + "-" + aGroupName + "-MeshOnGroup.vtk";
+ VISU::WriteToFile(anAppendFilter->GetOutput(),aFileName);
}
}
#ifndef _DEXCEPT_
vtkUnstructuredGrid*
VISU_Convertor_impl
::GetTimeStampOnProfile( const VISU::PMeshImpl& theMesh,
- const VISU::PMeshOnEntityImpl& theMeshOnEntity,
- const VISU::PFieldImpl& theField,
- const VISU::PValForTimeImpl& theValForTime,
- const VISU::PUnstructuredGridIDMapperImpl& theUnstructuredGridIDMapper,
- const VISU::PProfileImpl& theProfile,
- const VISU::TEntity& theEntity )
+ const VISU::PMeshOnEntityImpl& theMeshOnEntity,
+ const VISU::PFieldImpl& theField,
+ const VISU::PValForTimeImpl& theValForTime,
+ const VISU::PUnstructuredGridIDMapperImpl& theUnstructuredGridIDMapper,
+ const VISU::PProfileImpl& theProfile,
+ const VISU::TEntity& theEntity )
{
LoadMeshOnEntity( theMesh, theMeshOnEntity );
GetMeshOnEntity( theMeshOnEntity->myMeshName, theMeshOnEntity->myEntity );
const VISU::EGeometry& aGeom = aSubProfileIter->first;
const VISU::PSubProfileImpl& aSubProfile = aSubProfileIter->second;
if ( aSubProfile->myStatus == VISU::eAddPart && aGeom == VISU::ePOINT1 ) {
- const VISU::TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap;
- VISU::TMeshOnEntityMap::const_reverse_iterator aMeshOnEntityIter = aMeshOnEntityMap.rbegin();
- for( ; aMeshOnEntityIter != aMeshOnEntityMap.rend(); aMeshOnEntityIter++ ) {
- VISU::TEntity anEntity = aMeshOnEntityIter->first;
- if ( anEntity == VISU::NODE_ENTITY )
- continue;
- VISU::PNamedIDMapper aNamedIDMapper = GetMeshOnEntity( theMesh->myName, anEntity );
- if( aNamedIDMapper ) {
- theUnstructuredGridIDMapper->SetReferencedMesh( aNamedIDMapper );
- VISU::PUnstructuredGrid aSource = theUnstructuredGridIDMapper->GetSource();
- VISU::GetTimeStampOnProfile( aSource, theField, theValForTime, theEntity );
-
- return theUnstructuredGridIDMapper->GetUnstructuredGridOutput();
- }
- }
+ const VISU::TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap;
+ VISU::TMeshOnEntityMap::const_reverse_iterator aMeshOnEntityIter = aMeshOnEntityMap.rbegin();
+ for( ; aMeshOnEntityIter != aMeshOnEntityMap.rend(); aMeshOnEntityIter++ ) {
+ VISU::TEntity anEntity = aMeshOnEntityIter->first;
+ if ( anEntity == VISU::NODE_ENTITY )
+ continue;
+ VISU::PNamedIDMapper aNamedIDMapper = GetMeshOnEntity( theMesh->myName, anEntity );
+ if( aNamedIDMapper ) {
+ theUnstructuredGridIDMapper->SetReferencedMesh( aNamedIDMapper );
+ VISU::PUnstructuredGrid aSource = theUnstructuredGridIDMapper->GetSource();
+ VISU::GetTimeStampOnProfile( aSource, theField, theValForTime, theEntity );
+
+ return theUnstructuredGridIDMapper->GetUnstructuredGridOutput();
+ }
+ }
}
}
}
VISU::PUnstructuredGridIDMapper
VISU_Convertor_impl
::GetTimeStampOnMesh( const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theStampsNum )
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theStampsNum )
{
INITMSG(MYDEBUG,"GetTimeStampOnMesh"<<
- "; theMeshName = '"<<theMeshName<<"'"<<
- "; theEntity = "<<theEntity<<
- "; theFieldName = '"<<theFieldName<<"'"<<
- "; theStampsNum = "<<theStampsNum<<
- endl);
+ "; theMeshName = '"<<theMeshName<<"'"<<
+ "; theEntity = "<<theEntity<<
+ "; theFieldName = '"<<theFieldName<<"'"<<
+ "; theStampsNum = "<<theStampsNum<<
+ endl);
//Cheching possibility do the query
TFindTimeStamp aFindTimeStamp = FindTimeStamp(theMeshName,
- theEntity,
- theFieldName,
- theStampsNum);
+ theEntity,
+ theFieldName,
+ theStampsNum);
VISU::PMeshImpl aMesh = boost::get<0>(aFindTimeStamp);
VISU::PMeshOnEntityImpl aMeshOnEntity = boost::get<1>(aFindTimeStamp);
vtkUnstructuredGrid* anOutput = NULL;
try{
- anOutput = GetTimeStampOnProfile(aMesh,
- aVTKMeshOnEntity,
- aField,
- aValForTime,
- anUnstructuredGridIDMapper,
- aValForTime->myProfile,
- aMeshOnEntity->myEntity);
+ anOutput = GetTimeStampOnProfile(aMesh,
+ aVTKMeshOnEntity,
+ aField,
+ aValForTime,
+ anUnstructuredGridIDMapper,
+ aValForTime->myProfile,
+ aMeshOnEntity->myEntity);
}catch(std::exception& exc){
- MSG(MYDEBUG,"Follow exception was occured :\n"<<exc.what());
- anOutput = GetTimeStampOnProfile(aMesh,
- aMeshOnEntity,
- aField,
- aValForTime,
- anUnstructuredGridIDMapper,
- aValForTime->myProfile,
- aVTKMeshOnEntity->myEntity);
+ MSG(MYDEBUG,"Follow exception was occured :\n"<<exc.what());
+ anOutput = GetTimeStampOnProfile(aMesh,
+ aMeshOnEntity,
+ aField,
+ aValForTime,
+ anUnstructuredGridIDMapper,
+ aValForTime->myProfile,
+ aVTKMeshOnEntity->myEntity);
}
anUnstructuredGridIDMapper->CopyStructure( aMesh );
anUnstructuredGridIDMapper->myIsVTKDone = true;
if(MYDEBUGWITHFILES){
- std::string aMeshName = (const char*)QString(theMeshName.c_str()).simplified().toLatin1();
- std::string aFieldName = (const char*)QString(theFieldName.c_str()).simplified().toLatin1();
- std::string aPrefix = std::string(getenv("HOME"))+"/"+getenv("USER")+"-";
- std::string aFileName = aPrefix + aMeshName + dtos("-%d-",int(theEntity)) +
- aFieldName + dtos("-%d", theStampsNum) + "-TimeStampOnMesh.vtk";
- VISU::WriteToFile(anOutput,aFileName);
+ std::string aMeshName = (const char*)QString(theMeshName.c_str()).simplified().toLatin1();
+ std::string aFieldName = (const char*)QString(theFieldName.c_str()).simplified().toLatin1();
+ std::string aPrefix = std::string(getenv("HOME"))+"/"+getenv("USER")+"-";
+ std::string aFileName = aPrefix + aMeshName + dtos("-%d-",int(theEntity)) +
+ aFieldName + dtos("-%d", theStampsNum) + "-TimeStampOnMesh.vtk";
+ VISU::WriteToFile(anOutput,aFileName);
}
if(MYVTKDEBUG){
- GetTimeStampSize(theMeshName, theEntity, theFieldName, theStampsNum);
- anOutput->Update();
- if(theEntity == VISU::NODE_ENTITY)
- BEGMSG(MYVTKDEBUG,"GetPointData() = "<<vtkFloatingPointType(anOutput->GetPointData()->GetActualMemorySize()*1000)<<endl);
- else
- BEGMSG(MYVTKDEBUG,"GetCellData() = "<<vtkFloatingPointType(anOutput->GetCellData()->GetActualMemorySize()*1000)<<endl);
- BEGMSG(MYVTKDEBUG,"GetActualMemorySize() = "<<vtkFloatingPointType(anOutput->GetActualMemorySize()*1000)<<endl);
+ GetTimeStampSize(theMeshName, theEntity, theFieldName, theStampsNum);
+ anOutput->Update();
+ if(theEntity == VISU::NODE_ENTITY)
+ BEGMSG(MYVTKDEBUG,"GetPointData() = "<<vtkFloatingPointType(anOutput->GetPointData()->GetActualMemorySize()*1000)<<endl);
+ else
+ BEGMSG(MYVTKDEBUG,"GetCellData() = "<<vtkFloatingPointType(anOutput->GetCellData()->GetActualMemorySize()*1000)<<endl);
+ BEGMSG(MYVTKDEBUG,"GetActualMemorySize() = "<<vtkFloatingPointType(anOutput->GetActualMemorySize()*1000)<<endl);
}
}
#ifndef _DEXCEPT_
VISU::PGaussPtsIDMapper
VISU_Convertor_impl
::GetTimeStampOnGaussPts(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theStampsNum)
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theStampsNum)
{
INITMSG(MYDEBUG,"GetTimeStampOnGaussPts"<<
- "; theMeshName = '"<<theMeshName<<"'"<<
- "; theEntity = "<<theEntity<<
- "; theFieldName = '"<<theFieldName<<"'"<<
- "; theStampsNum = "<<theStampsNum<<
- endl);
+ "; theMeshName = '"<<theMeshName<<"'"<<
+ "; theEntity = "<<theEntity<<
+ "; theFieldName = '"<<theFieldName<<"'"<<
+ "; theStampsNum = "<<theStampsNum<<
+ endl);
if(theEntity == VISU::NODE_ENTITY)
EXCEPTION(std::runtime_error, "It is impossible to reate Gauss Points on NODE_ENTITY !!!");
//Cheching possibility do the query
TFindTimeStamp aFindTimeStamp = FindTimeStamp(theMeshName,
- theEntity,
- theFieldName,
- theStampsNum);
+ theEntity,
+ theFieldName,
+ theStampsNum);
VISU::PMeshImpl aMesh = boost::get<0>(aFindTimeStamp);
VISU::PMeshOnEntityImpl aMeshOnEntity = boost::get<1>(aFindTimeStamp);
VISU::PGaussMeshImpl aGaussMesh = aValForTime->myGaussMesh;
if(!aGaussMesh->myIsVTKDone){
- BuildGaussMesh(aMesh, aVTKMeshOnEntity, aGaussMesh);
- aGaussMesh->myParent = aProfile.get();
- aGaussMesh->myIsVTKDone = true;
+ BuildGaussMesh(aMesh, aVTKMeshOnEntity, aGaussMesh);
+ aGaussMesh->myParent = aProfile.get();
+ aGaussMesh->myIsVTKDone = true;
}
aGaussPtsIDFilter->myIDMapper = aGaussMesh;
aGaussPtsIDFilter->myIsVTKDone = true;
if(MYDEBUGWITHFILES){
- std::string aMeshName = (const char*)QString(theMeshName.c_str()).simplified().toLatin1();
- std::string aFieldName = (const char*)QString(theFieldName.c_str()).simplified().toLatin1();
- std::string aPrefix = std::string(getenv("HOME"))+"/"+getenv("USER")+"-";
- std::string aFileName = aPrefix + aMeshName + dtos("-%d-",int(theEntity)) +
- aFieldName + dtos("-%d",theStampsNum) + "-TimeStampOnGaussPts.vtk";
- VISU::WriteToFile(anOutput, aFileName);
+ std::string aMeshName = (const char*)QString(theMeshName.c_str()).simplified().toLatin1();
+ std::string aFieldName = (const char*)QString(theFieldName.c_str()).simplified().toLatin1();
+ std::string aPrefix = std::string(getenv("HOME"))+"/"+getenv("USER")+"-";
+ std::string aFileName = aPrefix + aMeshName + dtos("-%d-",int(theEntity)) +
+ aFieldName + dtos("-%d",theStampsNum) + "-TimeStampOnGaussPts.vtk";
+ VISU::WriteToFile(anOutput, aFileName);
}
if(MYVTKDEBUG){
- GetTimeStampSize(theMeshName, theEntity, theFieldName, theStampsNum);
- anOutput->Update();
- if(theEntity == VISU::NODE_ENTITY)
- BEGMSG(MYVTKDEBUG,"GetPointData() = "<<vtkFloatingPointType(anOutput->GetPointData()->GetActualMemorySize()*1000)<<endl);
- else
- BEGMSG(MYVTKDEBUG,"GetCellData() = "<<vtkFloatingPointType(anOutput->GetCellData()->GetActualMemorySize()*1000)<<endl);
- BEGMSG(MYVTKDEBUG,"GetActualMemorySize() = "<<vtkFloatingPointType(anOutput->GetActualMemorySize()*1000)<<endl);
+ GetTimeStampSize(theMeshName, theEntity, theFieldName, theStampsNum);
+ anOutput->Update();
+ if(theEntity == VISU::NODE_ENTITY)
+ BEGMSG(MYVTKDEBUG,"GetPointData() = "<<vtkFloatingPointType(anOutput->GetPointData()->GetActualMemorySize()*1000)<<endl);
+ else
+ BEGMSG(MYVTKDEBUG,"GetCellData() = "<<vtkFloatingPointType(anOutput->GetCellData()->GetActualMemorySize()*1000)<<endl);
+ BEGMSG(MYVTKDEBUG,"GetActualMemorySize() = "<<vtkFloatingPointType(anOutput->GetActualMemorySize()*1000)<<endl);
}
}
#ifndef _DEXCEPT_
VISU_Convertor_impl::TFindMeshOnEntity
VISU_Convertor_impl
::FindMeshOnEntity(const std::string& theMeshName,
- const VISU::TEntity& theEntity)
+ const VISU::TEntity& theEntity)
{
VISU::PMeshImpl aMesh = FindMesh(theMeshName);
VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
VISU::PMeshOnEntityImpl aMeshOnEntity = aMeshOnEntityMapIter->second;
return TFindMeshOnEntity(aMesh,
- aMeshOnEntity);
+ aMeshOnEntity);
}
VISU_Convertor_impl::TFindFamilyOnEntity
VISU_Convertor_impl
::FindFamilyOnEntity(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFamilyName)
+ const VISU::TEntity& theEntity,
+ const std::string& theFamilyName)
{
if(theFamilyName != ""){
VISU::PMeshImpl aMesh = FindMesh(theMeshName);
if(aFamilyMapIter != aFamilyMap.end()){
const VISU::PFamily& aFamily = aFamilyMapIter->second;
return TFindFamilyOnEntity(aMesh,
- aMeshOnEntity,
- aFamily);
+ aMeshOnEntity,
+ aFamily);
}
}
return TFindFamilyOnEntity();
const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
VISU::TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin();
for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++){
- const std::string& aFieldName = aFieldMapIter->first;
- const VISU::PField aField = aFieldMapIter->second;
- const VISU::TValField& aValField = aField->myValField;
- VISU::TValField::const_iterator aValFieldIter = aValField.begin();
- for(; aValFieldIter != aValField.end(); aValFieldIter++){
- int aTimeStamp = aValFieldIter->first;
- aResult += GetTimeStampSize(aMeshName,anEntity,aFieldName,aTimeStamp);
- }
+ const std::string& aFieldName = aFieldMapIter->first;
+ const VISU::PField aField = aFieldMapIter->second;
+ const VISU::TValField& aValField = aField->myValField;
+ VISU::TValField::const_iterator aValFieldIter = aValField.begin();
+ for(; aValFieldIter != aValField.end(); aValFieldIter++){
+ int aTimeStamp = aValFieldIter->first;
+ aResult += GetTimeStampSize(aMeshName,anEntity,aFieldName,aTimeStamp);
+ }
}
//Importing groups
const VISU::TGroupMap& aGroupMap = aMesh->myGroupMap;
VISU::TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin();
for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){
- const std::string& aGroupName = aGroupMapIter->first;
- aResult += GetMeshOnGroupSize(aMeshName,aGroupName);
+ const std::string& aGroupName = aGroupMapIter->first;
+ aResult += GetMeshOnGroupSize(aMeshName,aGroupName);
}
//Import families
const VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
- const std::string& aFamilyName = aFamilyMapIter->first;
- aResult += GetFamilyOnEntitySize(aMeshName,anEntity,aFamilyName);
+ const std::string& aFamilyName = aFamilyMapIter->first;
+ aResult += GetFamilyOnEntitySize(aMeshName,anEntity,aFamilyName);
}
//Import mesh on entity
aResult += GetMeshOnEntitySize(aMeshName,anEntity);
size_t
VISU_Convertor_impl
::GetMeshOnEntitySize(const std::string& theMeshName,
- const VISU::TEntity& theEntity)
+ const VISU::TEntity& theEntity)
{
TFindMeshOnEntity aFindMeshOnEntity =
FindMeshOnEntity(theMeshName, theEntity);
size_t
VISU_Convertor_impl
::GetFamilyOnEntitySize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFamilyName)
+ const VISU::TEntity& theEntity,
+ const std::string& theFamilyName)
{
TFindFamilyOnEntity aFindFamilyOnEntity =
FindFamilyOnEntity(theMeshName,theEntity,theFamilyName);
VISU_Convertor_impl::TFindMeshOnGroup
VISU_Convertor_impl
::FindMeshOnGroup(const std::string& theMeshName,
- const std::string& theGroupName)
+ const std::string& theGroupName)
{
VISU::PMeshImpl aMesh = FindMesh(theMeshName);
VISU::TGroupMap& aGroupMap = aMesh->myGroupMap;
size_t
VISU_Convertor_impl
::GetMeshOnGroupSize(const std::string& theMeshName,
- const std::string& theGroupName)
+ const std::string& theGroupName)
{
TFindMeshOnGroup aFindMeshOnGroup = FindMeshOnGroup(theMeshName,theGroupName);
VISU::PMeshImpl aMesh = boost::get<0>(aFindMeshOnGroup);
VISU_Convertor_impl::TFindField
VISU_Convertor_impl
::FindField(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName)
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName)
{
TFindMeshOnEntity aFindMeshOnEntity =
FindMeshOnEntity(theMeshName,theEntity);
VISU::PFieldImpl aField = aFieldIter->second;
return TFindField( aMesh,
- aMeshOnEntity,
- aVTKMeshOnEntity,
- aField );
+ aMeshOnEntity,
+ aVTKMeshOnEntity,
+ aField );
}
size_t
VISU_Convertor_impl
::GetFieldOnMeshSize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName)
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName)
{
TFindField aFindField = FindField(theMeshName,theEntity,theFieldName);
VISU::PMeshOnEntityImpl aVTKMeshOnEntity = boost::get<2>(aFindField);
VISU_Convertor_impl::TFindTimeStamp
VISU_Convertor_impl
::FindTimeStamp(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theStampsNum)
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theStampsNum)
{
TFindField aFindField = FindField(theMeshName,theEntity,theFieldName);
VISU::PField aField = boost::get<3>(aFindField);
VISU::PValForTimeImpl aValForTime = aValFieldIter->second;
return TFindTimeStamp(aMesh,
- aMeshOnEntity,
- aVTKMeshOnEntity,
- aField,
- aValForTime);
+ aMeshOnEntity,
+ aVTKMeshOnEntity,
+ aField,
+ aValForTime);
}
size_t
VISU_Convertor_impl
::GetTimeStampSize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theStampsNum)
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theStampsNum)
{
TFindTimeStamp aFindTimeStamp =
FindTimeStamp(theMeshName,theEntity,theFieldName,theStampsNum);
size_t
VISU_Convertor_impl
::GetTimeStampOnMeshSize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber,
- bool& theIsEstimated)
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber,
+ bool& theIsEstimated)
{
size_t aSize = 0;
//Cheching possibility do the query
TFindTimeStamp aFindTimeStamp = FindTimeStamp(theMeshName,
- theEntity,
- theFieldName,
- theTimeStampNumber);
+ theEntity,
+ theFieldName,
+ theTimeStampNumber);
VISU::PValForTimeImpl aValForTime = boost::get<4>(aFindTimeStamp);
VISU::PUnstructuredGridIDMapperImpl anUnstructuredGridIDMapper = aValForTime->myUnstructuredGridIDMapper;
if(anUnstructuredGridIDMapper->myIsVTKDone){
VISU::PIDMapper anIDMapper = GetTimeStampOnMesh(theMeshName,
- theEntity,
- theFieldName,
- theTimeStampNumber);
+ theEntity,
+ theFieldName,
+ theTimeStampNumber);
anIDMapper->GetOutput();
aSize += anIDMapper->GetMemorySize();
}else
size_t
VISU_Convertor_impl
::GetTimeStampOnGaussPtsSize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber,
- bool& theIsEstimated)
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber,
+ bool& theIsEstimated)
{
size_t aSize = 0;
//Cheching possibility do the query
TFindTimeStamp aFindTimeStamp = FindTimeStamp(theMeshName,
- theEntity,
- theFieldName,
- theTimeStampNumber);
+ theEntity,
+ theFieldName,
+ theTimeStampNumber);
VISU::PValForTimeImpl aValForTime = boost::get<4>(aFindTimeStamp);
VISU::PGaussPtsIDFilter aGaussPtsIDFilter = aValForTime->myGaussPtsIDFilter;
if(aGaussPtsIDFilter->myIsVTKDone){
VISU::PGaussPtsIDMapper aGaussPtsIDMapper = GetTimeStampOnGaussPts(theMeshName,
- theEntity,
- theFieldName,
- theTimeStampNumber);
+ theEntity,
+ theFieldName,
+ theTimeStampNumber);
aGaussPtsIDMapper->GetOutput();
aSize += aGaussPtsIDMapper->GetMemorySize();
}else
const VISU::PField
VISU_Convertor_impl
::GetField(const std::string& theMeshName,
- VISU::TEntity theEntity,
- const std::string& theFieldName)
+ VISU::TEntity theEntity,
+ const std::string& theFieldName)
{
TFindField aFindField = FindField(theMeshName,theEntity,theFieldName);
VISU::PField aField = boost::get<3>(aFindField);
const VISU::PValForTime
VISU_Convertor_impl
::GetTimeStamp(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theStampsNum)
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theStampsNum)
{
TFindTimeStamp aFindTimeStamp =
FindTimeStamp(theMeshName,theEntity,theFieldName,theStampsNum);
virtual
VISU::PNamedIDMapper
GetMeshOnEntity(const std::string& theMeshName,
- const VISU::TEntity& theEntity);
+ const VISU::TEntity& theEntity);
//! Implemention of the VISU_Convertor::GetMeshOnEntitySize
virtual
size_t
GetMeshOnEntitySize(const std::string& theMeshName,
- const VISU::TEntity& theEntity);
+ const VISU::TEntity& theEntity);
//! Implemention of the VISU_Convertor::GetFamilyOnEntity
virtual
VISU::PUnstructuredGridIDMapper
GetFamilyOnEntity(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFamilyName);
+ const VISU::TEntity& theEntity,
+ const std::string& theFamilyName);
//! Implemention of the VISU_Convertor::GetFamilyOnEntitySize
virtual
size_t
GetFamilyOnEntitySize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFamilyName);
+ const VISU::TEntity& theEntity,
+ const std::string& theFamilyName);
//! Implemention of the VISU_Convertor::GetMeshOnGroup
virtual
VISU::PUnstructuredGridIDMapper
GetMeshOnGroup(const std::string& theMeshName,
- const std::string& theGroupName);
+ const std::string& theGroupName);
//! Implemention of the VISU_Convertor::GetMeshOnGroupSize
virtual
size_t
GetMeshOnGroupSize(const std::string& theMeshName,
- const std::string& theGroupName);
+ const std::string& theGroupName);
//! Implemention of the VISU_Convertor::GetTimeStampOnMesh
virtual
VISU::PUnstructuredGridIDMapper
GetTimeStampOnMesh( const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber );
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber );
//! Get amount of memory to build vtkDataSet for corresponding MED TIMESTAMP on mesh
virtual
size_t
GetTimeStampOnMeshSize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber,
- bool& theIsEstimated);
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber,
+ bool& theIsEstimated);
//! Get amount of memory to build vtkDataSet for corresponding MED TIMESTAMP on Gauss Points
virtual
size_t
GetTimeStampOnGaussPtsSize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber,
- bool& theIsEstimated);
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber,
+ bool& theIsEstimated);
//! Implemention of the VISU_Convertor::GetTimeStampOnGaussPts
virtual
VISU::PGaussPtsIDMapper
GetTimeStampOnGaussPts(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber);
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber);
//! Implemention of the VISU_Convertor::GetFieldOnMeshSize
virtual
size_t
GetFieldOnMeshSize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName);
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName);
//! Implemention of the VISU_Convertor::GetField
virtual
const VISU::PField
GetField(const std::string& theMeshName,
- VISU::TEntity theEntity,
- const std::string& theFieldName);
+ VISU::TEntity theEntity,
+ const std::string& theFieldName);
//! Implemention of the VISU_Convertor::GetTimeStamp
virtual
const VISU::PValForTime
GetTimeStamp(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theStampsNum);
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theStampsNum);
protected:
//! An utility method to find TMesh by its name
//! An utility method to find TMeshOnEntity by name of its parent mesh and entity
typedef boost::tuple<VISU::PMeshImpl,
- VISU::PMeshOnEntityImpl> TFindMeshOnEntity;
+ VISU::PMeshOnEntityImpl> TFindMeshOnEntity;
TFindMeshOnEntity
FindMeshOnEntity(const std::string& theMeshName,
- const VISU::TEntity& theEntity);
+ const VISU::TEntity& theEntity);
//! An utility method to find TFamily by name of its parent mesh, corresponding entity and its name
typedef boost::tuple<VISU::PMeshImpl,
- VISU::PMeshOnEntityImpl,VISU::PFamilyImpl> TFindFamilyOnEntity;
+ VISU::PMeshOnEntityImpl,VISU::PFamilyImpl> TFindFamilyOnEntity;
TFindFamilyOnEntity
FindFamilyOnEntity(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFamilyName);
+ const VISU::TEntity& theEntity,
+ const std::string& theFamilyName);
//! An utility method to find Group by name of its parent mesh and its name
typedef boost::tuple<VISU::PMeshImpl,
- VISU::PGroupImpl> TFindMeshOnGroup;
+ VISU::PGroupImpl> TFindMeshOnGroup;
TFindMeshOnGroup
FindMeshOnGroup(const std::string& theMeshName,
- const std::string& theGroupName);
+ const std::string& theGroupName);
//! An utility method to find TField by name of its parent mesh, corresponding entity and its name
typedef boost::tuple<VISU::PMeshImpl,
- VISU::PMeshOnEntityImpl,
- VISU::PMeshOnEntityImpl,
- VISU::PFieldImpl> TFindField;
+ VISU::PMeshOnEntityImpl,
+ VISU::PMeshOnEntityImpl,
+ VISU::PFieldImpl> TFindField;
TFindField
FindField( const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName );
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName );
//! An utility method to find TTimeStamp by name of its parent mesh, corresponding entity, field name and its number
typedef boost::tuple<VISU::PMeshImpl,
- VISU::PMeshOnEntityImpl,
- VISU::PMeshOnEntityImpl,
- VISU::PFieldImpl,
- VISU::PValForTimeImpl> TFindTimeStamp;
+ VISU::PMeshOnEntityImpl,
+ VISU::PMeshOnEntityImpl,
+ VISU::PFieldImpl,
+ VISU::PValForTimeImpl> TFindTimeStamp;
TFindTimeStamp
FindTimeStamp(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theStampsNum);
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theStampsNum);
vtkUnstructuredGrid*
GetTimeStampOnProfile( const VISU::PMeshImpl& theMesh,
- const VISU::PMeshOnEntityImpl& theMeshOnEntity,
- const VISU::PFieldImpl& theField,
- const VISU::PValForTimeImpl& theValForTime,
- const VISU::PUnstructuredGridIDMapperImpl& theIDMapperFilter,
- const VISU::PProfileImpl& theProfile,
- const VISU::TEntity& theEntity );
+ const VISU::PMeshOnEntityImpl& theMeshOnEntity,
+ const VISU::PFieldImpl& theField,
+ const VISU::PValForTimeImpl& theValForTime,
+ const VISU::PUnstructuredGridIDMapperImpl& theIDMapperFilter,
+ const VISU::PProfileImpl& theProfile,
+ const VISU::TEntity& theEntity );
protected:
//! Implemention of the VISU_Convertor::GetTimeStampSize
virtual
size_t
GetTimeStampSize(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theStampsNum);
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theStampsNum);
//! To fill intermeiate representation of TMeshOnEntity from a MED source
virtual
int
LoadMeshOnEntity(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity) = 0;
+ VISU::PMeshOnEntityImpl theMeshOnEntity) = 0;
//! To fill intermeiate representation of TFamily from a MED source
virtual
int
LoadFamilyOnEntity(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity,
- VISU::PFamilyImpl theFamily) = 0;
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFamilyImpl theFamily) = 0;
//! To fill intermeiate representation of TGroup from a MED source
virtual
int
LoadMeshOnGroup(VISU::PMeshImpl theMesh,
- const VISU::TFamilySet& theFamilySet) = 0;
+ const VISU::TFamilySet& theFamilySet) = 0;
//! To fill intermeiate representation of TValForTime for ordinary mesh from a MED source
virtual
int
LoadValForTimeOnMesh(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity,
- VISU::PFieldImpl theField,
- VISU::PValForTimeImpl theValForTime) = 0;
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFieldImpl theField,
+ VISU::PValForTimeImpl theValForTime) = 0;
//! To fill intermeiate representation of TValForTime for mesh on Gauss Points from a MED source
virtual
int
LoadValForTimeOnGaussPts(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity,
- VISU::PFieldImpl theField,
- VISU::PValForTimeImpl theValForTime) = 0;
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFieldImpl theField,
+ VISU::PValForTimeImpl theValForTime) = 0;
};
#endif
//----------------------------------------------------------------------------
TGetElnoNodeData( vtkDataArray *theElnoDataArray,
- vtkDataArray *theElnoDataMapper )
+ vtkDataArray *theElnoDataMapper )
: myElnoDataArray( TVTKDataArray::SafeDownCast( theElnoDataArray ) )
, myElnoDataMapper( vtkIntArray::SafeDownCast( theElnoDataMapper ) )
{}
//----------------------------------------------------------------------------------------------
TSetElnoNodeData( vtkIdType theEffectNbComp,
- vtkIdType theRealNbComp,
- vtkIdType theNbTuples,
- const char* theDataArrayName,
- const char* theMapperArrayName )
+ vtkIdType theRealNbComp,
+ vtkIdType theNbTuples,
+ const char* theDataArrayName,
+ const char* theMapperArrayName )
: myElnoDataArray( TVTKDataArray::New() )
, myElnoDataMapper( vtkIntArray::New() )
{
TDataType* aDataPtr = myElnoDataArray->GetPointer( aPos );
for ( vtkIdType aCompId = 0; aCompId < myElemInfo[ 1 ]; aCompId++ )
- *aDataPtr++ = *theDataPtr++;
+ *aDataPtr++ = *theDataPtr++;
return myElemInfo[ 2 ]++;
}
namespace{
inline void InsertCell(vtkUnstructuredGrid *theInput,
- vtkUnstructuredGrid *theOutput,
- vtkIdType theCellId, vtkIdList *theCellIds)
+ vtkUnstructuredGrid *theOutput,
+ vtkIdType theCellId, vtkIdList *theCellIds)
{
theCellIds->Reset();
vtkCell *aCell = theInput->GetCell(theCellId);
else if(!myRemovedCellIds.empty() && myRemovedCellTypes.empty()){
for(vtkIdType aCellId = 0; aCellId < aNbCells; aCellId++)
if(myRemovedCellIds.find(aCellId) == myRemovedCellIds.end())
- InsertCell(anInput,anOutput,aCellId,aCellIds);
+ InsertCell(anInput,anOutput,aCellId,aCellIds);
}else if(myRemovedCellIds.empty() && !myRemovedCellTypes.empty()){
for(vtkIdType aCellId = 0; aCellId < aNbCells; aCellId++)
if(myRemovedCellTypes.find(anInput->GetCellType(aCellId)) == myRemovedCellTypes.end())
- InsertCell(anInput,anOutput,aCellId,aCellIds);
+ InsertCell(anInput,anOutput,aCellId,aCellIds);
}else if(!myRemovedCellIds.empty() && !myRemovedCellTypes.empty())
for(vtkIdType aCellId = 0; aCellId < aNbCells; aCellId++)
if(myRemovedCellTypes.find(anInput->GetCellType(aCellId)) == myRemovedCellTypes.end())
- if(myRemovedCellIds.find(aCellId) == myRemovedCellIds.end())
- InsertCell(anInput,anOutput,aCellId,aCellIds);
+ if(myRemovedCellIds.find(aCellId) == myRemovedCellIds.end())
+ InsertCell(anInput,anOutput,aCellId,aCellIds);
aCellIds->Delete();
anOutput->SetPoints(anInput->GetPoints());
MSG(MYDEBUG,"Execute - anOutput->GetNumberOfCells() = "<<anOutput->GetNumberOfCells());
int
VISU_GaussMergeFilter
::RequestData(vtkInformation *theRequest,
- vtkInformationVector **theInputVector,
- vtkInformationVector *theOutputVector)
+ vtkInformationVector **theInputVector,
+ vtkInformationVector *theOutputVector)
{
if(vtkUnstructuredGrid *anInput = dynamic_cast<vtkUnstructuredGrid*>(this->GetInput())){
vtkPolyData *anOutput = dynamic_cast<vtkPolyData*>(this->GetOutput());
return ExecuteGauss(anInput,
- anOutput);
+ anOutput);
}
return Superclass::RequestData(theRequest,
- theInputVector,
- theOutputVector);
+ theInputVector,
+ theOutputVector);
}
//----------------------------------------------------------------------------
int
VISU_GaussMergeFilter
::RequestUpdateExtent(vtkInformation *vtkNotUsed(request),
- vtkInformationVector **inputVector,
- vtkInformationVector *vtkNotUsed(outputVector))
+ vtkInformationVector **inputVector,
+ vtkInformationVector *vtkNotUsed(outputVector))
{
vtkInformation *inputInfo;
int idx;
bool
VISU_GaussMergeFilter
::ExecuteGauss(vtkUnstructuredGrid* theInput,
- vtkPolyData* theOutput)
+ vtkPolyData* theOutput)
{
if(IsMergingInputs()){
vtkCellData *aCellData = theInput->GetCellData();
vtkIntArray *aGeometryCellMapper = dynamic_cast<vtkIntArray*>(aCellMapper);
vtkIntArray* aDataPointMapper = GetIDMapper(FieldList,
- VISU::TGetPointData(),
- "VISU_POINTS_MAPPER");
+ VISU::TGetPointData(),
+ "VISU_POINTS_MAPPER");
vtkIntArray* aDataCellIds = vtkIntArray::New();
aDataCellIds->SetNumberOfTuples(nbPoints);
int* aDataCellPointer = aDataCellIds->GetPointer(0);
{
- int nbPoints = aDataPointMapper->GetNumberOfTuples();
- for(int i=0;i<nbPoints;i++,aDataCellPointer++){
- VISU::TGaussPointID aGPID = myGaussPtsIDMapper->GetObjID(i);
- vtkIdType aCellId = aGPID.first;
- *aDataCellPointer = aCellId;
- aDataCellPointer++;
- *aDataCellPointer = 3; // it's a entity CELL
- }
+ int nbPoints = aDataPointMapper->GetNumberOfTuples();
+ for(int i=0;i<nbPoints;i++,aDataCellPointer++){
+ VISU::TGaussPointID aGPID = myGaussPtsIDMapper->GetObjID(i);
+ vtkIdType aCellId = aGPID.first;
+ *aDataCellPointer = aCellId;
+ aDataCellPointer++;
+ *aDataCellPointer = 3; // it's a entity CELL
+ }
}
/*
vtkIntArray* anCellArr = GetIDMapper(FieldList,
- VISU::TGetCellData(),
- "VISU_CELLS_MAPPER");
+ VISU::TGetCellData(),
+ "VISU_CELLS_MAPPER");
vtkIntArray* anPMArr = GetIDMapper(FieldList,
- VISU::TGetPointData(),
- "VISU_POINTS_MAPPER");
+ VISU::TGetPointData(),
+ "VISU_POINTS_MAPPER");
vtkDataArray* anFArr = GetIDMapper(FieldList,
- VISU::TGetPointData(),
- "VISU_FIELD");
+ VISU::TGetPointData(),
+ "VISU_FIELD");
*/
if(VISU::IsDifferent(aDataCellIds, aGeometryCellMapper)){
- VISU::TObjectIdArray anIntersection;
- VISU::GetIntersection(aDataCellIds,
- aGeometryCellMapper,
- anIntersection);
+ VISU::TObjectIdArray anIntersection;
+ VISU::GetIntersection(aDataCellIds,
+ aGeometryCellMapper,
+ anIntersection);
VISU::TObjectId2TupleGaussIdMap aDataCellId2TupleGaussIdMap;
- VISU::GetObjectId2TupleGaussIdArray(aDataCellIds, aDataCellId2TupleGaussIdMap);
+ VISU::GetObjectId2TupleGaussIdArray(aDataCellIds, aDataCellId2TupleGaussIdMap);
vtkIdType aNbTuples = 0;
for(vtkIdType i = 0;i < anIntersection.size();i++)
aNbTuples += aDataCellId2TupleGaussIdMap[anIntersection[i].first].size();
-
- vtkPointSet* aScalarsDataSet = dynamic_cast<vtkPointSet*>(GetScalars());
- vtkPoints* aDataPoints = aScalarsDataSet->GetPoints();
- vtkPoints* anOutputPoints = vtkPoints::New(aDataPoints->GetDataType());
-
- anOutputPoints->SetNumberOfPoints(aNbTuples);
- theOutput->SetPoints(anOutputPoints);
- anOutputPoints->Delete();
-
- vtkCellData* anInputCellData = aScalarsDataSet->GetCellData();
- vtkPointData* anInputPointData = aScalarsDataSet->GetPointData();
-
- theOutput->Allocate(aNbTuples);
- vtkCellData* anOutputCellData = theOutput->GetCellData();
- vtkPointData* anOutputPointData = theOutput->GetPointData();
-
- anOutputCellData->CopyAllocate(anInputCellData,aNbTuples);
- anOutputPointData->CopyAllocate(anInputPointData,aNbTuples);
-
- vtkIdList *aCellIds = vtkIdList::New();
- vtkFloatingPointType aCoords[3];
- for(int aTupleId=0, aNewTupleId=0; aTupleId<anIntersection.size(); aTupleId++){
- VISU::TObjectId& anObjectId = anIntersection[aTupleId];
+
+ vtkPointSet* aScalarsDataSet = dynamic_cast<vtkPointSet*>(GetScalars());
+ vtkPoints* aDataPoints = aScalarsDataSet->GetPoints();
+ vtkPoints* anOutputPoints = vtkPoints::New(aDataPoints->GetDataType());
+
+ anOutputPoints->SetNumberOfPoints(aNbTuples);
+ theOutput->SetPoints(anOutputPoints);
+ anOutputPoints->Delete();
+
+ vtkCellData* anInputCellData = aScalarsDataSet->GetCellData();
+ vtkPointData* anInputPointData = aScalarsDataSet->GetPointData();
+
+ theOutput->Allocate(aNbTuples);
+ vtkCellData* anOutputCellData = theOutput->GetCellData();
+ vtkPointData* anOutputPointData = theOutput->GetPointData();
+
+ anOutputCellData->CopyAllocate(anInputCellData,aNbTuples);
+ anOutputPointData->CopyAllocate(anInputPointData,aNbTuples);
+
+ vtkIdList *aCellIds = vtkIdList::New();
+ vtkFloatingPointType aCoords[3];
+ for(int aTupleId=0, aNewTupleId=0; aTupleId<anIntersection.size(); aTupleId++){
+ VISU::TObjectId& anObjectId = anIntersection[aTupleId];
VISU::TCellIdArray aCellIdArray = aDataCellId2TupleGaussIdMap[anObjectId.first];
for(vtkIdType i = 0; i < aCellIdArray.size();i++) {
aCellIds->Reset();
aCellIds->InsertNextId(aNewTupleId);
aNewTupleId++;
-
+
vtkIdType aCellType = GetScalars()->GetCellType(aCellId);
vtkIdType aNewCellId = theOutput->InsertNextCell(aCellType, aCellIds);
-
+
anOutputCellData->CopyData(anInputCellData, aCellId, aNewCellId);
anOutputPointData->CopyData(anInputPointData, aCellId, aNewCellId);
aDataPoints->GetPoint(aCellId, aCoords);
anOutputPoints->SetPoint(aNewCellId, aCoords);
}
- }
+ }
}
}
}
bool
ExecuteGauss(vtkUnstructuredGrid* theInput,
- vtkPolyData* theOutput);
+ vtkPolyData* theOutput);
private:
VISU_GaussMergeFilter(const VISU_GaussMergeFilter&); // Not implemented.
if ( IsStructured() ) {
TObj2StructuredId::const_iterator aIter = myObj2StructuredId.find( theNodeId );
if ( aIter != myObj2StructuredId.end() )
- return aIter->second;
+ return aIter->second;
}
return TStructuredId();
TObj2StructuredId::const_iterator aIter = myObj2StructuredId.begin();
for (; aIter != myObj2StructuredId.end(); aIter++ ) {
if ( theVec == aIter->second )
- return aIter->first;
+ return aIter->first;
}
return -1;
//---------------------------------------------------------------
VISU::PMEDSubProfile
CrSubProfile(const MED::PWrapper& theMEDWrapper,
- const MED::PMeshInfo& theMeshInfo,
- MED::EEntiteMaillage theMEntity,
- MED::EGeometrieElement theMGeom,
- const MED::TGeom2Size& theGeom2Size,
- const MED::TGeom2Profile& theGeom2Profile)
+ const MED::PMeshInfo& theMeshInfo,
+ MED::EEntiteMaillage theMEntity,
+ MED::EGeometrieElement theMGeom,
+ const MED::TGeom2Size& theGeom2Size,
+ const MED::TGeom2Profile& theGeom2Profile)
{
VISU::EGeometry aEGeom = MEDGeom2VISU(theMGeom);
vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom);
else{
MED::TGeom2Profile::const_iterator aProfileIter = theGeom2Profile.find(theMGeom);
if(aProfileIter != theGeom2Profile.end()){
- MED::PProfileInfo aProfileInfo = aProfileIter->second;
-
- aSubProfile->myName = aProfileInfo->GetName();
- aSubProfile->myStatus = VISU::eAddPart;
-
- const MED::TElemNum& anElemNum = aProfileInfo->myElemNum;
- TInt aNbElem = anElemNum.size();
- aSubProfile->myNbCells = aNbElem;
- switch(theMGeom){
- case MED::ePOLYGONE: {
- MED::PPolygoneInfo aPolygoneInfo =
- theMEDWrapper->GetPPolygoneInfo(theMeshInfo,theMEntity,theMGeom);
- for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
- TInt aNbConn = aPolygoneInfo->GetNbConn( anElemNum[ anElemId ] - 1 );
- aSubProfile->myCellsSize += aNbConn;
- }
- break;
- }
- case MED::ePOLYEDRE: {
- MED::PPolyedreInfo aPolyedreInfo =
- theMEDWrapper->GetPPolyedreInfo(theMeshInfo,theMEntity,theMGeom);
- for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
- MED::TCConnSliceArr aConnSliceArr =
- aPolyedreInfo->GetConnSliceArr( anElemNum[ anElemId ] - 1 );
- TInt aNbFaces = aConnSliceArr.size();
- TInt aCellSize = 0;
- for(TInt iFace = 0; iFace < aNbFaces; iFace++){
- MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
- TInt aNbConn = aConnSlice.size();
- aCellSize += aNbConn;
- }
- aSubProfile->myCellsSize += aCellSize;
- }
- break;
- }
- default: {
- aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes;
- }}
+ MED::PProfileInfo aProfileInfo = aProfileIter->second;
+
+ aSubProfile->myName = aProfileInfo->GetName();
+ aSubProfile->myStatus = VISU::eAddPart;
+
+ const MED::TElemNum& anElemNum = aProfileInfo->myElemNum;
+ TInt aNbElem = anElemNum.size();
+ aSubProfile->myNbCells = aNbElem;
+ switch(theMGeom){
+ case MED::ePOLYGONE: {
+ MED::PPolygoneInfo aPolygoneInfo =
+ theMEDWrapper->GetPPolygoneInfo(theMeshInfo,theMEntity,theMGeom);
+ for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
+ TInt aNbConn = aPolygoneInfo->GetNbConn( anElemNum[ anElemId ] - 1 );
+ aSubProfile->myCellsSize += aNbConn;
+ }
+ break;
+ }
+ case MED::ePOLYEDRE: {
+ MED::PPolyedreInfo aPolyedreInfo =
+ theMEDWrapper->GetPPolyedreInfo(theMeshInfo,theMEntity,theMGeom);
+ for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
+ MED::TCConnSliceArr aConnSliceArr =
+ aPolyedreInfo->GetConnSliceArr( anElemNum[ anElemId ] - 1 );
+ TInt aNbFaces = aConnSliceArr.size();
+ TInt aCellSize = 0;
+ for(TInt iFace = 0; iFace < aNbFaces; iFace++){
+ MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
+ TInt aNbConn = aConnSlice.size();
+ aCellSize += aNbConn;
+ }
+ aSubProfile->myCellsSize += aCellSize;
+ }
+ break;
+ }
+ default: {
+ aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes;
+ }}
}else{
- TInt aNbElem = aTimeStampIter->second;
- aSubProfile->myNbCells = aNbElem;
- switch(theMGeom){
- case MED::ePOLYGONE: {
- MED::PPolygoneInfo aPolygoneInfo =
- theMEDWrapper->GetPPolygoneInfo(theMeshInfo,theMEntity,theMGeom);
- for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
- TInt aNbConn = aPolygoneInfo->GetNbConn(anElemId);
- aSubProfile->myCellsSize += aNbConn;
- }
- break;
- }
- case MED::ePOLYEDRE: {
- MED::PPolyedreInfo aPolyedreInfo =
- theMEDWrapper->GetPPolyedreInfo(theMeshInfo,theMEntity,theMGeom);
- for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
- MED::TCConnSliceArr aConnSliceArr =
- aPolyedreInfo->GetConnSliceArr(anElemId);
- TInt aNbFaces = aConnSliceArr.size();
- TInt aCellSize = 0;
- for(TInt iFace = 0; iFace < aNbFaces; iFace++){
- MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
- TInt aNbConn = aConnSlice.size();
- aCellSize += aNbConn;
- }
- aSubProfile->myCellsSize += aCellSize;
- }
- break;
- }
- default: {
- aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes;
- }}
+ TInt aNbElem = aTimeStampIter->second;
+ aSubProfile->myNbCells = aNbElem;
+ switch(theMGeom){
+ case MED::ePOLYGONE: {
+ MED::PPolygoneInfo aPolygoneInfo =
+ theMEDWrapper->GetPPolygoneInfo(theMeshInfo,theMEntity,theMGeom);
+ for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
+ TInt aNbConn = aPolygoneInfo->GetNbConn(anElemId);
+ aSubProfile->myCellsSize += aNbConn;
+ }
+ break;
+ }
+ case MED::ePOLYEDRE: {
+ MED::PPolyedreInfo aPolyedreInfo =
+ theMEDWrapper->GetPPolyedreInfo(theMeshInfo,theMEntity,theMGeom);
+ for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
+ MED::TCConnSliceArr aConnSliceArr =
+ aPolyedreInfo->GetConnSliceArr(anElemId);
+ TInt aNbFaces = aConnSliceArr.size();
+ TInt aCellSize = 0;
+ for(TInt iFace = 0; iFace < aNbFaces; iFace++){
+ MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
+ TInt aNbConn = aConnSlice.size();
+ aCellSize += aNbConn;
+ }
+ aSubProfile->myCellsSize += aCellSize;
+ }
+ break;
+ }
+ default: {
+ aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes;
+ }}
}
}
INITMSG(MYDEBUG,
- "- aMGeom = "<<theMGeom<<
- "; aEGeom = "<<aEGeom<<
- "; aName = '"<<aSubProfile->myName<<"'"<<
- "; aStatus = "<<aSubProfile->myStatus<<
- "; aNbCells = "<<aSubProfile->myNbCells<<
- "; aCellsSize = "<<aSubProfile->myCellsSize<<
- endl);
+ "- aMGeom = "<<theMGeom<<
+ "; aEGeom = "<<aEGeom<<
+ "; aName = '"<<aSubProfile->myName<<"'"<<
+ "; aStatus = "<<aSubProfile->myStatus<<
+ "; aNbCells = "<<aSubProfile->myNbCells<<
+ "; aCellsSize = "<<aSubProfile->myCellsSize<<
+ endl);
return aSubProfile;
}
//---------------------------------------------------------------
VISU::TProfileKey
GetProfileKey(const MED::PWrapper& theMEDWrapper,
- const MED::PMeshInfo& theMeshInfo,
- const MED::PTimeStampValueBase& theTimeStampValue,
- const VISU::TMEDMeshOnEntity& theMeshOnEntity,
- MED::EEntiteMaillage theMEntity,
- const MED::TGeom2Size& theGeom2Size)
+ const MED::PMeshInfo& theMeshInfo,
+ const MED::PTimeStampValueBase& theTimeStampValue,
+ const VISU::TMEDMeshOnEntity& theMeshOnEntity,
+ MED::EEntiteMaillage theMEntity,
+ const MED::TGeom2Size& theGeom2Size)
{
INITMSG(MYDEBUG,"GetProfileKey"<<endl);
for(; anIter != aGeom2Size.end(); anIter++){
MED::EGeometrieElement aMGeom = anIter->first;
VISU::PSubProfile aSubProfile = CrSubProfile(theMEDWrapper,
- theMeshInfo,
- theMEntity,
- aMGeom,
- theGeom2Size,
- aGeom2Profile);
+ theMeshInfo,
+ theMEntity,
+ aMGeom,
+ theGeom2Size,
+ aGeom2Profile);
aProfileKey.insert(aSubProfile);
}
//---------------------------------------------------------------
void
InitProfile(const MED::PWrapper& theMEDWrapper,
- const MED::PMeshInfo& theMeshInfo,
- MED::PTimeStampValueBase& theTimeStampValue,
- VISU::TMEDMeshOnEntity& theMeshOnEntity,
- MED::EEntiteMaillage theMEntity,
- const MED::TGeom2Size& theGeom2Size,
- VISU::TMEDValForTime& theValForTime)
+ const MED::PMeshInfo& theMeshInfo,
+ MED::PTimeStampValueBase& theTimeStampValue,
+ VISU::TMEDMeshOnEntity& theMeshOnEntity,
+ MED::EEntiteMaillage theMEntity,
+ const MED::TGeom2Size& theGeom2Size,
+ VISU::TMEDValForTime& theValForTime)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"InitProfile");
INITMSG(MYDEBUG,"InitProfile"<<endl);
VISU::TProfileMap& aProfileMap = theMeshOnEntity.myProfileMap;
VISU::TProfileKey aProfileKey = GetProfileKey(theMEDWrapper,
- theMeshInfo,
- theTimeStampValue,
- theMeshOnEntity,
- theMEntity,
- theGeom2Size);
+ theMeshInfo,
+ theTimeStampValue,
+ theMeshOnEntity,
+ theMEntity,
+ theGeom2Size);
VISU::TProfileMap::const_iterator anIter = aProfileMap.find(aProfileKey);
if(anIter != aProfileMap.end()){
VISU::TProfileKey::const_iterator anIter = aProfileKey.begin();
for(; anIter != aProfileKey.end(); anIter++){
- VISU::PMEDSubProfile aSubProfile(*anIter);
+ VISU::PMEDSubProfile aSubProfile(*anIter);
- if(aProfile->myIsAll && aSubProfile->myStatus != VISU::eAddAll)
- aProfile->myIsAll = false;
+ if(aProfile->myIsAll && aSubProfile->myStatus != VISU::eAddAll)
+ aProfile->myIsAll = false;
- VISU::EGeometry aEGeom = aSubProfile->myGeom;
- aGeom2SubProfile[aEGeom] = aSubProfile;
+ VISU::EGeometry aEGeom = aSubProfile->myGeom;
+ aGeom2SubProfile[aEGeom] = aSubProfile;
}
aProfileMap[aProfileKey] = aProfile;
//---------------------------------------------------------------
VISU::TGaussKey
GetGaussKey(const MED::PTimeStampValueBase& theTimeStampValue,
- const VISU::TMEDMeshOnEntity& theMeshOnEntity,
- const MED::TGeom2Size& theGeom2Size,
- VISU::TMEDValForTime& theValForTime)
+ const VISU::TMEDMeshOnEntity& theMeshOnEntity,
+ const MED::TGeom2Size& theGeom2Size,
+ VISU::TMEDValForTime& theValForTime)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"GetGaussKey");
INITMSG(MYDEBUG,"GetGaussKey"<<endl);
VISU::TGeom2SubProfile::iterator anIter2 = aGeom2SubProfile.find(aEGeom);
if(anIter2 == aGeom2SubProfile.end()){
- INITMSG(MYDEBUG,"anIter2 == aGeom2SubProfile.end!!"<<endl);
- continue;
+ INITMSG(MYDEBUG,"anIter2 == aGeom2SubProfile.end!!"<<endl);
+ continue;
}
VISU::PMEDSubProfile aSubProfile = anIter2->second;
MED::TGeom2Size::const_iterator aTimeStampIter = theGeom2Size.find(aMGeom);
if(aTimeStampIter != theGeom2Size.end()){
- TInt aNbCells = aTimeStampIter->second;
- if(aSubProfile->myStatus == VISU::eAddPart)
- aNbCells = aSubProfile->myNbCells;
-
- VISU::PMEDGaussSubMesh aGaussSubMesh(new VISU::TMEDGaussSubMesh());
- aGaussSubMesh->mySubProfile = aSubProfile;
- aGaussSubMesh->myStatus = aSubProfile->myStatus;
-
- VISU::PMEDGauss aGauss(new VISU::TMEDGauss());
- aGaussSubMesh->myGauss = aGauss;
- aGauss->myGeom = aEGeom;
- aGauss->myNbPoints = 1;
-
- MED::TGeom2Gauss::const_iterator aGaussIter = aGeom2Gauss.find(aMGeom);
- if(aGaussIter != aGeom2Gauss.end()){
- MED::PGaussInfo aGaussInfo = aGaussIter->second;
- aGauss->myGaussInfo = aGaussInfo;
- aGauss->myName = aGaussInfo->GetName();
- aGauss->myNbPoints = aGaussInfo->GetNbGauss();
- } else if ( aTimeStampInfo.GetNbGauss(aMGeom) > 1 )
- EXCEPTION( std::runtime_error, "aGaussIter == aGeom2Gauss.end()"
- " && aTimeStampInfo.GetNbGauss(aMGeom) > 1 !!!" );
-
- aGaussSubMesh->myNbCells = aNbCells*aGauss->myNbPoints;
- aGaussSubMesh->myCellsSize = aGaussSubMesh->myNbCells*2;
-
- aGaussKey.insert(aGaussSubMesh);
-
- INITMSGA(MYDEBUG,0,
- "- aEGeom = "<<aGauss->myGeom<<
- "; aName = '"<<aGauss->myName<<"'"<<
- "; aNbGauss = "<<aGauss->myNbPoints<<
- "; aStatus = "<<aGaussSubMesh->myStatus<<
- "; aNbCells = "<<aGaussSubMesh->myNbCells<<
- "; aCellsSize = "<<aGaussSubMesh->myCellsSize<<
- endl);
-
- //break;
+ TInt aNbCells = aTimeStampIter->second;
+ if(aSubProfile->myStatus == VISU::eAddPart)
+ aNbCells = aSubProfile->myNbCells;
+
+ VISU::PMEDGaussSubMesh aGaussSubMesh(new VISU::TMEDGaussSubMesh());
+ aGaussSubMesh->mySubProfile = aSubProfile;
+ aGaussSubMesh->myStatus = aSubProfile->myStatus;
+
+ VISU::PMEDGauss aGauss(new VISU::TMEDGauss());
+ aGaussSubMesh->myGauss = aGauss;
+ aGauss->myGeom = aEGeom;
+ aGauss->myNbPoints = 1;
+
+ MED::TGeom2Gauss::const_iterator aGaussIter = aGeom2Gauss.find(aMGeom);
+ if(aGaussIter != aGeom2Gauss.end()){
+ MED::PGaussInfo aGaussInfo = aGaussIter->second;
+ aGauss->myGaussInfo = aGaussInfo;
+ aGauss->myName = aGaussInfo->GetName();
+ aGauss->myNbPoints = aGaussInfo->GetNbGauss();
+ } else if ( aTimeStampInfo.GetNbGauss(aMGeom) > 1 )
+ EXCEPTION( std::runtime_error, "aGaussIter == aGeom2Gauss.end()"
+ " && aTimeStampInfo.GetNbGauss(aMGeom) > 1 !!!" );
+
+ aGaussSubMesh->myNbCells = aNbCells*aGauss->myNbPoints;
+ aGaussSubMesh->myCellsSize = aGaussSubMesh->myNbCells*2;
+
+ aGaussKey.insert(aGaussSubMesh);
+
+ INITMSGA(MYDEBUG,0,
+ "- aEGeom = "<<aGauss->myGeom<<
+ "; aName = '"<<aGauss->myName<<"'"<<
+ "; aNbGauss = "<<aGauss->myNbPoints<<
+ "; aStatus = "<<aGaussSubMesh->myStatus<<
+ "; aNbCells = "<<aGaussSubMesh->myNbCells<<
+ "; aCellsSize = "<<aGaussSubMesh->myCellsSize<<
+ endl);
+
+ //break;
}
}
//---------------------------------------------------------------
void
InitGaussMesh(MED::PTimeStampValueBase& theTimeStampValue,
- VISU::TMEDMeshOnEntity& theMeshOnEntity,
- const MED::TGeom2Size& theGeom2Size,
- VISU::TMEDValForTime& theValForTime)
+ VISU::TMEDMeshOnEntity& theMeshOnEntity,
+ const MED::TGeom2Size& theGeom2Size,
+ VISU::TMEDValForTime& theValForTime)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"InitGaussMesh");
INITMSG(MYDEBUG,"InitGaussMesh"<<endl);
VISU::TGaussMeshMap& aGaussMeshMap = theMeshOnEntity.myGaussMeshMap;
VISU::TGaussKey aGaussKey = GetGaussKey(theTimeStampValue,
- theMeshOnEntity,
- theGeom2Size,
- theValForTime);
+ theMeshOnEntity,
+ theGeom2Size,
+ theValForTime);
VISU::TGaussMeshMap::const_iterator anIter = aGaussMeshMap.find(aGaussKey);
if(anIter != aGaussMeshMap.end()){
VISU::PMEDGaussMesh aGaussMesh(new VISU::TMEDGaussMesh());
VISU::TGeom2GaussSubMesh& aGeom2GaussSubMesh = aGaussMesh->myGeom2GaussSubMesh;
{
- VISU::TGaussKey::const_iterator anIter = aGaussKey.begin();
- for(; anIter != aGaussKey.end(); anIter++){
- VISU::PMEDGaussSubMesh aGaussSubMesh(*anIter);
- VISU::PMEDGauss aGauss = aGaussSubMesh->myGauss;
- VISU::EGeometry aEGeom = aGauss->myGeom;
- aGeom2GaussSubMesh[aEGeom] = aGaussSubMesh;
- }
+ VISU::TGaussKey::const_iterator anIter = aGaussKey.begin();
+ for(; anIter != aGaussKey.end(); anIter++){
+ VISU::PMEDGaussSubMesh aGaussSubMesh(*anIter);
+ VISU::PMEDGauss aGauss = aGaussSubMesh->myGauss;
+ VISU::EGeometry aEGeom = aGauss->myGeom;
+ aGeom2GaussSubMesh[aEGeom] = aGaussSubMesh;
+ }
}
{
- VISU::TGaussSubMeshArr& aGaussSubMeshArr = aGaussMesh->myGaussSubMeshArr;
- aGaussSubMeshArr.resize(aGeom2GaussSubMesh.size());
- VISU::TGeom2GaussSubMesh::const_iterator anIter = aGeom2GaussSubMesh.begin();
- for(TInt anID = 0; anIter != aGeom2GaussSubMesh.end(); anIter++, anID++){
- const VISU::PGaussSubMeshImpl& aGaussSubMesh = anIter->second;
- aGaussSubMeshArr[anID] = aGaussSubMesh;
- }
+ VISU::TGaussSubMeshArr& aGaussSubMeshArr = aGaussMesh->myGaussSubMeshArr;
+ aGaussSubMeshArr.resize(aGeom2GaussSubMesh.size());
+ VISU::TGeom2GaussSubMesh::const_iterator anIter = aGeom2GaussSubMesh.begin();
+ for(TInt anID = 0; anIter != aGeom2GaussSubMesh.end(); anIter++, anID++){
+ const VISU::PGaussSubMeshImpl& aGaussSubMesh = anIter->second;
+ aGaussSubMeshArr[anID] = aGaussSubMesh;
+ }
}
INITMSG(MYDEBUG,"aGaussMeshMap[aGaussKey] = aGaussMesh"<<std::endl);
aGaussMeshMap[aGaussKey] = aGaussMesh;
//---------------------------------------------------------------
void
BuildMeshOnEntityMap(VISU::PMEDMesh theMesh,
- const MED::TEntityInfo& theEntityInfo,
- const MED::PNodeInfo& theNodeInfo,
- const MED::PWrapper& theMEDWrapper)
+ const MED::TEntityInfo& theEntityInfo,
+ const MED::PNodeInfo& theNodeInfo,
+ const MED::PWrapper& theMEDWrapper)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"BuildMeshOnEntityMap");
INITMSG(MYDEBUG,"BuildMeshOnEntityMap"<<endl);
VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
VISU::PMEDMeshOnEntity aMeshOnEntity =
- aMeshOnEntityMap[aVEntity](new VISU::TMEDMeshOnEntity());
+ aMeshOnEntityMap[aVEntity](new VISU::TMEDMeshOnEntity());
aMeshOnEntity->myEntity = aVEntity;
aMeshOnEntity->myMeshName = aMeshName;
aMeshOnEntity->myGeom2Size = aGeom2Size;
VISU::TGeom2ElemID2FamilyID& aGeom2ElemID2FamilyID = aMeshOnEntity->myGeom2ElemID2FamilyID;
INITMSG(MYDEBUG,
- "- aMEntity = "<<aMEntity<<
- "; aVEntity = "<<aVEntity<<
- endl);
+ "- aMEntity = "<<aMEntity<<
+ "; aVEntity = "<<aVEntity<<
+ endl);
if(aMEntity == MED::eNOEUD){
- aMeshOnEntity->myNbCells = theMesh->myNbPoints;
- aMeshOnEntity->myCellsSize = 2*theMesh->myNbPoints;
-
- VISU::TElemID2FamilyID& anElemID2FamilyID = aGeom2ElemID2FamilyID[MED::ePOINT1];
-
- for(TInt iElem = 0; iElem < theMesh->myNbPoints; iElem++){
- TInt aFamId = theNodeInfo->GetFamNum(iElem);
- if(aFamId != 0)
- aFamilyID2CellsSize[aFamId] += 2;
- anElemID2FamilyID[iElem] = aFamId;
- }
-
- INITMSG(MYDEBUG,
- "- myNbCells = "<<aMeshOnEntity->myNbCells<<
- "; myCellsSize = "<<aMeshOnEntity->myCellsSize<<
- std::endl);
-
+ aMeshOnEntity->myNbCells = theMesh->myNbPoints;
+ aMeshOnEntity->myCellsSize = 2*theMesh->myNbPoints;
+
+ VISU::TElemID2FamilyID& anElemID2FamilyID = aGeom2ElemID2FamilyID[MED::ePOINT1];
+
+ for(TInt iElem = 0; iElem < theMesh->myNbPoints; iElem++){
+ TInt aFamId = theNodeInfo->GetFamNum(iElem);
+ if(aFamId != 0)
+ aFamilyID2CellsSize[aFamId] += 2;
+ anElemID2FamilyID[iElem] = aFamId;
+ }
+
+ INITMSG(MYDEBUG,
+ "- myNbCells = "<<aMeshOnEntity->myNbCells<<
+ "; myCellsSize = "<<aMeshOnEntity->myCellsSize<<
+ std::endl);
+
}else{
- MED::TGeom2Size::const_iterator aGeom2SizeIter = aGeom2Size.begin();
- aMeshOnEntity->myNbCells = 0;
- aMeshOnEntity->myCellsSize = 0;
- for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){
- const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first;
-
- VISU::TElemID2FamilyID& anElemID2FamilyID = aGeom2ElemID2FamilyID[aMGeom];
- switch(aMGeom){
- case MED::ePOLYGONE: {
- MED::PPolygoneInfo aPolygoneInfo = theMEDWrapper->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom);
- TInt aNbElem = aPolygoneInfo->GetNbElem();
-
- INITMSG(MYDEBUG,
- "- aMGeom = "<<aMGeom<<
- "; aNbElem = "<<aNbElem<<
- endl);
-
- aMeshOnEntity->myNbCells += aNbElem;
- for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
- TInt aNbConn = aPolygoneInfo->GetNbConn(anElemId);
- aMeshOnEntity->myCellsSize += aNbConn;
- TInt aFamId = aPolygoneInfo->GetFamNum(anElemId);
- if(aFamId != 0)
- aFamilyID2CellsSize[aFamId] += aNbConn + 1;
- anElemID2FamilyID[anElemId] = aFamId;
- }
- break;
- }
- case MED::ePOLYEDRE: {
- MED::PPolyedreInfo aPolyedreInfo = theMEDWrapper->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom);
- TInt aNbElem = aPolyedreInfo->GetNbElem();
-
- INITMSG(MYDEBUG,
- "- aMGeom = "<<aMGeom<<
- "; aNbElem = "<<aNbElem<<
- endl);
-
- aMeshOnEntity->myNbCells += aNbElem;
- for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
- MED::TCConnSliceArr aConnSliceArr = aPolyedreInfo->GetConnSliceArr(anElemId);
- TInt aNbFaces = aConnSliceArr.size();
- TInt aCellSize = 0;
- for(TInt iFace = 0; iFace < aNbFaces; iFace++){
- MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
- TInt aNbConn = aConnSlice.size();
- aCellSize += aNbConn;
- }
- aMeshOnEntity->myCellsSize += aCellSize;
- TInt aFamId = aPolyedreInfo->GetFamNum(anElemId);
- if(aFamId != 0)
- aFamilyID2CellsSize[aFamId] += aCellSize + 1;
- anElemID2FamilyID[anElemId] = aFamId;
- }
- break;
- }
- default: {
- VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
- vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom);
- MED::PCellInfo aCellInfo = theMEDWrapper->GetPCellInfo(aMeshInfo,aMEntity,aMGeom);
- TInt aNbElem = aCellInfo->GetNbElem();
- aMeshOnEntity->myNbCells += aNbElem;
- aMeshOnEntity->myCellsSize += aNbElem*(aVNbNodes+1);
-
- INITMSG(MYDEBUG,
- "- aMGeom = "<<aMGeom<<
- "; aNbElem = "<<aNbElem<<
- "; myNbCells = "<<aMeshOnEntity->myNbCells<<
- "; myCellsSize = "<<aMeshOnEntity->myCellsSize<<
- endl);
-
- for(TInt iElem = 0; iElem < aNbElem; iElem++){
- TInt aFamId = aCellInfo->GetFamNum(iElem);
- if(aFamId != 0)
- aFamilyID2CellsSize[aFamId] += aVNbNodes + 1;
- anElemID2FamilyID[iElem] = aFamId;
- }
- }} // end switch(...)
- }
+ MED::TGeom2Size::const_iterator aGeom2SizeIter = aGeom2Size.begin();
+ aMeshOnEntity->myNbCells = 0;
+ aMeshOnEntity->myCellsSize = 0;
+ for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){
+ const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first;
+
+ VISU::TElemID2FamilyID& anElemID2FamilyID = aGeom2ElemID2FamilyID[aMGeom];
+ switch(aMGeom){
+ case MED::ePOLYGONE: {
+ MED::PPolygoneInfo aPolygoneInfo = theMEDWrapper->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom);
+ TInt aNbElem = aPolygoneInfo->GetNbElem();
+
+ INITMSG(MYDEBUG,
+ "- aMGeom = "<<aMGeom<<
+ "; aNbElem = "<<aNbElem<<
+ endl);
+
+ aMeshOnEntity->myNbCells += aNbElem;
+ for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
+ TInt aNbConn = aPolygoneInfo->GetNbConn(anElemId);
+ aMeshOnEntity->myCellsSize += aNbConn;
+ TInt aFamId = aPolygoneInfo->GetFamNum(anElemId);
+ if(aFamId != 0)
+ aFamilyID2CellsSize[aFamId] += aNbConn + 1;
+ anElemID2FamilyID[anElemId] = aFamId;
+ }
+ break;
+ }
+ case MED::ePOLYEDRE: {
+ MED::PPolyedreInfo aPolyedreInfo = theMEDWrapper->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom);
+ TInt aNbElem = aPolyedreInfo->GetNbElem();
+
+ INITMSG(MYDEBUG,
+ "- aMGeom = "<<aMGeom<<
+ "; aNbElem = "<<aNbElem<<
+ endl);
+
+ aMeshOnEntity->myNbCells += aNbElem;
+ for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
+ MED::TCConnSliceArr aConnSliceArr = aPolyedreInfo->GetConnSliceArr(anElemId);
+ TInt aNbFaces = aConnSliceArr.size();
+ TInt aCellSize = 0;
+ for(TInt iFace = 0; iFace < aNbFaces; iFace++){
+ MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
+ TInt aNbConn = aConnSlice.size();
+ aCellSize += aNbConn;
+ }
+ aMeshOnEntity->myCellsSize += aCellSize;
+ TInt aFamId = aPolyedreInfo->GetFamNum(anElemId);
+ if(aFamId != 0)
+ aFamilyID2CellsSize[aFamId] += aCellSize + 1;
+ anElemID2FamilyID[anElemId] = aFamId;
+ }
+ break;
+ }
+ default: {
+ VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
+ vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom);
+ MED::PCellInfo aCellInfo = theMEDWrapper->GetPCellInfo(aMeshInfo,aMEntity,aMGeom);
+ TInt aNbElem = aCellInfo->GetNbElem();
+ aMeshOnEntity->myNbCells += aNbElem;
+ aMeshOnEntity->myCellsSize += aNbElem*(aVNbNodes+1);
+
+ INITMSG(MYDEBUG,
+ "- aMGeom = "<<aMGeom<<
+ "; aNbElem = "<<aNbElem<<
+ "; myNbCells = "<<aMeshOnEntity->myNbCells<<
+ "; myCellsSize = "<<aMeshOnEntity->myCellsSize<<
+ endl);
+
+ for(TInt iElem = 0; iElem < aNbElem; iElem++){
+ TInt aFamId = aCellInfo->GetFamNum(iElem);
+ if(aFamId != 0)
+ aFamilyID2CellsSize[aFamId] += aVNbNodes + 1;
+ anElemID2FamilyID[iElem] = aFamId;
+ }
+ }} // end switch(...)
+ }
}
}
}
//---------------------------------------------------------------
void
BuildMeshGrilleOnEntityMap(VISU::PMEDMesh theMesh,
- const MED::TEntityInfo& theEntityInfo,
- const MED::PGrilleInfo& theGrilleInfo,
- const MED::PWrapper& theMEDWrapper)
+ const MED::TEntityInfo& theEntityInfo,
+ const MED::PGrilleInfo& theGrilleInfo,
+ const MED::PWrapper& theMEDWrapper)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"BuildMeshGrilleOnEntityMap");
INITMSG(MYDEBUG,"BuildMeshGrilleOnEntityMap"<<endl);
VISU::TStructuredId& aGrilleStructure = theMesh->myGrilleStructure;
if ( theGrilleInfo->GetGrilleType() != MED::eGRILLE_STANDARD )
for ( int aDimId = 0; aDimId < theMesh->myDim; aDimId++ )
- aGrilleStructure[aDimId] = theGrilleInfo->GetNbIndexes(aDimId);
+ aGrilleStructure[aDimId] = theGrilleInfo->GetNbIndexes(aDimId);
else {
MED::TIntVector aVector = theGrilleInfo->GetGrilleStructure();
for ( int aDimId = 0; aDimId < aVector.size(); aDimId++ )
- aGrilleStructure[aDimId] = aVector[aDimId];
+ aGrilleStructure[aDimId] = aVector[aDimId];
}
int kMax = aGrilleStructure[2];
switch ( theMesh->myDim ) {
case 1:
for ( int i = 1; i <= iMax; i++ )
- aObj2StructuredId[i-1][0] = i;
+ aObj2StructuredId[i-1][0] = i;
break;
case 2:
for ( int j = 1; j <= jMax; j++ )
- for ( int i = 1; i <= iMax; i++ ) {
- aObj2StructuredId[iii][0] = i;
- aObj2StructuredId[iii][1] = j;
- iii++;
- }
+ for ( int i = 1; i <= iMax; i++ ) {
+ aObj2StructuredId[iii][0] = i;
+ aObj2StructuredId[iii][1] = j;
+ iii++;
+ }
break;
case 3:
for ( int k = 1; k <= kMax; k++ )
- for ( int j = 1; j <= jMax; j++ )
- for ( int i = 1; i <= iMax; i++ ) {
- aObj2StructuredId[iii][0] = i;
- aObj2StructuredId[iii][1] = j;
- aObj2StructuredId[iii][2] = k;
- iii++;
- }
+ for ( int j = 1; j <= jMax; j++ )
+ for ( int i = 1; i <= iMax; i++ ) {
+ aObj2StructuredId[iii][0] = i;
+ aObj2StructuredId[iii][1] = j;
+ aObj2StructuredId[iii][2] = k;
+ iii++;
+ }
}
for(; anEntityIter != theEntityInfo.end(); anEntityIter++){
VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
VISU::PMEDMeshOnEntity aMeshOnEntity =
- aMeshOnEntityMap[aVEntity](new VISU::TMEDMeshOnEntity());
+ aMeshOnEntityMap[aVEntity](new VISU::TMEDMeshOnEntity());
aMeshOnEntity->myEntity = aVEntity;
aMeshOnEntity->myMeshName = aMeshName;
aMeshOnEntity->myGeom2Size = aGeom2Size;
VISU::TGeom2ElemID2FamilyID& aGeom2ElemID2FamilyID = aMeshOnEntity->myGeom2ElemID2FamilyID;
INITMSG(MYDEBUG,
- "- aMEntity = "<<aMEntity<<
- "; aVEntity = "<<aVEntity<<
- endl);
+ "- aMEntity = "<<aMEntity<<
+ "; aVEntity = "<<aVEntity<<
+ endl);
if(aMEntity == MED::eNOEUD){
- aMeshOnEntity->myNbCells = theGrilleInfo->GetNbNodes();
- aMeshOnEntity->myCellsSize = 2*theGrilleInfo->GetNbNodes();
-
- VISU::TElemID2FamilyID& anElemID2FamilyID = aGeom2ElemID2FamilyID[MED::ePOINT1];
-
- if((theGrilleInfo->myFamNumNode).size() > 0)
- for(TInt iElem = 0; iElem < theGrilleInfo->GetNbNodes(); iElem++){
- TInt aFamId = theGrilleInfo->GetFamNumNode(iElem);
- if(aFamId != 0)
- aFamilyID2CellsSize[aFamId] += 2;
- anElemID2FamilyID[iElem] = aFamId;
- }
-
- INITMSG(MYDEBUG,
- "- myNbCells = "<<aMeshOnEntity->myNbCells<<
- "; myCellsSize = "<<aMeshOnEntity->myCellsSize<<
- endl);;
-
+ aMeshOnEntity->myNbCells = theGrilleInfo->GetNbNodes();
+ aMeshOnEntity->myCellsSize = 2*theGrilleInfo->GetNbNodes();
+
+ VISU::TElemID2FamilyID& anElemID2FamilyID = aGeom2ElemID2FamilyID[MED::ePOINT1];
+
+ if((theGrilleInfo->myFamNumNode).size() > 0)
+ for(TInt iElem = 0; iElem < theGrilleInfo->GetNbNodes(); iElem++){
+ TInt aFamId = theGrilleInfo->GetFamNumNode(iElem);
+ if(aFamId != 0)
+ aFamilyID2CellsSize[aFamId] += 2;
+ anElemID2FamilyID[iElem] = aFamId;
+ }
+
+ INITMSG(MYDEBUG,
+ "- myNbCells = "<<aMeshOnEntity->myNbCells<<
+ "; myCellsSize = "<<aMeshOnEntity->myCellsSize<<
+ endl);;
+
} else {
- MED::TGeom2Size::const_iterator aGeom2SizeIter = aGeom2Size.begin();
- aMeshOnEntity->myNbCells = 0;
- aMeshOnEntity->myCellsSize = 0;
- for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){
- const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first;
- VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
- vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom);
- TInt aNbElem = aGeom2SizeIter->second;//theGrilleInfo->GetNbCells();
- aMeshOnEntity->myNbCells += aNbElem;
- aMeshOnEntity->myCellsSize += aNbElem*(aVNbNodes+1);
-
- VISU::TElemID2FamilyID& anElemID2FamilyID = aGeom2ElemID2FamilyID[aMGeom];
-
- INITMSG(MYDEBUG,
- "- aMGeom = "<<aMGeom<<
- "; aNbElem = "<<aNbElem<<
- "; myNbCells = "<<aMeshOnEntity->myNbCells<<
- "; myCellsSize = "<<aMeshOnEntity->myCellsSize<<
- endl);
-
- if((theGrilleInfo->myFamNum).size() > 0)
- for(TInt iElem = 0; iElem < aNbElem; iElem++){
- TInt aFamId = theGrilleInfo->GetFamNum(iElem);
- if(aFamId != 0)
- aFamilyID2CellsSize[aFamId] += aVNbNodes + 1;
- anElemID2FamilyID[iElem] = aFamId;
- }
- }
+ MED::TGeom2Size::const_iterator aGeom2SizeIter = aGeom2Size.begin();
+ aMeshOnEntity->myNbCells = 0;
+ aMeshOnEntity->myCellsSize = 0;
+ for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){
+ const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first;
+ VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
+ vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom);
+ TInt aNbElem = aGeom2SizeIter->second;//theGrilleInfo->GetNbCells();
+ aMeshOnEntity->myNbCells += aNbElem;
+ aMeshOnEntity->myCellsSize += aNbElem*(aVNbNodes+1);
+
+ VISU::TElemID2FamilyID& anElemID2FamilyID = aGeom2ElemID2FamilyID[aMGeom];
+
+ INITMSG(MYDEBUG,
+ "- aMGeom = "<<aMGeom<<
+ "; aNbElem = "<<aNbElem<<
+ "; myNbCells = "<<aMeshOnEntity->myNbCells<<
+ "; myCellsSize = "<<aMeshOnEntity->myCellsSize<<
+ endl);
+
+ if((theGrilleInfo->myFamNum).size() > 0)
+ for(TInt iElem = 0; iElem < aNbElem; iElem++){
+ TInt aFamId = theGrilleInfo->GetFamNum(iElem);
+ if(aFamId != 0)
+ aFamilyID2CellsSize[aFamId] += aVNbNodes + 1;
+ anElemID2FamilyID[iElem] = aFamId;
+ }
+ }
}
}
}
//---------------------------------------------------------------
void
BuildFieldMap(VISU::PMEDMesh theMesh,
- const MED::TEntityInfo& theEntityInfo,
- MED::PWrapper theMEDWrapper)
+ const MED::TEntityInfo& theEntityInfo,
+ MED::PWrapper theMEDWrapper)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"BuildFieldMap");
TInt aNbFields = theMEDWrapper->GetNbFields();
MED::TErr anError = 0;
MED::PFieldInfo aFieldInfo = theMEDWrapper->GetPFieldInfo(aMeshInfo, iField, &anError);
if ( anError < 0 )
- continue;
+ continue;
TInt aNbComp = aFieldInfo->GetNbComp();
std::string aFieldName = aFieldInfo->GetName();
MED::TGeom2Size aGeom2Size;
MED::EEntiteMaillage aMEntity;
TInt aNbTimeStamps = theMEDWrapper->GetNbTimeStamps(aFieldInfo,
- theEntityInfo,
- aMEntity,
- aGeom2Size);
+ theEntityInfo,
+ aMEntity,
+ aGeom2Size);
if(aNbTimeStamps < 1)
- continue;
+ continue;
VISU::TEntity aVEntity = MEDEntityToVTK( aMEntity );
vtkIdType aDataType = VTK_DOUBLE;
if ( aFieldInfo->GetType() != MED::eFLOAT64 ) {
#if defined(HAVE_F77INT64)
- aDataType = VTK_LONG;
-#else
- aDataType = VTK_INT;
+ aDataType = VTK_LONG;
+#else
+ aDataType = VTK_INT;
#endif
}
VISU::PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[aVEntity];
aField->myIsELNO = ( aMEntity == MED::eNOEUD_ELEMENT );
INITMSG(MYDEBUG,"myName = '"<<aField->myName<<"'"<<
- "; myId = "<<aField->myId<<
- "; myEntity = "<<aField->myEntity<<
- "; myDataSize = "<<aField->myDataSize<<
- "; myNbComp = "<<aField->myNbComp<<"\n");
+ "; myId = "<<aField->myId<<
+ "; myEntity = "<<aField->myEntity<<
+ "; myDataSize = "<<aField->myDataSize<<
+ "; myNbComp = "<<aField->myNbComp<<"\n");
for(TInt iComp = 0; iComp < aNbComp; iComp++){
- aField->myCompNames[iComp] = aFieldInfo->GetCompName(iComp);
- aField->myUnitNames[iComp] = aFieldInfo->GetUnitName(iComp);
+ aField->myCompNames[iComp] = aFieldInfo->GetCompName(iComp);
+ aField->myUnitNames[iComp] = aFieldInfo->GetUnitName(iComp);
}
for(TInt iTimeStamp = 1; iTimeStamp <= aNbTimeStamps; iTimeStamp++){
- VISU::TTimerLog aTimerLog(MYDEBUG,"GetPTimeStampInfo");
-
- MED::TErr anError = 0;
- MED::PTimeStampInfo aTimeStampInfo = theMEDWrapper->GetPTimeStampInfo(aFieldInfo,
- aMEntity,
- aGeom2Size,
- iTimeStamp,
- &anError);
- if ( anError < 0 )
- continue;
-
- TFloat aDt = aTimeStampInfo->GetDt();
- std::string anUnitDt = aTimeStampInfo->GetUnitDt();
-
- VISU::TValField& aValField = aField->myValField;
- VISU::PMEDValForTime aValForTime = aValField[iTimeStamp](new VISU::TMEDValForTime());
- aValForTime->myId = iTimeStamp;
- aValForTime->myFieldName = aField->myName;
- aValForTime->myEntity = aField->myEntity;
- aValForTime->myMeshName = aField->myMeshName;
- aValForTime->myTime = VISU::TTime(aDt,anUnitDt);
- INITMSG(MYDEBUG,"aDt = '"<<aDt<<", "<<anUnitDt<<"'\n");
-
- VISU::TGeom2NbGauss& aVGeom2NbGauss = aValForTime->myGeom2NbGauss;
- const MED::TGeom2NbGauss& aMGeom2NbGauss = aTimeStampInfo->myGeom2NbGauss;
- MED::TGeom2NbGauss::const_iterator anIter = aMGeom2NbGauss.begin();
- for(; anIter != aMGeom2NbGauss.end(); anIter++){
- const MED::EGeometrieElement& aMGeom = anIter->first;
- VISU::EGeometry aEGeom = MEDGeom2VISU( aMGeom );
- TInt aNbGauss = anIter->second;
- aVGeom2NbGauss[ aEGeom ] = aNbGauss;
-
- // ELNO data should satisfy the following condition ( implicitly )
- vtkIdType aNbNodes = MEDGeom2NbNodes( aMGeom );
- aField->myIsELNO &= ( aNbGauss == aNbNodes );
- }
+ VISU::TTimerLog aTimerLog(MYDEBUG,"GetPTimeStampInfo");
+
+ MED::TErr anError = 0;
+ MED::PTimeStampInfo aTimeStampInfo = theMEDWrapper->GetPTimeStampInfo(aFieldInfo,
+ aMEntity,
+ aGeom2Size,
+ iTimeStamp,
+ &anError);
+ if ( anError < 0 )
+ continue;
+
+ TFloat aDt = aTimeStampInfo->GetDt();
+ std::string anUnitDt = aTimeStampInfo->GetUnitDt();
+
+ VISU::TValField& aValField = aField->myValField;
+ VISU::PMEDValForTime aValForTime = aValField[iTimeStamp](new VISU::TMEDValForTime());
+ aValForTime->myId = iTimeStamp;
+ aValForTime->myFieldName = aField->myName;
+ aValForTime->myEntity = aField->myEntity;
+ aValForTime->myMeshName = aField->myMeshName;
+ aValForTime->myTime = VISU::TTime(aDt,anUnitDt);
+ INITMSG(MYDEBUG,"aDt = '"<<aDt<<", "<<anUnitDt<<"'\n");
+
+ VISU::TGeom2NbGauss& aVGeom2NbGauss = aValForTime->myGeom2NbGauss;
+ const MED::TGeom2NbGauss& aMGeom2NbGauss = aTimeStampInfo->myGeom2NbGauss;
+ MED::TGeom2NbGauss::const_iterator anIter = aMGeom2NbGauss.begin();
+ for(; anIter != aMGeom2NbGauss.end(); anIter++){
+ const MED::EGeometrieElement& aMGeom = anIter->first;
+ VISU::EGeometry aEGeom = MEDGeom2VISU( aMGeom );
+ TInt aNbGauss = anIter->second;
+ aVGeom2NbGauss[ aEGeom ] = aNbGauss;
+
+ // ELNO data should satisfy the following condition ( implicitly )
+ vtkIdType aNbNodes = MEDGeom2NbNodes( aMGeom );
+ aField->myIsELNO &= ( aNbGauss == aNbNodes );
+ }
}
}
}
//---------------------------------------------------------------
void
BuildFamilyMap(VISU::PMEDMesh theMesh,
- const MED::TEntityInfo& theEntityInfo,
- const MED::TEntity2TGeom2ElemInfo& theEntity2TGeom2ElemInfo,
- const MED::TFamilyInfoSet& theFamilyInfoSet,
- MED::PWrapper theMEDWrapper)
+ const MED::TEntityInfo& theEntityInfo,
+ const MED::TEntity2TGeom2ElemInfo& theEntity2TGeom2ElemInfo,
+ const MED::TFamilyInfoSet& theFamilyInfoSet,
+ MED::PWrapper theMEDWrapper)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"BuildFamilyMap");
INITMSG(MYDEBUG,"BuildFamilyMap\n");
const VISU::TFamilyID2CellsSize& aFamilyID2CellsSize = aMeshOnEntity->myFamilyID2CellsSize;
VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
VISU::TFamilyIDMap& aFamilyIDMap = aMeshOnEntity->myFamilyIDMap;
-
+
if(aFamilyTSizeSet.empty())
- continue;
-
+ continue;
+
INITMSG(MY_FAMILY_DEBUG,
- "- aMEntity = "<<aMEntity<<
- "; aVEntity = "<<aVEntity<<
- endl);
+ "- aMEntity = "<<aMEntity<<
+ "; aVEntity = "<<aVEntity<<
+ endl);
MED::TFamilyTSizeSet::const_iterator aFamilyTSizeSetIter = aFamilyTSizeSet.begin();
for(; aFamilyTSizeSetIter != aFamilyTSizeSet.end(); aFamilyTSizeSetIter++){
- const MED::TFamilyTSize& aFamilyTSize = *aFamilyTSizeSetIter;
- const MED::PFamilyInfo& aFamilyInfo = boost::get<0>(aFamilyTSize);
- TInt aSize = boost::get<1>(aFamilyTSize);
- TInt anId = aFamilyInfo->GetId();
- if(anId == 0)
- continue;
-
- std::string aFamilyName = aFamilyInfo->GetName();
-
- VISU::PMEDFamily aFamily = aFamilyMap[aFamilyName](new VISU::TMEDFamily());
- aFamily->myId = anId;
- aFamily->myEntity = aVEntity;
- aFamily->myName = aFamilyName;
- aFamily->myNbCells = aSize;
-
- aFamily->myCellsSize = 0;
- VISU::TFamilyID2CellsSize::const_iterator anIter = aFamilyID2CellsSize.find(anId);
- if(anIter != aFamilyID2CellsSize.end())
- aFamily->myCellsSize = anIter->second;
-
- const TInt aNbGroup = aFamilyInfo->GetNbGroup();
- VISU::TNames& aGroupNames = aFamily->myGroupNames;
- aGroupNames.resize(aNbGroup);
- for(TInt i = 0; i < aNbGroup; i++){
- std::string aGroupName = aFamilyInfo->GetGroupName(i);
- aGroupNames[i] = aGroupName;
- }
-
- aFamilyIDMap[anId] = aFamily;
-
- INITMSG(MY_FAMILY_DEBUG,
- "- aFamilyName = '"<<aFamilyName<<"'"<<
- "; myId = "<<aFamily->myId<<"; "<<
- "; aNbAttr = "<<aFamilyInfo->GetNbAttr()<<
- "; aNbGroup = "<<aFamilyInfo->GetNbGroup()<<
- "; aVEntity = "<<aVEntity<<
- "; myNbCells = "<<aFamily->myNbCells<<
- "; myCellsSize = "<<aFamily->myCellsSize<<
- endl);
-#ifdef _DEBUG_
- for(TInt i = 0; i < aNbGroup; i++){
- std::string aGroupName = aFamilyInfo->GetGroupName(i);
- INITMSG(MY_FAMILY_DEBUG,"- aGroupName = '"<<aGroupName<<"'\n");
- }
+ const MED::TFamilyTSize& aFamilyTSize = *aFamilyTSizeSetIter;
+ const MED::PFamilyInfo& aFamilyInfo = boost::get<0>(aFamilyTSize);
+ TInt aSize = boost::get<1>(aFamilyTSize);
+ TInt anId = aFamilyInfo->GetId();
+ if(anId == 0)
+ continue;
+
+ std::string aFamilyName = aFamilyInfo->GetName();
+
+ VISU::PMEDFamily aFamily = aFamilyMap[aFamilyName](new VISU::TMEDFamily());
+ aFamily->myId = anId;
+ aFamily->myEntity = aVEntity;
+ aFamily->myName = aFamilyName;
+ aFamily->myNbCells = aSize;
+
+ aFamily->myCellsSize = 0;
+ VISU::TFamilyID2CellsSize::const_iterator anIter = aFamilyID2CellsSize.find(anId);
+ if(anIter != aFamilyID2CellsSize.end())
+ aFamily->myCellsSize = anIter->second;
+
+ const TInt aNbGroup = aFamilyInfo->GetNbGroup();
+ VISU::TNames& aGroupNames = aFamily->myGroupNames;
+ aGroupNames.resize(aNbGroup);
+ for(TInt i = 0; i < aNbGroup; i++){
+ std::string aGroupName = aFamilyInfo->GetGroupName(i);
+ aGroupNames[i] = aGroupName;
+ }
+
+ aFamilyIDMap[anId] = aFamily;
+
+ INITMSG(MY_FAMILY_DEBUG,
+ "- aFamilyName = '"<<aFamilyName<<"'"<<
+ "; myId = "<<aFamily->myId<<"; "<<
+ "; aNbAttr = "<<aFamilyInfo->GetNbAttr()<<
+ "; aNbGroup = "<<aFamilyInfo->GetNbGroup()<<
+ "; aVEntity = "<<aVEntity<<
+ "; myNbCells = "<<aFamily->myNbCells<<
+ "; myCellsSize = "<<aFamily->myCellsSize<<
+ endl);
+#ifdef _DEBUG_
+ for(TInt i = 0; i < aNbGroup; i++){
+ std::string aGroupName = aFamilyInfo->GetGroupName(i);
+ INITMSG(MY_FAMILY_DEBUG,"- aGroupName = '"<<aGroupName<<"'\n");
+ }
#endif
}
*/
void
BuildGrilleFamilyMap(VISU::PMEDMesh theMesh,
- const MED::TEntityInfo& theEntityInfo,
- const MED::TFamilyInfoSet& theFamilyInfoSet,
- MED::PWrapper theMEDWrapper)
+ const MED::TEntityInfo& theEntityInfo,
+ const MED::TFamilyInfoSet& theFamilyInfoSet,
+ MED::PWrapper theMEDWrapper)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"BuildGrilleFamilyMap");
INITMSG(MYDEBUG,"BuildGrilleFamilyMap\n");
TInt anId = aFamilyInfo->GetId();
if(anId == 0)
- continue;
+ continue;
std::string aFamilyName = aFamilyInfo->GetName();
const MED::EEntiteMaillage& aMEntity = MED::GetEntityByFamilyId(aGrilleInfo,
- anId);
+ anId);
VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
VISU::PMEDMeshOnEntity aMeshOnEntity;
VISU::TMeshOnEntityMap::iterator aMeshOnEntityIter = aMeshOnEntityMap.find(aVEntity);
if(aMeshOnEntityIter != aMeshOnEntityMap.end())
- aMeshOnEntity = aMeshOnEntityIter->second;
+ aMeshOnEntity = aMeshOnEntityIter->second;
VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
VISU::TFamilyIDMap& aFamilyIDMap = aMeshOnEntity->myFamilyIDMap;
const VISU::TFamilyID2CellsSize& aFamilyID2CellsSize = aMeshOnEntity->myFamilyID2CellsSize;
VISU::TFamilyID2CellsSize::const_iterator aFamilyid2CellsSizeIter = aFamilyID2CellsSize.find(anId);
if(aFamilyid2CellsSizeIter != (aMeshOnEntity->myFamilyID2CellsSize).end())
- aFamily->myCellsSize = aFamilyid2CellsSizeIter->second;
+ aFamily->myCellsSize = aFamilyid2CellsSizeIter->second;
MED::TFamilyID2NbCells::const_iterator aFam2NbCellsIter = aFam2NbCells.find(anId);
if(aFam2NbCellsIter != aFam2NbCells.end())
- aFamily->myNbCells = aFam2NbCellsIter->second;
+ aFamily->myNbCells = aFam2NbCellsIter->second;
const TInt aNbGroup = aFamilyInfo->GetNbGroup();
VISU::TNames& aGroupNames = aFamily->myGroupNames;
aGroupNames.resize(aNbGroup);
for(TInt i = 0; i < aNbGroup; i++){
- std::string aGroupName = aFamilyInfo->GetGroupName(i);
- aGroupNames[i] = aGroupName;
+ std::string aGroupName = aFamilyInfo->GetGroupName(i);
+ aGroupNames[i] = aGroupName;
}
aFamilyIDMap[anId] = aFamily;
INITMSG(MY_FAMILY_DEBUG,
- "- aFamilyName =|"<<aFamily->myName<<"|"
- << "; myId = "<<aFamily->myId
- << "; aNbAttr = "<<aFamilyInfo->GetNbAttr()
- << "; aNbGroup = "<<aFamilyInfo->GetNbGroup()
- << "; aVEntity = "<<aVEntity
- << "; myNbCells = "<<aFamily->myNbCells
- << "; myCellsSize = "<<aFamily->myCellsSize
- <<endl);
+ "- aFamilyName =|"<<aFamily->myName<<"|"
+ << "; myId = "<<aFamily->myId
+ << "; aNbAttr = "<<aFamilyInfo->GetNbAttr()
+ << "; aNbGroup = "<<aFamilyInfo->GetNbGroup()
+ << "; aVEntity = "<<aVEntity
+ << "; myNbCells = "<<aFamily->myNbCells
+ << "; myCellsSize = "<<aFamily->myCellsSize
+ <<endl);
}
//---------------------------------------------------------------
void
BuildGroupMap(VISU::PMEDMesh theMesh,
- const MED::TFamilyInfoSet& theFamilyInfoSet)
+ const MED::TFamilyInfoSet& theFamilyInfoSet)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"BuildGroupMap");
INITMSG(MYDEBUG,"BuildGroupMap\n");
const MED::TFamilyInfoSet& aFamilyInfoSet = aGroupInfoIter->second;
MED::TFamilyInfoSet::const_iterator aFamilyIter = aFamilyInfoSet.begin();
for(; aFamilyIter != aFamilyInfoSet.end(); aFamilyIter++){
- const MED::PFamilyInfo& aFamilyInfo = *aFamilyIter;
- std::string aFamilyName = aFamilyInfo->GetName();
-
- VISU::TEntity aVEntity = VISU::TEntity(-1);
- VISU::PMEDFamily aFamily;
-
- // Find aVisuEntity
- const VISU::TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap;
- VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityIter = aMeshOnEntityMap.begin();
- for(; aMeshOnEntityIter != aMeshOnEntityMap.end(); aMeshOnEntityIter++){
- const VISU::PMeshOnEntity& aMeshOnEntity = aMeshOnEntityIter->second;
- const VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
- VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
- for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
- const std::string& aName = aFamilyMapIter->first;
- if(aName == aFamilyName){
+ const MED::PFamilyInfo& aFamilyInfo = *aFamilyIter;
+ std::string aFamilyName = aFamilyInfo->GetName();
+
+ VISU::TEntity aVEntity = VISU::TEntity(-1);
+ VISU::PMEDFamily aFamily;
+
+ // Find aVisuEntity
+ const VISU::TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap;
+ VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityIter = aMeshOnEntityMap.begin();
+ for(; aMeshOnEntityIter != aMeshOnEntityMap.end(); aMeshOnEntityIter++){
+ const VISU::PMeshOnEntity& aMeshOnEntity = aMeshOnEntityIter->second;
+ const VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
+ VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
+ for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
+ const std::string& aName = aFamilyMapIter->first;
+ if(aName == aFamilyName){
aFamily = aFamilyMapIter->second;
- aVEntity = aFamily->myEntity;
- goto exit_lable;
- }
- }
- }
+ aVEntity = aFamily->myEntity;
+ goto exit_lable;
+ }
+ }
+ }
exit_lable:
- if(aFamily && aVEntity >= 0){
- aFamilySet.insert(aFamily);
- INITMSG(MY_GROUP_DEBUG,
- "- aFamilyName = '"<<aFamilyName<<"'"<<
- "; aVEntity = "<<aVEntity<<
- "\n");
- }
+ if(aFamily && aVEntity >= 0){
+ aFamilySet.insert(aFamily);
+ INITMSG(MY_GROUP_DEBUG,
+ "- aFamilyName = '"<<aFamilyName<<"'"<<
+ "; aVEntity = "<<aVEntity<<
+ "\n");
+ }
}
if(!aFamilySet.empty())
- aGroupMap.insert(VISU::TGroupMap::value_type(aGroupName,aGroup));
+ aGroupMap.insert(VISU::TGroupMap::value_type(aGroupName,aGroup));
}
}
void
TMEDNamedPointCoords
::Init(const MED::PNodeInfo& theNodeInfo,
- MED::EVersion theVersion)
+ MED::EVersion theVersion)
{
TMEDCoordHolder* aCoordHolder = new TMEDCoordHolder();
TInt aNbElem = theNodeInfo->GetNbElem();
VISU::TCoordSlice aVCoordSlice = GetCoordSlice(iElem);
MED::TNodeCoord aMCoord = theGrilleInfo->GetCoord(iElem);
for(TInt iDim = 0; iDim < aDim; iDim++){
- aVCoordSlice[iDim] = aMCoord[iDim];
+ aVCoordSlice[iDim] = aMCoord[iDim];
}
}
}
if(myIsElemNum){
// To prepare corresponding mapper engine
if(myObj2VTKID.empty()){
- vtkIdType anEnd = myElemNum->size();
- for(vtkIdType anID = 0; anID < anEnd; anID++)
- myObj2VTKID[(*myElemNum)[anID]] = anID;
+ vtkIdType anEnd = myElemNum->size();
+ for(vtkIdType anID = 0; anID < anEnd; anID++)
+ myObj2VTKID[(*myElemNum)[anID]] = anID;
}
TObj2VTKID::const_iterator anIter = myObj2VTKID.find(theID);
if(anIter != myObj2VTKID.end())
- return anIter->second;
+ return anIter->second;
return -1;
}
return TNamedPointCoords::GetVTKID(theID);
{
if ( myIsElemNum )
for ( size_t anId = 0; anId < (*myElemNum).size(); anId++ )
- if ( (*myElemNum)[ anId ] == theID ) {
- theID = anId;
- break;
- }
+ if ( (*myElemNum)[ anId ] == theID ) {
+ theID = anId;
+ break;
+ }
return TSubProfileImpl::GetElemVTKID( theID );
}
void
TMEDGauss
::LessThan(const PGaussImpl& theGauss,
- bool& theResult) const
+ bool& theResult) const
{
TGaussImpl::LessThan(theGauss,theResult);
if(myGaussInfo){
if(PMEDGauss aGauss = theGauss){
- const MED::TGaussInfo& aLeft = myGaussInfo;
- const MED::TGaussInfo& aReight = aGauss->myGaussInfo;
- theResult = MED::TGaussInfo::TLess()(aLeft,aReight);
+ const MED::TGaussInfo& aLeft = myGaussInfo;
+ const MED::TGaussInfo& aReight = aGauss->myGaussInfo;
+ theResult = MED::TGaussInfo::TLess()(aLeft,aReight);
}
}
}
void
TMEDSubMesh
::Init(const MED::PElemInfo& theElemInfo,
- MED::EVersion theVersion)
+ MED::EVersion theVersion)
{
myVersion = theVersion;
myIsElemNum = theElemInfo->IsElemNum();
std::string aMeshName = aMeshInfo->GetName();
TInt aDim = aMeshInfo->GetDim();
MED::EMaillage aType = aMeshInfo->GetType();
-
+
// creating TMesh structure and TMeshOnEntityMap
VISU::PMEDMesh aMesh = aMeshMap[aMeshName](new VISU::TMEDMesh());
aMesh->myNamedPointCoords(new VISU::TMEDNamedPointCoords());
INITMSG(MYDEBUG,"aMeshName = '"<<aMeshName<<
- "; aDim = "<<aDim<<"\n");
+ "; aDim = "<<aDim<<"\n");
if(aType == MED::eNON_STRUCTURE){
- if(MED::PNodeInfo aNodeInfo = myMed->GetPNodeInfo(aMeshInfo)){
- MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo);
+ if(MED::PNodeInfo aNodeInfo = myMed->GetPNodeInfo(aMeshInfo)){
+ MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo);
- aMesh->myNbPoints = aNodeInfo->GetNbElem();
- aMesh->myEntityInfo = anEntityInfo;
-
-
+ aMesh->myNbPoints = aNodeInfo->GetNbElem();
+ aMesh->myEntityInfo = anEntityInfo;
+
+
#ifndef _DEXCEPT_
- try{
+ try{
#endif
- INITMSG(MYDEBUG,"myNbPoints = "<<aMesh->myNbPoints<<
- "; anEntityInfo.size() = "<<anEntityInfo.size()<<
- "\n");
-
- BuildMeshOnEntityMap(aMesh,
- anEntityInfo,
- aNodeInfo,
- myMed);
-
+ INITMSG(MYDEBUG,"myNbPoints = "<<aMesh->myNbPoints<<
+ "; anEntityInfo.size() = "<<anEntityInfo.size()<<
+ "\n");
+
+ BuildMeshOnEntityMap(aMesh,
+ anEntityInfo,
+ aNodeInfo,
+ myMed);
+
#ifndef _DEXCEPT_
- }catch(std::exception& exc){
- MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
- }catch(...){
- MSG(MYDEBUG,"Unknown exception !!!");
- }
+ }catch(std::exception& exc){
+ MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
+ }catch(...){
+ MSG(MYDEBUG,"Unknown exception !!!");
+ }
#endif
- }
+ }
} // NON STRUCTURED MESH
else {
- MED::PGrilleInfo aGrilleInfo = myMed->GetPGrilleInfo(aMeshInfo);
+ MED::PGrilleInfo aGrilleInfo = myMed->GetPGrilleInfo(aMeshInfo);
- MED::TEntityInfo anEntityInfo;
- anEntityInfo[MED::eNOEUD][MED::ePOINT1] = aGrilleInfo->GetNbNodes();
- anEntityInfo[aGrilleInfo->GetEntity()][aGrilleInfo->GetGeom()] = aGrilleInfo->GetNbCells();
-
- aMesh->myNbPoints = aGrilleInfo->GetNbNodes();
- aMesh->myEntityInfo = anEntityInfo;
+ MED::TEntityInfo anEntityInfo;
+ anEntityInfo[MED::eNOEUD][MED::ePOINT1] = aGrilleInfo->GetNbNodes();
+ anEntityInfo[aGrilleInfo->GetEntity()][aGrilleInfo->GetGeom()] = aGrilleInfo->GetNbCells();
+
+ aMesh->myNbPoints = aGrilleInfo->GetNbNodes();
+ aMesh->myEntityInfo = anEntityInfo;
- aMesh->myIsPolarType = (MED::eGRILLE_POLAIRE == aGrilleInfo->GetGrilleType());
- aMesh->myIsStructured = true;
+ aMesh->myIsPolarType = (MED::eGRILLE_POLAIRE == aGrilleInfo->GetGrilleType());
+ aMesh->myIsStructured = true;
#ifndef _DEXCEPT_
- try{
+ try{
#endif
- BEGMSG(MYDEBUG,"anEntityInfo.size() = "<<anEntityInfo.size()<<"\n");
-
- BuildMeshGrilleOnEntityMap(aMesh,
- anEntityInfo,
- aGrilleInfo,
- myMed);
-
+ BEGMSG(MYDEBUG,"anEntityInfo.size() = "<<anEntityInfo.size()<<"\n");
+
+ BuildMeshGrilleOnEntityMap(aMesh,
+ anEntityInfo,
+ aGrilleInfo,
+ myMed);
+
#ifndef _DEXCEPT_
- }catch(std::exception& exc){
- MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
- }catch(...){
- MSG(MYDEBUG,"Unknown exception !!!");
- }
+ }catch(std::exception& exc){
+ MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
+ }catch(...){
+ MSG(MYDEBUG,"Unknown exception !!!");
+ }
#endif
}
VISU::TMeshMap::const_iterator anIter = aMeshMap.find(aMeshName);
if(anIter == aMeshMap.end())
- continue;
+ continue;
VISU::PMEDMesh aMesh = anIter->second;
INITMSG(MYDEBUG,"aMeshName = '"<<aMeshName<<"'\n");
#ifndef _DEXCEPT_
try{
#endif
- MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo);
+ MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo);
- BuildFieldMap(aMesh,
- anEntityInfo,
- myMed);
+ BuildFieldMap(aMesh,
+ anEntityInfo,
+ myMed);
#ifndef _DEXCEPT_
}catch(std::exception& exc){
- MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
+ MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
}catch(...){
- MSG(MYDEBUG,"Unknown exception !!!");
+ MSG(MYDEBUG,"Unknown exception !!!");
}
#endif
template<class TimeStampValueType>
void
BuildTimeStampMinMax(MED::SharedPtr<TimeStampValueType> theTimeStampValue,
- const VISU::PMEDMeshOnEntity theMeshOnEntity,
- const MED::TGeom2Gauss& theGeom2Gauss,
- VISU::TMetric2Comp2MinMax& theMetric2Comp2MinMax,
+ const VISU::PMEDMeshOnEntity theMeshOnEntity,
+ const MED::TGeom2Gauss& theGeom2Gauss,
+ VISU::TMetric2Comp2MinMax& theMetric2Comp2MinMax,
VISU::TMetric2Comp2MinMax& theMetric2Comp2AverageMinMax,
- VISU::TMetric2Comp2Group2MinMax& theMetric2Comp2Group2MinMax,
- VISU::TMetric2Comp2Group2MinMax& theMetric2Comp2Group2AverageMinMax,
- TInt theNbComp,
- TInt theNbComp2)
+ VISU::TMetric2Comp2Group2MinMax& theMetric2Comp2Group2MinMax,
+ VISU::TMetric2Comp2Group2MinMax& theMetric2Comp2Group2AverageMinMax,
+ TInt theNbComp,
+ TInt theNbComp2)
{
const VISU::TFamilyIDMap& aFamilyIDMap = theMeshOnEntity->myFamilyIDMap;
VISU::TGeom2ElemID2FamilyID aGeom2ElemID2FamilyID = theMeshOnEntity->myGeom2ElemID2FamilyID;
for(; anIter != aGeom2Value.end(); anIter++){
const typename TimeStampValueType::TTMeshValue& aMMeshValue = anIter->second;
MED::EGeometrieElement aMGeom = anIter->first;
-
+
TInt aNbElem = aMMeshValue.myNbElem;
TInt aNbGauss = aMMeshValue.myNbGauss;
-
+
MED::TGeom2Gauss::const_iterator aGaussIter = theGeom2Gauss.find(aMGeom);
if(aGaussIter == theGeom2Gauss.end())
aNbGauss = 1;
-
+
INITMSG(MYDEBUG,
- "- aMGeom = "<<aMGeom<<
- "; aNbElem = "<<aNbElem<<
- "; aNbGauss = "<<aNbGauss<<
- endl);
+ "- aMGeom = "<<aMGeom<<
+ "; aNbElem = "<<aNbElem<<
+ "; aNbGauss = "<<aNbGauss<<
+ endl);
VISU::TElemID2FamilyID anElemID2FamilyID = aGeom2ElemID2FamilyID[aMGeom];
typename TimeStampValueType::TTMeshValue::TCValueSliceArr aMValueSliceArr = aMMeshValue.GetCompValueSliceArr(iElem);
for(int aGaussMetric = (int)VISU::AVERAGE_METRIC; aGaussMetric <= (int)VISU::MAXIMUM_METRIC; aGaussMetric++){
- VISU::TComp2MinMax& aComp2MinMax = theMetric2Comp2MinMax[aGaussMetric];
- VISU::TComp2MinMax& aComp2AverageMinMax = theMetric2Comp2AverageMinMax[aGaussMetric];
- VISU::TComp2Group2MinMax& aComp2Group2MinMax = theMetric2Comp2Group2MinMax[aGaussMetric];
- VISU::TComp2Group2MinMax& aComp2Group2AverageMinMax = theMetric2Comp2Group2AverageMinMax[aGaussMetric];
-
- for(TInt iComp = 0; iComp < theNbComp; iComp++){
- const typename TimeStampValueType::TTMeshValue::TCValueSlice& aMValueSlice = aMValueSliceArr[iComp];
-
- VISU::TMinMax& aMinMax = aComp2MinMax[iComp+1];
- vtkFloatingPointType& aMin = aMinMax.first;
- vtkFloatingPointType& aMax = aMinMax.second;
- VISU::TMinMax& anAverageMinMax = aComp2AverageMinMax[iComp+1];
- vtkFloatingPointType& anAverageMin = anAverageMinMax.first;
- vtkFloatingPointType& anAverageMax = anAverageMinMax.second;
- vtkFloatingPointType anAverageValue = aBaseAverageValues[aGaussMetric];
-
- VISU::TGroup2MinMax& aGroup2MinMax = aComp2Group2MinMax[iComp+1];
- VISU::TGroup2MinMax& aGroup2AverageMinMax = aComp2Group2AverageMinMax[iComp+1];
- std::map<VISU::TName,vtkFloatingPointType> aGroup2AverageValue;
-
- // get names of groups, to which the element belongs
- VISU::TNames aGroupNames;
- VISU::TElemID2FamilyID::const_iterator anIter = anElemID2FamilyID.find(iElem);
- if(anIter != anElemID2FamilyID.end()){
- int aFamilyId = anIter->second;
- if(aFamilyId != 0){
- VISU::TFamilyIDMap::const_iterator aFamilyIter = aFamilyIDMap.find(aFamilyId);
- if(aFamilyIter != aFamilyIDMap.end()){
- VISU::PMEDFamily aFamily = aFamilyIter->second;
- aGroupNames = aFamily->myGroupNames;
- VISU::TNames::const_iterator aGroupIter = aGroupNames.begin();
- for(; aGroupIter != aGroupNames.end(); aGroupIter++)
- aGroup2AverageValue[*aGroupIter] = aBaseAverageValues[aGaussMetric];
- }
- }
- }
-
- for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
- const vtkFloatingPointType& aVal = aMValueSlice[iGauss];
- aMin = isnan(aVal) ? aVal : std::min(aMin,aVal);
- aMax = isnan(aVal) ? aVal : std::max(aMax,aVal);
- if(isAverageByGaussPoints){
- switch(aGaussMetric) {
- case VISU::AVERAGE_METRIC: anAverageValue += aVal; break;
- case VISU::MINIMUM_METRIC: anAverageValue = std::min(anAverageValue, aVal); break;
- case VISU::MAXIMUM_METRIC: anAverageValue = std::max(anAverageValue, aVal); break;
- }
- }
- else {
- anAverageMin = aMin;
- anAverageMax = aMax;
- }
-
- // additional calculation for each group, to which the element belongs
- VISU::TNames::const_iterator aGroupIter = aGroupNames.begin();
- for(; aGroupIter != aGroupNames.end(); aGroupIter++){
- VISU::TName aGroupName = *aGroupIter;
- bool isGroupFound = aGroup2MinMax.find(aGroupName) != aGroup2MinMax.end();
- VISU::TMinMax& aGroupMinMax = aGroup2MinMax[aGroupName];
- vtkFloatingPointType& aGroupMin = aGroupMinMax.first;
- vtkFloatingPointType& aGroupMax = aGroupMinMax.second;
- aGroupMin = isGroupFound ? std::min(aGroupMin,aVal) : aVal;
- aGroupMax = isGroupFound ? std::max(aGroupMax,aVal) : aVal;
-
- if(isAverageByGaussPoints){
- switch(aGaussMetric) {
- case VISU::AVERAGE_METRIC: aGroup2AverageValue[aGroupName] = aGroup2AverageValue[aGroupName] + aVal; break;
- case VISU::MINIMUM_METRIC: aGroup2AverageValue[aGroupName] = std::min(aGroup2AverageValue[aGroupName], aVal); break;
- case VISU::MAXIMUM_METRIC: aGroup2AverageValue[aGroupName] = std::max(aGroup2AverageValue[aGroupName], aVal); break;
- }
- }
- else {
- VISU::TMinMax& aGroupAverageMinMax = aGroup2AverageMinMax[aGroupName];
- vtkFloatingPointType& aGroupAverageMin = aGroupAverageMinMax.first;
- vtkFloatingPointType& aGroupAverageMax = aGroupAverageMinMax.second;
- aGroupAverageMin = aGroupMin;
- aGroupAverageMax = aGroupMax;
- }
- }
- }
- if(isAverageByGaussPoints){
- if(aGaussMetric == VISU::AVERAGE_METRIC)
- anAverageValue /= aNbGauss;
- anAverageMin = std::min(anAverageMin,anAverageValue);
- anAverageMax = std::max(anAverageMax,anAverageValue);
-
- VISU::TNames::const_iterator aGroupIter = aGroupNames.begin();
- for(; aGroupIter != aGroupNames.end(); aGroupIter++){
- VISU::TName aGroupName = *aGroupIter;
- vtkFloatingPointType aGroupAverageValue = aGroup2AverageValue[aGroupName];
- if(aGaussMetric == VISU::AVERAGE_METRIC)
- aGroupAverageValue /= aNbGauss;
- bool isGroupFound = aGroup2AverageMinMax.find(aGroupName) != aGroup2AverageMinMax.end();
- VISU::TMinMax& aGroupAverageMinMax = aGroup2AverageMinMax[aGroupName];
- vtkFloatingPointType& aGroupAverageMin = aGroupAverageMinMax.first;
- vtkFloatingPointType& aGroupAverageMax = aGroupAverageMinMax.second;
- aGroupAverageMin = isGroupFound ? std::min(aGroupAverageMin,aGroupAverageValue) : aGroupAverageValue;
- aGroupAverageMax = isGroupFound ? std::max(aGroupAverageMax,aGroupAverageValue) : aGroupAverageValue;
- }
- }
- }
+ VISU::TComp2MinMax& aComp2MinMax = theMetric2Comp2MinMax[aGaussMetric];
+ VISU::TComp2MinMax& aComp2AverageMinMax = theMetric2Comp2AverageMinMax[aGaussMetric];
+ VISU::TComp2Group2MinMax& aComp2Group2MinMax = theMetric2Comp2Group2MinMax[aGaussMetric];
+ VISU::TComp2Group2MinMax& aComp2Group2AverageMinMax = theMetric2Comp2Group2AverageMinMax[aGaussMetric];
+
+ for(TInt iComp = 0; iComp < theNbComp; iComp++){
+ const typename TimeStampValueType::TTMeshValue::TCValueSlice& aMValueSlice = aMValueSliceArr[iComp];
+
+ VISU::TMinMax& aMinMax = aComp2MinMax[iComp+1];
+ vtkFloatingPointType& aMin = aMinMax.first;
+ vtkFloatingPointType& aMax = aMinMax.second;
+ VISU::TMinMax& anAverageMinMax = aComp2AverageMinMax[iComp+1];
+ vtkFloatingPointType& anAverageMin = anAverageMinMax.first;
+ vtkFloatingPointType& anAverageMax = anAverageMinMax.second;
+ vtkFloatingPointType anAverageValue = aBaseAverageValues[aGaussMetric];
+
+ VISU::TGroup2MinMax& aGroup2MinMax = aComp2Group2MinMax[iComp+1];
+ VISU::TGroup2MinMax& aGroup2AverageMinMax = aComp2Group2AverageMinMax[iComp+1];
+ std::map<VISU::TName,vtkFloatingPointType> aGroup2AverageValue;
+
+ // get names of groups, to which the element belongs
+ VISU::TNames aGroupNames;
+ VISU::TElemID2FamilyID::const_iterator anIter = anElemID2FamilyID.find(iElem);
+ if(anIter != anElemID2FamilyID.end()){
+ int aFamilyId = anIter->second;
+ if(aFamilyId != 0){
+ VISU::TFamilyIDMap::const_iterator aFamilyIter = aFamilyIDMap.find(aFamilyId);
+ if(aFamilyIter != aFamilyIDMap.end()){
+ VISU::PMEDFamily aFamily = aFamilyIter->second;
+ aGroupNames = aFamily->myGroupNames;
+ VISU::TNames::const_iterator aGroupIter = aGroupNames.begin();
+ for(; aGroupIter != aGroupNames.end(); aGroupIter++)
+ aGroup2AverageValue[*aGroupIter] = aBaseAverageValues[aGaussMetric];
+ }
+ }
+ }
+
+ for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
+ const vtkFloatingPointType& aVal = aMValueSlice[iGauss];
+ aMin = isnan(aVal) ? aVal : std::min(aMin,aVal);
+ aMax = isnan(aVal) ? aVal : std::max(aMax,aVal);
+ if(isAverageByGaussPoints){
+ switch(aGaussMetric) {
+ case VISU::AVERAGE_METRIC: anAverageValue += aVal; break;
+ case VISU::MINIMUM_METRIC: anAverageValue = std::min(anAverageValue, aVal); break;
+ case VISU::MAXIMUM_METRIC: anAverageValue = std::max(anAverageValue, aVal); break;
+ }
+ }
+ else {
+ anAverageMin = aMin;
+ anAverageMax = aMax;
+ }
+
+ // additional calculation for each group, to which the element belongs
+ VISU::TNames::const_iterator aGroupIter = aGroupNames.begin();
+ for(; aGroupIter != aGroupNames.end(); aGroupIter++){
+ VISU::TName aGroupName = *aGroupIter;
+ bool isGroupFound = aGroup2MinMax.find(aGroupName) != aGroup2MinMax.end();
+ VISU::TMinMax& aGroupMinMax = aGroup2MinMax[aGroupName];
+ vtkFloatingPointType& aGroupMin = aGroupMinMax.first;
+ vtkFloatingPointType& aGroupMax = aGroupMinMax.second;
+ aGroupMin = isGroupFound ? std::min(aGroupMin,aVal) : aVal;
+ aGroupMax = isGroupFound ? std::max(aGroupMax,aVal) : aVal;
+
+ if(isAverageByGaussPoints){
+ switch(aGaussMetric) {
+ case VISU::AVERAGE_METRIC: aGroup2AverageValue[aGroupName] = aGroup2AverageValue[aGroupName] + aVal; break;
+ case VISU::MINIMUM_METRIC: aGroup2AverageValue[aGroupName] = std::min(aGroup2AverageValue[aGroupName], aVal); break;
+ case VISU::MAXIMUM_METRIC: aGroup2AverageValue[aGroupName] = std::max(aGroup2AverageValue[aGroupName], aVal); break;
+ }
+ }
+ else {
+ VISU::TMinMax& aGroupAverageMinMax = aGroup2AverageMinMax[aGroupName];
+ vtkFloatingPointType& aGroupAverageMin = aGroupAverageMinMax.first;
+ vtkFloatingPointType& aGroupAverageMax = aGroupAverageMinMax.second;
+ aGroupAverageMin = aGroupMin;
+ aGroupAverageMax = aGroupMax;
+ }
+ }
+ }
+ if(isAverageByGaussPoints){
+ if(aGaussMetric == VISU::AVERAGE_METRIC)
+ anAverageValue /= aNbGauss;
+ anAverageMin = std::min(anAverageMin,anAverageValue);
+ anAverageMax = std::max(anAverageMax,anAverageValue);
+
+ VISU::TNames::const_iterator aGroupIter = aGroupNames.begin();
+ for(; aGroupIter != aGroupNames.end(); aGroupIter++){
+ VISU::TName aGroupName = *aGroupIter;
+ vtkFloatingPointType aGroupAverageValue = aGroup2AverageValue[aGroupName];
+ if(aGaussMetric == VISU::AVERAGE_METRIC)
+ aGroupAverageValue /= aNbGauss;
+ bool isGroupFound = aGroup2AverageMinMax.find(aGroupName) != aGroup2AverageMinMax.end();
+ VISU::TMinMax& aGroupAverageMinMax = aGroup2AverageMinMax[aGroupName];
+ vtkFloatingPointType& aGroupAverageMin = aGroupAverageMinMax.first;
+ vtkFloatingPointType& aGroupAverageMax = aGroupAverageMinMax.second;
+ aGroupAverageMin = isGroupFound ? std::min(aGroupAverageMin,aGroupAverageValue) : aGroupAverageValue;
+ aGroupAverageMax = isGroupFound ? std::max(aGroupAverageMax,aGroupAverageValue) : aGroupAverageValue;
+ }
+ }
+ }
}
}
VISU::TGroup2MinMax& aGroup2AverageMinMax = aComp2Group2AverageMinMax[0];
for(TInt iElem = 0; iElem < aNbElem; iElem++){
- typename TimeStampValueType::TTMeshValue::TCValueSliceArr aMValueSliceArr = aMMeshValue.GetGaussValueSliceArr(iElem);
-
- // get names of groups, to which the element belongs
- VISU::TNames aGroupNames;
- VISU::TElemID2FamilyID::const_iterator anIter = anElemID2FamilyID.find(iElem);
- if(anIter != anElemID2FamilyID.end()){
- int aFamilyId = anIter->second;
- if(aFamilyId != 0){
- VISU::TFamilyIDMap::const_iterator aFamilyIter = aFamilyIDMap.find(aFamilyId);
- if(aFamilyIter != aFamilyIDMap.end()){
- VISU::PMEDFamily aFamily = aFamilyIter->second;
- aGroupNames = aFamily->myGroupNames;
- }
- }
- }
-
- for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
- const typename TimeStampValueType::TTMeshValue::TCValueSlice& aMValueSlice = aMValueSliceArr[iGauss];
- vtkFloatingPointType aValue = 0.0;
- for(TInt iComp = 0; iComp < theNbComp2; iComp++){
- vtkFloatingPointType aVal = aMValueSlice[iComp];
- aValue += aVal*aVal;
- }
- aValue = sqrt(aValue);
- aMin = isnan(aValue) ? aValue : std::min(aMin,aValue);
- aMax = isnan(aValue) ? aValue : std::max(aMax,aValue);
-
- // additional calculation for each group, to which the element belongs
- VISU::TNames::const_iterator aGroupIter = aGroupNames.begin();
- for(; aGroupIter != aGroupNames.end(); aGroupIter++){
- VISU::TName aGroupName = *aGroupIter;
- bool isGroupFound = aGroup2MinMax.find(aGroupName) != aGroup2MinMax.end();
- VISU::TMinMax& aGroupMinMax = aGroup2MinMax[aGroupName];
- vtkFloatingPointType& aGroupMin = aGroupMinMax.first;
- vtkFloatingPointType& aGroupMax = aGroupMinMax.second;
- aGroupMin = isGroupFound ? std::min(aGroupMin,aValue) : aValue;
- aGroupMax = isGroupFound ? std::max(aGroupMax,aValue) : aValue;
- }
- }
- if(isAverageByGaussPoints){
- typename TimeStampValueType::TTMeshValue::TCValueSliceArr aMCompValueSliceArr = aMMeshValue.GetCompValueSliceArr(iElem);
- vtkFloatingPointType aValue = 0.0;
- for(TInt iComp = 0; iComp < theNbComp2; iComp++){
- const typename TimeStampValueType::TTMeshValue::TCValueSlice& aMCompValueSlice = aMCompValueSliceArr[iComp];
- vtkFloatingPointType anAverageValue = aBaseAverageValues[aGaussMetric];
- for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
- const vtkFloatingPointType& aVal = aMCompValueSlice[iGauss];
- switch(aGaussMetric) {
- case VISU::AVERAGE_METRIC: anAverageValue += aVal; break;
- case VISU::MINIMUM_METRIC: anAverageValue = std::min(anAverageValue, aVal); break;
- case VISU::MAXIMUM_METRIC: anAverageValue = std::max(anAverageValue, aVal); break;
- }
- }
- if(aGaussMetric == VISU::AVERAGE_METRIC)
- anAverageValue /= aNbGauss;
- aValue += anAverageValue*anAverageValue;
- }
- aValue = sqrt(aValue);
- anAverageMin = std::min(anAverageMin,aValue);
- anAverageMax = std::max(anAverageMax,aValue);
-
- // additional calculation for each group, to which the element belongs
- VISU::TNames::const_iterator aGroupIter = aGroupNames.begin();
- for(; aGroupIter != aGroupNames.end(); aGroupIter++){
- VISU::TName aGroupName = *aGroupIter;
- bool isGroupFound = aGroup2AverageMinMax.find(aGroupName) != aGroup2AverageMinMax.end();
- VISU::TMinMax& aGroupAverageMinMax = aGroup2AverageMinMax[aGroupName];
- vtkFloatingPointType& aGroupAverageMin = aGroupAverageMinMax.first;
- vtkFloatingPointType& aGroupAverageMax = aGroupAverageMinMax.second;
- aGroupAverageMin = isGroupFound ? std::min(aGroupAverageMin,aValue) : aValue;
- aGroupAverageMax = isGroupFound ? std::max(aGroupAverageMax,aValue) : aValue;
- }
- }
- else {
- anAverageMin = aMin;
- anAverageMax = aMax;
-
- // additional calculation for each group, to which the element belongs
- VISU::TNames::const_iterator aGroupIter = aGroupNames.begin();
- for(; aGroupIter != aGroupNames.end(); aGroupIter++){
- VISU::TName aGroupName = *aGroupIter;
- VISU::TMinMax& aGroupAverageMinMax = aGroup2AverageMinMax[aGroupName];
- vtkFloatingPointType& aGroupAverageMin = aGroupAverageMinMax.first;
- vtkFloatingPointType& aGroupAverageMax = aGroupAverageMinMax.second;
- aGroupAverageMin = aGroup2MinMax[aGroupName].first;
- aGroupAverageMax = aGroup2MinMax[aGroupName].second;
- }
- }
+ typename TimeStampValueType::TTMeshValue::TCValueSliceArr aMValueSliceArr = aMMeshValue.GetGaussValueSliceArr(iElem);
+
+ // get names of groups, to which the element belongs
+ VISU::TNames aGroupNames;
+ VISU::TElemID2FamilyID::const_iterator anIter = anElemID2FamilyID.find(iElem);
+ if(anIter != anElemID2FamilyID.end()){
+ int aFamilyId = anIter->second;
+ if(aFamilyId != 0){
+ VISU::TFamilyIDMap::const_iterator aFamilyIter = aFamilyIDMap.find(aFamilyId);
+ if(aFamilyIter != aFamilyIDMap.end()){
+ VISU::PMEDFamily aFamily = aFamilyIter->second;
+ aGroupNames = aFamily->myGroupNames;
+ }
+ }
+ }
+
+ for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
+ const typename TimeStampValueType::TTMeshValue::TCValueSlice& aMValueSlice = aMValueSliceArr[iGauss];
+ vtkFloatingPointType aValue = 0.0;
+ for(TInt iComp = 0; iComp < theNbComp2; iComp++){
+ vtkFloatingPointType aVal = aMValueSlice[iComp];
+ aValue += aVal*aVal;
+ }
+ aValue = sqrt(aValue);
+ aMin = isnan(aValue) ? aValue : std::min(aMin,aValue);
+ aMax = isnan(aValue) ? aValue : std::max(aMax,aValue);
+
+ // additional calculation for each group, to which the element belongs
+ VISU::TNames::const_iterator aGroupIter = aGroupNames.begin();
+ for(; aGroupIter != aGroupNames.end(); aGroupIter++){
+ VISU::TName aGroupName = *aGroupIter;
+ bool isGroupFound = aGroup2MinMax.find(aGroupName) != aGroup2MinMax.end();
+ VISU::TMinMax& aGroupMinMax = aGroup2MinMax[aGroupName];
+ vtkFloatingPointType& aGroupMin = aGroupMinMax.first;
+ vtkFloatingPointType& aGroupMax = aGroupMinMax.second;
+ aGroupMin = isGroupFound ? std::min(aGroupMin,aValue) : aValue;
+ aGroupMax = isGroupFound ? std::max(aGroupMax,aValue) : aValue;
+ }
+ }
+ if(isAverageByGaussPoints){
+ typename TimeStampValueType::TTMeshValue::TCValueSliceArr aMCompValueSliceArr = aMMeshValue.GetCompValueSliceArr(iElem);
+ vtkFloatingPointType aValue = 0.0;
+ for(TInt iComp = 0; iComp < theNbComp2; iComp++){
+ const typename TimeStampValueType::TTMeshValue::TCValueSlice& aMCompValueSlice = aMCompValueSliceArr[iComp];
+ vtkFloatingPointType anAverageValue = aBaseAverageValues[aGaussMetric];
+ for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
+ const vtkFloatingPointType& aVal = aMCompValueSlice[iGauss];
+ switch(aGaussMetric) {
+ case VISU::AVERAGE_METRIC: anAverageValue += aVal; break;
+ case VISU::MINIMUM_METRIC: anAverageValue = std::min(anAverageValue, aVal); break;
+ case VISU::MAXIMUM_METRIC: anAverageValue = std::max(anAverageValue, aVal); break;
+ }
+ }
+ if(aGaussMetric == VISU::AVERAGE_METRIC)
+ anAverageValue /= aNbGauss;
+ aValue += anAverageValue*anAverageValue;
+ }
+ aValue = sqrt(aValue);
+ anAverageMin = std::min(anAverageMin,aValue);
+ anAverageMax = std::max(anAverageMax,aValue);
+
+ // additional calculation for each group, to which the element belongs
+ VISU::TNames::const_iterator aGroupIter = aGroupNames.begin();
+ for(; aGroupIter != aGroupNames.end(); aGroupIter++){
+ VISU::TName aGroupName = *aGroupIter;
+ bool isGroupFound = aGroup2AverageMinMax.find(aGroupName) != aGroup2AverageMinMax.end();
+ VISU::TMinMax& aGroupAverageMinMax = aGroup2AverageMinMax[aGroupName];
+ vtkFloatingPointType& aGroupAverageMin = aGroupAverageMinMax.first;
+ vtkFloatingPointType& aGroupAverageMax = aGroupAverageMinMax.second;
+ aGroupAverageMin = isGroupFound ? std::min(aGroupAverageMin,aValue) : aValue;
+ aGroupAverageMax = isGroupFound ? std::max(aGroupAverageMax,aValue) : aValue;
+ }
+ }
+ else {
+ anAverageMin = aMin;
+ anAverageMax = aMax;
+
+ // additional calculation for each group, to which the element belongs
+ VISU::TNames::const_iterator aGroupIter = aGroupNames.begin();
+ for(; aGroupIter != aGroupNames.end(); aGroupIter++){
+ VISU::TName aGroupName = *aGroupIter;
+ VISU::TMinMax& aGroupAverageMinMax = aGroup2AverageMinMax[aGroupName];
+ vtkFloatingPointType& aGroupAverageMin = aGroupAverageMinMax.first;
+ vtkFloatingPointType& aGroupAverageMax = aGroupAverageMinMax.second;
+ aGroupAverageMin = aGroup2MinMax[aGroupName].first;
+ aGroupAverageMax = aGroup2MinMax[aGroupName].second;
+ }
+ }
}
}
}
VISU::TMeshMap::const_iterator anIter = aMeshMap.find(aMeshName);
if(anIter == aMeshMap.end())
- continue;
+ continue;
VISU::PMEDMesh aMesh = anIter->second;
#ifndef _DEXCEPT_
try{
#endif
- TInt aNbFields = myMed->GetNbFields();
-
- INITMSG(MYDEBUG,
- "- aMeshName = '"<<aMeshName<<"'"<<
- "; aNbFields = "<<aNbFields<<"\n");
-
- MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo);
-
- for(TInt iField = 1; iField <= aNbFields; iField++){
- VISU::TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPFieldInfo()");
-
- MED::TErr anError = 0;
- MED::PFieldInfo aFieldInfo = myMed->GetPFieldInfo(aMeshInfo, iField, &anError);
- if ( anError < 0 )
- continue;
-
- std::string aFieldName = aFieldInfo->GetName();
- INITMSG(MYDEBUG,"- aFieldName = '"<<aFieldName<<"'\n");
-
- MED::TGeom2Size aGeom2Size;
- MED::EEntiteMaillage aMEntity;
- TInt aNbTimeStamps = myMed->GetNbTimeStamps(aFieldInfo,
- anEntityInfo,
- aMEntity,
- aGeom2Size);
- if(aNbTimeStamps < 1)
- continue;
-
- VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
- VISU::PMEDMeshOnEntity aMeshOnEntity = aMesh->myMeshOnEntityMap[aVEntity];
- VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
- VISU::PMEDField aField = aFieldMap[aFieldName];
-
- TInt aNbComp = aField->myNbComp;
- int aNbComp2 = aNbComp;
- if(aNbComp == 2 || aNbComp == 4)
- aNbComp2 = 2;
- else if(aNbComp > 4)
- aNbComp2 = 3;
-
- VISU::TMetric2Comp2MinMax& aMetric2Comp2MinMax = aField->myMetric2Comp2MinMax;
+ TInt aNbFields = myMed->GetNbFields();
+
+ INITMSG(MYDEBUG,
+ "- aMeshName = '"<<aMeshName<<"'"<<
+ "; aNbFields = "<<aNbFields<<"\n");
+
+ MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo);
+
+ for(TInt iField = 1; iField <= aNbFields; iField++){
+ VISU::TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPFieldInfo()");
+
+ MED::TErr anError = 0;
+ MED::PFieldInfo aFieldInfo = myMed->GetPFieldInfo(aMeshInfo, iField, &anError);
+ if ( anError < 0 )
+ continue;
+
+ std::string aFieldName = aFieldInfo->GetName();
+ INITMSG(MYDEBUG,"- aFieldName = '"<<aFieldName<<"'\n");
+
+ MED::TGeom2Size aGeom2Size;
+ MED::EEntiteMaillage aMEntity;
+ TInt aNbTimeStamps = myMed->GetNbTimeStamps(aFieldInfo,
+ anEntityInfo,
+ aMEntity,
+ aGeom2Size);
+ if(aNbTimeStamps < 1)
+ continue;
+
+ VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
+ VISU::PMEDMeshOnEntity aMeshOnEntity = aMesh->myMeshOnEntityMap[aVEntity];
+ VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
+ VISU::PMEDField aField = aFieldMap[aFieldName];
+
+ TInt aNbComp = aField->myNbComp;
+ int aNbComp2 = aNbComp;
+ if(aNbComp == 2 || aNbComp == 4)
+ aNbComp2 = 2;
+ else if(aNbComp > 4)
+ aNbComp2 = 3;
+
+ VISU::TMetric2Comp2MinMax& aMetric2Comp2MinMax = aField->myMetric2Comp2MinMax;
VISU::TMetric2Comp2MinMax& aMetric2Comp2AverageMinMax = aField->myMetric2Comp2AverageMinMax;
VISU::TMetric2Comp2Group2MinMax& aMetric2Comp2Group2MinMax = aField->myMetric2Comp2Group2MinMax;
VISU::TMetric2Comp2Group2MinMax& aMetric2Comp2Group2AverageMinMax = aField->myMetric2Comp2Group2AverageMinMax;
- TSetIsDone aSetIsDone(aField->myIsMinMaxInitilized);
- for(TInt iTimeStamp = aNbTimeStamps; iTimeStamp >= 1; iTimeStamp--){
- VISU::TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPTimeStampInfo()");
- INITMSG(MYDEBUG,"- iTimeStamp = "<<iTimeStamp<<endl);
-
+ TSetIsDone aSetIsDone(aField->myIsMinMaxInitilized);
+ for(TInt iTimeStamp = aNbTimeStamps; iTimeStamp >= 1; iTimeStamp--){
+ VISU::TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPTimeStampInfo()");
+ INITMSG(MYDEBUG,"- iTimeStamp = "<<iTimeStamp<<endl);
+
#ifndef _DEXCEPT_
try {
#ifdef NO_CAS_CATCH
if(aFieldInfo->GetType() == MED::eFLOAT64)
BuildTimeStampMinMax<MED::TFloatTimeStampValue>(CastToFloatTimeStampValue(aTimeStampValue),
- aMeshOnEntity,
+ aMeshOnEntity,
aGeom2Gauss,
aMetric2Comp2MinMax,
aMetric2Comp2AverageMinMax,
- aMetric2Comp2Group2MinMax,
- aMetric2Comp2Group2AverageMinMax,
+ aMetric2Comp2Group2MinMax,
+ aMetric2Comp2Group2AverageMinMax,
aNbComp,
aNbComp2);
else
BuildTimeStampMinMax<MED::TIntTimeStampValue>(CastToIntTimeStampValue(aTimeStampValue),
- aMeshOnEntity,
+ aMeshOnEntity,
aGeom2Gauss,
aMetric2Comp2MinMax,
aMetric2Comp2AverageMinMax,
- aMetric2Comp2Group2MinMax,
- aMetric2Comp2Group2AverageMinMax,
+ aMetric2Comp2Group2MinMax,
+ aMetric2Comp2Group2AverageMinMax,
aNbComp,
aNbComp2);
MSG(MYDEBUG,"Unknown exception !!!");
}
#endif
- }
- for(TInt iComp = 0; iComp <= aNbComp; iComp++){
- VISU::TMinMax aMinMax = aField->GetMinMax(iComp, VISU::TNames());
- INITMSG(MYDEBUG,"- "<<iComp<<": "<<aMinMax.first<<"; "<<aMinMax.second<<endl);
- }
- }
+ }
+ for(TInt iComp = 0; iComp <= aNbComp; iComp++){
+ VISU::TMinMax aMinMax = aField->GetMinMax(iComp, VISU::TNames());
+ INITMSG(MYDEBUG,"- "<<iComp<<": "<<aMinMax.first<<"; "<<aMinMax.second<<endl);
+ }
+ }
#ifndef _DEXCEPT_
}catch(std::exception& exc){
- MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
+ MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
}catch(...){
- MSG(MYDEBUG,"Unknown exception !!!");
+ MSG(MYDEBUG,"Unknown exception !!!");
}
#endif
VISU::TMeshMap::const_iterator anIter = aMeshMap.find(aMeshName);
if(anIter == aMeshMap.end())
- continue;
+ continue;
VISU::PMEDMesh aMesh = anIter->second;
INITMSG(MYDEBUG,"aMeshName = '"<<aMeshName<<"'\n");
MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo);
MED::TEntity2TGeom2ElemInfo anEntity2TGeom2ElemInfo =
- MED::GetEntity2TGeom2ElemInfo(myMed, aMeshInfo, anEntityInfo);
+ MED::GetEntity2TGeom2ElemInfo(myMed, aMeshInfo, anEntityInfo);
#ifndef _DEXCEPT_
try{
#endif
- MED::TFamilyInfoSet aFamilyInfoSet = MED::GetFamilyInfoSet(myMed, aMeshInfo);
-
- if(aType == MED::eNON_STRUCTURE)
- BuildFamilyMap(aMesh,
- anEntityInfo,
- anEntity2TGeom2ElemInfo,
- aFamilyInfoSet,
- myMed);
- else
- BuildGrilleFamilyMap(aMesh,
- anEntityInfo,
- aFamilyInfoSet,
- myMed);
-
- BuildGroupMap(aMesh,
- aFamilyInfoSet);
+ MED::TFamilyInfoSet aFamilyInfoSet = MED::GetFamilyInfoSet(myMed, aMeshInfo);
+
+ if(aType == MED::eNON_STRUCTURE)
+ BuildFamilyMap(aMesh,
+ anEntityInfo,
+ anEntity2TGeom2ElemInfo,
+ aFamilyInfoSet,
+ myMed);
+ else
+ BuildGrilleFamilyMap(aMesh,
+ anEntityInfo,
+ aFamilyInfoSet,
+ myMed);
+
+ BuildGroupMap(aMesh,
+ aFamilyInfoSet);
#ifndef _DEXCEPT_
}catch(std::exception& exc){
- MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
+ MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
}catch(...){
- MSG(MYDEBUG,"Unknown exception !!!");
+ MSG(MYDEBUG,"Unknown exception !!!");
}
#endif
int
VISU_MedConvertor
::LoadMeshOnEntity(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity)
+ VISU::PMeshOnEntityImpl theMeshOnEntity)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"LoadMeshOnEntity");
INITMSG(MYDEBUG,"LoadMeshOnEntity"<<endl);
int
VISU_MedConvertor
::LoadFamilyOnEntity(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity,
- VISU::PFamilyImpl theFamily)
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFamilyImpl theFamily)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"LoadFamilyOnEntity");
INITMSG(MYDEBUG,"LoadFamilyOnEntity"<<endl);
int
VISU_MedConvertor
::LoadMeshOnGroup(VISU::PMeshImpl theMesh,
- const VISU::TFamilySet& theFamilySet)
+ const VISU::TFamilySet& theFamilySet)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"LoadMeshOnGroup");
INITMSG(MYDEBUG,"LoadMeshOnGroup"<<endl);
int
VISU_MedConvertor
::LoadValForTimeOnMesh(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity,
- VISU::PFieldImpl theField,
- VISU::PValForTimeImpl theValForTime)
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFieldImpl theField,
+ VISU::PValForTimeImpl theValForTime)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"LoadValForTimeOnMesh");
INITMSG(MYDEBUG,"LoadValForTimeOnMesh"<<endl);
int
VISU_MedConvertor
::LoadValForTimeOnGaussPts(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity,
- VISU::PFieldImpl theField,
- VISU::PValForTimeImpl theValForTime)
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFieldImpl theField,
+ VISU::PValForTimeImpl theValForTime)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"LoadValForTimeOnGaussPts");
INITMSG(MYDEBUG,"LoadValForTimeOnGaussPts"<<endl);
int
VISU_MedConvertor
::LoadPoints(const MED::PWrapper& theMed,
- VISU::PMEDMesh theMesh)
+ VISU::PMEDMesh theMesh)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"LoadPoints");
try{
VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
aCell2Connect.resize(aNbElem);
for (int iElem = 0; iElem < aNbElem; iElem++)
- aCell2Connect[iElem] = VISU::TConnect(1,iElem);
+ aCell2Connect[iElem] = VISU::TConnect(1,iElem);
} // END NON_STRUCTURED
else { // STRUCTURED
//Main part of code
VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
aCell2Connect.resize(aNbElem);
for(int iElem = 0; iElem < aNbElem; iElem++)
- aCell2Connect[iElem] = VISU::TConnect(1,iElem);
+ aCell2Connect[iElem] = VISU::TConnect(1,iElem);
}
int
VISU_MedConvertor
::LoadPointsOnFamily(const MED::PWrapper& theMed,
- const VISU::PMEDMesh theMesh,
- const VISU::PMEDFamily theFamily)
+ const VISU::PMEDMesh theMesh,
+ const VISU::PMEDFamily theFamily)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"LoadPointsOnFamily");
try{
TInt aNbElem = aNodeInfo->GetNbElem();
if(aNbElem > 0){
- TInt anId = theFamily->myId;
- VISU::TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[VISU::ePOINT1];
- for(TInt iElem = 0; iElem < aNbElem; iElem++)
- if(aNodeInfo->GetFamNum(iElem) == anId)
- aSubMeshID.push_back(iElem);
+ TInt anId = theFamily->myId;
+ VISU::TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[VISU::ePOINT1];
+ for(TInt iElem = 0; iElem < aNbElem; iElem++)
+ if(aNodeInfo->GetFamNum(iElem) == anId)
+ aSubMeshID.push_back(iElem);
}
}
else {
TInt aNbElem = aGrilleInfo->GetNbNodes();
if(aNbElem > 0){
- TInt anId = theFamily->myId;
- VISU::TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[VISU::ePOINT1];
- for(TInt iElem = 0; iElem < aNbElem; iElem++)
- if(aGrilleInfo->GetFamNumNode(iElem) == anId)
- aSubMeshID.push_back(iElem);
+ TInt anId = theFamily->myId;
+ VISU::TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[VISU::ePOINT1];
+ for(TInt iElem = 0; iElem < aNbElem; iElem++)
+ if(aGrilleInfo->GetFamNumNode(iElem) == anId)
+ aSubMeshID.push_back(iElem);
}
}
int
VISU_MedConvertor
::LoadCellsOnEntity(const MED::PWrapper& theMed,
- const VISU::PMEDMesh theMesh,
- const VISU::PMEDMeshOnEntity theMeshOnEntity)
+ const VISU::PMEDMesh theMesh,
+ const VISU::PMEDMeshOnEntity theMeshOnEntity)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"LoadCellsOnEntity");
#ifndef _DEXCEPT_
VISU::TGeom2SubMesh& aGeom2SubMesh = theMeshOnEntity->myGeom2SubMesh;
for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){
- const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first;
- VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
- INITMSG(MYDEBUG,"aMGeom = "<<aMGeom<<"; aEGeom = "<<aEGeom<<"\n");
- {
- vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom);
- INITMSG(MYDEBUG,"aVNbNodes = "<<aVNbNodes<<"\n");
-
- TInt aNbElem = aGeom2SizeIter->second;//aGrilleInfo->GetNbCells();
-
- if(aNbElem > 0){
- VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh());
-
- aSubMesh->Init(aGrilleInfo);
- aSubMesh->myNbCells = aNbElem;
- aSubMesh->myCellsSize = aNbElem*(aVNbNodes+1);
-
- VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
- aCell2Connect.resize(aNbElem);
-
- TInt aMNbNodes = MEDGeom2NbNodes(aMGeom);
- VISU::TVector<TInt> aConnect(aMNbNodes);
-
- for(TInt iElem = 0; iElem < aNbElem; iElem++) {
- MED::TIntVector aConn = aGrilleInfo->GetConn(iElem);
- VISU::TConnect& anArray = aCell2Connect[iElem];
- anArray.resize(aVNbNodes);
-
- if(anIsNodeNum){
- for(TInt iConn = 0; iConn < aMNbNodes; iConn++){
- aConnect[iConn] = aNodeIdMap[aConn[iConn] - 1];
- }
- }else{
- for(int iConn = 0; iConn < aMNbNodes; ++iConn){
- aConnect[iConn] = aConn[iConn];
- }
- }
-
- switch(aMGeom){
- case MED::eQUAD4:
- anArray[0] = aConnect[0];
- anArray[1] = aConnect[2];
- anArray[2] = aConnect[3];
- anArray[3] = aConnect[1];
- break;
- case MED::eHEXA8:
- anArray[0] = aConnect[0];
- anArray[1] = aConnect[2];
- anArray[2] = aConnect[3];
- anArray[3] = aConnect[1];
- anArray[4] = aConnect[4];
- anArray[5] = aConnect[6];
- anArray[6] = aConnect[7];
- anArray[7] = aConnect[5];
- break;
- default:
- for(int iNode = 0; iNode < aVNbNodes; iNode++)
- anArray[iNode] = aConnect[iNode];
- }
-
- for(int iNode = 0; iNode < aVNbNodes; iNode++)
- if(anArray[iNode] < 0 || aNbPoints <= anArray[iNode])
- EXCEPTION(std::runtime_error,"LoadCellsOnEntity - "<<
- " aNbPoints("<<aNbPoints<<") "<<
- "<= anArray["<<iElem<<"]"<<
- "["<<iNode<<"]"<<
- "("<<anArray[iNode]<<") < 0");
- }
- }
- }
+ const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first;
+ VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
+ INITMSG(MYDEBUG,"aMGeom = "<<aMGeom<<"; aEGeom = "<<aEGeom<<"\n");
+ {
+ vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom);
+ INITMSG(MYDEBUG,"aVNbNodes = "<<aVNbNodes<<"\n");
+
+ TInt aNbElem = aGeom2SizeIter->second;//aGrilleInfo->GetNbCells();
+
+ if(aNbElem > 0){
+ VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh());
+
+ aSubMesh->Init(aGrilleInfo);
+ aSubMesh->myNbCells = aNbElem;
+ aSubMesh->myCellsSize = aNbElem*(aVNbNodes+1);
+
+ VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
+ aCell2Connect.resize(aNbElem);
+
+ TInt aMNbNodes = MEDGeom2NbNodes(aMGeom);
+ VISU::TVector<TInt> aConnect(aMNbNodes);
+
+ for(TInt iElem = 0; iElem < aNbElem; iElem++) {
+ MED::TIntVector aConn = aGrilleInfo->GetConn(iElem);
+ VISU::TConnect& anArray = aCell2Connect[iElem];
+ anArray.resize(aVNbNodes);
+
+ if(anIsNodeNum){
+ for(TInt iConn = 0; iConn < aMNbNodes; iConn++){
+ aConnect[iConn] = aNodeIdMap[aConn[iConn] - 1];
+ }
+ }else{
+ for(int iConn = 0; iConn < aMNbNodes; ++iConn){
+ aConnect[iConn] = aConn[iConn];
+ }
+ }
+
+ switch(aMGeom){
+ case MED::eQUAD4:
+ anArray[0] = aConnect[0];
+ anArray[1] = aConnect[2];
+ anArray[2] = aConnect[3];
+ anArray[3] = aConnect[1];
+ break;
+ case MED::eHEXA8:
+ anArray[0] = aConnect[0];
+ anArray[1] = aConnect[2];
+ anArray[2] = aConnect[3];
+ anArray[3] = aConnect[1];
+ anArray[4] = aConnect[4];
+ anArray[5] = aConnect[6];
+ anArray[6] = aConnect[7];
+ anArray[7] = aConnect[5];
+ break;
+ default:
+ for(int iNode = 0; iNode < aVNbNodes; iNode++)
+ anArray[iNode] = aConnect[iNode];
+ }
+
+ for(int iNode = 0; iNode < aVNbNodes; iNode++)
+ if(anArray[iNode] < 0 || aNbPoints <= anArray[iNode])
+ EXCEPTION(std::runtime_error,"LoadCellsOnEntity - "<<
+ " aNbPoints("<<aNbPoints<<") "<<
+ "<= anArray["<<iElem<<"]"<<
+ "["<<iNode<<"]"<<
+ "("<<anArray[iNode]<<") < 0");
+ }
+ }
+ }
}
theMeshOnEntity->myIsDone = true;
EBooleen anIsNodeNum = aNodeInfo->IsElemNum();
if(anIsNodeNum){
for(TInt i = 0; i < aNbPoints; i++){
- aNodeIdMap[aNodeInfo->GetElemNum(i)-1] = i;
+ aNodeIdMap[aNodeInfo->GetElemNum(i)-1] = i;
}
}
#endif
INITMSG(MYDEBUG,"aMGeom = "<<aMGeom<<"; aEGeom = "<<aEGeom<<"\n");
switch(aMGeom){
case MED::ePOLYGONE: {
- MED::PPolygoneInfo aPolygoneInfo = theMed->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom);
- TInt aNbElem = aPolygoneInfo->GetNbElem();
- if(aNbElem > 0){
- VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh());
-
- aSubMesh->Init(MED::PElemInfo(aPolygoneInfo),theMed->GetVersion());
- aSubMesh->myNbCells = aNbElem;
-
- VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
- aCell2Connect.resize(aNbElem);
-
- for(TInt iElem = 0; iElem < aNbElem; iElem++) {
- MED::TCConnSlice aConnSlice = aPolygoneInfo->GetConnSlice(iElem);
- TInt aNbConn = aPolygoneInfo->GetNbConn(iElem);
- aSubMesh->myCellsSize += aNbConn;
- VISU::TConnect& anArray = aCell2Connect[iElem];
- anArray.resize(aNbConn);
- for(TInt iConn = 0; iConn < aNbConn; iConn++)
- anArray[iConn] = aConnSlice[iConn] - 1;
- }
- }
- break;
+ MED::PPolygoneInfo aPolygoneInfo = theMed->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom);
+ TInt aNbElem = aPolygoneInfo->GetNbElem();
+ if(aNbElem > 0){
+ VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh());
+
+ aSubMesh->Init(MED::PElemInfo(aPolygoneInfo),theMed->GetVersion());
+ aSubMesh->myNbCells = aNbElem;
+
+ VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
+ aCell2Connect.resize(aNbElem);
+
+ for(TInt iElem = 0; iElem < aNbElem; iElem++) {
+ MED::TCConnSlice aConnSlice = aPolygoneInfo->GetConnSlice(iElem);
+ TInt aNbConn = aPolygoneInfo->GetNbConn(iElem);
+ aSubMesh->myCellsSize += aNbConn;
+ VISU::TConnect& anArray = aCell2Connect[iElem];
+ anArray.resize(aNbConn);
+ for(TInt iConn = 0; iConn < aNbConn; iConn++)
+ anArray[iConn] = aConnSlice[iConn] - 1;
+ }
+ }
+ break;
}
case MED::ePOLYEDRE: {
- MED::PPolyedreInfo aPolyedreInfo = theMed->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom);
- TInt aNbElem = aPolyedreInfo->GetNbElem();
-
- if(aNbElem > 0){
- VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh());
-
- aSubMesh->Init(MED::PElemInfo(aPolyedreInfo),theMed->GetVersion());
- aSubMesh->myNbCells = aNbElem;
-
- VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
- aCell2Connect.resize(aNbElem);
-
- for(TInt iElem = 0; iElem < aNbElem; iElem++){
- MED::TCConnSliceArr aConnSliceArr = aPolyedreInfo->GetConnSliceArr(iElem);
- VISU::TConnect& anArray = aCell2Connect[iElem];
- typedef std::set<TInt> TConnectSet;
- TConnectSet aConnectSet;
- TInt aNbFaces = aConnSliceArr.size();
- for(TInt iFace = 0; iFace < aNbFaces; iFace++){
- MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
- TInt aNbConn = aConnSlice.size();
- aSubMesh->myCellsSize += aNbConn;
- for(TInt iConn = 0; iConn < aNbConn; iConn++){
- aConnectSet.insert(aConnSlice[iConn]);
- }
- }
-
- int aNbConn = aConnectSet.size();
- anArray.resize(aNbConn);
- TConnectSet::iterator anIter = aConnectSet.begin();
- for(int i = 0; anIter != aConnectSet.end(); anIter++, i++){
- TInt anId = *anIter;
- anArray[i] = anId - 1;
- }
- }
- }
-
- break;
+ MED::PPolyedreInfo aPolyedreInfo = theMed->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom);
+ TInt aNbElem = aPolyedreInfo->GetNbElem();
+
+ if(aNbElem > 0){
+ VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh());
+
+ aSubMesh->Init(MED::PElemInfo(aPolyedreInfo),theMed->GetVersion());
+ aSubMesh->myNbCells = aNbElem;
+
+ VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
+ aCell2Connect.resize(aNbElem);
+
+ for(TInt iElem = 0; iElem < aNbElem; iElem++){
+ MED::TCConnSliceArr aConnSliceArr = aPolyedreInfo->GetConnSliceArr(iElem);
+ VISU::TConnect& anArray = aCell2Connect[iElem];
+ typedef std::set<TInt> TConnectSet;
+ TConnectSet aConnectSet;
+ TInt aNbFaces = aConnSliceArr.size();
+ for(TInt iFace = 0; iFace < aNbFaces; iFace++){
+ MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
+ TInt aNbConn = aConnSlice.size();
+ aSubMesh->myCellsSize += aNbConn;
+ for(TInt iConn = 0; iConn < aNbConn; iConn++){
+ aConnectSet.insert(aConnSlice[iConn]);
+ }
+ }
+
+ int aNbConn = aConnectSet.size();
+ anArray.resize(aNbConn);
+ TConnectSet::iterator anIter = aConnectSet.begin();
+ for(int i = 0; anIter != aConnectSet.end(); anIter++, i++){
+ TInt anId = *anIter;
+ anArray[i] = anId - 1;
+ }
+ }
+ }
+
+ break;
}
default: {
- vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom);
- INITMSG(MYDEBUG,"aVNbNodes = "<<aVNbNodes<<"\n");
-
- MED::PCellInfo aCellInfo = theMed->GetPCellInfo(aMeshInfo,aMEntity,aMGeom);
- TInt aNbElem = aCellInfo->GetNbElem();
-
- if(aNbElem > 0){
- VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh());
-
- aSubMesh->Init(MED::PElemInfo(aCellInfo), theMed->GetVersion());
- aSubMesh->myNbCells = aNbElem;
- aSubMesh->myCellsSize = aNbElem*(aVNbNodes+1);
-
- VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
- aCell2Connect.resize(aNbElem);
-
- TInt aMNbNodes = MEDGeom2NbNodes(aMGeom);
- VISU::TVector<TInt> aConnect(aMNbNodes);
-
- for(TInt iElem = 0; iElem < aNbElem; iElem++) {
- MED::TCConnSlice aConnSlice = aCellInfo->GetConnSlice(iElem);
- VISU::TConnect& anArray = aCell2Connect[iElem];
- anArray.resize(aVNbNodes);
-
- if(anIsNodeNum){
- for(TInt iConn = 0; iConn < aMNbNodes; iConn++){
- aConnect[iConn] = aNodeIdMap[aConnSlice[iConn] - 1];
- }
- }else{
- for(int iConn = 0; iConn < aMNbNodes; iConn++){
- aConnect[iConn] = aConnSlice[iConn] - 1;
- }
- }
-
- switch(aMGeom){
+ vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom);
+ INITMSG(MYDEBUG,"aVNbNodes = "<<aVNbNodes<<"\n");
+
+ MED::PCellInfo aCellInfo = theMed->GetPCellInfo(aMeshInfo,aMEntity,aMGeom);
+ TInt aNbElem = aCellInfo->GetNbElem();
+
+ if(aNbElem > 0){
+ VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh());
+
+ aSubMesh->Init(MED::PElemInfo(aCellInfo), theMed->GetVersion());
+ aSubMesh->myNbCells = aNbElem;
+ aSubMesh->myCellsSize = aNbElem*(aVNbNodes+1);
+
+ VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
+ aCell2Connect.resize(aNbElem);
+
+ TInt aMNbNodes = MEDGeom2NbNodes(aMGeom);
+ VISU::TVector<TInt> aConnect(aMNbNodes);
+
+ for(TInt iElem = 0; iElem < aNbElem; iElem++) {
+ MED::TCConnSlice aConnSlice = aCellInfo->GetConnSlice(iElem);
+ VISU::TConnect& anArray = aCell2Connect[iElem];
+ anArray.resize(aVNbNodes);
+
+ if(anIsNodeNum){
+ for(TInt iConn = 0; iConn < aMNbNodes; iConn++){
+ aConnect[iConn] = aNodeIdMap[aConnSlice[iConn] - 1];
+ }
+ }else{
+ for(int iConn = 0; iConn < aMNbNodes; iConn++){
+ aConnect[iConn] = aConnSlice[iConn] - 1;
+ }
+ }
+
+ switch(aMGeom){
#if !(defined(VTK_QUADRATIC_EDGE) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
- case MED::eSEG3:
- anArray[0] = aConnect[0];
- anArray[2] = aConnect[1];
+ case MED::eSEG3:
+ anArray[0] = aConnect[0];
+ anArray[2] = aConnect[1];
- anArray[1] = aConnect[2];
- break;
+ anArray[1] = aConnect[2];
+ break;
#endif
#if !(defined(VTK_QUADRATIC_TRIANGLE) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
- case MED::eTRIA6:
- anArray[0] = aConnect[0];
- anArray[2] = aConnect[1];
- anArray[4] = aConnect[2];
-
- anArray[1] = aConnect[3];
- anArray[3] = aConnect[4];
- anArray[5] = aConnect[5];
- break;
+ case MED::eTRIA6:
+ anArray[0] = aConnect[0];
+ anArray[2] = aConnect[1];
+ anArray[4] = aConnect[2];
+
+ anArray[1] = aConnect[3];
+ anArray[3] = aConnect[4];
+ anArray[5] = aConnect[5];
+ break;
#endif
#if !(defined(VTK_QUADRATIC_QUAD) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
- case MED::eQUAD8:
- anArray[0] = aConnect[0];
- anArray[2] = aConnect[1];
- anArray[4] = aConnect[2];
- anArray[6] = aConnect[3];
-
- anArray[1] = aConnect[4];
- anArray[3] = aConnect[5];
- anArray[5] = aConnect[6];
- anArray[7] = aConnect[7];
- break;
+ case MED::eQUAD8:
+ anArray[0] = aConnect[0];
+ anArray[2] = aConnect[1];
+ anArray[4] = aConnect[2];
+ anArray[6] = aConnect[3];
+
+ anArray[1] = aConnect[4];
+ anArray[3] = aConnect[5];
+ anArray[5] = aConnect[6];
+ anArray[7] = aConnect[7];
+ break;
#endif
#if (defined(VTK_QUADRATIC_TETRA) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
- case MED::eTETRA10:
- anArray[0] = aConnect[0];
- anArray[1] = aConnect[2];
- anArray[2] = aConnect[1];
- anArray[3] = aConnect[3];
-
- anArray[4] = aConnect[6];
- anArray[5] = aConnect[5];
- anArray[6] = aConnect[4];
-
- anArray[7] = aConnect[7];
- anArray[8] = aConnect[9];
- anArray[9] = aConnect[8];
- break;
+ case MED::eTETRA10:
+ anArray[0] = aConnect[0];
+ anArray[1] = aConnect[2];
+ anArray[2] = aConnect[1];
+ anArray[3] = aConnect[3];
+
+ anArray[4] = aConnect[6];
+ anArray[5] = aConnect[5];
+ anArray[6] = aConnect[4];
+
+ anArray[7] = aConnect[7];
+ anArray[8] = aConnect[9];
+ anArray[9] = aConnect[8];
+ break;
#endif
- case MED::eTETRA4:
- anArray[0] = aConnect[0];
- anArray[1] = aConnect[2];
- anArray[2] = aConnect[1];
- anArray[3] = aConnect[3];
- break;
+ case MED::eTETRA4:
+ anArray[0] = aConnect[0];
+ anArray[1] = aConnect[2];
+ anArray[2] = aConnect[1];
+ anArray[3] = aConnect[3];
+ break;
#if (defined(VTK_QUADRATIC_PYRAMID) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
- case MED::ePYRA13:
- anArray[0] = aConnect[0];
- anArray[1] = aConnect[3];
- anArray[2] = aConnect[2];
- anArray[3] = aConnect[1];
- anArray[4] = aConnect[4];
-
- anArray[5] = aConnect[8];
- anArray[6] = aConnect[7];
- anArray[7] = aConnect[6];
- anArray[8] = aConnect[5];
-
- anArray[9] = aConnect[9];
- anArray[10] = aConnect[12];
- anArray[11] = aConnect[11];
- anArray[12] = aConnect[10];
- break;
+ case MED::ePYRA13:
+ anArray[0] = aConnect[0];
+ anArray[1] = aConnect[3];
+ anArray[2] = aConnect[2];
+ anArray[3] = aConnect[1];
+ anArray[4] = aConnect[4];
+
+ anArray[5] = aConnect[8];
+ anArray[6] = aConnect[7];
+ anArray[7] = aConnect[6];
+ anArray[8] = aConnect[5];
+
+ anArray[9] = aConnect[9];
+ anArray[10] = aConnect[12];
+ anArray[11] = aConnect[11];
+ anArray[12] = aConnect[10];
+ break;
#endif
- case MED::ePYRA5:
- anArray[0] = aConnect[0];
- anArray[1] = aConnect[3];
- anArray[2] = aConnect[2];
- anArray[3] = aConnect[1];
- anArray[4] = aConnect[4];
- break;
- default:
- for(int iNode = 0; iNode < aVNbNodes; iNode++)
- anArray[iNode] = aConnect[iNode];
- }
- for(int iNode = 0; iNode < aVNbNodes; iNode++)
- if(anArray[iNode] < 0 || aNbPoints <= anArray[iNode])
- EXCEPTION(std::runtime_error,"LoadCellsOnEntity - "<<
- " aNbPoints("<<aNbPoints<<") "<<
- "<= anArray["<<iElem<<"]"<<
- "["<<iNode<<"]"<<
- "("<<anArray[iNode]<<") < 0");
- }
- }
+ case MED::ePYRA5:
+ anArray[0] = aConnect[0];
+ anArray[1] = aConnect[3];
+ anArray[2] = aConnect[2];
+ anArray[3] = aConnect[1];
+ anArray[4] = aConnect[4];
+ break;
+ default:
+ for(int iNode = 0; iNode < aVNbNodes; iNode++)
+ anArray[iNode] = aConnect[iNode];
+ }
+ for(int iNode = 0; iNode < aVNbNodes; iNode++)
+ if(anArray[iNode] < 0 || aNbPoints <= anArray[iNode])
+ EXCEPTION(std::runtime_error,"LoadCellsOnEntity - "<<
+ " aNbPoints("<<aNbPoints<<") "<<
+ "<= anArray["<<iElem<<"]"<<
+ "["<<iNode<<"]"<<
+ "("<<anArray[iNode]<<") < 0");
+ }
+ }
}}
}
int
VISU_MedConvertor
::LoadCellsOnFamily(const MED::PWrapper& theMed,
- const VISU::PMEDMesh theMesh,
- const VISU::PMEDMeshOnEntity theMeshOnEntity,
- const VISU::PMEDFamily theFamily)
+ const VISU::PMEDMesh theMesh,
+ const VISU::PMEDMeshOnEntity theMeshOnEntity,
+ const VISU::PMEDFamily theFamily)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"LoadCellsOnFamily");
#ifndef _DEXCEPT_
for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){
const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first;
if(aType == MED::eNON_STRUCTURE){
- MED::PElemInfo anElemInfo;
- switch(aMGeom){
- case MED::ePOLYGONE: {
- anElemInfo = theMed->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom);
- break;
- }
- case MED::ePOLYEDRE: {
- anElemInfo = theMed->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom);
- break;
- }
- default: {
- anElemInfo = theMed->GetPCellInfo(aMeshInfo,aMEntity,aMGeom);
- break;
- }}
- if(anElemInfo){
- if(TInt aNbElem = anElemInfo->GetNbElem()){
- VISU::TSubMeshID aSubMeshID;
- for(TInt iElem = 0; iElem < aNbElem; iElem++)
- if(anElemInfo->GetFamNum(iElem) == anId)
- aSubMeshID.push_back(iElem);
- if(!aSubMeshID.empty()){
- VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
- INITMSG(MYDEBUG,"aMGeom = "<<aMGeom<<"\n");
- aGeom2SubMeshID.insert(VISU::TGeom2SubMeshID::value_type(aEGeom,aSubMeshID));
- }
- }
- }
+ MED::PElemInfo anElemInfo;
+ switch(aMGeom){
+ case MED::ePOLYGONE: {
+ anElemInfo = theMed->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom);
+ break;
+ }
+ case MED::ePOLYEDRE: {
+ anElemInfo = theMed->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom);
+ break;
+ }
+ default: {
+ anElemInfo = theMed->GetPCellInfo(aMeshInfo,aMEntity,aMGeom);
+ break;
+ }}
+ if(anElemInfo){
+ if(TInt aNbElem = anElemInfo->GetNbElem()){
+ VISU::TSubMeshID aSubMeshID;
+ for(TInt iElem = 0; iElem < aNbElem; iElem++)
+ if(anElemInfo->GetFamNum(iElem) == anId)
+ aSubMeshID.push_back(iElem);
+ if(!aSubMeshID.empty()){
+ VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
+ INITMSG(MYDEBUG,"aMGeom = "<<aMGeom<<"\n");
+ aGeom2SubMeshID.insert(VISU::TGeom2SubMeshID::value_type(aEGeom,aSubMeshID));
+ }
+ }
+ }
} else {
- MED::PGrilleInfo anElemInfo = theMed->GetPGrilleInfo(aMeshInfo);
- if(anElemInfo){
- TInt aNbElem = anElemInfo->GetNbCells();
- if(aNbElem>0 && (aMGeom == anElemInfo->GetGeom()) ){
- VISU::TSubMeshID aSubMeshID;
- for(TInt iElem = 0; iElem < aNbElem; iElem++)
- if(anElemInfo->GetFamNum(iElem) == anId)
- aSubMeshID.push_back(iElem);
- if(!aSubMeshID.empty()){
- VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
- INITMSG(MYDEBUG,"aMGeom = "<<aMGeom<<"\n");
- aGeom2SubMeshID.insert(VISU::TGeom2SubMeshID::value_type(aEGeom,aSubMeshID));
- }
- }
- }
+ MED::PGrilleInfo anElemInfo = theMed->GetPGrilleInfo(aMeshInfo);
+ if(anElemInfo){
+ TInt aNbElem = anElemInfo->GetNbCells();
+ if(aNbElem>0 && (aMGeom == anElemInfo->GetGeom()) ){
+ VISU::TSubMeshID aSubMeshID;
+ for(TInt iElem = 0; iElem < aNbElem; iElem++)
+ if(anElemInfo->GetFamNum(iElem) == anId)
+ aSubMeshID.push_back(iElem);
+ if(!aSubMeshID.empty()){
+ VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
+ INITMSG(MYDEBUG,"aMGeom = "<<aMGeom<<"\n");
+ aGeom2SubMeshID.insert(VISU::TGeom2SubMeshID::value_type(aEGeom,aSubMeshID));
+ }
+ }
+ }
}
}
//---------------------------------------------------------------
void
LoadProfile(const MED::PWrapper& theMed,
- VISU::PMEDMesh theMesh,
- MED::PTimeStampValueBase theTimeStampValue,
- VISU::TMEDValForTime& theValForTime,
- VISU::TMEDMeshOnEntity& theMeshOnEntity)
+ VISU::PMEDMesh theMesh,
+ MED::PTimeStampValueBase theTimeStampValue,
+ VISU::TMEDValForTime& theValForTime,
+ VISU::TMEDMeshOnEntity& theMeshOnEntity)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"LoadProfile");
INITMSG(MYDEBUG,"LoadProfile"<<endl);
MED::TElemNum& anElemNum = aProfileInfo->myElemNum;
if(!anElemNum.empty()){
- VISU::TSubMeshID& aSubMeshID = aSubProfile->mySubMeshID;
- TInt aSize = anElemNum.size();
- aSubMeshID.resize(aSize);
- for(TInt anId = 0; anId < aSize; anId++)
- aSubMeshID[anId] = anElemNum[anId] - 1;
+ VISU::TSubMeshID& aSubMeshID = aSubProfile->mySubMeshID;
+ TInt aSize = anElemNum.size();
+ aSubMeshID.resize(aSize);
+ for(TInt anId = 0; anId < aSize; anId++)
+ aSubMeshID[anId] = anElemNum[anId] - 1;
}
INITMSG(MYDEBUG,
- "- aEGeom = "<<aEGeom<<
- "; aNbCells = "<<aSubProfile->mySubMeshID.size()<<
- endl);
+ "- aEGeom = "<<aEGeom<<
+ "; aNbCells = "<<aSubProfile->mySubMeshID.size()<<
+ endl);
}
}
{
//---------------------------------------------------------------
void
LoadGaussMesh(const MED::PWrapper& theMed,
- VISU::PMEDMesh theMesh,
- MED::PTimeStampValueBase theTimeStampValue,
- VISU::TMEDValForTime& theValForTime,
- VISU::TMEDMeshOnEntity& theMeshOnEntity)
+ VISU::PMEDMesh theMesh,
+ MED::PTimeStampValueBase theTimeStampValue,
+ VISU::TMEDValForTime& theValForTime,
+ VISU::TMEDMeshOnEntity& theMeshOnEntity)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"LoadGaussMesh");
INITMSG(MYDEBUG,"LoadGaussMesh"<<endl);
switch(aMGeom){
case MED::ePOLYGONE:
aPolygoneInfo = theMed->GetPPolygoneInfo(aMeshInfo,
- aMEntity,
- aMGeom);
+ aMEntity,
+ aMGeom);
anElemInfo = aPolygoneInfo;
break;
case MED::ePOLYEDRE:
aPolyedreInfo = theMed->GetPPolyedreInfo(aMeshInfo,
- aMEntity,
- aMGeom);
+ aMEntity,
+ aMGeom);
anElemInfo = aPolyedreInfo;
break;
default:
aCellInfo = theMed->GetPCellInfo(aMeshInfo,
- aMEntity,
- aMGeom);
+ aMEntity,
+ aMGeom);
anElemInfo = aCellInfo;
}
aGaussSubMesh->myIsElemNum = anElemInfo->IsElemNum();
VISU::PMEDGauss aGauss = aGaussSubMesh->myGauss;
MED::PGaussInfo aGaussInfo = aGauss->myGaussInfo;
if(aGaussInfo){
- aName = aGaussInfo->GetName();
- if(!aSubMeshID.empty()){
- const std::string& aProfileName = aSubProfile->myName;
- MED::PProfileInfo aProfileInfo = MED::GetProfileInfo(theMed,
- aProfileName);
- if(aProfileInfo){
- const MED::TElemNum& anElemNum = aProfileInfo->myElemNum;
- anIsGaussCoord3D = MED::GetGaussCoord3D(aGaussInfo,
- aCellInfo,
- aNodeInfo,
- aGaussCoord,
- anElemNum);
- }
- }else
- anIsGaussCoord3D = MED::GetGaussCoord3D(aGaussInfo,
- aCellInfo,
- aNodeInfo,
- aGaussCoord);
+ aName = aGaussInfo->GetName();
+ if(!aSubMeshID.empty()){
+ const std::string& aProfileName = aSubProfile->myName;
+ MED::PProfileInfo aProfileInfo = MED::GetProfileInfo(theMed,
+ aProfileName);
+ if(aProfileInfo){
+ const MED::TElemNum& anElemNum = aProfileInfo->myElemNum;
+ anIsGaussCoord3D = MED::GetGaussCoord3D(aGaussInfo,
+ aCellInfo,
+ aNodeInfo,
+ aGaussCoord,
+ anElemNum);
+ }
+ }else
+ anIsGaussCoord3D = MED::GetGaussCoord3D(aGaussInfo,
+ aCellInfo,
+ aNodeInfo,
+ aGaussCoord);
}
}else{
if(!aSubMeshID.empty()){
- const std::string& aProfileName = aSubProfile->myName;
- MED::PProfileInfo aProfileInfo = MED::GetProfileInfo(theMed,
- aProfileName);
- if(aProfileInfo){
- const MED::TElemNum& anElemNum = aProfileInfo->myElemNum;
- switch(aMGeom){
- case MED::ePOLYGONE:
- anIsGaussCoord3D = MED::GetBaryCenter(aPolygoneInfo,
- aNodeInfo,
- aGaussCoord,
- anElemNum);
- break;
- case MED::ePOLYEDRE:
- anIsGaussCoord3D = MED::GetBaryCenter(aPolyedreInfo,
- aNodeInfo,
- aGaussCoord,
- anElemNum);
- break;
- default:
- anIsGaussCoord3D = MED::GetBaryCenter(aCellInfo,
- aNodeInfo,
- aGaussCoord,
- anElemNum);
- }
- }
+ const std::string& aProfileName = aSubProfile->myName;
+ MED::PProfileInfo aProfileInfo = MED::GetProfileInfo(theMed,
+ aProfileName);
+ if(aProfileInfo){
+ const MED::TElemNum& anElemNum = aProfileInfo->myElemNum;
+ switch(aMGeom){
+ case MED::ePOLYGONE:
+ anIsGaussCoord3D = MED::GetBaryCenter(aPolygoneInfo,
+ aNodeInfo,
+ aGaussCoord,
+ anElemNum);
+ break;
+ case MED::ePOLYEDRE:
+ anIsGaussCoord3D = MED::GetBaryCenter(aPolyedreInfo,
+ aNodeInfo,
+ aGaussCoord,
+ anElemNum);
+ break;
+ default:
+ anIsGaussCoord3D = MED::GetBaryCenter(aCellInfo,
+ aNodeInfo,
+ aGaussCoord,
+ anElemNum);
+ }
+ }
}else
- switch(aMGeom){
- case MED::ePOLYGONE:
- anIsGaussCoord3D = MED::GetBaryCenter(aPolygoneInfo,
- aNodeInfo,
- aGaussCoord);
- break;
- case MED::ePOLYEDRE:
- anIsGaussCoord3D = MED::GetBaryCenter(aPolyedreInfo,
- aNodeInfo,
- aGaussCoord);
- break;
- default:
- anIsGaussCoord3D = MED::GetBaryCenter(aCellInfo,
- aNodeInfo,
- aGaussCoord);
- }
+ switch(aMGeom){
+ case MED::ePOLYGONE:
+ anIsGaussCoord3D = MED::GetBaryCenter(aPolygoneInfo,
+ aNodeInfo,
+ aGaussCoord);
+ break;
+ case MED::ePOLYEDRE:
+ anIsGaussCoord3D = MED::GetBaryCenter(aPolyedreInfo,
+ aNodeInfo,
+ aGaussCoord);
+ break;
+ default:
+ anIsGaussCoord3D = MED::GetBaryCenter(aCellInfo,
+ aNodeInfo,
+ aGaussCoord);
+ }
}
if(anIsGaussCoord3D){
TInt aNbCells = aNbElem*aNbGauss;
INITMSG(MYDEBUG,
- "- aEGeom = "<<aEGeom<<
- "; aName = '"<<aName<<"'"<<
- "; aStatus = "<<aGaussSubMesh->myStatus<<
- "; aNbElem = "<<aNbElem<<
- "; aNbGauss = "<<aNbGauss<<
- "; aNbCells = "<<aNbCells<<
- endl);
+ "- aEGeom = "<<aEGeom<<
+ "; aName = '"<<aName<<"'"<<
+ "; aStatus = "<<aGaussSubMesh->myStatus<<
+ "; aNbElem = "<<aNbElem<<
+ "; aNbGauss = "<<aNbGauss<<
+ "; aNbCells = "<<aNbCells<<
+ endl);
}else
EXCEPTION(std::runtime_error,"LoadGaussMesh - Gauss Points localization error!!!");
}
template<class TimeStampValueType>
void
FillValForTime(MED::SharedPtr<TimeStampValueType> theTimeStampValue,
- const VISU::TGeom2SubProfile& theGeom2SubProfile,
- VISU::PMEDValForTime theValForTime,
- VISU::PMEDField theField)
+ const VISU::TGeom2SubProfile& theGeom2SubProfile,
+ VISU::PMEDValForTime theValForTime,
+ VISU::PMEDField theField)
{
theField->myDataSize = 0;
TInt aNbComp = theField->myNbComp;
TInt aNbGauss = theValForTime->GetNbGauss(aEGeom);
INITMSG(MYDEBUG,
- "- aEGeom = "<<aEGeom<<
- "; aNbElem = "<<aNbElem<<
- "; aNbGauss = "<<aNbGauss<<
- endl);
+ "- aEGeom = "<<aEGeom<<
+ "; aNbElem = "<<aNbElem<<
+ "; aNbGauss = "<<aNbGauss<<
+ endl);
VISU::PMeshValue& aVMeshValue = theValForTime->GetMeshValue(aEGeom);
typedef typename TimeStampValueType::TElement TElement;
//---------------------------------------------------------------
int
LoadValForTime(const MED::PWrapper& theMed,
- VISU::PMEDMesh theMesh,
- VISU::PMEDMeshOnEntity theMeshOnEntity,
- VISU::PMEDField theField,
- VISU::PMEDValForTime theValForTime,
- bool theIsGauss,
- bool& theIsDone)
+ VISU::PMEDMesh theMesh,
+ VISU::PMEDMeshOnEntity theMeshOnEntity,
+ VISU::PMEDField theField,
+ VISU::PMEDValForTime theValForTime,
+ bool theIsGauss,
+ bool& theIsDone)
{
VISU::TTimerLog aTimerLog(MYDEBUG,"LoadValForTime");
INITMSG(MYDEBUG,"LoadValForTime - theIsGauss = "<<theIsGauss<<endl);
const std::string& aMeshName = theMeshOnEntity->myMeshName;
const MED::PMeshInfo& aMeshInfo = theMesh->myMeshInfo;
MED::PFieldInfo aFieldInfo = theMed->GetPFieldInfo(aMeshInfo,
- theField->myId);
+ theField->myId);
MED::TGeom2Size aGeom2Size;
MED::EEntiteMaillage aMEntity;
theMed->GetNbTimeStamps(aFieldInfo,
- theMesh->myEntityInfo,
- aMEntity,
- aGeom2Size);
+ theMesh->myEntityInfo,
+ aMEntity,
+ aGeom2Size);
MED::PTimeStampInfo aTimeStampInfo =
theMed->GetPTimeStampInfo(aFieldInfo,
- aMEntity,
- aGeom2Size,
- theValForTime->myId);
+ aMEntity,
+ aGeom2Size,
+ theValForTime->myId);
MED::TKey2Gauss aKey2Gauss = GetKey2Gauss(theMed);
MED::TMKey2Profile aMKey2Profile = GetMKey2Profile(theMed);
MED::PTimeStampValueBase aTimeStampValue =
theMed->GetPTimeStampValue(aTimeStampInfo,
- aMKey2Profile,
- aKey2Gauss);
+ aMKey2Profile,
+ aKey2Gauss);
InitProfile(theMed,
- aMeshInfo,
- aTimeStampValue,
- theMeshOnEntity,
- aMEntity,
- aGeom2Size,
- theValForTime);
+ aMeshInfo,
+ aTimeStampValue,
+ theMeshOnEntity,
+ aMEntity,
+ aGeom2Size,
+ theValForTime);
LoadProfile(theMed,
- theMesh,
- aTimeStampValue,
- theValForTime,
- theMeshOnEntity);
+ theMesh,
+ aTimeStampValue,
+ theValForTime,
+ theMeshOnEntity);
if(theIsGauss) {
InitGaussMesh(aTimeStampValue,
- theMeshOnEntity,
- aGeom2Size,
- theValForTime);
+ theMeshOnEntity,
+ aGeom2Size,
+ theValForTime);
LoadGaussMesh(theMed,
- theMesh,
- aTimeStampValue,
- theValForTime,
- theMeshOnEntity);
+ theMesh,
+ aTimeStampValue,
+ theValForTime,
+ theMeshOnEntity);
}
VISU::PMEDProfile aProfile = theValForTime->myProfile;
VISU::TGeom2SubProfile& aGeom2SubProfile = aProfile->myGeom2SubProfile;
INITMSGA(MYDEBUG,0,
- "- aMeshName = '"<<aMeshName<<"'"<<
- "; aFieldName = '"<<aFieldInfo->GetName()<<"'"<<
- "; aMEntity = "<<aMEntity<<
- "; aNbComp = "<<theField->myNbComp<<
- endl);
+ "- aMeshName = '"<<aMeshName<<"'"<<
+ "; aFieldName = '"<<aFieldInfo->GetName()<<"'"<<
+ "; aMEntity = "<<aMEntity<<
+ "; aNbComp = "<<theField->myNbComp<<
+ endl);
if(aFieldInfo->GetType() == MED::eFLOAT64)
FillValForTime<MED::TFloatTimeStampValue>(CastToFloatTimeStampValue(aTimeStampValue),
- aGeom2SubProfile,
- theValForTime,
- theField);
+ aGeom2SubProfile,
+ theValForTime,
+ theField);
else
FillValForTime<MED::TIntTimeStampValue>(CastToIntTimeStampValue(aTimeStampValue),
- aGeom2SubProfile,
- theValForTime,
- theField);
+ aGeom2SubProfile,
+ theValForTime,
+ theField);
theIsDone = true;
return 1;
int
VISU_MedConvertor
::LoadValForTimeOnMesh(const MED::PWrapper& theMed,
- VISU::PMEDMesh theMesh,
- VISU::PMEDMeshOnEntity theMeshOnEntity,
- VISU::PMEDField theField,
- VISU::PMEDValForTime theValForTime)
+ VISU::PMEDMesh theMesh,
+ VISU::PMEDMeshOnEntity theMeshOnEntity,
+ VISU::PMEDField theField,
+ VISU::PMEDValForTime theValForTime)
{
VISU::PUnstructuredGridIDMapperImpl anUnstructuredGridIDMapper = theValForTime->myUnstructuredGridIDMapper;
return LoadValForTime(theMed,
- theMesh,
- theMeshOnEntity,
- theField,
- theValForTime,
- false,
- anUnstructuredGridIDMapper->myIsVTKDone);
+ theMesh,
+ theMeshOnEntity,
+ theField,
+ theValForTime,
+ false,
+ anUnstructuredGridIDMapper->myIsVTKDone);
}
int
VISU_MedConvertor
::LoadValForTimeOnGaussPts(const MED::PWrapper& theMed,
- VISU::PMEDMesh theMesh,
- VISU::PMEDMeshOnEntity theMeshOnEntity,
- VISU::PMEDField theField,
- VISU::PMEDValForTime theValForTime)
+ VISU::PMEDMesh theMesh,
+ VISU::PMEDMeshOnEntity theMeshOnEntity,
+ VISU::PMEDField theField,
+ VISU::PMEDValForTime theValForTime)
{
VISU::PGaussPtsIDFilter aGaussPtsIDFilter = theValForTime->myGaussPtsIDFilter;
return LoadValForTime(theMed,
- theMesh,
- theMeshOnEntity,
- theField,
- theValForTime,
- true,
- aGaussPtsIDFilter->myIsVTKDone);
+ theMesh,
+ theMeshOnEntity,
+ theField,
+ theValForTime,
+ true,
+ aGaussPtsIDFilter->myIsVTKDone);
}
//---------------------------------------------------------------
template<class TValueType>
struct VISU_CONVERTOR_EXPORT TTMEDMeshValue: TTMeshValueHolder<TValueType,
- MED::SharedPtr<MED::TTMeshValue<MED::TVector<TValueType> > > >
+ MED::SharedPtr<MED::TTMeshValue<MED::TVector<TValueType> > > >
{
virtual
const TValueType*
void
Init(const MED::PNodeInfo& theNodeInfo,
- MED::EVersion theVersion);
+ MED::EVersion theVersion);
void
Init(const MED::PGrilleInfo& theGrilleInfo);
virtual
void
LessThan(const PGaussImpl& theGauss,
- bool& theResult) const;
+ bool& theResult) const;
};
typedef MED::SharedPtr<TMEDGauss> PMEDGauss;
void
Init(const MED::PElemInfo& theElemInfo,
- MED::EVersion theVersion);
+ MED::EVersion theVersion);
void
Init(const MED::PGrilleInfo& theGrilleInfo);
virtual
int
LoadMeshOnEntity(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity);
+ VISU::PMeshOnEntityImpl theMeshOnEntity);
virtual
int
LoadFamilyOnEntity(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity,
- VISU::PFamilyImpl theFamily);
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFamilyImpl theFamily);
virtual
int
LoadMeshOnGroup(VISU::PMeshImpl theMesh,
- const VISU::TFamilySet& theFamilySet);
+ const VISU::TFamilySet& theFamilySet);
virtual
int
LoadValForTimeOnMesh(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity,
- VISU::PFieldImpl theField,
- VISU::PValForTimeImpl theValForTime);
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFieldImpl theField,
+ VISU::PValForTimeImpl theValForTime);
virtual
int
LoadValForTimeOnGaussPts(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity,
- VISU::PFieldImpl theField,
- VISU::PValForTimeImpl theValForTime);
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFieldImpl theField,
+ VISU::PValForTimeImpl theValForTime);
int
LoadPoints(const MED::PWrapper& theMed,
- const VISU::PMEDMesh theMesh);
+ const VISU::PMEDMesh theMesh);
int
LoadPointsOnFamily(const MED::PWrapper& theMed,
- const VISU::PMEDMesh theMesh,
- const VISU::PMEDFamily theFamily);
+ const VISU::PMEDMesh theMesh,
+ const VISU::PMEDFamily theFamily);
int
LoadCellsOnEntity(const MED::PWrapper& theMed,
- const VISU::PMEDMesh theMesh,
- const VISU::PMEDMeshOnEntity theMeshOnEntity);
+ const VISU::PMEDMesh theMesh,
+ const VISU::PMEDMeshOnEntity theMeshOnEntity);
int
LoadCellsOnFamily(const MED::PWrapper& theMed,
- const VISU::PMEDMesh theMesh,
- const VISU::PMEDMeshOnEntity theMeshOnEntity,
- const VISU::PMEDFamily theFamily);
+ const VISU::PMEDMesh theMesh,
+ const VISU::PMEDMeshOnEntity theMeshOnEntity,
+ const VISU::PMEDFamily theFamily);
int
LoadValForTimeOnMesh(const MED::PWrapper& theMed,
- VISU::PMEDMesh theMesh,
- VISU::PMEDMeshOnEntity theMeshOnEntity,
- VISU::PMEDField theField,
- VISU::PMEDValForTime theValForTime);
+ VISU::PMEDMesh theMesh,
+ VISU::PMEDMeshOnEntity theMeshOnEntity,
+ VISU::PMEDField theField,
+ VISU::PMEDValForTime theValForTime);
int
LoadValForTimeOnGaussPts(const MED::PWrapper& theMed,
- VISU::PMEDMesh theMesh,
- VISU::PMEDMeshOnEntity theMeshOnEntity,
- VISU::PMEDField theField,
- VISU::PMEDValForTime theValForTime);
+ VISU::PMEDMesh theMesh,
+ VISU::PMEDMeshOnEntity theMeshOnEntity,
+ VISU::PMEDField theField,
+ VISU::PMEDValForTime theValForTime);
};
#endif
int
VISU_MergeFilter
::RequestData(vtkInformation *theRequest,
- vtkInformationVector **theInputVector,
- vtkInformationVector *theOutputVector)
+ vtkInformationVector **theInputVector,
+ vtkInformationVector *theOutputVector)
{
if(vtkUnstructuredGrid *anInput = dynamic_cast<vtkUnstructuredGrid*>(this->GetInput())){
vtkUnstructuredGrid *anOutput = dynamic_cast<vtkUnstructuredGrid*>(this->GetOutput());
return VISU::Execute(anInput,
- anOutput,
- this->GetScalars(),
- this->GetVectors(),
- this->GetNormals(),
- this->GetTCoords(),
- this->GetTensors(),
- this->FieldList,
- IsMergingInputs());
+ anOutput,
+ this->GetScalars(),
+ this->GetVectors(),
+ this->GetNormals(),
+ this->GetTCoords(),
+ this->GetTensors(),
+ this->FieldList,
+ IsMergingInputs());
}else if(vtkPolyData *anInput = dynamic_cast<vtkPolyData*>(this->GetInput())){
vtkPolyData *anOutput = dynamic_cast<vtkPolyData*>(this->GetOutput());
return VISU::Execute(anInput,
- anOutput,
- this->GetScalars(),
- this->GetVectors(),
- this->GetNormals(),
- this->GetTCoords(),
- this->GetTensors(),
- this->FieldList,
- IsMergingInputs());
+ anOutput,
+ this->GetScalars(),
+ this->GetVectors(),
+ this->GetNormals(),
+ this->GetTCoords(),
+ this->GetTensors(),
+ this->FieldList,
+ IsMergingInputs());
}
return Superclass::RequestData(theRequest,
- theInputVector,
- theOutputVector);
+ theInputVector,
+ theOutputVector);
}
//----------------------------------------------------------------------------
int
VISU_MergeFilter
::RequestUpdateExtent(vtkInformation *vtkNotUsed(request),
- vtkInformationVector **inputVector,
- vtkInformationVector *vtkNotUsed(outputVector))
+ vtkInformationVector **inputVector,
+ vtkInformationVector *vtkNotUsed(outputVector))
{
vtkInformation *inputInfo;
int idx;
void
CopyDataOnCells(TDataSet *theInput,
- vtkIntArray *theGeometryCellMapper,
- vtkIntArray *theDataCellMapper,
- vtkDataSet* theScalarsDataSet,
- vtkDataSet* theVectorsDataSet,
- vtkDataSet* theNormalsDataSet,
- vtkDataSet* theTCoordsDataSet,
- vtkDataSet* theTensorsDataSet,
- VISU::TFieldList* theFieldList,
- TDataSet *theOutput)
+ vtkIntArray *theGeometryCellMapper,
+ vtkIntArray *theDataCellMapper,
+ vtkDataSet* theScalarsDataSet,
+ vtkDataSet* theVectorsDataSet,
+ vtkDataSet* theNormalsDataSet,
+ vtkDataSet* theTCoordsDataSet,
+ vtkDataSet* theTensorsDataSet,
+ VISU::TFieldList* theFieldList,
+ TDataSet *theOutput)
{
if(IsDifferent(theGeometryCellMapper, theDataCellMapper)){
TObjectIdArray anIntersection;
GetIntersection(theGeometryCellMapper,
- theDataCellMapper,
- anIntersection);
+ theDataCellMapper,
+ anIntersection);
TObjectId2TupleIdMap aGeomObjectId2TupleIdMap;
GetObjectId2TupleIdMap(theGeometryCellMapper, aGeomObjectId2TupleIdMap);
theOutput->Allocate(aNbTuples);
vtkIdList *aCellIds = vtkIdList::New();
for(int aTupleId = 0; aTupleId < aNbTuples; aTupleId++){
- TObjectId& anObjectId = anIntersection[aTupleId];
- vtkIdType aCellId = aGeomObjectId2TupleIdMap[anObjectId];
- vtkCell *aCell = theInput->GetCell(aCellId);
- aCellIds->Reset();
- vtkIdType aNbPointIds = aCell->PointIds->GetNumberOfIds();
- for(vtkIdType anId = 0; anId < aNbPointIds; anId++)
- aCellIds->InsertNextId(aCell->GetPointIds()->GetId(anId));
- vtkIdType aCellType = theInput->GetCellType(aCellId);
- vtkIdType aNewCellId = theOutput->InsertNextCell(aCellType, aCellIds);
- vtkIdType aDataCellId = aDataObjectId2TupleIdMap[anObjectId];
- anOutputCellData->CopyData(aCellData, aDataCellId, aNewCellId);
+ TObjectId& anObjectId = anIntersection[aTupleId];
+ vtkIdType aCellId = aGeomObjectId2TupleIdMap[anObjectId];
+ vtkCell *aCell = theInput->GetCell(aCellId);
+ aCellIds->Reset();
+ vtkIdType aNbPointIds = aCell->PointIds->GetNumberOfIds();
+ for(vtkIdType anId = 0; anId < aNbPointIds; anId++)
+ aCellIds->InsertNextId(aCell->GetPointIds()->GetId(anId));
+ vtkIdType aCellType = theInput->GetCellType(aCellId);
+ vtkIdType aNewCellId = theOutput->InsertNextCell(aCellType, aCellIds);
+ vtkIdType aDataCellId = aDataObjectId2TupleIdMap[anObjectId];
+ anOutputCellData->CopyData(aCellData, aDataCellId, aNewCellId);
}
aCellIds->Delete();
template<class TDataSet>
void
CopyDataOnPoints(TDataSet *theInput,
- vtkIntArray *theGeometryPointMapper,
- vtkIntArray *theDataPointMapper,
- vtkDataSet* theScalarsDataSet,
- vtkDataSet* theVectorsDataSet,
- vtkDataSet* theNormalsDataSet,
- vtkDataSet* theTCoordsDataSet,
- vtkDataSet* theTensorsDataSet,
- VISU::TFieldList* theFieldList,
- TDataSet *theOutput)
+ vtkIntArray *theGeometryPointMapper,
+ vtkIntArray *theDataPointMapper,
+ vtkDataSet* theScalarsDataSet,
+ vtkDataSet* theVectorsDataSet,
+ vtkDataSet* theNormalsDataSet,
+ vtkDataSet* theTCoordsDataSet,
+ vtkDataSet* theTensorsDataSet,
+ VISU::TFieldList* theFieldList,
+ TDataSet *theOutput)
{
if(IsDifferent(theGeometryPointMapper, theDataPointMapper)){
TObjectId2TupleIdMap aDataObjectId2PointIdMap;
int aNbCells = theInput->GetNumberOfCells();
theOutput->Allocate(aNbCells);
for(int aCellId = 0; aCellId < aNbCells; aCellId++){
- aCellIds->Reset();
- vtkCell *aCell = theInput->GetCell(aCellId);
- vtkIdType aNbPointIds = aCell->PointIds->GetNumberOfIds();
- for(vtkIdType anId = 0; anId < aNbPointIds; anId++){
- vtkIdType aPointId = aCell->GetPointIds()->GetId(anId);
- int* aPointer = theGeometryPointMapper->GetPointer(aPointId * 2);
- TCellId aCellId = *aPointer;
- TEntityId anEntityId = *(aPointer + 1);
- TObjectId anObjectId(aCellId, anEntityId);
- TObjectId2TupleIdMap::iterator anIter = aDataObjectId2PointIdMap.find(anObjectId);
- if(anIter != aDataObjectId2PointIdMap.end()){
- aPointId = anIter->second;
- aCellIds->InsertNextId(aPointId);
- }else
- goto PASS_INSERT_NEXT_CELL;
- }
- {
- vtkIdType aCellType = theInput->GetCellType(aCellId);
- vtkIdType aNewCellId = theOutput->InsertNextCell(aCellType, aCellIds);
- anOutputCellData->CopyData(aCellData, aCellId, aNewCellId);
- }
+ aCellIds->Reset();
+ vtkCell *aCell = theInput->GetCell(aCellId);
+ vtkIdType aNbPointIds = aCell->PointIds->GetNumberOfIds();
+ for(vtkIdType anId = 0; anId < aNbPointIds; anId++){
+ vtkIdType aPointId = aCell->GetPointIds()->GetId(anId);
+ int* aPointer = theGeometryPointMapper->GetPointer(aPointId * 2);
+ TCellId aCellId = *aPointer;
+ TEntityId anEntityId = *(aPointer + 1);
+ TObjectId anObjectId(aCellId, anEntityId);
+ TObjectId2TupleIdMap::iterator anIter = aDataObjectId2PointIdMap.find(anObjectId);
+ if(anIter != aDataObjectId2PointIdMap.end()){
+ aPointId = anIter->second;
+ aCellIds->InsertNextId(aPointId);
+ }else
+ goto PASS_INSERT_NEXT_CELL;
+ }
+ {
+ vtkIdType aCellType = theInput->GetCellType(aCellId);
+ vtkIdType aNewCellId = theOutput->InsertNextCell(aCellType, aCellIds);
+ anOutputCellData->CopyData(aCellData, aCellId, aNewCellId);
+ }
PASS_INSERT_NEXT_CELL:
- continue;
+ continue;
}
aCellIds->Delete();
int aNbDataPoints = theDataPointMapper->GetNumberOfTuples();
anOutputPoints->SetNumberOfPoints(aNbDataPoints);
for(int aPointId = 0; aPointId < aNbDataPoints; aPointId++){
- int* aPointer = theDataPointMapper->GetPointer(aPointId * 2);
- TCellId aCellId = *aPointer;
- TEntityId anEntityId = *(aPointer + 1);
- TObjectId anObjectId(aCellId, anEntityId);
- TObjectId2TupleIdMap::iterator anIter = aGeomObjectId2TupleIdMap.find(anObjectId);
- if(anIter != aGeomObjectId2TupleIdMap.end()){
- // If the point exists in the geometry put it to output
- int aGeometryPointId = anIter->second;
- vtkFloatingPointType aCoords[3];
- anGeometryPoints->GetPoint(aGeometryPointId, aCoords);
- anOutputPoints->SetPoint(aPointId, aCoords);
- }else{
- // If no, the point from data should be used
- vtkFloatingPointType aCoords[3];
- aDataPoints->GetPoint(aPointId, aCoords);
- anOutputPoints->SetPoint(aPointId, aCoords);
- }
+ int* aPointer = theDataPointMapper->GetPointer(aPointId * 2);
+ TCellId aCellId = *aPointer;
+ TEntityId anEntityId = *(aPointer + 1);
+ TObjectId anObjectId(aCellId, anEntityId);
+ TObjectId2TupleIdMap::iterator anIter = aGeomObjectId2TupleIdMap.find(anObjectId);
+ if(anIter != aGeomObjectId2TupleIdMap.end()){
+ // If the point exists in the geometry put it to output
+ int aGeometryPointId = anIter->second;
+ vtkFloatingPointType aCoords[3];
+ anGeometryPoints->GetPoint(aGeometryPointId, aCoords);
+ anOutputPoints->SetPoint(aPointId, aCoords);
+ }else{
+ // If no, the point from data should be used
+ vtkFloatingPointType aCoords[3];
+ aDataPoints->GetPoint(aPointId, aCoords);
+ anOutputPoints->SetPoint(aPointId, aCoords);
+ }
}
}else{
theOutput->CopyStructure(theInput);
inline
void
CopyArray(vtkDataArray* theDataArray,
- vtkDataSetAttributes* theOutput,
- TSetDataAttribute theSetAttribute,
- vtkIdType theFixedNbTuples)
+ vtkDataSetAttributes* theOutput,
+ TSetDataAttribute theSetAttribute,
+ vtkIdType theFixedNbTuples)
{
if(theDataArray){
vtkIdType aNbTuples = theDataArray->GetNumberOfTuples();
if(theFixedNbTuples == aNbTuples)
- (theOutput->*theSetAttribute)(theDataArray);
+ (theOutput->*theSetAttribute)(theDataArray);
}
}
#endif
inline
void
CopyArray(vtkDataArray* theDataArray,
- vtkDataSetAttributes* theOutput,
- TSetAttribute theSetAttribute,
- vtkIdType theFixedNbTuples)
+ vtkDataSetAttributes* theOutput,
+ TSetAttribute theSetAttribute,
+ vtkIdType theFixedNbTuples)
{
if(theDataArray){
vtkIdType aNbTuples = theDataArray->GetNumberOfTuples();
if(theFixedNbTuples == aNbTuples)
- (theOutput->*theSetAttribute)(theDataArray);
+ (theOutput->*theSetAttribute)(theDataArray);
}
}
inline
void
CopyAttribute(vtkDataSetAttributes* theInput,
- TGetAttribute theGetAttribute,
- vtkDataSetAttributes* theOutput,
+ TGetAttribute theGetAttribute,
+ vtkDataSetAttributes* theOutput,
#if (VTK_XVERSION < 0x050100)
- TSetAttribute theSetAttribute,
+ TSetAttribute theSetAttribute,
#else
- TSetDataAttribute theSetAttribute,
+ TSetDataAttribute theSetAttribute,
#endif
- vtkIdType theFixedNbTuples)
+ vtkIdType theFixedNbTuples)
{
CopyArray((theInput->*theGetAttribute)(),
- theOutput, theSetAttribute,
- theFixedNbTuples);
+ theOutput, theSetAttribute,
+ theFixedNbTuples);
}
inline
void
CopyDataSetAttribute(vtkDataSet *theInput,
- TGetAttribute theGetAttribute,
- vtkDataSet *theOutput,
+ TGetAttribute theGetAttribute,
+ vtkDataSet *theOutput,
#if (VTK_XVERSION < 0x050100)
- TSetAttribute theSetAttribute,
+ TSetAttribute theSetAttribute,
#else
- TSetDataAttribute theSetAttribute,
+ TSetDataAttribute theSetAttribute,
#endif
- vtkIdType theNbPoints,
- vtkIdType theNbCells)
+ vtkIdType theNbPoints,
+ vtkIdType theNbCells)
{
CopyAttribute(theInput->GetPointData(),
- theGetAttribute,
- theOutput->GetPointData(),
- theSetAttribute,
- theNbPoints);
+ theGetAttribute,
+ theOutput->GetPointData(),
+ theSetAttribute,
+ theNbPoints);
CopyAttribute(theInput->GetCellData(),
- theGetAttribute,
- theOutput->GetCellData(),
- theSetAttribute,
- theNbCells);
+ theGetAttribute,
+ theOutput->GetCellData(),
+ theSetAttribute,
+ theNbCells);
}
inline
void
CopyField(vtkDataSetAttributes* theInput,
- const char* theFieldName,
- vtkDataSetAttributes* theOutput,
- vtkIdType theFixedNbTuples)
+ const char* theFieldName,
+ vtkDataSetAttributes* theOutput,
+ vtkIdType theFixedNbTuples)
{
CopyArray(theInput->GetArray(theFieldName),
- theOutput,
+ theOutput,
#if (VTK_XVERSION < 0x050100)
&vtkDataSetAttributes::AddArray,
#else
- &vtkFieldData::AddArray,
+ &vtkFieldData::AddArray,
#endif
- theFixedNbTuples);
+ theFixedNbTuples);
}
inline
void
CopyDataSetField(vtkDataSet* theInput,
- const char* theFieldName,
- vtkDataSet* theOutput,
- vtkIdType theNbPoints,
- vtkIdType theNbCells)
+ const char* theFieldName,
+ vtkDataSet* theOutput,
+ vtkIdType theNbPoints,
+ vtkIdType theNbCells)
{
if(theInput){
CopyField(theInput->GetPointData(),
- theFieldName,
- theOutput->GetPointData(),
- theNbPoints);
+ theFieldName,
+ theOutput->GetPointData(),
+ theNbPoints);
CopyField(theInput->GetCellData(),
- theFieldName,
- theOutput->GetCellData(),
- theNbCells);
+ theFieldName,
+ theOutput->GetCellData(),
+ theNbCells);
}
}
//---------------------------------------------------------------
void
BasicExecute(vtkDataSet *theInput,
- vtkDataSet* theScalarsDataSet,
- vtkDataSet* theVectorsDataSet,
- vtkDataSet* theNormalsDataSet,
- vtkDataSet* theTCoordsDataSet,
- vtkDataSet* theTensorsDataSet,
- VISU::TFieldList* theFieldList,
- vtkDataSet *theOutput)
+ vtkDataSet* theScalarsDataSet,
+ vtkDataSet* theVectorsDataSet,
+ vtkDataSet* theNormalsDataSet,
+ vtkDataSet* theTCoordsDataSet,
+ vtkDataSet* theTensorsDataSet,
+ VISU::TFieldList* theFieldList,
+ vtkDataSet *theOutput)
{
theOutput->CopyStructure(theInput);
// merge data only if it is consistent
if(theScalarsDataSet)
CopyDataSetAttribute(theScalarsDataSet,
- &vtkDataSetAttributes::GetScalars,
- theOutput,
- &vtkDataSetAttributes::SetScalars,
- aNbPoints,
- aNbCells);
+ &vtkDataSetAttributes::GetScalars,
+ theOutput,
+ &vtkDataSetAttributes::SetScalars,
+ aNbPoints,
+ aNbCells);
if(theVectorsDataSet)
CopyDataSetAttribute(theVectorsDataSet,
- &vtkDataSetAttributes::GetVectors,
- theOutput,
- &vtkDataSetAttributes::SetVectors,
- aNbPoints,
- aNbCells);
+ &vtkDataSetAttributes::GetVectors,
+ theOutput,
+ &vtkDataSetAttributes::SetVectors,
+ aNbPoints,
+ aNbCells);
if(theNormalsDataSet)
CopyDataSetAttribute(theNormalsDataSet,
- &vtkDataSetAttributes::GetNormals,
- theOutput,
- &vtkDataSetAttributes::SetNormals,
- aNbPoints,
- aNbCells);
+ &vtkDataSetAttributes::GetNormals,
+ theOutput,
+ &vtkDataSetAttributes::SetNormals,
+ aNbPoints,
+ aNbCells);
if(theTCoordsDataSet)
CopyDataSetAttribute(theTCoordsDataSet,
- &vtkDataSetAttributes::GetTCoords,
- theOutput,
- &vtkDataSetAttributes::SetTCoords,
- aNbPoints,
- aNbCells);
+ &vtkDataSetAttributes::GetTCoords,
+ theOutput,
+ &vtkDataSetAttributes::SetTCoords,
+ aNbPoints,
+ aNbCells);
if(theTensorsDataSet)
CopyDataSetAttribute(theTensorsDataSet,
- &vtkDataSetAttributes::GetTensors,
- theOutput,
- &vtkDataSetAttributes::SetTensors,
- aNbPoints,
- aNbCells);
+ &vtkDataSetAttributes::GetTensors,
+ theOutput,
+ &vtkDataSetAttributes::SetTensors,
+ aNbPoints,
+ aNbCells);
VISU::TFieldListIterator anIter(theFieldList);
for(anIter.Begin(); !anIter.End() ; anIter.Next()){
vtkDataSet *aDataSet = anIter.Get()->Ptr;
const char* aFieldName = anIter.Get()->GetName();
CopyDataSetField(aDataSet,
- aFieldName,
- theOutput,
- aNbPoints,
- aNbCells);
+ aFieldName,
+ theOutput,
+ aNbPoints,
+ aNbCells);
}
}
template<class TDataSet>
bool
Execute(TDataSet *theInput,
- vtkDataSet* theScalarsDataSet,
- vtkDataSet* theVectorsDataSet,
- vtkDataSet* theNormalsDataSet,
- vtkDataSet* theTCoordsDataSet,
- vtkDataSet* theTensorsDataSet,
- VISU::TFieldList* theFieldList,
- bool theIsMergingInputs,
- TDataSet *theOutput)
+ vtkDataSet* theScalarsDataSet,
+ vtkDataSet* theVectorsDataSet,
+ vtkDataSet* theNormalsDataSet,
+ vtkDataSet* theTCoordsDataSet,
+ vtkDataSet* theTensorsDataSet,
+ VISU::TFieldList* theFieldList,
+ bool theIsMergingInputs,
+ TDataSet *theOutput)
{
if(theIsMergingInputs){
vtkCellData *aCellData = theInput->GetCellData();
if(vtkDataArray *aCellMapper = aCellData->GetArray("VISU_CELLS_MAPPER")){
- bool anIsDataOnCells = false;
- if(vtkDataSet* aDataSet = theScalarsDataSet)
- if(vtkCellData* aCellData = aDataSet->GetCellData())
- anIsDataOnCells = (aCellData->GetArray("VISU_FIELD") != NULL);
- if(anIsDataOnCells){
- vtkIntArray *aGeometryCellMapper = dynamic_cast<vtkIntArray*>(aCellMapper);
- vtkIntArray* aDataCellMapper = GetIDMapper(theFieldList,
- TGetCellData(),
- "VISU_CELLS_MAPPER");
- CopyDataOnCells(theInput,
- aGeometryCellMapper,
- aDataCellMapper,
- theScalarsDataSet,
- theVectorsDataSet,
- theNormalsDataSet,
- theTCoordsDataSet,
- theTensorsDataSet,
- theFieldList,
- theOutput);
- }else{
- vtkPointData *aPointData = theInput->GetPointData();
- vtkDataArray *aPointMapper = aPointData->GetArray("VISU_POINTS_MAPPER");
- vtkIntArray *aGeometryPointMapper = dynamic_cast<vtkIntArray*>(aPointMapper);
- vtkIntArray* aDataPointMapper = GetIDMapper(theFieldList,
- TGetPointData(),
- "VISU_POINTS_MAPPER");
- CopyDataOnPoints(theInput,
- aGeometryPointMapper,
- aDataPointMapper,
- theScalarsDataSet,
- theVectorsDataSet,
- theNormalsDataSet,
- theTCoordsDataSet,
- theTensorsDataSet,
- theFieldList,
- theOutput);
- }
+ bool anIsDataOnCells = false;
+ if(vtkDataSet* aDataSet = theScalarsDataSet)
+ if(vtkCellData* aCellData = aDataSet->GetCellData())
+ anIsDataOnCells = (aCellData->GetArray("VISU_FIELD") != NULL);
+ if(anIsDataOnCells){
+ vtkIntArray *aGeometryCellMapper = dynamic_cast<vtkIntArray*>(aCellMapper);
+ vtkIntArray* aDataCellMapper = GetIDMapper(theFieldList,
+ TGetCellData(),
+ "VISU_CELLS_MAPPER");
+ CopyDataOnCells(theInput,
+ aGeometryCellMapper,
+ aDataCellMapper,
+ theScalarsDataSet,
+ theVectorsDataSet,
+ theNormalsDataSet,
+ theTCoordsDataSet,
+ theTensorsDataSet,
+ theFieldList,
+ theOutput);
+ }else{
+ vtkPointData *aPointData = theInput->GetPointData();
+ vtkDataArray *aPointMapper = aPointData->GetArray("VISU_POINTS_MAPPER");
+ vtkIntArray *aGeometryPointMapper = dynamic_cast<vtkIntArray*>(aPointMapper);
+ vtkIntArray* aDataPointMapper = GetIDMapper(theFieldList,
+ TGetPointData(),
+ "VISU_POINTS_MAPPER");
+ CopyDataOnPoints(theInput,
+ aGeometryPointMapper,
+ aDataPointMapper,
+ theScalarsDataSet,
+ theVectorsDataSet,
+ theNormalsDataSet,
+ theTCoordsDataSet,
+ theTensorsDataSet,
+ theFieldList,
+ theOutput);
+ }
}
}else{
BasicExecute(theInput,
- theScalarsDataSet,
- theVectorsDataSet,
- theNormalsDataSet,
- theTCoordsDataSet,
- theTensorsDataSet,
- theFieldList,
- theOutput);
+ theScalarsDataSet,
+ theVectorsDataSet,
+ theNormalsDataSet,
+ theTCoordsDataSet,
+ theTensorsDataSet,
+ theFieldList,
+ theOutput);
}
return true;
}
//---------------------------------------------------------------
void
GetObjectIdSet(vtkIntArray *theArray,
- TObjectIdSet& theObjectIdSet)
+ TObjectIdSet& theObjectIdSet)
{
theObjectIdSet.clear();
int aMaxId = theArray->GetMaxId();
//---------------------------------------------------------------
void
GetObjectId2TupleIdMap(vtkIntArray *theArray,
- TObjectId2TupleIdMap& theObjectId2TupleIdMap)
+ TObjectId2TupleIdMap& theObjectId2TupleIdMap)
{
theObjectId2TupleIdMap.clear();
int* aPointer = theArray->GetPointer(0);
template<class TGetFieldData>
vtkIntArray*
GetIDMapper(VISU::TFieldList* theFieldList,
- TGetFieldData theGetFieldData,
- const char* theFieldName)
+ TGetFieldData theGetFieldData,
+ const char* theFieldName)
{
VISU::TFieldListIterator anIter(theFieldList);
for(anIter.Begin(); !anIter.End() ; anIter.Next()){
const char* aFieldName = anIter.Get()->GetName();
if(strcmp(aFieldName, theFieldName) == 0){
- vtkDataSet* aDataSet = anIter.Get()->Ptr;
- vtkFieldData *aFieldData = theGetFieldData(aDataSet);
- vtkDataArray *anIDMapper = aFieldData->GetArray(theFieldName);
- return dynamic_cast<vtkIntArray*>(anIDMapper);
+ vtkDataSet* aDataSet = anIter.Get()->Ptr;
+ vtkFieldData *aFieldData = theGetFieldData(aDataSet);
+ vtkDataArray *anIDMapper = aFieldData->GetArray(theFieldName);
+ return dynamic_cast<vtkIntArray*>(anIDMapper);
}
}
return NULL;
template<class TGetFieldData>
vtkIntArray*
GetIDMapper(vtkDataSet* theIDMapperDataSet,
- TGetFieldData theGetFieldData,
- const char* theFieldName)
+ TGetFieldData theGetFieldData,
+ const char* theFieldName)
{
vtkFieldData *aFieldData = theGetFieldData(theIDMapperDataSet);
vtkDataArray *anIDMapper = aFieldData->GetArray(theFieldName);
//---------------------------------------------------------------
bool
IsDifferent(vtkIntArray *theFirstIDMapper,
- vtkIntArray *theSecondIDMapper)
+ vtkIntArray *theSecondIDMapper)
{
vtkIdType aFirstNbTuples = theFirstIDMapper->GetNumberOfTuples();
vtkIdType aSecondNbTuples = theSecondIDMapper->GetNumberOfTuples();
int* aSecondPointer = theSecondIDMapper->GetPointer(0);
for(int anId = 0; anId <= aMaxId; anId++){
if(*aFirstPointer++ != *aSecondPointer++)
- return true;
+ return true;
}
return false;
//---------------------------------------------------------------
void
GetIntersection(vtkIntArray *theFirstIDMapper,
- vtkIntArray *theSecondIDMapper,
- TObjectIdArray& theResult)
+ vtkIntArray *theSecondIDMapper,
+ TObjectIdArray& theResult)
{
TObjectIdSet aFirstObjectIdSet;
GetObjectIdSet(theFirstIDMapper, aFirstObjectIdSet);
theResult.resize(aMaxLength);
TObjectIdArray::iterator anArrayIter = theResult.begin();
anArrayIter = std::set_intersection(aFirstObjectIdSet.begin(),
- aFirstObjectIdSet.end(),
- aSecondObjectIdSet.begin(),
- aSecondObjectIdSet.end(),
- anArrayIter);
+ aFirstObjectIdSet.end(),
+ aSecondObjectIdSet.begin(),
+ aSecondObjectIdSet.end(),
+ anArrayIter);
theResult.erase(anArrayIter, theResult.end());
}
//---------------------------------------------------------------
bool
Execute(vtkUnstructuredGrid *theInput,
- vtkUnstructuredGrid *theOutput,
- vtkDataSet* theScalarsDataSet,
- vtkDataSet* theVectorsDataSet,
- vtkDataSet* theNormalsDataSet,
- vtkDataSet* theTCoordsDataSet,
- vtkDataSet* theTensorsDataSet,
- TFieldList* theFieldList,
- bool theIsMergingInputs)
+ vtkUnstructuredGrid *theOutput,
+ vtkDataSet* theScalarsDataSet,
+ vtkDataSet* theVectorsDataSet,
+ vtkDataSet* theNormalsDataSet,
+ vtkDataSet* theTCoordsDataSet,
+ vtkDataSet* theTensorsDataSet,
+ TFieldList* theFieldList,
+ bool theIsMergingInputs)
{
return ::Execute(theInput,
- theScalarsDataSet,
- theVectorsDataSet,
- theNormalsDataSet,
- theTCoordsDataSet,
- theTensorsDataSet,
- theFieldList,
- theIsMergingInputs,
- theOutput);
+ theScalarsDataSet,
+ theVectorsDataSet,
+ theNormalsDataSet,
+ theTCoordsDataSet,
+ theTensorsDataSet,
+ theFieldList,
+ theIsMergingInputs,
+ theOutput);
}
//---------------------------------------------------------------
bool
Execute(vtkPolyData *theInput,
- vtkPolyData *theOutput,
- vtkDataSet* theScalarsDataSet,
- vtkDataSet* theVectorsDataSet,
- vtkDataSet* theNormalsDataSet,
- vtkDataSet* theTCoordsDataSet,
- vtkDataSet* theTensorsDataSet,
- TFieldList* theFieldList,
- bool theIsMergingInputs)
+ vtkPolyData *theOutput,
+ vtkDataSet* theScalarsDataSet,
+ vtkDataSet* theVectorsDataSet,
+ vtkDataSet* theNormalsDataSet,
+ vtkDataSet* theTCoordsDataSet,
+ vtkDataSet* theTensorsDataSet,
+ TFieldList* theFieldList,
+ bool theIsMergingInputs)
{
return ::Execute(theInput,
- theScalarsDataSet,
- theVectorsDataSet,
- theNormalsDataSet,
- theTCoordsDataSet,
- theTensorsDataSet,
- theFieldList,
- theIsMergingInputs,
- theOutput);
+ theScalarsDataSet,
+ theVectorsDataSet,
+ theNormalsDataSet,
+ theTCoordsDataSet,
+ theTensorsDataSet,
+ theFieldList,
+ theIsMergingInputs,
+ theOutput);
}
}
void
GetObjectId2TupleIdMap(vtkIntArray *theArray,
- TObjectId2TupleIdMap& theObjectId2TupleIdMap);
+ TObjectId2TupleIdMap& theObjectId2TupleIdMap);
void
GetObjectId2TupleGaussIdArray(vtkIntArray *theArray,
template<class TGetFieldData>
vtkIntArray*
GetIDMapper(VISU::TFieldList* theFieldList,
- TGetFieldData theGetFieldData,
- const char* theFieldName);
+ TGetFieldData theGetFieldData,
+ const char* theFieldName);
template<class TGetFieldData>
vtkIntArray*
GetIDMapper(vtkDataSet* theIDMapperDataSet,
- TGetFieldData theGetFieldData,
- const char* theFieldName);
+ TGetFieldData theGetFieldData,
+ const char* theFieldName);
bool
IsDifferent(vtkIntArray *theFirstIDMapper,
- vtkIntArray *theSecondIDMapper);
+ vtkIntArray *theSecondIDMapper);
void
GetIntersection(vtkIntArray *theFirstIDMapper,
- vtkIntArray *theSecondIDMapper,
- TObjectIdArray& theResult);
+ vtkIntArray *theSecondIDMapper,
+ TObjectIdArray& theResult);
//---------------------------------------------------------------
bool
Execute(vtkUnstructuredGrid *theInput,
- vtkUnstructuredGrid *theOutput,
- vtkDataSet* theScalarsDataSet,
- vtkDataSet* theVectorsDataSet,
- vtkDataSet* theNormalsDataSet,
- vtkDataSet* theTCoordsDataSet,
- vtkDataSet* theTensorsDataSet,
- TFieldList* theFieldList,
- bool theIsMergingInputs);
+ vtkUnstructuredGrid *theOutput,
+ vtkDataSet* theScalarsDataSet,
+ vtkDataSet* theVectorsDataSet,
+ vtkDataSet* theNormalsDataSet,
+ vtkDataSet* theTCoordsDataSet,
+ vtkDataSet* theTensorsDataSet,
+ TFieldList* theFieldList,
+ bool theIsMergingInputs);
//---------------------------------------------------------------
bool
Execute(vtkPolyData *theInput,
- vtkPolyData *theOutput,
- vtkDataSet* theScalarsDataSet,
- vtkDataSet* theVectorsDataSet,
- vtkDataSet* theNormalsDataSet,
- vtkDataSet* theTCoordsDataSet,
- vtkDataSet* theTensorsDataSet,
- TFieldList* theFieldList,
- bool theIsMergingInputs);
+ vtkPolyData *theOutput,
+ vtkDataSet* theScalarsDataSet,
+ vtkDataSet* theVectorsDataSet,
+ vtkDataSet* theNormalsDataSet,
+ vtkDataSet* theTCoordsDataSet,
+ vtkDataSet* theTensorsDataSet,
+ TFieldList* theFieldList,
+ bool theIsMergingInputs);
//---------------------------------------------------------------
class TFieldNode
{
int length = static_cast<int>(strlen(name));
if (length > 0) {
- this->Name = new char[length+1];
- strcpy(this->Name, name);
+ this->Name = new char[length+1];
+ strcpy(this->Name, name);
} else {
this->Name = 0;
}
{
TFieldNode* newNode = new TFieldNode(name, ptr);
if (!this->First) {
- this->First = newNode;
- this->Last = newNode;
+ this->First = newNode;
+ this->Last = newNode;
} else {
this->Last->Next = newNode;
this->Last = newNode;
void Next()
{
if (this->Position) {
- this->Position = this->Position->Next;
+ this->Position = this->Position->Next;
}
}
int End()
//! To intitilize the data strucutre
void
Init(vtkIdType theNbElem,
- vtkIdType theNbGauss,
- vtkIdType theNbComp);
+ vtkIdType theNbGauss,
+ vtkIdType theNbComp);
//! Gets memory size used by the instance (bytes).
virtual
TCValueSliceArr aValueSliceArr(this->myNbGauss);
vtkIdType anId = theElemId * this->myStep;
for(vtkIdType aGaussId = 0; aGaussId < this->myNbGauss; aGaussId++){
- aValueSliceArr[aGaussId] =
- TCValueSlice(this->GetPointer(),
- this->size(),
- std::slice(anId, this->myNbComp, 1));
- anId += this->myNbComp;
+ aValueSliceArr[aGaussId] =
+ TCValueSlice(this->GetPointer(),
+ this->size(),
+ std::slice(anId, this->myNbComp, 1));
+ anId += this->myNbComp;
}
return aValueSliceArr;
}
TValueSliceArr aValueSliceArr(this->myNbGauss);
vtkIdType anId = theElemId * this->myStep;
for(vtkIdType aGaussId = 0; aGaussId < this->myNbGauss; aGaussId++){
- aValueSliceArr[aGaussId] =
- TValueSlice(this->GetPointer(),
- this->size(),
- std::slice(anId, this->myNbComp, 1));
- anId += this->myNbComp;
+ aValueSliceArr[aGaussId] =
+ TValueSlice(this->GetPointer(),
+ this->size(),
+ std::slice(anId, this->myNbComp, 1));
+ anId += this->myNbComp;
}
return aValueSliceArr;
}
TCValueSliceArr aValueSliceArr(this->myNbComp);
vtkIdType anId = theElemId * this->myStep;
for(vtkIdType aCompId = 0; aCompId < this->myNbComp; aCompId++){
- aValueSliceArr[aCompId] =
- TCValueSlice(this->GetPointer(),
- this->size(),
- std::slice(anId, this->myNbGauss, this->myNbComp));
- anId += 1;
+ aValueSliceArr[aCompId] =
+ TCValueSlice(this->GetPointer(),
+ this->size(),
+ std::slice(anId, this->myNbGauss, this->myNbComp));
+ anId += 1;
}
return aValueSliceArr;
}
TValueSliceArr aValueSliceArr(this->myNbComp);
vtkIdType anId = theElemId * this->myStep;
for(vtkIdType aCompId = 0; aCompId < this->myNbComp; aCompId++){
- aValueSliceArr[aCompId] =
- TValueSlice(this->GetPointer(),
- this->size(),
- std::slice(anId, this->myNbGauss, this->myNbComp));
- anId += 1;
+ aValueSliceArr[aCompId] =
+ TValueSlice(this->GetPointer(),
+ this->size(),
+ std::slice(anId, this->myNbGauss, this->myNbComp));
+ anId += 1;
}
return aValueSliceArr;
}
//! To initilize the class instance
void
Init(vtkIdType theNbElem,
- vtkIdType theNbGauss,
- vtkIdType theNbComp,
- const TContainerType& theContainer)
+ vtkIdType theNbGauss,
+ vtkIdType theNbComp,
+ const TContainerType& theContainer)
{
TMeshValueBase::Init(theNbElem, theNbGauss, theNbComp);
myContainer = theContainer;
// Initilize corresponding vtkDataSetAttributes for TValForTime
void
GetTimeStampOnProfile(const PUnstructuredGrid& theSource,
- const PFieldImpl& theField,
- const PValForTimeImpl& theValForTime,
- const VISU::TEntity& theEntity);
+ const PFieldImpl& theField,
+ const PValForTimeImpl& theValForTime,
+ const VISU::TEntity& theEntity);
//---------------------------------------------------------------
// Initilize corresponding vtkDataSetAttributes for TValForTime
void
GetTimeStampOnGaussMesh(const PPolyData& theSource,
- const PFieldImpl& theField,
- const PValForTimeImpl& theValForTime);
+ const PFieldImpl& theField,
+ const PValForTimeImpl& theValForTime);
void
InitMed2VisuArray(std::vector<int>& anArray, EGeometry aEGeom);
void
TCoordHolderBase
::Init(vtkIdType theNbPoints,
- vtkIdType theDim)
+ vtkIdType theDim)
{
myDim = theDim;
myNbPoints = theNbPoints;
vtkIdType aDim = GetDim();
INITMSG(MYDEBUG,"TPointCoords::GetPoints - aNbPoints = "<<aNbPoints<<
- "; aDim = "<<aDim<<
- endl);
+ "; aDim = "<<aDim<<
+ endl);
if(GetDim() == 3){
- INITMSG(MYDEBUG,"TPointCoords::GetPoints - SetVoidArray()"<<endl);
- SetVoidArray();
+ INITMSG(MYDEBUG,"TPointCoords::GetPoints - SetVoidArray()"<<endl);
+ SetVoidArray();
}else{
- vtkPoints* aPoints = myPointSet->GetPoints();
- for(vtkIdType aPointId = 0; aPointId < aNbPoints; aPointId++){
- TCCoordSlice aSlice = GetCoordSlice(aPointId);
+ vtkPoints* aPoints = myPointSet->GetPoints();
+ for(vtkIdType aPointId = 0; aPointId < aNbPoints; aPointId++){
+ TCCoordSlice aSlice = GetCoordSlice(aPointId);
- vtkFloatingPointType aCoords[3] = {0.0, 0.0, 0.0};
- for(vtkIdType aDimId = 0; aDimId < aDim; aDimId++)
- aCoords[aDimId] = aSlice[aDimId];
+ vtkFloatingPointType aCoords[3] = {0.0, 0.0, 0.0};
+ for(vtkIdType aDimId = 0; aDimId < aDim; aDimId++)
+ aCoords[aDimId] = aSlice[aDimId];
- aPoints->SetPoint(aPointId, aCoords);
- }
+ aPoints->SetPoint(aPointId, aCoords);
+ }
}
myIsVTKDone = true;
VISU::TCoord
GetCoord(VISU::TCCoordSlice& theCoordSlice,
- int theCoordId)
+ int theCoordId)
{
return (*myGetCoord[theCoordId])(theCoordSlice);
}
// 1D - always along X
// 2D - always in XOY plane
anIsDimPresent[iDim] = iDim < GetDim();
-// std::string aName = GetName(iDim);
-// if ( aName.size() > 1 ) // PAL13021 (PAL12148), aName has size 8 or 16
-// aName = aName.substr(0,1);
-// if(aName == "x" || aName == "X")
-// anIsDimPresent[eX] = true;
-// else if(aName == "y" || aName == "Y")
-// anIsDimPresent[eY] = true;
-// else if(aName == "z" || aName == "Z")
-// anIsDimPresent[eZ] = true;
+// std::string aName = GetName(iDim);
+// if ( aName.size() > 1 ) // PAL13021 (PAL12148), aName has size 8 or 16
+// aName = aName.substr(0,1);
+// if(aName == "x" || aName == "X")
+// anIsDimPresent[eX] = true;
+// else if(aName == "y" || aName == "Y")
+// anIsDimPresent[eY] = true;
+// else if(aName == "z" || aName == "Z")
+// anIsDimPresent[eZ] = true;
}
switch(GetDim()){
case 3:
- aCoordHelperPtr.reset(new TCoordHelper(aXYZGetCoord));
- break;
+ aCoordHelperPtr.reset(new TCoordHelper(aXYZGetCoord));
+ break;
case 2:
- if(anIsDimPresent[eY] && anIsDimPresent[eZ])
- aCoordHelperPtr.reset(new TCoordHelper(aYZGetCoord));
- else if(anIsDimPresent[eX] && anIsDimPresent[eZ])
- aCoordHelperPtr.reset(new TCoordHelper(aXZGetCoord));
- else
- aCoordHelperPtr.reset(new TCoordHelper(aXYGetCoord));
- break;
+ if(anIsDimPresent[eY] && anIsDimPresent[eZ])
+ aCoordHelperPtr.reset(new TCoordHelper(aYZGetCoord));
+ else if(anIsDimPresent[eX] && anIsDimPresent[eZ])
+ aCoordHelperPtr.reset(new TCoordHelper(aXZGetCoord));
+ else
+ aCoordHelperPtr.reset(new TCoordHelper(aXYGetCoord));
+ break;
case 1:
- if(anIsDimPresent[eY])
- aCoordHelperPtr.reset(new TCoordHelper(aYGetCoord));
- else if(anIsDimPresent[eZ])
- aCoordHelperPtr.reset(new TCoordHelper(aZGetCoord));
- else
- aCoordHelperPtr.reset(new TCoordHelper(aXGetCoord));
- break;
+ if(anIsDimPresent[eY])
+ aCoordHelperPtr.reset(new TCoordHelper(aYGetCoord));
+ else if(anIsDimPresent[eZ])
+ aCoordHelperPtr.reset(new TCoordHelper(aZGetCoord));
+ else
+ aCoordHelperPtr.reset(new TCoordHelper(aXGetCoord));
+ break;
}
INITMSG(MYDEBUG,"TNamedPointCoords::GetPoints - aNbPoints = "<<GetNbPoints()<<
- "; aDim = "<<GetDim()<<
- endl);
+ "; aDim = "<<GetDim()<<
+ endl);
if(anIsDimPresent[eX] && anIsDimPresent[eY] && anIsDimPresent[eZ]){
- INITMSG(MYDEBUG,"TNamedPointCoords::GetPoints - SetVoidArray()"<<endl);
- SetVoidArray();
+ INITMSG(MYDEBUG,"TNamedPointCoords::GetPoints - SetVoidArray()"<<endl);
+ SetVoidArray();
}else{
- vtkPoints* aPoints = myPointSet->GetPoints();
- for(vtkIdType aNodeId = 0; aNodeId < GetNbPoints(); aNodeId++){
- TCCoordSlice aCoordSlice = GetCoordSlice(aNodeId);
- aPoints->SetPoint(aNodeId,
- aCoordHelperPtr->GetCoord(aCoordSlice,eX),
- aCoordHelperPtr->GetCoord(aCoordSlice,eY),
- aCoordHelperPtr->GetCoord(aCoordSlice,eZ));
- }
+ vtkPoints* aPoints = myPointSet->GetPoints();
+ for(vtkIdType aNodeId = 0; aNodeId < GetNbPoints(); aNodeId++){
+ TCCoordSlice aCoordSlice = GetCoordSlice(aNodeId);
+ aPoints->SetPoint(aNodeId,
+ aCoordHelperPtr->GetCoord(aCoordSlice,eX),
+ aCoordHelperPtr->GetCoord(aCoordSlice,eY),
+ aCoordHelperPtr->GetCoord(aCoordSlice,eZ));
+ }
}
{
- vtkIdType aNbTuples = GetNbPoints();
- int anEntity = int(VISU::NODE_ENTITY);
- vtkIntArray *aDataArray = vtkIntArray::New();
- aDataArray->SetName("VISU_POINTS_MAPPER");
- aDataArray->SetNumberOfComponents(2);
- aDataArray->SetNumberOfTuples(aNbTuples);
- int *aPtr = aDataArray->GetPointer(0);
- for(vtkIdType aTupleId = 0; aTupleId < aNbTuples; aTupleId++){
- vtkIdType anObjID = GetObjID(aTupleId);
- *aPtr++ = anObjID;
- *aPtr++ = anEntity;
- }
- myPointSet->GetPointData()->AddArray(aDataArray);
- aDataArray->Delete();
+ vtkIdType aNbTuples = GetNbPoints();
+ int anEntity = int(VISU::NODE_ENTITY);
+ vtkIntArray *aDataArray = vtkIntArray::New();
+ aDataArray->SetName("VISU_POINTS_MAPPER");
+ aDataArray->SetNumberOfComponents(2);
+ aDataArray->SetNumberOfTuples(aNbTuples);
+ int *aPtr = aDataArray->GetPointer(0);
+ for(vtkIdType aTupleId = 0; aTupleId < aNbTuples; aTupleId++){
+ vtkIdType anObjID = GetObjID(aTupleId);
+ *aPtr++ = anObjID;
+ *aPtr++ = anEntity;
+ }
+ myPointSet->GetPointData()->AddArray(aDataArray);
+ aDataArray->Delete();
}
myIsVTKDone = true;
//! To initilize the instance
void
Init(vtkIdType theNbPoints,
- vtkIdType theDim);
+ vtkIdType theDim);
vtkIdType
GetNbPoints() const;
//! To initilize the class instance
void
Init(vtkIdType theNbPoints,
- vtkIdType theDim,
- const TContainerType& theCoord)
+ vtkIdType theDim,
+ const TContainerType& theCoord)
{
TCoordHolderBase::Init(theNbPoints, theDim);
myCoord = theCoord;
GetCoordSlice(vtkIdType theNodeId) const
{
return TCCoordSlice(this->GetPointer(),
- this->size(),
- std::slice(theNodeId * this->GetDim(), this->GetDim(), 1));
+ this->size(),
+ std::slice(theNodeId * this->GetDim(), this->GetDim(), 1));
}
//! Get slice of coordinates for defined node
GetCoordSlice(vtkIdType theNodeId)
{
return TCoordSlice(this->GetPointer(),
- this->size(),
- std::slice(theNodeId * this->GetDim(), this->GetDim(), 1));
+ this->size(),
+ std::slice(theNodeId * this->GetDim(), this->GetDim(), 1));
}
virtual
//---------------------------------------------------------------
//! Define a basic class for MED FAMILY entity
struct VISU_CONVERTOR_EXPORT TFamily: virtual TIntId,
- virtual TUnstructuredGridIDMapper
+ virtual TUnstructuredGridIDMapper
{
TEntity myEntity; //!< Referes to MED ENTITY where the TFamily belongs to.
TName myName; //!< Contains name of the corresponding MED FAMILY
//---------------------------------------------------------------
//! Define an intermediate class which unifies memory size calculation
struct VISU_CONVERTOR_EXPORT TMemoryCheckIDMapper: public virtual TIsVTKDone,
- public virtual TIDMapper
+ public virtual TIDMapper
{
//! Gets memory size used by the instance (bytes).
virtual
//---------------------------------------------------------------
//! Specialize TMesh to provide VTK mapping for nodes
struct VISU_CONVERTOR_EXPORT TMeshImpl: virtual TMesh,
- virtual TIsVTKDone
+ virtual TIsVTKDone
{
PNamedPointCoords myNamedPointCoords; //!< Keeps intermediate representation of the nodes
vtkIdType myNbPoints; //!< Keeps number of the nodes
//! Specialize TSubProfile to provide VTK mapping
struct VISU_CONVERTOR_EXPORT TSubProfileImpl: virtual TSubProfile,
- virtual TUnstructuredGridHolder
+ virtual TUnstructuredGridHolder
{
TSubProfileImpl();
//! Specialize TProfile to provide VTK mapping for MED TIMESTAMP mesh
struct VISU_CONVERTOR_EXPORT TProfileImpl: virtual TProfile,
- virtual TAppendFilterHolder
+ virtual TAppendFilterHolder
{
TProfileImpl();
bool myIsAll; //!< Say, whether the MED TIMESTAMP defined on all MED ENTITY or not
//---------------------------------------------------------------
//! Specialize TIDMapper to provide VTK mapping for MED TIMESTAMP mesh
struct TUnstructuredGridIDMapperImpl: virtual TMergeFilterHolder,
- virtual TUnstructuredGridIDMapper
+ virtual TUnstructuredGridIDMapper
{
PAppendFilterHolder myIDMapper; //!< Responsible for numbering
PCommonCellsFilter myCommonCellsFilter;
//---------------------------------------------------------------
//! Specialize TIDMapper to provide VTK mapping for MED TIMESTAMP mesh
struct TPolyDataIDMapperImpl: virtual TMergeFilterHolder,
- virtual TPolyDataIDMapper
+ virtual TPolyDataIDMapper
{
PAppendPolyDataHolder myIDMapper; //!< Responsible for numbering
virtual
void
LessThan(const PGaussImpl& theGauss,
- bool& theResult) const;
+ bool& theResult) const;
};
//---------------------------------------------------------------
//! Specialize TGaussSubMesh to provide VTK mapping for the entity
struct VISU_CONVERTOR_EXPORT TGaussSubMeshImpl: virtual TGaussSubMesh,
- virtual TPolyDataHolder
+ virtual TPolyDataHolder
{
TGaussSubMeshImpl();
//! Specialize TGaussMesh to provide VTK mapping for the entity
struct VISU_CONVERTOR_EXPORT TGaussMeshImpl: virtual TGaussMesh,
- virtual TAppendPolyDataHolder
+ virtual TAppendPolyDataHolder
{
TGaussMeshImpl();
//---------------------------------------------------------------
//! Specialize TGaussPtsIDMapper to provide VTK mapping for MED TIMESTAMP mesh
struct VISU_CONVERTOR_EXPORT TGaussPtsIDFilter: virtual TPolyDataIDMapperImpl,
- virtual TGaussPtsIDMapper
+ virtual TGaussPtsIDMapper
{
PGaussPtsIDMapper myGaussPtsIDMapper;
//! Specialize TMeshOnEntity to provide VTK mapping for the entity
struct VISU_CONVERTOR_EXPORT TMeshOnEntityImpl: virtual TMeshOnEntity,
- virtual TAppendFilterHolder,
- virtual TSizeCounter
+ virtual TAppendFilterHolder,
+ virtual TSizeCounter
{
TMeshOnEntityImpl();
//! Specialize TFamily to provide VTK mapping for the entity
struct VISU_CONVERTOR_EXPORT TFamilyImpl: virtual TFamily,
- virtual TUnstructuredGridHolder
+ virtual TUnstructuredGridHolder
{
//! Reimplements the TStructured::CopyStructure
virtual
//! Specialize TGroup to provide VTK mapping for the entity
struct VISU_CONVERTOR_EXPORT TGroupImpl: virtual TGroup,
- virtual TAppendFilterHolder
+ virtual TAppendFilterHolder
{
//! Reimplements the TStructured::CopyStructure
virtual
//! To initialize the data structure
void
Init(vtkIdType theNbComp,
- vtkIdType theDataType);
+ vtkIdType theDataType);
//! Gets type idetificator of the mesh data.
vtkIdType
while ( theStmIn.get( tmp ) ) {
aStrOut<<tmp;
if ( tmp == '\n' )
- break;
+ break;
}
aStrOut<<std::ends;
// split string to data and comment (comment starts from '#' symbol)
int index = aTmp.indexOf( "#" );
if ( index >= 0 ) {
- data = aTmp.left( index ).trimmed();
- cmt = aTmp.mid( index+1 ).trimmed();
+ data = aTmp.left( index ).trimmed();
+ cmt = aTmp.mid( index+1 ).trimmed();
}
// if comment is not empty, try to get keyword from it (separated by ':' symbol)
if ( !cmt.isEmpty() ) {
- int index1 = cmt.indexOf( ":" );
- if ( index1 >= 0 ) {
- QString tmpstr = cmt.left( index1 ).trimmed();
- if ( tmpstr == QString( "TITLE" ) ||
- tmpstr == QString( "COLUMN_TITLES" ) ||
- tmpstr == QString( "COLUMN_UNITS" ) ||
- tmpstr == QString( "COMMENT" ) ) {
- keyword = tmpstr;
- cmt = cmt.mid( index1+1 ).trimmed();
- }
- }
+ int index1 = cmt.indexOf( ":" );
+ if ( index1 >= 0 ) {
+ QString tmpstr = cmt.left( index1 ).trimmed();
+ if ( tmpstr == QString( "TITLE" ) ||
+ tmpstr == QString( "COLUMN_TITLES" ) ||
+ tmpstr == QString( "COLUMN_UNITS" ) ||
+ tmpstr == QString( "COMMENT" ) ) {
+ keyword = tmpstr;
+ cmt = cmt.mid( index1+1 ).trimmed();
+ }
+ }
}
// if data is empty, process only comment
if ( data.isEmpty() ) {
- // if keyword is found, try to process it
- // elsewise it is a simple comment, just ignore it
- if ( !keyword.isEmpty() ) {
- if ( keyword == QString( "TITLE" ) ) {
- QString title = cmt;
- if ( aTable2D.myTitle != "" )
- title = QString( aTable2D.myTitle.c_str() ) + QString( " " ) + title;
- if(MYDEBUG) std::cout << "...Table TITLE is: " << title.toLatin1().constData() << std::endl;
- aTable2D.myTitle = title.toLatin1().constData();
- }
- else if ( keyword == QString( "COLUMN_TITLES" ) ) {
- // comment may contain column headers
- QStringList aStrList = cmt.split( "|", QString::SkipEmptyParts );
- if(MYDEBUG) std::cout << "...Column TITLES are: ";
- for ( int i = 0; i < aStrList.count(); i++ ) {
- QString tmpstr = aStrList[ i ].trimmed();
- if(MYDEBUG) std::cout << tmpstr.toLatin1().constData() << " ";
- aTable2D.myColumnTitles.push_back( tmpstr.toLatin1().constData() );
- }
- if(MYDEBUG) std::cout << std::endl;
- }
- else if ( keyword == QString( "COLUMN_UNITS" ) ) {
- // comment may contain column units
- QStringList aStrList = cmt.split( " ", QString::SkipEmptyParts );
- if(MYDEBUG) std::cout << "...Column UNITS are: ";
- for ( int i = 0; i < aStrList.count(); i++ ) {
- QString tmpstr = aStrList[ i ].trimmed();
- if(MYDEBUG) std::cout << tmpstr.toLatin1().constData() << " ";
- aTable2D.myColumnUnits.push_back( tmpstr.toLatin1().constData() );
- }
- if(MYDEBUG) std::cout << std::endl;
- }
- else if ( keyword == QString( "COMMENT" ) ) {
- // keyword 'COMMENT' processing can be here
- // currently it is ignored
- if(MYDEBUG) std::cout << "...COMMENT: " << cmt.toLatin1().constData() << std::endl;
- }
- }
- else {
- if(MYDEBUG) std::cout << "...comment: " << cmt.toLatin1().constData() << std::endl;
- // simple comment processing can be here
- // currently it is ignored
- }
+ // if keyword is found, try to process it
+ // elsewise it is a simple comment, just ignore it
+ if ( !keyword.isEmpty() ) {
+ if ( keyword == QString( "TITLE" ) ) {
+ QString title = cmt;
+ if ( aTable2D.myTitle != "" )
+ title = QString( aTable2D.myTitle.c_str() ) + QString( " " ) + title;
+ if(MYDEBUG) std::cout << "...Table TITLE is: " << title.toLatin1().constData() << std::endl;
+ aTable2D.myTitle = title.toLatin1().constData();
+ }
+ else if ( keyword == QString( "COLUMN_TITLES" ) ) {
+ // comment may contain column headers
+ QStringList aStrList = cmt.split( "|", QString::SkipEmptyParts );
+ if(MYDEBUG) std::cout << "...Column TITLES are: ";
+ for ( int i = 0; i < aStrList.count(); i++ ) {
+ QString tmpstr = aStrList[ i ].trimmed();
+ if(MYDEBUG) std::cout << tmpstr.toLatin1().constData() << " ";
+ aTable2D.myColumnTitles.push_back( tmpstr.toLatin1().constData() );
+ }
+ if(MYDEBUG) std::cout << std::endl;
+ }
+ else if ( keyword == QString( "COLUMN_UNITS" ) ) {
+ // comment may contain column units
+ QStringList aStrList = cmt.split( " ", QString::SkipEmptyParts );
+ if(MYDEBUG) std::cout << "...Column UNITS are: ";
+ for ( int i = 0; i < aStrList.count(); i++ ) {
+ QString tmpstr = aStrList[ i ].trimmed();
+ if(MYDEBUG) std::cout << tmpstr.toLatin1().constData() << " ";
+ aTable2D.myColumnUnits.push_back( tmpstr.toLatin1().constData() );
+ }
+ if(MYDEBUG) std::cout << std::endl;
+ }
+ else if ( keyword == QString( "COMMENT" ) ) {
+ // keyword 'COMMENT' processing can be here
+ // currently it is ignored
+ if(MYDEBUG) std::cout << "...COMMENT: " << cmt.toLatin1().constData() << std::endl;
+ }
+ }
+ else {
+ if(MYDEBUG) std::cout << "...comment: " << cmt.toLatin1().constData() << std::endl;
+ // simple comment processing can be here
+ // currently it is ignored
+ }
}
// if data is not empty, try to process it
else {
- TTable2D::TRow aRow;
- if(MYDEBUG) std::cout << "...New row is found: " << std::endl;
- if ( !cmt.isEmpty() ) {
- aRow.myTitle = cmt.toLatin1().constData();
- if(MYDEBUG) std::cout << "......ROW TITLE is: " << cmt.toLatin1().constData() << std::endl;
- }
- QString datar1 = data.replace(QRegExp("\t"), " ");
- QStringList aValList = datar1.split( " ", QString::SkipEmptyParts );
- for ( int i = 0; i < aValList.count(); i++ ) {
- if ( aValList[i].trimmed() != "" ) {
- TTable2D::TValue aVal = aValList[i].trimmed().toLatin1().constData();
- aRow.myValues.push_back( aVal );
- }
- }
- if( aRow.myValues.size() > 0 )
- aTable2D.myRows.push_back( aRow );
- // ************** OLD CODE ******************
- /*
- TValue aVal;
- istrstream aStream( data );
- aStream.precision( STRPRECISION );
- while( aStream >> aVal ) {
- aRow.myValues.push_back( aVal );
- }
- if( aRow.myValues.size() > 0 )
- aTable2D.myRows.push_back( aRow );
- */
- // ************** OLD CODE ******************
+ TTable2D::TRow aRow;
+ if(MYDEBUG) std::cout << "...New row is found: " << std::endl;
+ if ( !cmt.isEmpty() ) {
+ aRow.myTitle = cmt.toLatin1().constData();
+ if(MYDEBUG) std::cout << "......ROW TITLE is: " << cmt.toLatin1().constData() << std::endl;
+ }
+ QString datar1 = data.replace(QRegExp("\t"), " ");
+ QStringList aValList = datar1.split( " ", QString::SkipEmptyParts );
+ for ( int i = 0; i < aValList.count(); i++ ) {
+ if ( aValList[i].trimmed() != "" ) {
+ TTable2D::TValue aVal = aValList[i].trimmed().toLatin1().constData();
+ aRow.myValues.push_back( aVal );
+ }
+ }
+ if( aRow.myValues.size() > 0 )
+ aTable2D.myRows.push_back( aRow );
+ // ************** OLD CODE ******************
+ /*
+ TValue aVal;
+ istrstream aStream( data );
+ aStream.precision( STRPRECISION );
+ while( aStream >> aVal ) {
+ aRow.myValues.push_back( aVal );
+ }
+ if( aRow.myValues.size() > 0 )
+ aTable2D.myRows.push_back( aRow );
+ */
+ // ************** OLD CODE ******************
}
::getLine( aStmIn, aTmp );
}
typedef typename TSequence< T02, T03, T04, T05, T06, T07, T08, T09, T10,
T11, T12, T13, T14, T15, T16, T17, T18, T19, T20,
T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, T36, T37, T38, T39, T40
- >::TResult
+ T31, T32, T33, T34, T35, T36, T37, T38, T39, T40
+ >::TResult
TailResult;
public:
typedef TList< T01, TailResult > TResult;
vtkIdType anOldId = anOldPointsIds->GetId(i);
TId2IdMap::iterator anIter = aId2IdMap.find(anOldId);
if(anIter == aId2IdMap.end())
- goto NEXT_CELL;
+ goto NEXT_CELL;
vtkIdType aNewId = anIter->second;
aNewPointsIds->InsertNextId(aNewId);
}
{
//----------------------------------------------------------------------------
typedef TSequence< char,
- unsigned char,
- short,
- unsigned short,
- int,
- unsigned int,
- long,
- unsigned long,
- float,
- double >::TResult TVTKBasicTypeList;
+ unsigned char,
+ short,
+ unsigned short,
+ int,
+ unsigned int,
+ long,
+ unsigned long,
+ float,
+ double >::TResult TVTKBasicTypeList;
//----------------------------------------------------------------------------
typedef TSequence< vtkCharArray,
- vtkUnsignedCharArray,
- vtkShortArray,
- vtkUnsignedShortArray,
- vtkIntArray,
- vtkUnsignedIntArray,
- vtkLongArray,
- vtkUnsignedLongArray,
- vtkFloatArray,
- vtkDoubleArray >::TResult TVTKArrayTypeList;
+ vtkUnsignedCharArray,
+ vtkShortArray,
+ vtkUnsignedShortArray,
+ vtkIntArray,
+ vtkUnsignedIntArray,
+ vtkLongArray,
+ vtkUnsignedLongArray,
+ vtkFloatArray,
+ vtkDoubleArray >::TResult TVTKArrayTypeList;
//----------------------------------------------------------------------------
typedef TSequence< TInt2Type< VTK_CHAR >,
- TInt2Type< VTK_UNSIGNED_CHAR >,
- TInt2Type< VTK_SHORT >,
- TInt2Type< VTK_UNSIGNED_SHORT >,
- TInt2Type< VTK_INT >,
- TInt2Type< VTK_UNSIGNED_INT >,
- TInt2Type< VTK_LONG >,
- TInt2Type< VTK_UNSIGNED_LONG >,
- TInt2Type< VTK_FLOAT >,
- TInt2Type< VTK_DOUBLE > >::TResult TVTKBasicEnumList;
+ TInt2Type< VTK_UNSIGNED_CHAR >,
+ TInt2Type< VTK_SHORT >,
+ TInt2Type< VTK_UNSIGNED_SHORT >,
+ TInt2Type< VTK_INT >,
+ TInt2Type< VTK_UNSIGNED_INT >,
+ TInt2Type< VTK_LONG >,
+ TInt2Type< VTK_UNSIGNED_LONG >,
+ TInt2Type< VTK_FLOAT >,
+ TInt2Type< VTK_DOUBLE > >::TResult TVTKBasicEnumList;
//----------------------------------------------------------------------------
/*
# = dynamic_cast</*
-*>( );define VTK_EMPTY_CELL 0
-#define VTK_VERTEX 1
-#define VTK_POLY_VERTEX 2
-#define VTK_LINE 3
-#define VTK_POLY_LINE 4
-#define VTK_TRIANGLE 5
-#define VTK_TRIANGLE_STRIP 6
-#define VTK_POLYGON 7
-#define VTK_PIXEL 8
-#define VTK_QUAD 9
-#define VTK_TETRA 10
-#define VTK_VOXEL 11
-#define VTK_HEXAHEDRON 12
-#define VTK_WEDGE 13
-#define VTK_PYRAMID 14
-#define VTK_QUADRATIC_EDGE 21
-#define VTK_QUADRATIC_TRiTSIANGLE 22
-#define VTK_QUADRATIC_QUAD 23
-#define VTK_QUADRATIC_TETRA 24
-#define VTK_QUADRATIC_HEXAHEDRON 25
-#define VTK_CONVEX_POINT_SET 41
-#define VTK_PARAMETRIC_CURVE 51
-#define VTK_PARAMETRIC_SURFACE 52
-#define VTK_PARAMETRIC_TRI_SURFACE 53
-#define VTK_PARAMETRIC_QUAD_SURFACE 54
-#define VTK_PARAMETRIC_TETRA_REGION 55
-#define VTK_PARAMETRIC_HEX_REGION 56
+*>( );define VTK_EMPTY_CELL 0
+#define VTK_VERTEX 1
+#define VTK_POLY_VERTEX 2
+#define VTK_LINE 3
+#define VTK_POLY_LINE 4
+#define VTK_TRIANGLE 5
+#define VTK_TRIANGLE_STRIP 6
+#define VTK_POLYGON 7
+#define VTK_PIXEL 8
+#define VTK_QUAD 9
+#define VTK_TETRA 10
+#define VTK_VOXEL 11
+#define VTK_HEXAHEDRON 12
+#define VTK_WEDGE 13
+#define VTK_PYRAMID 14
+#define VTK_QUADRATIC_EDGE 21
+#define VTK_QUADRATIC_TRiTSIANGLE 22
+#define VTK_QUADRATIC_QUAD 23
+#define VTK_QUADRATIC_TETRA 24
+#define VTK_QUADRATIC_HEXAHEDRON 25
+#define VTK_CONVEX_POINT_SET 41
+#define VTK_PARAMETRIC_CURVE 51
+#define VTK_PARAMETRIC_SURFACE 52
+#define VTK_PARAMETRIC_TRI_SURFACE 53
+#define VTK_PARAMETRIC_QUAD_SURFACE 54
+#define VTK_PARAMETRIC_TETRA_REGION 55
+#define VTK_PARAMETRIC_HEX_REGION 56
*/
static MED::EGeometrieElement VTK2MED( const int theGeom )
VISU_Vtk2MedConvertor();
VISU_Vtk2MedConvertor( const std::string theMEDFileName,
- const std::string theFirstVTKFileName );
+ const std::string theFirstVTKFileName );
VISU_Vtk2MedConvertor( const std::string theMEDFileName,
- const std::string theFirstVTKFileName,
- const TVectorString theDataVTKFileNames );
+ const std::string theFirstVTKFileName,
+ const TVectorString theDataVTKFileNames );
void setMEDFileName( const std::string theFileName );
// Fill container with indices of cells which match given type.
void
GetIdsOfCellsOfType( vtkDataSet* theInput, // input
- const int type, // input
- vtkIntArray *array ); // output
+ const int type, // input
+ vtkIntArray *array ); // output
// ret value 0 - OK
// ret value 1 - ERROR
int
Geometry2MED( vtkDataSet* aInput,
- MED::PWrapper myMed,
- MED::PMeshInfo aMeshInfo,
- TGeom2CellIds& outGeom2CellIdMap );
+ MED::PWrapper myMed,
+ MED::PMeshInfo aMeshInfo,
+ TGeom2CellIds& outGeom2CellIdMap );
// ret value 0 - OK
// ret value 1 - ERROR
int
Data2MED( std::vector<vtkDataSet*> theListForAdd,
- MED::PWrapper myMed,
- MED::PMeshInfo theMeshInfo,
- TGeom2CellIds& theGeom2CellIdMap );
+ MED::PWrapper myMed,
+ MED::PMeshInfo theMeshInfo,
+ TGeom2CellIds& theGeom2CellIdMap );
// ret value 0 - OK
// ret value 1 - ERROR
int
CreateElements( vtkDataSet* theInput,
- MED::PMeshInfo theMeshInfo,
- MED::PWrapper theMed,
- vtkIntArray* theCellsMapper,
- MED::EEntiteMaillage theEntity,
- int theVTKGeom,
- int nbPointsInGeom,
- std::vector<int>& theNumberingConvertor,
- TGeom2CellIds& theGeom2CellIdMap );
+ MED::PMeshInfo theMeshInfo,
+ MED::PWrapper theMed,
+ vtkIntArray* theCellsMapper,
+ MED::EEntiteMaillage theEntity,
+ int theVTKGeom,
+ int nbPointsInGeom,
+ std::vector<int>& theNumberingConvertor,
+ TGeom2CellIds& theGeom2CellIdMap );
// ret value 0 - OK
// ret value 1 - ERROR
int
CreatePolygons( vtkDataSet* theInput,
- MED::PMeshInfo theMeshInfo,
- MED::PWrapper theMed,
- vtkIntArray* theCellsMapper,
- MED::EEntiteMaillage theEntity,
- TGeom2CellIds& theGeom2CellIdMap );
+ MED::PMeshInfo theMeshInfo,
+ MED::PWrapper theMed,
+ vtkIntArray* theCellsMapper,
+ MED::EEntiteMaillage theEntity,
+ TGeom2CellIds& theGeom2CellIdMap );
// ret value 0 - OK
// ret value 1 - ERROR
int
CreatePolyedres( vtkDataSet* theInput,
- MED::PMeshInfo theMeshInfo,
- MED::PWrapper theMed,
- vtkIntArray* theCellsMapper,
- MED::EEntiteMaillage theEntity,
- TGeom2CellIds& theGeom2CellIdMap );
+ MED::PMeshInfo theMeshInfo,
+ MED::PWrapper theMed,
+ vtkIntArray* theCellsMapper,
+ MED::EEntiteMaillage theEntity,
+ TGeom2CellIds& theGeom2CellIdMap );
};
bool testUnits = ( myOrientation == Qt::Horizontal && col == 0 ) || ( myOrientation == Qt::Vertical && row == 0 );
QWidget* wg = QTable::createEditor( row, col, initFromCell );
if ( wg && wg->inherits("QLineEdit") && myValidator && !testUnits )
- (( QLineEdit*)wg)->setValidator( myValidator );
+ (( QLineEdit*)wg)->setValidator( myValidator );
return wg;
}
Constructor
*/
VisuGUI_TableDlg::VisuGUI_TableDlg( QWidget* parent,
- _PTR(SObject) obj,
- bool edit,
- int which,
- Qt::Orientation orient,
- bool showColumnTitles )
+ _PTR(SObject) obj,
+ bool edit,
+ int which,
+ Qt::Orientation orient,
+ bool showColumnTitles )
: QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
myIntTable( 0 ), myRealTable( 0 )
{
_PTR(StudyBuilder) builder = study->NewBuilder();
builder->NewCommand(); // start transaction !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
try {
- if ( myIntTable ) {
- builder->RemoveAttribute( myObject, "AttributeTableOfInteger" );
- tblIntAttr = builder->FindOrCreateAttribute( myObject, "AttributeTableOfInteger" );
+ if ( myIntTable ) {
+ builder->RemoveAttribute( myObject, "AttributeTableOfInteger" );
+ tblIntAttr = builder->FindOrCreateAttribute( myObject, "AttributeTableOfInteger" );
- int i;
- int nbRows = myIntTable->getNumRows();
- int nbCols = myIntTable->getNumCols();
- QString tlt = myIntTable->getTableTitle();
- QStringList rowTitles, colTitles, units;
- myIntTable->getRowTitles( rowTitles );
- myIntTable->getColTitles( colTitles );
- myIntTable->getUnits( units );
-
- if ( nbRows > 0) {
- // data
- int nRow = 0;
- tblIntAttr->SetNbColumns( nbCols );
- for ( i = 0; i < nbRows; i++ ) {
- QStringList data;
- myIntTable->getRowData( i, data );
- bool bEmptyRow = true;
- for ( int j = 0; j < data.count(); j++ ) {
- if ( !data[ j ].isNull() ) {
- tblIntAttr->PutValue( data[ j ].toInt(), nRow+1, j+1 );
- bEmptyRow = false;
- }
- }
- if ( !bEmptyRow ) { // Skip rows with no data !!!
- // set row title
- tblIntAttr->SetRowTitle( nRow+1, rowTitles[ i ].isNull() ? "" : (const char*)rowTitles[ i ].toLatin1() );
- // set row unit
- tblIntAttr->SetRowUnit( nRow+1, units[ i ].isNull() ? "" : (const char*)units[ i ].toLatin1() );
- nRow++;
- }
- }
- if ( nRow > 0 ) { // Set columns only if table is not empty, otherwise exception is raised !!!
- // column titles
- for ( i = 0; i < colTitles.count(); i++ )
- tblIntAttr->SetColumnTitle( i+1, colTitles[ i ].isNull() ? "" : (const char*)colTitles[ i ].toLatin1() );
- }
- }
- // title
- tblIntAttr->SetTitle( (const char*)myIntTable->getTableTitle().toLatin1() );
- }
- if ( myRealTable ) {
- builder->RemoveAttribute( myObject, "AttributeTableOfReal" );
- tblRealAttr = builder->FindOrCreateAttribute( myObject, "AttributeTableOfReal" );
+ int i;
+ int nbRows = myIntTable->getNumRows();
+ int nbCols = myIntTable->getNumCols();
+ QString tlt = myIntTable->getTableTitle();
+ QStringList rowTitles, colTitles, units;
+ myIntTable->getRowTitles( rowTitles );
+ myIntTable->getColTitles( colTitles );
+ myIntTable->getUnits( units );
+
+ if ( nbRows > 0) {
+ // data
+ int nRow = 0;
+ tblIntAttr->SetNbColumns( nbCols );
+ for ( i = 0; i < nbRows; i++ ) {
+ QStringList data;
+ myIntTable->getRowData( i, data );
+ bool bEmptyRow = true;
+ for ( int j = 0; j < data.count(); j++ ) {
+ if ( !data[ j ].isNull() ) {
+ tblIntAttr->PutValue( data[ j ].toInt(), nRow+1, j+1 );
+ bEmptyRow = false;
+ }
+ }
+ if ( !bEmptyRow ) { // Skip rows with no data !!!
+ // set row title
+ tblIntAttr->SetRowTitle( nRow+1, rowTitles[ i ].isNull() ? "" : (const char*)rowTitles[ i ].toLatin1() );
+ // set row unit
+ tblIntAttr->SetRowUnit( nRow+1, units[ i ].isNull() ? "" : (const char*)units[ i ].toLatin1() );
+ nRow++;
+ }
+ }
+ if ( nRow > 0 ) { // Set columns only if table is not empty, otherwise exception is raised !!!
+ // column titles
+ for ( i = 0; i < colTitles.count(); i++ )
+ tblIntAttr->SetColumnTitle( i+1, colTitles[ i ].isNull() ? "" : (const char*)colTitles[ i ].toLatin1() );
+ }
+ }
+ // title
+ tblIntAttr->SetTitle( (const char*)myIntTable->getTableTitle().toLatin1() );
+ }
+ if ( myRealTable ) {
+ builder->RemoveAttribute( myObject, "AttributeTableOfReal" );
+ tblRealAttr = builder->FindOrCreateAttribute( myObject, "AttributeTableOfReal" );
- int i;
- int nbRows = myRealTable->getNumRows();
- int nbCols = myRealTable->getNumCols();
- QString tlt = myRealTable->getTableTitle();
- QStringList rowTitles, colTitles, units;
- myRealTable->getRowTitles( rowTitles );
- myRealTable->getColTitles( colTitles );
- myRealTable->getUnits( units );
-
- if ( nbRows > 0) {
- // data
- int nRow = 0;
- tblRealAttr->SetNbColumns( nbCols );
- for ( i = 0; i < nbRows; i++ ) {
- QStringList data;
- myRealTable->getRowData( i, data );
- bool bEmptyRow = true;
- for ( int j = 0; j < data.count(); j++ ) {
- if ( !data[ j ].isNull() ) {
- tblRealAttr->PutValue( data[ j ].toDouble(), nRow+1, j+1 );
- bEmptyRow = false;
- }
- }
- if ( !bEmptyRow ) { // Skip rows with no data !!!
- // set row title
- tblRealAttr->SetRowTitle( nRow+1, rowTitles[ i ].isNull() ? "" : (const char*)rowTitles[ i ].toLatin1() );
- // set row unit
- tblRealAttr->SetRowUnit( nRow+1, units[ i ].isNull() ? "" : (const char*)units[ i ].toLatin1() );
- nRow++;
- }
- }
- if ( nRow > 0 ) { // Set columns only if table is not empty, otherwise exception is raised !!!
- // column titles
- for ( i = 0; i < colTitles.count(); i++ )
- tblRealAttr->SetColumnTitle( i+1, colTitles[ i ].isNull() ? "" : (const char*)colTitles[ i ].toLatin1() );
- }
- }
- // title
- tblRealAttr->SetTitle( (const char*)myRealTable->getTableTitle().toLatin1() );
- }
- if ( myIntTable || myRealTable)
- builder->CommitCommand(); // commit transaction !!!!!!!!!!!!!!!!!!!!!!!!!!!
- else
- builder->AbortCommand(); // abort transaction !!!!!!!!!!!!!!!!!!!!!!!!!!!
+ int i;
+ int nbRows = myRealTable->getNumRows();
+ int nbCols = myRealTable->getNumCols();
+ QString tlt = myRealTable->getTableTitle();
+ QStringList rowTitles, colTitles, units;
+ myRealTable->getRowTitles( rowTitles );
+ myRealTable->getColTitles( colTitles );
+ myRealTable->getUnits( units );
+
+ if ( nbRows > 0) {
+ // data
+ int nRow = 0;
+ tblRealAttr->SetNbColumns( nbCols );
+ for ( i = 0; i < nbRows; i++ ) {
+ QStringList data;
+ myRealTable->getRowData( i, data );
+ bool bEmptyRow = true;
+ for ( int j = 0; j < data.count(); j++ ) {
+ if ( !data[ j ].isNull() ) {
+ tblRealAttr->PutValue( data[ j ].toDouble(), nRow+1, j+1 );
+ bEmptyRow = false;
+ }
+ }
+ if ( !bEmptyRow ) { // Skip rows with no data !!!
+ // set row title
+ tblRealAttr->SetRowTitle( nRow+1, rowTitles[ i ].isNull() ? "" : (const char*)rowTitles[ i ].toLatin1() );
+ // set row unit
+ tblRealAttr->SetRowUnit( nRow+1, units[ i ].isNull() ? "" : (const char*)units[ i ].toLatin1() );
+ nRow++;
+ }
+ }
+ if ( nRow > 0 ) { // Set columns only if table is not empty, otherwise exception is raised !!!
+ // column titles
+ for ( i = 0; i < colTitles.count(); i++ )
+ tblRealAttr->SetColumnTitle( i+1, colTitles[ i ].isNull() ? "" : (const char*)colTitles[ i ].toLatin1() );
+ }
+ }
+ // title
+ tblRealAttr->SetTitle( (const char*)myRealTable->getTableTitle().toLatin1() );
+ }
+ if ( myIntTable || myRealTable)
+ builder->CommitCommand(); // commit transaction !!!!!!!!!!!!!!!!!!!!!!!!!!!
+ else
+ builder->AbortCommand(); // abort transaction !!!!!!!!!!!!!!!!!!!!!!!!!!!
}
catch( ... ) {
- MESSAGE("VisuGUI_TableDlg::onOK : Exception has been caught !!!");
- builder->AbortCommand(); // abort transaction !!!!!!!!!!!!!!!!!!!!!!!!!!!
- done = false;
- SUIT_MessageBox::critical ( this, tr("ERR_ERROR"), tr("ERR_APP_EXCEPTION") );
+ MESSAGE("VisuGUI_TableDlg::onOK : Exception has been caught !!!");
+ builder->AbortCommand(); // abort transaction !!!!!!!!!!!!!!!!!!!!!!!!!!!
+ done = false;
+ SUIT_MessageBox::critical ( this, tr("ERR_ERROR"), tr("ERR_APP_EXCEPTION") );
}
}
}
if (app)
app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"),
QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
// Table of integer
if ( tblIntAttr && myIntTable ) {
try {
- // title
- myIntTable->setTableTitle( tblIntAttr->GetTitle().c_str() );
- // nb of rows & cols
- int nbRows = tblIntAttr->GetNbRows() ;
- int nbCols = tblIntAttr->GetNbColumns();
- myIntTable->setNumRows( nbRows );
- myIntTable->setNumCols( nbCols );
- // rows titles
- QStringList strlist;
- vector<string> rowTitles = tblIntAttr->GetRowTitles();
- for ( i = 0; i < nbRows; i++ ) {
- if ( rowTitles.size() > 0 )
- strlist.append( rowTitles[i].c_str() );
- else
- strlist.append( "" );
- }
- myIntTable->setRowTitles( strlist );
- // columns titles
- strlist.clear();
- vector<string> colTitles = tblIntAttr->GetColumnTitles();
- for ( i = 0; i < nbCols; i++ ) {
- if ( colTitles.size() > 0 )
- strlist.append( colTitles[i].c_str() );
- else
- strlist.append( "" );
- }
- myIntTable->setColTitles( strlist );
- // units
- strlist.clear();
- vector<string> rowUnits = tblIntAttr->GetRowUnits();
- if ( rowUnits.size() > 0 ) {
- for ( i = 0; i < nbRows; i++ )
- strlist.append( rowUnits[i].c_str() );
- myIntTable->setUnits( strlist );
- }
- // data
- for ( i = 1; i <= nbRows; i++ ) {
- strlist.clear();
- for ( j = 1; j <= nbCols; j++ ) {
- if ( tblIntAttr->HasValue( i, j ) )
- strlist.append( QString::number( tblIntAttr->GetValue( i, j ) ) );
- else
- strlist.append( QString::null );
- }
- myIntTable->setRowData( i-1, strlist );
- }
- myIntTable->adjustTable();
+ // title
+ myIntTable->setTableTitle( tblIntAttr->GetTitle().c_str() );
+ // nb of rows & cols
+ int nbRows = tblIntAttr->GetNbRows() ;
+ int nbCols = tblIntAttr->GetNbColumns();
+ myIntTable->setNumRows( nbRows );
+ myIntTable->setNumCols( nbCols );
+ // rows titles
+ QStringList strlist;
+ vector<string> rowTitles = tblIntAttr->GetRowTitles();
+ for ( i = 0; i < nbRows; i++ ) {
+ if ( rowTitles.size() > 0 )
+ strlist.append( rowTitles[i].c_str() );
+ else
+ strlist.append( "" );
+ }
+ myIntTable->setRowTitles( strlist );
+ // columns titles
+ strlist.clear();
+ vector<string> colTitles = tblIntAttr->GetColumnTitles();
+ for ( i = 0; i < nbCols; i++ ) {
+ if ( colTitles.size() > 0 )
+ strlist.append( colTitles[i].c_str() );
+ else
+ strlist.append( "" );
+ }
+ myIntTable->setColTitles( strlist );
+ // units
+ strlist.clear();
+ vector<string> rowUnits = tblIntAttr->GetRowUnits();
+ if ( rowUnits.size() > 0 ) {
+ for ( i = 0; i < nbRows; i++ )
+ strlist.append( rowUnits[i].c_str() );
+ myIntTable->setUnits( strlist );
+ }
+ // data
+ for ( i = 1; i <= nbRows; i++ ) {
+ strlist.clear();
+ for ( j = 1; j <= nbCols; j++ ) {
+ if ( tblIntAttr->HasValue( i, j ) )
+ strlist.append( QString::number( tblIntAttr->GetValue( i, j ) ) );
+ else
+ strlist.append( QString::null );
+ }
+ myIntTable->setRowData( i-1, strlist );
+ }
+ myIntTable->adjustTable();
}
catch( ... ) {
- MESSAGE("VisuGUI_TableDlg::initDlg : Exception has been caught !!!");
+ MESSAGE("VisuGUI_TableDlg::initDlg : Exception has been caught !!!");
}
}
// Table of real
if ( tblRealAttr && myRealTable ) {
try {
- // title
- myRealTable->setTableTitle( tblRealAttr->GetTitle().c_str() );
- // nb of rows & cols
- int nbRows = tblRealAttr->GetNbRows() ;
- int nbCols = tblRealAttr->GetNbColumns();
- myRealTable->setNumRows( nbRows );
- myRealTable->setNumCols( nbCols );
- // rows titles
- QStringList strlist;
- vector<string> rowTitles = tblRealAttr->GetRowTitles();
- for ( i = 0; i < nbRows; i++ ) {
- if ( rowTitles.size() > 0 )
- strlist.append( rowTitles[i].c_str() );
- else
- strlist.append( "" );
- }
- myRealTable->setRowTitles( strlist );
- // columns titles
- strlist.clear();
- vector<string> colTitles = tblRealAttr->GetColumnTitles();
- for ( i = 0; i < nbCols; i++ ) {
- if ( colTitles.size() > 0 )
- strlist.append( colTitles[i].c_str() );
- else
- strlist.append( "" );
- }
- myRealTable->setColTitles( strlist );
- // units
- strlist.clear();
- vector<string> rowUnits = tblRealAttr->GetRowUnits();
- if ( rowUnits.size() > 0 ) {
- for ( i = 0; i < nbRows; i++ )
- strlist.append( rowUnits[i].c_str() );
- myRealTable->setUnits( strlist );
- }
+ // title
+ myRealTable->setTableTitle( tblRealAttr->GetTitle().c_str() );
+ // nb of rows & cols
+ int nbRows = tblRealAttr->GetNbRows() ;
+ int nbCols = tblRealAttr->GetNbColumns();
+ myRealTable->setNumRows( nbRows );
+ myRealTable->setNumCols( nbCols );
+ // rows titles
+ QStringList strlist;
+ vector<string> rowTitles = tblRealAttr->GetRowTitles();
+ for ( i = 0; i < nbRows; i++ ) {
+ if ( rowTitles.size() > 0 )
+ strlist.append( rowTitles[i].c_str() );
+ else
+ strlist.append( "" );
+ }
+ myRealTable->setRowTitles( strlist );
+ // columns titles
+ strlist.clear();
+ vector<string> colTitles = tblRealAttr->GetColumnTitles();
+ for ( i = 0; i < nbCols; i++ ) {
+ if ( colTitles.size() > 0 )
+ strlist.append( colTitles[i].c_str() );
+ else
+ strlist.append( "" );
+ }
+ myRealTable->setColTitles( strlist );
+ // units
+ strlist.clear();
+ vector<string> rowUnits = tblRealAttr->GetRowUnits();
+ if ( rowUnits.size() > 0 ) {
+ for ( i = 0; i < nbRows; i++ )
+ strlist.append( rowUnits[i].c_str() );
+ myRealTable->setUnits( strlist );
+ }
// data
- for ( i = 1; i <= nbRows; i++ ) {
- strlist.clear();
- for ( j = 1; j <= nbCols; j++ ) {
- if ( tblRealAttr->HasValue( i, j ) )
- strlist.append( QString::number( tblRealAttr->GetValue( i, j ) ) );
- else
- strlist.append( QString::null );
- }
- myRealTable->setRowData( i-1, strlist );
- }
- myRealTable->adjustTable();
+ for ( i = 1; i <= nbRows; i++ ) {
+ strlist.clear();
+ for ( j = 1; j <= nbCols; j++ ) {
+ if ( tblRealAttr->HasValue( i, j ) )
+ strlist.append( QString::number( tblRealAttr->GetValue( i, j ) ) );
+ else
+ strlist.append( QString::null );
+ }
+ myRealTable->setRowData( i-1, strlist );
+ }
+ myRealTable->adjustTable();
}
catch( ... ) {
- MESSAGE("VisuGUI_TableDlg::initDlg : Exception has been caught !!!");
+ MESSAGE("VisuGUI_TableDlg::initDlg : Exception has been caught !!!");
}
}
}
Constructor
*/
VisuGUI_TableWidget::VisuGUI_TableWidget( QWidget* parent,
- const char* name,
- bool edit,
- Qt::Orientation orient,
- bool showColumnTitles )
+ const char* name,
+ bool edit,
+ Qt::Orientation orient,
+ bool showColumnTitles )
: QWidget( parent ), myOrientation( orient )
{
QGridLayout* mainLayout = new QGridLayout( this );
QTableSelection ts = myTable->selection( i );
for ( int j = ts.topRow(); j < ts.bottomRow()+1; j++) {
for ( int k = ts.leftCol(); k < ts.rightCol()+1; k++) {
- if ( myTable->item( j, k ) )
- bCT = true;
+ if ( myTable->item( j, k ) )
+ bCT = true;
}
}
}*/
QTableSelection ts = myTable->selection( i );
for ( int j = ts.topRow(); j < ts.bottomRow()+1; j++) {
if ( myOrientation == Qt::Vertical && j == 0 ) {
-// continue; // UNITS
+// continue; // UNITS
}
for ( int k = ts.leftCol(); k < ts.rightCol()+1; k++) {
- if ( myOrientation == Qt::Horizontal && k == 0 ) {
-// continue; // UNITS
- }
- myTable->clearCell( j, k );
+ if ( myOrientation == Qt::Horizontal && k == 0 ) {
+// continue; // UNITS
+ }
+ myTable->clearCell( j, k );
}
}
}
/*QMouseEvent* me = ( QMouseEvent* )e;
if ( me->button() == Qt::LeftButton && (myTable->editTriggers() != QAbstractItemView::NoEditTriggers ) ) {
if ( o == myTable->horizontalHeader() ) {
- for ( int i = 0; i < myTable->horizontalHeader()->count(); i++ ) {
- QRect rect = myTable->horizontalHeader()->sectionRect( i );
- rect.addCoords( 1, 1, -1, -1 );
- if ( rect.contains( myTable->horizontalHeader()->mapFromGlobal( me->globalPos() ) ) ) {
- if ( myOrientation == Qt::Vertical || i != 0 ) {
- bool bOk;
- QString tlt = QInputDialog::getText( tr( "SET_TITLE_TLT" ),
- tr( "TITLE_LBL" ),
- QLineEdit::Normal,
- myTable->horizontalHeader()->label( i ),
- &bOk,
- this );
- if ( bOk && !tlt.isNull() )
- myTable->horizontalHeader()->setLabel( i, tlt );
- break;
- }
- }
- }
+ for ( int i = 0; i < myTable->horizontalHeader()->count(); i++ ) {
+ QRect rect = myTable->horizontalHeader()->sectionRect( i );
+ rect.addCoords( 1, 1, -1, -1 );
+ if ( rect.contains( myTable->horizontalHeader()->mapFromGlobal( me->globalPos() ) ) ) {
+ if ( myOrientation == Qt::Vertical || i != 0 ) {
+ bool bOk;
+ QString tlt = QInputDialog::getText( tr( "SET_TITLE_TLT" ),
+ tr( "TITLE_LBL" ),
+ QLineEdit::Normal,
+ myTable->horizontalHeader()->label( i ),
+ &bOk,
+ this );
+ if ( bOk && !tlt.isNull() )
+ myTable->horizontalHeader()->setLabel( i, tlt );
+ break;
+ }
+ }
+ }
}
if ( o == myTable->verticalHeader() ) {
- for ( int i = 0; i < myTable->verticalHeader()->count(); i++ ) {
- QRect rect = myTable->verticalHeader()->sectionRect( i );
- rect.addCoords( 1, 1, -1, -1 );
- if ( rect.contains( myTable->verticalHeader()->mapFromGlobal( me->globalPos() ) ) ) {
- if ( myOrientation == Qt::Horizontal || i != 0 ) {
- bool bOk;
- QString tlt = QInputDialog::getText( tr( "SET_TITLE_TLT" ),
- tr( "TITLE_LBL" ),
- QLineEdit::Normal,
- myTable->verticalHeader()->label( i ),
- &bOk,
- this );
- if ( bOk && !tlt.isNull() )
- myTable->verticalHeader()->setLabel( i, tlt );
- break;
- }
- }
- }
+ for ( int i = 0; i < myTable->verticalHeader()->count(); i++ ) {
+ QRect rect = myTable->verticalHeader()->sectionRect( i );
+ rect.addCoords( 1, 1, -1, -1 );
+ if ( rect.contains( myTable->verticalHeader()->mapFromGlobal( me->globalPos() ) ) ) {
+ if ( myOrientation == Qt::Horizontal || i != 0 ) {
+ bool bOk;
+ QString tlt = QInputDialog::getText( tr( "SET_TITLE_TLT" ),
+ tr( "TITLE_LBL" ),
+ QLineEdit::Normal,
+ myTable->verticalHeader()->label( i ),
+ &bOk,
+ this );
+ if ( bOk && !tlt.isNull() )
+ myTable->verticalHeader()->setLabel( i, tlt );
+ break;
+ }
+ }
+ }
}
}*/
}
int j = myTable->currentColumn() - 1;
if ( j < 0 ) { j = myTable->columnCount()-1; i--; }
if ( i >= 0 && j >= 0 )
- myTable->setCurrentCell( i, j );
+ myTable->setCurrentCell( i, j );
}
}
return QWidget::eventFilter( o, e );
enum { ttNone, ttInt, ttReal, ttBoth, ttAuto };
VisuGUI_TableDlg( QWidget* parent,
- _PTR(SObject) obj,
- bool edit = false,
- int which = ttAuto,
- Qt::Orientation orient = Qt::Horizontal,
- bool showColumnTitles = true );
+ _PTR(SObject) obj,
+ bool edit = false,
+ int which = ttAuto,
+ Qt::Orientation orient = Qt::Horizontal,
+ bool showColumnTitles = true );
~VisuGUI_TableDlg();
private:
Q_OBJECT
public:
VisuGUI_TableWidget( QWidget* parent = 0,
- const char* name = 0,
- bool edit = false,
- Qt::Orientation orient = Qt::Horizontal,
- bool showColumnTitles = true );
+ const char* name = 0,
+ bool edit = false,
+ Qt::Orientation orient = Qt::Horizontal,
+ bool showColumnTitles = true );
~VisuGUI_TableWidget();
void setTableTitle( const QString& title );
virtual ~NumDelegateItem();
virtual QWidget * createEditor( QWidget * parent,
- const QStyleOptionViewItem & option,
- const QModelIndex & index ) const;
+ const QStyleOptionViewItem & option,
+ const QModelIndex & index ) const;
virtual void setEditorData( QWidget * editor,
- const QModelIndex & index ) const;
+ const QModelIndex & index ) const;
private:
int myMode;
};
virtual
void
GetFeatureEdgesFlags(bool& theIsFeatureEdges,
- bool& theIsBoundaryEdges,
- bool& theIsManifoldEdges,
- bool& theIsNonManifoldEdges);
+ bool& theIsBoundaryEdges,
+ bool& theIsManifoldEdges,
+ bool& theIsNonManifoldEdges);
virtual
void
SetFeatureEdgesFlags(bool theIsFeatureEdges,
- bool theIsBoundaryEdges,
- bool theIsManifoldEdges,
- bool theIsNonManifoldEdges);
+ bool theIsBoundaryEdges,
+ bool theIsManifoldEdges,
+ bool theIsNonManifoldEdges);
virtual
bool
virtual
bool
PreHighlight(vtkInteractorStyle* theInteractorStyle,
- SVTK_SelectionEvent* theSelectionEvent,
- bool theIsHighlight);
+ SVTK_SelectionEvent* theSelectionEvent,
+ bool theIsHighlight);
//! To process highlight (called from #SVTK_InteractorStyle)
virtual
bool
Highlight(vtkInteractorStyle* theInteractorStyle,
- SVTK_SelectionEvent* theSelectionEvent,
- bool theIsHighlight);
+ SVTK_SelectionEvent* theSelectionEvent,
+ bool theIsHighlight);
//! Internal highlight.
virtual
static
void
ProcessEvents(vtkObject* theObject,
- unsigned long theEvent,
- void* theClientData,
- void* theCallData);
+ unsigned long theEvent,
+ void* theClientData,
+ void* theCallData);
//----------------------------------------------------------------------------
private:
if(theActorFactory)
myDestroySignal.connect(boost::bind(&TActorFactory::RemoveActor,
- theActorFactory,
- _1));
+ theActorFactory,
+ _1));
myActorFactory = theActorFactory;
}
{
bool
CheckIsSameValue(vtkFloatingPointType theTarget,
- vtkFloatingPointType theSource)
+ vtkFloatingPointType theSource)
{
static vtkFloatingPointType TOL = 10.0 / VTK_LARGE_FLOAT;
return fabs(theTarget - theSource) < TOL;
bool
CheckIsSameVector(vtkFloatingPointType* theTarget,
- vtkFloatingPointType* theSource,
- size_t theLength)
+ vtkFloatingPointType* theSource,
+ size_t theLength)
{
for ( size_t anId = 0; anId < theLength; anId++ ) {
if ( !CheckIsSameValue( theTarget[ anId ], theSource[ anId ] ) )
- return false;
+ return false;
}
return true;
if( VISU_PickingSettings* aPickingSettings = VISU_PickingSettings::Get() )
aPickingSettings->AddObserver(VISU::UpdatePickingSettingsEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
}
VISU_GaussPtsAct
if(theWidgetCtrl){
theWidgetCtrl->AddObserver(vtkCommand::EnableEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
theWidgetCtrl->AddObserver(vtkCommand::DisableEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
theWidgetCtrl->AddObserver(vtkCommand::StartInteractionEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
theWidgetCtrl->AddObserver(vtkCommand::EndInteractionEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
}
myWidgetCtrl = theWidgetCtrl;
inline
vtkFloatingPointType
GetRadius(vtkIdType theVTKID,
- vtkDataArray *theScalarArray,
- VISU_GaussPointsPL* theGaussPointsPL)
+ vtkDataArray *theScalarArray,
+ VISU_GaussPointsPL* theGaussPointsPL)
{
vtkFloatingPointType aRadius = 0.5;
if(theGaussPointsPL->GetPointSpriteMapper()->GetPointSpriteMode() == 1) // Geometry mode
else if(theGaussPointsPL->GetBicolor()){
vtkFloatingPointType aVal = theScalarArray->GetTuple1(theVTKID);
if(aVal > 0.0)
- aRadius *= theGaussPointsPL->GetMaxSize();
+ aRadius *= theGaussPointsPL->GetMaxSize();
else
- aRadius *= theGaussPointsPL->GetMinSize();
+ aRadius *= theGaussPointsPL->GetMinSize();
aRadius *= theGaussPointsPL->GetAverageCellSize();
}else
aRadius *= theGaussPointsPL->GetPointSize(theVTKID,theScalarArray);
vtkFloatingPointType
VISU_GaussPtsAct
::GetRadius(vtkIdType theObjID,
- vtkIdType theVTKID,
- vtkDataArray *theScalarArray)
+ vtkIdType theVTKID,
+ vtkDataArray *theScalarArray)
{
return ::GetRadius(theVTKID,theScalarArray,myDeviceActor->GetPipeLine());
}
using namespace VISU;
myGaussPtsActorFactory = dynamic_cast<TGaussPtsActorFactory*>(theActorFactory);
myUpdatePrs3dSignal.connect(boost::bind(&TGaussPtsActorFactory::UpdateFromActor,
- myGaussPtsActorFactory,
- _1));
+ myGaussPtsActorFactory,
+ _1));
Superclass::SetFactory(theActorFactory);
}
if(theInteractor){
theInteractor->AddObserver(vtkCommand::CharEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
theInteractor->AddObserver(VISU::SetSMDecreaseMagnificationEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
theInteractor->AddObserver(VISU::SetSMIncreaseMagnificationEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
}
Superclass::SetInteractor(theInteractor);
void
VISU_GaussPtsAct
::ProcessEvents(vtkObject* vtkNotUsed(theObject),
- unsigned long theEvent,
- void* theClientData,
- void* vtkNotUsed(theCallData))
+ unsigned long theEvent,
+ void* theClientData,
+ void* vtkNotUsed(theCallData))
{
if(vtkObject* anObject = reinterpret_cast<vtkObject*>(theClientData))
if(VISU_GaussPtsAct* self = dynamic_cast<VISU_GaussPtsAct*>(anObject)) {
if(theEvent == VISU::UpdateInsideSettingsEvent)
- self->UpdateInsideCursorSettings();
+ self->UpdateInsideCursorSettings();
else
- self->OnInteractorEvent(theEvent);
+ self->OnInteractorEvent(theEvent);
}
}
{
if( IsSegmentationEnabled() )
{
- this->ChangeMagnification( myInteractor->GetShiftKey() );
- return;
+ this->ChangeMagnification( myInteractor->GetShiftKey() );
+ return;
}
myChangeMagnification = myInteractor->GetShiftKey();
{
if( IsSegmentationEnabled() && myWidgetCtrl->IsSphereActive() )
{
- VISU_SphereWidget* aSphereWidget = myWidgetCtrl->GetSphereWidget();
- aSphereWidget->ChangeRadius( myInteractor->GetShiftKey() );
- myWidgetCtrl->InvokeEvent(vtkCommand::EndInteractionEvent,NULL);
- myWidgetCtrl->GetInteractor()->Render();
+ VISU_SphereWidget* aSphereWidget = myWidgetCtrl->GetSphereWidget();
+ aSphereWidget->ChangeRadius( myInteractor->GetShiftKey() );
+ myWidgetCtrl->InvokeEvent(vtkCommand::EndInteractionEvent,NULL);
+ myWidgetCtrl->GetInteractor()->Render();
}
return;
}
if(Superclass::GetPickable()){
if(vtkMapper* aMapper = GetMapper()){
if(vtkDataSet* aDataSet= aMapper->GetInput()){
- aDataSet->Update();
- return aDataSet->GetNumberOfCells() > 0;
+ aDataSet->Update();
+ return aDataSet->GetNumberOfCells() > 0;
}
}
}
bool
VISU_GaussPtsAct
::PreHighlight(vtkInteractorStyle* theInteractorStyle,
- SVTK_SelectionEvent* theSelectionEvent,
- bool theIsHighlight)
+ SVTK_SelectionEvent* theSelectionEvent,
+ bool theIsHighlight)
{
if ( !GetPickable() )
return false;
if(aSelectionMode == ActorSelection || !theIsHighlight)
return Superclass::PreHighlight(theInteractorStyle,
- theSelectionEvent,
- theIsHighlight);
+ theSelectionEvent,
+ theIsHighlight);
bool anIsChanged = (mySelectionMode != aSelectionMode);
bool anIsPreselected = myIsPreselected;
if(aSelectionMode == GaussPointSelection && theIsHighlight){
myPointPicker->Pick(theSelectionEvent->myX,
- theSelectionEvent->myY,
- 0.0,
- theInteractorStyle->GetCurrentRenderer());
+ theSelectionEvent->myY,
+ 0.0,
+ theInteractorStyle->GetCurrentRenderer());
if(myPointPicker->GetActor() != this)
return (anIsPreselected != myIsPreselected);
vtkIdType anObjId = GetNodeObjId( aVtkId );
myIsPreselected = (anObjId >= 0);
if(myIsPreselected){
- anIsChanged = (myLastPreHighlightObjID != anObjId);
- if(anIsChanged){
- vtkFloatingPointType* aNodeCoord = GetNodeCoord(anObjId);
+ anIsChanged = (myLastPreHighlightObjID != anObjId);
+ if(anIsChanged){
+ vtkFloatingPointType* aNodeCoord = GetNodeCoord(anObjId);
//Take into account translation
vtkFloatingPointType aLocalNodeCoord[3];
this->Transform->Push();
aLocalNodeCoord[1] = aNodeCoord[1] + aPosition[1];
aLocalNodeCoord[2] = aNodeCoord[2] + aPosition[2];
- vtkDataSet* aDataSet = GetInput();
- vtkPointData* aPointData = aDataSet->GetPointData();
- if(vtkDataArray *aScalarArray = aPointData->GetScalars()){
- vtkFloatingPointType aPyramidHeight = aPickingSettings->GetPyramidHeight();
- aPyramidHeight = aPyramidHeight*myGaussPointsPL->GetMaxPointSize();
- //vtkFloatingPointType aColor[3] = myPreHighlightActor->GetProperty()->GetColor();
- vtkFloatingPointType aColor[3];
- theInteractorStyle->GetCurrentRenderer()->GetBackground( aColor );
- aColor[0] = 1. - aColor[0];
- aColor[1] = 1. - aColor[1];
- aColor[2] = 1. - aColor[2];
-
- myCursorPyramid->Init(aPyramidHeight,
- aPickingSettings->GetCursorSize(),
- GetRadius(anObjId,aVtkId,aScalarArray),
- GetMagnification(anObjId),
- GetClamp(anObjId),
- aNodeCoord,
- aColor);
- }
+ vtkDataSet* aDataSet = GetInput();
+ vtkPointData* aPointData = aDataSet->GetPointData();
+ if(vtkDataArray *aScalarArray = aPointData->GetScalars()){
+ vtkFloatingPointType aPyramidHeight = aPickingSettings->GetPyramidHeight();
+ aPyramidHeight = aPyramidHeight*myGaussPointsPL->GetMaxPointSize();
+ //vtkFloatingPointType aColor[3] = myPreHighlightActor->GetProperty()->GetColor();
+ vtkFloatingPointType aColor[3];
+ theInteractorStyle->GetCurrentRenderer()->GetBackground( aColor );
+ aColor[0] = 1. - aColor[0];
+ aColor[1] = 1. - aColor[1];
+ aColor[2] = 1. - aColor[2];
+
+ myCursorPyramid->Init(aPyramidHeight,
+ aPickingSettings->GetCursorSize(),
+ GetRadius(anObjId,aVtkId,aScalarArray),
+ GetMagnification(anObjId),
+ GetClamp(anObjId),
+ aNodeCoord,
+ aColor);
+ }
this->Transform->Pop();
- myLastPreHighlightObjID = anObjId;
- }
- myCursorPyramid->SetVisibility(true);
+ myLastPreHighlightObjID = anObjId;
+ }
+ myCursorPyramid->SetVisibility(true);
}
}
}
inline
void
ChangeZoom(VISU_PickingSettings *thePickingSettings,
- vtkRenderer* theRenderer,
- vtkIdType theInitialHasIndex,
- vtkIdType theCurrentHasIndex)
+ vtkRenderer* theRenderer,
+ vtkIdType theInitialHasIndex,
+ vtkIdType theCurrentHasIndex)
{
if( (theInitialHasIndex + theCurrentHasIndex == 1) && thePickingSettings){
vtkCamera *aCamera = theRenderer->GetActiveCamera();
bool
VISU_GaussPtsAct
::Highlight(vtkInteractorStyle* theInteractorStyle,
- SVTK_SelectionEvent* theSelectionEvent,
- bool theIsHighlight)
+ SVTK_SelectionEvent* theSelectionEvent,
+ bool theIsHighlight)
{
if ( !GetPickable() )
return false;
mySelector->RemoveIObject(anIO);
/* ChangeZoom(myPickingSettings,
- theInteractorStyle,
- anInitialHasIndex,
- false,
- anIO);*/
+ theInteractorStyle,
+ anInitialHasIndex,
+ false,
+ anIO);*/
return true;
}
if(aSelectionMode == ActorSelection)
return Superclass::Highlight(theInteractorStyle,
- theSelectionEvent,
- theIsHighlight);
+ theSelectionEvent,
+ theIsHighlight);
if(aSelectionMode == GaussPointSelection && !theSelectionEvent->myIsRectangle){
vtkRenderer *aRenderer = theInteractorStyle->GetCurrentRenderer();
myPointPicker->Pick(theSelectionEvent->myX,
- theSelectionEvent->myY,
- 0.0,
- aRenderer);
+ theSelectionEvent->myY,
+ 0.0,
+ aRenderer);
if(myPointPicker->GetActor() != this) {
mySelector->ClearIObjects();
/* ChangeZoom(myPickingSettings,
- theInteractorStyle,
- anInitialHasIndex,
- false,
- anIO);*/
+ theInteractorStyle,
+ anInitialHasIndex,
+ false,
+ anIO);*/
return true;
}
if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId, true ) && hasIO()) {
vtkIdType anObjId = GetNodeObjId( aVtkId );
if(anObjId >= 0){
- // myIsHighlighted = true;
- // Update the Selector
- if(mySelector->IsSelected(myIO))
- mySelector->AddOrRemoveIndex(myIO,anObjId,theSelectionEvent->myIsShift);
- else{
- if(!theSelectionEvent->myIsShift){
- mySelector->ClearIObjects();
- }
- mySelector->AddOrRemoveIndex(myIO,anObjId,theSelectionEvent->myIsShift);
- mySelector->AddIObject(this);
- }
- /*
- vtkFloatingPointType* aNodeCoord = GetNodeCoord(anObjId);
- //
- // FlyTo
- vtkRenderWindowInteractor* anInteractor = theInteractorStyle->GetInteractor();
- vtkFloatingPointType aDollyWas = anInteractor->GetDolly();
- int aNumberOfFlyFramesWas = anInteractor->GetNumberOfFlyFrames();
-
- anInteractor->SetDolly(0.);
- anInteractor->SetNumberOfFlyFrames(myPickingSettings->GetStepNumber());
- anInteractor->FlyTo(aRenderer,aNodeCoord);
- aRenderer->ResetCameraClippingRange();
- anInteractor->SetDolly(aDollyWas);
- anInteractor->SetNumberOfFlyFrames(aNumberOfFlyFramesWas);
-
- anInteractor->InvokeEvent(SVTK::ChangeRotationPoint, aNodeCoord);*/
-
- mySelectionMode = aSelectionMode;
-
- /* ChangeZoom(myPickingSettings,
- theInteractorStyle,
- anInitialHasIndex,
- true,
- anIO);*/
-
- return true;
+ // myIsHighlighted = true;
+ // Update the Selector
+ if(mySelector->IsSelected(myIO))
+ mySelector->AddOrRemoveIndex(myIO,anObjId,theSelectionEvent->myIsShift);
+ else{
+ if(!theSelectionEvent->myIsShift){
+ mySelector->ClearIObjects();
+ }
+ mySelector->AddOrRemoveIndex(myIO,anObjId,theSelectionEvent->myIsShift);
+ mySelector->AddIObject(this);
+ }
+ /*
+ vtkFloatingPointType* aNodeCoord = GetNodeCoord(anObjId);
+ //
+ // FlyTo
+ vtkRenderWindowInteractor* anInteractor = theInteractorStyle->GetInteractor();
+ vtkFloatingPointType aDollyWas = anInteractor->GetDolly();
+ int aNumberOfFlyFramesWas = anInteractor->GetNumberOfFlyFrames();
+
+ anInteractor->SetDolly(0.);
+ anInteractor->SetNumberOfFlyFrames(myPickingSettings->GetStepNumber());
+ anInteractor->FlyTo(aRenderer,aNodeCoord);
+ aRenderer->ResetCameraClippingRange();
+ anInteractor->SetDolly(aDollyWas);
+ anInteractor->SetNumberOfFlyFrames(aNumberOfFlyFramesWas);
+
+ anInteractor->InvokeEvent(SVTK::ChangeRotationPoint, aNodeCoord);*/
+
+ mySelectionMode = aSelectionMode;
+
+ /* ChangeZoom(myPickingSettings,
+ theInteractorStyle,
+ anInitialHasIndex,
+ true,
+ anIO);*/
+
+ return true;
}// if( anObjId >= 0 ) {
}//if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId, true ) && hasIO())
}//if(!theSelectionEvent->myIsRectangle){
/* ChangeZoom(myPickingSettings,
- theInteractorStyle,
- anInitialHasIndex,
- false,
- anIO);*/
+ theInteractorStyle,
+ anInitialHasIndex,
+ false,
+ anIO);*/
return false;
}
if( GetVisibility() && aPickingSettings->GetCameraMovementEnabled() )
{
ChangeZoom(aPickingSettings,
- GetRenderer(),
- anInitialHasIndex,
- aCurrentHasIndex);
+ GetRenderer(),
+ anInitialHasIndex,
+ aCurrentHasIndex);
}
if( aSelectionMode == ActorSelection ) {
// Zoom if necessary
// ChangeZoom(myPickingSettings,
-// GetRenderer(),
-// anInitialHasIndex,
-// aCurrentHasIndex);
+// GetRenderer(),
+// anInitialHasIndex,
+// aCurrentHasIndex);
// TColStd_IndexedMapOfInteger aMapIndex;
mySelector->GetIndex( getIO(), aMapIndex );
vtkFloatingPointType aPyramidHeight = aPickingSettings->GetPyramidHeight();
aPyramidHeight = aPyramidHeight*myGaussPointsPL->GetMaxPointSize();
myCursorPyramidSelected->Init(aPyramidHeight,
- aPickingSettings->GetCursorSize(),
- GetRadius(anObjId,aVtkId,aScalarArray),
- GetMagnification(anObjId),
- GetClamp(anObjId),
- aLocalNodeCoord,
- myHighlightActor->GetProperty()->GetColor());
+ aPickingSettings->GetCursorSize(),
+ GetRadius(anObjId,aVtkId,aScalarArray),
+ GetMagnification(anObjId),
+ GetClamp(anObjId),
+ aLocalNodeCoord,
+ myHighlightActor->GetProperty()->GetColor());
myCursorPyramidSelected->SetVisibility(anIsVisible && theIsHighlight);
//
const VISU::PGaussPtsIDMapper& aGaussPtsIDMapper =
- myGaussPointsPL->GetGaussPtsIDMapper();
+ myGaussPointsPL->GetGaussPtsIDMapper();
VISU::TNamedIDMapper* aParent = aGaussPtsIDMapper->GetParent();
VISU::TGaussPointID aGaussPointID = myGaussPointsPL->GetObjID(anObjId);
aStr<<"\nParentCellID: "<<aCellID;
std::string aParentName = aParent->GetElemName(aCellID);
if(aParentName != "") {
- aStr<<"\nParentCellName: '"<<aParentName<<"'";
+ aStr<<"\nParentCellName: '"<<aParentName<<"'";
}
aStr<<"\nLocalPntID: "<<aLocalPntID;
aStr<<"\nScalar: "<<aVal;
aStr<<"\nData: {";
int anId = 0;
while(anId < aNbComp){
- vtkFloatingPointType aComp = aTuple[anId++];
- aStr<<aComp;
- if(anId < aNbComp)
- aStr<<"; ";
+ vtkFloatingPointType aComp = aTuple[anId++];
+ aStr<<aComp;
+ if(anId < aNbComp)
+ aStr<<"; ";
}
aStr<<"}";
}
vtkIdType aNbPoints = aCellPoints->GetNumberOfIds();
for (vtkIdType i = 0; i < aNbPoints; i++) {
- aCellDataSet->GetPointCells(aCellPoints->GetId(i), aPointCells);
+ aCellDataSet->GetPointCells(aCellPoints->GetId(i), aPointCells);
- // add cell ids
- vtkIdType aNbCells = aPointCells->GetNumberOfIds();
- for (vtkIdType j = 0; j < aNbCells; j++)
- aNeighbourCells->InsertUniqueId(aPointCells->GetId(j));
+ // add cell ids
+ vtkIdType aNbCells = aPointCells->GetNumberOfIds();
+ for (vtkIdType j = 0; j < aNbCells; j++)
+ aNeighbourCells->InsertUniqueId(aPointCells->GetId(j));
}
aPointCells->Delete();
// get vector data
vtkDataArray* anInputVectors = aDataSetAttributes->GetVectors();
if (!anInputVectors)
- return;
+ return;
// insert neighbour cells to the special dataset
vtkUnstructuredGrid *aCellsToWarp = vtkUnstructuredGrid::New();
std::vector<vtkFloatingPointType> aTuple(aNbComp);
for (vtkIdType i = 0; i < aNbNeighbourCells; i++) {
- vtkIdType aVTKCellId = aNeighbourCells->GetId(i);
- vtkIdType anObjCellId = aParent->GetElemObjID(aVTKCellId);
-
- vtkCell* aCurCell = aParent->GetElemCell(anObjCellId);
-
- vtkIdType aNewCellId = aCellsToWarp->InsertNextCell(aCurCell->GetCellType(), aCurCell->GetPointIds());
-
- // get gauss points corresponding to the current cell
- vtkIdType aPointVtkId = -1;
- vtkIdType aLocalPntId = 0;
- aPointVtkId = aGaussPtsIDMapper->GetVTKID(VISU::TGaussPointID(anObjCellId, aLocalPntId));
-
- if (aPointVtkId >= 0) {
- // Compute average vector
- aCellVectors->Reset();
- while (aPointVtkId >= 0) {
- anInputVectors->GetTuple(aPointVtkId, &aTuple[0]);
-
- if (aNbComp >= 3)
- aCellVectors->InsertNextTuple3(aTuple[0], aTuple[1], aTuple[2]);
- else if (aNbComp == 2)
- aCellVectors->InsertNextTuple3(aTuple[0], aTuple[1], 0);
- else if (aNbComp == 1)
- aCellVectors->InsertNextTuple3(aTuple[0], 0, 0);
-
- aPointVtkId = aGaussPtsIDMapper->GetVTKID(VISU::TGaussPointID(anObjCellId, ++aLocalPntId));
- }
-
- double aXCoord = 0, anYCoord = 0, aZCoord = 0;
-
- vtkIdType aNbVectors = aCellVectors->GetNumberOfTuples();
-
- for (vtkIdType aVecId = 0; aVecId < aNbVectors; aVecId++) {
- aXCoord += aCellVectors->GetComponent(aVecId, 0);
- anYCoord += aCellVectors->GetComponent(aVecId, 1);
- aZCoord += aCellVectors->GetComponent(aVecId, 2);
- }
-
- aXCoord = aXCoord / aNbVectors;
- anYCoord = anYCoord / aNbVectors;
- aZCoord = aZCoord / aNbVectors;
-
- // set vector data for the cell
- aVectorsToSet->SetTuple3(aNewCellId, aXCoord, anYCoord, aZCoord);
- }
- else
- aVectorsToSet->SetTuple3(aNewCellId, 0, 0, 0);
+ vtkIdType aVTKCellId = aNeighbourCells->GetId(i);
+ vtkIdType anObjCellId = aParent->GetElemObjID(aVTKCellId);
+
+ vtkCell* aCurCell = aParent->GetElemCell(anObjCellId);
+
+ vtkIdType aNewCellId = aCellsToWarp->InsertNextCell(aCurCell->GetCellType(), aCurCell->GetPointIds());
+
+ // get gauss points corresponding to the current cell
+ vtkIdType aPointVtkId = -1;
+ vtkIdType aLocalPntId = 0;
+ aPointVtkId = aGaussPtsIDMapper->GetVTKID(VISU::TGaussPointID(anObjCellId, aLocalPntId));
+
+ if (aPointVtkId >= 0) {
+ // Compute average vector
+ aCellVectors->Reset();
+ while (aPointVtkId >= 0) {
+ anInputVectors->GetTuple(aPointVtkId, &aTuple[0]);
+
+ if (aNbComp >= 3)
+ aCellVectors->InsertNextTuple3(aTuple[0], aTuple[1], aTuple[2]);
+ else if (aNbComp == 2)
+ aCellVectors->InsertNextTuple3(aTuple[0], aTuple[1], 0);
+ else if (aNbComp == 1)
+ aCellVectors->InsertNextTuple3(aTuple[0], 0, 0);
+
+ aPointVtkId = aGaussPtsIDMapper->GetVTKID(VISU::TGaussPointID(anObjCellId, ++aLocalPntId));
+ }
+
+ double aXCoord = 0, anYCoord = 0, aZCoord = 0;
+
+ vtkIdType aNbVectors = aCellVectors->GetNumberOfTuples();
+
+ for (vtkIdType aVecId = 0; aVecId < aNbVectors; aVecId++) {
+ aXCoord += aCellVectors->GetComponent(aVecId, 0);
+ anYCoord += aCellVectors->GetComponent(aVecId, 1);
+ aZCoord += aCellVectors->GetComponent(aVecId, 2);
+ }
+
+ aXCoord = aXCoord / aNbVectors;
+ anYCoord = anYCoord / aNbVectors;
+ aZCoord = aZCoord / aNbVectors;
+
+ // set vector data for the cell
+ aVectorsToSet->SetTuple3(aNewCellId, aXCoord, anYCoord, aZCoord);
+ }
+ else
+ aVectorsToSet->SetTuple3(aNewCellId, 0, 0, 0);
}
aCellsToWarp->GetCellData()->SetVectors(aVectorsToSet);
if(theInsideCursorSettings){
theInsideCursorSettings->AddObserver(VISU::UpdateInsideSettingsEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
UpdateInsideCursorSettings();
}
}
vtkFloatingPointType
VISU_GaussPtsAct1
::GetRadius(vtkIdType theObjID,
- vtkIdType theVTKID,
- vtkDataArray *theScalarArray)
+ vtkIdType theVTKID,
+ vtkDataArray *theScalarArray)
{
VISU_GaussPointsPL* aPipeLine = myDeviceActor->GetPipeLine();
if(IsSegmentationEnabled()){
void
VISU_GaussPtsAct1::SetPosition(double _arg[3]){
- if(MYDEBUG1) MESSAGE("VISU_GaussPtsAct1::SetPosition - this = "<<this);
+ if(MYDEBUG1) MESSAGE("VISU_GaussPtsAct1::SetPosition - this = "<<this);
Superclass::SetPosition(_arg);
myUpdatePositionSignal(_arg);
}
if(theOutsideCursorSettings)
{
theOutsideCursorSettings->AddObserver(VISU::UpdateOutsideSettingsEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
UpdateOutsideCursorSettings();
}
}
void
VISU_GaussPtsAct1
::ProcessEvents(vtkObject* theObject,
- unsigned long theEvent,
- void* theClientData,
- void* theCallData)
+ unsigned long theEvent,
+ void* theClientData,
+ void* theCallData)
{
if(vtkObject* anObject = reinterpret_cast<vtkObject*>(theClientData))
if(VISU_GaussPtsAct1* self = dynamic_cast<VISU_GaussPtsAct1*>(anObject))
if(theEvent == VISU::UpdateOutsideSettingsEvent)
- self->UpdateOutsideCursorSettings();
+ self->UpdateOutsideCursorSettings();
Superclass::ProcessEvents(theObject,theEvent,theClientData,theCallData);
}
//----------------------------------------------------------------------------
void
VISU_GaussPtsAct2::SetPosition(double _arg[3]){
- if(MYDEBUG1) MESSAGE("VISU_GaussPtsAct2::SetPosition - this = "<<this);
+ if(MYDEBUG1) MESSAGE("VISU_GaussPtsAct2::SetPosition - this = "<<this);
Superclass::SetPosition(_arg);
}
virtual
bool
PreHighlight(vtkInteractorStyle* theInteractorStyle,
- SVTK_SelectionEvent* theSelectionEvent,
- bool theIsHighlight);
+ SVTK_SelectionEvent* theSelectionEvent,
+ bool theIsHighlight);
//! Redefined method of the actor's highlighting
virtual
bool
Highlight(vtkInteractorStyle* theInteractorStyle,
- SVTK_SelectionEvent* theSelectionEvent,
- bool theIsHighlight);
+ SVTK_SelectionEvent* theSelectionEvent,
+ bool theIsHighlight);
//----------------------------------------------------------------------------
//! Set the picking settings to the actor.
virtual
vtkFloatingPointType
GetRadius(vtkIdType theObjID,
- vtkIdType theVTKID,
- vtkDataArray *theScalarArray);
+ vtkIdType theVTKID,
+ vtkDataArray *theScalarArray);
//! To get current value of the magnification
virtual
static
void
ProcessEvents(vtkObject* theObject,
- unsigned long theEvent,
- void* theClientData,
- void* theCallData);
+ unsigned long theEvent,
+ void* theClientData,
+ void* theCallData);
// To process VTK event method
virtual
virtual
int
RenderTranslucentGeometry(vtkViewport *viewport);
-
+
virtual
void
SetPosition(double _arg[3]);
virtual
vtkFloatingPointType
GetRadius(vtkIdType theObjID,
- vtkIdType theVTKID,
- vtkDataArray *theScalarArray);
+ vtkIdType theVTKID,
+ vtkDataArray *theScalarArray);
//! To get current value of the magnification
virtual
static
void
ProcessEvents(vtkObject* theObject,
- unsigned long theEvent,
- void* theClientData,
- void* theCallData);
+ unsigned long theEvent,
+ void* theClientData,
+ void* theCallData);
// To process VTK event method
virtual
virtual
unsigned long int
GetMemorySize();
-
+
virtual
void
SetPosition(double _arg[3]);
TTextureValue
GetTexture(const std::string& theMainTexture,
- const std::string& theAlphaTexture)
+ const std::string& theAlphaTexture)
{
typedef std::pair<std::string,std::string> TTextureKey;
typedef std::map<TTextureKey,TTextureValue> TTextureMap;
QString anAlphaTextureVTI = Image2VTI(theAlphaTexture).c_str();
if( !aMainTextureVTI.isNull() && !anAlphaTextureVTI.isNull() ){
- aTextureValue =
- VISU_GaussPointsPL::MakeTexture( aMainTextureVTI.toLatin1().data(),
- anAlphaTextureVTI.toLatin1().data() );
+ aTextureValue =
+ VISU_GaussPointsPL::MakeTexture( aMainTextureVTI.toLatin1().data(),
+ anAlphaTextureVTI.toLatin1().data() );
- if( aTextureValue.GetPointer() )
- aTextureMap[aTextureKey] = aTextureValue;
+ if( aTextureValue.GetPointer() )
+ aTextureMap[aTextureKey] = aTextureValue;
}
RemoveFile(aMainTextureVTI.toLatin1().data());
void
VISU_GaussDeviceActorBase
::DoMapperShallowCopy( vtkMapper* theMapper,
- bool theIsCopyInput )
+ bool theIsCopyInput )
{
VISU::CopyMapper( GetMapper(), theMapper, theIsCopyInput );
}
if(Superclass::GetPickable()){
if(vtkMapper* aMapper = GetMapper()){
if(vtkDataSet* aDataSet= aMapper->GetInput()){
- aDataSet->Update();
- return aDataSet->GetNumberOfCells() > 0;
+ aDataSet->Update();
+ return aDataSet->GetNumberOfCells() > 0;
}
}
}
void
VISU_CursorPyramid
::SetPreferences(vtkFloatingPointType theHeight,
- vtkFloatingPointType theCursorSize)
+ vtkFloatingPointType theCursorSize)
{
Init(theHeight, theCursorSize, myRadius, myMagnification, myClamp, GetPosition(), GetProperty()->GetColor());
}
VISU_OBJECT_EXPORT
TTextureValue
GetTexture(const std::string& theMainTexture,
- const std::string& theAlphaTexture);
+ const std::string& theAlphaTexture);
}
virtual
void
DoMapperShallowCopy( vtkMapper* theMapper,
- bool theIsCopyInput );
+ bool theIsCopyInput );
VISU_OpenGLPointSpriteMapper*
GetPointSpriteMapper();
vtkFloatingPointType theColor[3]);
void SetPreferences(vtkFloatingPointType theHeight,
- vtkFloatingPointType theCursorSize);
+ vtkFloatingPointType theCursorSize);
protected:
VISU_CursorPyramid();
unsigned long aTime = myLabelsDataSet->GetMTime();
unsigned long anObjTime = GetMTime();
if (aTime < anObjTime) {
- myLabelsDataSet->ShallowCopy(aDataSet);
- myLabelsDataSet->Modified();
+ myLabelsDataSet->ShallowCopy(aDataSet);
+ myLabelsDataSet->Modified();
}
}
}
void
VISU_MeshAct
::SetFeatureEdgesFlags(bool theIsFeatureEdges,
- bool theIsBoundaryEdges,
- bool theIsManifoldEdges,
- bool theIsNonManifoldEdges)
+ bool theIsBoundaryEdges,
+ bool theIsManifoldEdges,
+ bool theIsNonManifoldEdges)
{
Superclass::SetFeatureEdgesFlags(theIsFeatureEdges,
- theIsBoundaryEdges,
- theIsManifoldEdges,
- theIsNonManifoldEdges);
+ theIsBoundaryEdges,
+ theIsManifoldEdges,
+ theIsNonManifoldEdges);
mySurfaceActor->SetFeatureEdgesFlags(theIsFeatureEdges,
- theIsBoundaryEdges,
- theIsManifoldEdges,
- theIsNonManifoldEdges);
+ theIsBoundaryEdges,
+ theIsManifoldEdges,
+ theIsNonManifoldEdges);
}
void
virtual
void
SetFeatureEdgesFlags(bool theIsFeatureEdges,
- bool theIsBoundaryEdges,
- bool theIsManifoldEdges,
- bool theIsNonManifoldEdges);
+ bool theIsBoundaryEdges,
+ bool theIsManifoldEdges,
+ bool theIsNonManifoldEdges);
virtual
void
if(theInteractor)
theInteractor->AddObserver(vtkCommand::CharEvent,
- myEventCallbackCommand,
- 0.0);
+ myEventCallbackCommand,
+ 0.0);
myInteractor = theInteractor;
}
//----------------------------------------------------------------------------
void
DoMapperShallowCopy( vtkMapper* theMapper,
- bool theIsCopyInput )
+ bool theIsCopyInput )
{
Superclass::DoMapperShallowCopy( theMapper, theIsCopyInput );
static
void
ProcessEvents(vtkObject* theObject,
- unsigned long theEvent,
- void* theClientData,
- void* theCallData)
+ unsigned long theEvent,
+ void* theClientData,
+ void* theCallData)
{
if ( VISU_PointsDeviceActor* self = reinterpret_cast<VISU_PointsDeviceActor*>( theClientData ) )
self->OnInteractorEvent( theEvent );
switch( myInteractor->GetKeyCode() ) {
case 'M' :
case 'm' : {
- if ( !GetVisibility() )
- return;
+ if ( !GetVisibility() )
+ return;
- static vtkFloatingPointType anIncrement = 2;
- vtkFloatingPointType aMagnification = GetPointSpriteMapper()->GetPointSpriteMagnification();
- vtkFloatingPointType coefficient = myInteractor->GetShiftKey() ? anIncrement : 1 / anIncrement;
+ static vtkFloatingPointType anIncrement = 2;
+ vtkFloatingPointType aMagnification = GetPointSpriteMapper()->GetPointSpriteMagnification();
+ vtkFloatingPointType coefficient = myInteractor->GetShiftKey() ? anIncrement : 1 / anIncrement;
- GetPointSpriteMapper()->SetPointSpriteMagnification( aMagnification * coefficient );
+ GetPointSpriteMapper()->SetPointSpriteMagnification( aMagnification * coefficient );
- myInteractor->CreateTimer(VTKI_TIMER_UPDATE);
- break;
+ myInteractor->CreateTimer(VTKI_TIMER_UPDATE);
+ break;
}
default:
- return;
+ return;
}
break;
}
void
VISU_ScalarMapAct
::SetFeatureEdgesFlags(bool theIsFeatureEdges,
- bool theIsBoundaryEdges,
- bool theIsManifoldEdges,
- bool theIsNonManifoldEdges)
+ bool theIsBoundaryEdges,
+ bool theIsManifoldEdges,
+ bool theIsNonManifoldEdges)
{
Superclass::SetFeatureEdgesFlags(theIsFeatureEdges,
- theIsBoundaryEdges,
- theIsManifoldEdges,
- theIsNonManifoldEdges);
+ theIsBoundaryEdges,
+ theIsManifoldEdges,
+ theIsNonManifoldEdges);
mySurfaceActor->SetFeatureEdgesFlags(theIsFeatureEdges,
- theIsBoundaryEdges,
- theIsManifoldEdges,
- theIsNonManifoldEdges);
+ theIsBoundaryEdges,
+ theIsManifoldEdges,
+ theIsNonManifoldEdges);
}
void
virtual
void
SetFeatureEdgesFlags(bool theIsFeatureEdges,
- bool theIsBoundaryEdges,
- bool theIsManifoldEdges,
- bool theIsNonManifoldEdges);
+ bool theIsBoundaryEdges,
+ bool theIsManifoldEdges,
+ bool theIsNonManifoldEdges);
virtual
void
int
SALOME_ExtractGeometry
::RequestData(vtkInformation *request,
- vtkInformationVector **inputVector,
- vtkInformationVector *outputVector)
+ vtkInformationVector **inputVector,
+ vtkInformationVector *outputVector)
{
// get the info objects
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
int
SALOME_ExtractGeometry
::RequestData2(vtkInformation *vtkNotUsed(request),
- vtkInformationVector **inputVector,
- vtkInformationVector *outputVector)
+ vtkInformationVector **inputVector,
+ vtkInformationVector *outputVector)
{
// get the info objects
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
{
newId = newPts->InsertNextPoint(x);
pointMap[ptId] = newId;
- if(myStoreMapping)
- myNodeVTK2ObjIds.push_back(ptId);
+ if(myStoreMapping)
+ myNodeVTK2ObjIds.push_back(ptId);
outputPD->CopyData(pd,ptId,newId);
}
}
{
newId = newPts->InsertNextPoint(x);
pointMap[ptId] = newId;
- if(myStoreMapping)
- myNodeVTK2ObjIds.push_back(ptId);
+ if(myStoreMapping)
+ myNodeVTK2ObjIds.push_back(ptId);
outputPD->CopyData(pd,ptId,newId);
}
}
x = input->GetPoint(ptId);
newId = newPts->InsertNextPoint(x);
pointMap[ptId] = newId;
- if(myStoreMapping)
- myNodeVTK2ObjIds.push_back(ptId);
+ if(myStoreMapping)
+ myNodeVTK2ObjIds.push_back(ptId);
outputPD->CopyData(pd,ptId,newId);
}
newCellPts->InsertId(i,pointMap[ptId]);
{
newCellId = output->InsertNextCell(cell->GetCellType(),newCellPts);
if(myStoreMapping)
- myElemVTK2ObjIds.push_back(cellId);
+ myElemVTK2ObjIds.push_back(cellId);
outputCD->CopyData(cd,cellId,newCellId);
}
}//for all cells
int
SALOME_ExtractPolyDataGeometry
::RequestData(vtkInformation *request,
- vtkInformationVector **inputVector,
- vtkInformationVector *outputVector)
+ vtkInformationVector **inputVector,
+ vtkInformationVector *outputVector)
{
myElemVTK2ObjIds.clear();
myNodeVTK2ObjIds.clear();
int
SALOME_ExtractPolyDataGeometry
::RequestData2(vtkInformation *vtkNotUsed(request),
- vtkInformationVector **inputVector,
- vtkInformationVector *outputVector)
+ vtkInformationVector **inputVector,
+ vtkInformationVector *outputVector)
{
// get the info objects
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
{
newId = newPts->InsertNextPoint(x);
pointMap[ptId] = newId;
- if(myStoreMapping)
- myNodeVTK2ObjIds.push_back(ptId);
+ if(myStoreMapping)
+ myNodeVTK2ObjIds.push_back(ptId);
outputPD->CopyData(pd,ptId,newId);
}
}
{
newId = newPts->InsertNextPoint(x);
pointMap[ptId] = newId;
- if(myStoreMapping)
- myNodeVTK2ObjIds.push_back(ptId);
+ if(myStoreMapping)
+ myNodeVTK2ObjIds.push_back(ptId);
outputPD->CopyData(pd,ptId,newId);
}
}
x = input->GetPoint(ptId);
newId = newPts->InsertNextPoint(x);
pointMap[ptId] = newId;
- if(myStoreMapping)
- myNodeVTK2ObjIds.push_back(ptId);
+ if(myStoreMapping)
+ myNodeVTK2ObjIds.push_back(ptId);
outputPD->CopyData(pd,ptId,newId);
}
newCellPts->InsertId(i,pointMap[ptId]);
{
newCellId = output->InsertNextCell(cell->GetCellType(),newCellPts);
if(myStoreMapping)
- myElemVTK2ObjIds.push_back(cellId);
+ myElemVTK2ObjIds.push_back(cellId);
outputCD->CopyData(cd,cellId,newCellId);
}
}//for all cells
template<class TPipeLine>
VISU_ColoredPL*
CreateColoredPL(VISU_Convertor* theConvertor,
- const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber);
+ const std::string& theMeshName,
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber);
//----------------------------------------------------------------------------
template<>
VISU_ColoredPL*
CreateColoredPL<VISU_GaussPointsPL>(VISU_Convertor* theConvertor,
- const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber)
+ const std::string& theMeshName,
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber)
{
VISU_GaussPointsPL* aPresent = VISU_GaussPointsPL::New();
VISU::PGaussPtsIDMapper aGaussPtsIDMapper =
theConvertor->GetTimeStampOnGaussPts(theMeshName,
- theEntity,
- theFieldName,
- theTimeStampNumber);
+ theEntity,
+ theFieldName,
+ theTimeStampNumber);
aPresent->SetGaussPtsIDMapper(aGaussPtsIDMapper);
char aMainTexture[80];
template<class TPipeLine>
VISU_ColoredPL*
CreateColoredPL(VISU_Convertor* theConvertor,
- const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber)
+ const std::string& theMeshName,
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber)
{
TPipeLine* aPresent = TPipeLine::New();
VISU::PUnstructuredGridIDMapper anUnstructuredGridIDMapper =
theConvertor->GetTimeStampOnMesh(theMeshName,
- theEntity,
- theFieldName,
- theTimeStampNumber);
+ theEntity,
+ theFieldName,
+ theTimeStampNumber);
aPresent->SetUnstructuredGridIDMapper(anUnstructuredGridIDMapper);
vtkFloatingPointType aRange[] = { 4, 5 };
//{
// VISU::PUnstructuredGridIDMapper anIDMapper =
// theConvertor->GetMeshOnGroup(theMeshName,
- // "groupe1");
+ // "groupe1");
// aPresent->AddGeometry(anIDMapper->GetOutput());
//}
//{
// VISU::PUnstructuredGridIDMapper anIDMapper =
// theConvertor->GetMeshOnGroup(theMeshName,
- // "TUBEH ");
+ // "TUBEH ");
// aPresent->AddGeometry(anIDMapper->GetOutput());
//}
//{
// VISU::PUnstructuredGridIDMapper anIDMapper =
// theConvertor->GetMeshOnGroup(theMeshName,
- // "STRI ");
+ // "STRI ");
// aPresent->AddGeometry(anIDMapper->GetOutput());
//}
aPresent->Update();
const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter;
if(isOnlyMesh){
- const VISU::TEntity& anEntity = VISU::CELL_ENTITY;
- aMeshOnEntityMapIter = aMeshOnEntityMap.find(anEntity);
+ const VISU::TEntity& anEntity = VISU::CELL_ENTITY;
+ aMeshOnEntityMapIter = aMeshOnEntityMap.find(anEntity);
- VISU::PNamedIDMapper anIDMapper =
- aConvertor->GetMeshOnEntity(aMeshName,anEntity);
+ VISU::PNamedIDMapper anIDMapper =
+ aConvertor->GetMeshOnEntity(aMeshName,anEntity);
- VISU_MeshPL* aPresent = VISU_MeshPL::New();
- aPresent->SetUnstructuredGridIDMapper(anIDMapper);
+ VISU_MeshPL* aPresent = VISU_MeshPL::New();
+ aPresent->SetUnstructuredGridIDMapper(anIDMapper);
- vtkActor* aActor = vtkActor::New();
- aActor->SetMapper(aPresent->GetMapper());
- aActor->GetProperty()->SetRepresentation(VTK_WIREFRAME);
- //aRenderer->ResetCameraClippingRange();
+ vtkActor* aActor = vtkActor::New();
+ aActor->SetMapper(aPresent->GetMapper());
+ aActor->GetProperty()->SetRepresentation(VTK_WIREFRAME);
+ //aRenderer->ResetCameraClippingRange();
- aRenderer->AddActor(aActor);
+ aRenderer->AddActor(aActor);
- aWindow->Render();
- anInteractor->Start();
- return 0;
+ aWindow->Render();
+ anInteractor->Start();
+ return 0;
}
//Import fields
aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++) {
- const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
- const VISU::PMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second;
- const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
- VISU::TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin();
- for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++){
- const VISU::PField aField = aFieldMapIter->second;
-// if(aField->myNbComp == 1)
-// continue;
- const std::string& aFieldName = aFieldMapIter->first;
- const VISU::TValField& aValField = aField->myValField;
- VISU::TValField::const_reverse_iterator aValFieldIter = aValField.rbegin();
- if(aValFieldIter == aValField.rend()) return 0;
- int aTimeStamp = aValFieldIter->first;
-
- vtkActor* anActor = vtkActor::New();
- VISU_ColoredPL* aPresent = NULL;
- if(anEntity == VISU::NODE_ENTITY){
- aPresent = CreateColoredPL<TPresent>(aConvertor,
- aMeshName,
- anEntity,
- aFieldName,
- aTimeStamp);
-
- anActor->SetMapper(aPresent->GetMapper());
- }else{
- continue;
- aPresent = CreateColoredPL<TPresent>(aConvertor,
- aMeshName,
- anEntity,
- aFieldName,
- aTimeStamp);
-
- VTKViewer_GeometryFilter* aGeometryFilter = VTKViewer_GeometryFilter::New();
- aGeometryFilter->SetInput(aPresent->GetOutput());
- aGeometryFilter->SetInside(true);
-
- vtkMaskPoints* aMaskPoints = vtkMaskPoints::New();
- aMaskPoints->SetInput(aGeometryFilter->GetOutput());
- aMaskPoints->SetGenerateVertices(true);
- aMaskPoints->SetOnRatio(1);
-
- VISU_OpenGLPointSpriteMapper* aMapper = VISU_OpenGLPointSpriteMapper::New();
- aMapper->SetAverageCellSize( VISU_DeformedShapePL::GetScaleFactor( aPresent->GetOutput() ) );
+ const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
+ const VISU::PMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second;
+ const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
+ VISU::TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin();
+ for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++){
+ const VISU::PField aField = aFieldMapIter->second;
+// if(aField->myNbComp == 1)
+// continue;
+ const std::string& aFieldName = aFieldMapIter->first;
+ const VISU::TValField& aValField = aField->myValField;
+ VISU::TValField::const_reverse_iterator aValFieldIter = aValField.rbegin();
+ if(aValFieldIter == aValField.rend()) return 0;
+ int aTimeStamp = aValFieldIter->first;
+
+ vtkActor* anActor = vtkActor::New();
+ VISU_ColoredPL* aPresent = NULL;
+ if(anEntity == VISU::NODE_ENTITY){
+ aPresent = CreateColoredPL<TPresent>(aConvertor,
+ aMeshName,
+ anEntity,
+ aFieldName,
+ aTimeStamp);
+
+ anActor->SetMapper(aPresent->GetMapper());
+ }else{
+ continue;
+ aPresent = CreateColoredPL<TPresent>(aConvertor,
+ aMeshName,
+ anEntity,
+ aFieldName,
+ aTimeStamp);
+
+ VTKViewer_GeometryFilter* aGeometryFilter = VTKViewer_GeometryFilter::New();
+ aGeometryFilter->SetInput(aPresent->GetOutput());
+ aGeometryFilter->SetInside(true);
+
+ vtkMaskPoints* aMaskPoints = vtkMaskPoints::New();
+ aMaskPoints->SetInput(aGeometryFilter->GetOutput());
+ aMaskPoints->SetGenerateVertices(true);
+ aMaskPoints->SetOnRatio(1);
+
+ VISU_OpenGLPointSpriteMapper* aMapper = VISU_OpenGLPointSpriteMapper::New();
+ aMapper->SetAverageCellSize( VISU_DeformedShapePL::GetScaleFactor( aPresent->GetOutput() ) );
- char aMainTexture[80];
- strcpy( aMainTexture, getenv( "VISU_ROOT_DIR" ) );
- strcat( aMainTexture, "/share/salome/resources/visu/sprite_texture.vti" );
-
- char anAlphaTexture[80];
- strcpy( anAlphaTexture, getenv( "VISU_ROOT_DIR" ) );
- strcat( anAlphaTexture, "/share/salome/resources/visu/sprite_alpha.vti" );
-
- vtkSmartPointer<vtkImageData> aTextureValue =
- VISU_GaussPointsPL::MakeTexture( aMainTexture, anAlphaTexture );
- aMapper->SetImageData( aTextureValue.GetPointer() );
+ char aMainTexture[80];
+ strcpy( aMainTexture, getenv( "VISU_ROOT_DIR" ) );
+ strcat( aMainTexture, "/share/salome/resources/visu/sprite_texture.vti" );
+
+ char anAlphaTexture[80];
+ strcpy( anAlphaTexture, getenv( "VISU_ROOT_DIR" ) );
+ strcat( anAlphaTexture, "/share/salome/resources/visu/sprite_alpha.vti" );
+
+ vtkSmartPointer<vtkImageData> aTextureValue =
+ VISU_GaussPointsPL::MakeTexture( aMainTexture, anAlphaTexture );
+ aMapper->SetImageData( aTextureValue.GetPointer() );
- //vtkPolyDataMapper* aMapper = vtkPolyDataMapper::New();
- aMapper->SetLookupTable(aPresent->GetMapperTable());
- aMapper->SetUseLookupTableScalarRange(true);
- aMapper->SetColorModeToMapScalars();
- aMapper->SetScalarVisibility(true);
+ //vtkPolyDataMapper* aMapper = vtkPolyDataMapper::New();
+ aMapper->SetLookupTable(aPresent->GetMapperTable());
+ aMapper->SetUseLookupTableScalarRange(true);
+ aMapper->SetColorModeToMapScalars();
+ aMapper->SetScalarVisibility(true);
- aMapper->SetInput(aMaskPoints->GetOutput());
- aGeometryFilter->Delete();
+ aMapper->SetInput(aMaskPoints->GetOutput());
+ aGeometryFilter->Delete();
- anActor->SetMapper(aMapper);
- aMapper->Delete();
- }
+ anActor->SetMapper(aMapper);
+ aMapper->Delete();
+ }
lut->SetNumberOfTableValues(nbColors);
vtkDataArray* dataArr;
if(VISU::IsDataOnCells(aPresent->GetInput())) {
- dataArr = aPresent->GetInput()->GetCellData()->GetScalars();
+ dataArr = aPresent->GetInput()->GetCellData()->GetScalars();
} else {
- dataArr = aPresent->GetInput()->GetPointData()->GetScalars();
+ dataArr = aPresent->GetInput()->GetPointData()->GetScalars();
}
vtkFloatingPointType aRange[2];
dataArr->GetRange(aRange);
MSG(true, "3\n");
for(vtkIdType aValId = 0; aValId < aNbVals; aValId++){
// MSG(true, "Value: "<< *(dataArr->GetTuple(aValId)));
- idx = lut->GetIndex(*(dataArr->GetTuple(aValId)));
+ idx = lut->GetIndex(*(dataArr->GetTuple(aValId)));
// MSG(true, "Value index "<<idx);
- cnt = distr->GetValue(idx);
- distr->SetValue(idx, cnt + 1);
+ cnt = distr->GetValue(idx);
+ distr->SetValue(idx, cnt + 1);
}
MSG(true, "4\n");
distr->Modified();
// points->Allocate(aNbVals);
// double x[3] = {0., 0., 0.};
/* for(vtkIdType aValId = 0; aValId < aNbVals; aValId++){
- x[0] = aValId;
- points->InsertPoint(aValId, x);
+ x[0] = aValId;
+ points->InsertPoint(aValId, x);
*/// MSG(true, "Inserted point "<<aValId);
// MSG(true, ": "<<distr->GetValue(aValId));
// }
MSG(true, "nbYLabels = "<<xyplot->GetNumberOfYLabels());
if (ny < xyplot->GetNumberOfYLabels()) {
MSG(true, "5.1");
- xyplot->SetNumberOfYLabels(ny);
+ xyplot->SetNumberOfYLabels(ny);
MSG(true, "nbYLabels = "<<xyplot->GetNumberOfYLabels());
}
*/ xyplot->GetProperty()->SetColor(1, 1, 1);
vtkObject::GlobalWarningDisplayOn();
- VISU_ScalarBarActor * aScalarBar = VISU_ScalarBarActor::New();
- //vtkScalarBarActor * aScalarBar = vtkScalarBarActor::New();
- aPresent->SetNbColors(5);
- aPresent->DebugOn();
- aPresent->Update();
- aScalarBar->SetLookupTable(aPresent->GetBarTable());
- aScalarBar->DebugOn();
- aScalarBar->SetDistribution(aPresent->GetDistribution());
- aScalarBar->DistributionVisibilityOn();
-// aScalarBar->SetOrientationToHorizontal();
-// aScalarBar->GetPositionCoordinate()->SetValue(.1, .6, 0);
-// aScalarBar->GetPosition2Coordinate()->SetValue(.8, .3, 0);
+ VISU_ScalarBarActor * aScalarBar = VISU_ScalarBarActor::New();
+ //vtkScalarBarActor * aScalarBar = vtkScalarBarActor::New();
+ aPresent->SetNbColors(5);
+ aPresent->DebugOn();
+ aPresent->Update();
+ aScalarBar->SetLookupTable(aPresent->GetBarTable());
+ aScalarBar->DebugOn();
+ aScalarBar->SetDistribution(aPresent->GetDistribution());
+ aScalarBar->DistributionVisibilityOn();
+// aScalarBar->SetOrientationToHorizontal();
+// aScalarBar->GetPositionCoordinate()->SetValue(.1, .6, 0);
+// aScalarBar->GetPosition2Coordinate()->SetValue(.8, .3, 0);
/*{
vtkScalarBarWidget* aWidget = vtkScalarBarWidget::New();
aWidget->SetEnabled( 1 );
}
*/
- aRenderer->AddActor(anActor);
-// aRenderer->AddActor2D(xyplot); //RKV
- aRenderer->AddActor2D(aScalarBar);
-
- //aRenderer->AddActor2D(barChartActor()); //RKV
-
- aWindow->Render();
- aRenderer->ResetCamera();
-
- anInteractor->Start();
- return 0;
- }
+ aRenderer->AddActor(anActor);
+// aRenderer->AddActor2D(xyplot); //RKV
+ aRenderer->AddActor2D(aScalarBar);
+
+ //aRenderer->AddActor2D(barChartActor()); //RKV
+
+ aWindow->Render();
+ aRenderer->ResetCamera();
+
+ anInteractor->Start();
+ return 0;
+ }
}
}
else{
void
VISU_ColoredPL
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
if ( theIsCopyInput ) {
SetScalarRange( aPipeLine->GetScalarRange() );
if ( this->IsScalarFilterUsed() )
- SetScalarFilterRange( aPipeLine->GetScalarFilterRange() );
+ SetScalarFilterRange( aPipeLine->GetScalarFilterRange() );
}
SetScalarMode(aPipeLine->GetScalarMode());
void
VISU_ColoredPL
::SetScalarMode(int theScalarMode,
- vtkDataSet *theInput,
- VISU_Extractor* theExtractor)
+ vtkDataSet *theInput,
+ VISU_Extractor* theExtractor)
{
if(theInput){
if(VISU::IsDataOnPoints(theInput)){
vtkPointData *aPointData = theInput->GetPointData();
if(!aPointData->GetAttribute(vtkDataSetAttributes::VECTORS)) {
- if(theScalarMode == 0){
- return;
- }
+ if(theScalarMode == 0){
+ return;
+ }
}
} else {
vtkCellData *aCellData = theInput->GetCellData();
if(!aCellData->GetAttribute(vtkDataSetAttributes::VECTORS)){
- if(theScalarMode == 0){
- return;
- }
+ if(theScalarMode == 0){
+ return;
+ }
}
}
}
unsigned long int aTime = this->GetMTime();
// If modified then update the distribution array
if (aTime > myDistribution->GetMTime()) {
- // Set number of colors for the distribution
+ // Set number of colors for the distribution
int nbColors = this->GetNbColors();
- this->myDistribution->SetNumberOfValues(nbColors);
- // Initialize numbers of colored cells with zero
- this->myDistribution->FillComponent(0, 0);
- // Create a lookup table to compute a color of a cell
+ this->myDistribution->SetNumberOfValues(nbColors);
+ // Initialize numbers of colored cells with zero
+ this->myDistribution->FillComponent(0, 0);
+ // Create a lookup table to compute a color of a cell
VISU_LookupTable* lut = GetMapperTable();
vtkFloatingPointType aMapScale = lut->GetMapScale();
// Get scalar values from the input data to calculate their distribution within cells
vtkDataArray* dataArr;
// Dtermine where we have to take scalars from: cells data or points data.
if(VISU::IsDataOnCells(this->GetOutput())) {
- dataArr = this->GetOutput()->GetCellData()->GetScalars();
+ dataArr = this->GetOutput()->GetCellData()->GetScalars();
} else {
- dataArr = this->GetOutput()->GetPointData()->GetScalars();
+ dataArr = this->GetOutput()->GetPointData()->GetScalars();
}
// If scalars data array is not defined then create an empty one to avoid exceptions
if (dataArr == NULL) {
- dataArr = vtkDoubleArray::New();
+ dataArr = vtkDoubleArray::New();
}
// Get range of scalars values
}
}
this->myDistribution->Modified();
-
+
}
return myDistribution;
virtual
void
DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
//----------------------------------------------------------------------------
VISU_Extractor*
static
void
SetScalarMode(int theScalarMode,
- vtkDataSet *theInput,
- VISU_Extractor* theExtractor);
+ vtkDataSet *theInput,
+ VISU_Extractor* theExtractor);
private:
vtkSmartPointer< VISU_LookupTable > myMapperTable;
void
VISU_CutLinesPL
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
if(VISU_CutLinesPL *aPipeLine = dynamic_cast<VISU_CutLinesPL*>(thePipeLine)){
SetOrientation(aPipeLine->GetPlaneOrientation(1),
- aPipeLine->GetRotateX(1),aPipeLine->GetRotateY(1),1);
+ aPipeLine->GetRotateX(1),aPipeLine->GetRotateY(1),1);
SetDisplacement(aPipeLine->GetDisplacement(1),1);
if (aPipeLine->IsDefault())
SetDefault();
vtkFloatingPointType aDir[3];
GetDir(aDir,
- myAng[0],
- myBasePlane[0]);
+ myAng[0],
+ myBasePlane[0]);
vtkFloatingPointType aBoundPrj[3];
GetBoundProject(aBoundPrj,
- aBounds,
- aDir);
+ aBounds,
+ aDir);
aPosition = aBoundPrj[0] + aBoundPrj[2] * myDisplacement[0];
}
vtkFloatingPointType aDir[2][3];
GetDir(aDir[0],
- myAng[0],
- myBasePlane[0]);
+ myAng[0],
+ myBasePlane[0]);
CutWithPlanes(anAppendPolyData,
- GetMergedInput(),
- 1,
- aDir[0],
- aBaseBounds,
- myPosition,
- myCondition,
- myDisplacement[0]);
+ GetMergedInput(),
+ 1,
+ aDir[0],
+ aBaseBounds,
+ myPosition,
+ myCondition,
+ myDisplacement[0]);
//Build lines
vtkDataSet *aDataSet = anAppendPolyData->GetOutput();
aDataSet->Update();
aDataSet->GetBounds(aBounds);
GetDir(aDir[1],
- myAng[1],
- myBasePlane[1]);
+ myAng[1],
+ myBasePlane[1]);
VISU_CutPlanesPL::CutWithPlanes(myAppendPolyData,
- aDataSet,
- GetNbParts(),
- aDir[1],
- aBounds,
- myPartPosition,
- myPartCondition,
- myDisplacement[1]);
+ aDataSet,
+ GetNbParts(),
+ aDir[1],
+ aBounds,
+ myPartPosition,
+ myPartCondition,
+ myDisplacement[1]);
//{
// std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-myAppendPolyData.vtk";
// VISU::WriteToFile(myAppendPolyData->GetOutput(), aFileName);
}
GetBoundProject(myBoundPrjLn,
- aBaseBounds,
- myDirLn);
+ aBaseBounds,
+ myDirLn);
VISU::Mul(myDirLn,
- myBoundPrjLn[0],
- myBasePnt);
+ myBoundPrjLn[0],
+ myBasePnt);
CorrectPnt(myBasePnt,
- aBaseBounds);
+ aBaseBounds);
VISU_ScalarMapPL::Update();
}
void
VISU_CutLinesPL
::CutWithPlanes(vtkAppendPolyData* theAppendPolyData,
- vtkDataSet* theDataSet,
- int theNbPlanes,
- vtkFloatingPointType theDir[3],
- vtkFloatingPointType theBounds[6],
- vtkFloatingPointType thePartPosition,
- int thePartCondition,
- vtkFloatingPointType theDisplacement)
+ vtkDataSet* theDataSet,
+ int theNbPlanes,
+ vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theBounds[6],
+ vtkFloatingPointType thePartPosition,
+ int thePartCondition,
+ vtkFloatingPointType theDisplacement)
{
std::vector<vtkFloatingPointType> aPartPosition(1,thePartPosition);
std::vector<int> aPartCondition(1,thePartCondition);
VISU_CutPlanesPL::CutWithPlanes(theAppendPolyData,
- theDataSet,
- theNbPlanes,
- theDir,
- theBounds,
- aPartPosition,
- aPartCondition,
- theDisplacement);
+ theDataSet,
+ theNbPlanes,
+ theDir,
+ theBounds,
+ aPartPosition,
+ aPartCondition,
+ theDisplacement);
}
static
void
CutWithPlanes(vtkAppendPolyData* theAppendPolyData,
- vtkDataSet* theDataSet,
- int theNbPlanes,
- vtkFloatingPointType theDir[3],
- vtkFloatingPointType theBounds[6],
- vtkFloatingPointType thePlanePosition,
- int thePlaneCondition,
- vtkFloatingPointType theDisplacement);
+ vtkDataSet* theDataSet,
+ int theNbPlanes,
+ vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theBounds[6],
+ vtkFloatingPointType thePlanePosition,
+ int thePlaneCondition,
+ vtkFloatingPointType theDisplacement);
protected:
VISU_CutLinesPL();
virtual
void
DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
vtkFloatingPointType myPosition;
int myCondition;
void
VISU_CutPlanesPL
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
if(VISU_CutPlanesPL *aPipeLine = dynamic_cast<VISU_CutPlanesPL*>(thePipeLine)){
SetOrientation(aPipeLine->GetPlaneOrientation(),
- aPipeLine->GetRotateX(),
- aPipeLine->GetRotateY());
+ aPipeLine->GetRotateX(),
+ aPipeLine->GetRotateY());
SetDisplacement(aPipeLine->GetDisplacement());
SetNbParts(aPipeLine->GetNbParts());
for (int i = 0, iEnd = GetNbParts(); i < iEnd; i++)
- if(!aPipeLine->IsPartDefault(i))
- SetPartPosition(i, aPipeLine->GetPartPosition(i));
+ if(!aPipeLine->IsPartDefault(i))
+ SetPartPosition(i, aPipeLine->GetPartPosition(i));
}
}
vtkFloatingPointType aDir[3];
GetDir(aDir,
- myAng[0],
- myBasePlane[0]);
+ myAng[0],
+ myBasePlane[0]);
vtkFloatingPointType aBounds[6];
CutWithPlanes(myAppendPolyData,
aFilterOutput,
- myNbParts,
- aDir,
- aBounds,
- myPartPosition,
- myPartCondition,
- myDisplacement[0]);
+ myNbParts,
+ aDir,
+ aBounds,
+ myPartPosition,
+ myPartCondition,
+ myDisplacement[0]);
vtkFloatingPointType*
VISU_CutPlanesPL
::GetRy(vtkFloatingPointType theRy[3][3],
- vtkFloatingPointType thaAng)
+ vtkFloatingPointType thaAng)
{
theRy[0][0] = cos(thaAng); theRy[0][1] = 0.0; theRy[0][2] = sin(thaAng);
theRy[1][0] = 0.0; theRy[1][1] = 1.0; theRy[1][2] = 0.0;
vtkFloatingPointType*
VISU_CutPlanesPL
::GetRz(vtkFloatingPointType theRz[3][3],
- vtkFloatingPointType thaAng)
+ vtkFloatingPointType thaAng)
{
theRz[0][0] = cos(thaAng); theRz[0][1] = -sin(thaAng); theRz[0][2] = 0.0;
theRz[1][0] = sin(thaAng); theRz[1][1] = cos(thaAng); theRz[1][2] = 0.0;
void
VISU_CutPlanesPL
::CorrectPnt(vtkFloatingPointType thePnt[3],
- const vtkFloatingPointType BoundPrj[6])
+ const vtkFloatingPointType BoundPrj[6])
{
for(int i = 0, j = 0; i < 3; ++i, j=2*i){
if(thePnt[i] < BoundPrj[j]) thePnt[i] = BoundPrj[j];
void
VISU_CutPlanesPL
::GetBoundProject(vtkFloatingPointType BoundPrj[3],
- const vtkFloatingPointType BoundBox[6],
- const vtkFloatingPointType Dir[3])
+ const vtkFloatingPointType BoundBox[6],
+ const vtkFloatingPointType Dir[3])
{
vtkFloatingPointType BoundPoints[8][3] = { {BoundBox[0],BoundBox[2],BoundBox[4]},
- {BoundBox[1],BoundBox[2],BoundBox[4]},
- {BoundBox[0],BoundBox[3],BoundBox[4]},
- {BoundBox[1],BoundBox[3],BoundBox[4]},
- {BoundBox[0],BoundBox[2],BoundBox[5]},
- {BoundBox[1],BoundBox[2],BoundBox[5]},
- {BoundBox[0],BoundBox[3],BoundBox[5]},
- {BoundBox[1],BoundBox[3],BoundBox[5]}};
+ {BoundBox[1],BoundBox[2],BoundBox[4]},
+ {BoundBox[0],BoundBox[3],BoundBox[4]},
+ {BoundBox[1],BoundBox[3],BoundBox[4]},
+ {BoundBox[0],BoundBox[2],BoundBox[5]},
+ {BoundBox[1],BoundBox[2],BoundBox[5]},
+ {BoundBox[0],BoundBox[3],BoundBox[5]},
+ {BoundBox[1],BoundBox[3],BoundBox[5]}};
BoundPrj[0] = vtkMath::Dot(Dir,BoundPoints[0]), BoundPrj[1] = BoundPrj[0];
for(int i = 1; i < 8; i++){
vtkFloatingPointType tmp = vtkMath::Dot(Dir,BoundPoints[i]);
void
VISU_CutPlanesPL
::SetOrientation(const VISU_CutPlanesPL::PlaneOrientation& theOrient,
- vtkFloatingPointType theXAng,
- vtkFloatingPointType theYAng,
- int theNum)
+ vtkFloatingPointType theXAng,
+ vtkFloatingPointType theYAng,
+ int theNum)
{
myBasePlane[theNum] = theOrient;
switch(myBasePlane[theNum]){
void
VISU_CutPlanesPL
::SetDisplacement(vtkFloatingPointType theDisp,
- int theNum)
+ int theNum)
{
if(VISU::CheckIsSameValue(myDisplacement[theNum], theDisp))
return;
void
VISU_CutPlanesPL
::SetPartPosition(int thePartNumber,
- vtkFloatingPointType thePartPosition)
+ vtkFloatingPointType thePartPosition)
{
if(thePartNumber >= myNbParts)
return;
vtkFloatingPointType
VISU_CutPlanesPL
::GetPartPosition(int thePartNumber,
- int theNum)
+ int theNum)
{
if(thePartNumber >= myNbParts)
return 0;
GetDir(aDir,
- myAng[theNum],
- myBasePlane[theNum]);
+ myAng[theNum],
+ myBasePlane[theNum]);
GetBoundProject(aBoundPrj,
- aBounds,
- aDir);
+ aBounds,
+ aDir);
if(myNbParts > 1){
- vtkFloatingPointType aDBoundPrj = aBoundPrj[2]/(myNbParts - 1);
- vtkFloatingPointType aDisplacement = aDBoundPrj * myDisplacement[theNum];
- vtkFloatingPointType aStartPosition = aBoundPrj[0] - 0.5*aDBoundPrj + aDisplacement;
- aPosition = aStartPosition + thePartNumber*aDBoundPrj;
+ vtkFloatingPointType aDBoundPrj = aBoundPrj[2]/(myNbParts - 1);
+ vtkFloatingPointType aDisplacement = aDBoundPrj * myDisplacement[theNum];
+ vtkFloatingPointType aStartPosition = aBoundPrj[0] - 0.5*aDBoundPrj + aDisplacement;
+ aPosition = aStartPosition + thePartNumber*aDBoundPrj;
}else
- aPosition = aBoundPrj[0] + aBoundPrj[2]*myDisplacement[theNum];
+ aPosition = aBoundPrj[0] + aBoundPrj[2]*myDisplacement[theNum];
}
return aPosition;
void
VISU_CutPlanesPL
::GetDir(vtkFloatingPointType theDir[3],
- const vtkFloatingPointType theAng[3],
- const PlaneOrientation& theBasePlane)
+ const vtkFloatingPointType theAng[3],
+ const PlaneOrientation& theBasePlane)
{
int iPlane = 0;
vtkFloatingPointType aRx[3][3], aRy[3][3], aRz[3][3], aRotation[3][3];
void
VISU_CutPlanesPL
::CutWithPlane(vtkAppendPolyData* theAppendPolyData,
- vtkDataSet* theDataSet,
- vtkFloatingPointType theDir[3],
- vtkFloatingPointType theOrig[3])
+ vtkDataSet* theDataSet,
+ vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theOrig[3])
{
vtkCutter *aCutPlane = vtkCutter::New();
aCutPlane->SetInput(theDataSet);
void
VISU_CutPlanesPL
::CutWithPlanes(vtkAppendPolyData* theAppendPolyData,
- vtkDataSet* theDataSet,
- int theNbPlanes,
- vtkFloatingPointType theDir[3],
- vtkFloatingPointType theBounds[6],
- const std::vector<vtkFloatingPointType>& thePlanePosition,
- const std::vector<int>& thePlaneCondition,
- vtkFloatingPointType theDisplacement)
+ vtkDataSet* theDataSet,
+ int theNbPlanes,
+ vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theBounds[6],
+ const std::vector<vtkFloatingPointType>& thePlanePosition,
+ const std::vector<int>& thePlaneCondition,
+ vtkFloatingPointType theDisplacement)
{
vtkFloatingPointType aBoundPrj[3], aOrig[3], aPosition;
GetBoundProject(aBoundPrj, theBounds, theDir);
for (int i = 0; i < theNbPlanes; i++){
aPosition = aStartPosition + i*aDBoundPrj;
if(thePlaneCondition[i]){
- aPosition = aStartPosition + i*aDBoundPrj;
+ aPosition = aStartPosition + i*aDBoundPrj;
}else
- aPosition = thePlanePosition[i];
+ aPosition = thePlanePosition[i];
VISU::Mul(theDir,aPosition,aOrig);
CutWithPlane(theAppendPolyData,theDataSet,theDir,aOrig);
}
virtual
void
SetOrientation(const VISU_CutPlanesPL::PlaneOrientation& theOrient,
- vtkFloatingPointType theXAng,
- vtkFloatingPointType theYAng,
- int theNum = 0);
+ vtkFloatingPointType theXAng,
+ vtkFloatingPointType theYAng,
+ int theNum = 0);
virtual
const PlaneOrientation&
virtual
void
SetDisplacement(vtkFloatingPointType theDisp,
- int theNum = 0);
+ int theNum = 0);
virtual
void
SetPartPosition(int thePartNumber,
- vtkFloatingPointType thePartPosition);
+ vtkFloatingPointType thePartPosition);
virtual
vtkFloatingPointType
GetPartPosition(int thePartNumber,
- int theNum = 0);
+ int theNum = 0);
virtual
void
static
vtkFloatingPointType*
GetRx(vtkFloatingPointType theRx[3][3],
- vtkFloatingPointType thaAng);
+ vtkFloatingPointType thaAng);
static
vtkFloatingPointType*
GetRy(vtkFloatingPointType theRy[3][3],
- vtkFloatingPointType thaAng);
+ vtkFloatingPointType thaAng);
static
vtkFloatingPointType*
GetRz(vtkFloatingPointType theRz[3][3],
- vtkFloatingPointType thaAng);
+ vtkFloatingPointType thaAng);
static
void
CorrectPnt(vtkFloatingPointType thePnt[3],
- const vtkFloatingPointType BoundPrj[6]);
+ const vtkFloatingPointType BoundPrj[6]);
static
void
GetBoundProject(vtkFloatingPointType BoundPrj[3],
- const vtkFloatingPointType BoundBox[6],
- const vtkFloatingPointType Dir[3]);
+ const vtkFloatingPointType BoundBox[6],
+ const vtkFloatingPointType Dir[3]);
static
void
GetDir(vtkFloatingPointType theDir[3],
- const vtkFloatingPointType theAng[3],
- const PlaneOrientation& theBasePlane);
+ const vtkFloatingPointType theAng[3],
+ const PlaneOrientation& theBasePlane);
static
void
static
void
CutWithPlane(vtkAppendPolyData* theAppendPolyData,
- vtkDataSet* theDataSet,
- vtkFloatingPointType theDir[3],
- vtkFloatingPointType theOrig[3]);
+ vtkDataSet* theDataSet,
+ vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theOrig[3]);
static
void
CutWithPlanes(vtkAppendPolyData* theAppendPolyData,
- vtkDataSet* theDataSet,
- int theNbPlanes,
- vtkFloatingPointType theDir[3],
- vtkFloatingPointType theBounds[6],
- const std::vector<vtkFloatingPointType>& thePlanePosition,
- const std::vector<int>& thePlaneCondition,
- vtkFloatingPointType theDisplacement);
+ vtkDataSet* theDataSet,
+ int theNbPlanes,
+ vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theBounds[6],
+ const std::vector<vtkFloatingPointType>& thePlanePosition,
+ const std::vector<int>& thePlaneCondition,
+ vtkFloatingPointType theDisplacement);
virtual void SetVectorialField(VISU::PUnstructuredGridIDMapper);
VISU::PUnstructuredGridIDMapper getVectorialField();
virtual
void
DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
void
SetPartPosition(int theNum = 0);
void
VISU_CutSegmentPL
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
void
VISU_CutSegmentPL
::SetPoint1(vtkFloatingPointType theX,
- vtkFloatingPointType theY,
- vtkFloatingPointType theZ )
+ vtkFloatingPointType theY,
+ vtkFloatingPointType theZ )
{
myPoint1[0] = theX;
myPoint1[1] = theY;
void
VISU_CutSegmentPL
::GetPoint1(vtkFloatingPointType& theX,
- vtkFloatingPointType& theY,
- vtkFloatingPointType& theZ )
+ vtkFloatingPointType& theY,
+ vtkFloatingPointType& theZ )
{
theX = myPoint1[0];
theY = myPoint1[1];
void
VISU_CutSegmentPL
::SetPoint2(vtkFloatingPointType theX,
- vtkFloatingPointType theY,
- vtkFloatingPointType theZ )
+ vtkFloatingPointType theY,
+ vtkFloatingPointType theZ )
{
myPoint2[0] = theX;
myPoint2[1] = theY;
void
VISU_CutSegmentPL
::GetPoint2(vtkFloatingPointType& theX,
- vtkFloatingPointType& theY,
- vtkFloatingPointType& theZ )
+ vtkFloatingPointType& theY,
+ vtkFloatingPointType& theZ )
{
theX = myPoint2[0];
theY = myPoint2[1];
}
GetBoundProject(myBoundPrjLn,
- aBounds,
- myDirLn);
+ aBounds,
+ myDirLn);
VISU::Mul(myDirLn,
- myBoundPrjLn[0],
- myBasePnt);
+ myBoundPrjLn[0],
+ myBasePnt);
CorrectPnt(myBasePnt,
- aBounds);
+ aBounds);
VISU_ScalarMapPL::Update();
}
virtual
void
SetPoint1(vtkFloatingPointType theX,
- vtkFloatingPointType theY,
- vtkFloatingPointType theZ);
+ vtkFloatingPointType theY,
+ vtkFloatingPointType theZ);
virtual
void
GetPoint1(vtkFloatingPointType& theX,
- vtkFloatingPointType& theY,
- vtkFloatingPointType& theZ);
+ vtkFloatingPointType& theY,
+ vtkFloatingPointType& theZ);
virtual
void
SetPoint2(vtkFloatingPointType theX,
- vtkFloatingPointType theY,
- vtkFloatingPointType theZ);
+ vtkFloatingPointType theY,
+ vtkFloatingPointType theZ);
virtual
void
GetPoint2(vtkFloatingPointType& theX,
- vtkFloatingPointType& theY,
- vtkFloatingPointType& theZ);
+ vtkFloatingPointType& theY,
+ vtkFloatingPointType& theZ);
public:
virtual
virtual
void
DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
vtkFloatingPointType myPoint1[3];
vtkFloatingPointType myPoint2[3];
void
VISU_DataSetMapperHolder
::ShallowCopy(VISU_MapperHolder *theMapperHolder,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
if(VISU_DataSetMapperHolder* aMapperHolder = dynamic_cast<VISU_DataSetMapperHolder*>(theMapperHolder)){
if(theIsCopyInput)
SetUnstructuredGridIDMapper(aMapperHolder->GetUnstructuredGridIDMapper());
VISU::CopyDataSetMapper(GetDataSetMapper(),
- aMapperHolder->GetDataSetMapper(),
- theIsCopyInput);
+ aMapperHolder->GetDataSetMapper(),
+ theIsCopyInput);
myExtractGeometry->SetImplicitFunction(aMapperHolder->GetImplicitFunction());
}
}
vtkImplicitFunction* aFun = NULL;
aFunction->InitTraversal();
for(vtkIdType anID = 0; anID <= theID; anID++)
- aFun = aFunction->GetNextItem();
+ aFun = aFunction->GetNextItem();
aPlane = dynamic_cast<vtkPlane*>(aFun);
}
}
virtual
void
ShallowCopy(VISU_MapperHolder *theMapperHolder,
- bool theIsCopyInput);
+ bool theIsCopyInput);
void
SetElnoDisassembleState( bool theIsShrunk );
void
VISU_DeformedGridPL
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
virtual
void
DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
private:
VISU_DeformedGridPL(const VISU_DeformedGridPL&); // Not implemented.
GetMapper()->ScalarVisibilityOn();
VISU::CellDataToPoint(myWarpVector,
- myCellDataToPointData,
- GetMergedInput());
+ myCellDataToPointData,
+ GetMergedInput());
myScalars = vtkUnstructuredGrid::SafeDownCast(GetMergedInput());
void
VISU_DeformedShapeAndScalarMapPL
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
virtual
void
DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
private:
VISU_DeformedShapeAndScalarMapPL(const VISU_DeformedShapeAndScalarMapPL&);
void
VISU_DeformedShapePL
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
::InsertCustomPL()
{
VISU::CellDataToPoint(myWarpVector,
- myCellDataToPointData,
- GetMergedInput());
+ myCellDataToPointData,
+ GetMergedInput());
return myWarpVector->GetOutput();
}
virtual
void
DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
vtkFloatingPointType myScaleFactor;
vtkFloatingPointType myMapScaleFactor;
VISU_ElnoAssembleFilter::VISU_ElnoAssembleFilter()
{
this->SetInputArrayToProcess( 0, // idx
- 0, // port
- 0, // connection
- vtkDataObject::FIELD_ASSOCIATION_POINTS, // field association
- "ELNO_POINT_COORDS" ); // name
+ 0, // port
+ 0, // connection
+ vtkDataObject::FIELD_ASSOCIATION_POINTS, // field association
+ "ELNO_POINT_COORDS" ); // name
this->myIsRestorePoints = false;
}
//----------------------------------------------------------------------------
template < int points_type, int elno_type >
int Execute2( vtkPointSet *theInput,
- vtkPointSet *theOutput,
- vtkDataArray *theElnoPointCoords )
+ vtkPointSet *theOutput,
+ vtkDataArray *theElnoPointCoords )
{
theOutput->CopyStructure( theInput );
//----------------------------------------------------------------------------
template < int points_type >
int Execute( vtkPointSet *theInput,
- vtkPointSet *theOutput,
- vtkDataArray *theElnoPointCoords )
+ vtkPointSet *theOutput,
+ vtkDataArray *theElnoPointCoords )
{
switch( theElnoPointCoords->GetDataType() ){
case VTK_DOUBLE:
//----------------------------------------------------------------------------
int VISU_ElnoAssembleFilter::RequestData( vtkInformation *vtkNotUsed(request),
- vtkInformationVector **inputVector,
- vtkInformationVector *outputVector )
+ vtkInformationVector **inputVector,
+ vtkInformationVector *outputVector )
{
// get the info objects
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
VISU_ElnoDisassembleFilter::VISU_ElnoDisassembleFilter()
{
this->SetInputArrayToProcess( 0, // idx
- 0, // port
- 0, // connection
- vtkDataObject::FIELD_ASSOCIATION_CELLS, // field association
- "ELNO_FIELD" ); // name
+ 0, // port
+ 0, // connection
+ vtkDataObject::FIELD_ASSOCIATION_CELLS, // field association
+ "ELNO_FIELD" ); // name
this->SetInputArrayToProcess( 1, // idx
- 0, // port
- 0, // connection
- vtkDataObject::FIELD_ASSOCIATION_CELLS, // field association
- "ELNO_COMPONENT_MAPPER" ); // name
+ 0, // port
+ 0, // connection
+ vtkDataObject::FIELD_ASSOCIATION_CELLS, // field association
+ "ELNO_COMPONENT_MAPPER" ); // name
this->myShrinkFactor = -0.999;
}
//----------------------------------------------------------------------------
TExecute2( vtkUnstructuredGrid *theInput,
- vtkUnstructuredGrid *theOutput,
- vtkDataArray *theElnoDataArray,
- vtkDataArray *theElnoDataMapper,
- vtkFloatingPointType theShrinkFactor )
+ vtkUnstructuredGrid *theOutput,
+ vtkDataArray *theElnoDataArray,
+ vtkDataArray *theElnoDataMapper,
+ vtkFloatingPointType theShrinkFactor )
: myGetElnoNodeData( theElnoDataArray, theElnoDataMapper )
, myInput( theInput )
, myOutput( theOutput )
myElnoPartialDataArray = TElnoDataArray::New();
// This partial data can be represented as in terms of vectors as scalars
if ( anInputCellData->GetVectors() != NULL )
- myElnoPartialDataArray->SetNumberOfComponents( 3 );
+ myElnoPartialDataArray->SetNumberOfComponents( 3 );
else
- myElnoPartialDataArray->SetNumberOfComponents( 1 );
+ myElnoPartialDataArray->SetNumberOfComponents( 1 );
myElnoPartialDataArray->SetNumberOfTuples( aNbPoints );
myElnoPointCoords = TPointsDataArray::New();
myOutputPointsMapper->SetNumberOfTuples( aNbPoints );
if ( theShrinkFactor > 0.0 )
- this->ShrinkExecute();
+ this->ShrinkExecute();
else
- this->SimpleExecute();
+ this->SimpleExecute();
theOutput->SetPoints( aPoints );
theOutput->SetCells( theInput->GetCellTypesArray(),
- theInput->GetCellLocationsArray(),
- myConnectivity );
+ theInput->GetCellLocationsArray(),
+ myConnectivity );
myConnectivity->Delete();
myElnoFullDataArray->Delete();
if ( anInputCellData->GetVectors() != NULL )
- myOutputPointData->SetVectors( myElnoPartialDataArray );
+ myOutputPointData->SetVectors( myElnoPartialDataArray );
else
- myOutputPointData->SetScalars( myElnoPartialDataArray );
+ myOutputPointData->SetScalars( myElnoPartialDataArray );
myElnoPartialDataArray->Delete();
myOutputPointData->AddArray( myElnoPointCoords );
vtkIdType aNbPts = 0, *aPts = 0;
for ( vtkIdType aCellId = 0; myConnectivity->GetNextCell( aNbPts, aPts ); aCellId++ ) {
for ( vtkIdType aPntId = 0; aPntId < aNbPts; aPntId++ ) {
- TPointsDataType aCoords[ 3 ];
- vtkIdType aCurrentPntId = aPts[ aPntId ];
- myInputPointsArray->GetTupleValue( aCurrentPntId, aCoords );
-
- aPts[ aPntId ] = myOutputPointsArray->InsertNextTupleValue( aCoords );
- vtkIdType aNewPntId = aPts[ aPntId ];
-
- myElnoPointCoords->SetTupleValue( aNewPntId, aCoords );
-
- myOutputPointData->CopyData( myInputPointData, aCurrentPntId, aNewPntId );
-
- TElnoDataType* anElnoData = myGetElnoNodeData( aCellId, aPntId );
- myElnoFullDataArray->SetTupleValue( aNewPntId, anElnoData );
-
- myElnoFullDataArray->GetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
- myElnoPartialDataArray->SetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
-
- myInputPointsMapper->GetTupleValue( aCurrentPntId, &anPointsMapperValues[ 0 ] );
- myOutputPointsMapper->SetTupleValue( aNewPntId, &anPointsMapperValues[ 0 ] );
+ TPointsDataType aCoords[ 3 ];
+ vtkIdType aCurrentPntId = aPts[ aPntId ];
+ myInputPointsArray->GetTupleValue( aCurrentPntId, aCoords );
+
+ aPts[ aPntId ] = myOutputPointsArray->InsertNextTupleValue( aCoords );
+ vtkIdType aNewPntId = aPts[ aPntId ];
+
+ myElnoPointCoords->SetTupleValue( aNewPntId, aCoords );
+
+ myOutputPointData->CopyData( myInputPointData, aCurrentPntId, aNewPntId );
+
+ TElnoDataType* anElnoData = myGetElnoNodeData( aCellId, aPntId );
+ myElnoFullDataArray->SetTupleValue( aNewPntId, anElnoData );
+
+ myElnoFullDataArray->GetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
+ myElnoPartialDataArray->SetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
+
+ myInputPointsMapper->GetTupleValue( aCurrentPntId, &anPointsMapperValues[ 0 ] );
+ myOutputPointsMapper->SetTupleValue( aNewPntId, &anPointsMapperValues[ 0 ] );
}
}
}
myConnectivity->InitTraversal();
vtkIdType aNbPts = 0, *aPts = 0;
for ( vtkIdType aCellId = 0; myConnectivity->GetNextCell( aNbPts, aPts ); aCellId++ ) {
-
- TPointsDataType aCenter[ 3 ] = { TPointsDataType(), TPointsDataType(), TPointsDataType() };
-
- for ( vtkIdType aPntId = 0; aPntId < aNbPts; aPntId++ ) {
- TPointsDataType aCoords[ 3 ];
- myInputPointsArray->GetTupleValue( aPts[ aPntId ], aCoords );
-
- aCenter[ 0 ] += aCoords[ 0 ];
- aCenter[ 1 ] += aCoords[ 1 ];
- aCenter[ 2 ] += aCoords[ 2 ];
- }
-
- aCenter[ 0 ] /= aNbPts;
- aCenter[ 1 ] /= aNbPts;
- aCenter[ 2 ] /= aNbPts;
-
- for ( vtkIdType aPntId = 0; aPntId < aNbPts; aPntId++ ) {
- TPointsDataType aCoords[ 3 ];
- vtkIdType aCurrentPntId = aPts[ aPntId ];
- myInputPointsArray->GetTupleValue( aCurrentPntId, aCoords );
-
- TPointsDataType aNewCoords[ 3 ];
-
- aNewCoords[ 0 ] = aCenter[ 0 ] +
- TPointsDataType( myShrinkFactor * ( aCoords[ 0 ] - aCenter[ 0 ] ) );
- aNewCoords[ 1 ] = aCenter[ 1 ] +
- TPointsDataType( myShrinkFactor * ( aCoords[ 1 ] - aCenter[ 1 ] ) );
- aNewCoords[ 2 ] = aCenter[ 2 ] +
- TPointsDataType( myShrinkFactor * ( aCoords[ 2 ] - aCenter[ 2 ] ) );
-
- aPts[ aPntId ] = myOutputPointsArray->InsertNextTupleValue( aNewCoords );
- vtkIdType aNewPntId = aPts[ aPntId ];
-
- myElnoPointCoords->SetTupleValue( aNewPntId, aCoords );
-
- myOutputPointData->CopyData( myInputPointData, aCurrentPntId, aNewPntId );
-
- TElnoDataType* anElnoData = myGetElnoNodeData( aCellId, aPntId );
- myElnoFullDataArray->SetTupleValue( aNewPntId, anElnoData );
-
- myElnoFullDataArray->GetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
- myElnoPartialDataArray->SetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
-
- myInputPointsMapper->GetTupleValue( aCurrentPntId, &anPointsMapperValues[ 0 ] );
- myOutputPointsMapper->SetTupleValue( aNewPntId, &anPointsMapperValues[ 0 ] );
- }
+
+ TPointsDataType aCenter[ 3 ] = { TPointsDataType(), TPointsDataType(), TPointsDataType() };
+
+ for ( vtkIdType aPntId = 0; aPntId < aNbPts; aPntId++ ) {
+ TPointsDataType aCoords[ 3 ];
+ myInputPointsArray->GetTupleValue( aPts[ aPntId ], aCoords );
+
+ aCenter[ 0 ] += aCoords[ 0 ];
+ aCenter[ 1 ] += aCoords[ 1 ];
+ aCenter[ 2 ] += aCoords[ 2 ];
+ }
+
+ aCenter[ 0 ] /= aNbPts;
+ aCenter[ 1 ] /= aNbPts;
+ aCenter[ 2 ] /= aNbPts;
+
+ for ( vtkIdType aPntId = 0; aPntId < aNbPts; aPntId++ ) {
+ TPointsDataType aCoords[ 3 ];
+ vtkIdType aCurrentPntId = aPts[ aPntId ];
+ myInputPointsArray->GetTupleValue( aCurrentPntId, aCoords );
+
+ TPointsDataType aNewCoords[ 3 ];
+
+ aNewCoords[ 0 ] = aCenter[ 0 ] +
+ TPointsDataType( myShrinkFactor * ( aCoords[ 0 ] - aCenter[ 0 ] ) );
+ aNewCoords[ 1 ] = aCenter[ 1 ] +
+ TPointsDataType( myShrinkFactor * ( aCoords[ 1 ] - aCenter[ 1 ] ) );
+ aNewCoords[ 2 ] = aCenter[ 2 ] +
+ TPointsDataType( myShrinkFactor * ( aCoords[ 2 ] - aCenter[ 2 ] ) );
+
+ aPts[ aPntId ] = myOutputPointsArray->InsertNextTupleValue( aNewCoords );
+ vtkIdType aNewPntId = aPts[ aPntId ];
+
+ myElnoPointCoords->SetTupleValue( aNewPntId, aCoords );
+
+ myOutputPointData->CopyData( myInputPointData, aCurrentPntId, aNewPntId );
+
+ TElnoDataType* anElnoData = myGetElnoNodeData( aCellId, aPntId );
+ myElnoFullDataArray->SetTupleValue( aNewPntId, anElnoData );
+
+ myElnoFullDataArray->GetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
+ myElnoPartialDataArray->SetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
+
+ myInputPointsMapper->GetTupleValue( aCurrentPntId, &anPointsMapperValues[ 0 ] );
+ myOutputPointsMapper->SetTupleValue( aNewPntId, &anPointsMapperValues[ 0 ] );
+ }
}
}
};
//----------------------------------------------------------------------------
template < int points_type, int elno_type >
int Execute2( vtkUnstructuredGrid *theInput,
- vtkUnstructuredGrid *theOutput,
- vtkDataArray *theElnoDataArray,
- vtkDataArray *theElnoDataMapper,
- vtkFloatingPointType theShrinkFactor )
+ vtkUnstructuredGrid *theOutput,
+ vtkDataArray *theElnoDataArray,
+ vtkDataArray *theElnoDataMapper,
+ vtkFloatingPointType theShrinkFactor )
{
TExecute2< points_type, elno_type >( theInput,
- theOutput,
- theElnoDataArray,
- theElnoDataMapper,
- theShrinkFactor );
+ theOutput,
+ theElnoDataArray,
+ theElnoDataMapper,
+ theShrinkFactor );
return 1;
}
//----------------------------------------------------------------------------
template < int points_type >
int Execute( vtkUnstructuredGrid *theInput,
- vtkUnstructuredGrid *theOutput,
- vtkDataArray *theElnoDataArray,
- vtkDataArray *theElnoDataMapper,
- vtkFloatingPointType theShrinkFactor )
+ vtkUnstructuredGrid *theOutput,
+ vtkDataArray *theElnoDataArray,
+ vtkDataArray *theElnoDataMapper,
+ vtkFloatingPointType theShrinkFactor )
{
switch( theElnoDataArray->GetDataType() ){
case VTK_DOUBLE:
return Execute2< points_type, VTK_DOUBLE >
- ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor );
+ ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor );
case VTK_FLOAT:
return Execute2< points_type, VTK_FLOAT >
- ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor );
+ ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor );
case VTK_INT:
return Execute2< points_type, VTK_INT >
- ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor );
+ ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor );
case VTK_LONG:
return Execute2< points_type, VTK_LONG >
- ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor );
+ ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor );
default:
break;
}
//----------------------------------------------------------------------------
int VISU_ElnoDisassembleFilter::RequestData( vtkInformation *vtkNotUsed(request),
- vtkInformationVector **inputVector,
- vtkInformationVector *outputVector )
+ vtkInformationVector **inputVector,
+ vtkInformationVector *outputVector )
{
// get the info objects
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
template<typename TValueType>
void
Module2Scalars(vtkDataArray *theInputDataArray,
- TValueType* theOutputPtr,
- vtkIdType theNbOfTuples)
+ TValueType* theOutputPtr,
+ vtkIdType theNbOfTuples)
{
vtkIdType aNbComp = theInputDataArray->GetNumberOfComponents();
std::vector<vtkFloatingPointType> anArray(aNbComp < 3? 3: aNbComp);
theInputDataArray->GetTuple(aTupleId, &anArray[0]);
vtkFloatingPointType aVector[3] = {anArray[0], anArray[1], anArray[2]};
vtkFloatingPointType aScalar = sqrt(aVector[0]*aVector[0] +
- aVector[1]*aVector[1] +
- aVector[2]*aVector[2]);
+ aVector[1]*aVector[1] +
+ aVector[2]*aVector[2]);
*theOutputPtr = TValueType(aScalar);
theOutputPtr++;
}
template<typename TValueType>
void
LinearTransformVectors(TValueType* theInputPtr,
- TValueType* theOutputPtr,
- vtkIdType theNbOfTuples,
- vtkFloatingPointType theScale[3])
+ TValueType* theOutputPtr,
+ vtkIdType theNbOfTuples,
+ vtkFloatingPointType theScale[3])
{
for(vtkIdType aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++){
for(vtkIdType aComponentId = 0; aComponentId < 3; aComponentId++){
template<typename TValueType>
void
NonLinearTransformVectors(vtkDataArray *theInputVectors,
- TValueType* theInputPtr,
- TValueType* theOutputPtr,
- vtkIdType theNbOfTuples,
- vtkFloatingPointType theScale[3],
- VISU_FieldTransform::TTransformFun theFunction,
- vtkFloatingPointType theModifiedScalarMin,
- vtkFloatingPointType theModifiedScalarDelta,
- vtkFloatingPointType theSourceScalarMax)
+ TValueType* theInputPtr,
+ TValueType* theOutputPtr,
+ vtkIdType theNbOfTuples,
+ vtkFloatingPointType theScale[3],
+ VISU_FieldTransform::TTransformFun theFunction,
+ vtkFloatingPointType theModifiedScalarMin,
+ vtkFloatingPointType theModifiedScalarDelta,
+ vtkFloatingPointType theSourceScalarMax)
{
for(vtkIdType aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++){
vtkFloatingPointType anInputVector[3];
vtkFloatingPointType aMagnification = vtkMath::Norm(anInputVector);
if(aMagnification > Tolerance)
aMagnification =
- ((*theFunction)(aMagnification) - theModifiedScalarMin) /
- theModifiedScalarDelta * theSourceScalarMax /
- aMagnification;
+ ((*theFunction)(aMagnification) - theModifiedScalarMin) /
+ theModifiedScalarDelta * theSourceScalarMax /
+ aMagnification;
if(aMagnification < 0.0)
aMagnification = 0.0;
for(vtkIdType aComponentId = 0; aComponentId < 3; aComponentId++){
template<typename TDataSetAttributesType>
void
ExecuteVectors(VISU_FieldTransform::TTransformFun theFunction,
- VTKViewer_Transform* theTransform,
- vtkFloatingPointType theScalarRange[2],
- vtkIdType theNbOfTuples,
- TDataSetAttributesType* theInputData,
- TDataSetAttributesType* theOutputData)
+ VTKViewer_Transform* theTransform,
+ vtkFloatingPointType theScalarRange[2],
+ vtkIdType theNbOfTuples,
+ TDataSetAttributesType* theInputData,
+ TDataSetAttributesType* theOutputData)
{
vtkDataArray *anInputVectors = theInputData->GetVectors();
if(!anInputVectors || theNbOfTuples < 1)
if(theFunction == &(VISU_FieldTransform::Ident)){
switch(anInputDataType){
vtkTemplateMacro4(LinearTransformVectors,
- (VTK_TT *)(anInputPtr),
- (VTK_TT *)(anOutputPtr),
- theNbOfTuples,
- aScale);
+ (VTK_TT *)(anInputPtr),
+ (VTK_TT *)(anOutputPtr),
+ theNbOfTuples,
+ aScale);
default:
break;
}
}else{
switch(anInputDataType){
vtkTemplateMacro9(NonLinearTransformVectors,
- anInputVectors,
- (VTK_TT *)(anInputPtr),
- (VTK_TT *)(anOutputPtr),
- theNbOfTuples,
- aScale,
- theFunction,
- aScalarRange[0],
- aScalarDelta,
- theScalarRange[1]);
+ anInputVectors,
+ (VTK_TT *)(anInputPtr),
+ (VTK_TT *)(anOutputPtr),
+ theNbOfTuples,
+ aScale,
+ theFunction,
+ aScalarRange[0],
+ aScalarDelta,
+ theScalarRange[1]);
default:
break;
}
template<typename TValueType>
void
NonLinearTransformScalars(vtkDataArray *theInputScalars,
- TValueType* theInputPtr,
- TValueType* theOutputPtr,
- vtkIdType theNbOfTuples,
- VISU_FieldTransform::TTransformFun theFunction,
- vtkFloatingPointType theModifiedScalarMin)
+ TValueType* theInputPtr,
+ TValueType* theOutputPtr,
+ vtkIdType theNbOfTuples,
+ VISU_FieldTransform::TTransformFun theFunction,
+ vtkFloatingPointType theModifiedScalarMin)
{
for(vtkIdType aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++){
vtkFloatingPointType aScalar = (*theFunction)(vtkFloatingPointType(*theInputPtr));
template<typename TDataSetAttributesType>
void
ExecuteScalars(VISU_FieldTransform::TTransformFun theFunction,
- vtkFloatingPointType theScalarRange[2],
- vtkIdType theNbOfTuples,
- TDataSetAttributesType* theInputData,
- TDataSetAttributesType* theOutputData)
+ vtkFloatingPointType theScalarRange[2],
+ vtkIdType theNbOfTuples,
+ TDataSetAttributesType* theInputData,
+ TDataSetAttributesType* theOutputData)
{
vtkDataArray *anInputScalars = theInputData->GetScalars();
if(!anInputScalars || theNbOfTuples < 1)
switch(anInputDataType){
vtkTemplateMacro6(NonLinearTransformScalars,
- anInputScalars,
- (VTK_TT *)(anInputPtr),
- (VTK_TT *)(anOutputPtr),
- theNbOfTuples,
- theFunction,
- aScalarRange[0]);
+ anInputScalars,
+ (VTK_TT *)(anInputPtr),
+ (VTK_TT *)(anOutputPtr),
+ theNbOfTuples,
+ theFunction,
+ aScalarRange[0]);
default:
break;
}
int
VISU_FieldTransform
::RequestData(vtkInformation *vtkNotUsed(request),
- vtkInformationVector **inputVector,
- vtkInformationVector *outputVector)
+ vtkInformationVector **inputVector,
+ vtkInformationVector *outputVector)
{
// get the info objects
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
output->GetCellData()->CopyVectorsOff();
ExecuteScalars(myFunction,
- myScalarRange,
- input->GetNumberOfPoints(),
- input->GetPointData(),
- output->GetPointData());
+ myScalarRange,
+ input->GetNumberOfPoints(),
+ input->GetPointData(),
+ output->GetPointData());
ExecuteVectors(myFunction,
- myTransform,
- myScalarRange,
- input->GetNumberOfPoints(),
- input->GetPointData(),
- output->GetPointData());
+ myTransform,
+ myScalarRange,
+ input->GetNumberOfPoints(),
+ input->GetPointData(),
+ output->GetPointData());
ExecuteScalars(myFunction,
- myScalarRange,
- input->GetNumberOfCells(),
- input->GetCellData(),
- output->GetCellData());
+ myScalarRange,
+ input->GetNumberOfCells(),
+ input->GetCellData(),
+ output->GetCellData());
ExecuteVectors(myFunction,
- myTransform,
- myScalarRange,
- input->GetNumberOfCells(),
- input->GetCellData(),
- output->GetCellData());
+ myTransform,
+ myScalarRange,
+ input->GetNumberOfCells(),
+ input->GetCellData(),
+ output->GetCellData());
}else{
output->GetPointData()->CopyAllOn();
output->GetCellData()->CopyAllOn();
void
VISU_GaussPointsPL
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
VISU_MergedPL::DoShallowCopy(thePipeLine, theIsCopyInput);
vtkSmartPointer<vtkImageData>
VISU_GaussPointsPL
::MakeTexture( const char* theMainTexture,
- const char* theAlphaTexture )
+ const char* theAlphaTexture )
{
if( !theMainTexture || !theAlphaTexture )
return 0;
* for rendering the Gauss Points as Point Sprites.
*/
class VISU_PIPELINE_EXPORT VISU_GaussPointsPL : public VISU_MergedPL,
- public VISU_ColoredPL
+ public VISU_ColoredPL
{
public:
//----------------------------------------------------------------------------
static
vtkSmartPointer<vtkImageData>
MakeTexture( const char* theMainTexture,
- const char* theAlphaTexture );
+ const char* theAlphaTexture );
public:
//----------------------------------------------------------------------------
virtual
void
DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
private:
//----------------------------------------------------------------------------
theRenderer->ViewToWorld(P[0][0],P[0][1],P[0][2]);
theRenderer->ViewToWorld(P[1][0],P[1][1],P[1][2]);
vtkFloatingPointType aWorldDiag = sqrt((P[1][0]-P[0][0])*(P[1][0]-P[0][0])+
- (P[1][1]-P[0][1])*(P[1][1]-P[0][1])+
- (P[1][2]-P[0][2])*(P[1][2]-P[0][2]));
+ (P[1][1]-P[0][1])*(P[1][1]-P[0][1])+
+ (P[1][2]-P[0][2])*(P[1][2]-P[0][2]));
int* aSize = theRenderer->GetRenderWindow()->GetSize();
vtkFloatingPointType aWinDiag = sqrt(vtkFloatingPointType(aSize[0]*aSize[0]+aSize[1]*aSize[1]));
vtkDataSet* aDataSet = GetMapper()->GetInput();
void
VISU_IsoSurfacesPL
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
Superclass::Build();
VISU::CellDataToPoint(myContourFilter,
- myCellDataToPointData,
- GetMergedInput());
+ myCellDataToPointData,
+ GetMergedInput());
}
virtual
void
DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
int myNbParts;
vtkFloatingPointType myRange[2];
//----------------------------------------------------------------------------
int VISU_LabelPointsFilter::RequestData(vtkInformation* vtkNotUsed(request),
- vtkInformationVector** inputVector,
- vtkInformationVector* outputVector)
+ vtkInformationVector** inputVector,
+ vtkInformationVector* outputVector)
{
// get the info objects
vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
}
int VISU_LabelPointsFilter::RequestUpdateExtent(vtkInformation* vtkNotUsed(request),
- vtkInformationVector** inputVector,
- vtkInformationVector* outputVector)
+ vtkInformationVector** inputVector,
+ vtkInformationVector* outputVector)
{
// get the info objects
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
int VISU_LabelPointsFilter::GetRegions(vtkPolyData* theInput,
- vtkPolyData* theOutput)
+ vtkPolyData* theOutput)
{
vtkIdType cellId, i;
vtkIdType numPts, numCells;
aWave->InsertNextId(cellId);
aPointNumber = 0;
TraverseAndMark(aWave, aWave2, aVisited, aPointMap,
- aRegionNumber, aPointNumber, aMesh);
+ aRegionNumber, aPointNumber, aMesh);
if (aPointNumber >= myPointsNb) {
- std::set<vtkIdType, ltIdType> aIdxSet;
- for (i=0; i < numPts; i++) {
- if ( aPointMap[i] > -1 ) {
- aIdxSet.insert(i);
- aPointMap[i] = -1;
- }
- }
- std::vector<vtkIdType> aIdx(aIdxSet.begin(), aIdxSet.end());
- int aActualPts = aIdx.size();
- int aNewId;
- if (myPointsNb > 2) {
- int k = aActualPts/(myPointsNb - 1);
- int count;
- for (i=0, count = 0; i < aActualPts; i+=k, count++) {
- aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[i]));
- aOutPD->CopyData(aInpPD, aIdx[i], aNewId);
- }
- if (count < myPointsNb) {
- aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[aActualPts - 1]));
- aOutPD->CopyData(aInpPD, aIdx[aActualPts - 1], aNewId);
- }
- } else {
- aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[0]));
- aOutPD->CopyData(aInpPD, aIdx[0], aNewId);
- if (myPointsNb == 2) {
- aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[aActualPts - 1]));
- aOutPD->CopyData(aInpPD, aIdx[aActualPts - 1], aNewId);
- }
- }
+ std::set<vtkIdType, ltIdType> aIdxSet;
+ for (i=0; i < numPts; i++) {
+ if ( aPointMap[i] > -1 ) {
+ aIdxSet.insert(i);
+ aPointMap[i] = -1;
+ }
+ }
+ std::vector<vtkIdType> aIdx(aIdxSet.begin(), aIdxSet.end());
+ int aActualPts = aIdx.size();
+ int aNewId;
+ if (myPointsNb > 2) {
+ int k = aActualPts/(myPointsNb - 1);
+ int count;
+ for (i=0, count = 0; i < aActualPts; i+=k, count++) {
+ aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[i]));
+ aOutPD->CopyData(aInpPD, aIdx[i], aNewId);
+ }
+ if (count < myPointsNb) {
+ aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[aActualPts - 1]));
+ aOutPD->CopyData(aInpPD, aIdx[aActualPts - 1], aNewId);
+ }
+ } else {
+ aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[0]));
+ aOutPD->CopyData(aInpPD, aIdx[0], aNewId);
+ if (myPointsNb == 2) {
+ aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[aActualPts - 1]));
+ aOutPD->CopyData(aInpPD, aIdx[aActualPts - 1], aNewId);
+ }
+ }
}
aWave->Reset();
aWave2->Reset();
// traversal occurs across shared vertices.
//
void VISU_LabelPointsFilter::TraverseAndMark (vtkIdList* theWave,
- vtkIdList* theWave2,
- int* theVisited,
- vtkIdType* thePointMap,
- int& theRegionNumber,
- vtkIdType& thePointNumber,
- vtkPolyData* theMesh)
+ vtkIdList* theWave2,
+ int* theVisited,
+ vtkIdType* thePointMap,
+ int& theRegionNumber,
+ vtkIdType& thePointNumber,
+ vtkPolyData* theMesh)
{
vtkIdType cellId, ptId, numIds, i;
int j, k;
if ( theVisited[cellId] < 0 ) {
theVisited[cellId] = theRegionNumber;
theMesh->GetCellPoints(cellId, npts, pts);
-
+
for (j=0; j < npts; j++) {
if ( thePointMap[ptId=pts[j]] < 0 ) {
thePointMap[ptId] = thePointNumber++;
- }
+ }
theMesh->GetPointCells(ptId,ncells,cells);
-
+
// check connectivity criterion (geometric + scalar)
for (k=0; k < ncells; k++) {
cellId = cells[k];
- theWave2->InsertNextId(cellId);
- // }
- }//for all cells using this point
- }//for all points of this cell
+ theWave2->InsertNextId(cellId);
+ // }
+ }//for all cells using this point
+ }//for all points of this cell
}//if cell not yet visited
}//for all cells in this wave
void TraverseAndMark (vtkIdList* theWave,
- vtkIdList* theWave2,
- int* theVisited,
- vtkIdType* thePointMap,
- int& theRegionNumber,
- vtkIdType& thePointNumber,
- vtkPolyData* theMesh);
+ vtkIdList* theWave2,
+ int* theVisited,
+ vtkIdType* thePointMap,
+ int& theRegionNumber,
+ vtkIdType& thePointNumber,
+ vtkPolyData* theMesh);
int GetRegions(vtkPolyData* theInput,
- vtkPolyData* theOutput);
+ vtkPolyData* theOutput);
int myPointsNb;
virtual void ForceBuild();
virtual void MapScalarsThroughTable2(void *input, unsigned char *output,
- int inputDataType, int numberOfValues,
- int inputIncrement, int outputIncrement);
+ int inputDataType, int numberOfValues,
+ int inputIncrement, int outputIncrement);
vtkFloatingPointType GetMapScale() { return myScale; }
void SetMapScale(vtkFloatingPointType theScale = 1.0);
void SetBicolor( bool theBicolor );
static int ComputeLogRange( vtkFloatingPointType inRange[2],
- vtkFloatingPointType outRange[2] );
+ vtkFloatingPointType outRange[2] );
unsigned char *MapValue(vtkFloatingPointType v);
void MarkValueByColor( vtkFloatingPointType theValue,
- unsigned char* theColor );
+ unsigned char* theColor );
bool HasMarkedValues() const { return myHasMarkedValues; }
void
VISU_MapperHolder
::ShallowCopy(VISU_MapperHolder *theMapperHolder,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
if(theIsCopyInput)
SetIDMapper(theMapperHolder->GetIDMapper());
VISU::CopyMapper(GetMapper(),
- theMapperHolder->GetMapper(),
- theIsCopyInput);
+ theMapperHolder->GetMapper(),
+ theIsCopyInput);
}
virtual
void
ShallowCopy(VISU_MapperHolder *theMapperHolder,
- bool theIsCopyInput);
+ bool theIsCopyInput);
//! Gets memory size used by the instance (bytes).
virtual
void
VISU_MergedPL
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
if(VISU_MergedPL *aPipeLine = dynamic_cast<VISU_MergedPL*>(thePipeLine)){
if ( this == aPipeLine )
ClearGeometry();
int aNbOfGeometry = aPipeLine->GetNumberOfGeometry();
for ( int aGeomNumber = 0; aGeomNumber < aNbOfGeometry; aGeomNumber++ ) {
- VISU::TName aGeomName;
- AddGeometry( aPipeLine->GetGeometry( aGeomNumber, aGeomName ), aGeomName );
+ VISU::TName aGeomName;
+ AddGeometry( aPipeLine->GetGeometry( aGeomNumber, aGeomName ), aGeomName );
}
}else
SetSourceGeometry();
virtual
void
DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
virtual
void
//----------------------------------------------------------------------------
class VISU_PIPELINE_EXPORT VISU_MeshPL : public VISU_PipeLine,
- public VISU_UnstructuredGridPL
+ public VISU_UnstructuredGridPL
{
public:
vtkTypeMacro(VISU_MeshPL, VISU_PipeLine);
int* aSize = GetImageData()->GetDimensions();
unsigned char* dataPtr = (unsigned char*)GetImageData()->GetScalarPointer();
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, aSize[0], aSize[1], 0,
- GL_RGBA, GL_UNSIGNED_BYTE, dataPtr );
+ GL_RGBA, GL_UNSIGNED_BYTE, dataPtr );
//glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glEnable( GL_TEXTURE_2D );
//-----------------------------------------------------------------------------
template < class TCoordinates >
void DrawPoints( TCoordinates *theStartPoints,
- vtkCellArray *theCells,
- TColorFunctorBase* theColorFunctor,
- TVertex* theVertexArr,
- vtkIdType &theCellId,
- vtkIdType &theVertexId )
+ vtkCellArray *theCells,
+ TColorFunctorBase* theColorFunctor,
+ TVertex* theVertexArr,
+ vtkIdType &theCellId,
+ vtkIdType &theVertexId )
{
vtkIdType *ptIds = theCells->GetPointer();
vtkIdType *endPtIds = ptIds + theCells->GetNumberOfConnectivityEntries();
//-----------------------------------------------------------------------------
template < class TCoordinates >
void DrawCellsPoints( vtkPolyData *theInput,
- vtkPoints* thePoints,
- TColorFunctorBase* theColorFunctor,
- TVertex* theVertexArr )
+ vtkPoints* thePoints,
+ TColorFunctorBase* theColorFunctor,
+ TVertex* theVertexArr )
{
vtkIdType aCellId = 0, aVertexId = 0;
glPointSize( this->DefaultPointSize );
{
- TColorFunctorBase* aColorFunctor = NULL;
- if( colors && this->PointSpriteMode != 1 ) {
- if ( cellScalars )
- aColorFunctor = new TCellColors2Color( colors );
- else
- aColorFunctor = new TPointColors2Color( colors );
- } else {
- aColorFunctor = new TPropertyColor( theActor->GetProperty() );
- }
- if ( points->GetDataType() == VTK_FLOAT )
- ::DrawCellsPoints< float >( input, points, aColorFunctor, aVertexArr );
- else
- ::DrawCellsPoints< double >( input, points, aColorFunctor, aVertexArr );
-
- delete aColorFunctor;
+ TColorFunctorBase* aColorFunctor = NULL;
+ if( colors && this->PointSpriteMode != 1 ) {
+ if ( cellScalars )
+ aColorFunctor = new TCellColors2Color( colors );
+ else
+ aColorFunctor = new TPointColors2Color( colors );
+ } else {
+ aColorFunctor = new TPropertyColor( theActor->GetProperty() );
+ }
+ if ( points->GetDataType() == VTK_FLOAT )
+ ::DrawCellsPoints< float >( input, points, aColorFunctor, aVertexArr );
+ else
+ ::DrawCellsPoints< double >( input, points, aColorFunctor, aVertexArr );
+
+ delete aColorFunctor;
}
if( this->ExtensionsInitialized ) {
- GLuint aBufferObjectID = 0;
- vglGenBuffersARB( 1, &aBufferObjectID );
- vglBindBufferARB( GL_ARRAY_BUFFER_ARB, aBufferObjectID );
-
- int anArrayObjectSize = sizeof( TVertex ) * aTotalConnectivitySize;
- vglBufferDataARB( GL_ARRAY_BUFFER_ARB, anArrayObjectSize, aVertexArr, GL_STATIC_DRAW_ARB );
-
- delete [] aVertexArr;
-
- vglBindBufferARB( GL_ARRAY_BUFFER_ARB, 0 );
- vglBindBufferARB( GL_ARRAY_BUFFER_ARB, aBufferObjectID );
-
- glColorPointer( 4, GL_FLOAT, sizeof(TVertex), (void*)0 );
- glVertexPointer( 3, GL_FLOAT, sizeof(TVertex), (void*)(4*sizeof(GLfloat)) );
-
- glEnableClientState( GL_VERTEX_ARRAY );
- glEnableClientState( GL_COLOR_ARRAY );
-
- glDrawArrays( GL_POINTS, 0, aTotalConnectivitySize );
-
- glDisableClientState( GL_COLOR_ARRAY );
- glDisableClientState( GL_VERTEX_ARRAY );
-
- vglDeleteBuffersARB( 1, &aBufferObjectID );
+ GLuint aBufferObjectID = 0;
+ vglGenBuffersARB( 1, &aBufferObjectID );
+ vglBindBufferARB( GL_ARRAY_BUFFER_ARB, aBufferObjectID );
+
+ int anArrayObjectSize = sizeof( TVertex ) * aTotalConnectivitySize;
+ vglBufferDataARB( GL_ARRAY_BUFFER_ARB, anArrayObjectSize, aVertexArr, GL_STATIC_DRAW_ARB );
+
+ delete [] aVertexArr;
+
+ vglBindBufferARB( GL_ARRAY_BUFFER_ARB, 0 );
+ vglBindBufferARB( GL_ARRAY_BUFFER_ARB, aBufferObjectID );
+
+ glColorPointer( 4, GL_FLOAT, sizeof(TVertex), (void*)0 );
+ glVertexPointer( 3, GL_FLOAT, sizeof(TVertex), (void*)(4*sizeof(GLfloat)) );
+
+ glEnableClientState( GL_VERTEX_ARRAY );
+ glEnableClientState( GL_COLOR_ARRAY );
+
+ glDrawArrays( GL_POINTS, 0, aTotalConnectivitySize );
+
+ glDisableClientState( GL_COLOR_ARRAY );
+ glDisableClientState( GL_VERTEX_ARRAY );
+
+ vglDeleteBuffersARB( 1, &aBufferObjectID );
} else { // there are not extensions
- glColorPointer( 4, GL_FLOAT, sizeof(TVertex), aVertexArr );
- glVertexPointer( 3, GL_FLOAT, sizeof(TVertex),
- (void*)((GLfloat*)((void*)(aVertexArr)) + 4));
-
- glEnableClientState( GL_VERTEX_ARRAY );
- glEnableClientState( GL_COLOR_ARRAY );
-
- glDrawArrays( GL_POINTS, 0, aTotalConnectivitySize );
-
- glDisableClientState( GL_COLOR_ARRAY );
- glDisableClientState( GL_VERTEX_ARRAY );
-
- delete [] aVertexArr;
+ glColorPointer( 4, GL_FLOAT, sizeof(TVertex), aVertexArr );
+ glVertexPointer( 3, GL_FLOAT, sizeof(TVertex),
+ (void*)((GLfloat*)((void*)(aVertexArr)) + 4));
+
+ glEnableClientState( GL_VERTEX_ARRAY );
+ glEnableClientState( GL_COLOR_ARRAY );
+
+ glDrawArrays( GL_POINTS, 0, aTotalConnectivitySize );
+
+ glDisableClientState( GL_COLOR_ARRAY );
+ glDisableClientState( GL_VERTEX_ARRAY );
+
+ delete [] aVertexArr;
}
}
void
VISU_PipeLine
::ShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
SetImplicitFunction(thePipeLine->GetImplicitFunction());
DoShallowCopy(thePipeLine, theIsCopyInput);
void
VISU_PipeLine
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
GetMapperHolder()->ShallowCopy(thePipeLine->GetMapperHolder(),
- theIsCopyInput);
+ theIsCopyInput);
}
void
VISU_PipeLine
::SetPlaneParam(vtkFloatingPointType theDir[3],
- vtkFloatingPointType theDist,
- vtkPlane* thePlane)
+ vtkFloatingPointType theDist,
+ vtkPlane* thePlane)
{
thePlane->SetNormal(theDir);
vtkFloatingPointType anOrigin[3];
VISU::DistanceToPosition(GetInput(),
- theDir,
- theDist,
- anOrigin);
+ theDir,
+ theDist,
+ anOrigin);
thePlane->SetOrigin(anOrigin);
}
void
VISU_PipeLine
::GetPlaneParam(vtkFloatingPointType theDir[3],
- vtkFloatingPointType& theDist,
- vtkPlane* thePlane)
+ vtkFloatingPointType& theDist,
+ vtkPlane* thePlane)
{
thePlane->GetNormal(theDir);
thePlane->GetOrigin(anOrigin);
VISU::PositionToDistance(GetInput(),
- theDir,
- anOrigin,
- theDist);
+ theDir,
+ anOrigin,
+ theDist);
}
try{
size_t aSize = size_t(theSize);
if(char *aCheck = new char[aSize]){
- delete [] aCheck;
- return aSize;
+ delete [] aCheck;
+ return aSize;
}
}catch(std::bad_alloc& exc){
}catch(...){
size_t
VISU_PipeLine
::GetAvailableMemory(size_t theSize,
- size_t theMinSize)
+ size_t theMinSize)
{
// Finds acceptable memory size by half-deflection methods
static double EPSILON = 2 * 1024;
virtual
void
ShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
virtual
void
virtual
void
SetPlaneParam(vtkFloatingPointType theDir[3],
- vtkFloatingPointType theDist,
- vtkPlane* thePlane);
+ vtkFloatingPointType theDist,
+ vtkPlane* thePlane);
virtual
void
GetPlaneParam(vtkFloatingPointType theDir[3],
- vtkFloatingPointType& theDist,
- vtkPlane* thePlane);
+ vtkFloatingPointType& theDist,
+ vtkPlane* thePlane);
//----------------------------------------------------------------------------
static
static
size_t
GetAvailableMemory(size_t theSize,
- size_t theMinSize = 1024*1024);
+ size_t theMinSize = 1024*1024);
protected:
//----------------------------------------------------------------------------
virtual
void
DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
//----------------------------------------------------------------------------
vtkDataSet*
//----------------------------------------------------------------------------
void
Sub(const vtkFloatingPointType A[3],
- const vtkFloatingPointType B[3],
- vtkFloatingPointType C[3])
+ const vtkFloatingPointType B[3],
+ vtkFloatingPointType C[3])
{ //A-B
for(int i = 0; i < 3; i++)
C[i] = A[i] - B[i];
//----------------------------------------------------------------------------
bool
CheckIsSameValue(vtkFloatingPointType theTarget,
- vtkFloatingPointType theSource)
+ vtkFloatingPointType theSource)
{
static vtkFloatingPointType TOL = 10.0 / VTK_LARGE_FLOAT;
if(fabs(theTarget - theSource) < TOL)
//----------------------------------------------------------------------------
bool
CheckIsSameRange(vtkFloatingPointType* theTarget,
- vtkFloatingPointType* theSource)
+ vtkFloatingPointType* theSource)
{
return CheckIsSameValue(theTarget[0], theSource[0]) &&
CheckIsSameValue(theTarget[1], theSource[1]);
//----------------------------------------------------------------------------
void
CopyMapper(vtkMapper* theTarget,
- vtkMapper* theSource,
- bool theIsCopyInput)
+ vtkMapper* theSource,
+ bool theIsCopyInput)
{
// To customize vtkMapper::ShallowCopy ...
theTarget->SetLookupTable(theSource->GetLookupTable());
if(theIsCopyInput){
vtkFloatingPointType* aScalarRange = theSource->GetScalarRange();
if(!CheckIsSameRange(theTarget->GetScalarRange(), aScalarRange))
- theTarget->SetScalarRange(aScalarRange);
+ theTarget->SetScalarRange(aScalarRange);
}
theTarget->SetColorMode(theSource->GetColorMode());
theTarget->SetScalarMode(theSource->GetScalarMode());
//----------------------------------------------------------------------------
void
CopyDataSetMapper(vtkDataSetMapper* theTarget,
- vtkDataSetMapper* theSource,
- bool theIsCopyInput)
+ vtkDataSetMapper* theSource,
+ bool theIsCopyInput)
{
// To customize vtkDataSetMapper::ShallowCopy ...
//theTarget->SetInput(theSource->GetInput());
//----------------------------------------------------------------------------
void
CopyPolyDataMapper(vtkPolyDataMapper* theTarget,
- vtkPolyDataMapper* theSource,
- bool theIsCopyInput)
+ vtkPolyDataMapper* theSource,
+ bool theIsCopyInput)
{
// To customize vtkPolyDataMapper::ShallowCopy ...
//theTarget->SetInput(theSource->GetInput());
//----------------------------------------------------------------------------
void
CopyPointSpriteDataMapper(VISU_OpenGLPointSpriteMapper* theTarget,
- VISU_OpenGLPointSpriteMapper* theSource,
- bool theIsCopyInput)
+ VISU_OpenGLPointSpriteMapper* theSource,
+ bool theIsCopyInput)
{
// To customize VISU_OpenGLPointSpriteMapper::ShallowCopy ...
theTarget->SetPrimitiveType( theSource->GetPrimitiveType() );
//----------------------------------------------------------------------------
void
ComputeBoundsParam(vtkDataSet* theDataSet,
- vtkFloatingPointType theDirection[3],
- vtkFloatingPointType theMinPnt[3],
- vtkFloatingPointType& theMaxBoundPrj,
- vtkFloatingPointType& theMinBoundPrj)
+ vtkFloatingPointType theDirection[3],
+ vtkFloatingPointType theMinPnt[3],
+ vtkFloatingPointType& theMaxBoundPrj,
+ vtkFloatingPointType& theMinBoundPrj)
{
vtkFloatingPointType aBounds[6];
theDataSet->GetBounds(aBounds);
}
vtkFloatingPointType aBoundPoints[8][3] = { {aBounds[0],aBounds[2],aBounds[4]},
- {aBounds[1],aBounds[2],aBounds[4]},
- {aBounds[0],aBounds[3],aBounds[4]},
- {aBounds[1],aBounds[3],aBounds[4]},
- {aBounds[0],aBounds[2],aBounds[5]},
- {aBounds[1],aBounds[2],aBounds[5]},
- {aBounds[0],aBounds[3],aBounds[5]},
- {aBounds[1],aBounds[3],aBounds[5]}};
+ {aBounds[1],aBounds[2],aBounds[4]},
+ {aBounds[0],aBounds[3],aBounds[4]},
+ {aBounds[1],aBounds[3],aBounds[4]},
+ {aBounds[0],aBounds[2],aBounds[5]},
+ {aBounds[1],aBounds[2],aBounds[5]},
+ {aBounds[0],aBounds[3],aBounds[5]},
+ {aBounds[1],aBounds[3],aBounds[5]}};
int aMaxId = 0, aMinId = aMaxId;
theMaxBoundPrj = vtkMath::Dot(theDirection,aBoundPoints[aMaxId]);
for(int i = 1; i < 8; i++){
vtkFloatingPointType aTmp = vtkMath::Dot(theDirection,aBoundPoints[i]);
if(theMaxBoundPrj < aTmp){
- theMaxBoundPrj = aTmp;
- aMaxId = i;
+ theMaxBoundPrj = aTmp;
+ aMaxId = i;
}
if(theMinBoundPrj > aTmp){
- theMinBoundPrj = aTmp;
- aMinId = i;
+ theMinBoundPrj = aTmp;
+ aMinId = i;
}
}
vtkFloatingPointType *aMinPnt = aBoundPoints[aMaxId];
//----------------------------------------------------------------------------
void
DistanceToPosition(vtkDataSet* theDataSet,
- vtkFloatingPointType theDirection[3],
- vtkFloatingPointType theDist,
- vtkFloatingPointType thePos[3])
+ vtkFloatingPointType theDirection[3],
+ vtkFloatingPointType theDist,
+ vtkFloatingPointType thePos[3])
{
vtkFloatingPointType aMaxBoundPrj, aMinBoundPrj, aMinPnt[3];
ComputeBoundsParam(theDataSet,
- theDirection,
- aMinPnt,
- aMaxBoundPrj,
- aMinBoundPrj);
+ theDirection,
+ aMinPnt,
+ aMaxBoundPrj,
+ aMinBoundPrj);
vtkFloatingPointType aLength = (aMaxBoundPrj-aMinBoundPrj)*theDist;
thePos[0] = aMinPnt[0] - theDirection[0] * aLength;
thePos[1] = aMinPnt[1] - theDirection[1] * aLength;
//----------------------------------------------------------------------------
void
PositionToDistance(vtkDataSet* theDataSet,
- vtkFloatingPointType theDirection[3],
- vtkFloatingPointType thePos[3],
- vtkFloatingPointType& theDist)
+ vtkFloatingPointType theDirection[3],
+ vtkFloatingPointType thePos[3],
+ vtkFloatingPointType& theDist)
{
vtkFloatingPointType aMaxBoundPrj, aMinBoundPrj, aMinPnt[3];
ComputeBoundsParam(theDataSet,
- theDirection,
- aMinPnt,
- aMaxBoundPrj,
- aMinBoundPrj);
+ theDirection,
+ aMinPnt,
+ aMaxBoundPrj,
+ aMinBoundPrj);
vtkFloatingPointType aPrj = vtkMath::Dot(theDirection,thePos);
theDist = (aPrj-aMinBoundPrj)/(aMaxBoundPrj-aMinBoundPrj);
}
{
for(int i = 0, n = theDataSet->GetNumberOfCells(); i < n; i++)
if(vtkCell* aCell = theDataSet->GetCell(i))
- if(!aCell->IsLinear())
- return true;
+ if(!aCell->IsLinear())
+ return true;
return false;
}
template<class TOutputFilter>
void
CellDataToPoint(TOutputFilter* theOutputFilter,
- vtkCellDataToPointData *theCellDataToPointData,
- vtkDataSet* theDataSet)
+ vtkCellDataToPointData *theCellDataToPointData,
+ vtkDataSet* theDataSet)
{
if(VISU::IsDataOnCells(theDataSet)){
//! Checks whether the float values are the same or not
bool VISU_PIPELINE_EXPORT
CheckIsSameValue(vtkFloatingPointType theTarget,
- vtkFloatingPointType theSource);
+ vtkFloatingPointType theSource);
//! Checks whether the scalar range is the same or not
bool VISU_PIPELINE_EXPORT
CheckIsSameRange(vtkFloatingPointType* theTarget,
- vtkFloatingPointType* theSource);
+ vtkFloatingPointType* theSource);
//! Customizes vtkMapper::ShallowCopy
void VISU_PIPELINE_EXPORT
CopyMapper(vtkMapper* theTarget,
- vtkMapper* theSource,
- bool theIsCopyInput);
+ vtkMapper* theSource,
+ bool theIsCopyInput);
//! Customizes vtkDataSetMapper::ShallowCopy
void VISU_PIPELINE_EXPORT
CopyDataSetMapper(vtkDataSetMapper* theTarget,
- vtkDataSetMapper* theSource,
- bool theIsCopyInput);
+ vtkDataSetMapper* theSource,
+ bool theIsCopyInput);
//! Customizes vtkPolyDataMapper::ShallowCopy
void VISU_PIPELINE_EXPORT
CopyPolyDataMapper(vtkPolyDataMapper* theTarget,
- vtkPolyDataMapper* theSource,
- bool theIsCopyInput);
+ vtkPolyDataMapper* theSource,
+ bool theIsCopyInput);
//! Customizes VISU_OpenGLPointSpriteMapper::ShallowCopy
void VISU_PIPELINE_EXPORT
CopyPointSpriteDataMapper(VISU_OpenGLPointSpriteMapper* theTarget,
- VISU_OpenGLPointSpriteMapper* theSource,
- bool theIsCopyInput);
+ VISU_OpenGLPointSpriteMapper* theSource,
+ bool theIsCopyInput);
//----------------------------------------------------------------------------
void VISU_PIPELINE_EXPORT
ComputeBoundsParam(vtkDataSet* theDataSet,
- vtkFloatingPointType theDirection[3],
- vtkFloatingPointType theMinPnt[3],
- vtkFloatingPointType& theMaxBoundPrj,
- vtkFloatingPointType& theMinBoundPrj);
+ vtkFloatingPointType theDirection[3],
+ vtkFloatingPointType theMinPnt[3],
+ vtkFloatingPointType& theMaxBoundPrj,
+ vtkFloatingPointType& theMinBoundPrj);
//----------------------------------------------------------------------------
void VISU_PIPELINE_EXPORT
DistanceToPosition(vtkDataSet* theDataSet,
- vtkFloatingPointType theDirection[3],
- vtkFloatingPointType theDist,
- vtkFloatingPointType thePos[3]);
+ vtkFloatingPointType theDirection[3],
+ vtkFloatingPointType theDist,
+ vtkFloatingPointType thePos[3]);
//----------------------------------------------------------------------------
void VISU_PIPELINE_EXPORT
PositionToDistance(vtkDataSet* theDataSet,
- vtkFloatingPointType theDirection[3],
- vtkFloatingPointType thePos[3],
- vtkFloatingPointType& theDist);
+ vtkFloatingPointType theDirection[3],
+ vtkFloatingPointType thePos[3],
+ vtkFloatingPointType& theDist);
//----------------------------------------------------------------------------
static
bool
IsValidPlane2Position(vtkPlane *pPx,
- vtkDataSet *pDataSet,
- vtkFloatingPointType aTol=0.003);
+ vtkDataSet *pDataSet,
+ vtkFloatingPointType aTol=0.003);
static
void
GetBndPoints(vtkDataSet *pDataSet,
- vtkFloatingPointType aPnts[24]);
+ vtkFloatingPointType aPnts[24]);
static
vtkFloatingPointType
DistanceToPlane(const vtkFloatingPointType x[3],
- const vtkFloatingPointType n[3],
- const vtkFloatingPointType p0[3]);
+ const vtkFloatingPointType n[3],
+ const vtkFloatingPointType p0[3]);
vtkCxxRevisionMacro(VISU_PlanesWidget, "$Revision$");
vtkStandardNewMacro(VISU_PlanesWidget);
vtkRenderWindowInteractor *i = this->Interactor;
if( this->HandleMoveEvent ) {
i->AddObserver(vtkCommand::MouseMoveEvent,
- this->EventCallbackCommand,
- this->Priority);
+ this->EventCallbackCommand,
+ this->Priority);
}
if( this->HandleLeftButtonEvent ) {
i->AddObserver(vtkCommand::LeftButtonPressEvent,
- this->EventCallbackCommand,
- this->Priority);
+ this->EventCallbackCommand,
+ this->Priority);
i->AddObserver(vtkCommand::LeftButtonReleaseEvent,
- this->EventCallbackCommand,
- this->Priority);
+ this->EventCallbackCommand,
+ this->Priority);
}
if( this->HandleMiddleButtonEvent ) {
i->AddObserver(vtkCommand::MiddleButtonPressEvent,
- this->EventCallbackCommand,
- this->Priority);
+ this->EventCallbackCommand,
+ this->Priority);
i->AddObserver(vtkCommand::MiddleButtonReleaseEvent,
- this->EventCallbackCommand,
- this->Priority);
+ this->EventCallbackCommand,
+ this->Priority);
}
if( this->HandleRightButtonEvent ) {
i->AddObserver(vtkCommand::RightButtonPressEvent,
- this->EventCallbackCommand,
- this->Priority);
+ this->EventCallbackCommand,
+ this->Priority);
i->AddObserver(vtkCommand::RightButtonReleaseEvent,
- this->EventCallbackCommand,
- this->Priority);
+ this->EventCallbackCommand,
+ this->Priority);
}
// add the outline
this->CurrentRenderer->AddActor(this->myOutlineActor);
// purpose :
//==================================================================
void VISU_PlanesWidget::ProcessEvents(vtkObject* vtkNotUsed(object),
- unsigned long event,
- void* clientdata,
- void* vtkNotUsed(calldata))
+ unsigned long event,
+ void* clientdata,
+ void* vtkNotUsed(calldata))
{
VISU_PlanesWidget* self =
reinterpret_cast<VISU_PlanesWidget *>( clientdata );
// purpose :
//==================================================================
void VISU_PlanesWidget::Scale(double *p1, double *p2,
- int vtkNotUsed(X), int Y)
+ int vtkNotUsed(X), int Y)
{
//Get the motion vector
double v[3];
//
this->AdjustBounds(bds, bounds, origin);
this->SetOrigin((bounds[1]+bounds[0])/2.0,
- (bounds[3]+bounds[2])/2.0,
- (bounds[5]+bounds[4])/2.0);
+ (bounds[3]+bounds[2])/2.0,
+ (bounds[5]+bounds[4])/2.0);
static vtkFloatingPointType DIST_COEFF = 0.1;
SetDistance(this->InitialLength*DIST_COEFF);
for (i=0; i<24; i+=3){
aD=-DistanceToPlane(aPnts+i, aN, aOr);
if (aD>aDmax){
- aDmax=aD;
- iFound=1;
+ aDmax=aD;
+ iFound=1;
}
}
if (iFound && aDmax>aTol1) {
//==================================================================
void
GetBndPoints(vtkDataSet *pDataSet,
- vtkFloatingPointType aPnts[24])
+ vtkFloatingPointType aPnts[24])
{
int aIndx[24] = {
0,2,4,1,2,4,1,3,4,0,3,4,
//==================================================================
vtkFloatingPointType
DistanceToPlane(const vtkFloatingPointType x[3],
- const vtkFloatingPointType n[3],
- const vtkFloatingPointType p0[3])
+ const vtkFloatingPointType n[3],
+ const vtkFloatingPointType p0[3])
{
return ((n[0]*(x[0]-p0[0]) +
- n[1]*(x[1]-p0[1]) +
- n[2]*(x[2]-p0[2])));
+ n[1]*(x[1]-p0[1]) +
+ n[2]*(x[2]-p0[2])));
}
/*
//==================================================================
// Get the origin of the plane.
void
SetOrigin(vtkFloatingPointType x,
- vtkFloatingPointType y,
- vtkFloatingPointType z);
+ vtkFloatingPointType y,
+ vtkFloatingPointType z);
void
SetOrigin(vtkFloatingPointType x[3]);
// Get the normal to the plane.
void
SetNormal(vtkFloatingPointType x,
- vtkFloatingPointType y,
- vtkFloatingPointType z);
+ vtkFloatingPointType y,
+ vtkFloatingPointType z);
void
SetNormal(vtkFloatingPointType x[3]);
static
void
ProcessEvents(vtkObject* object, unsigned long event,
- void* clientdata, void* calldata);
+ void* clientdata, void* calldata);
// ProcessEvents() dispatches to these methods.
void OnLeftButtonDown();
void
VISU_Plot3DPL
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
vtkFloatingPointType
VISU_Plot3DPL
::GetScaleFactor( VISU_ColoredPL* theColoredPL,
- vtkDataSet* theDataSet )
+ vtkDataSet* theDataSet )
{
theDataSet->Update();
vtkFloatingPointType aLength = theDataSet->GetLength(); // diagonal length
void
VISU_Plot3DPL
::SetPlanePosition(vtkFloatingPointType thePosition,
- bool theIsRelative)
+ bool theIsRelative)
{
bool anIsSameValue = VISU::CheckIsSameValue(myIsRelative, theIsRelative);
anIsSameValue &= (myPosition == thePosition);
void
VISU_Plot3DPL::
SetOrientation(VISU_CutPlanesPL::PlaneOrientation theOrientation,
- vtkFloatingPointType theXAngle,
- vtkFloatingPointType theYAngle)
+ vtkFloatingPointType theXAngle,
+ vtkFloatingPointType theYAngle)
{
bool anIsSameValue = VISU::CheckIsSameValue(GetRotateX(), theXAngle);
anIsSameValue &= VISU::CheckIsSameValue(GetRotateY(), theYAngle);
void
VISU_Plot3DPL
::GetBasePlane(vtkFloatingPointType theOrigin[3],
- vtkFloatingPointType theNormal[3],
- bool theCenterOrigine )
+ vtkFloatingPointType theNormal[3],
+ bool theCenterOrigine )
{
VISU_CutPlanesPL::GetDir(theNormal,myAngle,myOrientation);
void
VISU_Plot3DPL
::GetMinMaxPosition( vtkFloatingPointType& minPos,
- vtkFloatingPointType& maxPos )
+ vtkFloatingPointType& maxPos )
{
vtkFloatingPointType aBounds[6], aBoundPrj[3], aNormal[3];
VISU_CutPlanesPL::GetDir(aNormal,myAngle,myOrientation);
void
SetOrientation(VISU_CutPlanesPL::PlaneOrientation theOrientation,
- vtkFloatingPointType theXAngle = 0.0,
- vtkFloatingPointType theYAngle = 0.0);
+ vtkFloatingPointType theXAngle = 0.0,
+ vtkFloatingPointType theYAngle = 0.0);
vtkFloatingPointType
GetPlanePosition();
void
SetPlanePosition(vtkFloatingPointType thePosition,
- bool theIsRelative);
+ bool theIsRelative);
void
SetScaleFactor(vtkFloatingPointType theScaleFactor);
void
GetBasePlane (vtkFloatingPointType theOrigin[3],
- vtkFloatingPointType theNormal[3],
- bool theCenterOrigine = false );
+ vtkFloatingPointType theNormal[3],
+ bool theCenterOrigine = false );
void
GetMinMaxPosition( vtkFloatingPointType& minPos,
- vtkFloatingPointType& maxPos );
+ vtkFloatingPointType& maxPos );
public:
virtual
static
vtkFloatingPointType
GetScaleFactor( VISU_ColoredPL* theColoredPL,
- vtkDataSet* theDataSet );
+ vtkDataSet* theDataSet );
void
SetMapScale(vtkFloatingPointType theMapScale);
virtual
void
DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
vtkFloatingPointType myAngle[3];
bool myIsRelative, myIsContour;
void
VISU_PointSpriteMapperHolder
::ShallowCopy(VISU_MapperHolder *theMapperHolder,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
if(VISU_PointSpriteMapperHolder* aMapperHolder = dynamic_cast<VISU_PointSpriteMapperHolder*>(theMapperHolder)){
if(theIsCopyInput)
SetGaussPtsIDMapper(aMapperHolder->GetGaussPtsIDMapper());
VISU::CopyPointSpriteDataMapper(GetPointSpriteMapper(),
- aMapperHolder->GetPointSpriteMapper(),
- theIsCopyInput);
+ aMapperHolder->GetPointSpriteMapper(),
+ theIsCopyInput);
myExtractPolyDataGeometry->SetImplicitFunction(aMapperHolder->GetImplicitFunction());
}
}
virtual
void
ShallowCopy(VISU_MapperHolder *theMapperHolder,
- bool theIsCopyInput);
+ bool theIsCopyInput);
//----------------------------------------------------------------------------
void
void
VISU_PolyDataMapperHolder
::ShallowCopy(VISU_MapperHolder *theMapperHolder,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
if(VISU_PolyDataMapperHolder* aMapperHolder = dynamic_cast<VISU_PolyDataMapperHolder*>(theMapperHolder)){
if(theIsCopyInput)
SetPolyDataIDMapper(aMapperHolder->GetPolyDataIDMapper());
VISU::CopyPolyDataMapper(GetPolyDataMapper(),
- aMapperHolder->GetPolyDataMapper(),
- theIsCopyInput);
+ aMapperHolder->GetPolyDataMapper(),
+ theIsCopyInput);
myExtractPolyDataGeometry->SetImplicitFunction(aMapperHolder->GetImplicitFunction());
}
}
vtkImplicitFunction* aFun = NULL;
aFunction->InitTraversal();
for(vtkIdType anID = 0; anID <= theID; anID++)
- aFun = aFunction->GetNextItem();
+ aFun = aFunction->GetNextItem();
aPlane = dynamic_cast<vtkPlane*>(aFun);
}
}
virtual
void
ShallowCopy(VISU_MapperHolder *theMapperHolder,
- bool theIsCopyInput);
+ bool theIsCopyInput);
//! Gets memory size used by the instance (bytes).
virtual
// RKV : Begin
// If the distribution is changed then recalculate the total
if (this->Distribution->GetMTime() > this->BuildTime) {
- int aNbVals = this->Distribution->GetNumberOfTuples();
+ int aNbVals = this->Distribution->GetNumberOfTuples();
double range[2];
this->Distribution->GetRange(range);
this->DistributionActor->SetYRange(0, range[1]);
-/* int total = 0;
- for(vtkIdType aValId = 0; aValId < aNbVals; aValId++){
- total += this->Distribution->GetValue(aValId);
- }
- this->DistributionActor->SetYRange(0, total);
+/* int total = 0;
+ for(vtkIdType aValId = 0; aValId < aNbVals; aValId++){
+ total += this->Distribution->GetValue(aValId);
+ }
+ this->DistributionActor->SetYRange(0, total);
*/
}
if(LabelRatioWidth == 0)
if ( this->Orientation == VTK_ORIENT_VERTICAL )
- targetWidth = (int)(0.6*size[0]);
- else
- targetWidth = (int)(size[0]*0.8/this->NumberOfLabels);
+ targetWidth = (int)(0.6*size[0]);
+ else
+ targetWidth = (int)(size[0]*0.8/this->NumberOfLabels);
else
targetWidth = (int)(0.01*LabelRatioWidth*size[0]);
{
this->DistributionVisibility = v;
if (v) {
- this->DistributionActor->VisibilityOn();
+ this->DistributionActor->VisibilityOn();
} else {
- this->DistributionActor->VisibilityOff();
+ this->DistributionActor->VisibilityOff();
}
}
// int total = 0;
if (this->GetDebug()) {
for(vtkIdType aValId = 0; aValId < aNbVals; aValId++){
-// if (this->GetDebug()) {
- if (this->Distribution->GetValue(aValId) > 0)
- vtkDebugMacro(<< "D(" << aValId << ") = " << this->Distribution->GetValue(aValId));
-// }
-// total += this->Distribution->GetValue(aValId);
+// if (this->GetDebug()) {
+ if (this->Distribution->GetValue(aValId) > 0)
+ vtkDebugMacro(<< "D(" << aValId << ") = " << this->Distribution->GetValue(aValId));
+// }
+// total += this->Distribution->GetValue(aValId);
}
}
// this->DistributionActor->SetYRange(0, total);
}
void VISU_ScalarBarActor::DebugOn() {
- this->DistributionActor->DebugOn();
- Superclass::DebugOn();
+ this->DistributionActor->DebugOn();
+ Superclass::DebugOn();
}
void VISU_ScalarBarActor::DebugOff() {
- this->DistributionActor->DebugOff();
- Superclass::DebugOff();
+ this->DistributionActor->DebugOff();
+ Superclass::DebugOff();
}
// RKV : End
void VISU_ScalarBarActor::SetRatios(int titleRatioSize, int labelRatioWidth,
- int barRatioWidth, int barRatioHeight)
+ int barRatioWidth, int barRatioHeight)
{
TitleRatioSize=titleRatioSize;
if(TitleRatioSize>100)
}
void VISU_ScalarBarActor::SizeBar(int& barSizeWidth, int& barSizeHeight, int *size,
- vtkViewport *viewport, vtkFloatingPointType *range)
+ vtkViewport *viewport, vtkFloatingPointType *range)
{
if(BarRatioWidth == 0)
if ( this->Orientation == VTK_ORIENT_VERTICAL )
{
- int labelSize[2];
- this->AllocateAndSizeLabels(labelSize, size, viewport,range);
- barSizeWidth = size[0] - 4 - labelSize[0];
+ int labelSize[2];
+ this->AllocateAndSizeLabels(labelSize, size, viewport,range);
+ barSizeWidth = size[0] - 4 - labelSize[0];
} else
- barSizeWidth = size[0];
+ barSizeWidth = size[0];
else
barSizeWidth = (int)(0.01*BarRatioWidth*size[0]);
if ( this->Orientation == VTK_ORIENT_VERTICAL ) {
// Position the distribution curve vertically
if (u > 0.5) {
- // X - UP, Y - TO THE LEFT
- this->DistributionActor->SetPlotLocation(VISU_XYPLOT_RIGHT);
- // Curve to be placed on the left side of the bar
+ // X - UP, Y - TO THE LEFT
+ this->DistributionActor->SetPlotLocation(VISU_XYPLOT_RIGHT);
+ // Curve to be placed on the left side of the bar
vtkDebugMacro(<< "Curve to be placed on the left side of the bar");
// relative to the bar origin
- u = 0;
- v = 0;
+ u = 0;
+ v = 0;
viewport->ViewportToNormalizedViewport(u, v);
vtkDebugMacro(<< "u=" << u << "; v=" << v);
this->DistributionActor->GetPositionCoordinate()->SetValue(u, v, 0);
vtkDebugMacro("u2=" << u << "; v2=" << v);
this->DistributionActor->GetPosition2Coordinate()->SetValue(u, v, 0);
} else {
- // X - UP, Y - TO THE RIGHT
- this->DistributionActor->SetPlotLocation(VISU_XYPLOT_LEFT);
- // Curve to be placed on the right side of the bar
+ // X - UP, Y - TO THE RIGHT
+ this->DistributionActor->SetPlotLocation(VISU_XYPLOT_LEFT);
+ // Curve to be placed on the right side of the bar
vtkDebugMacro(<< "Curve to be placed on the right side of the bar");
// relative to the bar origin
u = barWidth;
- v = 0;
+ v = 0;
viewport->ViewportToNormalizedViewport(u, v);
vtkDebugMacro(<< "u=" << u << "; v=" << v);
this->DistributionActor->GetPositionCoordinate()->SetValue(u, v, 0);
} else {
// Position the distribution curve horizontally
if (v > 0.5) {
- // X - TO THE LEFT, Y - DOWN
- this->DistributionActor->SetPlotLocation(VISU_XYPLOT_TOP);
- // Curve to be placed below the bar
+ // X - TO THE LEFT, Y - DOWN
+ this->DistributionActor->SetPlotLocation(VISU_XYPLOT_TOP);
+ // Curve to be placed below the bar
vtkDebugMacro(<< "Curve to be placed below the bar");
// relative to the bar origin
- u = 0;
- v = 0;
+ u = 0;
+ v = 0;
viewport->ViewportToNormalizedViewport(u, v);
vtkDebugMacro(<< "u=" << u << "; v=" << v);
this->DistributionActor->GetPositionCoordinate()->SetValue(u, v, 0);
vtkDebugMacro("u2=" << u << "; v2=" << v);
this->DistributionActor->GetPosition2Coordinate()->SetValue(u, v, 0);
} else {
- // X - TO THE RIGHT, Y - UP
- this->DistributionActor->SetPlotLocation(VISU_XYPLOT_BOTTOM);
- // Curve to be placed on the top of the bar
+ // X - TO THE RIGHT, Y - UP
+ this->DistributionActor->SetPlotLocation(VISU_XYPLOT_BOTTOM);
+ // Curve to be placed on the top of the bar
vtkDebugMacro(<< "Curve to be placed on the top of the bar");
// relative to the bar origin
- u = 0;
- v = barHeight;
+ u = 0;
+ v = barHeight;
viewport->ViewportToNormalizedViewport(u, v);
vtkDebugMacro(<< "u=" << u << "; v=" << v);
this->DistributionActor->GetPositionCoordinate()->SetValue(u, v, 0);
// Set/Get the scalar bar dimention properties in persents.
// 0 <= ration <= 100
void SetRatios(int titleRatioSize,int labelRatioWidth,
- int barRatioWidth, int barRatioHeight);
+ int barRatioWidth, int barRatioHeight);
void GetRatios(int& titleRatioSize, int& labelRatioWidth,
- int& barRatioWidth, int& barRatioHeight);
+ int& barRatioWidth, int& barRatioHeight);
// Description:
// Set/Get the format with which to print the labels on the scalar
void SizeTitle(int *titleSize, int *size, vtkViewport *viewport);
void SizeBar(int& barSizeWidth, int& barSizeHeight, int *size,
- vtkViewport *viewport, vtkFloatingPointType *range);
-
+ vtkViewport *viewport, vtkFloatingPointType *range);
+
/** Place the distribution plot actor in the viewport according to the
* scalar bar location and orientation */
void PlaceDistribution(vtkViewport *viewport, const int barWidth, const int barHeight);
void
VISU_ScalarBarCtrl
::SetRangeLocal(vtkFloatingPointType theMin,
- vtkFloatingPointType theMax)
+ vtkFloatingPointType theMax)
{
myLocalLookupTable->SetTableRange(theMin,theMax);
}
void
VISU_ScalarBarCtrl
::SetRangeGlobal(vtkFloatingPointType theMin,
- vtkFloatingPointType theMax)
+ vtkFloatingPointType theMax)
{
myGlobalLookupTable->SetTableRange(theMin,theMax);
}
void
VISU_ScalarBarCtrl
::PrepareTables(VISU_ScalarBarActor* theScalarBarActor,
- VISU_LookupTable *theLookupTable,
- vtkIdType theId)
+ VISU_LookupTable *theLookupTable,
+ vtkIdType theId)
{
vtkCoordinate * aCoordinate = theScalarBarActor->GetPositionCoordinate();
aCoordinate->SetCoordinateSystemToNormalizedViewport();
// Ranges
void
SetRangeGlobal(vtkFloatingPointType theMin,
- vtkFloatingPointType theMax);
+ vtkFloatingPointType theMax);
void
SetRangeGlobal(vtkFloatingPointType *theRange);
void
SetRangeLocal(vtkFloatingPointType theMin,
- vtkFloatingPointType theMax);
+ vtkFloatingPointType theMax);
void
SetRangeLocal(vtkFloatingPointType *theRange);
void
PrepareTables(VISU_ScalarBarActor* theScalarBarActor,
- VISU_LookupTable *theLookupTable,
- vtkIdType theId);
+ VISU_LookupTable *theLookupTable,
+ vtkIdType theId);
protected:
EMode myMode;
//----------------------------------------------------------------------------
class VISU_PIPELINE_EXPORT VISU_ScalarMapPL : public VISU_MergedPL,
- public VISU_ColoredPL,
- public VISU_UnstructuredGridPL
+ public VISU_ColoredPL,
+ public VISU_UnstructuredGridPL
{
public:
vtkTypeMacro(VISU_ScalarMapPL, VISU_ColoredPL);
virtual
void
DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
void
SetElnoDisassembleState( bool theIsShrunk );
// Compute the two points defining the motion vector
aCamera->GetFocalPoint(focalPoint);
ComputeWorldToDisplay(focalPoint[0],
- focalPoint[1],
- focalPoint[2],
- focalPoint);
+ focalPoint[1],
+ focalPoint[2],
+ focalPoint);
z = focalPoint[2];
ComputeDisplayToWorld(double(Interactor->GetLastEventPosition()[0]),
double(Interactor->GetLastEventPosition()[1]),
// Description:
// Set/Get the center of the sphere.
void SetCenter(vtkFloatingPointType x,
- vtkFloatingPointType y,
- vtkFloatingPointType z);
+ vtkFloatingPointType y,
+ vtkFloatingPointType z);
void SetCenter(vtkFloatingPointType x[3]);
vtkFloatingPointType* GetCenter();
void
VISU_StreamLinesPL
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
if(VISU_StreamLinesPL *aPipeLine = dynamic_cast<VISU_StreamLinesPL*>(thePipeLine)){
SetParams(aPipeLine->GetIntegrationStep(),
- aPipeLine->GetPropagationTime(),
- aPipeLine->GetStepLength(),
- aPipeLine->GetSource(),
- aPipeLine->GetUsedPoints(),
- aPipeLine->GetDirection());
+ aPipeLine->GetPropagationTime(),
+ aPipeLine->GetStepLength(),
+ aPipeLine->GetSource(),
+ aPipeLine->GetUsedPoints(),
+ aPipeLine->GetDirection());
}
}
size_t
VISU_StreamLinesPL
::GetNecasseryMemorySize(vtkIdType theNbOfPoints,
- vtkFloatingPointType theStepLength,
- vtkFloatingPointType thePropogationTime,
- vtkFloatingPointType thePercents)
+ vtkFloatingPointType theStepLength,
+ vtkFloatingPointType thePropogationTime,
+ vtkFloatingPointType thePercents)
{
static vtkFloatingPointType aStreamPointSize = sizeof(vtkFloatingPointType)*15 + sizeof(vtkIdType)*2;
static vtkFloatingPointType aStreamArraySize = aStreamPointSize*1024; // == 69632
size_t
VISU_StreamLinesPL
::FindPossibleParams(vtkDataSet* theDataSet,
- vtkFloatingPointType& theStepLength,
- vtkFloatingPointType& thePropogationTime,
- vtkFloatingPointType& thePercents)
+ vtkFloatingPointType& theStepLength,
+ vtkFloatingPointType& thePropogationTime,
+ vtkFloatingPointType& thePercents)
{
static vtkFloatingPointType aPercentsDecrease = 3.0, aStepLengthIncrease = 9.0;
vtkIdType aNbOfPoints = theDataSet->GetNumberOfPoints();
vtkFloatingPointType aStepLength = theStepLength + aDeltaStepLength;
if(aStepLength < aMaxStepLength) theStepLength = aStepLength;
else if(aStepChanged){
- aStepLength = aMaxStepLength;
- aStepChanged = 0;
+ aStepLength = aMaxStepLength;
+ aStepChanged = 0;
}
vtkFloatingPointType aPercents = thePercents /= aPercentsDecrease;
if(aPercents*aNbOfPoints > 1) thePercents = aPercents;
else if(aPerecentsChanged) {
- thePercents = 1.1 / aNbOfPoints;
- aPerecentsChanged = 0;
+ thePercents = 1.1 / aNbOfPoints;
+ aPerecentsChanged = 0;
}
aSize = GetNecasseryMemorySize(aNbOfPoints,theStepLength,thePropogationTime,thePercents);
if(CheckAvailableMemory(aSize)){
- anIsPossible = i;
- break;
+ anIsPossible = i;
+ break;
}
}
}
size_t
VISU_StreamLinesPL
::SetParams(vtkFloatingPointType theIntStep,
- vtkFloatingPointType thePropogationTime,
- vtkFloatingPointType theStepLength,
- vtkPointSet* theSource,
- vtkFloatingPointType thePercents,
- int theDirection)
+ vtkFloatingPointType thePropogationTime,
+ vtkFloatingPointType theStepLength,
+ vtkPointSet* theSource,
+ vtkFloatingPointType thePercents,
+ int theDirection)
{
vtkPointSet* aDataSet = theSource? theSource: GetMergedInput();
aDataSet->Update();
thePercents = 2.0 / aNbOfPoints;
theIntStep = CorrectIntegrationStep(theIntStep,
- aPointSet,
- thePercents);
+ aPointSet,
+ thePercents);
thePropogationTime = CorrectPropagationTime(thePropogationTime,
- aPointSet);
+ aPointSet);
theStepLength = CorrectStepLength(theStepLength,
- aPointSet);
+ aPointSet);
size_t anIsAccepted = FindPossibleParams(aPointSet,
- theStepLength,
- thePropogationTime,
- thePercents);
+ theStepLength,
+ thePropogationTime,
+ thePercents);
if (anIsAccepted) {
mySource = theSource;
size_t
VISU_StreamLinesPL
::IsPossible(vtkPointSet* theDataSet,
- vtkFloatingPointType thePercents)
+ vtkFloatingPointType thePercents)
{
vtkFloatingPointType aStepLength = GetBaseStepLength(theDataSet);
vtkFloatingPointType aBasePropTime = GetBasePropagationTime(theDataSet);
vtkDataSet* aDataSet = aPointsFilter->GetOutput();
aDataSet->Update();
size_t aRes = FindPossibleParams(aDataSet,
- aStepLength,
- aBasePropTime,
- thePercents);
+ aStepLength,
+ aBasePropTime,
+ thePercents);
aPointsFilter->Delete();
return aRes;
}
vtkFloatingPointType
VISU_StreamLinesPL
::GetMinIntegrationStep(vtkDataSet* theDataSet,
- vtkFloatingPointType thePercents)
+ vtkFloatingPointType thePercents)
{
if(!theDataSet)
return -1.0;
vtkFloatingPointType
VISU_StreamLinesPL
::GetBaseIntegrationStep(vtkDataSet* theDataSet,
- vtkFloatingPointType thePercents)
+ vtkFloatingPointType thePercents)
{
theDataSet->Update();
vtkFloatingPointType
VISU_StreamLinesPL
::CorrectIntegrationStep(vtkFloatingPointType theStep,
- vtkDataSet* theDataSet,
- vtkFloatingPointType thePercents)
+ vtkDataSet* theDataSet,
+ vtkFloatingPointType thePercents)
{
theDataSet->Update();
vtkFloatingPointType
VISU_StreamLinesPL
::CorrectPropagationTime(vtkFloatingPointType thePropagationTime,
- vtkDataSet* theDataSet)
+ vtkDataSet* theDataSet)
{
vtkFloatingPointType aMinPropagationTime = GetMinPropagationTime(theDataSet);
if(aMinPropagationTime > thePropagationTime)
vtkFloatingPointType
VISU_StreamLinesPL
::CorrectStepLength(vtkFloatingPointType theStep,
- vtkDataSet* theDataSet)
+ vtkDataSet* theDataSet)
{
vtkFloatingPointType aMinStep = GetMinStepLength(theDataSet);
if(theStep < aMinStep)
vtkFloatingPointType aPropagationTime = GetBasePropagationTime(aDataSet);
vtkFloatingPointType aStepLength = GetBaseStepLength(aDataSet);
SetParams(anIntStep,
- aPropagationTime,
- aStepLength);
+ aPropagationTime,
+ aStepLength);
}
Superclass::Build();
VISU::CellDataToPoint(myStream,
- myCellDataToPointData,
- GetMergedInput());
+ myCellDataToPointData,
+ GetMergedInput());
myGeomFilter->SetInput(myStream->GetOutput());
myGeomFilter->ExtentClippingOn();
virtual
size_t
SetParams(vtkFloatingPointType theIntStep,
- vtkFloatingPointType thePropogationTime,
- vtkFloatingPointType theStepLength,
- vtkPointSet* theSource = NULL,
- vtkFloatingPointType thePercents = 0.3,
- int theDirection = VTK_INTEGRATE_BOTH_DIRECTIONS);
+ vtkFloatingPointType thePropogationTime,
+ vtkFloatingPointType theStepLength,
+ vtkPointSet* theSource = NULL,
+ vtkFloatingPointType thePercents = 0.3,
+ int theDirection = VTK_INTEGRATE_BOTH_DIRECTIONS);
virtual
vtkPointSet*
static
vtkFloatingPointType
GetMinIntegrationStep(vtkDataSet* theDataSet,
- vtkFloatingPointType thePercents = 0.3);
+ vtkFloatingPointType thePercents = 0.3);
static
vtkFloatingPointType
GetBaseIntegrationStep(vtkDataSet* theDataSet,
- vtkFloatingPointType thePercents = 0.3);
+ vtkFloatingPointType thePercents = 0.3);
static
vtkFloatingPointType
static
size_t
IsPossible(vtkPointSet* theDataSet,
- vtkFloatingPointType thePercents = 0.3);
+ vtkFloatingPointType thePercents = 0.3);
protected:
VISU_StreamLinesPL();
virtual
void
DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
static
size_t
GetNecasseryMemorySize(vtkIdType theNbOfPoints,
- vtkFloatingPointType theStepLength,
- vtkFloatingPointType thePropogationTime,
- vtkFloatingPointType thePercents = 0.3);
+ vtkFloatingPointType theStepLength,
+ vtkFloatingPointType thePropogationTime,
+ vtkFloatingPointType thePercents = 0.3);
static
size_t
FindPossibleParams(vtkDataSet* theDataSet,
- vtkFloatingPointType& theStepLength,
- vtkFloatingPointType& thePropogationTime,
- vtkFloatingPointType& thePercents);
+ vtkFloatingPointType& theStepLength,
+ vtkFloatingPointType& thePropogationTime,
+ vtkFloatingPointType& thePercents);
static
vtkFloatingPointType
CorrectIntegrationStep(vtkFloatingPointType theStep,
- vtkDataSet* theDataSet,
- vtkFloatingPointType thePercents = 0.3);
+ vtkDataSet* theDataSet,
+ vtkFloatingPointType thePercents = 0.3);
static
vtkFloatingPointType
CorrectPropagationTime(vtkFloatingPointType thePropagationTime,
- vtkDataSet* theDataSet);
+ vtkDataSet* theDataSet);
static
vtkFloatingPointType
CorrectStepLength(vtkFloatingPointType theStep,
- vtkDataSet* theDataSet);
+ vtkDataSet* theDataSet);
vtkStreamLine* myStream;
vtkPointSet* mySource;
//----------------------------------------------------------------------------
template<class TOutputFilter>
void ToCellCenters( TOutputFilter *theOutputFilter,
- vtkCellCenters *theCellCenters,
- vtkDataSet* theDataSet,
- VISU_UsedPointsFilter* theUsedPointsFilter )
+ vtkCellCenters *theCellCenters,
+ vtkDataSet* theDataSet,
+ VISU_UsedPointsFilter* theUsedPointsFilter )
{
if ( VISU::IsDataOnCells( theDataSet ) ) {
theCellCenters->SetInput( theDataSet );
void
VISU_VectorsPL
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
Superclass::Build();
ToCellCenters( myTransformFilter,
- myCenters,
- GetMergedInput(),
- myUsedPointsFilter );
+ myCenters,
+ GetMergedInput(),
+ myUsedPointsFilter );
myGlyph->SetInput( myTransformFilter->GetOutput() );
myGlyph->SetVectorModeToUseVector();
virtual
void
DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
+ bool theIsCopyInput);
GlyphType myTypeGlyph;
GlyphPos myPosGlyph;
int i;
for (i=0; i<myNbWidgets; ++i){
myWidgets[i]->AddObserver(vtkCommand::EnableEvent,
- myEventCallbackCommand,
- myPriority);
+ myEventCallbackCommand,
+ myPriority);
myWidgets[i]->AddObserver(vtkCommand::DisableEvent,
- myEventCallbackCommand,
- myPriority);
+ myEventCallbackCommand,
+ myPriority);
myWidgets[i]->AddObserver(vtkCommand::EndInteractionEvent,
- myEventCallbackCommand,
- myPriority);
+ myEventCallbackCommand,
+ myPriority);
myWidgets[i]->AddObserver(vtkCommand::StartInteractionEvent,
- myEventCallbackCommand,
- myPriority);
+ myEventCallbackCommand,
+ myPriority);
myWidgets[i]->AddObserver(vtkCommand::InteractionEvent,
- myEventCallbackCommand,
- myPriority);
+ myEventCallbackCommand,
+ myPriority);
}
}
//==================================================================
if (theFlag) {//enabling
if (HasActiveIndex()) {
for (i=0; i<myNbWidgets; ++i) {
- iFlag=(i==myActiveIndex) ? 1 : 0;
- myWidgets[i]->SetEnabled(iFlag);
+ iFlag=(i==myActiveIndex) ? 1 : 0;
+ myWidgets[i]->SetEnabled(iFlag);
}
}
}
// purpose :
//==================================================================
void VISU_WidgetCtrl::ProcessEvents(vtkObject* vtkNotUsed(theObject),
- unsigned long theEvent,
- void* theClientData,
- void* vtkNotUsed(theCallData))
+ unsigned long theEvent,
+ void* theClientData,
+ void* vtkNotUsed(theCallData))
{
VISU_WidgetCtrl *aSelf = reinterpret_cast<VISU_WidgetCtrl*>(theClientData);
switch(theEvent){
}
//==================================================================
-vtkFloatingPointType
+vtkFloatingPointType
VISU_WidgetCtrl
::EvaluateFunction(vtkFloatingPointType theX[3])
{
}
//==================================================================
-void
+void
VISU_WidgetCtrl
::EvaluateGradient(vtkFloatingPointType theX[3],
- vtkFloatingPointType theG[3])
+ vtkFloatingPointType theG[3])
{
theG[0] = theG[1] = theG[2] = 0.0;
if(VISU_ImplicitFunctionWidget* aWidget = GetActiveWidget()){
vtkImplicitFunction* ImplicitFunction();
virtual
- vtkFloatingPointType
+ vtkFloatingPointType
EvaluateFunction(vtkFloatingPointType theX[3]);
virtual
- void
+ void
EvaluateGradient(vtkFloatingPointType theX[3],
- vtkFloatingPointType theG[3]);
+ vtkFloatingPointType theG[3]);
virtual
unsigned long
VISU_SphereWidget * GetSphereWidget();
//
static void ProcessEvents(vtkObject* theObject,
- unsigned long theEvent,
- void* theClientData,
- void* theCalldata);
+ unsigned long theEvent,
+ void* theClientData,
+ void* theCalldata);
//
protected:
VISU_WidgetCtrl();
* VISU_XYPLOT_RIGHT - the right bottom corner (X axis is directed to the top, Y - to the left)
*/
enum VISU_XYPlotLocation { VISU_XYPLOT_BOTTOM = 0,
- VISU_XYPLOT_TOP, VISU_XYPLOT_LEFT, VISU_XYPLOT_RIGHT };
+ VISU_XYPLOT_TOP, VISU_XYPLOT_LEFT, VISU_XYPLOT_RIGHT };
// RKV : End
class VISU_PIPELINE_EXPORT VISU_XYPlotActor : public vtkActor2D
public:
enum PanelId { SelectionPanelId = 0,
- FeatureEdgesPanelId,
+ FeatureEdgesPanelId,
ClippingPlanesPanelId };
public:
virtual
SUIT_ViewManager*
getViewManager(const QString& theType,
- const bool theIsCreate);
+ const bool theIsCreate);
VISU::TViewToPrs3d&
getScalarBarsMap();
\param theParent parent widget
*/
VisuGUI_BasePanel::VisuGUI_BasePanel( const QString& theName,
- QWidget* theParent,
+ QWidget* theParent,
const int theBtns )
: QGroupBox( theName, theParent ),
myOK( 0 ),
app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
}
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
SUIT_MessageBox::warning(0, ("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
{
myTime = myTime.addMSecs( 100 );
if( myTime.minute() > 9 && myTimeLCDNumber->numDigits() < 9 )
- myTimeLCDNumber->setNumDigits( 9 );
+ myTimeLCDNumber->setNumDigits( 9 );
myTimeLCDNumber->display( myTime.toString( "m:ss.zzz" ) );
bool isEntitiesDone = myResult->IsEntitiesDone();
if( aBuildAtOnce )
{
- updateButton( myBuildEntitiesButton, true );
- updateButton( myBuildFieldsButton, true );
- updateButton( myBuildMinMaxButton, true );
- updateButton( myBuildGroupsButton, true );
-
- QApplication::restoreOverrideCursor();
-
- QTime aTime;
- int mSecs = ( int )( 1000 * ( vtkTimerLog::GetCurrentTime() - myCurrentTime ) );
- aTime = aTime.addMSecs( mSecs );
- if( aTime.minute() > 9 )
- myTimeLCDNumber->setNumDigits( 9 );
- myTimeLCDNumber->display( aTime.toString( "m:ss.zzz" ) );
+ updateButton( myBuildEntitiesButton, true );
+ updateButton( myBuildFieldsButton, true );
+ updateButton( myBuildMinMaxButton, true );
+ updateButton( myBuildGroupsButton, true );
+
+ QApplication::restoreOverrideCursor();
+
+ QTime aTime;
+ int mSecs = ( int )( 1000 * ( vtkTimerLog::GetCurrentTime() - myCurrentTime ) );
+ aTime = aTime.addMSecs( mSecs );
+ if( aTime.minute() > 9 )
+ myTimeLCDNumber->setNumDigits( 9 );
+ myTimeLCDNumber->display( aTime.toString( "m:ss.zzz" ) );
}
if( myCloseCheckBox->isChecked() )
- done( 0 );
+ done( 0 );
else
- SUIT_MessageBox::warning( this,
+ SUIT_MessageBox::warning( this,
tr( "INF_VISU" ),
tr( "IMPORT_DONE" ),
tr( "BUT_OK" ) );
using namespace std;
VisuGUI_CacheDlg::VisuGUI_CacheDlg( VISU::ColoredPrs3dCache_var theCache,
- SalomeApp_Module* theModule )
+ SalomeApp_Module* theModule )
: QDialog( VISU::GetDesktop( theModule ), Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
myCache( theCache )
{
double anUsedMemory = myCache->GetMemorySize();
double aLimitedMemoryMax =
#ifdef WNT
- max
+ max
#else
- std::max
+ std::max
#endif
- (anUsedMemory + aFreeMemory, aLimitedMemory);
+ (anUsedMemory + aFreeMemory, aLimitedMemory);
// Settings
QButtonGroup* aMemoryGroup = new QButtonGroup( this );
LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
if (app)
app->onHelpContextModule(app->activeModule() ?
- app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName);
+ app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName);
else {
SUIT_MessageBox::warning(0, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
public:
VisuGUI_CacheDlg( VISU::ColoredPrs3dCache_var aCache,
- SalomeApp_Module* theModule );
+ SalomeApp_Module* theModule );
virtual ~VisuGUI_CacheDlg();
public:
vtkFloatingPointType aDel = aDataSet->GetLength()/2.0;
vtkFloatingPointType aDelta[2][3] = {{aDir[0][0]*aDel, aDir[0][1]*aDel, aDir[0][2]*aDel},
- {aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}};
+ {aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}};
vtkFloatingPointType aParam, aPnt0[3], aPnt1[3], aPnt2[3];
vtkFloatingPointType aPnt01[3] = {aPnt[0] - aDelta[0][0] - aDelta[1][0],
- aPnt[1] - aDelta[0][1] - aDelta[1][1],
- aPnt[2] - aDelta[0][2] - aDelta[1][2]};
+ aPnt[1] - aDelta[0][1] - aDelta[1][1],
+ aPnt[2] - aDelta[0][2] - aDelta[1][2]};
vtkFloatingPointType aPnt02[3] = {aPnt01[0] + aNormal[0],
- aPnt01[1] + aNormal[1],
- aPnt01[2] + aNormal[2]};
+ aPnt01[1] + aNormal[1],
+ aPnt01[2] + aNormal[2]};
vtkPlane::IntersectWithLine(aPnt01,aPnt02,aNormal,anOrigin,aParam,aPnt0);
vtkFloatingPointType aPnt11[3] = {aPnt[0] - aDelta[0][0] + aDelta[1][0],
- aPnt[1] - aDelta[0][1] + aDelta[1][1],
- aPnt[2] - aDelta[0][2] + aDelta[1][2]};
+ aPnt[1] - aDelta[0][1] + aDelta[1][1],
+ aPnt[2] - aDelta[0][2] + aDelta[1][2]};
vtkFloatingPointType aPnt12[3] = {aPnt11[0] + aNormal[0],
- aPnt11[1] + aNormal[1],
- aPnt11[2] + aNormal[2]};
+ aPnt11[1] + aNormal[1],
+ aPnt11[2] + aNormal[2]};
vtkPlane::IntersectWithLine(aPnt11,aPnt12,aNormal,anOrigin,aParam,aPnt1);
vtkFloatingPointType aPnt21[3] = {aPnt[0] + aDelta[0][0] - aDelta[1][0],
- aPnt[1] + aDelta[0][1] - aDelta[1][1],
- aPnt[2] + aDelta[0][2] - aDelta[1][2]};
+ aPnt[1] + aDelta[0][1] - aDelta[1][1],
+ aPnt[2] + aDelta[0][2] - aDelta[1][2]};
vtkFloatingPointType aPnt22[3] = {aPnt21[0] + aNormal[0],
- aPnt21[1] + aNormal[1],
- aPnt21[2] + aNormal[2]};
+ aPnt21[1] + aNormal[1],
+ aPnt21[2] + aNormal[2]};
vtkPlane::IntersectWithLine(aPnt21,aPnt22,aNormal,anOrigin,aParam,aPnt2);
vtkPlaneSource* aPlaneSource = aPlane->myPlaneSource;
double dot = normal * dir;
//ENK: 23.11.2006 - PAL13176
if(i==0){
- maxDot = dot;
+ maxDot = dot;
gridDir = dir;
values = curValues;
gridAxId = i;
gp_Dir dir;
CORBA::String_var aMeshName = myPrs3d->GetMeshName();
const vector<vtkFloatingPointType> * indices = result->GetAxisInfo(aMeshName.in(),
- axis, dir);
+ axis, dir);
if (indices)
maxIndex = indices->size() - 1;
}
public:
VisuGUI_ClippingDlg( VisuGUI* theModule,
- bool modal = false );
+ bool modal = false );
float getDistance() { return (float)SpinBoxDistance->value(); }
void setDistance(const float theDistance) { SpinBoxDistance->setValue(theDistance); }
//****************************************************************
//PreviewPlane::PreviewPlane(SVTK_ViewWindow* theWindow, const PlaneDef& thePlane, const double* theBounds):
PreviewPlane::PreviewPlane(SVTK_ViewWindow* theWindow,
- VISU_CutPlaneFunction* thePlane,
- const double* theBounds):
+ VISU_CutPlaneFunction* thePlane,
+ const double* theBounds):
myWindow(theWindow),
myBounds(theBounds)
{
myBox->SetDimensions(2, 2, 2);
myBox->SetOrigin(aBound[0],aBound[2],aBound[4]);
myBox->SetSpacing((aBound[1]-aBound[0]),
- (aBound[3]-aBound[2]),
- (aBound[5]-aBound[4]));
+ (aBound[3]-aBound[2]),
+ (aBound[5]-aBound[4]));
myCutter = vtkCutter::New();
myCutter->SetInput(myBox);
// fillPlanesList();
connect(myModule, SIGNAL(presentationCreated(VISU::Prs3d_i*)),
- this, SLOT(onPresentationCreate(VISU::Prs3d_i*)));
+ this, SLOT(onPresentationCreate(VISU::Prs3d_i*)));
connect(myModule, SIGNAL(beforeObjectDelete(QString)),
- this, SLOT(onObjectDelete(QString)));
+ this, SLOT(onObjectDelete(QString)));
SUIT_Desktop* aDesktop = VISU::GetDesktop(myModule);
connect(aDesktop, SIGNAL(windowActivated(SUIT_ViewWindow*)),
- this, SLOT(onWindowActivated(SUIT_ViewWindow*)));
+ this, SLOT(onWindowActivated(SUIT_ViewWindow*)));
}
while (!aFather->_is_nil()) {
QString aFName = aFather->GetName();
aPath.append(aFName);
- if (aFName == "Post-Pro") break;
+ if (aFName == "Post-Pro") break;
aFather = aFather->GetFather();
}
aObjName = aSObject->GetName();
_PTR(Study) aStudy = VISU::GetCStudy(VISU::GetAppStudy(myModule));
_PTR(SObject) aSObjPtr = aStudy->FindObjectID(aColPrs->GetHolderEntry().c_str());
if (aSObjPtr) {
- _PTR(SObject) aFather = aSObjPtr->GetFather();
- while (aFather) {
- QString aFName(aFather->GetName().c_str());
- aPath.append(aFName);
- if (aFName == "Post-Pro") break;
- aFather = aFather->GetFather();
- }
+ _PTR(SObject) aFather = aSObjPtr->GetFather();
+ while (aFather) {
+ QString aFName(aFather->GetName().c_str());
+ aPath.append(aFName);
+ if (aFName == "Post-Pro") break;
+ aFather = aFather->GetFather();
+ }
}
aObjName = aSObjPtr->GetName().c_str();
}
//*************************************************************************
QStringList VisuGUI_ClippingPanel::getPrsList(_PTR(Study) theStudy,
- _PTR(SObject) theObject)
+ _PTR(SObject) theObject)
{
//QList<VISU::Prs3d_i*> aList;
QStringList aList;
for (int i = 0; i < aSTLList.size(); i++) {
VISU::Prs3d_i* aPrs = aSTLList[i];
if (!aList.contains(aPrs->GetEntry().c_str()))
- aList.append(aPrs->GetEntry().c_str());
+ aList.append(aPrs->GetEntry().c_str());
}
if (aList.size() == 0) {
//QList<VISU::Prs3d_i*> aSubList = getPrsList(theStudy, aSObject);
QStringList aSubList = getPrsList(theStudy, aSObject);
for (int i = 0; i < aSubList.size(); i++) {
- //VISU::Prs3d_i* aPrs = aSubList[i];
- QString aPrsEntry = aSubList[i];
- if (!aList.contains(aPrsEntry))
- aList.append(aPrsEntry);
+ //VISU::Prs3d_i* aPrs = aSubList[i];
+ QString aPrsEntry = aSubList[i];
+ if (!aList.contains(aPrsEntry))
+ aList.append(aPrsEntry);
}
}
}
QTableWidgetItem* aItem = new QTableWidgetItem(aPlane->getName().c_str());
QTableWidgetItem* aCheckItem = new QTableWidgetItem();
aCheckItem->setCheckState((myNonActivePlanes->checkState() == Qt::Checked)?
- Qt::Unchecked : Qt::Checked);
+ Qt::Unchecked : Qt::Checked);
if (aPlane->isAuto()) { // If this is Auto plane
aItem->setFlags(0);
aItem->setCheckState(Qt::Checked);
// Check current presentation
int aPrsNum = myPrsList->currentRow();
if (aPrsNum >= 0) {
- if (VISU_ClippingPlaneMgr::ContainsPlane(getPrs(myPresentations.at(aPrsNum)), aPlane))
- aItem->setCheckState(Qt::Checked);
+ if (VISU_ClippingPlaneMgr::ContainsPlane(getPrs(myPresentations.at(aPrsNum)), aPlane))
+ aItem->setCheckState(Qt::Checked);
}
}
myPlanesList->setItem(i, 0, aItem);
aCheckItem->setCheckState((myNonActivePlanes->checkState() == Qt::Checked)? Qt::Unchecked : Qt::Checked);
if (aNewPlane.isAuto) { // If this is Auto plane
- aItem->setFlags(0);
- // apply to all presentations
- aItem->setCheckState(Qt::Checked);
- foreach(QString aPrsEntry, myPresentations) {
- getPrs(aPrsEntry)->AddClippingPlane(aNewPlane.plane);
- }
+ aItem->setFlags(0);
+ // apply to all presentations
+ aItem->setCheckState(Qt::Checked);
+ foreach(QString aPrsEntry, myPresentations) {
+ getPrs(aPrsEntry)->AddClippingPlane(aNewPlane.plane);
+ }
} else { // if it is not auto
- foreach(QString aPrsEntry, myPresentations) {
- _PTR(ChildIterator) aRefIter = aStudy->NewChildIterator(aSObject);
- for (; aRefIter->More(); aRefIter->Next()) {
- _PTR(SObject) aObj = aRefIter->Value();
- _PTR(SObject) aRefPrsObject;
- if (aObj->ReferencedObject(aRefPrsObject)) { // If it is referenced on current plane
- if (QString(aRefPrsObject->GetID().c_str()) == aPrsEntry) {
- getPrs(aPrsEntry)->AddClippingPlane(aNewPlane.plane);
- }
- }
- }
- }
- aItem->setCheckState(Qt::Unchecked);
- // Check current presentation
- int aPrsNum = myPrsList->currentRow();
- if (aPrsNum >= 0) {
- if (containsPlane(getPrs(myPresentations.at(aPrsNum)), aNewPlane))
- aItem->setCheckState(Qt::Checked);
- }
+ foreach(QString aPrsEntry, myPresentations) {
+ _PTR(ChildIterator) aRefIter = aStudy->NewChildIterator(aSObject);
+ for (; aRefIter->More(); aRefIter->Next()) {
+ _PTR(SObject) aObj = aRefIter->Value();
+ _PTR(SObject) aRefPrsObject;
+ if (aObj->ReferencedObject(aRefPrsObject)) { // If it is referenced on current plane
+ if (QString(aRefPrsObject->GetID().c_str()) == aPrsEntry) {
+ getPrs(aPrsEntry)->AddClippingPlane(aNewPlane.plane);
+ }
+ }
+ }
+ }
+ aItem->setCheckState(Qt::Unchecked);
+ // Check current presentation
+ int aPrsNum = myPrsList->currentRow();
+ if (aPrsNum >= 0) {
+ if (containsPlane(getPrs(myPresentations.at(aPrsNum)), aNewPlane))
+ aItem->setCheckState(Qt::Checked);
+ }
}
myPlanesList->setItem(i, 0, aItem);
myPlanesList->setItem(i, 1, aCheckItem);
QTableWidgetItem* aItem = new QTableWidgetItem(aPlane->getName().c_str());
QTableWidgetItem* aCheckItem = new QTableWidgetItem();
aCheckItem->setCheckState((myNonActivePlanes->checkState() == Qt::Checked)?
- Qt::Unchecked : Qt::Checked);
+ Qt::Unchecked : Qt::Checked);
//aNewPlane.plane->setActive(myNonActivePlanes->checkState() != Qt::Checked);
aPlane->setActive(myNonActivePlanes->checkState() != Qt::Checked);
//if (aNewPlane.isAuto) {
int aPrsNum = myPrsList->currentRow();
if (aPrsNum >= 0) {
if (VISU_ClippingPlaneMgr::ContainsPlane(getPrs(myPresentations.at(aPrsNum)), aPlane))
- aItem->setCheckState(Qt::Checked);
+ aItem->setCheckState(Qt::Checked);
}
}
VISU_CutPlaneFunction* aPlane = aMgr.GetClippingPlane(aRow);
QMessageBox::StandardButton aRes =
QMessageBox::warning(VISU::GetDesktop(myModule),
- tr("TIT_DELETE_PLANE"),
- tr("MSG_DELETE_PLANE").arg(aPlane->getName().c_str()),
- QMessageBox::Yes | QMessageBox::No,
- QMessageBox::No);
+ tr("TIT_DELETE_PLANE"),
+ tr("MSG_DELETE_PLANE").arg(aPlane->getName().c_str()),
+ QMessageBox::Yes | QMessageBox::No,
+ QMessageBox::No);
if (aRes == QMessageBox::Yes) {
aMgr.DeleteClippingPlane(aRow);
/* short aTag1 = aPlane.plane->getPlaneObject()->Tag();
for (int i = 0; i < myPresentations.size(); i++) {
VISU::Prs3d_i* aPrs = getPrs(myPresentations.at(i));
for (int j = aPrs->GetNumberOfClippingPlanes()-1; j > -1; j--) {
- CutPlaneFunction* aPln = dynamic_cast<CutPlaneFunction*>(aPrs->GetClippingPlane(j));
- if (aPln) {
- short aTag2 = aPln->getPlaneObject()->Tag();
- if (aTag1 == aTag2) {
- aPrs->RemoveClippingPlane(j);
- }
- }
+ CutPlaneFunction* aPln = dynamic_cast<CutPlaneFunction*>(aPrs->GetClippingPlane(j));
+ if (aPln) {
+ short aTag2 = aPln->getPlaneObject()->Tag();
+ if (aTag1 == aTag2) {
+ aPrs->RemoveClippingPlane(j);
+ }
+ }
}
}
aPrs->AddClippingPlane(aPlane.plane);
if(!aStudy->GetProperties()->IsLocked()) {
- _PTR(SObject) aNewObj = aBuilder->NewObject(aSObject);
- aBuilder->Addreference(aNewObj, aPrsSObj);
+ _PTR(SObject) aNewObj = aBuilder->NewObject(aSObject);
+ aBuilder->Addreference(aNewObj, aPrsSObj);
}
}
} else {
for (int i = 0; i < aPrs->GetNumberOfClippingPlanes(); i++) {
if (aPrs->GetClippingPlane(i) == aPlane.plane.GetPointer()) {
- aPrs->RemoveClippingPlane(i);
- break;
+ aPrs->RemoveClippingPlane(i);
+ break;
}
}
if(!aStudy->GetProperties()->IsLocked()) {
_PTR(ChildIterator) aIter = aStudy->NewChildIterator(aSObject);
for (; aIter->More(); aIter->Next()) {
- _PTR(SObject) aRefObj = aIter->Value();
- if(aRefObj) {
- _PTR(SObject) aRefPrsObject;
- if (aRefObj->ReferencedObject(aRefPrsObject)) {
- if (QString(aRefPrsObject->GetID().c_str()) == QString(aPrs->GetEntry().c_str())) {
- VISU::DeleteSObject(myModule, aStudy, aRefObj);
- break;
- }
- }
- }
+ _PTR(SObject) aRefObj = aIter->Value();
+ if(aRefObj) {
+ _PTR(SObject) aRefPrsObject;
+ if (aRefObj->ReferencedObject(aRefPrsObject)) {
+ if (QString(aRefPrsObject->GetID().c_str()) == QString(aPrs->GetEntry().c_str())) {
+ VISU::DeleteSObject(myModule, aStudy, aRefObj);
+ break;
+ }
+ }
+ }
}
}
}*/
if (aPrs) {
QString aID(aPrs->GetEntry().c_str());
if (aID == theEntry) {
- myPresentations.removeAt(i);
- myPrsList->takeItem(i);
- break;
+ myPresentations.removeAt(i);
+ myPrsList->takeItem(i);
+ break;
}
i++;
}
VISU_CutPlaneFunction* aPlane = aMgr.GetClippingPlane(i);
if (!aPlane->isAuto())
aItem->setCheckState(VISU_ClippingPlaneMgr::ContainsPlane(aPrs, aPlane)?
- Qt::Checked : Qt::Unchecked);
+ Qt::Checked : Qt::Unchecked);
}
/* for (aIt = myPlanes.begin(), i = 0; aIt != myPlanes.end(); ++aIt, i++) {
QTableWidgetItem* aItem = myPlanesList->item(i, 0);
VISU::Prs3d_i* VisuGUI_ClippingPanel::getPrs(QString theEntry)
{
VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(VISU::GetAppStudy(myModule),
- qPrintable(theEntry));
+ qPrintable(theEntry));
return VISU::GetPrs3dFromBase(anObjectInfo.myBase);
}
//****************************************************************
void VisuGUI_ClippingPlaneDlg::ProcessEvents(vtkObject* theObject,
- unsigned long theEvent,
- void* theClientData,
- void* vtkNotUsed(theCallData))
+ unsigned long theEvent,
+ void* theClientData,
+ void* vtkNotUsed(theCallData))
{
vtkImplicitPlaneWidget* aWidget = vtkImplicitPlaneWidget::SafeDownCast(theObject);
if (aWidget == NULL) return;
//aPlaneWgt->OutlineTranslationOff();
//aPlaneWgt->ScaleEnabledOn();
aPlaneWgt->AddObserver(vtkCommand::InteractionEvent,
- myCallback.GetPointer(),
- 0.);
+ myCallback.GetPointer(),
+ 0.);
return aPlaneWgt;
}
VISU_ClippingPlaneMgr& aMgr = VISU::GetVisuGen(myModule)->GetClippingPlaneMgr();
if (myPlaneId == -1) { // Create a New plane
myPlaneId = aMgr.CreateClippingPlane(myXOrigin->value(), myYOrigin->value(), myZOrigin->value(),
- myXDir->value(), myYDir->value(), myZDir->value(),
- myAutoApply->checkState() == Qt::Checked,
- qPrintable(myNameEdt->text()));
+ myXDir->value(), myYDir->value(), myZDir->value(),
+ myAutoApply->checkState() == Qt::Checked,
+ qPrintable(myNameEdt->text()));
} else { // Edit Plane
aMgr.EditClippingPlane(myPlaneId,
- myXOrigin->value(), myYOrigin->value(), myZOrigin->value(),
- myXDir->value(), myYDir->value(), myZDir->value(),
- myAutoApply->checkState() == Qt::Checked,
- qPrintable(myNameEdt->text()));
+ myXOrigin->value(), myYOrigin->value(), myZOrigin->value(),
+ myXDir->value(), myYDir->value(), myZDir->value(),
+ myAutoApply->checkState() == Qt::Checked,
+ qPrintable(myNameEdt->text()));
}
VISU::UpdateObjBrowser(myModule);
}
if (VISU::getClippingPlanesFolder(aStudy, aFolder)) {
_PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
if (myPlaneObj == 0) { // Create a New plane
- myPlaneObj = aBuilder->NewObject(aFolder);
+ myPlaneObj = aBuilder->NewObject(aFolder);
}
// Save Name
_PTR(GenericAttribute) anAttr;
anAttr = aBuilder->FindOrCreateAttribute(myPlaneObj,"AttributeSequenceOfReal");
_PTR(AttributeSequenceOfReal) aArray(anAttr);
if (aArray->Length() == 6) {
- for (int i = 0; i < 6; i++)
- aArray->ChangeValue(i+1, aParams[i]);
+ for (int i = 0; i < 6; i++)
+ aArray->ChangeValue(i+1, aParams[i]);
} else {
- for (int i = 0; i < 6; i++)
- aArray->Add(aParams[i]);
+ for (int i = 0; i < 6; i++)
+ aArray->Add(aParams[i]);
}
// Save Bool Flag
anAttr = aBuilder->FindOrCreateAttribute(myPlaneObj,"AttributeInteger");
static void ProcessEvents(vtkObject* theObject, unsigned long theEvent,
- void* theClientData, void* theCallData);
+ void* theClientData, void* theCallData);
VisuGUI* myModule;
SVTK_ViewWindow* myViewWindow;
#endif
SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"),
QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).
- arg(helpFileName) );
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).
+ arg(helpFileName) );
}
}
//------------------------------------------------------------------------------
void VisuGUI_CutLinesDlg::initFromPrsObject ( VISU::ColoredPrs3d_i* thePrs,
- bool theInit )
+ bool theInit )
{
if( theInit )
myPrsCopy = VISU::TSameAsFactory<VISU::TCUTLINES>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
anIsOk &= GetScalarPane()->storeToPrsObject( myPrsCopy );
myPrsCopy->SetOrientation(getOrientaion(),
- myRotXSpn->value()*PI/180.,
- myRotYSpn->value()*PI/180.);
+ myRotXSpn->value()*PI/180.,
+ myRotYSpn->value()*PI/180.);
myPrsCopy->SetDisplacement(myPosSpn->value());
myPrsCopy->SetNbLines((int)myNbSpn->value());
myPrsCopy->SetOrientation2(getOrientaion(false),
- myRotXSpn2->value()*PI/180.,
- myRotYSpn2->value()*PI/180.);
+ myRotXSpn2->value()*PI/180.,
+ myRotYSpn2->value()*PI/180.);
myPrsCopy->SetDisplacement2(myPosSpn2->value());
if (!myCBSetDef->isChecked())
myPrsCopy->SetLinePosition( i, aVar.toDouble() );
}
else
- myPrsCopy->SetDefaultPosition(i);
+ myPrsCopy->SetDefaultPosition(i);
}
}
if (aItem->checkState() != Qt::Checked )
{
QVariant aVar = aModel->index( i, 0 ).data();
- myCutLines->SetLinePosition(i, aVar.toDouble());
+ myCutLines->SetLinePosition(i, aVar.toDouble());
}
}
{
if (myPreviewCheck->isChecked())
{
- deletePlanes();
- createPlanes();
+ deletePlanes();
+ createPlanes();
}
}
}
SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
if (aView)
{
- if (myPreviewCheck->isChecked())
+ if (myPreviewCheck->isChecked())
{
- deletePlanes();
- createPlanes();
- }
+ deletePlanes();
+ createPlanes();
+ }
}
aModel->setData( anIndex, myCutLines->GetLinePosition(theRow), Qt::DisplayRole );
myPosTable->item( theRow, 0 )->setFlags( myPosTable->item( theRow, 0 )->flags() | Qt::ItemIsEnabled );
//Update Preview
if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
{
- //myCutLines->GetPipeLine()->Update();
- deletePlanes();
- createPlanes();
- //vf->Repaint();
+ //myCutLines->GetPipeLine()->Update();
+ deletePlanes();
+ createPlanes();
+ //vf->Repaint();
}
}
}
~VisuGUI_CutLinesDlg();
virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit );
+ bool theInit );
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
GDeformation->setChecked(true);
int idx = myVectorialFieldCombo->findText(thePrs->GetVectorialFieldName());
if (idx >= 0)
- myVectorialFieldCombo->setCurrentIndex(idx);
+ myVectorialFieldCombo->setCurrentIndex(idx);
else {
- myVectorialFieldCombo->addItem(thePrs->GetVectorialFieldName());
- myVectorialFieldCombo->setCurrentIndex(myVectorialFieldCombo->count()-1);
+ myVectorialFieldCombo->addItem(thePrs->GetVectorialFieldName());
+ myVectorialFieldCombo->setCurrentIndex(myVectorialFieldCombo->count()-1);
}
}
}
QTableWidgetItem* aItem = myPosTable->item( i, 1 );
if (aItem == 0) break;
if (aItem->checkState() != Qt::Checked )
- myCutPlanes->SetPlanePosition(i, myPosTable->item(i, 0)->text().toDouble());
+ myCutPlanes->SetPlanePosition(i, myPosTable->item(i, 0)->text().toDouble());
}
if (aNbPlanes > aNbRows)
//Update Preview
if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
{
- myCutPlanes->GetPipeLine()->Update();
- deletePlanes();
- createPlanes();
- vf->Repaint();
+ myCutPlanes->GetPipeLine()->Update();
+ deletePlanes();
+ createPlanes();
+ vf->Repaint();
}
}
}
if (myPreviewCheck->isChecked()) {
//Update Preview
if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
- myCutPlanes->SetPlanePosition( theRow, anIndex.data().toDouble());
- myCutPlanes->GetPipeLine()->Update();
- deletePlanes();
- createPlanes();
- vf->Repaint();
+ myCutPlanes->SetPlanePosition( theRow, anIndex.data().toDouble());
+ myCutPlanes->GetPipeLine()->Update();
+ deletePlanes();
+ createPlanes();
+ vf->Repaint();
}
}
} else {
aModel->setData( anIndex, myCutPlanes->GetPlanePosition(theRow), Qt::DisplayRole );
anItem->setFlags( anItem->flags() | Qt::ItemIsEnabled );
if (myPreviewCheck->isChecked()) {
- if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
- //Update Preview
- myCutPlanes->GetPipeLine()->Update();
- deletePlanes();
- createPlanes();
- vf->Repaint();
- }
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
+ //Update Preview
+ myCutPlanes->GetPipeLine()->Update();
+ deletePlanes();
+ createPlanes();
+ vf->Repaint();
+ }
}
}
//myPosTable->item(theRow, 0)->setEnabled(!isDefault);
myCutPlanes->GetPipeLine()->Update();
createPlanes();
if(VISU::GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)) {
- vf->onFitAll();
+ vf->onFitAll();
}
} else {
deletePlanes();
{}
void VisuGUI_CutPlanesDlg::initFromPrsObject ( VISU::ColoredPrs3d_i* thePrs,
- bool theInit )
+ bool theInit )
{
if( theInit )
myPrsCopy = VISU::TSameAsFactory<VISU::TCUTPLANES>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
~VisuGUI_CutPlanesDlg();
virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit );
+ bool theInit );
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
//------------------------------------------------------------------------------
void VisuGUI_CutSegmentDlg::initFromPrsObject ( VISU::ColoredPrs3d_i* thePrs,
- bool theInit )
+ bool theInit )
{
if( theInit )
myPrsCopy = VISU::TSameAsFactory<VISU::TCUTSEGMENT>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
~VisuGUI_CutSegmentDlg();
virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit );
+ bool theInit );
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
}
void VisuGUI_DeformedShapeAndScalarMapDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit )
+ bool theInit )
{
if( theInit )
myPrsCopy = VISU::TSameAsFactory<VISU::TDEFORMEDSHAPEANDSCALARMAP>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
CORBA::String_var aFieldName(myPrsCopy->GetScalarFieldName());
QString aIteration = GetFloatValueOfTimeStamp(myPrsCopy->GetScalarEntity(),
- aFieldName.in(),
- myPrsCopy->GetScalarTimeStampNumber());
+ aFieldName.in(),
+ myPrsCopy->GetScalarTimeStampNumber());
if (myEntity2Fields.size() == 0)
{
// find all fields and time stamps on it
if (selected.Extent() > 0) {
Handle(SALOME_InteractiveObject) aIO = selected.First();
if (aIO->hasEntry()) {
- _PTR(SObject) aSObject = aActiveStudy->FindObjectID(aIO->getEntry());
- VISU::VISUType aType = VISU::Storable::SObject2Type( aSObject );
- switch(aType){
- case VISU::TTIMESTAMP: {
- aSObject = aSObject->GetFather();
- aSObject = aSObject->GetFather();
- break;
- }
- case VISU::TFIELD: {
- _PTR(SObject) newSObject;
- if(aSObject->ReferencedObject(newSObject)) aSObject = newSObject;
- aSObject = aSObject->GetFather();
- break;
- }
- case VISU::TANIMATION: {
- _PTR(ChildIterator) aTmpIter = aActiveStudy->NewChildIterator(aSObject);
- for (aTmpIter->InitEx(true); aTmpIter->More(); aTmpIter->Next()) {
- _PTR(SObject) aTmpChildSObj = aTmpIter->Value();
- _PTR(SObject) newSObject;
- if(aTmpChildSObj->ReferencedObject(newSObject)){
- aSObject = newSObject;
- aSObject->GetFather();
- break;
- }
- }
- break;
- }}
-
- aSObject = aSObject->GetFather();
- aSObject = aSObject->GetFather();
-
- mySelectionObj = aSObject;
- CORBA::Object_var anObject = VISU::ClientSObjectToObject(mySelectionObj);
- if (CORBA::is_nil(anObject)) {
- mySelectionObj = mySelectionObj->GetFather();
- }
+ _PTR(SObject) aSObject = aActiveStudy->FindObjectID(aIO->getEntry());
+ VISU::VISUType aType = VISU::Storable::SObject2Type( aSObject );
+ switch(aType){
+ case VISU::TTIMESTAMP: {
+ aSObject = aSObject->GetFather();
+ aSObject = aSObject->GetFather();
+ break;
+ }
+ case VISU::TFIELD: {
+ _PTR(SObject) newSObject;
+ if(aSObject->ReferencedObject(newSObject)) aSObject = newSObject;
+ aSObject = aSObject->GetFather();
+ break;
+ }
+ case VISU::TANIMATION: {
+ _PTR(ChildIterator) aTmpIter = aActiveStudy->NewChildIterator(aSObject);
+ for (aTmpIter->InitEx(true); aTmpIter->More(); aTmpIter->Next()) {
+ _PTR(SObject) aTmpChildSObj = aTmpIter->Value();
+ _PTR(SObject) newSObject;
+ if(aTmpChildSObj->ReferencedObject(newSObject)){
+ aSObject = newSObject;
+ aSObject->GetFather();
+ break;
+ }
+ }
+ break;
+ }}
+
+ aSObject = aSObject->GetFather();
+ aSObject = aSObject->GetFather();
+
+ mySelectionObj = aSObject;
+ CORBA::Object_var anObject = VISU::ClientSObjectToObject(mySelectionObj);
+ if (CORBA::is_nil(anObject)) {
+ mySelectionObj = mySelectionObj->GetFather();
+ }
}
}
for (aIter->InitEx(true); aIter->More(); aIter->Next()) {
_PTR(SObject) aChildSObj = aIter->Value();
- VISU::Storable::TRestoringMap aRestoringMap = VISU::Storable::GetStorableMap(aChildSObj);
+ VISU::Storable::TRestoringMap aRestoringMap = VISU::Storable::GetStorableMap(aChildSObj);
if (!aRestoringMap.empty()) {
- VISU::VISUType aType = VISU::Storable::RestoringMap2Type(aRestoringMap);
- if (aType == VISU::TTIMESTAMP) {
- QString aMeshName = aRestoringMap["myMeshName"];
- CORBA::String_var aName = myPrsCopy->GetMeshName();
- if (aMeshName != aName.in())
- continue;
- QString aFieldName = aRestoringMap["myFieldName"];
- QString aTimeIter = aRestoringMap["myTimeStampId"];
- QString aEntity = aRestoringMap["myEntityId"];
- VISU::Entity anEntity;
- switch (aEntity.toInt()) {
- case 0: anEntity = VISU::NODE; break;
- case 1: anEntity = VISU::EDGE; break;
- case 2: anEntity = VISU::FACE; break;
- case 3: anEntity = VISU::CELL; break;
- }
- TFieldName2TimeStamps& aFieldName2TimeStamps = myEntity2Fields[anEntity];
- TTimeStampNumber2Time& aTimeStampNumber2Time = aFieldName2TimeStamps[aFieldName];
- aTimeStampNumber2Time[aTimeIter.toInt()] =
- GetFloatValueOfTimeStamp(anEntity,
- aFieldName.toLatin1().constData(),
- aTimeIter.toInt());
- }
+ VISU::VISUType aType = VISU::Storable::RestoringMap2Type(aRestoringMap);
+ if (aType == VISU::TTIMESTAMP) {
+ QString aMeshName = aRestoringMap["myMeshName"];
+ CORBA::String_var aName = myPrsCopy->GetMeshName();
+ if (aMeshName != aName.in())
+ continue;
+ QString aFieldName = aRestoringMap["myFieldName"];
+ QString aTimeIter = aRestoringMap["myTimeStampId"];
+ QString aEntity = aRestoringMap["myEntityId"];
+ VISU::Entity anEntity;
+ switch (aEntity.toInt()) {
+ case 0: anEntity = VISU::NODE; break;
+ case 1: anEntity = VISU::EDGE; break;
+ case 2: anEntity = VISU::FACE; break;
+ case 3: anEntity = VISU::CELL; break;
+ }
+ TFieldName2TimeStamps& aFieldName2TimeStamps = myEntity2Fields[anEntity];
+ TTimeStampNumber2Time& aTimeStampNumber2Time = aFieldName2TimeStamps[aFieldName];
+ aTimeStampNumber2Time[aTimeIter.toInt()] =
+ GetFloatValueOfTimeStamp(anEntity,
+ aFieldName.toLatin1().constData(),
+ aTimeIter.toInt());
+ }
}
}
}
myPrsCopy->SetScale(getFactor());
myPrsCopy->SetScalarField(myPrsCopy->GetScalarEntity(),
- getCurrentScalarFieldName().toLatin1().constData(),
- myTimeStampID[ myTimeStampsCombo->currentIndex() ]);
+ getCurrentScalarFieldName().toLatin1().constData(),
+ myTimeStampID[ myTimeStampsCombo->currentIndex() ]);
if(myUpdateScalars)
SetScalarField( false );
for(; aFieldIter != aFieldName2TimeStamps.end(); aFieldIter++){
const QString& aFieldName = aFieldIter->first;
if (aFieldName == myFieldsCombo->currentText()) {
- anEntity = anIter->first;
- break;
+ anEntity = anIter->first;
+ break;
}
}
}
void
VisuGUI_DeformedShapeAndScalarMapDlg
::SetScalarField(int theIter,
- QString theFieldName,
- const bool save_scalar_pane )
+ QString theFieldName,
+ const bool save_scalar_pane )
{
QApplication::setOverrideCursor(Qt::WaitCursor);
try {
myPrsCopy->SetScalarField(anEntity,
- aFieldName.toLatin1().constData(),
- theIter);
+ aFieldName.toLatin1().constData(),
+ theIter);
if( save_scalar_pane )
UpdateScalarField();
myIsScalarFieldValid = true;
for(; aFieldIter != aFieldName2TimeStamps.end(); aFieldIter++){
const QString& aFieldName = aFieldIter->first;
if(theFieldName != aFieldName)
- continue;
+ continue;
myTimeStampID.clear();
myTimeStampsCombo->clear();
const TTimeStampNumber2Time& aTimeStampNumber2Time = aFieldIter->second;
TTimeStampNumber2Time::const_iterator aTimeStampIter = aTimeStampNumber2Time.begin();
for(; aTimeStampIter != aTimeStampNumber2Time.end(); aTimeStampIter++){
- int aTimeStampNumber = aTimeStampIter->first;
- myTimeStampID.push_back(aTimeStampNumber);
+ int aTimeStampNumber = aTimeStampIter->first;
+ myTimeStampID.push_back(aTimeStampNumber);
- QString aTimeStampTime = aTimeStampIter->second;
- myTimeStampsCombo->addItem(aTimeStampTime);
+ QString aTimeStampTime = aTimeStampIter->second;
+ myTimeStampsCombo->addItem(aTimeStampTime);
}
if(currentTimeStampId >= myTimeStampID.size())
currentTimeStampId = myTimeStampID.size()-1;
QString
VisuGUI_DeformedShapeAndScalarMapDlg
::GetFloatValueOfTimeStamp(VISU::Entity theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber)
+ const std::string& theFieldName,
+ int theTimeStampNumber)
{
QString aTime("");
VISU::TEntity anEntity = VISU::TEntity(theEntity);
VISU::Result_i* theResult = myPrsCopy->GetCResult();
VISU::Result_i::PInput anInput = theResult->GetInput();
VISU::PField aField = anInput->GetField(myPrsCopy->GetCMeshName(),
- anEntity,
- theFieldName);
+ anEntity,
+ theFieldName);
if(!aField)
return aTime;
void setFactor(double theFactor);
virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit );
+ bool theInit );
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
void AddAllFieldNames();
void AddAllTimes(const QString& theFieldName);
QString GetFloatValueOfTimeStamp(VISU::Entity theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber);
+ const std::string& theFieldName,
+ int theTimeStampNumber);
void updateControls();
};
INFOS(exc.what());
SUIT_MessageBox::warning(VISU::GetDesktop(myModule),
- tr("WRN_VISU"),
- tr("ERR_CANT_BUILD_PRESENTATION") + ": " + exc.what());
+ tr("WRN_VISU"),
+ tr("ERR_CANT_BUILD_PRESENTATION") + ": " + exc.what());
}
aViewWindow->Repaint();
}
VISU::Storable::TRestoringMap aRestoringMap = VISU::Storable::GetStorableMap(aTimeStamp);
VISU::VISUType aType = VISU::Storable::RestoringMap2Type(aRestoringMap);
if ( aType == VISU::TTIMESTAMP )
- {
+ {
- QString aMeshName = aRestoringMap["myMeshName"];
- QString anEntity = aRestoringMap["myEntityId"];
- QString aFieldName = aRestoringMap["myFieldName"];
- QString aTimeStampId = aRestoringMap["myTimeStampId"];
-
- //typedef VISU::DeformedShape_i TPrs3d_i;
-
- aPrs3d =
- VISU::CreatePrs3dFromFactory<VISU::DeformedShape_i>(theModule,
- aTimeStamp,
- aMeshName.toLatin1().data(),
- (VISU::Entity)anEntity.toInt(),
- aFieldName.toLatin1().data(),
- aTimeStampId.toInt(),
- aPublishInStudyMode);
-
- if (aPrs3d) {
- VisuGUI_DeformedShapeDlg* aDlg = new VisuGUI_DeformedShapeDlg (theModule);
- aDlg->initFromPrsObject(aPrs3d, true);
- aDlg->UseMagn->setChecked(true);
- VisuGUI_DialogRunner r(aDlg);
- int dlgResult = r.run( false );
-
- if ( dlgResult == 0 )
- DeletePrs3d(theModule,aPrs3d);
- else {
- aDlg->storeToPrsObject( aPrs3d );
- SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
- PublishInView(theModule, aPrs3d, aViewWindow);
- if(VISU::GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false))
- aViewWindow->onFitAll();
- int aPos = VISU::GetFreePositionOfDefaultScalarBar(theModule, aViewWindow);
- VISU::AddScalarBarPosition(theModule, aViewWindow, aPrs3d, aPos);
- }
-
- VISU::UpdateObjBrowser(theModule, true, aTimeStamp);
- delete aDlg;
- }
- }
+ QString aMeshName = aRestoringMap["myMeshName"];
+ QString anEntity = aRestoringMap["myEntityId"];
+ QString aFieldName = aRestoringMap["myFieldName"];
+ QString aTimeStampId = aRestoringMap["myTimeStampId"];
+
+ //typedef VISU::DeformedShape_i TPrs3d_i;
+
+ aPrs3d =
+ VISU::CreatePrs3dFromFactory<VISU::DeformedShape_i>(theModule,
+ aTimeStamp,
+ aMeshName.toLatin1().data(),
+ (VISU::Entity)anEntity.toInt(),
+ aFieldName.toLatin1().data(),
+ aTimeStampId.toInt(),
+ aPublishInStudyMode);
+
+ if (aPrs3d) {
+ VisuGUI_DeformedShapeDlg* aDlg = new VisuGUI_DeformedShapeDlg (theModule);
+ aDlg->initFromPrsObject(aPrs3d, true);
+ aDlg->UseMagn->setChecked(true);
+ VisuGUI_DialogRunner r(aDlg);
+ int dlgResult = r.run( false );
+
+ if ( dlgResult == 0 )
+ DeletePrs3d(theModule,aPrs3d);
+ else {
+ aDlg->storeToPrsObject( aPrs3d );
+ SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
+ PublishInView(theModule, aPrs3d, aViewWindow);
+ if(VISU::GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false))
+ aViewWindow->onFitAll();
+ int aPos = VISU::GetFreePositionOfDefaultScalarBar(theModule, aViewWindow);
+ VISU::AddScalarBarPosition(theModule, aViewWindow, aPrs3d, aPos);
+ }
+
+ VISU::UpdateObjBrowser(theModule, true, aTimeStamp);
+ delete aDlg;
+ }
+ }
}
return aPrs3d;
}
SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(theModule);
if (aViewWindow)
if (VISU_Actor* anActor = FindActor(aViewWindow, thePrs3d))
- if (anActor->GetVisibility())
- anActor->VisibilityOff();
+ if (anActor->GetVisibility())
+ anActor->VisibilityOff();
VisuGUI_DialogRunner r(aDlg);
int dlgResult = r.run( false );
INFOS(exc.what());
SUIT_MessageBox::warning
- (VISU::GetDesktop(theModule), QObject::tr("WRN_VISU"),
- QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()));
+ (VISU::GetDesktop(theModule), QObject::tr("WRN_VISU"),
+ QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()));
}
if (aViewWindow)
if (VISU_Actor* anActor = FindActor(aViewWindow, thePrs3d))
- if (!anActor->GetVisibility())
- anActor->VisibilityOn();
+ if (!anActor->GetVisibility())
+ anActor->VisibilityOn();
delete aDlg;
}
{ return UseMagn->isChecked(); }
virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit );
+ bool theInit );
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: VisuGUI_DialogRunner.cxx
-// Created: Thu Oct 6 10:17:39 2005
-// Author: Alexander SOLOVYOV
-// <asl@multiplex.nnov.opencascade.com>
+// File: VisuGUI_DialogRunner.cxx
+// Created: Thu Oct 6 10:17:39 2005
+// Author: Alexander SOLOVYOV
+// <asl@multiplex.nnov.opencascade.com>
//
#include "VisuGUI_DialogRunner.h"
//if (!aViewer)
//aViewer = dynamic_cast<SVTK_Viewer*>( aView );
if( aViewer ){
- SUIT_ViewManager* aViewManager = aViewer->getViewManager();
- SUIT_ViewWindow* aWindow = aViewManager->getActiveView();
- if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>( aWindow )){
- VISU::Prs3d_i* aPrs3d = NULL;
- if(aType == VISU::TCOLOREDPRS3DHOLDER){
- VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(aBase);
- VISU::ColoredPrs3d_var aColoredPrs3d = aHolder->GetDevice();
- aPrs3d = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aColoredPrs3d).in());
- }else if (aType == VISU::TPOINTMAP3D) {
- VISU::PointMap3d_i* aTable3d = dynamic_cast<VISU::PointMap3d_i*>(aBaseServant);
- VISU_ActorBase* anActorBase = VISU::FindActorBase(aViewWindow, aTable3d);
- if (anActorBase) {
- anActorBase->SetVisibility(true);
- aViewWindow->Repaint();
- }
- else {
- VISU_PointMap3dActor* aPointMap3dActor = aTable3d->CreateActor();
- if (aPointMap3dActor) {
- aViewWindow->AddActor(aPointMap3dActor);
- aPointMap3dActor->SetVisibility(true);
- aViewWindow->Repaint();
- }
- }
- }
- else
- aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aBaseServant);
-
- if(aPrs3d){
- buildPrs3d( aViewWindow, aPrs3d );
- Handle(SALOME_InteractiveObject) anIO = aPrs3d->GetIO();
- if(anIO->hasEntry()){
- std::string anEntry = anIO->getEntry();
- aPrs = LightApp_Displayer::buildPresentation( anEntry.c_str(), aView );
- }
- }
- }
+ SUIT_ViewManager* aViewManager = aViewer->getViewManager();
+ SUIT_ViewWindow* aWindow = aViewManager->getActiveView();
+ if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>( aWindow )){
+ VISU::Prs3d_i* aPrs3d = NULL;
+ if(aType == VISU::TCOLOREDPRS3DHOLDER){
+ VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(aBase);
+ VISU::ColoredPrs3d_var aColoredPrs3d = aHolder->GetDevice();
+ aPrs3d = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aColoredPrs3d).in());
+ }else if (aType == VISU::TPOINTMAP3D) {
+ VISU::PointMap3d_i* aTable3d = dynamic_cast<VISU::PointMap3d_i*>(aBaseServant);
+ VISU_ActorBase* anActorBase = VISU::FindActorBase(aViewWindow, aTable3d);
+ if (anActorBase) {
+ anActorBase->SetVisibility(true);
+ aViewWindow->Repaint();
+ }
+ else {
+ VISU_PointMap3dActor* aPointMap3dActor = aTable3d->CreateActor();
+ if (aPointMap3dActor) {
+ aViewWindow->AddActor(aPointMap3dActor);
+ aPointMap3dActor->SetVisibility(true);
+ aViewWindow->Repaint();
+ }
+ }
+ }
+ else
+ aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aBaseServant);
+
+ if(aPrs3d){
+ buildPrs3d( aViewWindow, aPrs3d );
+ Handle(SALOME_InteractiveObject) anIO = aPrs3d->GetIO();
+ if(anIO->hasEntry()){
+ std::string anEntry = anIO->getEntry();
+ aPrs = LightApp_Displayer::buildPresentation( anEntry.c_str(), aView );
+ }
+ }
+ }
}
}
if (aView) aViewer = dynamic_cast<SPlot2d_Viewer*>(aView);
if(!aViewer && (aType==VISU::TCURVE || aType==VISU::TCONTAINER))
if(VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>(myApp->activeModule()))
- aViewer = VISU::GetPlot2dViewer( (SalomeApp_Module*)aVisuGUI, true );
+ aViewer = VISU::GetPlot2dViewer( (SalomeApp_Module*)aVisuGUI, true );
if(aViewer){
SUIT_ViewManager* aViewManager = aViewer->getViewManager();
SUIT_ViewWindow* aWindow = aViewManager->getActiveView();
Plot2d_ViewWindow* aViewWindow = dynamic_cast<Plot2d_ViewWindow*>( aWindow );
if( !aViewWindow )
- return 0;
+ return 0;
SPlot2d_Prs* aPlot2dPrs = 0;
switch (aType) {
case VISU::TCURVE: {
- VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(aBaseServant);
- aPlot2dPrs = buildCurve( aViewWindow, aCurve );
- break;
+ VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(aBaseServant);
+ aPlot2dPrs = buildCurve( aViewWindow, aCurve );
+ break;
}
case VISU::TCONTAINER: {
- VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aBaseServant);
- aPlot2dPrs = buildContainer( aViewWindow, aContainer );
- break;
+ VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aBaseServant);
+ aPlot2dPrs = buildContainer( aViewWindow, aContainer );
+ break;
}
case VISU::TPOINTMAP3D: {
- VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBaseServant);
- aPlot2dPrs = buildTable( aViewWindow, aTable );
- break;
+ VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBaseServant);
+ aPlot2dPrs = buildTable( aViewWindow, aTable );
+ break;
}
case VISU::TTABLE: {
- VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBaseServant);
- aPlot2dPrs = buildTable( aViewWindow, aTable );
- break;
+ VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBaseServant);
+ aPlot2dPrs = buildTable( aViewWindow, aTable );
+ break;
}}
if( aPlot2dPrs )
- aPrs = new SPlot2d_Prs( aPlot2dPrs );
+ aPrs = new SPlot2d_Prs( aPlot2dPrs );
if( aPrs )
- UpdatePrs( aPrs );
+ UpdatePrs( aPrs );
}
}
return aPrs;
CORBA::Object_ptr aCurve = VISU::Curve::_narrow( childObject );
if( !CORBA::is_nil( aCurve ) )
{
- VISU::Curve_i* theCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurve).in());
- addCurve( prs, wnd, theCurve );
+ VISU::Curve_i* theCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurve).in());
+ addCurve( prs, wnd, theCurve );
}
}
}
/* XPM */
static const char * left_xpm[] = {
"24 24 61 1",
-" c None",
-". c #323232",
-"+ c #010101",
-"@ c #4A4A4A",
-"# c #040404",
-"$ c #979797",
-"% c #7B7B7B",
-"& c #939393",
-"* c #EEEEEE",
-"= c #686868",
-"- c #030303",
-"; c #9C9C9C",
-"> c #FFFFFF",
-", c #B1B1B1",
-"' c #5E5E5E",
-") c #060606",
-"! c #C1C1C1",
-"~ c #626262",
-"{ c #000000",
-"] c #989898",
-"^ c #A1A1A1",
-"/ c #A5A5A5",
-"( c #909090",
-"_ c #868686",
-": c #616161",
-"< c #959595",
-"[ c #919191",
-"} c #848484",
-"| c #606060",
-"1 c #0B0B0B",
-"2 c #545454",
-"3 c #727272",
-"4 c #A2A2A2",
-"5 c #969696",
-"6 c #838383",
-"7 c #5F5F5F",
-"8 c #101010",
-"9 c #434343",
-"0 c #6B6B6B",
-"a c #858585",
-"b c #8E8E8E",
-"c c #373737",
-"d c #696969",
-"e c #8D8D8D",
-"f c #B5B5B5",
-"g c #111111",
-"h c #393939",
-"i c #898989",
-"j c #B0B0B0",
-"k c #191919",
-"l c #3A3A3A",
-"m c #646464",
-"n c #535353",
-"o c #050505",
-"p c #353535",
-"q c #585858",
-"r c #4C4C4C",
-"s c #0D0D0D",
-"t c #3E3E3E",
-"u c #020202",
-"v c #0A0A0A",
+" c None",
+". c #323232",
+"+ c #010101",
+"@ c #4A4A4A",
+"# c #040404",
+"$ c #979797",
+"% c #7B7B7B",
+"& c #939393",
+"* c #EEEEEE",
+"= c #686868",
+"- c #030303",
+"; c #9C9C9C",
+"> c #FFFFFF",
+", c #B1B1B1",
+"' c #5E5E5E",
+") c #060606",
+"! c #C1C1C1",
+"~ c #626262",
+"{ c #000000",
+"] c #989898",
+"^ c #A1A1A1",
+"/ c #A5A5A5",
+"( c #909090",
+"_ c #868686",
+": c #616161",
+"< c #959595",
+"[ c #919191",
+"} c #848484",
+"| c #606060",
+"1 c #0B0B0B",
+"2 c #545454",
+"3 c #727272",
+"4 c #A2A2A2",
+"5 c #969696",
+"6 c #838383",
+"7 c #5F5F5F",
+"8 c #101010",
+"9 c #434343",
+"0 c #6B6B6B",
+"a c #858585",
+"b c #8E8E8E",
+"c c #373737",
+"d c #696969",
+"e c #8D8D8D",
+"f c #B5B5B5",
+"g c #111111",
+"h c #393939",
+"i c #898989",
+"j c #B0B0B0",
+"k c #191919",
+"l c #3A3A3A",
+"m c #646464",
+"n c #535353",
+"o c #050505",
+"p c #353535",
+"q c #585858",
+"r c #4C4C4C",
+"s c #0D0D0D",
+"t c #3E3E3E",
+"u c #020202",
+"v c #0A0A0A",
" ",
" ",
" .+ .+ ",
static const char * right_xpm[] = {
"24 24 43 1",
-" g None",
-". g #323232",
-"+ g #5D5D5D",
-"@ g #000000",
-"# g #C4C4C4",
-"$ g #313131",
-"% g #C5C5C5",
-"& g #E4E4E4",
-"* g #2D2D2D",
-"= g #B7B7B7",
-"- g #EFEFEF",
-"; g #DCDCDC",
-"> g #282828",
-", g #AFAFAF",
-"' g #E0E0E0",
-") g #242424",
-"! g #C7C7C7",
-"~ g #9A9A9A",
-"{ g #8E8E8E",
-"] g #1F1F1F",
-"^ g #A5A5A5",
-"/ g #989898",
-"( g #888888",
-"_ g #1B1B1B",
-": g #ADADAD",
-"< g #858585",
-"[ g #838383",
-"} g #868686",
-"| g #929292",
-"1 g #C1C1C1",
-"2 g #161616",
-"3 g #909090",
-"4 g #747474",
-"5 g #3A3A3A",
-"6 g #121212",
-"7 g #0D0D0D",
-"8 g #7A7A7A",
-"9 g #8A8A8A",
-"0 g #090909",
-"a g #040404",
-"b g #707070",
-"c g #6E6E6E",
-"d g #3F3F3F",
+" g None",
+". g #323232",
+"+ g #5D5D5D",
+"@ g #000000",
+"# g #C4C4C4",
+"$ g #313131",
+"% g #C5C5C5",
+"& g #E4E4E4",
+"* g #2D2D2D",
+"= g #B7B7B7",
+"- g #EFEFEF",
+"; g #DCDCDC",
+"> g #282828",
+", g #AFAFAF",
+"' g #E0E0E0",
+") g #242424",
+"! g #C7C7C7",
+"~ g #9A9A9A",
+"{ g #8E8E8E",
+"] g #1F1F1F",
+"^ g #A5A5A5",
+"/ g #989898",
+"( g #888888",
+"_ g #1B1B1B",
+": g #ADADAD",
+"< g #858585",
+"[ g #838383",
+"} g #868686",
+"| g #929292",
+"1 g #C1C1C1",
+"2 g #161616",
+"3 g #909090",
+"4 g #747474",
+"5 g #3A3A3A",
+"6 g #121212",
+"7 g #0D0D0D",
+"8 g #7A7A7A",
+"9 g #8A8A8A",
+"0 g #090909",
+"a g #040404",
+"b g #707070",
+"c g #6E6E6E",
+"d g #3F3F3F",
" ",
" ",
" .. .. ",
VISU::Base_var aVisuObj = VISU::Base::_narrow(anObject);
if (!CORBA::is_nil(aVisuObj)) {
if (aVisuObj->GetType() == VISU::TCURVE) {
- _PTR(SObject) aTableSO = aSObject->GetFather();
- CurveStruct aEntry;
- aEntry.TableName = getSObjectName(aTableSO);
- aEntry.CurveName = getSObjectName(aSObject);
- aEntry.CurveEntry = aSObject->GetID().c_str();
- aStudyCurves.append(aEntry);
+ _PTR(SObject) aTableSO = aSObject->GetFather();
+ CurveStruct aEntry;
+ aEntry.TableName = getSObjectName(aTableSO);
+ aEntry.CurveName = getSObjectName(aSObject);
+ aEntry.CurveEntry = aSObject->GetID().c_str();
+ aStudyCurves.append(aEntry);
}
}
}
for (it = aStudyCurves.begin(); it != aStudyCurves.end(); ++it) {
for (it2 = aContainerCurves.begin(); it2 != aContainerCurves.end(); ++it2) {
if (isExist = ((*it).CurveEntry == (*it2).CurveEntry))
- break;
+ break;
}
if (!isExist)
{
if (aCurveSO) {
CORBA::Object_var aObject = VISU::ClientSObjectToObject(aCurveSO);
if (!CORBA::is_nil(aObject)) {
- VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aObject).in());
- if (aCurve) theContainer->AddCurve(aCurve->_this());
+ VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aObject).in());
+ if (aCurve) theContainer->AddCurve(aCurve->_this());
}
}
}
aTopLayout->addWidget( myGrp );
connect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( onSelectionEvent() ) );
+ this, SLOT( onSelectionEvent() ) );
}
VisuGUI_FeatureEdgesPanel::~VisuGUI_FeatureEdgesPanel()
anIsManifoldEdges = false,
anIsNonManifoldEdges = false;
myActor->GetFeatureEdgesFlags( anIsFeatureEdges,
- anIsBoundaryEdges,
- anIsManifoldEdges,
- anIsNonManifoldEdges );
+ anIsBoundaryEdges,
+ anIsManifoldEdges,
+ anIsNonManifoldEdges );
//float aColoring = myActor->GetFeatureEdgesColoring();
{
myActor->SetFeatureEdgesAngle( myAngleSpinBox->value() );
myActor->SetFeatureEdgesFlags( myFeatureEdgesCB->isChecked(),
- myBoundaryEdgesCB->isChecked(),
- myManifoldEdgesCB->isChecked(),
- myNonManifoldEdgesCB->isChecked() );
+ myBoundaryEdgesCB->isChecked(),
+ myManifoldEdgesCB->isChecked(),
+ myNonManifoldEdgesCB->isChecked() );
//myActor->SetFeatureEdgesColoring( myColoringCB->isChecked() );
myActor->Update();
}
void VisuGUI_FeatureEdgesPanel::onModuleActivated()
{
disconnect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( onSelectionEvent() ) );
+ this, SLOT( onSelectionEvent() ) );
connect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( onSelectionEvent() ) );
+ this, SLOT( onSelectionEvent() ) );
VisuGUI_Panel::onModuleActivated();
}
void VisuGUI_FeatureEdgesPanel::onModuleDeactivated()
{
disconnect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( onSelectionEvent() ) );
+ this, SLOT( onSelectionEvent() ) );
VisuGUI_Panel::onModuleDeactivated();
}
Constructor
*/
VisuGUI_FileDlg::VisuGUI_FileDlg (QWidget* parent,
- bool open,
- bool showQuickDir,
- bool modal) :
+ bool open,
+ bool showQuickDir,
+ bool modal) :
SUIT_FileDlg(parent, open, showQuickDir, modal)
{
myCBuildAll = new QCheckBox (tr("FULL_LOAD"), this);
if ( fi.isFile() )
{
setDirectory( fi.absoluteDir().absolutePath() );
- selectFile( fi.fileName() );
+ selectFile( fi.fileName() );
}
else if ( fi.isDir() )
- setDirectory( path );
+ setDirectory( path );
return true;
}
else {
if ( QFileInfo( fi.absoluteDir().absolutePath() ).exists() ) {
- setDirectory( fi.absoluteDir().absolutePath() );
- return true;
+ setDirectory( fi.absoluteDir().absolutePath() );
+ return true;
}
}
}
Returns the file name for Open/Save [ static ]
*/
QString VisuGUI_FileDlg::getFileName( QWidget* parent,
- const QString& initial,
- const QStringList& filters,
- const QString& caption,
- bool open,
+ const QString& initial,
+ const QStringList& filters,
+ const QString& caption,
+ bool open,
bool showQuickDir,
SUIT_FileValidator* validator )
{
Q_OBJECT;
public:
VisuGUI_FileDlg( QWidget* parent,
- bool open,
- bool showQuickDir = true,
- bool modal = true );
+ bool open,
+ bool showQuickDir = true,
+ bool modal = true );
~VisuGUI_FileDlg();
public:
static bool IsBuild;
static QString getFileName( QWidget* parent,
- const QString& initial,
- const QStringList& filters,
- const QString& caption,
- bool open,
- bool showQuickDir = true,
- SUIT_FileValidator* validator = 0);
+ const QString& initial,
+ const QStringList& filters,
+ const QString& caption,
+ bool open,
+ bool showQuickDir = true,
+ SUIT_FileValidator* validator = 0);
private:
QCheckBox* myCBuildAll;
VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
if ( VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase ) {
if ( VISU::ColoredPrs3d_i* aColoredPrs3d = dynamic_cast< VISU::ColoredPrs3d_i* >( aBase ) ) {
- myColoredPrs3d = aColoredPrs3d;
+ myColoredPrs3d = aColoredPrs3d;
} else if (VISU::ColoredPrs3dHolder_i* aHolder =
- dynamic_cast< VISU::ColoredPrs3dHolder_i* >( aBase )) {
- myColoredPrs3d = aHolder->GetPrs3dDevice();
+ dynamic_cast< VISU::ColoredPrs3dHolder_i* >( aBase )) {
+ myColoredPrs3d = aHolder->GetPrs3dDevice();
}
if (myColoredPrs3d.get() != NULL) {
- myRangeBox->setChecked( myColoredPrs3d->IsScalarFilterUsed() );
- myMinEdit->setText( QString::number( myColoredPrs3d->GetScalarFilterMin() ) );
- myMaxEdit->setText( QString::number( myColoredPrs3d->GetScalarFilterMax() ) );
- setEnabled( true );
- return;
+ myRangeBox->setChecked( myColoredPrs3d->IsScalarFilterUsed() );
+ myMinEdit->setText( QString::number( myColoredPrs3d->GetScalarFilterMin() ) );
+ myMaxEdit->setText( QString::number( myColoredPrs3d->GetScalarFilterMax() ) );
+ setEnabled( true );
+ return;
}
}
}
myConditionBox = new QComboBox( this );
myConditionBox->addItems( QStringList()
- << tr( "MINIMUM" )
- << tr( "MAXIMUM" )
- << "="
- << "<="
- << ">="
- << tr( "BETWEEN" ) );
+ << tr( "MINIMUM" )
+ << tr( "MAXIMUM" )
+ << "="
+ << "<="
+ << ">="
+ << tr( "BETWEEN" ) );
connect( myConditionBox, SIGNAL( currentIndexChanged( int ) ), this, SLOT( onConditionChanged( int ) ) );
{
if( VISU_GaussPtsAct* aGaussPtsAct = dynamic_cast<VISU_GaussPtsAct*>( myActor ) )
{
- VISU::TGaussPointID aGaussPointID = aGaussPtsAct->GetGaussPointsPL()->GetObjID( aVTKId );
- anId.first = aGaussPointID.first;
- anId.second = aGaussPointID.second;
+ VISU::TGaussPointID aGaussPointID = aGaussPtsAct->GetGaussPointsPL()->GetObjID( aVTKId );
+ anId.first = aGaussPointID.first;
+ anId.second = aGaussPointID.second;
}
}
//printf( "(%d) <%d - %d> %f\n", aVTKId, anId.first, anId.second, aValue );
if( anId.first < 0 ||
- anId.second < 0 && mySelectionMode == GaussPointSelection )
+ anId.second < 0 && mySelectionMode == GaussPointSelection )
continue;
bool ok = false;
{
if( aCondition <= 1 && fabs( aValue - anExtremum ) > eps )
{
- anExtremum = aValue;
- myIdsList.clear();
+ anExtremum = aValue;
+ myIdsList.clear();
}
if( !myIdsList.contains( anId ) )
myIdsList.append( anId );
aStr.remove( ']' );
aFirstId = aStr.section( ' ', 0, 0 ).toInt( &ok );
if( !ok )
- aFirstId = -1;
+ aFirstId = -1;
else
{
- ok = false;
- aSecondId = aStr.section( ' ', 1, 1 ).toInt( &ok );
- if( !ok )
- aSecondId = -1;
+ ok = false;
+ aSecondId = aStr.section( ' ', 1, 1 ).toInt( &ok );
+ if( !ok )
+ aSecondId = -1;
}
}
}
myPrevBtn->setEnabled( myCurrentPage != 0 );
myNextBtn->setEnabled( ( myCurrentPage + 1 ) * PAGE_SIZE < aSize );
myPageLabel->setText( QString( "Page %1/%2" )
- .arg( aSize > 0 ? myCurrentPage + 1 : 0 )
- .arg( aSize > 0 ? ( aSize - 1 ) / PAGE_SIZE + 1 : 0 ) );
+ .arg( aSize > 0 ? myCurrentPage + 1 : 0 )
+ .arg( aSize > 0 ? ( aSize - 1 ) / PAGE_SIZE + 1 : 0 ) );
int aFirstIndex = myCurrentPage * PAGE_SIZE;
int aLastIndex = aFirstIndex + PAGE_SIZE - 1;
//! Initializing dialog from the Gauss Points presentation.
virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit );
+ bool theInit );
//! Update Gauss Points presentation using parameters from the dialog.
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
SVTK_RenderWindowInteractor* anInteractor = NULL;
if( SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>( myModule ) )
- //if( SVTK_MainWindow* aMainWindow = aViewWindow->getMainWindow() )
- anInteractor = aViewWindow->GetInteractor();
+ //if( SVTK_MainWindow* aMainWindow = aViewWindow->getMainWindow() )
+ anInteractor = aViewWindow->GetInteractor();
if ( !anInteractor )
- return aResult;
+ return aResult;
mySelector = anInteractor->GetSelector();
if ( !mySelector )
- return aResult;
+ return aResult;
const SALOME_ListIO& aListIO = mySelector->StoredIObjects();
if ( aListIO.Extent() != 1 )
- return aResult;
+ return aResult;
myIO = aListIO.First();
if ( mySelector->HasIndex( myIO ) )
- mySelector->GetIndex(myIO, myMapIndex);
-
+ mySelector->GetIndex(myIO, myMapIndex);
+
VTK::ActorCollectionCopy aCopy(anInteractor->getRenderer()->GetActors());
myActor = SVTK::Find<VISU_GaussPtsAct>(aCopy.GetActors(),
- SVTK::TIsSameIObject<VISU_GaussPtsAct>( myIO ));
+ SVTK::TIsSameIObject<VISU_GaussPtsAct>( myIO ));
if ( !myActor )
- return aResult;
+ return aResult;
myPipeLine = myActor->GetGaussPointsPL();
{
public:
GaussPtsIDValidator( const SalomeApp_Module* theModule,
- QObject * theParent ):
+ QObject * theParent ):
QIntValidator( 0, VTK_LARGE_ID, theParent ),
myHelper(theModule)
{}
validate ( QString & theInput, int & thePos ) const
{
if ( QIntValidator::validate( theInput, thePos ) == QValidator::Invalid)
- return QValidator::Invalid;
+ return QValidator::Invalid;
if ( !myHelper.get() )
- return QValidator::Invalid;
+ return QValidator::Invalid;
return QValidator::Acceptable;
}
{
public:
GaussCellIDValidator( QLineEdit* theLocalPointLabel,
- const SalomeApp_Module* theModule,
- QObject * theParent ):
+ const SalomeApp_Module* theModule,
+ QObject * theParent ):
GaussPtsIDValidator( theModule, theParent ),
myLocalPointLineEdit( theLocalPointLabel )
{}
validate ( QString & theInput, int & thePos ) const
{
if( theInput.isEmpty() )
- return QValidator::Acceptable;
+ return QValidator::Acceptable;
if ( GaussPtsIDValidator::validate( theInput, thePos ) == QValidator::Invalid)
- return QValidator::Invalid;
+ return QValidator::Invalid;
VISU::TCellID aCellID = theInput.toInt();
VISU::TLocalPntID aLocalPntID = myLocalPointLineEdit->text().toInt();
VISU::PGaussPtsIDMapper anIDMapper = myHelper.myPipeLine->GetGaussPtsIDMapper();
if ( anIDMapper->GetVTKID( VISU::TGaussPointID( aCellID, aLocalPntID ) ) < 0 )
- return QValidator::Intermediate;
+ return QValidator::Intermediate;
return QValidator::Acceptable;
}
{
public:
GaussLocalPointIDValidator( QLineEdit* theParentElementLineEdit,
- const SalomeApp_Module* theModule,
- QObject * theParent ):
+ const SalomeApp_Module* theModule,
+ QObject * theParent ):
GaussPtsIDValidator( theModule, theParent ),
myParentElementLineEdit( theParentElementLineEdit )
{}
validate ( QString & theInput, int & thePos ) const
{
if( theInput.isEmpty() )
- return QValidator::Acceptable;
+ return QValidator::Acceptable;
if ( GaussPtsIDValidator::validate( theInput, thePos ) == QValidator::Invalid)
- return QValidator::Invalid;
+ return QValidator::Invalid;
VISU::TLocalPntID aLocalPntID = theInput.toInt();
VISU::TCellID aCellID = myParentElementLineEdit->text().toInt();
VISU::PGaussPtsIDMapper anIDMapper = myHelper.myPipeLine->GetGaussPtsIDMapper();
if ( anIDMapper->GetVTKID( VISU::TGaussPointID( aCellID, aLocalPntID ) ) < 0 )
- return QValidator::Intermediate;
+ return QValidator::Intermediate;
return QValidator::Acceptable;
}
//---------------------------------------------------------------------------------
VisuGUI_GaussPointsSelectionPane::VisuGUI_GaussPointsSelectionPane( const SalomeApp_Module* theModule,
- QWidget* theParent ) :
+ QWidget* theParent ) :
QWidget( theParent ),
myModule( theModule ),
myEventCallbackCommand( vtkCallbackCommand::New() )
//printf( "AddObserver(vtkCommand::KeyPressEvent)\n" );
aDevice->AddObserver(vtkCommand::KeyPressEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
if( aDevice->HasObserver(vtkCommand::EndPickEvent) )
aDevice->RemoveObservers(vtkCommand::EndPickEvent);
//printf( "AddObserver(vtkCommand::EndPickEvent)\n" );
aDevice->AddObserver(vtkCommand::EndPickEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
}
SVTK_RenderWindowInteractor* VisuGUI_GaussPointsSelectionPane::getInteractor()
}
void VisuGUI_GaussPointsSelectionPane::ProcessEvents(vtkObject* vtkNotUsed(theObject),
- unsigned long theEvent,
- void* theClientData,
- void* vtkNotUsed(theCallData))
+ unsigned long theEvent,
+ void* theClientData,
+ void* vtkNotUsed(theCallData))
{
VisuGUI_GaussPointsSelectionPane* self = reinterpret_cast<VisuGUI_GaussPointsSelectionPane*>(theClientData);
platform = "application";
#endif
SUIT_MessageBox::warning( 0,
- QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName),
- QObject::tr("BUT_OK"));
+ QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
}
}
private:
static void ProcessEvents(vtkObject* theObject,
- unsigned long theEvent,
- void* theClientData,
- void* theCallData);
+ unsigned long theEvent,
+ void* theClientData,
+ void* theCallData);
void KeyPressed();
void SelectionEvent();
//---------------------------------------------------------------
VisuGUI_InputPane::VisuGUI_InputPane( VISU::VISUType theType,
- SalomeApp_Module* theModule,
- VisuGUI_Prs3dDlg* theDialog ) :
+ SalomeApp_Module* theModule,
+ VisuGUI_Prs3dDlg* theDialog ) :
QGroupBox( theDialog ),
myModule( theModule ),
myDialog( theDialog ),
if (myFieldFilter)
{
- aSelectionMgr->removeFilter(myFieldFilter);
- delete myFieldFilter;
+ aSelectionMgr->removeFilter(myFieldFilter);
+ delete myFieldFilter;
}
// Restore initial selection
{
QList<QListWidgetItem*> aList = mySelectedGroups->findItems( theItem->text(), Qt::MatchExactly );
if ( aList.isEmpty() )
- mySelectedGroups->insertItem( mySelectedGroups->count(), theItem->text() );
+ mySelectedGroups->insertItem( mySelectedGroups->count(), theItem->text() );
}
else if (aListWidget == mySelectedGroups)
delete theItem;
{
_PTR(SObject) aChildObj = aIter->Value();
if( !aChildObj )
- return;
+ return;
if( anEntityName.isNull() )
{
- _PTR(SObject) aRefObj;
- if( aChildObj->ReferencedObject( aRefObj ) )
- anEntityName = aRefObj->GetName().c_str();
+ _PTR(SObject) aRefObj;
+ if( aChildObj->ReferencedObject( aRefObj ) )
+ anEntityName = aRefObj->GetName().c_str();
}
VISU::Storable::TRestoringMap aRestoringMap = VISU::Storable::GetStorableMap(aChildObj);
if( aRestoringMap["myComment"] == "TIMESTAMP" )
{
- aTimeStampName = aChildObj->GetName().c_str();
- myTimeStamps->addItem( aTimeStampName );
+ aTimeStampName = aChildObj->GetName().c_str();
+ myTimeStamps->addItem( aTimeStampName );
}
}
public:
VisuGUI_InputPane( VISU::VISUType theType,
- SalomeApp_Module* theModule,
- VisuGUI_Prs3dDlg* theDialog );
+ SalomeApp_Module* theModule,
+ VisuGUI_Prs3dDlg* theDialog );
virtual ~VisuGUI_InputPane();
public:
using namespace std;
VisuGUI_IsoSurfPane::VisuGUI_IsoSurfPane (QWidget* parent,
- VisuGUI_ScalarBarPane* theScalarPane)
+ VisuGUI_ScalarBarPane* theScalarPane)
: QWidget(parent),
myScalarPane(theScalarPane)
{
}
void VisuGUI_IsoSurfacesDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit )
+ bool theInit )
{
if( theInit )
myPrsCopy = VISU::TSameAsFactory<VISU::TISOSURFACES>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
public:
VisuGUI_IsoSurfPane (QWidget* parent,
- VisuGUI_ScalarBarPane* theScalarPane);
+ VisuGUI_ScalarBarPane* theScalarPane);
~VisuGUI_IsoSurfPane() {};
void initFromPrsObject(VISU::IsoSurfaces_i* thePrs);
~VisuGUI_IsoSurfacesDlg();
virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit );
+ bool theInit );
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
//---------------------------------------------------------------
typedef void (SUIT_ViewWindow::* TViewVisibility)();
void SetViewVisibility(SalomeApp_Application* app,
- TViewVisibility theViewVisibility)
+ TViewVisibility theViewVisibility)
{
ViewManagerList l;
//app->viewManagers( VVTK_Viewer::Type(), l );
for( ; anIt!=aLast; anIt++ )
if( SUIT_ViewManager* aViewManager = *anIt )
{
- QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
- int aSize = aViews.size();
- for(int anId = 0; anId < aSize; anId++)
- {
- if(SUIT_ViewWindow* aView = aViews[anId])
- (aView->* theViewVisibility)();
- }
+ QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
+ int aSize = aViews.size();
+ for(int anId = 0; anId < aSize; anId++)
+ {
+ if(SUIT_ViewWindow* aView = aViews[anId])
+ (aView->* theViewVisibility)();
+ }
}
}
}
// "Save VISU State" command is moved from SalomeApp_Applicaiton
createAction( SAVE_VISU_STATE, tr( "TOT_DESK_FILE_SAVE_GUI_STATE" ), QIcon(),
- tr( "MEN_DESK_FILE_SAVE_GUI_STATE" ), tr( "PRP_DESK_FILE_SAVE_GUI_STATE" ),
- 0, getApp()->desktop(), false, getApp(), SLOT( onSaveGUIState() ) );
+ tr( "MEN_DESK_FILE_SAVE_GUI_STATE" ), tr( "PRP_DESK_FILE_SAVE_GUI_STATE" ),
+ 0, getApp()->desktop(), false, getApp(), SLOT( onSaveGUIState() ) );
int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1 );
createMenu( SAVE_VISU_STATE, fileMenu, 9, -1 );
QPixmap aPixmap;
/* aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_GAUSS_NEW_VIEWER"));
createAction( GAUSS_NEW_VIEWER,
- tr("MEN_GAUSS_NEW_VIEWER"),
- aPixmap,
+ tr("MEN_GAUSS_NEW_VIEWER"),
+ aPixmap,
tr("MEN_GAUSS_NEW_VIEWER"),
- tr("MEN_GAUSS_NEW_VIEWER"),
- Qt::ALT+Qt::Key_S,
- this,
- false,
+ tr("MEN_GAUSS_NEW_VIEWER"),
+ Qt::ALT+Qt::Key_S,
+ this,
+ false,
this,
- SLOT(onCreateViewManager()));
+ SLOT(onCreateViewManager()));
int windowMenu = createMenu( tr( "MEN_DESK_WINDOW" ), -1, 100 );
int newWinMenu = createMenu( tr( "MEN_DESK_NEWWINDOW" ), windowMenu, -1, 0 );
createMenu( action( GAUSS_NEW_VIEWER ), newWinMenu, -1 );
this, SLOT(OnCreateGaussPoints()));
mgr->insert( action( GAUSS_CREATE_PRS ), -1, 0, -1 );
mgr->setRule( action( GAUSS_CREATE_PRS ),
- "client='ObjectBrowser' and selcount=1 "
- "and type in {'VISU::TTIMESTAMP' 'VISU::TFIELD'} "
- "and $medEntity in {'EDGE_ENTITY' 'FACE_ENTITY' 'CELL_ENTITY'} "
- "and $medSource in {'eImportFile' 'eCopyAndImportFile'}" );
+ "client='ObjectBrowser' and selcount=1 "
+ "and type in {'VISU::TTIMESTAMP' 'VISU::TFIELD'} "
+ "and $medEntity in {'EDGE_ENTITY' 'FACE_ENTITY' 'CELL_ENTITY'} "
+ "and $medSource in {'eImportFile' 'eCopyAndImportFile'}" );
createMenu( action( GAUSS_CREATE_PRS ), createMenu( tr( "MEN_VISUALISATION" ), -1 ), -1 );
createTool( GAUSS_CREATE_PRS, createTool( tr( "TOOL_VISUALISATION" ) ), -1 );
aRule + " and ({true} in $canBeDisplayed)" );*/
createAction( GAUSS_RENAME_CONFIGURATION, VisuGUI::tr("MEN_RENAME"), QIcon(),
- VisuGUI::tr("MEN_RENAME"), "", 0, this, false,
+ VisuGUI::tr("MEN_RENAME"), "", 0, this, false,
this, SLOT(OnRename()));
mgr->insert( action( GAUSS_RENAME_CONFIGURATION ), -1, -1, -1 );
mgr->setRule( action( GAUSS_RENAME_CONFIGURATION ), "selcount=1 and type='VISU::TGAUSSVIEW'" );
// aViewer->setBackgroundColor( aResourceMgr->colorValue( "VTKViewer", "background", aViewer->backgroundColor() ) );
// aViewer->setProjectionMode( aResourceMgr->integerValue( "VTKViewer", "projection_mode", aViewer->projectionMode() ) );
// aViewer->setTrihedronSize( aResourceMgr->integerValue( "VTKViewer", "trihedron_size", aViewer->trihedronSize() ),
-// aResourceMgr->booleanValue( "VTKViewer", "relative_size", aViewer->trihedronRelative() ) );
+// aResourceMgr->booleanValue( "VTKViewer", "relative_size", aViewer->trihedronRelative() ) );
// aViewer->setIncrementalSpeed( aResourceMgr->integerValue( "VTKViewer", "speed_value", aViewer->incrementalSpeed() ),
-// aResourceMgr->integerValue( "VTKViewer", "speed_mode", aViewer->incrementalSpeedMode() ) );
+// aResourceMgr->integerValue( "VTKViewer", "speed_mode", aViewer->incrementalSpeedMode() ) );
// aViewer->setInteractionStyle( aResourceMgr->integerValue( "VTKViewer", "navigation_mode", aViewer->interactionStyle() ) );
// aViewer->setSpacemouseButtons( aResourceMgr->integerValue( "VTKViewer", "spacemouse_func1_btn", aViewer->spacemouseBtn(1) ),
-// aResourceMgr->integerValue( "VTKViewer", "spacemouse_func2_btn", aViewer->spacemouseBtn(1) ),
-// aResourceMgr->integerValue( "VTKViewer", "spacemouse_func5_btn", aViewer->spacemouseBtn(1) ) );
+// aResourceMgr->integerValue( "VTKViewer", "spacemouse_func2_btn", aViewer->spacemouseBtn(1) ),
+// aResourceMgr->integerValue( "VTKViewer", "spacemouse_func5_btn", aViewer->spacemouseBtn(1) ) );
// new LightApp_VTKSelector( aViewer, anApp->selectionMgr() );
setPreferenceProperty( primitiveGr, "columns", 2 );
int primitiveTypePref = addPreference( tr( "VISU_GAUSS_PREF_PRIMITIVE_TYPE" ), primitiveGr,
- LightApp_Preferences::Selector, "VISU",
+ LightApp_Preferences::Selector, "VISU",
"point_sprite_primitive_type" );
QStringList values;
setPreferenceProperty( primitiveTypePref, "indexes", indices );
int clampPref = addPreference( tr( "VISU_GAUSS_PREF_CLAMP" ), primitiveGr,
- LightApp_Preferences::IntSpin, "VISU", "point_sprite_clamp" );
+ LightApp_Preferences::IntSpin, "VISU", "point_sprite_clamp" );
setPreferenceProperty( clampPref, "min", 1 );
setPreferenceProperty( clampPref, "max", 512 );
addPreference( tr( "VISU_GAUSS_PREF_MAIN_TEXTURE" ), primitiveGr,
- LightApp_Preferences::File, "VISU", "point_sprite_main_texture" );
+ LightApp_Preferences::File, "VISU", "point_sprite_main_texture" );
addPreference( tr( "VISU_GAUSS_PREF_ALPHA_TEXTURE" ), primitiveGr,
- LightApp_Preferences::File, "VISU", "point_sprite_alpha_texture" );
+ LightApp_Preferences::File, "VISU", "point_sprite_alpha_texture" );
int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr,
- LightApp_Preferences::DblSpin, "VISU",
+ LightApp_Preferences::DblSpin, "VISU",
"point_sprite_alpha_threshold" );
setPreferenceProperty( alphaThresholdPref, "min", 0.0 );
setPreferenceProperty( alphaThresholdPref, "max", 1.0 );
setPreferenceProperty( alphaThresholdPref, "step", 0.1 );
int resolutionPref = addPreference( tr( "VISU_GAUSS_PREF_RESOLUTION" ), primitiveGr,
- LightApp_Preferences::IntSpin, "VISU", "geom_sphere_resolution" );
+ LightApp_Preferences::IntSpin, "VISU", "geom_sphere_resolution" );
setPreferenceProperty( resolutionPref, "min", 3 );
setPreferenceProperty( resolutionPref, "max", 100 );
int faceLimitPref = addPreference( tr( "VISU_GAUSS_PREF_FACE_LIMIT" ), primitiveGr,
- LightApp_Preferences::IntSpin, "VISU", "geom_sphere_face_limit" );
+ LightApp_Preferences::IntSpin, "VISU", "geom_sphere_face_limit" );
setPreferenceProperty( faceLimitPref, "min", 10 );
setPreferenceProperty( faceLimitPref, "max", 1000000 );
setPreferenceProperty( sizeGr, "columns", 2 );
int minSizePref = addPreference( tr( "VISU_GAUSS_PREF_MIN_SIZE" ), sizeGr,
- LightApp_Preferences::IntSpin, "VISU", "point_sprite_min_size" );
+ LightApp_Preferences::IntSpin, "VISU", "point_sprite_min_size" );
setPreferenceProperty( minSizePref, "min", 1 );
setPreferenceProperty( minSizePref, "max", 100 );
int maxSizePref = addPreference( tr( "VISU_GAUSS_PREF_MAX_SIZE" ), sizeGr,
- LightApp_Preferences::IntSpin, "VISU", "point_sprite_max_size" );
+ LightApp_Preferences::IntSpin, "VISU", "point_sprite_max_size" );
setPreferenceProperty( maxSizePref, "min", 1 );
setPreferenceProperty( maxSizePref, "max", 100 );
int magnificationPref = addPreference( tr( "VISU_GAUSS_PREF_MAGNIFICATION" ), sizeGr,
- LightApp_Preferences::IntSpin, "VISU",
+ LightApp_Preferences::IntSpin, "VISU",
"point_sprite_magnification" );
setPreferenceProperty( magnificationPref, "min", 10 );
setPreferenceProperty( magnificationPref, "max", 1000 );
int incrementPref = addPreference( tr( "VISU_GAUSS_PREF_INCREMENT" ), sizeGr,
- LightApp_Preferences::DblSpin, "VISU", "point_sprite_increment" );
+ LightApp_Preferences::DblSpin, "VISU", "point_sprite_increment" );
setPreferenceProperty( incrementPref, "min", 0.01 );
setPreferenceProperty( incrementPref, "max", 10 );
setPreferenceProperty( incrementPref, "step", 0.1 );
setPreferenceProperty( geomGr, "columns", 2 );
int sizePref = addPreference( tr( "VISU_GAUSS_PREF_SIZE" ), geomGr,
- LightApp_Preferences::IntSpin, "VISU", "point_sprite_size" );
+ LightApp_Preferences::IntSpin, "VISU", "point_sprite_size" );
setPreferenceProperty( sizePref, "min", 1 );
setPreferenceProperty( sizePref, "max", 100 );
addPreference( tr( "VISU_GAUSS_PREF_COLOR" ), geomGr,
- LightApp_Preferences::Color, "VISU", "point_sprite_color" );
+ LightApp_Preferences::Color, "VISU", "point_sprite_color" );
// ScalarBar Preferences
int scalarBarGr = addPreference( tr( "VISU_GAUSS_SCALAR_BAR_PREF_GROUP_TTL" ), gaussTab );
setPreferenceProperty( scalarBarGr, "columns", 2 );
int activeBarPref = addPreference( tr( "VISU_GAUSS_PREF_ACTIVE_BAR" ), scalarBarGr,
- LightApp_Preferences::Selector, "VISU", "scalar_bar_active_local" );
+ LightApp_Preferences::Selector, "VISU", "scalar_bar_active_local" );
values.clear();
values.append( tr( "VISU_GAUSS_PREF_LOCAL" ) );
setPreferenceProperty( activeBarPref, "indexes", indices );
addPreference( tr( "VISU_GAUSS_PREF_DISPLAY_GLOBAL" ), scalarBarGr,
- LightApp_Preferences::Bool, "VISU", "scalar_bar_display_global" );
+ LightApp_Preferences::Bool, "VISU", "scalar_bar_display_global" );
int colorPref = addPreference( tr( "VISU_GAUSS_PREF_SCALAR_BAR_MODE" ), scalarBarGr,
- LightApp_Preferences::Selector, "VISU", "scalar_bar_bicolor" );
+ LightApp_Preferences::Selector, "VISU", "scalar_bar_bicolor" );
values.clear();
values.append( tr( "VISU_GAUSS_PREF_BICOLOR" ) );
setPreferenceProperty( colorPref, "indexes", indices );
int spacingPref = addPreference( tr( "VISU_GAUSS_PREF_SPACING" ), scalarBarGr,
- LightApp_Preferences::DblSpin, "VISU", "scalar_bar_spacing" );
+ LightApp_Preferences::DblSpin, "VISU", "scalar_bar_spacing" );
setPreferenceProperty( spacingPref, "min", 0.01 );
setPreferenceProperty( spacingPref, "max", 1.0 );
setPreferenceProperty( spacingPref, "step", 0.01 );
setPreferenceProperty( primitiveTypePref, "indexes", indices );
int clampPref = addPreference( tr( "VISU_GAUSS_PREF_CLAMP" ), primitiveGr,
- LightApp_Preferences::IntSpin, "VISU", "inside_point_sprite_clamp" );
+ LightApp_Preferences::IntSpin, "VISU", "inside_point_sprite_clamp" );
setPreferenceProperty( clampPref, "min", 1 );
setPreferenceProperty( clampPref, "max", 512 );
addPreference( tr( "VISU_GAUSS_PREF_MAIN_TEXTURE" ), primitiveGr,
- LightApp_Preferences::File, "VISU", "inside_point_sprite_main_texture" );
+ LightApp_Preferences::File, "VISU", "inside_point_sprite_main_texture" );
addPreference( tr( "VISU_GAUSS_PREF_ALPHA_TEXTURE" ), primitiveGr,
- LightApp_Preferences::File, "VISU", "inside_point_sprite_alpha_texture" );
+ LightApp_Preferences::File, "VISU", "inside_point_sprite_alpha_texture" );
int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr,
- LightApp_Preferences::DblSpin, "VISU",
+ LightApp_Preferences::DblSpin, "VISU",
"inside_point_sprite_alpha_threshold" );
setPreferenceProperty( alphaThresholdPref, "min", 0.0 );
setPreferenceProperty( alphaThresholdPref, "max", 1.0 );
setPreferenceProperty( alphaThresholdPref, "step", 0.1 );
int resolutionPref = addPreference( tr( "VISU_GAUSS_PREF_RESOLUTION" ), primitiveGr,
- LightApp_Preferences::IntSpin, "VISU",
+ LightApp_Preferences::IntSpin, "VISU",
"inside_geom_sphere_resolution" );
setPreferenceProperty( resolutionPref, "min", 3 );
setPreferenceProperty( resolutionPref, "max", 100 );
int faceLimitPref = addPreference( tr( "VISU_GAUSS_PREF_FACE_LIMIT" ), primitiveGr,
- LightApp_Preferences::IntSpin, "VISU",
+ LightApp_Preferences::IntSpin, "VISU",
"inside_geom_sphere_face_limit" );
setPreferenceProperty( faceLimitPref, "min", 10 );
setPreferenceProperty( faceLimitPref, "max", 1000000 );
setPreferenceProperty( sizeGr, "columns", 4 );
int minSizePref = addPreference( tr( "VISU_GAUSS_PREF_MIN_SIZE" ), sizeGr,
- LightApp_Preferences::IntSpin, "VISU",
+ LightApp_Preferences::IntSpin, "VISU",
"inside_point_sprite_min_size" );
setPreferenceProperty( minSizePref, "min", 1 );
setPreferenceProperty( minSizePref, "max", 100 );
int maxSizePref = addPreference( tr( "VISU_GAUSS_PREF_MAX_SIZE" ), sizeGr,
- LightApp_Preferences::IntSpin, "VISU",
+ LightApp_Preferences::IntSpin, "VISU",
"inside_point_sprite_max_size" );
setPreferenceProperty( maxSizePref, "min", 1 );
setPreferenceProperty( maxSizePref, "max", 100 );
setPreferenceProperty( magnificationGr, "columns", 4 );
int magnificationPref = addPreference( tr( "VISU_GAUSS_PREF_MAGNIFICATION" ), magnificationGr,
- LightApp_Preferences::IntSpin, "VISU",
+ LightApp_Preferences::IntSpin, "VISU",
"inside_point_sprite_magnification" );
setPreferenceProperty( magnificationPref, "min", 10 );
setPreferenceProperty( magnificationPref, "max", 1000 );
int incrementPref = addPreference( tr( "VISU_GAUSS_PREF_INCREMENT" ), magnificationGr,
- LightApp_Preferences::DblSpin, "VISU",
+ LightApp_Preferences::DblSpin, "VISU",
"inside_point_sprite_increment" );
setPreferenceProperty( incrementPref, "min", 0.01 );
setPreferenceProperty( incrementPref, "max", 10 );
setPreferenceProperty( primitiveTypePref, "indexes", indices );
int clampPref = addPreference( tr( "VISU_GAUSS_PREF_CLAMP" ), primitiveGr,
- LightApp_Preferences::IntSpin, "VISU", "outside_point_sprite_clamp" );
+ LightApp_Preferences::IntSpin, "VISU", "outside_point_sprite_clamp" );
setPreferenceProperty( clampPref, "min", 1 );
setPreferenceProperty( clampPref, "max", 512 );
addPreference( tr( "VISU_GAUSS_PREF_MAIN_TEXTURE" ), primitiveGr,
- LightApp_Preferences::File, "VISU", "outside_point_sprite_main_texture" );
+ LightApp_Preferences::File, "VISU", "outside_point_sprite_main_texture" );
addPreference( tr( "VISU_GAUSS_PREF_ALPHA_TEXTURE" ), primitiveGr,
- LightApp_Preferences::File, "VISU", "outside_point_sprite_alpha_texture" );
+ LightApp_Preferences::File, "VISU", "outside_point_sprite_alpha_texture" );
int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr,
- LightApp_Preferences::DblSpin, "VISU",
+ LightApp_Preferences::DblSpin, "VISU",
"outside_point_sprite_alpha_threshold" );
setPreferenceProperty( alphaThresholdPref, "min", 0.0 );
setPreferenceProperty( alphaThresholdPref, "max", 1.0 );
setPreferenceProperty( alphaThresholdPref, "step", 0.1 );
int resolutionPref = addPreference( tr( "VISU_GAUSS_PREF_RESOLUTION" ), primitiveGr,
- LightApp_Preferences::IntSpin, "VISU",
+ LightApp_Preferences::IntSpin, "VISU",
"outside_geom_sphere_resolution" );
setPreferenceProperty( resolutionPref, "min", 3 );
setPreferenceProperty( resolutionPref, "max", 100 );
int faceLimitPref = addPreference( tr( "VISU_GAUSS_PREF_FACE_LIMIT" ), primitiveGr,
- LightApp_Preferences::IntSpin, "VISU",
+ LightApp_Preferences::IntSpin, "VISU",
"outside_geom_sphere_face_limit" );
setPreferenceProperty( faceLimitPref, "min", 10 );
setPreferenceProperty( faceLimitPref, "max", 1000000 );
setPreferenceProperty( sizeGr, "columns", 2 );
int sizePref = addPreference( tr( "VISU_GAUSS_PREF_SIZE" ), sizeGr,
- LightApp_Preferences::IntSpin, "VISU", "outside_point_sprite_size" );
+ LightApp_Preferences::IntSpin, "VISU", "outside_point_sprite_size" );
setPreferenceProperty( sizePref, "min", 1 );
setPreferenceProperty( sizePref, "max", 100 );
setPreferenceProperty( colorGr, "columns", 2 );
addPreference( tr( "VISU_GAUSS_PREF_UNIFORM_COLOR" ), colorGr,
- LightApp_Preferences::Bool, "VISU", "outside_point_sprite_uniform" );
+ LightApp_Preferences::Bool, "VISU", "outside_point_sprite_uniform" );
addPreference( tr( "VISU_GAUSS_PREF_COLOR" ), colorGr,
- LightApp_Preferences::Color, "VISU", "outside_point_sprite_color" );
+ LightApp_Preferences::Color, "VISU", "outside_point_sprite_color" );
}
setPreferenceProperty( cursorSizePref, "step", 0.1 );
int pyramidHeightPref = addPreference( tr( "VISU_PICKING_PREF_PYRAMID_HEIGHT" ), cursorGr,
- LightApp_Preferences::DblSpin, "VISU", "picking_pyramid_height" );
+ LightApp_Preferences::DblSpin, "VISU", "picking_pyramid_height" );
setPreferenceProperty( pyramidHeightPref, "min", 1 );
setPreferenceProperty( pyramidHeightPref, "max", 100 );
setPreferenceProperty( infoWindowGr, "columns", 2 );
int infoWindowPref = addPreference( tr( "VISU_PICKING_PREF_INFO_WINDOW" ), infoWindowGr,
- LightApp_Preferences::Bool, "VISU", "picking_info_window" );
+ LightApp_Preferences::Bool, "VISU", "picking_info_window" );
setPreferenceProperty( infoWindowPref, "columns", 2 );
int transparencyPref = addPreference( tr( "VISU_PICKING_PREF_TRANSPARENCY" ), infoWindowGr,
- LightApp_Preferences::IntSpin, "VISU", "picking_transparency" );
+ LightApp_Preferences::IntSpin, "VISU", "picking_transparency" );
setPreferenceProperty( transparencyPref, "min", 0 );
setPreferenceProperty( transparencyPref, "max", 100 );
setPreferenceProperty( transparencyPref, "step", 10 );
int positionPref = addPreference( tr( "VISU_PICKING_PREF_POSITION" ), infoWindowGr,
- LightApp_Preferences::Selector, "VISU", "picking_position" );
+ LightApp_Preferences::Selector, "VISU", "picking_position" );
QStringList values;
values.append( tr( "VISU_PICKING_PREF_BELOW_POINT" ) );
values.append( tr( "VISU_PICKING_PREF_TOP_LEFT_CORNER" ) );
setPreferenceProperty( cameraGr, "columns", 2 );
int cameraPref = addPreference( tr( "VISU_PICKING_PREF_CAMERA_MOVEMENT" ), cameraGr,
- LightApp_Preferences::Bool, "VISU", "picking_camera_movement" );
+ LightApp_Preferences::Bool, "VISU", "picking_camera_movement" );
setPreferenceProperty( cameraPref, "columns", 2 );
int zoomFactorPref = addPreference( tr( "VISU_PICKING_PREF_ZOOM_FACTOR" ), cameraGr,
- LightApp_Preferences::DblSpin, "VISU", "picking_zoom_factor" );
+ LightApp_Preferences::DblSpin, "VISU", "picking_zoom_factor" );
setPreferenceProperty( zoomFactorPref, "min", 0.1 );
setPreferenceProperty( zoomFactorPref, "max", 10.0 );
setPreferenceProperty( zoomFactorPref, "step", 0.1 );
int stepNumberPref = addPreference( tr( "VISU_PICKING_PREF_STEP_NUMBER" ), cameraGr,
- LightApp_Preferences::IntSpin, "VISU", "picking_step_number" );
+ LightApp_Preferences::IntSpin, "VISU", "picking_step_number" );
setPreferenceProperty( stepNumberPref, "min", 1 );
setPreferenceProperty( stepNumberPref, "max", 100 );
setPreferenceProperty( parentMeshGr, "columns", 1 );
addPreference( tr( "VISU_PICKING_PREF_DISPLAY_PARENT_MESH" ), parentMeshGr,
- LightApp_Preferences::Bool, "VISU", "picking_display_parent_mesh" );
+ LightApp_Preferences::Bool, "VISU", "picking_display_parent_mesh" );
}
setPreferenceProperty( recorderGr, "columns", 2 );
int modePref = addPreference( tr( "VISU_RECORDER_PREF_RECORDING_MODE" ), recorderGr,
- LightApp_Preferences::Selector, "VISU", "recorder_mode" );
+ LightApp_Preferences::Selector, "VISU", "recorder_mode" );
QStringList values;
values.append( tr( "VISU_RECORDER_PREF_SKIPPED_FRAMES" ) );
values.append( tr( "VISU_RECORDER_PREF_ALL_DISLPAYED_FRAMES" ) );
setPreferenceProperty( modePref, "indexes", indices );
int fpsPref = addPreference( tr( "VISU_RECORDER_PREF_FPS" ), recorderGr,
- LightApp_Preferences::DblSpin, "VISU", "recorder_fps" );
+ LightApp_Preferences::DblSpin, "VISU", "recorder_fps" );
setPreferenceProperty( fpsPref, "min", 0.1 );
setPreferenceProperty( fpsPref, "max", 100 );
int qualityPref = addPreference( tr( "VISU_RECORDER_PREF_QUALITY" ), recorderGr,
- LightApp_Preferences::IntSpin, "VISU", "recorder_quality" );
+ LightApp_Preferences::IntSpin, "VISU", "recorder_quality" );
setPreferenceProperty( qualityPref, "min", 1 );
setPreferenceProperty( qualityPref, "max", 100 );
addPreference( tr( "VISU_RECORDER_PREF_PROGRESSIVE" ), recorderGr,
- LightApp_Preferences::Bool, "VISU", "recorder_progressive" );
+ LightApp_Preferences::Bool, "VISU", "recorder_progressive" );
}
if (aPrs)
emit presentationCreated(aPrs);
INFOS( "VisuGUI_Module::OnCreateGaussPoints() : Gauss Points created in " <<
- vtkTimerLog::GetCPUTime() - initialTime << " seconds" );
+ vtkTimerLog::GetCPUTime() - initialTime << " seconds" );
}
// void VisuGUI_Module::OnViewManagerAdded(SUIT_ViewManager* viewMgr)
VisuGUI::preferencesChanged(group,pref);
// if ( group == "VISU" && ( pref == "speed_increment" || pref == "spacemouse_func1_btn" ||
-// pref == "spacemouse_func2_btn" || pref == "spacemouse_func3_btn" ||
-// pref == "spacemouse_func4_btn" || pref == "spacemouse_func5_btn" ) ) {
+// pref == "spacemouse_func2_btn" || pref == "spacemouse_func3_btn" ||
+// pref == "spacemouse_func4_btn" || pref == "spacemouse_func5_btn" ) ) {
// // update properties of VVTK view windows
// SUIT_ViewManager* vm = getApp()->getViewManager( VVTK_Viewer::Type(), false );
namespace
{
/* void GetViewParams(VVTK_MainWindow* theViewWindow,
- const char* theSuffix,
- std::ostringstream& theStr)
+ const char* theSuffix,
+ std::ostringstream& theStr)
{
vtkFloatingPointType aColor[3];
vtkRenderer* aRenderer = theViewWindow->getRenderer();
*/
//---------------------------------------------------------------
/* void SetViewParams(VVTK_MainWindow* theViewWindow,
- const char* theSuffix,
- const Storable::TRestoringMap& theMap)
+ const char* theSuffix,
+ const Storable::TRestoringMap& theMap)
{
vtkFloatingPointType aColor[3];
aColor[0] = Storable::FindValue(theMap,std::string("myColor") + theSuffix + ".R").toDouble();
*/
//---------------------------------------------------------------
/* void GetViewParams(VVTK_MainWindow1* theViewWindow,
- std::ostringstream& theStr)
+ std::ostringstream& theStr)
{
GetViewParams(theViewWindow,"1",theStr);
if(aWidgetCtrl->GetEnabled()){
std::string aSegmentationMode;
if(aWidgetCtrl->IsPlanesActive()){
- VISU_PlanesWidget *aPlanesWidget = aWidgetCtrl->GetPlanesWidget();
- vtkFloatingPointType anOrigin[3];
- aPlanesWidget->GetOrigin(anOrigin);
- Storable::DataToStream(theStr,"myCursorOrigin[0]",anOrigin[0]);
- Storable::DataToStream(theStr,"myCursorOrigin[1]",anOrigin[1]);
- Storable::DataToStream(theStr,"myCursorOrigin[2]",anOrigin[2]);
-
- vtkFloatingPointType aNormal[3];
- aPlanesWidget->GetNormal(aNormal);
- Storable::DataToStream(theStr,"myCursorNormal[0]",aNormal[0]);
- Storable::DataToStream(theStr,"myCursorNormal[1]",aNormal[1]);
- Storable::DataToStream(theStr,"myCursorNormal[2]",aNormal[2]);
-
- vtkFloatingPointType aDepth = aPlanesWidget->Distance();
- Storable::DataToStream(theStr,"myCursorDepth",aDepth);
-
- aSegmentationMode = "Planes";
+ VISU_PlanesWidget *aPlanesWidget = aWidgetCtrl->GetPlanesWidget();
+ vtkFloatingPointType anOrigin[3];
+ aPlanesWidget->GetOrigin(anOrigin);
+ Storable::DataToStream(theStr,"myCursorOrigin[0]",anOrigin[0]);
+ Storable::DataToStream(theStr,"myCursorOrigin[1]",anOrigin[1]);
+ Storable::DataToStream(theStr,"myCursorOrigin[2]",anOrigin[2]);
+
+ vtkFloatingPointType aNormal[3];
+ aPlanesWidget->GetNormal(aNormal);
+ Storable::DataToStream(theStr,"myCursorNormal[0]",aNormal[0]);
+ Storable::DataToStream(theStr,"myCursorNormal[1]",aNormal[1]);
+ Storable::DataToStream(theStr,"myCursorNormal[2]",aNormal[2]);
+
+ vtkFloatingPointType aDepth = aPlanesWidget->Distance();
+ Storable::DataToStream(theStr,"myCursorDepth",aDepth);
+
+ aSegmentationMode = "Planes";
}else if(aWidgetCtrl->IsSphereActive()){
- VISU_SphereWidget *aSphereWidget = aWidgetCtrl->GetSphereWidget();
- vtkFloatingPointType aCenter[3];
- aSphereWidget->GetCenter(aCenter);
- Storable::DataToStream(theStr,"mySphereCursorCenter[0]",aCenter[0]);
- Storable::DataToStream(theStr,"mySphereCursorCenter[1]",aCenter[1]);
- Storable::DataToStream(theStr,"mySphereCursorCenter[2]",aCenter[2]);
+ VISU_SphereWidget *aSphereWidget = aWidgetCtrl->GetSphereWidget();
+ vtkFloatingPointType aCenter[3];
+ aSphereWidget->GetCenter(aCenter);
+ Storable::DataToStream(theStr,"mySphereCursorCenter[0]",aCenter[0]);
+ Storable::DataToStream(theStr,"mySphereCursorCenter[1]",aCenter[1]);
+ Storable::DataToStream(theStr,"mySphereCursorCenter[2]",aCenter[2]);
- vtkFloatingPointType aRadius = aSphereWidget->GetRadius();
- Storable::DataToStream(theStr,"mySphereCursorRaduis",aRadius);
+ vtkFloatingPointType aRadius = aSphereWidget->GetRadius();
+ Storable::DataToStream(theStr,"mySphereCursorRaduis",aRadius);
- aSegmentationMode = "Sphere";
+ aSegmentationMode = "Sphere";
}
Storable::DataToStream(theStr,"mySegmentationMode",aSegmentationMode.c_str());
*/
//---------------------------------------------------------------
/*void SetViewParams(VVTK_MainWindow1* theViewWindow,
- const Storable::TRestoringMap& theMap)
+ const Storable::TRestoringMap& theMap)
{
SetViewParams(theViewWindow,"1",theMap);
}
*/
//---------------------------------------------------------------
/*void GetViewParams(VVTK_MainWindow2* theViewWindow,
- std::ostringstream& theStr)
+ std::ostringstream& theStr)
{
GetViewParams(theViewWindow,"2",theStr);
}
void SetViewParams(VVTK_MainWindow2* theViewWindow,
- const Storable::TRestoringMap& theMap)
+ const Storable::TRestoringMap& theMap)
{
SetViewParams(theViewWindow,"2",theMap);
}
void operator()(VISU_GaussPtsAct* theActor)
{
if(theActor->GetVisibility()){
- const Handle(SALOME_InteractiveObject)& anIO = theActor->getIO();
- myVisibleEntries.insert(TVisibleEntries::value_type(anIO->getEntry(),TSelection()));
+ const Handle(SALOME_InteractiveObject)& anIO = theActor->getIO();
+ myVisibleEntries.insert(TVisibleEntries::value_type(anIO->getEntry(),TSelection()));
}
}
};
/*void GetGaussPointsSelection(SVTK_ViewWindow* theViewWindow,
- TVisibleEntries& theVisibleEntries)
+ TVisibleEntries& theVisibleEntries)
{
// First find all visible Gauss Points presentations
vtkRenderer* aRenderer = theViewWindow->getRenderer();
vtkActorCollection* anActors = aRenderer->GetActors();
TGetVisibleEntries aGetVisibleEntries(theVisibleEntries);
SVTK::ForEach<VISU_GaussPtsAct>(anActors,
- aGetVisibleEntries);
+ aGetVisibleEntries);
// Next, find the sub-ids for the visible Gauss Points presentations
SVTK_Selector* aSelector = theViewWindow->GetSelector();
std::string anEntry = anIO->getEntry();
TVisibleEntries::iterator anEntriesIter = theVisibleEntries.find(anEntry);
if(anEntriesIter != theVisibleEntries.end()){
- TSelection& aSelection = anEntriesIter->second;
- aSelection.myIsSelected = true;
- TColStd_IndexedMapOfInteger anIndexes;
- aSelector->GetIndex(anIO,anIndexes);
- if(anIndexes.Extent() > 0){
- aSelection.myHasSubId = true;
- aSelection.mySubId = anIndexes(1);
- }
+ TSelection& aSelection = anEntriesIter->second;
+ aSelection.myIsSelected = true;
+ TColStd_IndexedMapOfInteger anIndexes;
+ aSelector->GetIndex(anIO,anIndexes);
+ if(anIndexes.Extent() > 0){
+ aSelection.myHasSubId = true;
+ aSelection.mySubId = anIndexes(1);
+ }
}
}
}
//---------------------------------------------------------------
inline void CreateReference(_PTR(Study) theStudyDocument,
- _PTR(StudyBuilder) theStudyBuilder,
- _PTR(SObject) theFatherSObject,
- const string& theRefEntry,
- const TSelection& theSelection)
+ _PTR(StudyBuilder) theStudyBuilder,
+ _PTR(SObject) theFatherSObject,
+ const string& theRefEntry,
+ const TSelection& theSelection)
{
_PTR(SObject) aNewObj = theStudyBuilder->NewObject(theFatherSObject);
_PTR(SObject) aRefSObj = theStudyDocument->FindObjectID(theRefEntry);
//---------------------------------------------------------------
/*void SetGaussPointsSelection(VisuGUI* theModule,
- SVTK_ViewWindow* theViewWindow,
- _PTR(Study) theCStudy,
- _PTR(SObject) theSObject)
+ SVTK_ViewWindow* theViewWindow,
+ _PTR(Study) theCStudy,
+ _PTR(SObject) theSObject)
{
SVTK_Selector* aSelector = theViewWindow->GetSelector();
aSelector->ClearIObjects();
_PTR(SObject) aChildSObject = aChildIter->Value();
_PTR(SObject) aSObject;
if(aChildSObject->ReferencedObject(aSObject)){
- CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject);
- PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
- if(VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in())){
- // To set visiblity
- VISU::UpdateViewer(theModule, aPrs3d, anIsFirst, false);
- anIsFirst = false;
-
- // To update selection
- Storable::TRestoringMap aMap = Storable::GetStorableMap(aChildSObject);
- if(!aMap.empty()){
- bool anIsSelected = aMap["myIsSelected"].toInt();
- bool aHasSubId = aMap["myHasSubId"].toInt();
- int aSubId = aMap["mySubId"].toInt();
-
- if(anIsSelected){
- std::string anEntry = aSObject->GetID();
- Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject(anEntry.c_str(),"");
- aSelector->AddIObject(anIO);
- if(aHasSubId)
- aSelector->AddOrRemoveIndex(anIO,aSubId,false);
- }
- }
- }
+ CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject);
+ PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
+ if(VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in())){
+ // To set visiblity
+ VISU::UpdateViewer(theModule, aPrs3d, anIsFirst, false);
+ anIsFirst = false;
+
+ // To update selection
+ Storable::TRestoringMap aMap = Storable::GetStorableMap(aChildSObject);
+ if(!aMap.empty()){
+ bool anIsSelected = aMap["myIsSelected"].toInt();
+ bool aHasSubId = aMap["myHasSubId"].toInt();
+ int aSubId = aMap["mySubId"].toInt();
+
+ if(anIsSelected){
+ std::string anEntry = aSObject->GetID();
+ Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject(anEntry.c_str(),"");
+ aSelector->AddIObject(anIO);
+ if(aHasSubId)
+ aSelector->AddOrRemoveIndex(anIO,aSubId,false);
+ }
+ }
+ }
}
}
//---------------------------------------------------------------
/*void OnStoreConfiguration(SalomeApp_Module* theModule,
- bool theIsNew)
+ bool theIsNew)
{
_PTR(Study) aCStudy = GetCStudy(GetAppStudy(theModule));
if (CheckLock(aCStudy,GetDesktop(theModule)))
std::string aValue = GetViewParams(aViewWindow);
if(theIsNew){
- _PTR(SComponent) aSComponent = ClientFindOrCreateVisuComponent(aCStudy);
-
- static int myNbConfigs = 0;
- std::string aName = VISU::GenerateName("Config.", ++myNbConfigs).toLatin1().data();
-
- std::string aSComponentEntry = aSComponent->GetID();
- anEntry = CreateAttributes(aCStudy,
- aSComponentEntry.c_str(),
- "",
- "",
- aName.c_str(),
- "",
- aValue.c_str());
+ _PTR(SComponent) aSComponent = ClientFindOrCreateVisuComponent(aCStudy);
+
+ static int myNbConfigs = 0;
+ std::string aName = VISU::GenerateName("Config.", ++myNbConfigs).toLatin1().data();
+
+ std::string aSComponentEntry = aSComponent->GetID();
+ anEntry = CreateAttributes(aCStudy,
+ aSComponentEntry.c_str(),
+ "",
+ "",
+ aName.c_str(),
+ "",
+ aValue.c_str());
}else{
- SALOME_ListIO aListIO;
- aSelectionMgr->selectedObjects(aListIO);
- SALOME_ListIteratorOfListIO aListIter( aListIO );
- for(; aListIter.More(); aListIter.Next()){
- Handle(SALOME_InteractiveObject) anIO = aListIter.Value();
- _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
- _PTR(GenericAttribute) anAttr;
- if(aSObject->FindAttribute(anAttr,"AttributeString")){
- _PTR(AttributeString) aComment(anAttr);
- std::string aCommentValue(aComment->Value());
- if(aCommentValue.compare("myComment=GAUSSVIEW") >= 0){
- aComment->SetValue(aValue.c_str());
- anEntry = aSObject->GetID();
-
- _PTR(ChildIterator) aChildIter = aCStudy->NewChildIterator(aSObject);
- for (; aChildIter->More(); aChildIter->Next()) {
- _PTR(SObject) aChildSObject = aChildIter->Value();
- aStudyBuilder->RemoveObject(aChildSObject);
- }
- break;
- }
- }
- }
+ SALOME_ListIO aListIO;
+ aSelectionMgr->selectedObjects(aListIO);
+ SALOME_ListIteratorOfListIO aListIter( aListIO );
+ for(; aListIter.More(); aListIter.Next()){
+ Handle(SALOME_InteractiveObject) anIO = aListIter.Value();
+ _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
+ _PTR(GenericAttribute) anAttr;
+ if(aSObject->FindAttribute(anAttr,"AttributeString")){
+ _PTR(AttributeString) aComment(anAttr);
+ std::string aCommentValue(aComment->Value());
+ if(aCommentValue.compare("myComment=GAUSSVIEW") >= 0){
+ aComment->SetValue(aValue.c_str());
+ anEntry = aSObject->GetID();
+
+ _PTR(ChildIterator) aChildIter = aCStudy->NewChildIterator(aSObject);
+ for (; aChildIter->More(); aChildIter->Next()) {
+ _PTR(SObject) aChildSObject = aChildIter->Value();
+ aStudyBuilder->RemoveObject(aChildSObject);
+ }
+ break;
+ }
+ }
+ }
}
if(anEntry != ""){
- TVisibleEntries aVisibleEntries;
- GetGaussPointsSelection(aViewWindow,
- aVisibleEntries);
-
- _PTR(SObject) aSObject = aCStudy->FindObjectID(anEntry);
- _PTR(StudyBuilder) aStudyBuilder = aCStudy->NewBuilder();
- TVisibleEntries::const_iterator anIter = aVisibleEntries.begin();
- for(; anIter != aVisibleEntries.end(); anIter++){
- const std::string& anEntry = anIter->first;
- const TSelection& aSelection = anIter->second;
-
- CreateReference(aCStudy,
- aStudyBuilder,
- aSObject,
- anEntry,
- aSelection);
- }
-
- //UpdateObjBrowser(theModule,true,aSObject);
- UpdateObjBrowser(theModule,true);
+ TVisibleEntries aVisibleEntries;
+ GetGaussPointsSelection(aViewWindow,
+ aVisibleEntries);
+
+ _PTR(SObject) aSObject = aCStudy->FindObjectID(anEntry);
+ _PTR(StudyBuilder) aStudyBuilder = aCStudy->NewBuilder();
+ TVisibleEntries::const_iterator anIter = aVisibleEntries.begin();
+ for(; anIter != aVisibleEntries.end(); anIter++){
+ const std::string& anEntry = anIter->first;
+ const TSelection& aSelection = anIter->second;
+
+ CreateReference(aCStudy,
+ aStudyBuilder,
+ aSObject,
+ anEntry,
+ aSelection);
+ }
+
+ //UpdateObjBrowser(theModule,true,aSObject);
+ UpdateObjBrowser(theModule,true);
}
}
}*/
//---------------------------------------------------------------
/* template<class TMainWindow>
void SetMainWindowParams(VisuGUI* theModule,
- _PTR(SObject) theSObject,
- VVTK_ViewWindow* theViewWindow,
- TMainWindow* theMainWindow)
+ _PTR(SObject) theSObject,
+ VVTK_ViewWindow* theViewWindow,
+ TMainWindow* theMainWindow)
{
_PTR(Study) aCStudy = GetCStudy(GetAppStudy(theModule));
std::string aSegmentationMode;
if(VVTK_MainWindow1* aMainWindow = aViewWindow->getMainWindow1()){
- aMainWindow->SetPlanesSegementation(false);
- aMainWindow->SetSphereSegementation(false);
- VISU_WidgetCtrl* aWidgetCtrl = aMainWindow->GetWidgetCtrl();
- aSegmentationMode = Storable::FindValue(aMap,"mySegmentationMode").toLatin1().data();
-
- if(aSegmentationMode == "Planes"){
- VISU_PlanesWidget *aPlanesWidget = aWidgetCtrl->GetPlanesWidget();
- vtkFloatingPointType anOrigin[3];
- anOrigin[0] = Storable::FindValue(aMap,"myCursorOrigin[0]").toDouble();
- anOrigin[1] = Storable::FindValue(aMap,"myCursorOrigin[1]").toDouble();
- anOrigin[2] = Storable::FindValue(aMap,"myCursorOrigin[2]").toDouble();
- aPlanesWidget->SetOrigin(anOrigin);
-
- vtkFloatingPointType aNormal[3];
- aNormal[0] = Storable::FindValue(aMap,"myCursorNormal[0]").toDouble();
- aNormal[1] = Storable::FindValue(aMap,"myCursorNormal[1]").toDouble();
- aNormal[2] = Storable::FindValue(aMap,"myCursorNormal[2]").toDouble();
- aPlanesWidget->SetNormal(aNormal);
-
- vtkFloatingPointType aDepth = Storable::FindValue(aMap,"myCursorDepth").toDouble();
- aPlanesWidget->SetDistance(aDepth);
-
- aMainWindow->SetPlanesSegementation(true);
- }else if(aSegmentationMode == "Sphere"){
- VISU_SphereWidget *aSphereWidget = aWidgetCtrl->GetSphereWidget();
- vtkFloatingPointType aCenter[3];
- aCenter[0] = Storable::FindValue(aMap,"mySphereCursorCenter[0]").toDouble();
- aCenter[1] = Storable::FindValue(aMap,"mySphereCursorCenter[1]").toDouble();
- aCenter[2] = Storable::FindValue(aMap,"mySphereCursorCenter[2]").toDouble();
- aSphereWidget->SetCenter(aCenter);
-
- vtkFloatingPointType aRadius = Storable::FindValue(aMap,"mySphereCursorRaduis").toDouble();
- aSphereWidget->SetRadius(aRadius);
-
- aMainWindow->SetSphereSegementation(true);
- }
+ aMainWindow->SetPlanesSegementation(false);
+ aMainWindow->SetSphereSegementation(false);
+ VISU_WidgetCtrl* aWidgetCtrl = aMainWindow->GetWidgetCtrl();
+ aSegmentationMode = Storable::FindValue(aMap,"mySegmentationMode").toLatin1().data();
+
+ if(aSegmentationMode == "Planes"){
+ VISU_PlanesWidget *aPlanesWidget = aWidgetCtrl->GetPlanesWidget();
+ vtkFloatingPointType anOrigin[3];
+ anOrigin[0] = Storable::FindValue(aMap,"myCursorOrigin[0]").toDouble();
+ anOrigin[1] = Storable::FindValue(aMap,"myCursorOrigin[1]").toDouble();
+ anOrigin[2] = Storable::FindValue(aMap,"myCursorOrigin[2]").toDouble();
+ aPlanesWidget->SetOrigin(anOrigin);
+
+ vtkFloatingPointType aNormal[3];
+ aNormal[0] = Storable::FindValue(aMap,"myCursorNormal[0]").toDouble();
+ aNormal[1] = Storable::FindValue(aMap,"myCursorNormal[1]").toDouble();
+ aNormal[2] = Storable::FindValue(aMap,"myCursorNormal[2]").toDouble();
+ aPlanesWidget->SetNormal(aNormal);
+
+ vtkFloatingPointType aDepth = Storable::FindValue(aMap,"myCursorDepth").toDouble();
+ aPlanesWidget->SetDistance(aDepth);
+
+ aMainWindow->SetPlanesSegementation(true);
+ }else if(aSegmentationMode == "Sphere"){
+ VISU_SphereWidget *aSphereWidget = aWidgetCtrl->GetSphereWidget();
+ vtkFloatingPointType aCenter[3];
+ aCenter[0] = Storable::FindValue(aMap,"mySphereCursorCenter[0]").toDouble();
+ aCenter[1] = Storable::FindValue(aMap,"mySphereCursorCenter[1]").toDouble();
+ aCenter[2] = Storable::FindValue(aMap,"mySphereCursorCenter[2]").toDouble();
+ aSphereWidget->SetCenter(aCenter);
+
+ vtkFloatingPointType aRadius = Storable::FindValue(aMap,"mySphereCursorRaduis").toDouble();
+ aSphereWidget->SetRadius(aRadius);
+
+ aMainWindow->SetSphereSegementation(true);
+ }
}
if(VVTK_MainWindow1* aMainWindow = aViewWindow->getMainWindow1()){
- SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
- if(anInteractor->isVisible()){
- SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow);
- }else
- anInteractor->installEventFilter(this);
+ SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
+ if(anInteractor->isVisible()){
+ SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow);
+ }else
+ anInteractor->installEventFilter(this);
}
if(aSegmentationMode != ""){
- if(VVTK_MainWindow2* aMainWindow = aViewWindow->getMainWindow2()){
- SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
- if(anInteractor->isVisible())
- SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow);
- else
- anInteractor->installEventFilter(this);
- }
+ if(VVTK_MainWindow2* aMainWindow = aViewWindow->getMainWindow2()){
+ SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
+ if(anInteractor->isVisible())
+ SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow);
+ else
+ anInteractor->installEventFilter(this);
+ }
}
SetGaussPointsSelection(this,aViewWindow,aCStudy,aSObject);
// SUIT_ViewWindow* aWindow = aViewManager->getActiveView();
// VVTK_ViewWindow* aViewWindow = dynamic_cast<VVTK_ViewWindow*>(aWindow);
// if(VVTK_MainWindow1* aMainWindow = aViewWindow->getMainWindow1()){
-// SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
-// if(theWatched == anInteractor){
-// SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow);
-// anInteractor->removeEventFilter(this);
-// }
+// SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
+// if(theWatched == anInteractor){
+// SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow);
+// anInteractor->removeEventFilter(this);
+// }
// }
// if(VVTK_MainWindow2* aMainWindow = aViewWindow->getMainWindow2()){
-// SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
-// if(theWatched == aMainWindow->GetInteractor()){
-// SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow);
-// anInteractor->removeEventFilter(this);
-// }
+// SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
+// if(theWatched == aMainWindow->GetInteractor()){
+// SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow);
+// anInteractor->removeEventFilter(this);
+// }
// }
// }
// }
vwin->getVisualParameters().toLatin1().data() );
if ( application()->desktop()->activeWindow() == vwin )
- ip->setProperty( "ActiveGaussViewer", QString::number( vvtkViewers ).toLatin1().data() );
+ ip->setProperty( "ActiveGaussViewer", QString::number( vvtkViewers ).toLatin1().data() );
vvtkViewers++;
}
}
// saving VTK actors' properties
if ( vType == SVTK_Viewer::Type() /*|| // processing SVTK and VVTK viewers in the same
- vType == VVTK_Viewer::Type()*/ ) { // way (VVTK_ViewWindow inherits SVTK_ViewWindow)
+ vType == VVTK_Viewer::Type()*/ ) { // way (VVTK_ViewWindow inherits SVTK_ViewWindow)
QVector<SUIT_ViewWindow*> views = vman->getViews();
for ( int i = 0, iEnd = vman->getViewsCount(); i < iEnd; i++ ) {
- if ( SVTK_ViewWindow* vtkView = dynamic_cast<SVTK_ViewWindow*>( views[i] ) ) {
- VTK::ActorCollectionCopy aCopy(vtkView->getRenderer()->GetActors());
- vtkActorCollection* allActors = aCopy.GetActors();
- allActors->InitTraversal();
- while ( vtkActor* actor = allActors->GetNextActor() ) {
- if ( actor->GetVisibility() ) { // store only visible actors
- if ( VISU_Actor* vActor = VISU_Actor::SafeDownCast( actor ) ) {
- if ( vActor->hasIO() ) { // actor corresponds to existing obj
-
- Handle(SALOME_InteractiveObject) io = vActor->getIO();
- // entry is "ecoded" = it does NOT contain component adress, since it is a
- // subject to change on next component loading
- std::string entry = ip->encodeEntry( io->getEntry(), componentName );
-
- std::string param, vtkParam = vType.toLatin1().data();
+ if ( SVTK_ViewWindow* vtkView = dynamic_cast<SVTK_ViewWindow*>( views[i] ) ) {
+ VTK::ActorCollectionCopy aCopy(vtkView->getRenderer()->GetActors());
+ vtkActorCollection* allActors = aCopy.GetActors();
+ allActors->InitTraversal();
+ while ( vtkActor* actor = allActors->GetNextActor() ) {
+ if ( actor->GetVisibility() ) { // store only visible actors
+ if ( VISU_Actor* vActor = VISU_Actor::SafeDownCast( actor ) ) {
+ if ( vActor->hasIO() ) { // actor corresponds to existing obj
+
+ Handle(SALOME_InteractiveObject) io = vActor->getIO();
+ // entry is "ecoded" = it does NOT contain component adress, since it is a
+ // subject to change on next component loading
+ std::string entry = ip->encodeEntry( io->getEntry(), componentName );
+
+ std::string param, vtkParam = vType.toLatin1().data();
vtkParam += gSeparator;
- vtkParam += QString::number( *viewsCounter ).toLatin1().data();
+ vtkParam += QString::number( *viewsCounter ).toLatin1().data();
vtkParam += gSeparator;
- param = vtkParam + "Visibility";
- ip->setParameter( entry, param, "On" );
- param = vtkParam + "Name";
- ip->setParameter( entry, param, vActor->getName() );
- param = vtkParam + "RepresentationMode";
- ip->setParameter( entry, param, QString::number( vActor->GetRepresentation() ).toLatin1().data() );
+ param = vtkParam + "Visibility";
+ ip->setParameter( entry, param, "On" );
+ param = vtkParam + "Name";
+ ip->setParameter( entry, param, vActor->getName() );
+ param = vtkParam + "RepresentationMode";
+ ip->setParameter( entry, param, QString::number( vActor->GetRepresentation() ).toLatin1().data() );
param = vtkParam + "Quadratic2DRepresentation";
ip->setParameter( entry, param, QString::number( vActor->GetQuadratic2DRepresentation() ).toLatin1().data() );
- param = vtkParam + "Opacity";
- ip->setParameter( entry, param, QString::number( vActor->GetOpacity() ).toLatin1().data() );
- vtkFloatingPointType r, g, b;
- vActor->GetColor(r, g, b);
- QString colorStr = QString::number( r ); colorStr += gDigitsSep;
- colorStr += QString::number( g ); colorStr += gDigitsSep;
+ param = vtkParam + "Opacity";
+ ip->setParameter( entry, param, QString::number( vActor->GetOpacity() ).toLatin1().data() );
+ vtkFloatingPointType r, g, b;
+ vActor->GetColor(r, g, b);
+ QString colorStr = QString::number( r ); colorStr += gDigitsSep;
+ colorStr += QString::number( g ); colorStr += gDigitsSep;
colorStr += QString::number( b );
- param = vtkParam + "Color";
- ip->setParameter( entry, param, colorStr.toLatin1().data() );
- param = vtkParam + "LineWidth";
- ip->setParameter( entry, param, QString::number( vActor->GetLineWidth() ).toLatin1().data() );
- if ( vActor->IsShrunkable() && vActor->IsShrunk() ) {
- param = vtkParam + "ShrinkMode";
- ip->setParameter( entry, param, "On" );
- param = vtkParam + "ShrinkFactor";
- ip->setParameter( entry, param, QString::number( vActor->GetShrinkFactor() ).toLatin1().data() );
- }
- VISU_ScalarMapAct* scalarMapActor = dynamic_cast<VISU_ScalarMapAct*>( vActor );
- if ( scalarMapActor && scalarMapActor->IsShading() ) {
- param = vtkParam + "Shading";
- ip->setParameter( entry, param, "On" );
- }
- if ( const VISU::Prs3d_i* vPrs = vActor->GetPrs3d() ) {
- param = vtkParam + "ClippingPlane";
- int nPlanes = vPrs->GetNumberOfClippingPlanes();
- if ( !nPlanes )
- ip->setParameter( entry, param, "Off" );
- for ( int p = 0; p < nPlanes; p++ ) {
- vtkPlane* plane = vPrs->GetClippingPlane( p );
- vtkFloatingPointType normal[3], origin[3];
- plane->GetNormal( normal );
- plane->GetOrigin( origin );
- std::string planeValue = QString::number( normal[0] ).toLatin1().data(); planeValue += gDigitsSep;
- planeValue += QString::number( normal[1] ).toLatin1().data(); planeValue += gDigitsSep;
- planeValue += QString::number( normal[2] ).toLatin1().data(); planeValue += gDigitsSep;
- planeValue += QString::number( origin[0] ).toLatin1().data(); planeValue += gDigitsSep;
- planeValue += QString::number( origin[1] ).toLatin1().data(); planeValue += gDigitsSep;
- planeValue += QString::number( origin[2] ).toLatin1().data();
- param = QString( "%1ClippingPlane_%2" ).arg( vtkParam.c_str() ).arg( p+1 ).toLatin1().data();
- ip->setParameter( entry, param, planeValue );
- }
- }
-
- } // hasIO
- } // salome_actor successfull downcast to the VISU_Actor
- else if ( VISU_PointMap3dActor* vActor = VISU_PointMap3dActor::SafeDownCast( actor ) ) { // PointMap3D
- if ( vActor->hasIO() ) { // actor corresponds to existing obj
- Handle(SALOME_InteractiveObject) io = vActor->getIO();
- // entry is "ecoded" = it does NOT contain component adress, since it is a
- // subject to change on next component loading
- std::string entry = ip->encodeEntry( io->getEntry(), componentName );
- std::string param, vtkParam = vType.toLatin1().data();
+ param = vtkParam + "Color";
+ ip->setParameter( entry, param, colorStr.toLatin1().data() );
+ param = vtkParam + "LineWidth";
+ ip->setParameter( entry, param, QString::number( vActor->GetLineWidth() ).toLatin1().data() );
+ if ( vActor->IsShrunkable() && vActor->IsShrunk() ) {
+ param = vtkParam + "ShrinkMode";
+ ip->setParameter( entry, param, "On" );
+ param = vtkParam + "ShrinkFactor";
+ ip->setParameter( entry, param, QString::number( vActor->GetShrinkFactor() ).toLatin1().data() );
+ }
+ VISU_ScalarMapAct* scalarMapActor = dynamic_cast<VISU_ScalarMapAct*>( vActor );
+ if ( scalarMapActor && scalarMapActor->IsShading() ) {
+ param = vtkParam + "Shading";
+ ip->setParameter( entry, param, "On" );
+ }
+ if ( const VISU::Prs3d_i* vPrs = vActor->GetPrs3d() ) {
+ param = vtkParam + "ClippingPlane";
+ int nPlanes = vPrs->GetNumberOfClippingPlanes();
+ if ( !nPlanes )
+ ip->setParameter( entry, param, "Off" );
+ for ( int p = 0; p < nPlanes; p++ ) {
+ vtkPlane* plane = vPrs->GetClippingPlane( p );
+ vtkFloatingPointType normal[3], origin[3];
+ plane->GetNormal( normal );
+ plane->GetOrigin( origin );
+ std::string planeValue = QString::number( normal[0] ).toLatin1().data(); planeValue += gDigitsSep;
+ planeValue += QString::number( normal[1] ).toLatin1().data(); planeValue += gDigitsSep;
+ planeValue += QString::number( normal[2] ).toLatin1().data(); planeValue += gDigitsSep;
+ planeValue += QString::number( origin[0] ).toLatin1().data(); planeValue += gDigitsSep;
+ planeValue += QString::number( origin[1] ).toLatin1().data(); planeValue += gDigitsSep;
+ planeValue += QString::number( origin[2] ).toLatin1().data();
+ param = QString( "%1ClippingPlane_%2" ).arg( vtkParam.c_str() ).arg( p+1 ).toLatin1().data();
+ ip->setParameter( entry, param, planeValue );
+ }
+ }
+
+ } // hasIO
+ } // salome_actor successfull downcast to the VISU_Actor
+ else if ( VISU_PointMap3dActor* vActor = VISU_PointMap3dActor::SafeDownCast( actor ) ) { // PointMap3D
+ if ( vActor->hasIO() ) { // actor corresponds to existing obj
+ Handle(SALOME_InteractiveObject) io = vActor->getIO();
+ // entry is "ecoded" = it does NOT contain component adress, since it is a
+ // subject to change on next component loading
+ std::string entry = ip->encodeEntry( io->getEntry(), componentName );
+ std::string param, vtkParam = vType.toLatin1().data();
vtkParam += gSeparator;
- vtkParam += QString::number( *viewsCounter ).toLatin1().data();
+ vtkParam += QString::number( *viewsCounter ).toLatin1().data();
vtkParam += gSeparator;
- param = vtkParam + "Visibility";
- ip->setParameter( entry, param, "On" );
- param = vtkParam + "Name";
- ip->setParameter( entry, param, vActor->getName() );
- param = vtkParam + "RepresentationMode";
- ip->setParameter( entry, param, QString::number( vActor->GetRepresentation() ).toLatin1().data() );
- param = vtkParam + "Opacity";
- ip->setParameter( entry, param, QString::number( vActor->GetOpacity() ).toLatin1().data() );
- vtkFloatingPointType r, g, b;
- vActor->GetColor(r, g, b);
- QString colorStr = QString::number( r ); colorStr += gDigitsSep;
- colorStr += QString::number( g ); colorStr += gDigitsSep;
- colorStr += QString::number( b );
- param = vtkParam + "Color";
- ip->setParameter( entry, param, colorStr.toLatin1().data() );
- param = vtkParam + "LineWidth";
- ip->setParameter( entry, param, QString::number( vActor->GetLineWidth() ).toLatin1().data() );
- if ( vActor->IsShrunkable() && vActor->IsShrunk() ) {
- param = vtkParam + "ShrinkMode";
- ip->setParameter( entry, param, "On" );
- param = vtkParam + "ShrinkFactor";
- ip->setParameter( entry, param, QString::number( vActor->GetShrinkFactor() ).toLatin1().data() );
- }
- }
- } // salome actor is downcasted to the VISU_PointMap3dActor
- } // isVisible
- } // end of ..while.. actors traversal
- } // if ( vtkView )
+ param = vtkParam + "Visibility";
+ ip->setParameter( entry, param, "On" );
+ param = vtkParam + "Name";
+ ip->setParameter( entry, param, vActor->getName() );
+ param = vtkParam + "RepresentationMode";
+ ip->setParameter( entry, param, QString::number( vActor->GetRepresentation() ).toLatin1().data() );
+ param = vtkParam + "Opacity";
+ ip->setParameter( entry, param, QString::number( vActor->GetOpacity() ).toLatin1().data() );
+ vtkFloatingPointType r, g, b;
+ vActor->GetColor(r, g, b);
+ QString colorStr = QString::number( r ); colorStr += gDigitsSep;
+ colorStr += QString::number( g ); colorStr += gDigitsSep;
+ colorStr += QString::number( b );
+ param = vtkParam + "Color";
+ ip->setParameter( entry, param, colorStr.toLatin1().data() );
+ param = vtkParam + "LineWidth";
+ ip->setParameter( entry, param, QString::number( vActor->GetLineWidth() ).toLatin1().data() );
+ if ( vActor->IsShrunkable() && vActor->IsShrunk() ) {
+ param = vtkParam + "ShrinkMode";
+ ip->setParameter( entry, param, "On" );
+ param = vtkParam + "ShrinkFactor";
+ ip->setParameter( entry, param, QString::number( vActor->GetShrinkFactor() ).toLatin1().data() );
+ }
+ }
+ } // salome actor is downcasted to the VISU_PointMap3dActor
+ } // isVisible
+ } // end of ..while.. actors traversal
+ } // if ( vtkView )
} // for ( views )
(*viewsCounter)++;
} // if ( SVTK view model )
else if ( vType == SPlot2d_Viewer::Type() ) { // processing Plot2d viewers
QVector<SUIT_ViewWindow*> views = vman->getViews();
for ( int i = 0, iEnd = vman->getViewsCount(); i < iEnd; i++ ) {
- if ( Plot2d_ViewWindow* plotView = dynamic_cast<Plot2d_ViewWindow*>( views[i] ) ) {
- Plot2d_ViewFrame* plotVF = plotView->getViewFrame();
- QList<Plot2d_Curve*> curves;
+ if ( Plot2d_ViewWindow* plotView = dynamic_cast<Plot2d_ViewWindow*>( views[i] ) ) {
+ Plot2d_ViewFrame* plotVF = plotView->getViewFrame();
+ QList<Plot2d_Curve*> curves;
QList<Plot2d_Curve*>::Iterator itCurve;
- plotVF->getCurves( curves );
-
- //Plot2d_Curve* curve;
- for ( itCurve = curves.begin(); itCurve != curves.end(); itCurve++ ) {
- if ( SPlot2d_Curve* sCurve = dynamic_cast<SPlot2d_Curve*>( *itCurve ) ) {
- if ( sCurve->hasIO() ) {
-
- Handle(SALOME_InteractiveObject) io = sCurve->getIO();
- // entry is "ecoded" = it does NOT contain component adress, since it is a
- // subject to change on next component loading
- std::string entry = ip->encodeEntry( io->getEntry(), componentName );
-
- std::string param, plotParam = vType.toLatin1().data(); plotParam += gSeparator;
- plotParam += QString::number( *viewsCounter ).toLatin1().data(); plotParam += gSeparator;
-
- param = plotParam + "Visibility";
- ip->setParameter( entry, param, "On" );
- }
- }
- } // for curves
- } // if ( plotView )
+ plotVF->getCurves( curves );
+
+ //Plot2d_Curve* curve;
+ for ( itCurve = curves.begin(); itCurve != curves.end(); itCurve++ ) {
+ if ( SPlot2d_Curve* sCurve = dynamic_cast<SPlot2d_Curve*>( *itCurve ) ) {
+ if ( sCurve->hasIO() ) {
+
+ Handle(SALOME_InteractiveObject) io = sCurve->getIO();
+ // entry is "ecoded" = it does NOT contain component adress, since it is a
+ // subject to change on next component loading
+ std::string entry = ip->encodeEntry( io->getEntry(), componentName );
+
+ std::string param, plotParam = vType.toLatin1().data(); plotParam += gSeparator;
+ plotParam += QString::number( *viewsCounter ).toLatin1().data(); plotParam += gSeparator;
+
+ param = plotParam + "Visibility";
+ ip->setParameter( entry, param, "On" );
+ }
+ }
+ } // for curves
+ } // if ( plotView )
} // for ( views )
(*viewsCounter)++;
} // if ( SPlot2d view model )
// if ( *entIt == "GaussViewer" ) {
// // parameter names are view window's captions, values - visual parameters.
// for ( ; namesIt != paramNames.end(); ++namesIt, ++valuesIt ) {
-// SUIT_ViewManager* vman = onCreateViewManager();
-// SUIT_ViewWindow* vwin = vman->getActiveView();
-// vwin->setWindowTitle( (*namesIt).c_str() );
+// SUIT_ViewManager* vman = onCreateViewManager();
+// SUIT_ViewWindow* vwin = vman->getActiveView();
+// vwin->setWindowTitle( (*namesIt).c_str() );
-// // wait untill the window is really shown. This step fixes MANY bugs..
-// while ( !vwin->isVisible() )
-// qApp->processEvents();
+// // wait untill the window is really shown. This step fixes MANY bugs..
+// while ( !vwin->isVisible() )
+// qApp->processEvents();
-// vwin->setVisualParameters( (*valuesIt).c_str() );
+// vwin->setVisualParameters( (*valuesIt).c_str() );
// }
// continue; // skip to next entry
// }
std::string viewIndexStr = ::getParam( *namesIt, ViewIndex );
int viewIndex = QString( viewIndexStr.c_str() ).toUInt( &ok );
if ( !ok ) // bad conversion of view index to integer
- continue;
+ continue;
// cout << " -- " << viewerType << ": entry = " << entry.latin1() << ", paramName = " << paramName << endl;
if ( viewerType == SVTK_Viewer::Type().toLatin1().data() /*||
- viewerType == VVTK_Viewer::Type().toLatin1().data()*/ ) {
-
- // used as inner map key for locating the actor.
- QString viewerTypeIndex = QString( viewerType.c_str() ) + QString::number( viewIndex );
-
- if ( paramName == "Visibility" && displayer() ) {
- // if VVTK, then we must create viewer first, because
-
- QList<SUIT_ViewManager*> lst;
- getApp()->viewManagers( viewerType.c_str(), lst );
-
- // SVTK/VVTK ViewManager always has 1 ViewWindow, so view index is index of view manager
- if ( viewIndex >= 0 && viewIndex < lst.count() ) {
- SUIT_ViewManager* vman = lst.at( viewIndex );
- SUIT_ViewModel* vmodel = vman->getViewModel();
- // both SVTK and VVTK view models can be casted to SALOME_View
- displayer()->Display( entry, true, dynamic_cast<SALOME_View*>( vmodel ) );
-
- // store displayed actor in a temporary map for quicker access later when restoring other parameters
- SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) vman->getActiveView();
- QMap<QString, VISU_Actor*> viewActorMap;
- if ( vtkActors.contains( entry ) )
- viewActorMap = vtkActors[ entry ];
- viewActorMap[ viewerTypeIndex ] = FindActor( GetAppStudy(this), vtkView, entry );
- vtkActors[ entry ] = viewActorMap;
- }
- }
- else { // the rest properties "work" with VISU_Actor, so we initialize it at first
- VISU_Actor* vActor = 0;
- if ( vtkActors.contains( entry ) ) {
- QMap<QString, VISU_Actor*> viewActorMap = vtkActors[ entry ];
- if ( viewActorMap.contains( viewerTypeIndex ) )
- vActor = viewActorMap[ viewerTypeIndex ];
- }
- if ( !vActor )
- continue;
-
- QString val( (*valuesIt).c_str() );
-
- if ( paramName == "Name" )
- vActor->setName( val.toLatin1().data() );
-
- else if ( paramName == "RepresentationMode" )
- vActor->SetRepresentation( val.toInt() );
+ viewerType == VVTK_Viewer::Type().toLatin1().data()*/ ) {
+
+ // used as inner map key for locating the actor.
+ QString viewerTypeIndex = QString( viewerType.c_str() ) + QString::number( viewIndex );
+
+ if ( paramName == "Visibility" && displayer() ) {
+ // if VVTK, then we must create viewer first, because
+
+ QList<SUIT_ViewManager*> lst;
+ getApp()->viewManagers( viewerType.c_str(), lst );
+
+ // SVTK/VVTK ViewManager always has 1 ViewWindow, so view index is index of view manager
+ if ( viewIndex >= 0 && viewIndex < lst.count() ) {
+ SUIT_ViewManager* vman = lst.at( viewIndex );
+ SUIT_ViewModel* vmodel = vman->getViewModel();
+ // both SVTK and VVTK view models can be casted to SALOME_View
+ displayer()->Display( entry, true, dynamic_cast<SALOME_View*>( vmodel ) );
+
+ // store displayed actor in a temporary map for quicker access later when restoring other parameters
+ SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) vman->getActiveView();
+ QMap<QString, VISU_Actor*> viewActorMap;
+ if ( vtkActors.contains( entry ) )
+ viewActorMap = vtkActors[ entry ];
+ viewActorMap[ viewerTypeIndex ] = FindActor( GetAppStudy(this), vtkView, entry );
+ vtkActors[ entry ] = viewActorMap;
+ }
+ }
+ else { // the rest properties "work" with VISU_Actor, so we initialize it at first
+ VISU_Actor* vActor = 0;
+ if ( vtkActors.contains( entry ) ) {
+ QMap<QString, VISU_Actor*> viewActorMap = vtkActors[ entry ];
+ if ( viewActorMap.contains( viewerTypeIndex ) )
+ vActor = viewActorMap[ viewerTypeIndex ];
+ }
+ if ( !vActor )
+ continue;
+
+ QString val( (*valuesIt).c_str() );
+
+ if ( paramName == "Name" )
+ vActor->setName( val.toLatin1().data() );
+
+ else if ( paramName == "RepresentationMode" )
+ vActor->SetRepresentation( val.toInt() );
else if (paramName == "Quadratic2DRepresentation")
vActor->SetQuadratic2DRepresentation(VISU_Actor::EQuadratic2DRepresentation(val.toInt()));
- else if ( paramName == "Opacity" )
- vActor->SetOpacity( val.toFloat() );
-
- else if ( paramName == "Color" ) {
- QStringList colors = val.split( gDigitsSep, QString::SkipEmptyParts );
- if ( colors.count() == 3 )
- vActor->SetColor( colors[0].toFloat(), colors[1].toFloat(), colors[2].toFloat() );
- }
-
- else if ( paramName == "LineWidth" )
- vActor->SetLineWidth( val.toFloat() );
-
- else if ( paramName == "ShrinkMode" ) {
- vActor->SetShrinkable( true );
- vActor->SetShrink();
- }
-
- else if ( paramName == "ShrunkFactor" )
- vActor->SetShrinkFactor( val.toFloat() );
-
- else if ( paramName == "Shading" ) {
- if ( VISU_ScalarMapAct* scalarMapActor = dynamic_cast<VISU_ScalarMapAct*>( vActor ) )
- scalarMapActor->SetShading();
- }
-
- else if ( paramName.find( "ClippingPlane" ) != std::string::npos ) {
- VISU::Prs3d_i* prs = vActor->GetPrs3d();
- if ( !prs )
- continue;
-
- //prs->RemoveAllClippingPlanes();
- for (int i = prs->GetNumberOfClippingPlanes() - 1; i >= 0 ; i--) {
- OrientedPlane* aPlane = dynamic_cast<OrientedPlane*>(prs->GetClippingPlane(i));
- if (aPlane)
- prs->RemoveClippingPlane(i);
- }
- if ( val != "Off" ) {
- QStringList vals = val.split( gDigitsSep, QString::SkipEmptyParts );
- if ( vals.count() == 6 ) { // format check: 6 float values
- vtkFloatingPointType normal[3], origin[3];
- for (int x = 0; x < 3; x++ ) {
- normal[x] = vals[x].toFloat();
- origin[x] = vals[x+3].toFloat();
- }
- OrientedPlane* plane = OrientedPlane::New();
- plane->SetNormal( normal );
- plane->SetOrigin( origin );
- prs->AddClippingPlane( plane );
- plane->Delete();
- }
- }
- }
- } // else ..
+ else if ( paramName == "Opacity" )
+ vActor->SetOpacity( val.toFloat() );
+
+ else if ( paramName == "Color" ) {
+ QStringList colors = val.split( gDigitsSep, QString::SkipEmptyParts );
+ if ( colors.count() == 3 )
+ vActor->SetColor( colors[0].toFloat(), colors[1].toFloat(), colors[2].toFloat() );
+ }
+
+ else if ( paramName == "LineWidth" )
+ vActor->SetLineWidth( val.toFloat() );
+
+ else if ( paramName == "ShrinkMode" ) {
+ vActor->SetShrinkable( true );
+ vActor->SetShrink();
+ }
+
+ else if ( paramName == "ShrunkFactor" )
+ vActor->SetShrinkFactor( val.toFloat() );
+
+ else if ( paramName == "Shading" ) {
+ if ( VISU_ScalarMapAct* scalarMapActor = dynamic_cast<VISU_ScalarMapAct*>( vActor ) )
+ scalarMapActor->SetShading();
+ }
+
+ else if ( paramName.find( "ClippingPlane" ) != std::string::npos ) {
+ VISU::Prs3d_i* prs = vActor->GetPrs3d();
+ if ( !prs )
+ continue;
+
+ //prs->RemoveAllClippingPlanes();
+ for (int i = prs->GetNumberOfClippingPlanes() - 1; i >= 0 ; i--) {
+ OrientedPlane* aPlane = dynamic_cast<OrientedPlane*>(prs->GetClippingPlane(i));
+ if (aPlane)
+ prs->RemoveClippingPlane(i);
+ }
+ if ( val != "Off" ) {
+ QStringList vals = val.split( gDigitsSep, QString::SkipEmptyParts );
+ if ( vals.count() == 6 ) { // format check: 6 float values
+ vtkFloatingPointType normal[3], origin[3];
+ for (int x = 0; x < 3; x++ ) {
+ normal[x] = vals[x].toFloat();
+ origin[x] = vals[x+3].toFloat();
+ }
+ OrientedPlane* plane = OrientedPlane::New();
+ plane->SetNormal( normal );
+ plane->SetOrigin( origin );
+ prs->AddClippingPlane( plane );
+ plane->Delete();
+ }
+ }
+ }
+ } // else ..
} // if SVTK
else if ( viewerType == SPlot2d_Viewer::Type().toLatin1().data() ) {
- if ( paramName == "Visibility" && displayer() ) {
- QList<SUIT_ViewManager*> lst;
- getApp()->viewManagers( viewerType.c_str(), lst );
+ if ( paramName == "Visibility" && displayer() ) {
+ QList<SUIT_ViewManager*> lst;
+ getApp()->viewManagers( viewerType.c_str(), lst );
- if ( viewIndex >= 0 && viewIndex < lst.count() ) {
- SUIT_ViewManager* vman = lst.at( viewIndex );
- SUIT_ViewModel* vmodel = vman->getViewModel();
- // SVTK and VVTK view models can be casted to SALOME_View
- displayer()->Display( entry, true, dynamic_cast<SALOME_View*>( vmodel ) );
- }
- }
+ if ( viewIndex >= 0 && viewIndex < lst.count() ) {
+ SUIT_ViewManager* vman = lst.at( viewIndex );
+ SUIT_ViewModel* vmodel = vman->getViewModel();
+ // SVTK and VVTK view models can be casted to SALOME_View
+ displayer()->Display( entry, true, dynamic_cast<SALOME_View*>( vmodel ) );
+ }
+ }
} // if SPlot2d
if ( !vmodel )
continue;
if ( vmodel->getType() == SVTK_Viewer::Type() /*|| // processing SVTK and VVTK viewers
- vmodel->getType() == VVTK_Viewer::Type()*/ ) { // in the same way
+ vmodel->getType() == VVTK_Viewer::Type()*/ ) { // in the same way
SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) (*it)->getActiveView();
vtkView->getRenderer()->ResetCameraClippingRange();
vtkView->Repaint();
// if ( activeGaussViewer >= 0 && activeGaussViewer < lst.count() ) {
// SUIT_ViewWindow* activeView = lst.at( activeGaussViewer )->getActiveView();
// if ( activeView ) {
-// activeView->activateWindow();
-// //activeView->setFocus();
+// activeView->activateWindow();
+// //activeView->setFocus();
// }
// }
// }
virtual
SUIT_ViewManager*
getViewManager(const QString& theType,
- const bool theIsCreate);
+ const bool theIsCreate);
virtual
void
*/
VisuGUI_NameDlg::VisuGUI_NameDlg( QWidget* parent )
: QDialog( parent ? parent : SUIT_Session::session()->activeApplication()->desktop(),
- Qt::WindowTitleHint | Qt::WindowSystemMenuHint )//,WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
+ Qt::WindowTitleHint | Qt::WindowSystemMenuHint )//,WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
{
setWindowTitle( tr("TLT_RENAME") );
setSizeGripEnabled( TRUE );
QString anEntry(anIO->getEntry());
VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, anEntry.toLatin1().constData());
if(VISU::Prs3d_i* aPrsObject = VISU::GetPrs3dFromBase(anObjectInfo.myBase))
- addPresentation(aPrsObject);
+ addPresentation(aPrsObject);
else if (VISU::PointMap3d_i* aPrs = dynamic_cast<VISU::PointMap3d_i*>(anObjectInfo.myBase)) {
- addPointMapPresentation(aPrs);
+ addPointMapPresentation(aPrs);
}
}
}
if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
if (SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(aViewWindow)) {
if (VISU_Actor* anActor = VISU::FindActor(vw, thePrs)) {
- anActor->SetPosition(theOffset);
+ anActor->SetPosition(theOffset);
vw->onAdjustTrihedron();
vw->getRenderer()->ResetCameraClippingRange();
vw->Repaint();
for (int i = 0, iEnd = aViews.size(); i < iEnd; i++) {
if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
if (SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(aViewWindow)) {
- vw->onAdjustTrihedron();
+ vw->onAdjustTrihedron();
if (VISU_ActorBase* anActor = VISU::FindActorBase(vw, thePrs)) {
anActor->SetPosition(theOffset);
- vw->highlight(thePrs->GetIO(), 1);
+ vw->highlight(thePrs->GetIO(), 1);
vw->getRenderer()->ResetCameraClippingRange();
vw->Repaint();
}
}
OffsetStruct(vtkFloatingPointType theX,
- vtkFloatingPointType theY,
- vtkFloatingPointType theZ)
+ vtkFloatingPointType theY,
+ vtkFloatingPointType theZ)
{
myOffset[0] = theX;
myOffset[1] = theY;
\param theBtns panel buttons
*/
VisuGUI_Panel::VisuGUI_Panel( const QString& theName,
- VisuGUI* theModule,
- QWidget* theParent,
- const int theBtns )
+ VisuGUI* theModule,
+ QWidget* theParent,
+ const int theBtns )
: QtxDockWidget( true, theParent ),
myModule( theModule ),
myOK( 0 ),
public:
VisuGUI_Panel( const QString& theName,
- VisuGUI* theModule,
- QWidget* theParent = 0,
- const int theBtns = AllBtn );
+ VisuGUI* theModule,
+ QWidget* theParent = 0,
+ const int theBtns = AllBtn );
virtual ~VisuGUI_Panel();
virtual bool isValid( QString& theMessage );
//purpose :
//=======================================================================
void VisuGUI_Plot3DDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit )
+ bool theInit )
{
if( theInit )
myPrsCopy = VISU::TSameAsFactory<VISU::TPLOT3D>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
~VisuGUI_Plot3DDlg();
virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit );
+ bool theInit );
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
~VisuGUI_BarPrefDlg() {};
void setRatios(int titleRatioSize, int labelRatioWidth,
- int barRatioWidth, int barRatioHeight);
+ int barRatioWidth, int barRatioHeight);
void getRatios(int& titleRatioSize, int& labelRatioWidth,
- int& barRatioWidth, int& barRatioHeight);
+ int& barRatioWidth, int& barRatioHeight);
void setUnitsVisible(bool isVisible);
bool isUnitsVisible();
~VisuGUI_Prs3dDlg() {}
virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit ) = 0;
+ bool theInit ) = 0;
virtual int storeToPrsObject( VISU::ColoredPrs3d_i* thePrs ) = 0;
~VisuGUI_ScalarBarBaseDlg();
virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit );
+ bool theInit );
protected slots:
void accept();
void reject();
template<class TPrs3d_i, class TViewer, class TDlg, int TIsDlgModal>
void
EditPrs3d(VisuGUI* theModule,
- Handle(SALOME_InteractiveObject)& theIO,
- VISU::Prs3d_i* thePrs3d,
- SVTK_ViewWindow* theViewWindow)
+ Handle(SALOME_InteractiveObject)& theIO,
+ VISU::Prs3d_i* thePrs3d,
+ SVTK_ViewWindow* theViewWindow)
{
if (TPrs3d_i* aPrs3d = dynamic_cast<TPrs3d_i*>(thePrs3d)) {
bool isModal = TIsDlgModal;
if( ColoredPrs3d_i* aColoredPrs3d = dynamic_cast<ColoredPrs3d_i*>(aPrs3d) )
- if( !aColoredPrs3d->IsTimeStampFixed() )
- isModal = 0;
+ if( !aColoredPrs3d->IsTimeStampFixed() )
+ isModal = 0;
TDlg* aDlg = new TDlg (theModule);
aDlg->initFromPrsObject(aPrs3d, true);
if (runAndWait(aDlg,isModal)) {
- if (!(aDlg->storeToPrsObject(aPrs3d))) {
- delete aDlg;
- return;
- }
- try {
- aPrs3d->UpdateActors();
- } catch (std::runtime_error& exc) {
- aPrs3d->RemoveActors();
-
- INFOS(exc.what());
- SUIT_MessageBox::warning
- (GetDesktop(theModule), QObject::tr("WRN_VISU"),
- QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()) );
- }
- if (theViewWindow) {
- theViewWindow->getRenderer()->ResetCameraClippingRange();
- theViewWindow->Repaint();
- }
- // Optionally, create table and curves for cut lines
- QApplication::setOverrideCursor(Qt::WaitCursor);
- CreateCurves( theModule,
- dynamic_cast<VISU::CutLinesBase_i*>( aPrs3d ),
- aDlg,
- false ); // in edition mode
- QApplication::restoreOverrideCursor();
+ if (!(aDlg->storeToPrsObject(aPrs3d))) {
+ delete aDlg;
+ return;
+ }
+ try {
+ aPrs3d->UpdateActors();
+ } catch (std::runtime_error& exc) {
+ aPrs3d->RemoveActors();
+
+ INFOS(exc.what());
+ SUIT_MessageBox::warning
+ (GetDesktop(theModule), QObject::tr("WRN_VISU"),
+ QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()) );
+ }
+ if (theViewWindow) {
+ theViewWindow->getRenderer()->ResetCameraClippingRange();
+ theViewWindow->Repaint();
+ }
+ // Optionally, create table and curves for cut lines
+ QApplication::setOverrideCursor(Qt::WaitCursor);
+ CreateCurves( theModule,
+ dynamic_cast<VISU::CutLinesBase_i*>( aPrs3d ),
+ aDlg,
+ false ); // in edition mode
+ QApplication::restoreOverrideCursor();
}
delete aDlg;
}
template<class TPrs3d_i, class TDlg, int TIsDlgModal>
void
EditPrs3d(VisuGUI* theModule,
- Handle(SALOME_InteractiveObject)& theIO,
- VISU::Prs3d_i* thePrs3d,
- SVTK_ViewWindow* theViewWindow = NULL)
+ Handle(SALOME_InteractiveObject)& theIO,
+ VISU::Prs3d_i* thePrs3d,
+ SVTK_ViewWindow* theViewWindow = NULL)
{
SVTK_ViewWindow* aViewWindow = theViewWindow;
if (!aViewWindow)
template<class TPrs3d_i>
TPrs3d_i*
CreatePrs3dFromFactory(VisuGUI* theModule,
- _PTR(SObject) theTimeStamp,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- int theTimeId,
- ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode)
+ _PTR(SObject) theTimeStamp,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeId,
+ ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode)
{
VISU::Result_var aResult;
if (CheckResult(theModule, theTimeStamp, aResult)){
QApplication::setOverrideCursor(Qt::WaitCursor);
TPrs3d_i* aPrs3d = NULL;
if(thePublishInStudyMode == VISU::ColoredPrs3d_i::EPublishUnderTimeStamp)
- aPrs3d = VISU::CreatePrs3d<TPrs3d_i>(aResult,
- theMeshName,
- theEntity,
- theFieldName,
- theTimeId);
+ aPrs3d = VISU::CreatePrs3d<TPrs3d_i>(aResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theTimeId);
else
{
- CORBA::Float anUsedMemory = 0.0;
- CORBA::Float aRequiredMemory = 0.0;
- VISU::ColoredPrs3dCache::EnlargeType anEnlargeType =
- VISU::GetRequiredCacheMemory<TPrs3d_i>(aResult,
- theMeshName,
- theEntity,
- theFieldName,
- theTimeId,
- anUsedMemory,
- aRequiredMemory);
-
- if( anEnlargeType == VISU::ColoredPrs3dCache::IMPOSSIBLE )
- {
- size_t aMb = 1024 * 1024;
- double aFreeMemory = double(VISU_PipeLine::GetAvailableMemory(8192*aMb)) / double(aMb);
-
- CORBA::Float aNecessaryMemory = aRequiredMemory - aFreeMemory - anUsedMemory;
- SUIT_MessageBox::warning(GetDesktop(theModule),
- QObject::tr("WRN_VISU"),
- QObject::tr("ERR_NO_MEMORY_TO_BUILD").arg(aNecessaryMemory) );
- QApplication::restoreOverrideCursor();
- return NULL;
- }
- else
- {
- if( anEnlargeType == VISU::ColoredPrs3dCache::ENLARGE )
- {
- if(SUIT_MessageBox::information(GetDesktop(theModule),
- QObject::tr("WRN_VISU"),
- QObject::tr("WRN_EXTRA_MEMORY_REQUIRED").arg(aRequiredMemory),
- QObject::tr("&OK"), QObject::tr("&Cancel"),
- 0, 1) == 1)
- {
- QApplication::restoreOverrideCursor();
- return NULL;
- }
- }
- aPrs3d = VISU::CreateHolder2GetDeviceByType<TPrs3d_i>(aResult,
- theMeshName,
- theEntity,
- theFieldName,
- theTimeId,
- anEnlargeType,
- aRequiredMemory);
- }
+ CORBA::Float anUsedMemory = 0.0;
+ CORBA::Float aRequiredMemory = 0.0;
+ VISU::ColoredPrs3dCache::EnlargeType anEnlargeType =
+ VISU::GetRequiredCacheMemory<TPrs3d_i>(aResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theTimeId,
+ anUsedMemory,
+ aRequiredMemory);
+
+ if( anEnlargeType == VISU::ColoredPrs3dCache::IMPOSSIBLE )
+ {
+ size_t aMb = 1024 * 1024;
+ double aFreeMemory = double(VISU_PipeLine::GetAvailableMemory(8192*aMb)) / double(aMb);
+
+ CORBA::Float aNecessaryMemory = aRequiredMemory - aFreeMemory - anUsedMemory;
+ SUIT_MessageBox::warning(GetDesktop(theModule),
+ QObject::tr("WRN_VISU"),
+ QObject::tr("ERR_NO_MEMORY_TO_BUILD").arg(aNecessaryMemory) );
+ QApplication::restoreOverrideCursor();
+ return NULL;
+ }
+ else
+ {
+ if( anEnlargeType == VISU::ColoredPrs3dCache::ENLARGE )
+ {
+ if(SUIT_MessageBox::information(GetDesktop(theModule),
+ QObject::tr("WRN_VISU"),
+ QObject::tr("WRN_EXTRA_MEMORY_REQUIRED").arg(aRequiredMemory),
+ QObject::tr("&OK"), QObject::tr("&Cancel"),
+ 0, 1) == 1)
+ {
+ QApplication::restoreOverrideCursor();
+ return NULL;
+ }
+ }
+ aPrs3d = VISU::CreateHolder2GetDeviceByType<TPrs3d_i>(aResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theTimeId,
+ anEnlargeType,
+ aRequiredMemory);
+ }
}
QApplication::restoreOverrideCursor();
if(aPrs3d)
- return aPrs3d;
+ return aPrs3d;
}
SUIT_MessageBox::warning(GetDesktop(theModule),
- QObject::tr("WRN_VISU"),
- QObject::tr("ERR_CANT_BUILD_PRESENTATION") );
+ QObject::tr("WRN_VISU"),
+ QObject::tr("ERR_CANT_BUILD_PRESENTATION") );
return NULL;
}
template<class TPrs3d_i, class TViewer, class TDlg, int IsDlgModal>
TPrs3d_i*
CreateAndEditPrs3d(VisuGUI* theModule,
- _PTR(SObject) theTimeStamp,
- ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode)
+ _PTR(SObject) theTimeStamp,
+ ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode)
{
Storable::TRestoringMap aRestoringMap = Storable::GetStorableMap(theTimeStamp);
VISU::VISUType aType = VISU::Storable::RestoringMap2Type(aRestoringMap);
TPrs3d_i* aPrs3d =
CreatePrs3dFromFactory<TPrs3d_i>(theModule,
- theTimeStamp,
- (const char*)aMeshName.toLatin1(),
- (Entity)anEntity.toInt(),
- (const char*)aFieldName.toLatin1(),
- aTimeStampId.toInt(),
- thePublishInStudyMode);
+ theTimeStamp,
+ (const char*)aMeshName.toLatin1(),
+ (Entity)anEntity.toInt(),
+ (const char*)aFieldName.toLatin1(),
+ aTimeStampId.toInt(),
+ thePublishInStudyMode);
QApplication::restoreOverrideCursor();
if (aPrs3d) {
SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
int aValue = aResourceMgr->integerValue("VISU","BuildDefaultPrs3d",0);
if(aResourceMgr->booleanValue("VISU","display_only",false)){
- theModule->OnEraseAll();
- }
+ theModule->OnEraseAll();
+ }
if (!aValue) {
- if (TDlg* aDlg = new TDlg(theModule)) { // dialog box in creation mode
- aDlg->initFromPrsObject(aPrs3d, true);
- if (runAndWait(aDlg,IsDlgModal) && (aDlg->storeToPrsObject(aPrs3d))) {
- if(aResourceMgr->booleanValue("VISU","display_only",false)){
- if(SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(theModule, false)) aPlot2d->EraseAll();
- }
- // Optionally, create table and curves for cut lines
- QApplication::setOverrideCursor(Qt::WaitCursor);
- CreateCurves( theModule,
- dynamic_cast<VISU::CutLinesBase_i*>( aPrs3d ),
- aDlg,
- true ); // in creation mode
- UpdateObjBrowser(theModule,true,theTimeStamp);
- QApplication::restoreOverrideCursor();
- delete aDlg;
- } else {
- if ( theModule->application() )
- DeletePrs3d(theModule,aPrs3d);
- QApplication::restoreOverrideCursor();
- delete aDlg;
- return NULL;
- }
- }
+ if (TDlg* aDlg = new TDlg(theModule)) { // dialog box in creation mode
+ aDlg->initFromPrsObject(aPrs3d, true);
+ if (runAndWait(aDlg,IsDlgModal) && (aDlg->storeToPrsObject(aPrs3d))) {
+ if(aResourceMgr->booleanValue("VISU","display_only",false)){
+ if(SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(theModule, false)) aPlot2d->EraseAll();
+ }
+ // Optionally, create table and curves for cut lines
+ QApplication::setOverrideCursor(Qt::WaitCursor);
+ CreateCurves( theModule,
+ dynamic_cast<VISU::CutLinesBase_i*>( aPrs3d ),
+ aDlg,
+ true ); // in creation mode
+ UpdateObjBrowser(theModule,true,theTimeStamp);
+ QApplication::restoreOverrideCursor();
+ delete aDlg;
+ } else {
+ if ( theModule->application() )
+ DeletePrs3d(theModule,aPrs3d);
+ QApplication::restoreOverrideCursor();
+ delete aDlg;
+ return NULL;
+ }
+ }
}
// aViewWindow = GetViewWindow<TViewer>(theModule); IPAL 20125 dmv
// Display created presentation.
if (aViewWindow) {
- PublishInView(theModule, aPrs3d, aViewWindow);
+ PublishInView(theModule, aPrs3d, aViewWindow);
if(GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)){
- aViewWindow->onFitAll();
- }
+ aViewWindow->onFitAll();
+ }
- AddScalarBarPosition(theModule, aViewWindow, aPrs3d, aPos);
+ AddScalarBarPosition(theModule, aViewWindow, aPrs3d, aPos);
}
return aPrs3d;
template<class TPrs3d_i, class TViewer, class TDlg, int IsDlgModal>
TPrs3d_i*
CreatePrs3dInViewer(VisuGUI* theModule,
- _PTR(SObject) theTimeStampSObj,
- ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode)
+ _PTR(SObject) theTimeStampSObj,
+ ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode)
{
TPrs3d_i* aPrs = 0;
// Create new TViewWindow instance, if it does not exist.
template<class TPrs3d_i, class TDlg, int IsDlgModal>
TPrs3d_i*
CreatePrs3d(VisuGUI* theModule,
- const QString& theDesiredViewerType = QString())
+ const QString& theDesiredViewerType = QString())
{
TPrs3d_i* aPrs = 0;
if (CheckLock(GetCStudy(GetAppStudy(theModule)),GetDesktop(theModule)))
if(/*aPublishInStudyMode == */VISU::ColoredPrs3d_i::EPublishIndependently){
// CreatePrs3dInViewer<TPrs3d_i,VVTK_Viewer,TDlg,0>
- // (theModule,aTimeStampSObj,aPublishInStudyMode);
+ // (theModule,aTimeStampSObj,aPublishInStudyMode);
aPrs = CreatePrs3dInViewer<TPrs3d_i,SVTK_Viewer,TDlg,0>
- (theModule,aTimeStampSObj,aPublishInStudyMode);
+ (theModule,aTimeStampSObj,aPublishInStudyMode);
return aPrs;
}else{
if(theDesiredViewerType.isNull()){
- if (/*SUIT_ViewManager* aViewManager = */theModule->getApp()->activeViewManager())
- /*if (aViewManager->getType() == VVTK_Viewer::Type()){
- aPrs = CreatePrs3dInViewer<TPrs3d_i,VVTK_Viewer,TDlg,IsDlgModal>
- (theModule,aTimeStampSObj,aPublishInStudyMode);
- return aPrs;
- }*/
- aPrs = CreatePrs3dInViewer<TPrs3d_i,SVTK_Viewer,TDlg,IsDlgModal>
- (theModule,aTimeStampSObj,aPublishInStudyMode);
+ if (/*SUIT_ViewManager* aViewManager = */theModule->getApp()->activeViewManager())
+ /*if (aViewManager->getType() == VVTK_Viewer::Type()){
+ aPrs = CreatePrs3dInViewer<TPrs3d_i,VVTK_Viewer,TDlg,IsDlgModal>
+ (theModule,aTimeStampSObj,aPublishInStudyMode);
+ return aPrs;
+ }*/
+ aPrs = CreatePrs3dInViewer<TPrs3d_i,SVTK_Viewer,TDlg,IsDlgModal>
+ (theModule,aTimeStampSObj,aPublishInStudyMode);
}else{
- /*if(theDesiredViewerType == VVTK_Viewer::Type()) {
- aPrs = CreatePrs3dInViewer<TPrs3d_i,VVTK_Viewer,TDlg,IsDlgModal>
- (theModule,aTimeStampSObj,aPublishInStudyMode);
- } else {*/
- aPrs = CreatePrs3dInViewer<TPrs3d_i,SVTK_Viewer,TDlg,IsDlgModal>
- (theModule,aTimeStampSObj,aPublishInStudyMode);
- //}
+ /*if(theDesiredViewerType == VVTK_Viewer::Type()) {
+ aPrs = CreatePrs3dInViewer<TPrs3d_i,VVTK_Viewer,TDlg,IsDlgModal>
+ (theModule,aTimeStampSObj,aPublishInStudyMode);
+ } else {*/
+ aPrs = CreatePrs3dInViewer<TPrs3d_i,SVTK_Viewer,TDlg,IsDlgModal>
+ (theModule,aTimeStampSObj,aPublishInStudyMode);
+ //}
}
}
return aPrs;
Initialize dialog from the presentation
*/
void VisuGUI_ScalarBarDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit )
+ bool theInit )
{
if( theInit )
myPrsCopy = VISU::TSameAsFactory<VISU::TSCALARMAP>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
~VisuGUI_ScalarBarDlg();
virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit );
+ bool theInit );
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
Result_i::ECreationId aCreationId = aResult->GetCreationId();
switch(aCreationId){
case Result_i::eImportFile :
- return "eImportFile";
+ return "eImportFile";
case Result_i::eCopyAndImportFile :
- return "eCopyAndImportFile";
+ return "eCopyAndImportFile";
case Result_i::eImportMed :
- return "eImportMed";
+ return "eImportMed";
case Result_i::eImportMedField :
- return "eImportMedField";
+ return "eImportMedField";
default:
- return QString();
+ return QString();
}
}
}
{
QString
operator()(const SalomeApp_Module* theModule,
- const QString& theEntry)
+ const QString& theEntry)
{
if(SUIT_ViewManager* aViewManager = theModule->getApp()->activeViewManager()){
QString aType = aViewManager->getType();
TPopupFunctor aFunctor;
if(aType == SVTK_Viewer::Type())
- return aFunctor.template Get<SVTK_Viewer>(theModule, theEntry);
+ return aFunctor.template Get<SVTK_Viewer>(theModule, theEntry);
//else if(aType == VVTK_Viewer::Type())
//return aFunctor.template Get<VVTK_Viewer>(theModule, theEntry);
}
template<class TViewer>
bool
GetPrs3dSelectionInfo(const SalomeApp_Module* theModule,
- const QString& theEntry,
- VISU::Prs3d_i*& thePrs3d,
- SVTK_ViewWindow*& theViewWindow,
- VISU_Actor*& thenActor)
+ const QString& theEntry,
+ VISU::Prs3d_i*& thePrs3d,
+ SVTK_ViewWindow*& theViewWindow,
+ VISU_Actor*& thenActor)
{
VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(theModule), (const char*)theEntry.toLatin1());
thePrs3d = GetPrs3dFromBase(anObjectInfo.myBase);
aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(theModule);
if ( aSelectionInfo.empty() )
- return QString();
+ return QString();
VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
aPointMap3d = dynamic_cast<VISU::PointMap3d_i*>(aSelectionItem.myObjectInfo.myBase);
anActorBase = VISU::FindActorBase(aViewWindow, aPointMap3d);
QString
virtual
getPointMap(VISU::PointMap3d_i* thePrs3d,
- SVTK_ViewWindow* theViewWindow,
- VISU_ActorBase* theActor)
+ SVTK_ViewWindow* theViewWindow,
+ VISU_ActorBase* theActor)
{
return QString();
}
QString
virtual
getPointMap(VISU::PointMap3d_i* thePrs3d,
- SVTK_ViewWindow* theViewWindow,
- VISU_ActorBase* theActorBase)
+ SVTK_ViewWindow* theViewWindow,
+ VISU_ActorBase* theActorBase)
{
QString aResStr = "";
if (theActorBase) {
switch (theActorBase->GetRepresentation()) {
- ENUM2STRING( aResStr, VISU::WIREFRAME ); // = 1
- ENUM2STRING( aResStr, VISU::SHADED ); // = 2
+ ENUM2STRING( aResStr, VISU::WIREFRAME ); // = 1
+ ENUM2STRING( aResStr, VISU::SHADED ); // = 2
}
}
return aResStr;
_PTR(SObject) SO = aStudy->FindObjectID( (const char*)entry( ind ).toLatin1() );
if ( SO ){
for ( _PTR(ChildIterator) Iter = aStudy->NewChildIterator( SO ); Iter->More(); Iter->Next() ) {
- _PTR(SObject) refSO;
- if ( !Iter->Value()->ReferencedObject( refSO ) && ( !named || Iter->Value()->GetName().size() ) )
- cnt++;
+ _PTR(SObject) refSO;
+ if ( !Iter->Value()->ReferencedObject( refSO ) && ( !named || Iter->Value()->GetName().size() ) )
+ cnt++;
}
}
}
QString
virtual
getPointMap(VISU::PointMap3d_i* thePointMap,
- SVTK_ViewWindow* theViewWindow,
- VISU_ActorBase* theActorBase)
+ SVTK_ViewWindow* theViewWindow,
+ VISU_ActorBase* theActorBase)
{
if (theActorBase)
return theActorBase->IsShrunk() ? "1" : "0";
_PTR(SObject) SO = aStudy->FindObjectID( (const char*) entry( ind ).toLatin1() );
if ( SO ){
for ( _PTR(ChildIterator) Iter = aStudy->NewChildIterator( SO ); Iter->More(); Iter->Next() ) {
- _PTR(SObject) refSO;
- if ( Iter->Value()->ReferencedObject(refSO) )
- entryId = refSO->GetID().c_str();
- else
- entryId = Iter->Value()->GetID().c_str();
-
- LightApp_Displayer* displayer = LightApp_Displayer::FindDisplayer( myModule->moduleName(), false );
- if ( displayer->IsDisplayed( entryId ) && findHidden == false )
- return true;
- else if ( !displayer->IsDisplayed( entryId ) && findHidden == true )
- return true;
+ _PTR(SObject) refSO;
+ if ( Iter->Value()->ReferencedObject(refSO) )
+ entryId = refSO->GetID().c_str();
+ else
+ entryId = Iter->Value()->GetID().c_str();
+
+ LightApp_Displayer* displayer = LightApp_Displayer::FindDisplayer( myModule->moduleName(), false );
+ if ( displayer->IsDisplayed( entryId ) && findHidden == false )
+ return true;
+ else if ( !displayer->IsDisplayed( entryId ) && findHidden == true )
+ return true;
}
}
}
_PTR(SObject) SO = aStudy->FindObjectID( (const char*) entry( ind ).toLatin1() );
if ( SO ){
for ( _PTR(ChildIterator) Iter = aStudy->NewChildIterator( SO ); Iter->More(); Iter->Next() ) {
- _PTR(SObject) refSO;
- if ( Iter->Value()->ReferencedObject(refSO) ) {
- // reference on curve
- }
- else
- refSO = Iter->Value();
-
- CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(refSO);
- if(!CORBA::is_nil(aCORBAObject)){
- PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
- if(dynamic_cast<VISU::Curve_i*>(aServant.in()))
- return true;
- }
+ _PTR(SObject) refSO;
+ if ( Iter->Value()->ReferencedObject(refSO) ) {
+ // reference on curve
+ }
+ else
+ refSO = Iter->Value();
+
+ CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(refSO);
+ if(!CORBA::is_nil(aCORBAObject)){
+ PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
+ if(dynamic_cast<VISU::Curve_i*>(aServant.in()))
+ return true;
+ }
}
}
}
if( SUIT_ViewManager* vman = sApp->activeViewManager() )
if( SUIT_ViewModel* vmod = vman->getViewModel() ) {
viewerType = vmod->getType();
- if (viewerType ==SPlot2d_Viewer::Type())
- return true;
- }
+ if (viewerType ==SPlot2d_Viewer::Type())
+ return true;
+ }
return false;
}
{
int aColumnId = aColumnIter.next();
if( aColumnId >= 0 && aColumnId < aColumnHeaders.size() )
- aHorizontalHeaderLabels << aColumnHeaders[ aColumnId ];
+ aHorizontalHeaderLabels << aColumnHeaders[ aColumnId ];
}
aTable->setColumnCount( aHorizontalHeaderLabels.size() );
aTable->setHorizontalHeaderLabels( aHorizontalHeaderLabels );
aTable->resizeColumnsToContents();
connect( aTable, SIGNAL( doubleClicked( const QModelIndex& ) ),
- this, SLOT( onDoubleClicked( const QModelIndex& ) ) );
+ this, SLOT( onDoubleClicked( const QModelIndex& ) ) );
}
// Actor Pane
TopLayout->addWidget( aPrefBtn );
connect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( onSelectionEvent() ) );
+ this, SLOT( onSelectionEvent() ) );
connect( this, SIGNAL( selectionModeChanged( int ) ), myModule, SLOT( OnSwitchSelectionMode( int ) ) );
}
TPointData getPointData( TPointID thePointVTKID, VISU_Actor* theActor, const VISU::PIDMapper& theMapper,
- bool theIsValueData )
+ bool theIsValueData )
{
TPointData aPointData;
if (aSObject) {
VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(aSObject);
if (!aMap.empty()) {
- aMeshName = VISU::Storable::FindValue(aMap, "myMeshName");
- aFieldName = VISU::Storable::FindValue(aMap, "myFieldName");
+ aMeshName = VISU::Storable::FindValue(aMap, "myMeshName");
+ aFieldName = VISU::Storable::FindValue(aMap, "myFieldName");
}
}
int anID = aMapIndex(ind);
switch( aType )
- {
+ {
case 1:
- {
- if( aSingleSelection )
- myCellIDValLbl->setText( QString::number( anID ) );
+ {
+ if( aSingleSelection )
+ myCellIDValLbl->setText( QString::number( anID ) );
vtkCell* aCell = anVISUActor->GetElemCell( anID );
- int aCellVTKID = anVISUActor->GetElemVTKID( anID );
+ int aCellVTKID = anVISUActor->GetElemVTKID( anID );
if( !aCell || aCellVTKID < 0 )
- break;
-
- int aNbOfPoints = aCell->GetNumberOfPoints();
- if( aNbOfPoints < 1 )
- break;
-
- TPointDataMap aPointDataMap;
-
- vtkIdList* aPointList = aCell->GetPointIds();
- for( int i = 0; i < aNbOfPoints; i++ )
- {
- int aPointVTKID = aPointList->GetId(i);
-
- TPointID aPointID = anVISUActor->GetNodeObjId( aPointVTKID );
- TPointData aPointData = getPointData( aPointVTKID, anVISUActor, aMapper, true );
- aPointDataMap[ aPointID ] = aPointData;
- aGlobalPointDataMap[ aPointID ] = aPointData;
- }
-
- TCellToPointData aCellToPointData;
- aCellToPointData.CellData = getValueData( aCellVTKID, anVISUActor, aDataSet->GetCellData() );
- aCellToPointData.PointDataMap = aPointDataMap;
- aCellToPointDataMap[ anID ] = aCellToPointData;
- break;
+ break;
+
+ int aNbOfPoints = aCell->GetNumberOfPoints();
+ if( aNbOfPoints < 1 )
+ break;
+
+ TPointDataMap aPointDataMap;
+
+ vtkIdList* aPointList = aCell->GetPointIds();
+ for( int i = 0; i < aNbOfPoints; i++ )
+ {
+ int aPointVTKID = aPointList->GetId(i);
+
+ TPointID aPointID = anVISUActor->GetNodeObjId( aPointVTKID );
+ TPointData aPointData = getPointData( aPointVTKID, anVISUActor, aMapper, true );
+ aPointDataMap[ aPointID ] = aPointData;
+ aGlobalPointDataMap[ aPointID ] = aPointData;
+ }
+
+ TCellToPointData aCellToPointData;
+ aCellToPointData.CellData = getValueData( aCellVTKID, anVISUActor, aDataSet->GetCellData() );
+ aCellToPointData.PointDataMap = aPointDataMap;
+ aCellToPointDataMap[ anID ] = aCellToPointData;
+ break;
}
case 2:
{
- if( aSingleSelection )
- myIDValLbl->setText( QString::number( anID ) );
-
- int aPointVTKID = anVISUActor->GetNodeVTKID( anID );
- if( aPointVTKID < 0 )
- break;
-
- TCellDataMap aCellDataMap;
-
- VISU::TElnoPoints anElnoPoints = VISU::GetElnoPoints( aDataSet, anID );
- VISU::TElnoPoints::iterator anElnoIter = anElnoPoints.begin();
- for( ; anElnoIter != anElnoPoints.end(); anElnoIter++ )
- {
- VISU::TElnoPointID anElnoPointID = *anElnoIter;
- VISU::TVTKPointID aVTKPointID = anElnoPointID.first;
- VISU::TVTKCellID aVTKCellID = anElnoPointID.second;
-
- TCellID aCellID = anVISUActor->GetElemObjId( aVTKCellID );
- TValueData aValueData = getValueData( aVTKPointID, anVISUActor, aDataSet->GetPointData() );
- aCellDataMap[ aCellID ] = aValueData;
- }
-
- TPointToCellData aPointToCellData;
- aPointToCellData.PointData = getPointData( aPointVTKID, anVISUActor, aMapper, !isElno );
- aPointToCellData.CellDataMap = aCellDataMap;
- aPointToCellDataMap[ anID ] = aPointToCellData;
- break;
+ if( aSingleSelection )
+ myIDValLbl->setText( QString::number( anID ) );
+
+ int aPointVTKID = anVISUActor->GetNodeVTKID( anID );
+ if( aPointVTKID < 0 )
+ break;
+
+ TCellDataMap aCellDataMap;
+
+ VISU::TElnoPoints anElnoPoints = VISU::GetElnoPoints( aDataSet, anID );
+ VISU::TElnoPoints::iterator anElnoIter = anElnoPoints.begin();
+ for( ; anElnoIter != anElnoPoints.end(); anElnoIter++ )
+ {
+ VISU::TElnoPointID anElnoPointID = *anElnoIter;
+ VISU::TVTKPointID aVTKPointID = anElnoPointID.first;
+ VISU::TVTKCellID aVTKCellID = anElnoPointID.second;
+
+ TCellID aCellID = anVISUActor->GetElemObjId( aVTKCellID );
+ TValueData aValueData = getValueData( aVTKPointID, anVISUActor, aDataSet->GetPointData() );
+ aCellDataMap[ aCellID ] = aValueData;
+ }
+
+ TPointToCellData aPointToCellData;
+ aPointToCellData.PointData = getPointData( aPointVTKID, anVISUActor, aMapper, !isElno );
+ aPointToCellData.CellDataMap = aCellDataMap;
+ aPointToCellDataMap[ anID ] = aPointToCellData;
+ break;
}
}
}
switch( aType )
{
case 1:
- if( isElno )
- aTableIds.append( CellElno );
- else
- {
- aTableIds.append( CellStdCell );
- aTableIds.append( CellStdPoint );
- }
- break;
+ if( isElno )
+ aTableIds.append( CellElno );
+ else
+ {
+ aTableIds.append( CellStdCell );
+ aTableIds.append( CellStdPoint );
+ }
+ break;
case 2:
- aTableIds.append( isElno ? PointElno : PointStd );
- break;
+ aTableIds.append( isElno ? PointElno : PointStd );
+ break;
}
QListIterator<int> aTableIter( aTableIds );
while( aTableIter.hasNext() )
{
- int aTableId = aTableIter.next();
- if( !myTables.contains( aTableId ) )
- continue;
-
- QTableWidget* aTable = myTables[ aTableId ];
- if( !aTable )
- continue;
-
- int aRow = -1;
- switch( aTableId )
- {
- case CellStdPoint:
- {
- int aRowCount = aGlobalPointDataMap.size();
- aTable->setRowCount( aRowCount );
-
- TPointDataMap::const_iterator aPointIter = aGlobalPointDataMap.begin();
- for( ; aPointIter != aGlobalPointDataMap.end(); aPointIter++ )
- {
- aRow++;
- TPointID aPointID = aPointIter.key();
- const TPointData& aPointData = aPointIter.value();
- const TValueData& aValueData = aPointData.ValueData;
-
- setData( aTableId, aRow, Point, aPointID );
- setData( aTableId, aRow, X, aPointData.X );
- setData( aTableId, aRow, Y, aPointData.Y );
- setData( aTableId, aRow, Z, aPointData.Z );
- setData( aTableId, aRow, I, aPointData.I );
- setData( aTableId, aRow, J, aPointData.J );
- setData( aTableId, aRow, K, aPointData.K );
- setData( aTableId, aRow, Scalar, aValueData.Scalar );
- setData( aTableId, aRow, Vector, aValueData.Vector );
- }
- break;
- }
- case CellStdCell:
- case CellElno:
- {
- int aRowCount = 0;
- TCellToPointDataMap::const_iterator aCellToPointIter = aCellToPointDataMap.begin();
- for( ; aCellToPointIter != aCellToPointDataMap.end(); aCellToPointIter++ )
- {
- if( aTableId == CellStdCell )
- aRowCount++;
- else if( aTableId == CellElno )
- {
- const TCellToPointData& aCellToPointData = aCellToPointIter.value();
- const TPointDataMap& aPointDataMap = aCellToPointData.PointDataMap;
- int aNbPoints = aPointDataMap.size();
-
- aRowCount += aNbPoints;
- }
- }
- aTable->setRowCount( aRowCount );
-
- aCellToPointIter = aCellToPointDataMap.begin();
- for( ; aCellToPointIter != aCellToPointDataMap.end(); aCellToPointIter++ )
- {
- aRow++;
-
- TCellID aCellID = aCellToPointIter.key();
- const TCellToPointData& aCellToPointData = aCellToPointIter.value();
- const TValueData& aCellData = aCellToPointData.CellData;
-
- setData( aTableId, aRow, Cell, aCellID );
- if( aTableId == CellStdCell )
- {
- setData( aTableId, aRow, Scalar, aCellData.Scalar );
- setData( aTableId, aRow, Vector, aCellData.Vector );
- }
- else if( aTableId == CellElno )
- {
- const TPointDataMap& aPointDataMap = aCellToPointData.PointDataMap;
- int aNbPoints = aPointDataMap.size();
- if( aNbPoints > 1 )
- setRowSpan( aTableId, aRow, Cell, aNbPoints );
-
- TPointDataMap::const_iterator aPointIter = aPointDataMap.begin();
- for( aRow--; aPointIter != aPointDataMap.end(); aPointIter++ )
- {
- aRow++;
- TPointID aPointID = aPointIter.key();
- const TPointData& aPointData = aPointIter.value();
- const TValueData& aValueData = aPointData.ValueData;
-
- setData( aTableId, aRow, Point, aPointID );
- setData( aTableId, aRow, X, aPointData.X );
- setData( aTableId, aRow, Y, aPointData.Y );
- setData( aTableId, aRow, Z, aPointData.Z );
- setData( aTableId, aRow, I, aPointData.I );
- setData( aTableId, aRow, J, aPointData.J );
- setData( aTableId, aRow, K, aPointData.K );
- setData( aTableId, aRow, Scalar, aValueData.Scalar );
- setData( aTableId, aRow, Vector, aValueData.Vector );
- }
- }
- }
- break;
- }
- case PointStd:
- case PointElno:
- {
- int aRowCount = 0;
- TPointToCellDataMap::const_iterator aPointToCellIter = aPointToCellDataMap.begin();
- for( ; aPointToCellIter != aPointToCellDataMap.end(); aPointToCellIter++ )
- {
- const TPointToCellData& aPointToCellData = aPointToCellIter.value();
- const TCellDataMap& aCellDataMap = aPointToCellData.CellDataMap;
- int aNbCells = aCellDataMap.size();
- if( aNbCells > 1 )
- aRowCount += aNbCells;
- else
- aRowCount++;
- }
- aTable->setRowCount( aRowCount );
-
- aPointToCellIter = aPointToCellDataMap.begin();
- for( ; aPointToCellIter != aPointToCellDataMap.end(); aPointToCellIter++ )
- {
- aRow++;
-
- TPointID aPointID = aPointToCellIter.key();
- const TPointToCellData& aPointToCellData = aPointToCellIter.value();
- const TPointData& aPointData = aPointToCellData.PointData;
-
- setData( aTableId, aRow, Point, aPointID );
- setData( aTableId, aRow, X, aPointData.X );
- setData( aTableId, aRow, Y, aPointData.Y );
- setData( aTableId, aRow, Z, aPointData.Z );
- setData( aTableId, aRow, I, aPointData.I );
- setData( aTableId, aRow, J, aPointData.J );
- setData( aTableId, aRow, K, aPointData.K );
-
- if( aTableId == PointElno )
- {
- const TCellDataMap& aCellDataMap = aPointToCellData.CellDataMap;
- int aNbCells = aCellDataMap.size();
- if( aNbCells > 1 )
- for( int aColumnId = Point; aColumnId <= K; aColumnId++ )
- setRowSpan( aTableId, aRow, aColumnId, aNbCells );
-
- TCellDataMap::const_iterator aCellIter = aCellDataMap.begin();
- for( aRow--; aCellIter != aCellDataMap.end(); aCellIter++ )
- {
- aRow++;
- TCellID aCellID = aCellIter.key();
- const TValueData& aCellData = aCellIter.value();
-
- setData( aTableId, aRow, Cell, aCellID );
- setData( aTableId, aRow, Scalar, aCellData.Scalar );
- setData( aTableId, aRow, Vector, aCellData.Vector );
- }
- }
- else
- {
- const TValueData& aValueData = aPointData.ValueData;
- setData( aTableId, aRow, Scalar, aValueData.Scalar );
- setData( aTableId, aRow, Vector, aValueData.Vector );
- }
- }
- break;
- }
- }
-
- for( int aCol = column( aTableId, I ), aLastCol = column( aTableId, K ); aCol <= aLastCol; aCol++ )
- if( aCol != -1 )
- aTable->setColumnHidden( aCol, !isStructured );
- aTable->resizeColumnsToContents();
+ int aTableId = aTableIter.next();
+ if( !myTables.contains( aTableId ) )
+ continue;
+
+ QTableWidget* aTable = myTables[ aTableId ];
+ if( !aTable )
+ continue;
+
+ int aRow = -1;
+ switch( aTableId )
+ {
+ case CellStdPoint:
+ {
+ int aRowCount = aGlobalPointDataMap.size();
+ aTable->setRowCount( aRowCount );
+
+ TPointDataMap::const_iterator aPointIter = aGlobalPointDataMap.begin();
+ for( ; aPointIter != aGlobalPointDataMap.end(); aPointIter++ )
+ {
+ aRow++;
+ TPointID aPointID = aPointIter.key();
+ const TPointData& aPointData = aPointIter.value();
+ const TValueData& aValueData = aPointData.ValueData;
+
+ setData( aTableId, aRow, Point, aPointID );
+ setData( aTableId, aRow, X, aPointData.X );
+ setData( aTableId, aRow, Y, aPointData.Y );
+ setData( aTableId, aRow, Z, aPointData.Z );
+ setData( aTableId, aRow, I, aPointData.I );
+ setData( aTableId, aRow, J, aPointData.J );
+ setData( aTableId, aRow, K, aPointData.K );
+ setData( aTableId, aRow, Scalar, aValueData.Scalar );
+ setData( aTableId, aRow, Vector, aValueData.Vector );
+ }
+ break;
+ }
+ case CellStdCell:
+ case CellElno:
+ {
+ int aRowCount = 0;
+ TCellToPointDataMap::const_iterator aCellToPointIter = aCellToPointDataMap.begin();
+ for( ; aCellToPointIter != aCellToPointDataMap.end(); aCellToPointIter++ )
+ {
+ if( aTableId == CellStdCell )
+ aRowCount++;
+ else if( aTableId == CellElno )
+ {
+ const TCellToPointData& aCellToPointData = aCellToPointIter.value();
+ const TPointDataMap& aPointDataMap = aCellToPointData.PointDataMap;
+ int aNbPoints = aPointDataMap.size();
+
+ aRowCount += aNbPoints;
+ }
+ }
+ aTable->setRowCount( aRowCount );
+
+ aCellToPointIter = aCellToPointDataMap.begin();
+ for( ; aCellToPointIter != aCellToPointDataMap.end(); aCellToPointIter++ )
+ {
+ aRow++;
+
+ TCellID aCellID = aCellToPointIter.key();
+ const TCellToPointData& aCellToPointData = aCellToPointIter.value();
+ const TValueData& aCellData = aCellToPointData.CellData;
+
+ setData( aTableId, aRow, Cell, aCellID );
+ if( aTableId == CellStdCell )
+ {
+ setData( aTableId, aRow, Scalar, aCellData.Scalar );
+ setData( aTableId, aRow, Vector, aCellData.Vector );
+ }
+ else if( aTableId == CellElno )
+ {
+ const TPointDataMap& aPointDataMap = aCellToPointData.PointDataMap;
+ int aNbPoints = aPointDataMap.size();
+ if( aNbPoints > 1 )
+ setRowSpan( aTableId, aRow, Cell, aNbPoints );
+
+ TPointDataMap::const_iterator aPointIter = aPointDataMap.begin();
+ for( aRow--; aPointIter != aPointDataMap.end(); aPointIter++ )
+ {
+ aRow++;
+ TPointID aPointID = aPointIter.key();
+ const TPointData& aPointData = aPointIter.value();
+ const TValueData& aValueData = aPointData.ValueData;
+
+ setData( aTableId, aRow, Point, aPointID );
+ setData( aTableId, aRow, X, aPointData.X );
+ setData( aTableId, aRow, Y, aPointData.Y );
+ setData( aTableId, aRow, Z, aPointData.Z );
+ setData( aTableId, aRow, I, aPointData.I );
+ setData( aTableId, aRow, J, aPointData.J );
+ setData( aTableId, aRow, K, aPointData.K );
+ setData( aTableId, aRow, Scalar, aValueData.Scalar );
+ setData( aTableId, aRow, Vector, aValueData.Vector );
+ }
+ }
+ }
+ break;
+ }
+ case PointStd:
+ case PointElno:
+ {
+ int aRowCount = 0;
+ TPointToCellDataMap::const_iterator aPointToCellIter = aPointToCellDataMap.begin();
+ for( ; aPointToCellIter != aPointToCellDataMap.end(); aPointToCellIter++ )
+ {
+ const TPointToCellData& aPointToCellData = aPointToCellIter.value();
+ const TCellDataMap& aCellDataMap = aPointToCellData.CellDataMap;
+ int aNbCells = aCellDataMap.size();
+ if( aNbCells > 1 )
+ aRowCount += aNbCells;
+ else
+ aRowCount++;
+ }
+ aTable->setRowCount( aRowCount );
+
+ aPointToCellIter = aPointToCellDataMap.begin();
+ for( ; aPointToCellIter != aPointToCellDataMap.end(); aPointToCellIter++ )
+ {
+ aRow++;
+
+ TPointID aPointID = aPointToCellIter.key();
+ const TPointToCellData& aPointToCellData = aPointToCellIter.value();
+ const TPointData& aPointData = aPointToCellData.PointData;
+
+ setData( aTableId, aRow, Point, aPointID );
+ setData( aTableId, aRow, X, aPointData.X );
+ setData( aTableId, aRow, Y, aPointData.Y );
+ setData( aTableId, aRow, Z, aPointData.Z );
+ setData( aTableId, aRow, I, aPointData.I );
+ setData( aTableId, aRow, J, aPointData.J );
+ setData( aTableId, aRow, K, aPointData.K );
+
+ if( aTableId == PointElno )
+ {
+ const TCellDataMap& aCellDataMap = aPointToCellData.CellDataMap;
+ int aNbCells = aCellDataMap.size();
+ if( aNbCells > 1 )
+ for( int aColumnId = Point; aColumnId <= K; aColumnId++ )
+ setRowSpan( aTableId, aRow, aColumnId, aNbCells );
+
+ TCellDataMap::const_iterator aCellIter = aCellDataMap.begin();
+ for( aRow--; aCellIter != aCellDataMap.end(); aCellIter++ )
+ {
+ aRow++;
+ TCellID aCellID = aCellIter.key();
+ const TValueData& aCellData = aCellIter.value();
+
+ setData( aTableId, aRow, Cell, aCellID );
+ setData( aTableId, aRow, Scalar, aCellData.Scalar );
+ setData( aTableId, aRow, Vector, aCellData.Vector );
+ }
+ }
+ else
+ {
+ const TValueData& aValueData = aPointData.ValueData;
+ setData( aTableId, aRow, Scalar, aValueData.Scalar );
+ setData( aTableId, aRow, Vector, aValueData.Vector );
+ }
+ }
+ break;
+ }
+ }
+
+ for( int aCol = column( aTableId, I ), aLastCol = column( aTableId, K ); aCol <= aLastCol; aCol++ )
+ if( aCol != -1 )
+ aTable->setColumnHidden( aCol, !isStructured );
+ aTable->resizeColumnsToContents();
}
int stackId = isElno ? ElnoMesh : StdMesh;
QStackedWidget* aStackedWg = aType == 1 ? myCellStackedWg : aType == 2 ? myPointStackedWg : 0;
if( aStackedWg )
- aStackedWg->setCurrentIndex( stackId );
+ aStackedWg->setCurrentIndex( stackId );
}
}
myFl = false;
bool onIdEdit (const QString& theText,
TGetVTKIdMethod theMethod,
bool theIsCell,
- const SalomeApp_Module* theModule,
+ const SalomeApp_Module* theModule,
QLabel* theMeshName,
QString theValue,
QLabel* theFieldName)
{
int aVTKId = (aPipeLine->*theMethod)(anObjId);
if(aVTKId < 0)
- return false;
+ return false;
TColStd_MapOfInteger newIndices;
newIndices.Add(anObjId);
SVTK_RenderWindowInteractor* anInteractor = aViewWindow->GetInteractor();
VTK::ActorCollectionCopy aCopy(anInteractor->getRenderer()->GetActors());
VISU_Actor* anActor = SVTK::Find<VISU_Actor>(aCopy.GetActors(),
- SVTK::TIsSameIObject<VISU_Actor>( anIO ));
+ SVTK::TIsSameIObject<VISU_Actor>( anIO ));
anActor->Highlight( anIO );
return true;
if (myFl) return;
TGetVTKIdMethod aMethod = &VISU_PipeLine::GetNodeVTKID;
bool anIsSelected = onIdEdit(myIDValLbl->text(),
- aMethod,
- false,
- myModule,
- myMeshName,
- tr("WRN_NO_AVAILABLE_DATA"),
- myFieldName);
+ aMethod,
+ false,
+ myModule,
+ myMeshName,
+ tr("WRN_NO_AVAILABLE_DATA"),
+ myFieldName);
if (anIsSelected)
// as selection manager doesn't send signal currentSelectionChanged()
onSelectionEvent();
if (myFl) return;
TGetVTKIdMethod aMethod = &VISU_PipeLine::GetElemVTKID;
bool anIsSelected = onIdEdit(myCellIDValLbl->text(),
- aMethod,
- true,
- myModule,
- myMeshName,
- tr("WRN_NO_AVAILABLE_DATA"),
- myFieldName);
+ aMethod,
+ true,
+ myModule,
+ myMeshName,
+ tr("WRN_NO_AVAILABLE_DATA"),
+ myFieldName);
if (anIsSelected)
// as selection manager doesn't send signal currentSelectionChanged()
onSelectionEvent();
void VisuGUI_SelectionPanel::onModuleActivated()
{
disconnect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( onSelectionEvent() ) );
+ this, SLOT( onSelectionEvent() ) );
connect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( onSelectionEvent() ) );
+ this, SLOT( onSelectionEvent() ) );
VisuGUI_Panel::onModuleActivated();
}
void VisuGUI_SelectionPanel::onModuleDeactivated()
{
disconnect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( onSelectionEvent() ) );
+ this, SLOT( onSelectionEvent() ) );
VisuGUI_Panel::onModuleDeactivated();
}
*/
VisuGUI_SelectionPrefDlg::VisuGUI_SelectionPrefDlg( QWidget* parent )
: QDialog( parent ? parent : SUIT_Session::session()->activeApplication()->desktop(),
- Qt::WindowTitleHint | Qt::WindowSystemMenuHint )
+ Qt::WindowTitleHint | Qt::WindowSystemMenuHint )
{
setWindowTitle( tr("TLT_SELECTION_PREFERENCES") );
setSizeGripEnabled( TRUE );
vtkFloatingPointType* aColor = aPickingSettings->GetColor();
mySelectionColorButton->setColor( QColor( ( int )( aColor[0] * 255.0 ),
- ( int )( aColor[1] * 255.0 ),
- ( int )( aColor[2] * 255.0 ) ) );
+ ( int )( aColor[1] * 255.0 ),
+ ( int )( aColor[2] * 255.0 ) ) );
myInfoWindowGroup->setChecked( aPickingSettings->GetInfoWindowEnabled() );
myTransparencySpinBox->setValue( int(aPickingSettings->GetInfoWindowTransparency() * 100.0) );
tblIntAttr = anAttr;
if ( tblIntAttr ) {
try {
- int nbRows = tblIntAttr->GetNbRows() ;
- vector<string> rowTitles = tblIntAttr->GetRowTitles();
- vector<string> rowUnits = tblIntAttr->GetRowUnits();
- QStringList rows;
- for ( int i = 0; i < nbRows; i++ )
- rows.append( rowTitles[i].c_str() );
-
- for ( int i = 0; i < nbRows; i++ ) {
- VisuGUI_ItemContainer* item = new VisuGUI_ItemContainer( this );
- item->createWidgets( frame, rows );
- frameLayout->addWidget( item->myHBtn, row, 0 );
- frameLayout->addWidget( item->myVBtn, row, 1 );
- frameLayout->addWidget( item->myAssigned, row, 3 );
-
- frameLayout->addWidget( item->myTitleLab, row, 5 );
- if ( rowTitles.size() > 0 )
- item->myTitleLab->setText( QString( rowTitles[ i ].c_str() ) );
- frameLayout->addWidget( item->myUnitLab, row, 7 );
- if ( rowUnits.size() > 0 )
- item->myUnitLab->setText( QString( rowUnits[ i ].c_str() ) );
- frameLayout->addWidget( item->myAutoCheck, row, 9 );
- frameLayout->addWidget( item->myLineCombo, row, 10 );
- frameLayout->addWidget( item->myLineSpin, row, 11 );
- frameLayout->addWidget( item->myMarkerCombo, row, 12 );
- frameLayout->addWidget( item->myColorBtn, row, 13 );
- connect( item, SIGNAL( horToggled( bool ) ), this, SLOT( onHBtnToggled( bool ) ) );
- connect( item, SIGNAL( verToggled( bool ) ), this, SLOT( onVBtnToggled( bool ) ) );
- myItems.append( item );
- row++;
- }
+ int nbRows = tblIntAttr->GetNbRows() ;
+ vector<string> rowTitles = tblIntAttr->GetRowTitles();
+ vector<string> rowUnits = tblIntAttr->GetRowUnits();
+ QStringList rows;
+ for ( int i = 0; i < nbRows; i++ )
+ rows.append( rowTitles[i].c_str() );
+
+ for ( int i = 0; i < nbRows; i++ ) {
+ VisuGUI_ItemContainer* item = new VisuGUI_ItemContainer( this );
+ item->createWidgets( frame, rows );
+ frameLayout->addWidget( item->myHBtn, row, 0 );
+ frameLayout->addWidget( item->myVBtn, row, 1 );
+ frameLayout->addWidget( item->myAssigned, row, 3 );
+
+ frameLayout->addWidget( item->myTitleLab, row, 5 );
+ if ( rowTitles.size() > 0 )
+ item->myTitleLab->setText( QString( rowTitles[ i ].c_str() ) );
+ frameLayout->addWidget( item->myUnitLab, row, 7 );
+ if ( rowUnits.size() > 0 )
+ item->myUnitLab->setText( QString( rowUnits[ i ].c_str() ) );
+ frameLayout->addWidget( item->myAutoCheck, row, 9 );
+ frameLayout->addWidget( item->myLineCombo, row, 10 );
+ frameLayout->addWidget( item->myLineSpin, row, 11 );
+ frameLayout->addWidget( item->myMarkerCombo, row, 12 );
+ frameLayout->addWidget( item->myColorBtn, row, 13 );
+ connect( item, SIGNAL( horToggled( bool ) ), this, SLOT( onHBtnToggled( bool ) ) );
+ connect( item, SIGNAL( verToggled( bool ) ), this, SLOT( onVBtnToggled( bool ) ) );
+ myItems.append( item );
+ row++;
+ }
}
catch( ... ) {
- MESSAGE("VisuGUI_SetupPlot2dDlg::VisuGUI_SetupPlot2dDlg : Exception has been caught (int)!!!");
+ MESSAGE("VisuGUI_SetupPlot2dDlg::VisuGUI_SetupPlot2dDlg : Exception has been caught (int)!!!");
}
}
}
tblRealAttr = anAttr;
if ( tblRealAttr ) {
try {
- int nbRows = tblRealAttr->GetNbRows() ;
- vector<string> rowTitles = tblRealAttr->GetRowTitles();
- vector<string> rowUnits = tblRealAttr->GetRowUnits();
- QStringList rows;
- for ( int i = 0; i < nbRows; i++ )
- rows.append( rowTitles[i].c_str() );
-
- for ( int i = 0; i < nbRows; i++ ) {
- VisuGUI_ItemContainer* item = new VisuGUI_ItemContainer( this );
- item->createWidgets( frame, rows );
- frameLayout->addWidget( item->myHBtn, row, 0 );
- frameLayout->addWidget( item->myVBtn, row, 1 );
- frameLayout->addWidget( item->myAssigned, row, 3 );
-
- frameLayout->addWidget( item->myTitleLab, row, 5 );
- if ( rowTitles.size() > 0 )
- item->myTitleLab->setText( QString( rowTitles[ i ].c_str() ) );
- frameLayout->addWidget( item->myUnitLab, row, 7 );
- if ( rowUnits.size() > 0 )
- item->myUnitLab->setText( QString( rowUnits[ i ].c_str() ) );
- frameLayout->addWidget( item->myAutoCheck, row, 9 );
- frameLayout->addWidget( item->myLineCombo, row, 10 );
- frameLayout->addWidget( item->myLineSpin, row, 11 );
- frameLayout->addWidget( item->myMarkerCombo, row, 12 );
- frameLayout->addWidget( item->myColorBtn, row, 13 );
- connect( item, SIGNAL( horToggled( bool ) ), this, SLOT( onHBtnToggled( bool ) ) );
- connect( item, SIGNAL( verToggled( bool ) ), this, SLOT( onVBtnToggled( bool ) ) );
- myItems.append( item );
- row++;
- }
+ int nbRows = tblRealAttr->GetNbRows() ;
+ vector<string> rowTitles = tblRealAttr->GetRowTitles();
+ vector<string> rowUnits = tblRealAttr->GetRowUnits();
+ QStringList rows;
+ for ( int i = 0; i < nbRows; i++ )
+ rows.append( rowTitles[i].c_str() );
+
+ for ( int i = 0; i < nbRows; i++ ) {
+ VisuGUI_ItemContainer* item = new VisuGUI_ItemContainer( this );
+ item->createWidgets( frame, rows );
+ frameLayout->addWidget( item->myHBtn, row, 0 );
+ frameLayout->addWidget( item->myVBtn, row, 1 );
+ frameLayout->addWidget( item->myAssigned, row, 3 );
+
+ frameLayout->addWidget( item->myTitleLab, row, 5 );
+ if ( rowTitles.size() > 0 )
+ item->myTitleLab->setText( QString( rowTitles[ i ].c_str() ) );
+ frameLayout->addWidget( item->myUnitLab, row, 7 );
+ if ( rowUnits.size() > 0 )
+ item->myUnitLab->setText( QString( rowUnits[ i ].c_str() ) );
+ frameLayout->addWidget( item->myAutoCheck, row, 9 );
+ frameLayout->addWidget( item->myLineCombo, row, 10 );
+ frameLayout->addWidget( item->myLineSpin, row, 11 );
+ frameLayout->addWidget( item->myMarkerCombo, row, 12 );
+ frameLayout->addWidget( item->myColorBtn, row, 13 );
+ connect( item, SIGNAL( horToggled( bool ) ), this, SLOT( onHBtnToggled( bool ) ) );
+ connect( item, SIGNAL( verToggled( bool ) ), this, SLOT( onVBtnToggled( bool ) ) );
+ myItems.append( item );
+ row++;
+ }
}
catch( ... ) {
- MESSAGE("VisuGUI_SetupPlot2dDlg::VisuGUI_SetupPlot2dDlg : Exception has been caught (real)!!!");
+ MESSAGE("VisuGUI_SetupPlot2dDlg::VisuGUI_SetupPlot2dDlg : Exception has been caught (real)!!!");
}
}
}
Gets curves info ( indexes of row data in the table for horizontal and verical axes )
*/
void VisuGUI_SetupPlot2dDlg::getCurvesSource( int& horIndex, QList<int>& verIndexes,
- QList<int>& zIndices )
+ QList<int>& zIndices )
{
/* collecting horizontal and vertical axis items */
horIndex = -1;
Gets curve attributes
*/
bool VisuGUI_SetupPlot2dDlg::getCurveAttributes( const int vIndex,
- bool& isAuto,
- int& marker,
- int& line,
- int& lineWidth,
- QColor& color)
+ bool& isAuto,
+ int& marker,
+ int& line,
+ int& lineWidth,
+ QColor& color)
{
if ( vIndex >= 0 && vIndex < myItems.count() ) {
isAuto = myItems.at( vIndex )->isAutoAssign();
tblIntAttr = anAttr;
if ( tblIntAttr ) {
try {
- int nbCols = tblIntAttr->GetNbColumns() ;
- vector<string> rowTitles = tblIntAttr->GetRowTitles();
- vector<string> rowUnits = tblIntAttr->GetRowUnits();
-
- for ( i = 0; i < verIndex.count(); i++ ) {
- SPlot2d_Curve* curve = new SPlot2d_Curve();
- // curve titles
- if ( rowTitles.size() > 0 ) {
- curve->setHorTitle( QString( rowTitles[ horIndex ].c_str() ) );
- curve->setVerTitle( QString( rowTitles[ verIndex[i] ].c_str() ) );
- }
- // curve units
- if ( rowUnits.size() > 0 ) {
- curve->setHorUnits( QString( rowUnits[ horIndex ].c_str() ) );
- curve->setVerUnits( QString( rowUnits[ verIndex[i] ].c_str() ) );
- }
- // curve data
- int nbPoints = 0;
- for ( j = 1; j <= nbCols; j++ ) {
- if ( tblIntAttr->HasValue( horIndex+1, j ) && tblIntAttr->HasValue( verIndex[i]+1, j ) )
- nbPoints++;
- }
- if ( nbPoints > 0 ) {
- double* xList = new double[ nbPoints ];
- double* yList = new double[ nbPoints ];
- QStringList zList;
- for ( j = 1; j <= nbCols; j++ ) {
- if ( tblIntAttr->HasValue( horIndex+1, j ) && tblIntAttr->HasValue( verIndex[i]+1, j ) ) {
- xList[j-1] = tblIntAttr->GetValue( horIndex +1, j );
- yList[j-1] = tblIntAttr->GetValue( verIndex[i]+1, j );
- zList.append( QString( "%1" ).arg( tblIntAttr->GetValue( zIndices[i]+1, j ) ) );
- }
- }
- curve->setData( xList, yList, nbPoints, zList );
- }
- // curve attributes
- curve->setLine( (Plot2d::LineType)myItems.at( verIndex[i] )->getLine(), myItems.at( verIndex[i] )->getLineWidth() );
- curve->setMarker( (Plot2d::MarkerType)myItems.at( verIndex[i] )->getMarker() );
- curve->setColor( myItems.at( verIndex[i] )->getColor() );
- curve->setAutoAssign( myItems.at( verIndex[i] )->isAutoAssign() );
- // add curve into container
- container.append( curve );
- }
+ int nbCols = tblIntAttr->GetNbColumns() ;
+ vector<string> rowTitles = tblIntAttr->GetRowTitles();
+ vector<string> rowUnits = tblIntAttr->GetRowUnits();
+
+ for ( i = 0; i < verIndex.count(); i++ ) {
+ SPlot2d_Curve* curve = new SPlot2d_Curve();
+ // curve titles
+ if ( rowTitles.size() > 0 ) {
+ curve->setHorTitle( QString( rowTitles[ horIndex ].c_str() ) );
+ curve->setVerTitle( QString( rowTitles[ verIndex[i] ].c_str() ) );
+ }
+ // curve units
+ if ( rowUnits.size() > 0 ) {
+ curve->setHorUnits( QString( rowUnits[ horIndex ].c_str() ) );
+ curve->setVerUnits( QString( rowUnits[ verIndex[i] ].c_str() ) );
+ }
+ // curve data
+ int nbPoints = 0;
+ for ( j = 1; j <= nbCols; j++ ) {
+ if ( tblIntAttr->HasValue( horIndex+1, j ) && tblIntAttr->HasValue( verIndex[i]+1, j ) )
+ nbPoints++;
+ }
+ if ( nbPoints > 0 ) {
+ double* xList = new double[ nbPoints ];
+ double* yList = new double[ nbPoints ];
+ QStringList zList;
+ for ( j = 1; j <= nbCols; j++ ) {
+ if ( tblIntAttr->HasValue( horIndex+1, j ) && tblIntAttr->HasValue( verIndex[i]+1, j ) ) {
+ xList[j-1] = tblIntAttr->GetValue( horIndex +1, j );
+ yList[j-1] = tblIntAttr->GetValue( verIndex[i]+1, j );
+ zList.append( QString( "%1" ).arg( tblIntAttr->GetValue( zIndices[i]+1, j ) ) );
+ }
+ }
+ curve->setData( xList, yList, nbPoints, zList );
+ }
+ // curve attributes
+ curve->setLine( (Plot2d::LineType)myItems.at( verIndex[i] )->getLine(), myItems.at( verIndex[i] )->getLineWidth() );
+ curve->setMarker( (Plot2d::MarkerType)myItems.at( verIndex[i] )->getMarker() );
+ curve->setColor( myItems.at( verIndex[i] )->getColor() );
+ curve->setAutoAssign( myItems.at( verIndex[i] )->isAutoAssign() );
+ // add curve into container
+ container.append( curve );
+ }
}
catch( ... ) {
- MESSAGE("VisuGUI_SetupPlot2dDlg::getCurves : Exception has been caught (int)!!!");
+ MESSAGE("VisuGUI_SetupPlot2dDlg::getCurves : Exception has been caught (int)!!!");
}
}
}
tblRealAttr = anAttr;
if ( tblRealAttr ) {
try {
- int nbCols = tblRealAttr->GetNbColumns() ;
- vector<string> rowTitles = tblRealAttr->GetRowTitles();
- vector<string> rowUnits = tblRealAttr->GetRowUnits();
-
- for ( i = 0; i < verIndex.count(); i++ ) {
- SPlot2d_Curve* curve = new SPlot2d_Curve();
- // curve titles
- if ( rowTitles.size() > 0 ) {
- curve->setHorTitle( QString( rowTitles[ horIndex ].c_str() ) );
- curve->setVerTitle( QString( rowTitles[ verIndex[i] ].c_str() ) );
- }
- // curve units
- if ( rowUnits.size() > 0 ) {
- curve->setHorUnits( QString( rowUnits[ horIndex ].c_str() ) );
- curve->setVerUnits( QString( rowUnits[ verIndex[i] ].c_str() ) );
- }
- // curve data
- int nbPoints = 0;
- for ( j = 1; j <= nbCols; j++ ) {
- if ( tblRealAttr->HasValue( horIndex+1, j ) && tblRealAttr->HasValue( verIndex[i]+1, j ) )
- nbPoints++;
- }
- if ( nbPoints > 0 ) {
- double* xList = new double[ nbPoints ];
- double* yList = new double[ nbPoints ];
- QStringList zList;
- for ( j = 1; j <= nbCols; j++ ) {
- if ( tblRealAttr->HasValue( horIndex+1, j ) && tblRealAttr->HasValue( verIndex[i]+1, j ) ) {
- xList[j-1] = tblRealAttr->GetValue( horIndex +1, j );
- yList[j-1] = tblRealAttr->GetValue( verIndex[i]+1, j );
- zList.append( QString( "%1" ).arg( tblIntAttr->GetValue( zIndices[i]+1, j ) ) );
- }
- }
- curve->setData( xList, yList, nbPoints, zList );
- }
- // curve attributes
- curve->setLine( (Plot2d::LineType)myItems.at( verIndex[i] )->getLine(), myItems.at( verIndex[i] )->getLineWidth() );
- curve->setMarker( (Plot2d::MarkerType)myItems.at( verIndex[i] )->getMarker() );
- curve->setColor( myItems.at( verIndex[i] )->getColor() );
- curve->setAutoAssign( myItems.at( verIndex[i] )->isAutoAssign() );
- // add curve into container
- container.append( curve );
- }
+ int nbCols = tblRealAttr->GetNbColumns() ;
+ vector<string> rowTitles = tblRealAttr->GetRowTitles();
+ vector<string> rowUnits = tblRealAttr->GetRowUnits();
+
+ for ( i = 0; i < verIndex.count(); i++ ) {
+ SPlot2d_Curve* curve = new SPlot2d_Curve();
+ // curve titles
+ if ( rowTitles.size() > 0 ) {
+ curve->setHorTitle( QString( rowTitles[ horIndex ].c_str() ) );
+ curve->setVerTitle( QString( rowTitles[ verIndex[i] ].c_str() ) );
+ }
+ // curve units
+ if ( rowUnits.size() > 0 ) {
+ curve->setHorUnits( QString( rowUnits[ horIndex ].c_str() ) );
+ curve->setVerUnits( QString( rowUnits[ verIndex[i] ].c_str() ) );
+ }
+ // curve data
+ int nbPoints = 0;
+ for ( j = 1; j <= nbCols; j++ ) {
+ if ( tblRealAttr->HasValue( horIndex+1, j ) && tblRealAttr->HasValue( verIndex[i]+1, j ) )
+ nbPoints++;
+ }
+ if ( nbPoints > 0 ) {
+ double* xList = new double[ nbPoints ];
+ double* yList = new double[ nbPoints ];
+ QStringList zList;
+ for ( j = 1; j <= nbCols; j++ ) {
+ if ( tblRealAttr->HasValue( horIndex+1, j ) && tblRealAttr->HasValue( verIndex[i]+1, j ) ) {
+ xList[j-1] = tblRealAttr->GetValue( horIndex +1, j );
+ yList[j-1] = tblRealAttr->GetValue( verIndex[i]+1, j );
+ zList.append( QString( "%1" ).arg( tblIntAttr->GetValue( zIndices[i]+1, j ) ) );
+ }
+ }
+ curve->setData( xList, yList, nbPoints, zList );
+ }
+ // curve attributes
+ curve->setLine( (Plot2d::LineType)myItems.at( verIndex[i] )->getLine(), myItems.at( verIndex[i] )->getLineWidth() );
+ curve->setMarker( (Plot2d::MarkerType)myItems.at( verIndex[i] )->getMarker() );
+ curve->setColor( myItems.at( verIndex[i] )->getColor() );
+ curve->setAutoAssign( myItems.at( verIndex[i] )->isAutoAssign() );
+ // add curve into container
+ container.append( curve );
+ }
}
catch( ... ) {
- MESSAGE("VisuGUI_SetupPlot2dDlg::getCurves : Exception has been caught (real)!!!");
+ MESSAGE("VisuGUI_SetupPlot2dDlg::getCurves : Exception has been caught (real)!!!");
}
}
}
if ( on ) {
for ( int i = 0; i < myItems.count(); i++ ) {
if ( myItems.at( i ) != item )
- myItems.at( i )->setHorizontalOn( false );
+ myItems.at( i )->setHorizontalOn( false );
}
}
enableControls();
int totalOn = 0;
for ( i = 0; i < myItems.count(); i++ ) {
if ( myItems.at( i ) != item && !myItems.at( i )->isHorizontalOn() ) {
- if ( myItems.at( i )->myUnitLab->text() == item->myUnitLab->text() ) {
- if ( myItems.at( i )->isVerticalOn() )
- totalOn++;
- else
- itemList.append( myItems.at( i ) );
- }
- else {
- myItems.at( i )->setVerticalOn( false );
- }
+ if ( myItems.at( i )->myUnitLab->text() == item->myUnitLab->text() ) {
+ if ( myItems.at( i )->isVerticalOn() )
+ totalOn++;
+ else
+ itemList.append( myItems.at( i ) );
+ }
+ else {
+ myItems.at( i )->setVerticalOn( false );
+ }
}
}
if ( totalOn == 0 && !itemList.isEmpty() &&
- SUIT_MessageBox::information( this,
+ SUIT_MessageBox::information( this,
this->windowTitle(),
tr( "QUE_WANT_SAME_UNITS" ),
tr( "BUT_YES" ),
1, 1 ) == 0 )
{
for ( i = 0; i < itemList.count(); i++ ) {
- itemList.at( i )->blockSignals( true );
- itemList.at( i )->setVerticalOn( true );
- itemList.at( i )->blockSignals( false );
+ itemList.at( i )->blockSignals( true );
+ itemList.at( i )->setVerticalOn( true );
+ itemList.at( i )->blockSignals( false );
}
}
}
app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
}
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
SUIT_MessageBox::warning(0, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
if ( snd == myHBtn ) {
if ( on ) {
if ( myVBtn->isChecked() ) {
-// blockSignals( true );
- myVBtn->setChecked( false );
-// blockSignals( false );
+// blockSignals( true );
+ myVBtn->setChecked( false );
+// blockSignals( false );
}
}
emit horToggled( on );
else {
if ( on ) {
if ( myHBtn->isChecked() ) {
-// blockSignals( true );
- myHBtn->setChecked( false );
-// blockSignals( false );
+// blockSignals( true );
+ myHBtn->setChecked( false );
+// blockSignals( false );
}
}
emit verToggled( on );
platform = "application";
#endif
SUIT_MessageBox::warning( this,
- tr( "WRN_WARNING" ),
- tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
- arg( app->resourceMgr()->stringValue( "ExternalBrowser", platform ) ).arg( aHelpFileName ),
- tr( "BUT_OK" ) );
+ tr( "WRN_WARNING" ),
+ tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
+ arg( app->resourceMgr()->stringValue( "ExternalBrowser", platform ) ).arg( aHelpFileName ),
+ tr( "BUT_OK" ) );
}
}
Handle(SALOME_InteractiveObject) anIO = anIter.Value();
VISU_Actor* anActor = VISU::FindActor( VISU::GetAppStudy( myModule ), myViewWindow, anIO->getEntry() );
if ( anActor && anActor->IsShrunkable() )
- anActor->SetShrinkFactor( shrink );
+ anActor->SetShrinkFactor( shrink );
}
myViewWindow->Repaint();
}
if ( aList.Extent() == 1 ) {
Handle(SALOME_InteractiveObject) FirstIOS = aList.First();
if ( !FirstIOS.IsNull() ) {
- VISU_Actor* anActor = VISU::FindActor( VISU::GetAppStudy( myModule ), myViewWindow, FirstIOS->getEntry() );
- if ( anActor ) {
- shrinkable = anActor->IsShrunkable();
- if ( shrinkable )
- shrink = int( anActor->GetShrinkFactor() * 100. + 0.5 );
- }
+ VISU_Actor* anActor = VISU::FindActor( VISU::GetAppStudy( myModule ), myViewWindow, FirstIOS->getEntry() );
+ if ( anActor ) {
+ shrinkable = anActor->IsShrunkable();
+ if ( shrinkable )
+ shrink = int( anActor->GetShrinkFactor() * 100. + 0.5 );
+ }
}
}
else if ( aList.Extent() > 1 ) {
SALOME_ListIteratorOfListIO It( aList );
int setShr = -1;
for ( ; It.More(); It.Next() ) {
- Handle(SALOME_InteractiveObject) IO = It.Value();
- if (!IO.IsNull()) {
- VISU_Actor* anActor = VISU::FindActor( VISU::GetAppStudy( myModule ), myViewWindow, IO->getEntry() );
- if ( anActor ) {
- bool lshrinkable = anActor->IsShrunkable();
- shrinkable = shrinkable || lshrinkable;
- if ( lshrinkable ) {
- int shr = int( anActor->GetShrinkFactor() * 100. + 0.5 );
- if ( setShr < 0 )
- setShr = shr;
- else if ( setShr != shr ) {
- setShr = DEFAULT_SHRINK;
- break;
- }
- }
- }
- }
+ Handle(SALOME_InteractiveObject) IO = It.Value();
+ if (!IO.IsNull()) {
+ VISU_Actor* anActor = VISU::FindActor( VISU::GetAppStudy( myModule ), myViewWindow, IO->getEntry() );
+ if ( anActor ) {
+ bool lshrinkable = anActor->IsShrunkable();
+ shrinkable = shrinkable || lshrinkable;
+ if ( lshrinkable ) {
+ int shr = int( anActor->GetShrinkFactor() * 100. + 0.5 );
+ if ( setShr < 0 )
+ setShr = shr;
+ else if ( setShr != shr ) {
+ setShr = DEFAULT_SHRINK;
+ break;
+ }
+ }
+ }
+ }
}
if ( setShr >= 0 )
- shrink = setShr;
+ shrink = setShr;
}
ValueSpin->blockSignals( true );
ValueSpin->setValue( shrink );
public:
VisuGUI_ShrinkFactorDlg( VisuGUI* = 0,
- bool modal = false );
+ bool modal = false );
~VisuGUI_ShrinkFactorDlg();
Constructor
*/
VisuGUI_Slider::VisuGUI_Slider( VisuGUI* theModule,
- QMainWindow* theParent,
- LightApp_SelectionMgr* theSelectionMgr )
+ QMainWindow* theParent,
+ LightApp_SelectionMgr* theSelectionMgr )
: QWidget( theParent )
, myViewManager( VISU::GetVisuGen( theModule )->GetViewManager() )
, mySelectionMgr( theSelectionMgr )
{
QGridLayout* aGridLayout = new QGridLayout( aParent );
{
- myFirstTimeStamp = new QLabel( aParent );
- myFirstTimeStamp->setAlignment( Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter );
- myFirstTimeStamp->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
- aGridLayout->addWidget( myFirstTimeStamp, 0, 0, 1, 1 );
-
- mySlider = new QSlider( aParent );
- mySlider->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- mySlider->setFocusPolicy( Qt::StrongFocus );
- mySlider->setOrientation( Qt::Horizontal );
- mySlider->setTracking( false );
- mySlider->setMinimum( 0 );
- aGridLayout->addWidget( mySlider, 0, 1, 1, 3 );
-
- myLastTimeStamp = new QLabel( aParent );
- aGridLayout->addWidget( myLastTimeStamp, 0, 4, 1, 1 );
+ myFirstTimeStamp = new QLabel( aParent );
+ myFirstTimeStamp->setAlignment( Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter );
+ myFirstTimeStamp->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
+ aGridLayout->addWidget( myFirstTimeStamp, 0, 0, 1, 1 );
+
+ mySlider = new QSlider( aParent );
+ mySlider->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ mySlider->setFocusPolicy( Qt::StrongFocus );
+ mySlider->setOrientation( Qt::Horizontal );
+ mySlider->setTracking( false );
+ mySlider->setMinimum( 0 );
+ aGridLayout->addWidget( mySlider, 0, 1, 1, 3 );
+
+ myLastTimeStamp = new QLabel( aParent );
+ aGridLayout->addWidget( myLastTimeStamp, 0, 4, 1, 1 );
}
{
- myFirstButton = new QToolButton( aParent );
- myFirstButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_FIRST" ) ) );
- myFirstButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- aGridLayout->addWidget( myFirstButton, 1, 0, 1, 1 );
-
- myPreviousButton = new QToolButton( aParent );
- myPreviousButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PREVIOUS" ) ) );
- myPreviousButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- aGridLayout->addWidget( myPreviousButton, 1, 1, 1, 1 );
-
- myPlayButton = new QToolButton( aParent );
- myPlayButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PLAY" ) ) );
- myPlayButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- myPlayButton->setCheckable( true );
- aGridLayout->addWidget( myPlayButton, 1, 2, 1, 1 );
-
- myNextButton = new QToolButton( aParent );
- myNextButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_NEXT" ) ) );
- myNextButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- aGridLayout->addWidget( myNextButton, 1, 3, 1, 1 );
-
- myLastButton = new QToolButton( aParent );
- myLastButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_LAST" ) ) );
- myLastButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- aGridLayout->addWidget( myLastButton, 1, 4, 1, 1 );
+ myFirstButton = new QToolButton( aParent );
+ myFirstButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_FIRST" ) ) );
+ myFirstButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ aGridLayout->addWidget( myFirstButton, 1, 0, 1, 1 );
+
+ myPreviousButton = new QToolButton( aParent );
+ myPreviousButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PREVIOUS" ) ) );
+ myPreviousButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ aGridLayout->addWidget( myPreviousButton, 1, 1, 1, 1 );
+
+ myPlayButton = new QToolButton( aParent );
+ myPlayButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PLAY" ) ) );
+ myPlayButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ myPlayButton->setCheckable( true );
+ aGridLayout->addWidget( myPlayButton, 1, 2, 1, 1 );
+
+ myNextButton = new QToolButton( aParent );
+ myNextButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_NEXT" ) ) );
+ myNextButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ aGridLayout->addWidget( myNextButton, 1, 3, 1, 1 );
+
+ myLastButton = new QToolButton( aParent );
+ myLastButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_LAST" ) ) );
+ myLastButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ aGridLayout->addWidget( myLastButton, 1, 4, 1, 1 );
}
{
- myTimeStampIndexes = new QComboBox( aParent );
- myTimeStampIndexes->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- myTimeStampIndexes->setFocusPolicy( Qt::StrongFocus );
- aGridLayout->addWidget( myTimeStampIndexes, 2, 0, 1, 2 );
-
- myIsCycled = new QToolButton( aParent );
- myIsCycled->setText( tr( "IS_CYCLED" ) );
- myIsCycled->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- myIsCycled->setLayoutDirection( Qt::LeftToRight );
- myIsCycled->setCheckable( true );
- //myIsCycled->setEnabled( false );
- aGridLayout->addWidget( myIsCycled, 2, 2, 1, 1 );
-
- myTimeStampStrings = new QComboBox( aParent );
- myTimeStampStrings->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- myTimeStampStrings->setFocusPolicy( Qt::StrongFocus );
- aGridLayout->addWidget( myTimeStampStrings, 2, 3, 1, 2 );
+ myTimeStampIndexes = new QComboBox( aParent );
+ myTimeStampIndexes->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ myTimeStampIndexes->setFocusPolicy( Qt::StrongFocus );
+ aGridLayout->addWidget( myTimeStampIndexes, 2, 0, 1, 2 );
+
+ myIsCycled = new QToolButton( aParent );
+ myIsCycled->setText( tr( "IS_CYCLED" ) );
+ myIsCycled->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ myIsCycled->setLayoutDirection( Qt::LeftToRight );
+ myIsCycled->setCheckable( true );
+ //myIsCycled->setEnabled( false );
+ aGridLayout->addWidget( myIsCycled, 2, 2, 1, 1 );
+
+ myTimeStampStrings = new QComboBox( aParent );
+ myTimeStampStrings->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ myTimeStampStrings->setFocusPolicy( Qt::StrongFocus );
+ aGridLayout->addWidget( myTimeStampStrings, 2, 3, 1, 2 );
}
}
{
QVBoxLayout* aVBoxLayout = new QVBoxLayout( aParent );
{
- QHBoxLayout* aHBoxLayout = new QHBoxLayout();
-
- myMinimalMemoryButton = new QRadioButton( tr( "MINIMAL_MEMORY" ), aParent );
- aHBoxLayout->addWidget( myMinimalMemoryButton );
-
- QSpacerItem* aSpacerItem = new QSpacerItem( 16, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
- aHBoxLayout->addItem( aSpacerItem );
-
- myLimitedMemoryButton = new QRadioButton( tr( "LIMITED_MEMORY" ), aParent );
- myLimitedMemoryButton->setChecked( true );
- aHBoxLayout->addWidget( myLimitedMemoryButton );
-
- myLimitedMemory = new QtxDoubleSpinBox( aParent );
- myLimitedMemory->setMaximum( 10000 );
- myLimitedMemory->setValue( 512 );
- aHBoxLayout->addWidget( myLimitedMemory );
-
- QLabel* aMemoryDimensionLabel = new QLabel( aParent );
- aMemoryDimensionLabel->setText( tr( "MEMORY_UNITS" ) );
- aHBoxLayout->addWidget( aMemoryDimensionLabel );
-
- aVBoxLayout->addLayout( aHBoxLayout );
+ QHBoxLayout* aHBoxLayout = new QHBoxLayout();
+
+ myMinimalMemoryButton = new QRadioButton( tr( "MINIMAL_MEMORY" ), aParent );
+ aHBoxLayout->addWidget( myMinimalMemoryButton );
+
+ QSpacerItem* aSpacerItem = new QSpacerItem( 16, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ aHBoxLayout->addItem( aSpacerItem );
+
+ myLimitedMemoryButton = new QRadioButton( tr( "LIMITED_MEMORY" ), aParent );
+ myLimitedMemoryButton->setChecked( true );
+ aHBoxLayout->addWidget( myLimitedMemoryButton );
+
+ myLimitedMemory = new QtxDoubleSpinBox( aParent );
+ myLimitedMemory->setMaximum( 10000 );
+ myLimitedMemory->setValue( 512 );
+ aHBoxLayout->addWidget( myLimitedMemory );
+
+ QLabel* aMemoryDimensionLabel = new QLabel( aParent );
+ aMemoryDimensionLabel->setText( tr( "MEMORY_UNITS" ) );
+ aHBoxLayout->addWidget( aMemoryDimensionLabel );
+
+ aVBoxLayout->addLayout( aHBoxLayout );
}
{
- QHBoxLayout* aHBoxLayout = new QHBoxLayout();
-
- QLabel* aUsedMemoryLabel = new QLabel( tr( "USED_BY_CACHE" ), aParent );
- aUsedMemoryLabel->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
- aHBoxLayout->addWidget( aUsedMemoryLabel );
-
- myUsedMemory = new QLineEdit( aParent );
- myUsedMemory->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
- //myUsedMemory->setEnabled( false );
- aHBoxLayout->addWidget( myUsedMemory );
-
- QSpacerItem* aSpacerItem = new QSpacerItem( 16, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
- aHBoxLayout->addItem( aSpacerItem );
-
- QLabel* aFreeMemoryLabel = new QLabel( tr( "AVAILABLE_MEMORY" ), aParent );
- aHBoxLayout->addWidget( aFreeMemoryLabel );
+ QHBoxLayout* aHBoxLayout = new QHBoxLayout();
+
+ QLabel* aUsedMemoryLabel = new QLabel( tr( "USED_BY_CACHE" ), aParent );
+ aUsedMemoryLabel->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
+ aHBoxLayout->addWidget( aUsedMemoryLabel );
+
+ myUsedMemory = new QLineEdit( aParent );
+ myUsedMemory->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
+ //myUsedMemory->setEnabled( false );
+ aHBoxLayout->addWidget( myUsedMemory );
+
+ QSpacerItem* aSpacerItem = new QSpacerItem( 16, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ aHBoxLayout->addItem( aSpacerItem );
+
+ QLabel* aFreeMemoryLabel = new QLabel( tr( "AVAILABLE_MEMORY" ), aParent );
+ aHBoxLayout->addWidget( aFreeMemoryLabel );
- myFreeMemory = new QLineEdit( aParent );
- myFreeMemory->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
- //myFreeMemory->setEnabled( false );
- aHBoxLayout->addWidget( myFreeMemory );
+ myFreeMemory = new QLineEdit( aParent );
+ myFreeMemory->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
+ //myFreeMemory->setEnabled( false );
+ aHBoxLayout->addWidget( myFreeMemory );
- aVBoxLayout->addLayout( aHBoxLayout );
+ aVBoxLayout->addLayout( aHBoxLayout );
}
{
- QHBoxLayout* aHBoxLayout = new QHBoxLayout();
-
- QLabel* aLabel = new QLabel( tr( "SPEED" ), aParent );
- aLabel->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
- aHBoxLayout->addWidget( aLabel );
+ QHBoxLayout* aHBoxLayout = new QHBoxLayout();
+
+ QLabel* aLabel = new QLabel( tr( "SPEED" ), aParent );
+ aLabel->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
+ aHBoxLayout->addWidget( aLabel );
- mySpeedSlider = new QSlider( aParent );
- mySpeedSlider->setMinimum( 1 );
- mySpeedSlider->setMaximum( 100 );
- mySpeedSlider->setValue( mySpeedSlider->maximum() / 2 );
- mySpeedSlider->setPageStep( mySpeedSlider->maximum() / 5 );
- mySpeedSlider->setTickInterval( mySpeedSlider->pageStep() );
- mySpeedSlider->setOrientation( Qt::Horizontal );
- mySpeedSlider->setTickPosition( QSlider::TicksBelow );
- aHBoxLayout->addWidget( mySpeedSlider );
-
- aVBoxLayout->addLayout( aHBoxLayout );
+ mySpeedSlider = new QSlider( aParent );
+ mySpeedSlider->setMinimum( 1 );
+ mySpeedSlider->setMaximum( 100 );
+ mySpeedSlider->setValue( mySpeedSlider->maximum() / 2 );
+ mySpeedSlider->setPageStep( mySpeedSlider->maximum() / 5 );
+ mySpeedSlider->setTickInterval( mySpeedSlider->pageStep() );
+ mySpeedSlider->setOrientation( Qt::Horizontal );
+ mySpeedSlider->setTickPosition( QSlider::TicksBelow );
+ aHBoxLayout->addWidget( mySpeedSlider );
+
+ aVBoxLayout->addLayout( aHBoxLayout );
}
aTabWidget->addTab( aParent, tr( "PROPERTIES_TAB" ) );
myTimeStampIndexes->addItem( QString::number( aNumber ) );
if( aNumber == aTimeStampNumber )
- a_current_index = an_index;
+ a_current_index = an_index;
}
// work around - to update controls' sizes
myTimeStampStrings->setFont(myTimeStampStrings->font());
aSObject = aStudy->FindObjectID(anIO->getEntry());
if (aSObject) {
- CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject);
+ CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject);
if (!CORBA::is_nil(anObject)) {
- VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject);
+ VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject);
- if(!CORBA::is_nil(aHolder))
- {
- //cout << "ColoredPrs3dHolder" << endl;
- myHolderList.push_back(aHolder);
- }
+ if(!CORBA::is_nil(aHolder))
+ {
+ //cout << "ColoredPrs3dHolder" << endl;
+ myHolderList.push_back(aHolder);
+ }
}
}
}
public:
VisuGUI_Slider( VisuGUI* theModule,
- QMainWindow* theParent,
- LightApp_SelectionMgr* theSelectionMgr );
+ QMainWindow* theParent,
+ LightApp_SelectionMgr* theSelectionMgr );
virtual ~VisuGUI_Slider();
{}
void VisuGUI_StreamLinesDlg::initFromPrsObject ( VISU::ColoredPrs3d_i* thePrs,
- bool theInit )
+ bool theInit )
{
if( theInit )
myPrsCopy = VISU::TSameAsFactory<VISU::TSTREAMLINES>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
}
}
anIsOk &= myPrsCopy->SetParams(myIntegStepLen->value(),
- myPropTime->value(),
- myStepLen->value(),
- aPrs,
- myPntPercent->value(),
- aDirection);
+ myPropTime->value(),
+ myStepLen->value(),
+ aPrs,
+ myPntPercent->value(),
+ aDirection);
}
VISU::TSameAsFactory<VISU::TSTREAMLINES>().Copy(myPrsCopy, thePrs);
~VisuGUI_StreamLinesDlg();
virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit );
+ bool theInit );
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
Constructor
*/
VisuGUI_Sweep::VisuGUI_Sweep( VisuGUI* theModule,
- QMainWindow* theParent,
- LightApp_SelectionMgr* theSelectionMgr )
+ QMainWindow* theParent,
+ LightApp_SelectionMgr* theSelectionMgr )
: QWidget( theParent )
, myModule( theModule )
, myViewWindow( NULL )
{
QVBoxLayout* aVBoxLayout = new QVBoxLayout( aNavigationTab );
{
- QHBoxLayout* aHBoxLayout = new QHBoxLayout();
-
- QLabel* aStartSweepPosition = new QLabel( aNavigationTab );
- aStartSweepPosition->setText( tr( "START_SWEEP_POSITION" ) );
- aHBoxLayout->addWidget( aStartSweepPosition );
+ QHBoxLayout* aHBoxLayout = new QHBoxLayout();
+
+ QLabel* aStartSweepPosition = new QLabel( aNavigationTab );
+ aStartSweepPosition->setText( tr( "START_SWEEP_POSITION" ) );
+ aHBoxLayout->addWidget( aStartSweepPosition );
- mySweepSlider = new QSlider( aNavigationTab );
- mySweepSlider->setOrientation( Qt::Horizontal );
- mySweepSlider->setMinimum( 0 );
- aHBoxLayout->addWidget( mySweepSlider );
-
- QLabel* anEndSweepPosition = new QLabel( aNavigationTab );
- anEndSweepPosition->setText( tr( "END_SWEEP_POSITION" ) );
- aHBoxLayout->addWidget( anEndSweepPosition );
-
- aVBoxLayout->addLayout( aHBoxLayout );
+ mySweepSlider = new QSlider( aNavigationTab );
+ mySweepSlider->setOrientation( Qt::Horizontal );
+ mySweepSlider->setMinimum( 0 );
+ aHBoxLayout->addWidget( mySweepSlider );
+
+ QLabel* anEndSweepPosition = new QLabel( aNavigationTab );
+ anEndSweepPosition->setText( tr( "END_SWEEP_POSITION" ) );
+ aHBoxLayout->addWidget( anEndSweepPosition );
+
+ aVBoxLayout->addLayout( aHBoxLayout );
}
{
- QHBoxLayout* aHBoxLayout = new QHBoxLayout();
+ QHBoxLayout* aHBoxLayout = new QHBoxLayout();
- myFirstButton = new QToolButton( aNavigationTab );
- myFirstButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_FIRST" ) ) );
- myFirstButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- connect( myFirstButton, SIGNAL( clicked() ), SLOT( onFirst() ) );
- aHBoxLayout->addWidget( myFirstButton );
-
- myPreviousButton = new QToolButton( aNavigationTab );
- myPreviousButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PREVIOUS" ) ) );
- myPreviousButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- connect( myPreviousButton, SIGNAL( clicked() ), SLOT( onPrevious() ) );
- aHBoxLayout->addWidget( myPreviousButton );
-
- myPlayButton = new QToolButton( aNavigationTab );
- myPlayButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PLAY" ) ) );
- myPlayButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- myPlayButton->setCheckable( true );
- aHBoxLayout->addWidget( myPlayButton );
-
- myNextButton = new QToolButton( aNavigationTab );
- myNextButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_NEXT" ) ) );
- myNextButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- connect( myNextButton, SIGNAL( clicked() ), SLOT( onNext() ) );
- aHBoxLayout->addWidget( myNextButton );
-
- myLastButton = new QToolButton( aNavigationTab );
- myLastButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_LAST" ) ) );
- myLastButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- connect( myLastButton, SIGNAL( clicked() ), SLOT( onLast() ) );
- aHBoxLayout->addWidget( myLastButton );
-
- aVBoxLayout->addLayout( aHBoxLayout );
+ myFirstButton = new QToolButton( aNavigationTab );
+ myFirstButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_FIRST" ) ) );
+ myFirstButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ connect( myFirstButton, SIGNAL( clicked() ), SLOT( onFirst() ) );
+ aHBoxLayout->addWidget( myFirstButton );
+
+ myPreviousButton = new QToolButton( aNavigationTab );
+ myPreviousButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PREVIOUS" ) ) );
+ myPreviousButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ connect( myPreviousButton, SIGNAL( clicked() ), SLOT( onPrevious() ) );
+ aHBoxLayout->addWidget( myPreviousButton );
+
+ myPlayButton = new QToolButton( aNavigationTab );
+ myPlayButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PLAY" ) ) );
+ myPlayButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ myPlayButton->setCheckable( true );
+ aHBoxLayout->addWidget( myPlayButton );
+
+ myNextButton = new QToolButton( aNavigationTab );
+ myNextButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_NEXT" ) ) );
+ myNextButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ connect( myNextButton, SIGNAL( clicked() ), SLOT( onNext() ) );
+ aHBoxLayout->addWidget( myNextButton );
+
+ myLastButton = new QToolButton( aNavigationTab );
+ myLastButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_LAST" ) ) );
+ myLastButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ connect( myLastButton, SIGNAL( clicked() ), SLOT( onLast() ) );
+ aHBoxLayout->addWidget( myLastButton );
+
+ aVBoxLayout->addLayout( aHBoxLayout );
}
{
- QHBoxLayout* aHBoxLayout = new QHBoxLayout();
+ QHBoxLayout* aHBoxLayout = new QHBoxLayout();
- QToolButton* aStopButton = new QToolButton( aNavigationTab );
- aStopButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SWEEP_STOP" ) ) );
- aStopButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- aStopButton->setCheckable( false );
- connect( aStopButton, SIGNAL( clicked( ) ), SLOT( onStop( ) ) );
- aHBoxLayout->addWidget( aStopButton );
-
- myIsCycled = new QCheckBox( aNavigationTab );
- myIsCycled->setText( tr( "IS_CYCLED" ) );
- myIsCycled->setChecked( false );
- aHBoxLayout->addWidget( myIsCycled );
-
- aVBoxLayout->addLayout( aHBoxLayout );
+ QToolButton* aStopButton = new QToolButton( aNavigationTab );
+ aStopButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SWEEP_STOP" ) ) );
+ aStopButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ aStopButton->setCheckable( false );
+ connect( aStopButton, SIGNAL( clicked( ) ), SLOT( onStop( ) ) );
+ aHBoxLayout->addWidget( aStopButton );
+
+ myIsCycled = new QCheckBox( aNavigationTab );
+ myIsCycled->setText( tr( "IS_CYCLED" ) );
+ myIsCycled->setChecked( false );
+ aHBoxLayout->addWidget( myIsCycled );
+
+ aVBoxLayout->addLayout( aHBoxLayout );
}
aTabWidget->addTab( aNavigationTab, tr( "NAVIGATION_TAB" ) );
{
QGridLayout* aGridLayout = new QGridLayout( aPropertiesTab );
{
- QHBoxLayout* aHBoxLayout = new QHBoxLayout();
-
- QLabel* aModeAnnotation = new QLabel( aPropertiesTab );
- aModeAnnotation->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Preferred );
- aModeAnnotation->setText( tr( "MODE" ) );
- aHBoxLayout->addWidget( aModeAnnotation );
-
- mySweepMode = new QComboBox( aPropertiesTab );
- mySweepMode->insertItems( 0, QStringList()
- << tr( "LINEAR" )
- << tr( "COSINUSOIDAL" )
- << tr( "SINUSOIDAL" ) );
- mySweepMode->setCurrentIndex( aResourceMgr->integerValue( "VISU", "sweeping_modes", 0 ) );
- aHBoxLayout->addWidget( mySweepMode );
-
- myIntervals = new QComboBox( aPropertiesTab );
- myIntervals->insertItems( 0, QStringList()
- << tr( "[ 0, +PI ]" )
- << tr( "[ -PI, +PI ]" ) );
- myIntervals->setCurrentIndex( aResourceMgr->integerValue( "VISU", "sweeping_is2PI", 0 ) );
- aHBoxLayout->addWidget( myIntervals );
-
- aGridLayout->addLayout( aHBoxLayout, 0, 0, 1, 2 );
+ QHBoxLayout* aHBoxLayout = new QHBoxLayout();
+
+ QLabel* aModeAnnotation = new QLabel( aPropertiesTab );
+ aModeAnnotation->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Preferred );
+ aModeAnnotation->setText( tr( "MODE" ) );
+ aHBoxLayout->addWidget( aModeAnnotation );
+
+ mySweepMode = new QComboBox( aPropertiesTab );
+ mySweepMode->insertItems( 0, QStringList()
+ << tr( "LINEAR" )
+ << tr( "COSINUSOIDAL" )
+ << tr( "SINUSOIDAL" ) );
+ mySweepMode->setCurrentIndex( aResourceMgr->integerValue( "VISU", "sweeping_modes", 0 ) );
+ aHBoxLayout->addWidget( mySweepMode );
+
+ myIntervals = new QComboBox( aPropertiesTab );
+ myIntervals->insertItems( 0, QStringList()
+ << tr( "[ 0, +PI ]" )
+ << tr( "[ -PI, +PI ]" ) );
+ myIntervals->setCurrentIndex( aResourceMgr->integerValue( "VISU", "sweeping_is2PI", 0 ) );
+ aHBoxLayout->addWidget( myIntervals );
+
+ aGridLayout->addLayout( aHBoxLayout, 0, 0, 1, 2 );
}
QLabel* aNumberOfStepsAnnotation = new QLabel( aPropertiesTab );
public:
VisuGUI_Sweep( VisuGUI* theModule,
- QMainWindow* theParent,
- LightApp_SelectionMgr* theSelectionMgr );
+ QMainWindow* theParent,
+ LightApp_SelectionMgr* theSelectionMgr );
virtual ~VisuGUI_Sweep();
myBarPrs->GetTitleColor( R, G, B );
setPosAndSize( myBarPrs->GetPosX(),
- myBarPrs->GetPosY(),
- myBarPrs->GetWidth(),
- myBarPrs->GetHeight(),
- myBarPrs->GetBarOrientation() );
+ myBarPrs->GetPosY(),
+ myBarPrs->GetWidth(),
+ myBarPrs->GetHeight(),
+ myBarPrs->GetBarOrientation() );
myVerTS = myBarPrs->GetTitleSize();
myVerLS = myBarPrs->GetLabelSize();
myBarDlg->setUnitsVisible( myBarPrs->IsUnitsVisible() );
myTextDlg->myTitleFont->SetData( QColor( (int)(R*255.), (int)(G*255.), (int)(B*255.) ),
- myBarPrs->GetTitFontType(),
- myBarPrs->IsBoldTitle(),
- myBarPrs->IsItalicTitle(),
- myBarPrs->IsShadowTitle() );
+ myBarPrs->GetTitFontType(),
+ myBarPrs->IsBoldTitle(),
+ myBarPrs->IsItalicTitle(),
+ myBarPrs->IsShadowTitle() );
// "Labels"
myBarPrs->GetLabelColor( R, G, B );
myTextDlg->myLabelFont->SetData( QColor( (int)(R*255.), (int)(G*255.), (int)(B*255.) ),
myBarPrs->GetLblFontType(),
- myBarPrs->IsBoldLabel(),
- myBarPrs->IsItalicLabel(),
- myBarPrs->IsShadowLabel() );
+ myBarPrs->IsBoldLabel(),
+ myBarPrs->IsItalicLabel(),
+ myBarPrs->IsShadowLabel() );
}
//----------------------------------------------------------------------------
myBarPrs->SetShadowTitle( isTitleShadow );
myBarPrs->SetTitFontType( aTitleFontFamily );
myBarPrs->SetTitleColor( aTitColor.red()/255.,
- aTitColor.green()/255.,
- aTitColor.blue()/255. );
+ aTitColor.green()/255.,
+ aTitColor.blue()/255. );
// "Label"
QColor aLblColor( 255, 255, 255 );
myBarPrs->SetShadowLabel( isLabelShadow );
myBarPrs->SetLblFontType( aLabelFontFamily );
myBarPrs->SetLabelColor( aLblColor.red()/255.,
- aLblColor.green()/255.,
- aLblColor.blue()/255. );
+ aLblColor.green()/255.,
+ aLblColor.blue()/255. );
// myIsStoreTextProp = false;
}
return 1;
if ( RBIrange->isChecked() ) {
if (minVal >= maxVal) {
SUIT_MessageBox::warning( this,tr("WRN_VISU"),
- tr("MSG_MINMAX_VALUES") );
+ tr("MSG_MINMAX_VALUES") );
return false;
}
}
if ( CBLog->isChecked() ) {
if ( minVal <= 0.0 || maxVal <= 0.0) {
if ( RBIrange->isChecked() ) {
- SUIT_MessageBox::warning( this,
- tr("WRN_VISU"),
- tr("WRN_LOGARITHMIC_RANGE") );
+ SUIT_MessageBox::warning( this,
+ tr("WRN_VISU"),
+ tr("WRN_LOGARITHMIC_RANGE") );
} else {
- if ( minVal == 0)
- SUIT_MessageBox::warning( this,
- tr("WRN_VISU"),
- tr("WRN_LOGARITHMIC_RANGE") );
- else
- SUIT_MessageBox::warning( this,
- tr("WRN_VISU"),
- tr("WRN_LOGARITHMIC_FIELD_RANGE") );
- RBIrange->setChecked(true);
- changeRange(1);
+ if ( minVal == 0)
+ SUIT_MessageBox::warning( this,
+ tr("WRN_VISU"),
+ tr("WRN_LOGARITHMIC_RANGE") );
+ else
+ SUIT_MessageBox::warning( this,
+ tr("WRN_VISU"),
+ tr("WRN_LOGARITHMIC_FIELD_RANGE") );
+ RBIrange->setChecked(true);
+ changeRange(1);
}
return false;
}
platform = "application";
#endif
SUIT_MessageBox::warning( this, QObject::tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName) );
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName) );
}
}
}
ArrangeDlg::ArrangeDlg(QWidget* theParent,
- const SalomeApp_Module* theModule,
- SVTK_ViewWindow* theViewWindow)
+ const SalomeApp_Module* theModule,
+ SVTK_ViewWindow* theViewWindow)
: QDialog(theParent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
myAnimator(NULL),
myViewWindow(theViewWindow)
while(vtkActor* anActor = aCollection->GetNextActor()){
if (VISU_Actor* anVISUActor = dynamic_cast<VISU_Actor*>(anActor)) {
if(anVISUActor->GetVisibility() != 0){
- if (VISU::Prs3d_i* aPrs = anVISUActor->GetPrs3d()){
- if(!myPrsMap.contains(aPrs)){
- Handle(SALOME_InteractiveObject) anIO = aPrs->GetIO();
- if(!anIO->hasEntry())
- continue;
- SalomeApp_Study* aStudy = VISU::GetAppStudy(theModule);
- VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, anIO->getEntry());
- if(_PTR(SObject) aSObject = anObjectInfo.mySObject){
- _PTR(GenericAttribute) anAttr;
- if (aSObject->FindAttribute(anAttr, "AttributeName")) {
- _PTR(AttributeName) aName(anAttr);
- QString strIn(aName->Value().c_str());
- aPrsNames.append(strIn);
- myPrsMap[aPrs] = myOffsets.count();
- Offset aOffs;
- anVISUActor->GetPosition(aOffs.myOffset);
- myOffsets.append(aOffs);
- }
- }
- }
- }
+ if (VISU::Prs3d_i* aPrs = anVISUActor->GetPrs3d()){
+ if(!myPrsMap.contains(aPrs)){
+ Handle(SALOME_InteractiveObject) anIO = aPrs->GetIO();
+ if(!anIO->hasEntry())
+ continue;
+ SalomeApp_Study* aStudy = VISU::GetAppStudy(theModule);
+ VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, anIO->getEntry());
+ if(_PTR(SObject) aSObject = anObjectInfo.mySObject){
+ _PTR(GenericAttribute) anAttr;
+ if (aSObject->FindAttribute(anAttr, "AttributeName")) {
+ _PTR(AttributeName) aName(anAttr);
+ QString strIn(aName->Value().c_str());
+ aPrsNames.append(strIn);
+ myPrsMap[aPrs] = myOffsets.count();
+ Offset aOffs;
+ anVISUActor->GetPosition(aOffs.myOffset);
+ myOffsets.append(aOffs);
+ }
+ }
+ }
+ }
}
} else { //if PointMap3d Actor
if (VISU_ActorBase* anActorBase = dynamic_cast<VISU_ActorBase*>(anActor))
- if(anActorBase->GetVisibility() != 0)
- if (VISU::PointMap3d_i* aPrs = dynamic_cast<VISU::PointMap3d_i*>(anActorBase->GetFactory())) {
- if(!myPointMapPrsMap.contains(aPrs)){
- Handle(SALOME_InteractiveObject) anIO = aPrs->GetIO();
- if(!anIO->hasEntry())
- continue;
- SalomeApp_Study* aStudy = VISU::GetAppStudy(theModule);
- VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, anIO->getEntry());
- if(_PTR(SObject) aSObject = anObjectInfo.mySObject){
- _PTR(GenericAttribute) anAttr;
- if (aSObject->FindAttribute(anAttr, "AttributeName")) {
- _PTR(AttributeName) aName(anAttr);
- QString strIn(aName->Value().c_str());
- aPrsNames.append(strIn);
- myPointMapPrsMap[aPrs] = myOffsets.count();
- Offset aOffs;
- anActorBase->GetPosition(aOffs.myOffset);
- myOffsets.append(aOffs);
- }
- }
- }
- }
+ if(anActorBase->GetVisibility() != 0)
+ if (VISU::PointMap3d_i* aPrs = dynamic_cast<VISU::PointMap3d_i*>(anActorBase->GetFactory())) {
+ if(!myPointMapPrsMap.contains(aPrs)){
+ Handle(SALOME_InteractiveObject) anIO = aPrs->GetIO();
+ if(!anIO->hasEntry())
+ continue;
+ SalomeApp_Study* aStudy = VISU::GetAppStudy(theModule);
+ VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, anIO->getEntry());
+ if(_PTR(SObject) aSObject = anObjectInfo.mySObject){
+ _PTR(GenericAttribute) anAttr;
+ if (aSObject->FindAttribute(anAttr, "AttributeName")) {
+ _PTR(AttributeName) aName(anAttr);
+ QString strIn(aName->Value().c_str());
+ aPrsNames.append(strIn);
+ myPointMapPrsMap[aPrs] = myOffsets.count();
+ Offset aOffs;
+ anActorBase->GetPosition(aOffs.myOffset);
+ myOffsets.append(aOffs);
+ }
+ }
+ }
+ }
}
}
myFieldLst->addItems(aPrsNames);
myFieldLst = new QListWidget(aManualPane);
aHLay->addWidget( myFieldLst );
connect( myFieldLst, SIGNAL( currentRowChanged(int) ),
- this, SLOT( onFieldChange(int) ) );
+ this, SLOT( onFieldChange(int) ) );
QWidget* aCoordPane = new QWidget( aManualPane);
aHLay->addWidget( aCoordPane );
if (VISU_Actor* anActor = VISU::FindActor(myViewWindow, aPrs))
anActor->SetPosition(aOffs.myOffset);
if (mySaveChk)
- if (mySaveChk->isChecked())
- aPrs->SetOffset(aOffs.myOffset[0],aOffs.myOffset[1],aOffs.myOffset[2]);
+ if (mySaveChk->isChecked())
+ aPrs->SetOffset(aOffs.myOffset[0],aOffs.myOffset[1],aOffs.myOffset[2]);
}
QMap<VISU::PointMap3d_i*, int>::Iterator itt;
for (itt = myPointMapPrsMap.begin(); itt != myPointMapPrsMap.end(); ++itt) {
if (VISU_ActorBase* anActor = VISU::FindActorBase(myViewWindow, aPrs))
anActor->SetPosition(aOffs.myOffset);
if (mySaveChk)
- if (mySaveChk->isChecked())
- aPrs->SetOffset(aOffs.myOffset[0],aOffs.myOffset[1],aOffs.myOffset[2]);
+ if (mySaveChk->isChecked())
+ aPrs->SetOffset(aOffs.myOffset[0],aOffs.myOffset[1],aOffs.myOffset[2]);
}
} else {
vtkFloatingPointType aDist = 0;
for (it = myPrsMap.begin(); it != myPrsMap.end(); ++it, i++) {
VISU::Prs3d_i* aPrs = it.key();
if (VISU_Actor* aActor = VISU::FindActor(myViewWindow, aPrs)) {
- int aAxis = getAxis();
+ int aAxis = getAxis();
- vtkFloatingPointType aZeroOffset[3];
+ vtkFloatingPointType aZeroOffset[3];
aZeroOffset[0] = aZeroOffset[1] = aZeroOffset[2] = 0;
- aActor->SetPosition(aZeroOffset);
+ aActor->SetPosition(aZeroOffset);
aActor->GetMapper()->Update();
- vtkFloatingPointType aBounds[6];
- aActor->GetBounds(aBounds);
- switch (aAxis) {
- case XAxis:
- aDist = fabs(aBounds[1] - aBounds[0]);
- break;
- case YAxis:
- aDist = fabs(aBounds[3] - aBounds[2]);
- break;
- case ZAxis:
- aDist = fabs(aBounds[5] - aBounds[4]);
- }
- vtkFloatingPointType aOffset[3];
+ vtkFloatingPointType aBounds[6];
+ aActor->GetBounds(aBounds);
+ switch (aAxis) {
+ case XAxis:
+ aDist = fabs(aBounds[1] - aBounds[0]);
+ break;
+ case YAxis:
+ aDist = fabs(aBounds[3] - aBounds[2]);
+ break;
+ case ZAxis:
+ aDist = fabs(aBounds[5] - aBounds[4]);
+ }
+ vtkFloatingPointType aOffset[3];
aOffset[0] = aOffset[1] = aOffset[2] = 0;
aOffset[aAxis] =
(aBounds[2*aAxis+1] < aBounds[2*aAxis]) ? -aBounds[2*aAxis+1] : -aBounds[2*aAxis];
aShift = aPrevShift + aPrevDist/2.0 + aCCDist*getDistance() - aDist/2.0;
}
- aOffset[aAxis] += aShift;
- aActor->SetPosition(aOffset);
- if (mySaveChk)
- if (mySaveChk->isChecked())
- aPrs->SetOffset(aOffset[0],aOffset[1],aOffset[2]);
+ aOffset[aAxis] += aShift;
+ aActor->SetPosition(aOffset);
+ if (mySaveChk)
+ if (mySaveChk->isChecked())
+ aPrs->SetOffset(aOffset[0],aOffset[1],aOffset[2]);
- aPrevDist = aDist;
- aPrevShift = aShift;
+ aPrevDist = aDist;
+ aPrevShift = aShift;
}
} // end of myPrsMap loop
// Loop in PointMap3D the same as previous loop
for (itt = myPointMapPrsMap.begin(); itt != myPointMapPrsMap.end(); ++itt, i++) {
VISU::PointMap3d_i* aPrs = itt.key();
if (VISU_ActorBase* aActor = VISU::FindActorBase(myViewWindow, aPrs)) {
- int aAxis = getAxis();
+ int aAxis = getAxis();
- vtkFloatingPointType aZeroOffset[3];
- aZeroOffset[0] = aZeroOffset[1] = aZeroOffset[2] = 0;
- aActor->SetPosition(aZeroOffset);
+ vtkFloatingPointType aZeroOffset[3];
+ aZeroOffset[0] = aZeroOffset[1] = aZeroOffset[2] = 0;
+ aActor->SetPosition(aZeroOffset);
aActor->GetMapper()->Update();
- vtkFloatingPointType aBounds[6];
- aActor->GetBounds(aBounds);
- switch (aAxis) {
- case XAxis:
- aDist = fabs(aBounds[1] - aBounds[0]);
- break;
- case YAxis:
- aDist = fabs(aBounds[3] - aBounds[2]);
- break;
- case ZAxis:
- aDist = fabs(aBounds[5] - aBounds[4]);
- }
- vtkFloatingPointType aOffset[3];
+ vtkFloatingPointType aBounds[6];
+ aActor->GetBounds(aBounds);
+ switch (aAxis) {
+ case XAxis:
+ aDist = fabs(aBounds[1] - aBounds[0]);
+ break;
+ case YAxis:
+ aDist = fabs(aBounds[3] - aBounds[2]);
+ break;
+ case ZAxis:
+ aDist = fabs(aBounds[5] - aBounds[4]);
+ }
+ vtkFloatingPointType aOffset[3];
aOffset[0] = aOffset[1] = aOffset[2] = 0;
aOffset[aAxis] =
(aBounds[2*aAxis+1] < aBounds[2*aAxis]) ? -aBounds[2*aAxis+1] : -aBounds[2*aAxis];
aShift = aPrevShift + aPrevDist/2.0 + aCCDist*getDistance() - aDist/2.0;
}
- aOffset[aAxis] += aShift;
- aActor->SetPosition(aOffset);
- if (mySaveChk)
- if (mySaveChk->isChecked())
- aPrs->SetOffset(aOffset[0],aOffset[1],aOffset[2]);
+ aOffset[aAxis] += aShift;
+ aActor->SetPosition(aOffset);
+ if (mySaveChk)
+ if (mySaveChk->isChecked())
+ aPrs->SetOffset(aOffset[0],aOffset[1],aOffset[2]);
- aPrevDist = aDist;
- aPrevShift = aShift;
+ aPrevDist = aDist;
+ aPrevShift = aShift;
}
} // end of myPointMapPrsMap loop
}
//------------------------------------------------------------------------
SetupDlg::SetupDlg (QWidget* theParent,
- VisuGUI* theModule,
- VISU_TimeAnimation* theAnimator) :
+ VisuGUI* theModule,
+ VISU_TimeAnimation* theAnimator) :
QDialog(theParent,
- Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
+ Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
myAnimator(theAnimator),
myModule(theModule),
myIsRegenerate( false )
aStep = (aMaxTime - aMinTime) / (myAnimator->getFieldData(0).myNbTimes - 1);
else { // successive animation mode
std::pair<int,long> aLastFieldFrame(myAnimator->getNbFields() - 1,
- myAnimator->getFieldData(myAnimator->getNbFields() - 1).myNbTimes - 1);
+ myAnimator->getFieldData(myAnimator->getNbFields() - 1).myNbTimes - 1);
aStep = (aMaxTime - aMinTime) / myAnimator->getAbsoluteFrameNumber(aLastFieldFrame);
}
}
myMinVal->setText( QString::number( aMinTime ) );
// connect(myMinVal, SIGNAL( valueChanged(double)),
- // this, SLOT( onMinValue(double) ));
+ // this, SLOT( onMinValue(double) ));
connect( myMinVal, SIGNAL( returnPressed() ), this, SLOT( onMinValue() ) );
connect( myMinVal, SIGNAL( editingFinished() ), this, SLOT( onMinValue() ) );
// connect( myMinVal, SIGNAL( textChanged(const QString&)),
-// this, SLOT( onMinValueEdit(const QString&) ));
+// this, SLOT( onMinValueEdit(const QString&) ));
aRangeLayout->addWidget(myMinVal);
QLabel* aMaxLbl = new QLabel("To", myUseRangeBox);
myMaxVal->setText( QString::number( aMaxTime ) );
// connect(myMaxVal, SIGNAL( valueChanged(double)),
- // this, SLOT( onMaxValue(double) ));
+ // this, SLOT( onMaxValue(double) ));
connect( myMaxVal, SIGNAL( returnPressed() ), this, SLOT( onMaxValue() ) );
connect( myMaxVal, SIGNAL( editingFinished() ), this, SLOT( onMaxValue() ) );
// connect(myMaxVal, SIGNAL( textChanged(const QString&)),
-// this, SLOT( onMaxValueEdit(const QString&) ));
+// this, SLOT( onMaxValueEdit(const QString&) ));
aRangeLayout->addWidget(myMaxVal);
connect(myUseRangeBox, SIGNAL( toggled(bool)),
- this, SLOT( onRangeCheck(bool) ));
+ this, SLOT( onRangeCheck(bool) ));
aMainLayout->addWidget(myUseRangeBox);
myValues->setSelectionMode( QAbstractItemView::ExtendedSelection );
connect(myIndices, SIGNAL( textChanged(const QString&)),
- this, SLOT( onIndicesChanged(const QString&) ));
+ this, SLOT( onIndicesChanged(const QString&) ));
connect(myValues, SIGNAL( itemSelectionChanged() ),
- this, SLOT( onValuesChanged() ) );
+ this, SLOT( onValuesChanged() ) );
connect(myUseSequenceBox, SIGNAL( toggled(bool)),
- this, SLOT( onSequenceCheck(bool) ));
+ this, SLOT( onSequenceCheck(bool) ));
aUseSequenceLayout->addWidget( anIndicesLbl, 0, 0 );
aUseSequenceLayout->addWidget( myIndices, 0, 1 );
if ( myAnimator->getAnimationMode() == VISU::Animation::PARALLEL ) {
myFieldLst->setCurrentRow(0);
connect( myFieldLst, SIGNAL( currentRowChanged(int) ),
- this, SLOT( onFieldChange(int) ) );
+ this, SLOT( onFieldChange(int) ) );
}
else if ( myAnimator->getAnimationMode() == VISU::Animation::SUCCESSIVE )
myFieldLst->setSelectionMode(QAbstractItemView::NoSelection);
myTypeCombo = new QComboBox(aPropBox);
aPropVBLay->addWidget( myTypeCombo );
connect( myTypeCombo, SIGNAL( activated(int) ),
- this, SLOT( onTypeChanged(int) ) );
+ this, SLOT( onTypeChanged(int) ) );
// QPushButton* aBarBtn = new QPushButton("Scalar Bar...", aPropBox);
//connect( aBarBtn, SIGNAL( clicked() ),
- // this, SLOT( onScalarBarDlg() ) );
+ // this, SLOT( onScalarBarDlg() ) );
myPropBtn = new QPushButton("Properties...", aPropBox);
myPropBtn->setAutoDefault( false );
aPropVBLay->addWidget( myPropBtn );
// myPropBtn->setEnabled(myAnimator->getFieldData(0).myPrsType != VISU::TSCALARMAP);
connect( myPropBtn, SIGNAL( clicked() ),
- this, SLOT( onPreferencesDlg() ) );
+ this, SLOT( onPreferencesDlg() ) );
if (myAnimator->getNbFields() > 1 ) {
if( myAnimator->getAnimationMode() == VISU::Animation::PARALLEL ) {
template<class TPrs3d, class TDialog>
void
EditPrs(VisuGUI* theModule,
- FieldData& theData,
- VISU_TimeAnimation* theAnimator)
+ FieldData& theData,
+ VISU_TimeAnimation* theAnimator)
{
TDialog* aDlg = new TDialog(theModule);
TPrs3d* aPrs3d = dynamic_cast<TPrs3d*>(theData.myPrs[0]);
if (aDlg->exec() && aDlg->storeToPrsObject(dynamic_cast<TPrs3d*>(aPrs3d))) {
for (long aFrameId = 1; aFrameId < theData.myNbFrames; aFrameId++){
- VISU::ColoredPrs3d_i* aColoredPrs3d = theData.myPrs[aFrameId];
- aColoredPrs3d->SameAs(aPrs3d);
+ VISU::ColoredPrs3d_i* aColoredPrs3d = theData.myPrs[aFrameId];
+ aColoredPrs3d->SameAs(aPrs3d);
}
if ( theAnimator->getAnimationMode() == VISU::Animation::SUCCESSIVE ) {
- for (int aFieldId = 1; aFieldId < theAnimator->getNbFields(); aFieldId++) {
- FieldData& aFieldData = theAnimator->getFieldData(aFieldId);
- for (long aFrameId = 0; aFrameId < aFieldData.myNbFrames; aFrameId++) {
- VISU::ColoredPrs3d_i* aColoredPrs3d = aFieldData.myPrs[aFrameId];
- std::string aTitle = aColoredPrs3d->GetCTitle();
- aColoredPrs3d->SameAs(aPrs3d);
- aColoredPrs3d->SetTitle(aTitle.c_str());
- }
- }
+ for (int aFieldId = 1; aFieldId < theAnimator->getNbFields(); aFieldId++) {
+ FieldData& aFieldData = theAnimator->getFieldData(aFieldId);
+ for (long aFrameId = 0; aFrameId < aFieldData.myNbFrames; aFrameId++) {
+ VISU::ColoredPrs3d_i* aColoredPrs3d = aFieldData.myPrs[aFrameId];
+ std::string aTitle = aColoredPrs3d->GetCTitle();
+ aColoredPrs3d->SameAs(aPrs3d);
+ aColoredPrs3d->SetTitle(aTitle.c_str());
+ }
+ }
}
}
delete aDlg;
if ( myAnimator->getAnimationMode() == VISU::Animation::SUCCESSIVE ) {
for (int i = 0; i < myAnimator->getNbFields(); i++) {
if ( i != aRefFieldId && myAnimator->getFieldData(i).myPrs.empty() )
- myAnimator->generatePresentations(i);
+ myAnimator->generatePresentations(i);
}
}
if( aPrevSelected )
{
if( aNextSelected )
- aString = "";
+ aString = "";
else
- aString += ",";
+ aString += ",";
}
else
{
if( aNextSelected )
- aString += "-";
+ aString += "-";
else
- aString += ",";
+ aString += ",";
}
anIndices += aString;
//------------------------------------------------------------------------
static const char * firstIco[] = {
"18 10 2 1",
-" g None",
-". g #000000",
+" g None",
+". g #000000",
" . . ",
" .. .. .. ",
" .. ... ... ",
static const char * lastIco[] = {
"18 10 2 1",
-" g None",
-". g #000000",
+" g None",
+". g #000000",
" . . ",
" .. .. .. ",
" ... ... .. ",
static const char * leftIco[] = {
"11 10 2 1",
-" g None",
-". g #000000",
+" g None",
+". g #000000",
" . .",
" .. ..",
" ... ...",
static const char * playIco[] = {
"14 14 2 1",
-" g None",
-". g #000000",
+" g None",
+". g #000000",
" ",
" ",
" .. ",
static const char * rightIco[] = {
"11 10 2 1",
-" g None",
-". g #000000",
+" g None",
+". g #000000",
". . ",
".. .. ",
"... ... ",
static const char * pauseIco[] = {
"14 14 2 1",
-" g None",
-". g #000000",
+" g None",
+". g #000000",
" ",
" ",
" .. .. ",
VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule,
- _PTR(Study) theStudy,
- VISU::Animation::AnimationMode theMode) :
+ _PTR(Study) theStudy,
+ VISU::Animation::AnimationMode theMode) :
QDialog(VISU::GetDesktop(theModule),
- Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
+ Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
myModule(theModule),
mySetupDlg(NULL)
{
myAnimator = new VISU_TimeAnimation (theStudy);
myAnimator->setViewer(VISU::GetActiveViewWindow<SVTK_ViewWindow>(theModule));
connect(myAnimator, SIGNAL(frameChanged(long, double)), this, SLOT(onExecution(long, double)));
- connect(myAnimator, SIGNAL(stopped()), this, SLOT(onStop()));
+ connect(myAnimator, SIGNAL(stopped()), this, SLOT(onStop()));
myAnimator->setAnimationMode(theMode);
QVBoxLayout* aMainLayout = new QVBoxLayout(this);
mySetupBtn = new QPushButton("Setup Animation...", this);
connect( mySetupBtn, SIGNAL( clicked() ),
- this, SLOT( onSetupDlg() ) );
+ this, SLOT( onSetupDlg() ) );
aMainLayout->addWidget(mySetupBtn);
myGenBtn = new QPushButton("Generate frames", this);
connect( myGenBtn, SIGNAL( clicked() ),
- this, SLOT( createFrames() ) );
+ this, SLOT( createFrames() ) );
aMainLayout->addWidget(myGenBtn);
myPlayFrame = new QFrame(this);
//mySlider->setTickmarks(QSlider::Below);
mySlider->setTracking(false);
connect( mySlider, SIGNAL( sliderMoved(int) ),
- this, SLOT( onWindowChanged(int) ) );
+ this, SLOT( onWindowChanged(int) ) );
TopLayout->addWidget(mySlider, 1, 0, 1, 3);
myPlayBtn = new QPushButton(myPlayFrame);
myPlayBtn->setIcon(MYplayPixmap);
myPlayBtn->setCheckable(true);
connect( myPlayBtn, SIGNAL( clicked() ),
- this, SLOT( onPlayPressed() ) );
+ this, SLOT( onPlayPressed() ) );
TopLayout->addWidget(myPlayBtn, 2, 0, 1, 2);
QPushButton* aBackBtn = new QPushButton(myPlayFrame);
aBackBtn->setIcon(QPixmap(leftIco));
connect( aBackBtn, SIGNAL( clicked() ),
- this, SLOT( onBackPressed() ) );
+ this, SLOT( onBackPressed() ) );
TopLayout->addWidget(aBackBtn, 3, 0);
QPushButton* aForvardBtn = new QPushButton(myPlayFrame);
aForvardBtn->setIcon(QPixmap(rightIco));
connect( aForvardBtn, SIGNAL( clicked() ),
- this, SLOT( onForvardPressed() ) );
+ this, SLOT( onForvardPressed() ) );
TopLayout->addWidget(aForvardBtn, 3, 1);
QPushButton* aFirstBtn = new QPushButton(myPlayFrame);
aFirstBtn->setIcon(QPixmap(firstIco));
connect( aFirstBtn, SIGNAL( clicked() ),
- this, SLOT( onFirstPressed() ) );
+ this, SLOT( onFirstPressed() ) );
TopLayout->addWidget(aFirstBtn, 4, 0);
QPushButton* aLastBtn = new QPushButton(myPlayFrame);
aLastBtn->setIcon(QPixmap(lastIco));
connect( aLastBtn, SIGNAL( clicked() ),
- this, SLOT( onLastPressed() ) );
+ this, SLOT( onLastPressed() ) );
TopLayout->addWidget(aLastBtn, 4, 1);
QLabel* aSpeedLbl = new QLabel("Speed", myPlayFrame);
aWheel->setRange(1, 99, 1);
aWheel->setValue((int)myAnimator->getSpeed());
connect( aWheel, SIGNAL(valueChanged(double)),
- aSpeedNum, SLOT(display(double)) );
+ aSpeedNum, SLOT(display(double)) );
connect( aWheel, SIGNAL(valueChanged(double)),
- this, SLOT(onSpeedChange(double)) );
+ this, SLOT(onSpeedChange(double)) );
TopLayout->addWidget(aWheel, 1, 3, 3, 1, Qt::AlignRight);
QCheckBox* aCycleCheck = new QCheckBox("Cycled animation",myPlayFrame);
connect(mySaveCheck, SIGNAL( toggled(bool)),
myPicsFormat, SLOT( setEnabled(bool) ));
connect(myPicsFormat, SIGNAL( activated (int)),
- this, SLOT( onPicsFormatChanged()));
+ this, SLOT( onPicsFormatChanged()));
QLabel* aPathLbl = new QLabel("Path:", aSaveBox);
aPathLbl->setEnabled(false);
QPushButton* aBrowseBtn = new QPushButton("Browse...", aSaveBox);
aBrowseBtn->setEnabled(false);
connect(mySaveCheck, SIGNAL( toggled(bool)),
- aBrowseBtn, SLOT( setEnabled(bool) ));
+ aBrowseBtn, SLOT( setEnabled(bool) ));
connect(aBrowseBtn, SIGNAL( clicked()),
- this, SLOT( onBrowse() ));
+ this, SLOT( onBrowse() ));
mySaveCheck->setChecked(false);
aSaveLay->addWidget(aBrowseBtn, 2, 2);
//connect(mySaveAVICheck, SIGNAL( toggled(bool)),
// myBrowseAVIBtn, SLOT( setEnabled(bool) ));
connect(myBrowseAVIBtn, SIGNAL( clicked()),
- this, SLOT( onBrowseAVI() ));
+ this, SLOT( onBrowseAVI() ));
aSaveLay->addWidget(myBrowseAVIBtn, 4, 2);
mySaveAVICheck->setChecked(false);
/*
VISU::ColoredPrs3d_i* aPrs3d = dynamic_cast<VISU::ColoredPrs3d_i*>(aFieldData.myPrs[0]);
if( !aPrs3d )
- continue;
+ continue;
myAnimator->generatePresentations(i);
aFieldData = myAnimator->getFieldData(i);
for (long aFrameId = 0; aFrameId < aFieldData.myNbFrames; aFrameId++) {
- VISU::ColoredPrs3d_i* aColoredPrs3d = aFieldData.myPrs[aFrameId];
- std::string aTitle = aColoredPrs3d->GetCTitle();
- aColoredPrs3d->SameAs(aPrs3d);
- if ( aFrameId != 0 && myAnimator->getAnimationMode() == VISU::Animation::SUCCESSIVE ) {
- aColoredPrs3d->SetTitle(aTitle.c_str());
- }
+ VISU::ColoredPrs3d_i* aColoredPrs3d = aFieldData.myPrs[aFrameId];
+ std::string aTitle = aColoredPrs3d->GetCTitle();
+ aColoredPrs3d->SameAs(aPrs3d);
+ if ( aFrameId != 0 && myAnimator->getAnimationMode() == VISU::Animation::SUCCESSIVE ) {
+ aColoredPrs3d->SetTitle(aTitle.c_str());
+ }
}
*/
}
onPicsFormatChanged();
onPathChanged();
if (mySaveAVICheck->isChecked())
- mySaveAVICheck->setChecked(false);
+ mySaveAVICheck->setChecked(false);
} else {
myAnimator->dumpTo("");
}
if (app)
app->onHelpContextModule(myModule ? app->moduleName(myModule->moduleName()) : QString(""), aHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName),
- QObject::tr("BUT_OK"));
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
}
}
enum { XAxis, YAxis, ZAxis };
ArrangeDlg(QWidget* theParent,
- VISU_TimeAnimation* theAnimator);
+ VISU_TimeAnimation* theAnimator);
ArrangeDlg(QWidget* theParent,
- const SalomeApp_Module* theModule,
- SVTK_ViewWindow* theViewWindow);
+ const SalomeApp_Module* theModule,
+ SVTK_ViewWindow* theViewWindow);
~ArrangeDlg() {};
public:
SetupDlg( QWidget* theParent, VisuGUI* theModule,
- VISU_TimeAnimation* theAnimator );
+ VISU_TimeAnimation* theAnimator );
~SetupDlg() {};
public:
Q_OBJECT
public:
VisuGUI_TimeAnimationDlg(VisuGUI* theModule,
- _PTR(Study) theStudy,
- VISU::Animation::AnimationMode theMode = VISU::Animation::PARALLEL);
+ _PTR(Study) theStudy,
+ VISU::Animation::AnimationMode theMode = VISU::Animation::PARALLEL);
~VisuGUI_TimeAnimationDlg();
bool addField(_PTR(SObject) theField);
SYSTEMTIME st;
GetSystemTime(&st);
SystemTimeToFileTime(&st, RefToInitialTMS);
- time(RefToCurrentTimeB);
+ time(RefToCurrentTimeB);
#endif
}
}
GetSystemTime(&st);
SystemTimeToFileTime(&st, RefToCurrentTMS);
Cumul_user += (int)(((ULARGE_INTEGER*)(RefToCurrentTMS))->QuadPart - ((ULARGE_INTEGER*)(RefToInitialTMS))->QuadPart) / 10000000;
- Cumul_sys = Cumul_user;
- time(RefToCurrentTimeB);
+ Cumul_sys = Cumul_user;
+ time(RefToCurrentTimeB);
#endif
Stopped = 1;
}
//------------------------------------------------------------
bool
CheckLock( _PTR(Study) theStudy,
- QWidget* theWidget )
+ QWidget* theWidget )
{
if(IsStudyLocked(theStudy)){
SUIT_MessageBox::warning(theWidget,
QObject::tr("WRN_VISU_WARNING"),
QObject::tr("WRN_STUDY_LOCKED") );
- return true;
+ return true;
}
return false;
}
//------------------------------------------------------------
LightApp_DataObject*
FindDataObject(SUIT_DataObject* theDataObject,
- const QString& theEntry,
- int theLevel)
+ const QString& theEntry,
+ int theLevel)
{
int aLevel = theDataObject->level() + 2;
QString aSourceEntry = theEntry.section(':',0,aLevel);
DataObjectList::Iterator aDataObjectIter = aList.begin();
while( aDataObjectIter!= aList.end() ) {
if(LightApp_DataObject* aChildDataObject = dynamic_cast<LightApp_DataObject*>(*aDataObjectIter)){
- QString anEntry = aChildDataObject->entry();
- QString aCurrentEntry = anEntry.section(':',0,aLevel);
- if(aSourceEntry == aCurrentEntry){
- if(theLevel == aLevel){
- return aChildDataObject;
- }else{
- return FindDataObject(aChildDataObject,theEntry,theLevel);
- }
- }
+ QString anEntry = aChildDataObject->entry();
+ QString aCurrentEntry = anEntry.section(':',0,aLevel);
+ if(aSourceEntry == aCurrentEntry){
+ if(theLevel == aLevel){
+ return aChildDataObject;
+ }else{
+ return FindDataObject(aChildDataObject,theEntry,theLevel);
+ }
+ }
}
aDataObjectIter++;
}
//------------------------------------------------------------
LightApp_DataObject*
FindDataObject(CAM_Module* theModule,
- _PTR(SObject) theSObject)
+ _PTR(SObject) theSObject)
{
CAM_DataModel* aDataModel = theModule->dataModel();
CAM_DataObject* aRootDataObject = aDataModel->root();
//------------------------------------------------------------
void
UpdateObjBrowser(SalomeApp_Module* theModule,
- bool theIsUpdateDataModel,
- _PTR(SObject) theSObject)
+ bool theIsUpdateDataModel,
+ _PTR(SObject) theSObject)
{
LightApp_DataObject* aDataObject = NULL;
if(theSObject)
if ( theSObject ) {
_PTR(GenericAttribute) anAttr;
if (theSObject->FindAttribute( anAttr, "AttributeTableOfInteger" ))
- return true;
+ return true;
if (theSObject->FindAttribute( anAttr, "AttributeTableOfReal" ))
- return true;
+ return true;
}
return false;
}
Engines::Component_var aComponent = aLCC.FindOrLoad_Component("FactoryServer","VISU");
VISU_Gen_var aVISU = VISU_Gen::_narrow(aComponent);
if(!CORBA::is_nil(aVISU))
- aGen = VISU_Gen_i::GetVisuGenImpl();
+ aGen = VISU_Gen_i::GetVisuGenImpl();
}
if(aGen)
SALOME_ListIteratorOfListIO anIter(aListIO);
while(anIter.More())
{
- Handle(SALOME_InteractiveObject) anIO = anIter.Value();
- if(anIO->hasEntry())
- {
- TObjectInfo anObjectInfo = GetObjectByEntry(aStudy, anIO->getEntry());
- if(anObjectInfo.mySObject){
- TSelectionItem aSelectionItem;
- aSelectionItem.myObjectInfo = anObjectInfo;
- aSelectionItem.myIO = anIO;
- aSelectionInfo.push_back(aSelectionItem);
- }
- }
- anIter.Next(); // MULTIPR fixed
+ Handle(SALOME_InteractiveObject) anIO = anIter.Value();
+ if(anIO->hasEntry())
+ {
+ TObjectInfo anObjectInfo = GetObjectByEntry(aStudy, anIO->getEntry());
+ if(anObjectInfo.mySObject){
+ TSelectionItem aSelectionItem;
+ aSelectionItem.myObjectInfo = anObjectInfo;
+ aSelectionItem.myIO = anIO;
+ aSelectionInfo.push_back(aSelectionItem);
+ }
+ }
+ anIter.Next(); // MULTIPR fixed
}
}
return aSelectionInfo;
//----------------------------------------------------------------------------
TObjectInfo
GetObjectByEntry(const SalomeApp_Study* theStudy,
- const std::string& theEntry)
+ const std::string& theEntry)
{
TObjectInfo anObjectInfo;
if(!theStudy || theEntry == "")
anObjectInfo.mySObject = aSObject;
CORBA::Object_var anObject = ClientSObjectToObject(aSObject);
if(VISU::Base_i* aBase = GetServantInterface<VISU::Base_i>(anObject))
- anObjectInfo.myBase = aBase;
+ anObjectInfo.myBase = aBase;
}
return anObjectInfo;
//----------------------------------------------------------------------------
VISU::Prs3d_i*
GetPrs3dToModify(const SalomeApp_Module* theModule,
- Base_i* theBase)
+ Base_i* theBase)
{
if (CheckLock(GetCStudy(GetAppStudy(theModule)), GetDesktop(theModule)))
return NULL;
//----------------------------------------------------------------------------
bool
GetPrs3dSelectionInfo(const SalomeApp_Module* theModule,
- VISU::Prs3d_i*& thePrs3d,
- SVTK_ViewWindow*& theViewWindow,
- VISU_Actor*& thenActor)
+ VISU::Prs3d_i*& thePrs3d,
+ SVTK_ViewWindow*& theViewWindow,
+ VISU_Actor*& thenActor)
{
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(theModule);
if(aSelectionInfo.empty())
//------------------------------------------------------------
void
Remove(LightApp_SelectionMgr* theSelectionMgr,
- const Handle(SALOME_InteractiveObject)& theIO)
+ const Handle(SALOME_InteractiveObject)& theIO)
{
if (theIO.IsNull()) return;
SALOME_ListIO aListIO, aNewListIO;
for (; anIter.More(); anIter.Next()) {
Handle(SALOME_InteractiveObject) anIO = anIter.Value();
if (!anIO->isSame(theIO)) {
- aNewListIO.Append(theIO);
+ aNewListIO.Append(theIO);
}
}
theSelectionMgr->setSelectedObjects(aNewListIO);
_PTR(GenericAttribute) anAttr;
_PTR(AttributeString) aComment;
- _PTR(SObject) aRefSObject;
- if (aSObject->ReferencedObject(aRefSObject)) {
- // It can be a reference on curve, published under a container. IPAL 20317
- VISU::TObjectInfo aRefObjectInfo = GetObjectByEntry(GetAppStudy(theModule), aRefSObject->GetID());
- VISU::Base_i* aRefBase = aRefObjectInfo.myBase;
- if( (aRefBase && aRefBase->GetType() == VISU::TCURVE) || (aRefBase && aRefBase->GetType() == VISU::TMESH) )
- return true;
- }
+ _PTR(SObject) aRefSObject;
+ if (aSObject->ReferencedObject(aRefSObject)) {
+ // It can be a reference on curve, published under a container. IPAL 20317
+ VISU::TObjectInfo aRefObjectInfo = GetObjectByEntry(GetAppStudy(theModule), aRefSObject->GetID());
+ VISU::Base_i* aRefBase = aRefObjectInfo.myBase;
+ if( (aRefBase && aRefBase->GetType() == VISU::TCURVE) || (aRefBase && aRefBase->GetType() == VISU::TMESH) )
+ return true;
+ }
bool isUnderVISU = false;
_PTR(SObject) aFatherSObject = aSObject->GetFather();
//------------------------------------------------------------
void
DeleteSObject(VisuGUI* theModule,
- _PTR(Study) theStudy,
- _PTR(SObject) theSObject)
+ _PTR(Study) theStudy,
+ _PTR(SObject) theSObject)
{
_PTR(ChildIterator) aChildIter = theStudy->NewChildIterator(theSObject);
for (aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next()) {
if(VISU::ColoredPrs3d_i* aColoredPrs3d = dynamic_cast<VISU::ColoredPrs3d_i*>(thePrs)){
std::string anEntry = aColoredPrs3d->GetHolderEntry();
if(anEntry != ""){
- VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(theModule), anEntry);
- if(VISU::Base_i* aBase = anObjectInfo.myBase){
- if(aBase->GetType() == VISU::TCOLOREDPRS3DHOLDER){
- CORBA::Object_var anObject = aBase->_this();
- VISU::RemovableObject_var aRemovableObject = VISU::RemovableObject::_narrow(anObject);
- aRemovableObject->RemoveFromStudy();
- return;
- }
- }
+ VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(theModule), anEntry);
+ if(VISU::Base_i* aBase = anObjectInfo.myBase){
+ if(aBase->GetType() == VISU::TCOLOREDPRS3DHOLDER){
+ CORBA::Object_var anObject = aBase->_this();
+ VISU::RemovableObject_var aRemovableObject = VISU::RemovableObject::_narrow(anObject);
+ aRemovableObject->RemoveFromStudy();
+ return;
+ }
+ }
}
}
if(!aPrs3d) {
aTable = dynamic_cast<VISU::PointMap3d_i*>(aSelectionItem.myObjectInfo.myBase);
if(!aTable)
- return;
+ return;
}
SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
if (aPrs3d) {
anActor = FindActor(aViewWindow, aPrs3d);
if(!anActor)
- return;
+ return;
} else {
anActorBase = VISU::FindActorBase(aViewWindow, aTable);
if(!anActorBase)
- return;
+ return;
}
switch (theType) {
case VISU::SHRINK:
if (aPrs3d) {
- bool toShrink;
- if (anActor->IsShrunk()) {
- anActor->UnShrink();
- toShrink = false;
- }
- else {
- anActor->SetShrink();
- toShrink = true;
- }
- if (VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d)) {
- aMesh->SetShrink(toShrink);
- }
+ bool toShrink;
+ if (anActor->IsShrunk()) {
+ anActor->UnShrink();
+ toShrink = false;
+ }
+ else {
+ anActor->SetShrink();
+ toShrink = true;
+ }
+ if (VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d)) {
+ aMesh->SetShrink(toShrink);
+ }
} else if (aTable) {
- if (anActorBase->IsShrunk())
- anActorBase->UnShrink();
- else
- anActorBase->SetShrink();
+ if (anActorBase->IsShrunk())
+ anActorBase->UnShrink();
+ else
+ anActorBase->SetShrink();
}
break;
default:
if (aPrs3d) {
- if (VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d)) {
- aMesh->SetPresentationType(theType);
- RecreateActor(theModule, aMesh);
- } else {
- anActor->SetRepresentation(theType);
- }
+ if (VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d)) {
+ aMesh->SetPresentationType(theType);
+ RecreateActor(theModule, aMesh);
+ } else {
+ anActor->SetRepresentation(theType);
+ }
}
else if (aTable) {
- anActorBase->SetRepresentation(theType);
+ anActorBase->SetRepresentation(theType);
}
}
aViewWindow->Repaint();
//------------------------------------------------------------
void
SetShading ( const SalomeApp_Module* theModule,
- bool theOn )
+ bool theOn )
{
TSelectionInfo aSelectionInfo = GetSelectedObjects(theModule);
if(aSelectionInfo.empty())
CheckTimeStamp(const SalomeApp_Module* theModule,
_PTR(SObject)& theSObject,
Handle(SALOME_InteractiveObject)& theIO,
- ColoredPrs3d_i::EPublishInStudyMode& thePublishInStudyMode)
+ ColoredPrs3d_i::EPublishInStudyMode& thePublishInStudyMode)
{
TSelectionInfo aSelectionInfo = GetSelectedObjects(theModule);
if(!aSelectionInfo.empty()){
theSObject = aSelectionItem.myObjectInfo.mySObject;
VISU::VISUType aType = VISU::Storable::SObject2Type(theSObject);
if (VISU::TTIMESTAMP == aType){
- thePublishInStudyMode = ColoredPrs3d_i::EPublishUnderTimeStamp;
+ thePublishInStudyMode = ColoredPrs3d_i::EPublishUnderTimeStamp;
return true;
}
if (VISU::TFIELD == aType){
- thePublishInStudyMode = ColoredPrs3d_i::EPublishIndependently;
- if(theSObject->FindSubObject(2,theSObject))
- return true;
+ thePublishInStudyMode = ColoredPrs3d_i::EPublishIndependently;
+ if(theSObject->FindSubObject(2,theSObject))
+ return true;
}
}
SUIT_MessageBox::warning(GetDesktop(theModule),
//------------------------------------------------------------
VISU_Actor*
FindActor(const SalomeApp_Study* theStudy,
- SVTK_ViewWindow* theViewWindow,
- const QString& theEntry)
+ SVTK_ViewWindow* theViewWindow,
+ const QString& theEntry)
{
TObjectInfo anObjectInfo = GetObjectByEntry(theStudy, theEntry.toLatin1().data());
VISU::Prs3d_i* aPrs3d = GetPrs3dFromBase(anObjectInfo.myBase);
//------------------------------------------------------------
VISU_ActorBase*
FindActorBase(const SalomeApp_Study* theStudy,
- SVTK_ViewWindow* theViewWindow,
- const QString& theEntry)
+ SVTK_ViewWindow* theViewWindow,
+ const QString& theEntry)
{
TObjectInfo anObjectInfo = GetObjectByEntry(theStudy, theEntry.toLatin1().constData());
VISU::PointMap3d_i* aTable = dynamic_cast<VISU::PointMap3d_i*>(anObjectInfo.myBase);
QApplication::setOverrideCursor(Qt::WaitCursor);
/* SALOMEDS::SObject_var aSObject = thePrs->GetSObject();
- CORBA::String_var anEntry = aSObject->GetID();*/
+ CORBA::String_var anEntry = aSObject->GetID();*/
try {
thePrs->UpdateActors();
//------------------------------------------------------------
bool
ComputeVisiblePropBounds(SVTK_ViewWindow* theViewWindow,
- vtkFloatingPointType allBounds[6],
- const char* theActorClassName)
+ vtkFloatingPointType allBounds[6],
+ const char* theActorClassName)
{
vtkRenderer *aRen = theViewWindow->getRenderer();
VTK::ActorCollectionCopy aCopy(aRen->GetActors());
bounds[2] > -VTK_LARGE_FLOAT && bounds[3] < VTK_LARGE_FLOAT &&
bounds[4] > -VTK_LARGE_FLOAT && bounds[5] < VTK_LARGE_FLOAT)
{
- somethingVisible = true;
- if (bounds[0] < allBounds[0]) allBounds[0] = bounds[0];
- if (bounds[1] > allBounds[1]) allBounds[1] = bounds[1];
- if (bounds[2] < allBounds[2]) allBounds[2] = bounds[2];
- if (bounds[3] > allBounds[3]) allBounds[3] = bounds[3];
- if (bounds[4] < allBounds[4]) allBounds[4] = bounds[4];
- if (bounds[5] > allBounds[5]) allBounds[5] = bounds[5];
+ somethingVisible = true;
+ if (bounds[0] < allBounds[0]) allBounds[0] = bounds[0];
+ if (bounds[1] > allBounds[1]) allBounds[1] = bounds[1];
+ if (bounds[2] < allBounds[2]) allBounds[2] = bounds[2];
+ if (bounds[3] > allBounds[3]) allBounds[3] = bounds[3];
+ if (bounds[4] < allBounds[4]) allBounds[4] = bounds[4];
+ if (bounds[5] > allBounds[5]) allBounds[5] = bounds[5];
}//not bogus
}
}
//------------------------------------------------------------
void
PlotRemoveCurve(const SalomeApp_Module* theModule,
- VISU::Curve_i* pCrv)
+ VISU::Curve_i* pCrv)
{
// implementation moved to VISU_I package (see VISU_Tools.h)
VISU::PlotRemoveCurve( theModule->getApp(), pCrv );
// Others
VISU::Mesh_i*
CreateMesh(VisuGUI* theModule,
- const Handle(SALOME_InteractiveObject)& theIO,
- SVTK_ViewWindow* theViewWindow)
+ const Handle(SALOME_InteractiveObject)& theIO,
+ SVTK_ViewWindow* theViewWindow)
{
- _PTR(Study) aStudy = GetCStudy(GetAppStudy(theModule));
+ _PTR(Study) aStudy = GetCStudy(GetAppStudy(theModule));
//if (CheckLock(aStudy))
// return;
timer.Start();
#endif
if(GetResourceMgr()->booleanValue("VISU","display_only",false)){
- const VisuGUI* av = dynamic_cast<const VisuGUI*>(theModule);
- if(av)(const_cast<VisuGUI*>(av))->OnEraseAll();
- }
+ const VisuGUI* av = dynamic_cast<const VisuGUI*>(theModule);
+ if(av)(const_cast<VisuGUI*>(av))->OnEraseAll();
+ }
PublishMeshInView(theModule, pPresent, theViewWindow);
if(GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)){
- SetFitAll(theViewWindow);
- }
+ SetFitAll(theViewWindow);
+ }
#ifdef CHECKTIME
timer.Stop();
MESSAGE("VisuGUI::CreateMesh() - DISPLAY MESH");
if (aViewToPrsIter != aMap.end()) {
TSetPrs3d::const_iterator aPrsIter = (aViewToPrsIter->second).begin();
for (; aPrsIter != (aViewToPrsIter->second).end(); aPrsIter++) {
- aIndexes.insert((*aPrsIter).second);
+ aIndexes.insert((*aPrsIter).second);
}
}
std::set<int>::const_iterator aIter = aIndexes.begin();
TSetPrs3d::iterator aIter = aMap[theViewWindow].begin();
for (; aIter != aMap[theViewWindow].end(); aIter++)
if ((*aIter).first == thePrs3d) {
- aMap[theViewWindow].erase(*aIter);
- return;
+ aMap[theViewWindow].erase(*aIter);
+ return;
}
}
//------------------------------------------------------------
void initSpinBox( QSpinBox* spinBox,
- int min, int max, int step )
+ int min, int max, int step )
{
spinBox->setRange( min, max );
spinBox->setSingleStep( step );
}
//------------------------------------------------------------
void initSpinBox( QDoubleSpinBox* spinBox,
- double min, double max,
- double step, int decimals )
+ double min, double max,
+ double step, int decimals )
{
spinBox->setRange( min, max );
spinBox->setSingleStep( step );
bool IsStudyLocked( _PTR(Study) theStudy );
bool CheckLock( _PTR(Study) theStudy,
- QWidget* theWidget );
+ QWidget* theWidget );
//----------------------------------------------------------------------------
int runAndWait( QDialog* dlg, const bool modal );
void UpdateObjBrowser(SalomeApp_Module* theModule,
- bool theIsUpdateDataModel = true,
- _PTR(SObject) theSObject = _PTR(SObject)());
+ bool theIsUpdateDataModel = true,
+ _PTR(SObject) theSObject = _PTR(SObject)());
//----------------------------------------------------------------------------
VISU_Gen_i* GetVisuGen(const CAM_Module* theModule);
TSelectionInfo GetSelectedObjects(const SalomeApp_Module* theModule);
TObjectInfo GetObjectByEntry(const SalomeApp_Study* theStudy,
- const std::string& theEntry);
+ const std::string& theEntry);
VISU::Prs3d_i* GetPrs3dToModify(const SalomeApp_Module* theModule,
- Base_i* theBase);
+ Base_i* theBase);
VISU::Prs3d_i* GetPrs3dFromBase(Base_i* theBase);
bool GetPrs3dSelectionInfo( const SalomeApp_Module* theModule,
- VISU::Prs3d_i*& thePrs3d,
- SVTK_ViewWindow*& theViewWindow,
- VISU_Actor*& thenActor );
+ VISU::Prs3d_i*& thePrs3d,
+ SVTK_ViewWindow*& theViewWindow,
+ VISU_Actor*& thenActor );
//----------------------------------------------------------------------------
void Add(LightApp_SelectionMgr* theSelectionMgr,
- const Handle(SALOME_InteractiveObject)& theIO);
+ const Handle(SALOME_InteractiveObject)& theIO);
void Remove(LightApp_SelectionMgr* theSelectionMgr,
- const Handle(SALOME_InteractiveObject)& theIO);
+ const Handle(SALOME_InteractiveObject)& theIO);
bool IsRemovable (const std::string theEntry,
- const SalomeApp_Module* theModule);
+ const SalomeApp_Module* theModule);
bool IsRemovableSelected(const SalomeApp_Module* theModule);
void DeleteSObject(VisuGUI* theModule,
- _PTR(Study) theStudy,
- _PTR(SObject) theSObject);
+ _PTR(Study) theStudy,
+ _PTR(SObject) theSObject);
void DeletePrs3d(VisuGUI* theModule,
- VISU::Prs3d_i* thePrs);
+ VISU::Prs3d_i* thePrs);
// Presentation management
void ChangeRepresentation (const SalomeApp_Module* theModule,
- VISU::PresentationType theType);
+ VISU::PresentationType theType);
void ChangeQuadratic2DRepresentation (const SalomeApp_Module* theModule,
- VISU::Quadratic2DPresentationType theType);
+ VISU::Quadratic2DPresentationType theType);
// SObject type
bool CheckTimeStamp(const SalomeApp_Module* theModule,
- _PTR(SObject)& theSObject,
- Handle(SALOME_InteractiveObject)& theIO,
- ColoredPrs3d_i::EPublishInStudyMode& thePublishInStudyMode);
+ _PTR(SObject)& theSObject,
+ Handle(SALOME_InteractiveObject)& theIO,
+ ColoredPrs3d_i::EPublishInStudyMode& thePublishInStudyMode);
VISU::Result_i* CheckResult(const SalomeApp_Module* theModule,
- _PTR(SObject) theSource,
- VISU::Result_var& theResult);
+ _PTR(SObject) theSource,
+ VISU::Result_var& theResult);
bool IsSObjectTable(_PTR(SObject) theSObject);
/*! Display mesh presentation in given VTK view window
*/
VISU_Actor* PublishMeshInView(const SalomeApp_Module* theModule,
- VISU::Prs3d_i* thePrs,
- SVTK_ViewWindow* theViewWindow);
+ VISU::Prs3d_i* thePrs,
+ SVTK_ViewWindow* theViewWindow);
/*!
* \brief Repaint all SVTK view windows, where the given object is displayed.
* \param theIObject - is supposed to be selected (is highlighted in this method).
*/
void RepaintViewWindows(const SalomeApp_Module* theModule,
- const Handle(SALOME_InteractiveObject)& theIObject);
+ const Handle(SALOME_InteractiveObject)& theIObject);
VISU_Actor* FindActor(const SalomeApp_Study* theStudy,
- SVTK_ViewWindow* theViewWindow,
- const QString& theEntry);
+ SVTK_ViewWindow* theViewWindow,
+ const QString& theEntry);
VISU_ActorBase* FindActorBase(const SalomeApp_Study* theStudy,
- SVTK_ViewWindow* theViewWindow,
- const QString& theEntry);
+ SVTK_ViewWindow* theViewWindow,
+ const QString& theEntry);
void RecreateActor(const SalomeApp_Module* theModule,
- VISU::Prs3d_i* thePrs);
+ VISU::Prs3d_i* thePrs);
bool ComputeVisiblePropBounds(SVTK_ViewWindow* theViewWindow,
- vtkFloatingPointType allBounds[6],
- const char* theActorClassName = "VISU_Actor");
+ vtkFloatingPointType allBounds[6],
+ const char* theActorClassName = "VISU_Actor");
/*!
* \brief Advanced FitAll, sets view projection in accordance with current view contents
// Plot2d View
SPlot2d_Viewer* GetPlot2dViewer(const SalomeApp_Module* theModule,
- const bool theCreate = false);
+ const bool theCreate = false);
void PlotTable( const SalomeApp_Module* theModule,
- VISU::Table_i* table,
- int theDisplaying );
+ VISU::Table_i* table,
+ int theDisplaying );
void PlotCurve( const SalomeApp_Module* theModule,
- VISU::Curve_i* curve,
- int theDisplaying );
+ VISU::Curve_i* curve,
+ int theDisplaying );
void PlotRemoveCurve(const SalomeApp_Module* theModule,
- VISU::Curve_i* curve);
+ VISU::Curve_i* curve);
void PlotContainer( const SalomeApp_Module* theModule,
- VISU::Container_i* container,
- int theDisplaying );
+ VISU::Container_i* container,
+ int theDisplaying );
void CreatePlot( SalomeApp_Module* theModule,
- _PTR(SObject) theSobj );
+ _PTR(SObject) theSobj );
/*! Create mesh presentation and display it in \a theViewWindow.
* If \a theViewWindow is NULL, no displaying will be done.
*/
VISU::Mesh_i* CreateMesh(VisuGUI* theModule,
- const Handle(SALOME_InteractiveObject)& theIO,
- SVTK_ViewWindow* theViewWindow);
+ const Handle(SALOME_InteractiveObject)& theIO,
+ SVTK_ViewWindow* theViewWindow);
// Others
std::vector<VISU::Prs3d_i*> GetPrs3dList (const SalomeApp_Module* theModule,
- const Handle(SALOME_InteractiveObject)& theIO,
- bool theGP = false);
+ const Handle(SALOME_InteractiveObject)& theIO,
+ bool theGP = false);
std::vector<VISU::Prs3d_i*> GetPrs3dList (const SalomeApp_Module* theModule,
- _PTR(SObject) theObject,
- bool theGP = false);
+ _PTR(SObject) theObject,
+ bool theGP = false);
int GetFreePositionOfDefaultScalarBar(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow);
void AddScalarBarPosition(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow,
- VISU::Prs3d_i* thePrs3d, int pos);
+ VISU::Prs3d_i* thePrs3d, int pos);
void RemoveScalarBarPosition(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow,
- VISU::Prs3d_i* thePrs3d);
+ VISU::Prs3d_i* thePrs3d);
void initSpinBox( QSpinBox*, int, int, int = 1 );
void initSpinBox( QDoubleSpinBox*, double, double, double = 0.1, int = 6 );
app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
}
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
SUIT_MessageBox::warning(0, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
Handle(SALOME_InteractiveObject) anIO = anIter.Value();
VISU_Actor* anActor = VISU::FindActor(VISU::GetAppStudy(myModule), myViewWindow, anIO->getEntry());
if (anActor)
- anActor->SetOpacity(opacity);
+ anActor->SetOpacity(opacity);
else {
- VISU_ActorBase* anActor = VISU::FindActorBase(VISU::GetAppStudy(myModule), myViewWindow, anIO->getEntry());
+ VISU_ActorBase* anActor = VISU::FindActorBase(VISU::GetAppStudy(myModule), myViewWindow, anIO->getEntry());
if (anActor)
anActor->SetOpacity(opacity);
}
if (aList.Extent() == 1) {
Handle(SALOME_InteractiveObject) FirstIOS = aList.First();
if (!FirstIOS.IsNull()) {
- VISU_Actor* anActor = VISU::FindActor(VISU::GetAppStudy(myModule), myViewWindow, FirstIOS->getEntry());
- if (anActor)
- opacity = int(anActor->GetOpacity() * 100. + 0.5);
+ VISU_Actor* anActor = VISU::FindActor(VISU::GetAppStudy(myModule), myViewWindow, FirstIOS->getEntry());
+ if (anActor)
+ opacity = int(anActor->GetOpacity() * 100. + 0.5);
}
} else if (aList.Extent() > 1) {
SALOME_ListIteratorOfListIO It (aList);
int setOp = -1;
for (; It.More(); It.Next()) {
- Handle(SALOME_InteractiveObject) IO = It.Value();
- if (!IO.IsNull()) {
- VISU_Actor* anActor = VISU::FindActor(VISU::GetAppStudy(myModule), myViewWindow, IO->getEntry());
- if (anActor) {
- int op = int(anActor->GetOpacity() * 100. + 0.5);
- if (setOp < 0)
- setOp = op;
- else if (setOp != op) {
- setOp = 100;
- break;
- }
- }
- }
+ Handle(SALOME_InteractiveObject) IO = It.Value();
+ if (!IO.IsNull()) {
+ VISU_Actor* anActor = VISU::FindActor(VISU::GetAppStudy(myModule), myViewWindow, IO->getEntry());
+ if (anActor) {
+ int op = int(anActor->GetOpacity() * 100. + 0.5);
+ if (setOp < 0)
+ setOp = op;
+ else if (setOp != op) {
+ setOp = 100;
+ break;
+ }
+ }
+ }
}
if (setOp >= 0)
- opacity = setOp;
+ opacity = setOp;
} else {
}
Slider1->setValue(opacity);
public:
VisuGUI_TransparencyDlg( VisuGUI* = 0,
- bool modal = false );
+ bool modal = false );
~VisuGUI_TransparencyDlg();
{}
void VisuGUI_VectorsDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit )
+ bool theInit )
{
if ( theInit )
myPrsCopy = VISU::TSameAsFactory<VISU::TVECTORS>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
void enableMagnColor( bool enable );
virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit );
+ bool theInit );
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
if (!myViewers.contains(aViewer)) {
SUIT_ViewManager* aMgr = aViewer->getViewManager();
connect(aMgr, SIGNAL(deleteView(SUIT_ViewWindow*)),
- this, SLOT(onViewDeleted(SUIT_ViewWindow*)));
+ this, SLOT(onViewDeleted(SUIT_ViewWindow*)));
connect(aViewer, SIGNAL(actorAdded(SVTK_ViewWindow*, VTKViewer_Actor*)),
- this, SLOT(onAddActor(SVTK_ViewWindow*, VTKViewer_Actor*)));
+ this, SLOT(onAddActor(SVTK_ViewWindow*, VTKViewer_Actor*)));
myViewers.append(aViewer);
}
}
VISU_Actor*
PublishInView(VisuGUI* theModule,
Prs3d_i* thePrs,
- SVTK_ViewWindow* theViewWindow,
- bool theIsHighlight)
+ SVTK_ViewWindow* theViewWindow,
+ bool theIsHighlight)
{
if (theViewWindow) {
QApplication::setOverrideCursor( Qt::WaitCursor );
try {
- if (VISU_Actor* anActor = thePrs->CreateActor()) {
- theViewWindow->AddActor(anActor);
- if (theIsHighlight)
- theViewWindow->highlight(anActor->getIO(),true);
- theViewWindow->getRenderer()->ResetCameraClippingRange();
- theViewWindow->Repaint();
- QApplication::restoreOverrideCursor();
- return anActor;
- }
+ if (VISU_Actor* anActor = thePrs->CreateActor()) {
+ theViewWindow->AddActor(anActor);
+ if (theIsHighlight)
+ theViewWindow->highlight(anActor->getIO(),true);
+ theViewWindow->getRenderer()->ResetCameraClippingRange();
+ theViewWindow->Repaint();
+ QApplication::restoreOverrideCursor();
+ return anActor;
+ }
} catch(std::exception& exc) {
- thePrs->RemoveActors();
+ thePrs->RemoveActors();
- QApplication::restoreOverrideCursor();
- INFOS(exc.what());
- SUIT_MessageBox::warning
- (GetDesktop(theModule), QObject::tr("WRN_VISU"),
- QObject::tr("ERR_CANT_CREATE_ACTOR") + ": " + QObject::tr(exc.what()));
+ QApplication::restoreOverrideCursor();
+ INFOS(exc.what());
+ SUIT_MessageBox::warning
+ (GetDesktop(theModule), QObject::tr("WRN_VISU"),
+ QObject::tr("ERR_CANT_CREATE_ACTOR") + ": " + QObject::tr(exc.what()));
}
}
return NULL;
UpdateViewer(VisuGUI* theModule,
VISU::Prs3d_i* thePrs,
bool theDispOnly,
- const bool theIsHighlight)
+ const bool theIsHighlight)
{
if (SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule)) {
vtkRenderer *aRen = aViewWindow->getRenderer();
VISU_Actor* aResActor = NULL;
bool isOk = true;
while (vtkActor *anAct = anActColl->GetNextActor()) {
- if (VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(anAct)) {
- if (VISU::Prs3d_i* aPrs3d = anActor->GetPrs3d()) {
- if (thePrs == aPrs3d) {
- try {
- aResActor = anActor;
- thePrs->UpdateActors();
- aResActor->VisibilityOn();
- } catch (std::runtime_error& exc) {
- thePrs->RemoveActors();
- isOk = false;
+ if (VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(anAct)) {
+ if (VISU::Prs3d_i* aPrs3d = anActor->GetPrs3d()) {
+ if (thePrs == aPrs3d) {
+ try {
+ aResActor = anActor;
+ thePrs->UpdateActors();
+ aResActor->VisibilityOn();
+ } catch (std::runtime_error& exc) {
+ thePrs->RemoveActors();
+ isOk = false;
- INFOS(exc.what());
- SUIT_MessageBox::warning
- (GetDesktop(theModule), QObject::tr("WRN_VISU"),
- QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()) );
- }
- } else if (theDispOnly) {
- anActor->VisibilityOff();
- }
- } else if (theDispOnly && anActor->GetVisibility()) {
- anActor->VisibilityOff();
- }
- }
+ INFOS(exc.what());
+ SUIT_MessageBox::warning
+ (GetDesktop(theModule), QObject::tr("WRN_VISU"),
+ QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()) );
+ }
+ } else if (theDispOnly) {
+ anActor->VisibilityOff();
+ }
+ } else if (theDispOnly && anActor->GetVisibility()) {
+ anActor->VisibilityOff();
+ }
+ }
}
if (aResActor) {
- if (theIsHighlight && isOk)
- aViewWindow->highlight(aResActor->getIO(), true);
- aViewWindow->getRenderer()->ResetCameraClippingRange();
- aViewWindow->Repaint();
- return aResActor;
+ if (theIsHighlight && isOk)
+ aViewWindow->highlight(aResActor->getIO(), true);
+ aViewWindow->getRenderer()->ResetCameraClippingRange();
+ aViewWindow->Repaint();
+ return aResActor;
}
return PublishInView(theModule, thePrs, aViewWindow, theIsHighlight);
}
void
ErasePrs3d(VisuGUI* theModule,
VISU::Prs3d_i* thePrs,
- bool theDoRepaint)
+ bool theDoRepaint)
{
if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule)){
if(VISU_Actor* anActor = FindActor(aViewWindow, thePrs)){
anActor->VisibilityOff();
- if(theDoRepaint)
- aViewWindow->Repaint();
+ if(theDoRepaint)
+ aViewWindow->Repaint();
}
}
}
//----------------------------------------------------------------------------
void
ErasePrs(VisuGUI* theModule,
- Base_i* theBase,
- bool theDoRepaint)
+ Base_i* theBase,
+ bool theDoRepaint)
{
if(!theBase)
return;
switch (theBase->GetType()) {
case VISU::TCURVE: {
if (VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(theBase))
- PlotCurve(theModule, aCurve, VISU::eErase );
+ PlotCurve(theModule, aCurve, VISU::eErase );
break;
}
case VISU::TCONTAINER: {
if (VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(theBase))
- PlotContainer(theModule, aContainer, VISU::eErase );
+ PlotContainer(theModule, aContainer, VISU::eErase );
break;
}
case VISU::TTABLE: {
if (VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(theBase))
- PlotTable(theModule, aTable, VISU::eErase );
+ PlotTable(theModule, aTable, VISU::eErase );
break;
}
case VISU::TPOINTMAP3D: {
if (VISU::PointMap3d_i* aTable3d = dynamic_cast<VISU::PointMap3d_i*>(theBase)) {
- if (SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule)) {
- if(VISU_ActorBase* anActor = FindActorBase(aViewWindow, aTable3d)){
- anActor->VisibilityOff();
- if(theDoRepaint)
- aViewWindow->Repaint();
- }
- } else {
- if (VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(theBase))
- PlotTable(theModule, aTable, VISU::eErase );
- }
+ if (SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule)) {
+ if(VISU_ActorBase* anActor = FindActorBase(aViewWindow, aTable3d)){
+ anActor->VisibilityOff();
+ if(theDoRepaint)
+ aViewWindow->Repaint();
+ }
+ } else {
+ if (VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(theBase))
+ PlotTable(theModule, aTable, VISU::eErase );
+ }
}
break;
}
default: {
if(VISU::Prs3d_i* aPrs3d = VISU::GetPrs3dFromBase(theBase)){
- if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule)){
- RemoveScalarBarPosition(theModule, aViewWindow, aPrs3d);
- ErasePrs3d(theModule, aPrs3d, theDoRepaint);
- }
+ if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule)){
+ RemoveScalarBarPosition(theModule, aViewWindow, aPrs3d);
+ ErasePrs3d(theModule, aPrs3d, theDoRepaint);
+ }
}
}} // switch (aType)
}
typedef typename TViewer::TViewWindow TViewWindow;
if (SalomeApp_Application* anApp = theModule->getApp()) {
if (TViewWindow* aView = dynamic_cast<TViewWindow*>(anApp->desktop()->activeWindow()))
- return aView;
+ return aView;
}
SUIT_ViewManager* aViewManager =
theModule->getViewManager(TViewer::Type(), /*create = */true);
if (aViewManager) {
if (SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView()) {
- if (TViewWindow* aView = dynamic_cast<TViewWindow*>(aViewWindow)) {
- aViewWindow->raise();
- aViewWindow->setFocus();
- return aView;
- }
+ if (TViewWindow* aView = dynamic_cast<TViewWindow*>(aViewWindow)) {
+ aViewWindow->raise();
+ aViewWindow->setFocus();
+ return aView;
+ }
}
}
return NULL;
anApp = theModule->getApp();
else
anApp = dynamic_cast<SalomeApp_Application*>
- (SUIT_Session::session()->activeApplication());
+ (SUIT_Session::session()->activeApplication());
if (anApp)
if (SUIT_ViewManager* aViewManager = anApp->activeViewManager())
- if (SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView())
- return dynamic_cast<TViewWindow*>(aViewWindow);
+ if (SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView())
+ return dynamic_cast<TViewWindow*>(aViewWindow);
return NULL;
}
VISU_Actor*
PublishInView(VisuGUI* theModule,
Prs3d_i* thePrs,
- SVTK_ViewWindow* theViewWindow,
- const bool theIsHighlight = false);
+ SVTK_ViewWindow* theViewWindow,
+ const bool theIsHighlight = false);
//---------------------------------------------------------------
UpdateViewer(VisuGUI* theModule,
VISU::Prs3d_i* thePrs,
bool theDispOnly = false,
- const bool theIsHighlight = false);
+ const bool theIsHighlight = false);
//---------------------------------------------------------------
if (TViewWindow* aViewWindow = GetActiveViewWindow<TViewWindow>(theModule)) {
aViewWindow->unHighlightAll();
if (vtkRenderer *aRen = aViewWindow->getRenderer()) {
- VTK::ActorCollectionCopy aCopy(aRen->GetActors());
- vtkActorCollection *aCollection = aCopy.GetActors();
- aCollection->InitTraversal();
- while (vtkActor *anAct = aCollection->GetNextActor()) {
- if (anAct->GetVisibility() > 0)
- if (SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(anAct)) {
- anActor->VisibilityOff();
- }
- }
- aViewWindow->Repaint();
+ VTK::ActorCollectionCopy aCopy(aRen->GetActors());
+ vtkActorCollection *aCollection = aCopy.GetActors();
+ aCollection->InitTraversal();
+ while (vtkActor *anAct = aCollection->GetNextActor()) {
+ if (anAct->GetVisibility() > 0)
+ if (SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(anAct)) {
+ anActor->VisibilityOff();
+ }
+ }
+ aViewWindow->Repaint();
}
}
}
void
ErasePrs3d(VisuGUI* theModule,
VISU::Prs3d_i* thePrs,
- bool theDoRepaint = true);
+ bool theDoRepaint = true);
void
ErasePrs(VisuGUI* theModule,
- Base_i* theBase,
- bool theDoRepaintVW);
+ Base_i* theBase,
+ bool theDoRepaintVW);
}
#endif
_PTR(GenericAttribute) anAttr;
if (aSObject->FindAttribute(anAttr, "AttributeSequenceOfReal")) {
- _PTR(AttributeSequenceOfReal) aArray(anAttr);
- aPlane->SetOrigin(aArray->Value(1), aArray->Value(2), aArray->Value(3));
- aPlane->SetNormal(aArray->Value(4), aArray->Value(5), aArray->Value(6));
+ _PTR(AttributeSequenceOfReal) aArray(anAttr);
+ aPlane->SetOrigin(aArray->Value(1), aArray->Value(2), aArray->Value(3));
+ aPlane->SetNormal(aArray->Value(4), aArray->Value(5), aArray->Value(6));
}
if (aSObject->FindAttribute(anAttr, "AttributeInteger")) {
- _PTR(AttributeInteger) aFlag(anAttr);
- aPlane->setAuto(aFlag->Value() == 1);
+ _PTR(AttributeInteger) aFlag(anAttr);
+ aPlane->setAuto(aFlag->Value() == 1);
} else
- aPlane->setAuto(false);
+ aPlane->setAuto(false);
applyPlaneToAll(aPlane);
myPlanes->AddItem(aPlane);
if(VISU::Base_i* aBase = dynamic_cast<VISU::Base_i*>(VISU::GetServant(anObject).in())) {
VISU::Prs3d_i* aPrs;
if(aBase->GetType() == VISU::TCOLOREDPRS3DHOLDER){
- CORBA::Object_var anObject = aBase->_this();
- VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject);
- VISU::Prs3d_var aPrs3d = aHolder->GetDevice();
- aPrs = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aPrs3d).in());
+ CORBA::Object_var anObject = aBase->_this();
+ VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject);
+ VISU::Prs3d_var aPrs3d = aHolder->GetDevice();
+ aPrs = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aPrs3d).in());
} else {
- aPrs = dynamic_cast<VISU::Prs3d_i*>(aBase);
+ aPrs = dynamic_cast<VISU::Prs3d_i*>(aBase);
}
if (aPrs) {
- if (!ContainsPlane(aPrs, thePlane)) {
- if (thePlane->isAuto())
- aPrs->AddClippingPlane(thePlane);
- else {
- string aPrsEntry = aPrs->GetEntry();
- if (aPrsEntry.length() == 0) {
- VISU::ColoredPrs3d_i* aColPrs = dynamic_cast<VISU::ColoredPrs3d_i*>(aPrs);
- if (aColPrs)
- aPrsEntry = aColPrs->GetHolderEntry();
- }
-
- _PTR(SObject) aSObject = thePlane->getPlaneObject();
- _PTR(ChildIterator) aRefIter = myStudy->NewChildIterator(aSObject);
- for (; aRefIter->More(); aRefIter->Next()) {
- _PTR(SObject) aObj = aRefIter->Value();
- _PTR(SObject) aRefPrsObject;
- if (aObj->ReferencedObject(aRefPrsObject)) { // If it is referenced on current plane
- if (aRefPrsObject->GetID() == aPrsEntry) {
- aPrs->AddClippingPlane(thePlane);
- }
- }
- }
- }
- }
+ if (!ContainsPlane(aPrs, thePlane)) {
+ if (thePlane->isAuto())
+ aPrs->AddClippingPlane(thePlane);
+ else {
+ string aPrsEntry = aPrs->GetEntry();
+ if (aPrsEntry.length() == 0) {
+ VISU::ColoredPrs3d_i* aColPrs = dynamic_cast<VISU::ColoredPrs3d_i*>(aPrs);
+ if (aColPrs)
+ aPrsEntry = aColPrs->GetHolderEntry();
+ }
+
+ _PTR(SObject) aSObject = thePlane->getPlaneObject();
+ _PTR(ChildIterator) aRefIter = myStudy->NewChildIterator(aSObject);
+ for (; aRefIter->More(); aRefIter->Next()) {
+ _PTR(SObject) aObj = aRefIter->Value();
+ _PTR(SObject) aRefPrsObject;
+ if (aObj->ReferencedObject(aRefPrsObject)) { // If it is referenced on current plane
+ if (aRefPrsObject->GetID() == aPrsEntry) {
+ aPrs->AddClippingPlane(thePlane);
+ }
+ }
+ }
+ }
+ }
}
}
}
//*************************************************************
long VISU_ClippingPlaneMgr::CreateClippingPlane(double X,double Y, double Z,
- double dX, double dY, double dZ,
- bool isAuto, const char* name)
+ double dX, double dY, double dZ,
+ bool isAuto, const char* name)
{
_PTR(SObject) aObjPtr = CreateClippingPlaneObject(X, Y, Z, dX, dY, dZ, isAuto, name);
return myPlanes->GetNumberOfItems() - 1;
//*************************************************************
_PTR(SObject) VISU_ClippingPlaneMgr::CreateClippingPlaneObject(double X,double Y, double Z,
- double dX, double dY, double dZ,
- bool isAuto, const char* name)
+ double dX, double dY, double dZ,
+ bool isAuto, const char* name)
{
_PTR(SObject) aPlaneObj;
if(!myStudy->GetProperties()->IsLocked()) {
anAttr = aBuilder->FindOrCreateAttribute(aPlaneObj,"AttributeSequenceOfReal");
_PTR(AttributeSequenceOfReal) aArray(anAttr);
if (aArray->Length() == 6) {
- for (int i = 0; i < 6; i++)
- aArray->ChangeValue(i+1, aParams[i]);
+ for (int i = 0; i < 6; i++)
+ aArray->ChangeValue(i+1, aParams[i]);
} else {
- for (int i = 0; i < 6; i++)
- aArray->Add(aParams[i]);
+ for (int i = 0; i < 6; i++)
+ aArray->Add(aParams[i]);
}
// Save Bool Flag
anAttr = aBuilder->FindOrCreateAttribute(aPlaneObj,"AttributeInteger");
//*************************************************************
void VISU_ClippingPlaneMgr::EditClippingPlane(long id, double X,double Y, double Z,
- double dX, double dY, double dZ,
- bool isAuto, const char* name)
+ double dX, double dY, double dZ,
+ bool isAuto, const char* name)
{
VISU_CutPlaneFunction* aPlane = GetClippingPlane(id);
if (aPlane != NULL) {
if(!myStudy->GetProperties()->IsLocked()) {
_PTR(GenericAttribute) anAttr;
if (aSObj->FindAttribute(anAttr, "AttributeSequenceOfReal")) {
- _PTR(AttributeSequenceOfReal) aArray(anAttr);
- aArray->ChangeValue(1, X);
- aArray->ChangeValue(2, Y);
- aArray->ChangeValue(3, Z);
- aArray->ChangeValue(4, dX);
- aArray->ChangeValue(5, dY);
- aArray->ChangeValue(6, dZ);
+ _PTR(AttributeSequenceOfReal) aArray(anAttr);
+ aArray->ChangeValue(1, X);
+ aArray->ChangeValue(2, Y);
+ aArray->ChangeValue(3, Z);
+ aArray->ChangeValue(4, dX);
+ aArray->ChangeValue(5, dY);
+ aArray->ChangeValue(6, dZ);
}
if (aSObj->FindAttribute(anAttr, "AttributeInteger")) {
- _PTR(AttributeInteger) aFlag(anAttr);
- aFlag->SetValue(isAuto? 1 : 0);
+ _PTR(AttributeInteger) aFlag(anAttr);
+ aFlag->SetValue(isAuto? 1 : 0);
}
if (aSObj->FindAttribute(anAttr, "AttributeName")) {
- _PTR(AttributeName) aName(anAttr);
- aName->SetValue(name);
+ _PTR(AttributeName) aName(anAttr);
+ aName->SetValue(name);
}
// Remove references on presentations if it becomes Auto plane
_PTR(SObject) aPlaneSObj = aPlane->getPlaneObject();
if (aPlane->isAuto()) {
- _PTR(ChildIterator) aIter = myStudy->NewChildIterator(aPlaneSObj);
- _PTR(StudyBuilder) aBuilder = myStudy->NewBuilder();
- for (; aIter->More(); aIter->Next()) {
- _PTR(SObject) aObj = aIter->Value();
- aBuilder->RemoveObject(aObj);
- }
+ _PTR(ChildIterator) aIter = myStudy->NewChildIterator(aPlaneSObj);
+ _PTR(StudyBuilder) aBuilder = myStudy->NewBuilder();
+ for (; aIter->More(); aIter->Next()) {
+ _PTR(SObject) aObj = aIter->Value();
+ aBuilder->RemoveObject(aObj);
+ }
}
}
}
_PTR(SComponent) aVisuSO = myStudy->FindComponent("VISU");
_PTR(ChildIterator) aChildIter = myStudy->NewChildIterator(aVisuSO);
for (aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next()) {
- _PTR(SObject) aSObject = aChildIter->Value();
- CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject);
- if(VISU::Base_i* aBase = dynamic_cast<VISU::Base_i*>(VISU::GetServant(anObject).in())) {
- VISU::Prs3d_i* aPrs;
- if(aBase->GetType() == VISU::TCOLOREDPRS3DHOLDER){
- CORBA::Object_var anObject = aBase->_this();
- VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject);
- VISU::Prs3d_var aPrs3d = aHolder->GetDevice();
- aPrs = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aPrs3d).in());
- } else
- aPrs = dynamic_cast<VISU::Prs3d_i*>(aBase);
-
- if (aPrs) {
- if (ContainsPlane(aPrs, aPlane)) {
- short aTag1 = aPlane->getPlaneObject()->Tag();
- for (int j = aPrs->GetNumberOfClippingPlanes()-1; j > -1; j--) {
- VISU_CutPlaneFunction* aPln = dynamic_cast<VISU_CutPlaneFunction*>
- (aPrs->GetClippingPlane(j));
- if (aPln) {
- short aTag2 = aPln->getPlaneObject()->Tag();
- if (aTag1 == aTag2) {
- aPrs->RemoveClippingPlane(j);
- break;
- }
- }
- }
- }
- }
- }
+ _PTR(SObject) aSObject = aChildIter->Value();
+ CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject);
+ if(VISU::Base_i* aBase = dynamic_cast<VISU::Base_i*>(VISU::GetServant(anObject).in())) {
+ VISU::Prs3d_i* aPrs;
+ if(aBase->GetType() == VISU::TCOLOREDPRS3DHOLDER){
+ CORBA::Object_var anObject = aBase->_this();
+ VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject);
+ VISU::Prs3d_var aPrs3d = aHolder->GetDevice();
+ aPrs = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aPrs3d).in());
+ } else
+ aPrs = dynamic_cast<VISU::Prs3d_i*>(aBase);
+
+ if (aPrs) {
+ if (ContainsPlane(aPrs, aPlane)) {
+ short aTag1 = aPlane->getPlaneObject()->Tag();
+ for (int j = aPrs->GetNumberOfClippingPlanes()-1; j > -1; j--) {
+ VISU_CutPlaneFunction* aPln = dynamic_cast<VISU_CutPlaneFunction*>
+ (aPrs->GetClippingPlane(j));
+ if (aPln) {
+ short aTag2 = aPln->getPlaneObject()->Tag();
+ if (aTag1 == aTag2) {
+ aPrs->RemoveClippingPlane(j);
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
}
_PTR(SObject) aSObj = aPlane->getPlaneObject();
if (aSObj) {
- _PTR(StudyBuilder) aBuilder = myStudy->NewBuilder();
- aBuilder->RemoveObject(aSObj);
+ _PTR(StudyBuilder) aBuilder = myStudy->NewBuilder();
+ aBuilder->RemoveObject(aSObj);
}
myPlanes->RemoveItem(id);
return true;
VISU_CutPlaneFunction* aPlane = dynamic_cast<VISU_CutPlaneFunction*>(thePrs->GetClippingPlane(i));
if (aPlane) {
if (aPlane->getPlaneObject()->GetID() == aEntry) {
- return true;
+ return true;
}
}
}
if (!aPlane->isAuto()) {
string aEntry = thePrs->GetEntry();
if (aEntry.length() == 0) {
- VISU::ColoredPrs3d_i* aColPrs = dynamic_cast<VISU::ColoredPrs3d_i*>(thePrs);
- if (aColPrs)
- aEntry = aColPrs->GetHolderEntry();
+ VISU::ColoredPrs3d_i* aColPrs = dynamic_cast<VISU::ColoredPrs3d_i*>(thePrs);
+ if (aColPrs)
+ aEntry = aColPrs->GetHolderEntry();
}
if(!myStudy->GetProperties()->IsLocked()) {
- _PTR(StudyBuilder) aBuilder = myStudy->NewBuilder();
- _PTR(SObject) aPrsSObj = myStudy->FindObjectID(aEntry);
- _PTR(SObject) aSObject = aPlane->getPlaneObject();
- _PTR(SObject) aNewObj = aBuilder->NewObject(aSObject);
- aBuilder->Addreference(aNewObj, aPrsSObj);
+ _PTR(StudyBuilder) aBuilder = myStudy->NewBuilder();
+ _PTR(SObject) aPrsSObj = myStudy->FindObjectID(aEntry);
+ _PTR(SObject) aSObject = aPlane->getPlaneObject();
+ _PTR(SObject) aNewObj = aBuilder->NewObject(aSObject);
+ aBuilder->Addreference(aNewObj, aPrsSObj);
}
}
return true;
bool isRemoved = false;
short aTag1 = aPlane->getPlaneObject()->Tag();
for (int j = thePrs->GetNumberOfClippingPlanes()-1; j > -1; j--) {
- VISU_CutPlaneFunction* aPln = dynamic_cast<VISU_CutPlaneFunction*>
- (thePrs->GetClippingPlane(j));
- if (aPln) {
- short aTag2 = aPln->getPlaneObject()->Tag();
- if (aTag1 == aTag2) {
- thePrs->RemoveClippingPlane(j);
- isRemoved = true;
- break;
- }
- }
+ VISU_CutPlaneFunction* aPln = dynamic_cast<VISU_CutPlaneFunction*>
+ (thePrs->GetClippingPlane(j));
+ if (aPln) {
+ short aTag2 = aPln->getPlaneObject()->Tag();
+ if (aTag1 == aTag2) {
+ thePrs->RemoveClippingPlane(j);
+ isRemoved = true;
+ break;
+ }
+ }
}
if(!myStudy->GetProperties()->IsLocked()) {
- _PTR(SObject) aSObject = aPlane->getPlaneObject();
- _PTR(StudyBuilder) aBuilder = myStudy->NewBuilder();
-
- string aEntry = thePrs->GetEntry();
- if (aEntry.length() == 0) {
- VISU::ColoredPrs3d_i* aColPrs = dynamic_cast<VISU::ColoredPrs3d_i*>(thePrs);
- if (aColPrs)
- aEntry = aColPrs->GetHolderEntry();
- }
- _PTR(ChildIterator) aIter = myStudy->NewChildIterator(aSObject);
- for (; aIter->More(); aIter->Next()) {
- _PTR(SObject) aRefObj = aIter->Value();
- if(aRefObj) {
- _PTR(SObject) aRefPrsObject;
- if (aRefObj->ReferencedObject(aRefPrsObject)) {
- if (aRefPrsObject->GetID() == aEntry) {
- aBuilder->RemoveObject(aRefObj);
- break;
- }
- }
- }
- }
+ _PTR(SObject) aSObject = aPlane->getPlaneObject();
+ _PTR(StudyBuilder) aBuilder = myStudy->NewBuilder();
+
+ string aEntry = thePrs->GetEntry();
+ if (aEntry.length() == 0) {
+ VISU::ColoredPrs3d_i* aColPrs = dynamic_cast<VISU::ColoredPrs3d_i*>(thePrs);
+ if (aColPrs)
+ aEntry = aColPrs->GetHolderEntry();
+ }
+ _PTR(ChildIterator) aIter = myStudy->NewChildIterator(aSObject);
+ for (; aIter->More(); aIter->Next()) {
+ _PTR(SObject) aRefObj = aIter->Value();
+ if(aRefObj) {
+ _PTR(SObject) aRefPrsObject;
+ if (aRefObj->ReferencedObject(aRefPrsObject)) {
+ if (aRefPrsObject->GetID() == aEntry) {
+ aBuilder->RemoveObject(aRefObj);
+ break;
+ }
+ }
+ }
+ }
}
return isRemoved;
}
long CreateClippingPlane(double X,double Y, double Z,
- double dX, double dY, double dZ,
- bool isAuto, const char* name);
+ double dX, double dY, double dZ,
+ bool isAuto, const char* name);
void EditClippingPlane(long id, double X,double Y, double Z,
- double dX, double dY, double dZ,
- bool isAuto, const char* name);
+ double dX, double dY, double dZ,
+ bool isAuto, const char* name);
_PTR(SObject) CreateClippingPlaneObject(double X,double Y, double Z,
- double dX, double dY, double dZ,
- bool isAuto, const char* name);
+ double dX, double dY, double dZ,
+ bool isAuto, const char* name);
/* Returns clipping plane by its Id */
VISU_CutPlaneFunction* GetClippingPlane(long id);
//---------------------------------------------------------------
int
GetEntity2Geom(const VISU::TEntity& theEntity,
- SALOME_MED::medGeometryElement*& theVector)
+ SALOME_MED::medGeometryElement*& theVector)
{
switch(theEntity){
case VISU::CELL_ENTITY:
//---------------------------------------------------------------
void
GetCellsSize(vtkIdType& theNbCells,
- vtkIdType& theCellsSize,
- SALOME_MED::MESH_ptr theMEDMesh,
- const VISU::TEntity& theVEntity)
+ vtkIdType& theCellsSize,
+ SALOME_MED::MESH_ptr theMEDMesh,
+ const VISU::TEntity& theVEntity)
{
theNbCells = theCellsSize = 0;
if(MYDEBUG) MESSAGE("GetCellsSize - theVEntity = "<<theVEntity);
for(int iGeom = 0; iGeom < iGeomEnd; iGeom++){
int iNumElemEnd = connInfo->numberOfElements[iGeom];
if(iNumElemEnd > 0){
- if(MYDEBUG) MESSAGE("GetCellsSize - iNumElemEnd = "<<iNumElemEnd);
- theCellsSize += iNumElemEnd + connInfo->nodalConnectivityLength[iGeom];
- theNbCells += iNumElemEnd;
+ if(MYDEBUG) MESSAGE("GetCellsSize - iNumElemEnd = "<<iNumElemEnd);
+ theCellsSize += iNumElemEnd + connInfo->nodalConnectivityLength[iGeom];
+ theNbCells += iNumElemEnd;
}
}
}
//---------------------------------------------------------------
void
GetCellsSize(vtkIdType& theNbCells,
- vtkIdType& theCellsSize,
- SALOME_MED::FAMILY_ptr theMEDFamily)
+ vtkIdType& theCellsSize,
+ SALOME_MED::FAMILY_ptr theMEDFamily)
{
theNbCells = theCellsSize = 0;
SALOME_MED::SUPPORT::supportInfos_var suppInfo=theMEDFamily->getSupportGlobal();
for(int iGeom = 0; iGeom < iGeomEnd; iGeom++) {
int iNumElemEnd = suppInfo->nbEltTypes[iGeom];
if(iNumElemEnd > 0){
- if(MYDEBUG) MESSAGE("GetCellsSize - iNumElemEnd = "<<iNumElemEnd);
- theNbCells += iNumElemEnd;
- theCellsSize += iNumElemEnd + suppInfo->nodalConnectivityLength[iGeom];
+ if(MYDEBUG) MESSAGE("GetCellsSize - iNumElemEnd = "<<iNumElemEnd);
+ theNbCells += iNumElemEnd;
+ theCellsSize += iNumElemEnd + suppInfo->nodalConnectivityLength[iGeom];
}
}
}
//---------------------------------------------------------------
void
GetCellsSize(VISU::PCMesh theMesh,
- SALOME_MED::MESH_ptr theMEDMesh,
- const VISU::TEntity& theEntity)
+ SALOME_MED::MESH_ptr theMEDMesh,
+ const VISU::TEntity& theEntity)
{
VISU::TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap;
VISU::PCMeshOnEntity aMeshOnEntity = aMeshOnEntityMap[theEntity];
//---------------------------------------------------------------
VISU::PCMeshOnEntity
InitMeshOnEntity(const VISU::PCMesh& theMesh,
- const VISU::TEntity& theEntity,
- const VISU::PCMeshOnEntity& theMeshOnEntity)
+ const VISU::TEntity& theEntity,
+ const VISU::PCMeshOnEntity& theMeshOnEntity)
{
VISU::PCMeshOnEntity aMeshOnEntity;
VISU::TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap;
VISU::PCSubProfile
CrSubProfile(const VISU::PCMesh theMesh,
- const VISU::PCField theField,
- const VISU::TCMeshOnEntity& theMeshOnEntity,
- SALOME_MED::medGeometryElement theMGeom,
- int theNbElems)
+ const VISU::PCField theField,
+ const VISU::TCMeshOnEntity& theMeshOnEntity,
+ SALOME_MED::medGeometryElement theMGeom,
+ int theNbElems)
{
if (MYDEBUG) MESSAGE("CrSubProfile");
VISU::EGeometry aEGeom = MEDGeom2VISU(theMGeom);
aSubProfile->myStatus = VISU::eRemoveAll;
else if(aTimeStampIter == aCellsFirstIndex.end() && theMGeom == SALOME_MED::MED_POINT1){
if(theNbElems > 0){
- aSubProfile->myName = "";
- aSubProfile->myStatus = VISU::eAddPart;
-
- aSubProfile->myNbCells = theNbElems;
- aSubProfile->myCellsSize = aSubProfile->myNbCells;
+ aSubProfile->myName = "";
+ aSubProfile->myStatus = VISU::eAddPart;
+
+ aSubProfile->myNbCells = theNbElems;
+ aSubProfile->myCellsSize = aSubProfile->myNbCells;
}
}else{
- if(theNbElems > 0){
- aSubProfile->myName = "";
- aSubProfile->myStatus = VISU::eAddPart;
-
- aSubProfile->myNbCells = theNbElems;
- aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes;
- }
+ if(theNbElems > 0){
+ aSubProfile->myName = "";
+ aSubProfile->myStatus = VISU::eAddPart;
+
+ aSubProfile->myNbCells = theNbElems;
+ aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes;
+ }
}
if (MYDEBUG) MESSAGE("CrSubProfile done");
VISU::TProfileKey
GetProfileKey(const VISU::PCMesh theMesh,
- const VISU::PCField theField,
- const VISU::PCValForTime theValForTime,
- const VISU::TCMeshOnEntity& theMeshOnEntity)
+ const VISU::PCField theField,
+ const VISU::PCValForTime theValForTime,
+ const VISU::TCMeshOnEntity& theMeshOnEntity)
{
if (MYDEBUG) MESSAGE("GetProfileKey");
if(anIter == aFirstIndex.end() && aSupport->getEntity() == SALOME_MED::MED_NODE){
SALOME_MED::medGeometryElement aMGeom = SALOME_MED::MED_POINT1;
try{
- aNbElems = aSupport->getNumberOfElements(SALOME_MED::MED_NONE);
- if(MYDEBUG)MESSAGE("aMGeom="<<aMGeom<<" aNbElems="<<aNbElems);
+ aNbElems = aSupport->getNumberOfElements(SALOME_MED::MED_NONE);
+ if(MYDEBUG)MESSAGE("aMGeom="<<aMGeom<<" aNbElems="<<aNbElems);
}catch(...){
- MESSAGE("Error in theValForTime->myField->getSupport()->getNumberOfElements(aMGeom);");
+ MESSAGE("Error in theValForTime->myField->getSupport()->getNumberOfElements(aMGeom);");
}
-
+
VISU::PCSubProfile aSubProfile = CrSubProfile(theMesh,
- theField,
- theMeshOnEntity,
- aMGeom,
- aNbElems);
+ theField,
+ theMeshOnEntity,
+ aMGeom,
+ aNbElems);
aProfileKey.insert(aSubProfile);
}
for(; anIter != aFirstIndex.end(); anIter++){
SALOME_MED::medGeometryElement aMGeom = anIter->first;
try{
- aNbElems = aSupport->getNumberOfElements(aMGeom);
- if(MYDEBUG)MESSAGE("aMGeom="<<aMGeom<<" aNbElems="<<aNbElems);
- } catch(...){
- MESSAGE("Error in theValForTime->myField->getSupport()->getNumberOfElements(aMGeom);");
- continue;
+ aNbElems = aSupport->getNumberOfElements(aMGeom);
+ if(MYDEBUG)MESSAGE("aMGeom="<<aMGeom<<" aNbElems="<<aNbElems);
+ } catch(...){
+ MESSAGE("Error in theValForTime->myField->getSupport()->getNumberOfElements(aMGeom);");
+ continue;
}
VISU::PCSubProfile aSubProfile = CrSubProfile(theMesh,
- theField,
- theMeshOnEntity,
- aMGeom,
- aNbElems);
+ theField,
+ theMeshOnEntity,
+ aMGeom,
+ aNbElems);
aProfileKey.insert(aSubProfile);
}
void
InitProfile(VISU::PCMesh theMesh,
- VISU::PCField theField,
- VISU::PCValForTime theValForTime,
- VISU::TCMeshOnEntity& theMeshOnEntity)
+ VISU::PCField theField,
+ VISU::PCValForTime theValForTime,
+ VISU::TCMeshOnEntity& theMeshOnEntity)
{
if (MYDEBUG) MESSAGE("InitProfile");
VISU::TProfileMap& aProfileMap = theMeshOnEntity.myProfileMap;
VISU::TProfileKey aProfileKey = GetProfileKey(theMesh,
- theField,
- theValForTime,
- theMeshOnEntity);
+ theField,
+ theValForTime,
+ theMeshOnEntity);
VISU::TProfileMap::const_iterator anIter = aProfileMap.find(aProfileKey);
if(anIter != aProfileMap.end()){
VISU::TProfileKey::const_iterator anIter = aProfileKey.begin();
for(; anIter != aProfileKey.end(); anIter++){
- VISU::PCSubProfile aSubProfile(*anIter);
-
- if(aProfile->myIsAll && aSubProfile->myStatus != VISU::eAddAll)
- aProfile->myIsAll = false;
-
- VISU::EGeometry aEGeom = aSubProfile->myGeom;
- aGeom2SubProfile[aEGeom] = aSubProfile;
+ VISU::PCSubProfile aSubProfile(*anIter);
+
+ if(aProfile->myIsAll && aSubProfile->myStatus != VISU::eAddAll)
+ aProfile->myIsAll = false;
+
+ VISU::EGeometry aEGeom = aSubProfile->myGeom;
+ aGeom2SubProfile[aEGeom] = aSubProfile;
}
aProfileMap[aProfileKey] = aProfile;
void
LoadProfile(VISU::PCMesh theMesh,
- VISU::PCField theField,
- VISU::PCValForTime theValForTime,
- VISU::PCMeshOnEntity theMeshOnEntity)
+ VISU::PCField theField,
+ VISU::PCValForTime theValForTime,
+ VISU::PCMeshOnEntity theMeshOnEntity)
{
VISU::PCProfile aProfile = theValForTime->myProfile;
if (MYDEBUG) MESSAGE("LoadProfile aProfile->myIsDone="<<aProfile->myIsDone);
SALOME_MED::long_array_var aGeom2ProfileIds;
std::vector<int> aGeom2Profile;
if(!aSupport->isOnAllElements()){
- try{
- if(aMGeom == SALOME_MED::MED_POINT1)
- aGeom2ProfileIds = aSupport->getNumberFromFile(SALOME_MED::MED_NONE);
- else
- aGeom2ProfileIds = aSupport->getNumberFromFile(aMGeom);
- int aLen = aGeom2ProfileIds->length();
- if(MYDEBUG) MESSAGE_BEGIN(" - aMGeom="<<aMGeom<<"; aNbCells="<<aLen);
- for(int i = 0; i < aLen; i++){
- int anId = aGeom2ProfileIds[i];
- aGeom2Profile.push_back(anId);
- if(MYDEBUG) MESSAGE_ADD(std::endl << "------------------------------->" << anId);
- }
- if(MYDEBUG) MESSAGE_END(" ");
- } catch(...) {
- continue;
- }
+ try{
+ if(aMGeom == SALOME_MED::MED_POINT1)
+ aGeom2ProfileIds = aSupport->getNumberFromFile(SALOME_MED::MED_NONE);
+ else
+ aGeom2ProfileIds = aSupport->getNumberFromFile(aMGeom);
+ int aLen = aGeom2ProfileIds->length();
+ if(MYDEBUG) MESSAGE_BEGIN(" - aMGeom="<<aMGeom<<"; aNbCells="<<aLen);
+ for(int i = 0; i < aLen; i++){
+ int anId = aGeom2ProfileIds[i];
+ aGeom2Profile.push_back(anId);
+ if(MYDEBUG) MESSAGE_ADD(std::endl << "------------------------------->" << anId);
+ }
+ if(MYDEBUG) MESSAGE_END(" ");
+ } catch(...) {
+ continue;
+ }
} else {
- SALOME_MED::medEntityMesh aMEntity = aSupport->getEntity();
- int aNbElems = theMesh->myMesh->getNumberOfElements(aMEntity,aMGeom);
- for(int i = 0; i < aNbElems; i++)
- aGeom2Profile.push_back(i+1);
+ SALOME_MED::medEntityMesh aMEntity = aSupport->getEntity();
+ int aNbElems = theMesh->myMesh->getNumberOfElements(aMEntity,aMGeom);
+ for(int i = 0; i < aNbElems; i++)
+ aGeom2Profile.push_back(i+1);
}
if(aGeom2Profile.size()>0){
- VISU::TSubMeshID& aSubMeshID = aSubProfile->mySubMeshID;
- int aSize = aGeom2Profile.size();
- aSubMeshID.resize(aSize);
- for(int anId = 0; anId < aSize; anId++){
- aSubMeshID[anId] = aGeom2Profile[anId] - 1;
- }
+ VISU::TSubMeshID& aSubMeshID = aSubProfile->mySubMeshID;
+ int aSize = aGeom2Profile.size();
+ aSubMeshID.resize(aSize);
+ for(int anId = 0; anId < aSize; anId++){
+ aSubMeshID[anId] = aGeom2Profile[anId] - 1;
+ }
}
}
if(MYDEBUG)
MESSAGE("VISU_MEDFieldConvertor::Build - aFieldName = '"<<aFieldName<<
- "'; myId = "<<anId<<"; myTime = "<<aDT);
+ "'; myId = "<<anId<<"; myTime = "<<aDT);
return this;
}
{
SALOMEDS::GenericAttribute_var anAttr;
if(theSObj->FindAttribute(anAttr,"AttributeName")){
- SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
- CORBA::String_var aValue = aName->Value();
- theIsSuccess = (myName == aValue.in());
- if(theIsSuccess)
- return TRet(SALOMEDS::SObject::_duplicate(theSObj));
+ SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
+ CORBA::String_var aValue = aName->Value();
+ theIsSuccess = (myName == aValue.in());
+ if(theIsSuccess)
+ return TRet(SALOMEDS::SObject::_duplicate(theSObj));
}
return TRet();
}
{
CORBA::Object_var anObj = VISU::SObjectToObject(theSObj);
if(!CORBA::is_nil(anObj)){
- SALOME_MED::MESH_var aMesh = SALOME_MED::MESH::_narrow(anObj);
- if(!CORBA::is_nil(aMesh)){
- CORBA::String_var aName = aMesh->getName();
- theIsSuccess = (myName == aName.in());
- if(theIsSuccess)
- return TRet(aMesh,SALOMEDS::SObject::_duplicate(theSObj));
- }
+ SALOME_MED::MESH_var aMesh = SALOME_MED::MESH::_narrow(anObj);
+ if(!CORBA::is_nil(aMesh)){
+ CORBA::String_var aName = aMesh->getName();
+ theIsSuccess = (myName == aName.in());
+ if(theIsSuccess)
+ return TRet(aMesh,SALOMEDS::SObject::_duplicate(theSObj));
+ }
}
return TRet();
}
SALOMEDS::SObject_var aSObj = anIter->Value();
typename TFun::TRet aRet = theFun(aSObj,theIsSuccess);
if(theIsSuccess)
- return aRet;
+ return aRet;
}
return typename TFun::TRet();
}
anIsSuccess = false;
CORBA::String_var aMeshName = aMeshNames[iMesh];
TMeshByName::TRet aMeshByNameRet =
- Find(aMeshesSObj,aStudy,TMeshByName(aMeshName.in()),anIsSuccess);
+ Find(aMeshesSObj,aStudy,TMeshByName(aMeshName.in()),anIsSuccess);
if(MYDEBUG)
- MESSAGE("VISU_MEDConvertor::Build - Find aMeshName('"<<aMeshName.in()<<"') = "<<anIsSuccess);
+ MESSAGE("VISU_MEDConvertor::Build - Find aMeshName('"<<aMeshName.in()<<"') = "<<anIsSuccess);
if(!anIsSuccess)
- continue;
+ continue;
VISU::PCMesh aMesh = myMeshMap[aMeshName.in()](new VISU::TCMesh());
SALOME_MED::MESH_var aMEDMesh = boost::get<0>(aMeshByNameRet);
aMesh->myMesh = aMEDMesh;
if(MYDEBUG)
- MESSAGE("VISU_MEDConvertor::Build - aMeshName = "<<aMeshName<<"; myDim = "<<aMesh->myDim);
+ MESSAGE("VISU_MEDConvertor::Build - aMeshName = "<<aMeshName<<"; myDim = "<<aMesh->myDim);
std::string aName = aMeshName.in();
std::replace(aName.begin(),aName.end(),' ','_');
aStream<<"MEDSUPPORTS_OF_"<<aName;
std::string aSupportsName(aStream.str());
TSObjectByName::TRet aSObjectByNameRet =
- Find(aMeshesSObj,aStudy,TSObjectByName(aSupportsName.c_str()),anIsSuccess);
+ Find(aMeshesSObj,aStudy,TSObjectByName(aSupportsName.c_str()),anIsSuccess);
if(MYDEBUG)
- MESSAGE("VISU_MEDConvertor::Build - Find aSupportsName('"<<aSupportsName<<"') = "<<anIsSuccess);
+ MESSAGE("VISU_MEDConvertor::Build - Find aSupportsName('"<<aSupportsName<<"') = "<<anIsSuccess);
if(!anIsSuccess)
- continue;
+ continue;
VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
SALOMEDS::SObject_var aSupportsSObj = boost::get<0>(aSObjectByNameRet);
// Fill all MeshOnEntity
aSupportIterator->InitEx(true);
for(; aSupportIterator->More(); aSupportIterator->Next()){
- SALOMEDS::SObject_var aSupportSObj = aSupportIterator->Value();
-
- CORBA::Object_var aMedSupport = VISU::SObjectToObject(aSupportSObj);
- if(CORBA::is_nil(aMedSupport))
- continue;
-
- SALOME_MED::SUPPORT_var aMEDSupport = SALOME_MED::SUPPORT::_narrow(aMedSupport);
- if(aMEDSupport->_is_nil())
- continue;
-
- SALOME_MED::MESH_var aMeshOnSupport = aMEDSupport->getMesh();
- SALOME_MED::medEntityMesh aMEntity = aMEDSupport->getEntity();
- VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
- CORBA::String_var aSupportName = aMEDSupport->getName();
-
- if(aMEDSupport->isOnAllElements() && strcmp(aSupportName.in(),"SupportOnAll_MED_") > 0){
- if(MYDEBUG)
- MESSAGE("VISU_MEDConvertor::Build - Support isOnAllElements = '"<<aSupportName<<
- "' aVEntity = "<<aVEntity);
- vtkIdType aNbCells, aCellsSize;
- //Check, if there is any data on the support?
- if(aVEntity == VISU::NODE_ENTITY){
- aMesh->myNbPoints = aMeshOnSupport->getNumberOfNodes();
- aNbCells = aMesh->myNbPoints;
- aCellsSize = 2*aMesh->myNbPoints;
- }else
- ::GetCellsSize(aNbCells,aCellsSize,aMeshOnSupport,aVEntity);
-
- if(aNbCells > 0){
- if(aMeshOnEntityMap.find(aVEntity) == aMeshOnEntityMap.end()){
- VISU::PCMeshOnEntity aMeshOnEntity(new VISU::TCMeshOnEntity());
- aMeshOnEntity->myMeshName = aMeshName.in();
- aMeshOnEntity->myEntity = aVEntity;
- aMeshOnEntity->myNbCells = aNbCells;
- aMeshOnEntity->myCellsSize = aCellsSize;
- aMeshOnEntity->mySupport = aMEDSupport;
- aMeshOnEntityMap[aVEntity] = aMeshOnEntity;
- }
- }
- }
+ SALOMEDS::SObject_var aSupportSObj = aSupportIterator->Value();
+
+ CORBA::Object_var aMedSupport = VISU::SObjectToObject(aSupportSObj);
+ if(CORBA::is_nil(aMedSupport))
+ continue;
+
+ SALOME_MED::SUPPORT_var aMEDSupport = SALOME_MED::SUPPORT::_narrow(aMedSupport);
+ if(aMEDSupport->_is_nil())
+ continue;
+
+ SALOME_MED::MESH_var aMeshOnSupport = aMEDSupport->getMesh();
+ SALOME_MED::medEntityMesh aMEntity = aMEDSupport->getEntity();
+ VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
+ CORBA::String_var aSupportName = aMEDSupport->getName();
+
+ if(aMEDSupport->isOnAllElements() && strcmp(aSupportName.in(),"SupportOnAll_MED_") > 0){
+ if(MYDEBUG)
+ MESSAGE("VISU_MEDConvertor::Build - Support isOnAllElements = '"<<aSupportName<<
+ "' aVEntity = "<<aVEntity);
+ vtkIdType aNbCells, aCellsSize;
+ //Check, if there is any data on the support?
+ if(aVEntity == VISU::NODE_ENTITY){
+ aMesh->myNbPoints = aMeshOnSupport->getNumberOfNodes();
+ aNbCells = aMesh->myNbPoints;
+ aCellsSize = 2*aMesh->myNbPoints;
+ }else
+ ::GetCellsSize(aNbCells,aCellsSize,aMeshOnSupport,aVEntity);
+
+ if(aNbCells > 0){
+ if(aMeshOnEntityMap.find(aVEntity) == aMeshOnEntityMap.end()){
+ VISU::PCMeshOnEntity aMeshOnEntity(new VISU::TCMeshOnEntity());
+ aMeshOnEntity->myMeshName = aMeshName.in();
+ aMeshOnEntity->myEntity = aVEntity;
+ aMeshOnEntity->myNbCells = aNbCells;
+ aMeshOnEntity->myCellsSize = aCellsSize;
+ aMeshOnEntity->mySupport = aMEDSupport;
+ aMeshOnEntityMap[aVEntity] = aMeshOnEntity;
+ }
+ }
+ }
}
// Fill all Family
aSupportIterator->InitEx(true);
for(; aSupportIterator->More(); aSupportIterator->Next()){
- SALOMEDS::SObject_var aSupportSObj = aSupportIterator->Value();
-
- CORBA::Object_var aMedSupport = VISU::SObjectToObject(aSupportSObj);
- if(CORBA::is_nil(aMedSupport))
- continue;
-
- SALOME_MED::SUPPORT_var aMEDSupport = SALOME_MED::SUPPORT::_narrow(aMedSupport);
- if(aMEDSupport->_is_nil())
- continue;
-
- SALOME_MED::MESH_var aMeshOnSupport = aMEDSupport->getMesh();
- SALOME_MED::medEntityMesh aMEntity = aMEDSupport->getEntity();
- VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
- CORBA::String_var aSupportName = aMEDSupport->getName();
-
- SALOME_MED::FAMILY_var aMEDFamily = SALOME_MED::FAMILY::_narrow(aMedSupport);
- if(!aMEDFamily->_is_nil()) {
- VISU::TMeshOnEntityMap::iterator aMeshOnEntityMapIter = aMeshOnEntityMap.find(aVEntity);
- if(aMeshOnEntityMapIter == aMeshOnEntityMap.end())
- continue;
- VISU::PCMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second;
-
- vtkIdType aNbCells = aMeshOnEntity->myNbCells, aCellsSize = aMeshOnEntity->myCellsSize;
- CORBA::Boolean anIsOnAllElements = aMEDSupport->isOnAllElements();
- if(!anIsOnAllElements)
- ::GetCellsSize(aNbCells,aCellsSize,aMEDFamily);
-
- if(MYDEBUG)
- MESSAGE("VISU_MEDConvertor::Build "<<
- "- aFamily = '"<<aSupportName<<"'"<<
- "; anIsOnAllElements = "<<anIsOnAllElements<<
- "; aVEntity = "<<aVEntity<<
- "; aNbCells = "<<aNbCells);
-
- if(aNbCells > 0){
- VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
- VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.find(aSupportName.in());
- if(aFamilyMapIter == aFamilyMap.end()){
- VISU::PCFamily aFamily(new VISU::TCFamily());
- aFamily->myEntity = aVEntity;
- aFamily->myNbCells = aNbCells;
- aFamily->myCellsSize = aCellsSize;
- aFamily->myId = aMEDFamily->getIdentifier();
- aFamily->myName = aSupportName.in();
- aFamily->myFamily = aMEDFamily;
- aFamilyMap[aSupportName.in()] = aFamily;
- }
- }
- }
+ SALOMEDS::SObject_var aSupportSObj = aSupportIterator->Value();
+
+ CORBA::Object_var aMedSupport = VISU::SObjectToObject(aSupportSObj);
+ if(CORBA::is_nil(aMedSupport))
+ continue;
+
+ SALOME_MED::SUPPORT_var aMEDSupport = SALOME_MED::SUPPORT::_narrow(aMedSupport);
+ if(aMEDSupport->_is_nil())
+ continue;
+
+ SALOME_MED::MESH_var aMeshOnSupport = aMEDSupport->getMesh();
+ SALOME_MED::medEntityMesh aMEntity = aMEDSupport->getEntity();
+ VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
+ CORBA::String_var aSupportName = aMEDSupport->getName();
+
+ SALOME_MED::FAMILY_var aMEDFamily = SALOME_MED::FAMILY::_narrow(aMedSupport);
+ if(!aMEDFamily->_is_nil()) {
+ VISU::TMeshOnEntityMap::iterator aMeshOnEntityMapIter = aMeshOnEntityMap.find(aVEntity);
+ if(aMeshOnEntityMapIter == aMeshOnEntityMap.end())
+ continue;
+ VISU::PCMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second;
+
+ vtkIdType aNbCells = aMeshOnEntity->myNbCells, aCellsSize = aMeshOnEntity->myCellsSize;
+ CORBA::Boolean anIsOnAllElements = aMEDSupport->isOnAllElements();
+ if(!anIsOnAllElements)
+ ::GetCellsSize(aNbCells,aCellsSize,aMEDFamily);
+
+ if(MYDEBUG)
+ MESSAGE("VISU_MEDConvertor::Build "<<
+ "- aFamily = '"<<aSupportName<<"'"<<
+ "; anIsOnAllElements = "<<anIsOnAllElements<<
+ "; aVEntity = "<<aVEntity<<
+ "; aNbCells = "<<aNbCells);
+
+ if(aNbCells > 0){
+ VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
+ VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.find(aSupportName.in());
+ if(aFamilyMapIter == aFamilyMap.end()){
+ VISU::PCFamily aFamily(new VISU::TCFamily());
+ aFamily->myEntity = aVEntity;
+ aFamily->myNbCells = aNbCells;
+ aFamily->myCellsSize = aCellsSize;
+ aFamily->myId = aMEDFamily->getIdentifier();
+ aFamily->myName = aSupportName.in();
+ aFamily->myFamily = aMEDFamily;
+ aFamilyMap[aSupportName.in()] = aFamily;
+ }
+ }
+ }
}
-
+
// Fill all Groups
aSupportIterator->InitEx(true);
for(; aSupportIterator->More(); aSupportIterator->Next()){
- SALOMEDS::SObject_var aSupportSObj = aSupportIterator->Value();
-
- CORBA::Object_var aMedSupport = VISU::SObjectToObject(aSupportSObj);
- if(CORBA::is_nil(aMedSupport))
- continue;
-
- SALOME_MED::SUPPORT_var aMEDSupport = SALOME_MED::SUPPORT::_narrow(aMedSupport);
- if(aMEDSupport->_is_nil())
- continue;
-
- SALOME_MED::MESH_var aMeshOnSupport = aMEDSupport->getMesh();
- SALOME_MED::medEntityMesh aMEntity = aMEDSupport->getEntity();
- VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
- CORBA::String_var aSupportName = aMEDSupport->getName();
-
- SALOME_MED::GROUP_var aMEDGroup = SALOME_MED::GROUP::_narrow(aMedSupport);
- if(!aMEDGroup->_is_nil()){
- CORBA::Boolean anIsOnAllElements = aMEDSupport->isOnAllElements();
-
- if(MYDEBUG)
- MESSAGE("VISU_MEDConvertor::Build "<<
- "- aGroup = '"<<aSupportName<<"'"<<
- "; anIsOnAllElements = "<<anIsOnAllElements<<
- "; aVEntity = "<<aVEntity);
-
- VISU::PCGroup aGroup(new VISU::TCGroup());
- aGroup->myGroup = aMEDGroup;
- VISU::TFamilySet& aFamilySet = aGroup->myFamilySet;
-
- SALOME_MED::Family_array_var aFamilies = aMEDGroup->getFamilies();
- int iFamilyEnd = aFamilies->length();
- for(int iFamaily = 0; iFamaily < iFamilyEnd; iFamaily++){
- SALOME_MED::FAMILY_var aMEDFamily = aFamilies[iFamaily];
- CORBA::String_var aFamilyName = aMEDFamily->getName();
- TFindFamilyOnEntity aFindFamilyOnEntity =
- FindFamilyOnEntity(aMeshName.in(), aVEntity, aFamilyName.in());
- VISU::PCFamily aFamily = boost::get<2>(aFindFamilyOnEntity);
- if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aGroup - aFamilyName = '"<<aFamilyName.in()<<"' = "<<bool(aFamily));
- if(aFamily){
- aFamilySet.insert(aFamily);
- }
- }
-
- if(!aFamilySet.empty()){
- VISU::TGroupMap& aGroupMap = aMesh->myGroupMap;
- aGroupMap[aSupportName.in()] = aGroup;
- }
-
- }
+ SALOMEDS::SObject_var aSupportSObj = aSupportIterator->Value();
+
+ CORBA::Object_var aMedSupport = VISU::SObjectToObject(aSupportSObj);
+ if(CORBA::is_nil(aMedSupport))
+ continue;
+
+ SALOME_MED::SUPPORT_var aMEDSupport = SALOME_MED::SUPPORT::_narrow(aMedSupport);
+ if(aMEDSupport->_is_nil())
+ continue;
+
+ SALOME_MED::MESH_var aMeshOnSupport = aMEDSupport->getMesh();
+ SALOME_MED::medEntityMesh aMEntity = aMEDSupport->getEntity();
+ VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
+ CORBA::String_var aSupportName = aMEDSupport->getName();
+
+ SALOME_MED::GROUP_var aMEDGroup = SALOME_MED::GROUP::_narrow(aMedSupport);
+ if(!aMEDGroup->_is_nil()){
+ CORBA::Boolean anIsOnAllElements = aMEDSupport->isOnAllElements();
+
+ if(MYDEBUG)
+ MESSAGE("VISU_MEDConvertor::Build "<<
+ "- aGroup = '"<<aSupportName<<"'"<<
+ "; anIsOnAllElements = "<<anIsOnAllElements<<
+ "; aVEntity = "<<aVEntity);
+
+ VISU::PCGroup aGroup(new VISU::TCGroup());
+ aGroup->myGroup = aMEDGroup;
+ VISU::TFamilySet& aFamilySet = aGroup->myFamilySet;
+
+ SALOME_MED::Family_array_var aFamilies = aMEDGroup->getFamilies();
+ int iFamilyEnd = aFamilies->length();
+ for(int iFamaily = 0; iFamaily < iFamilyEnd; iFamaily++){
+ SALOME_MED::FAMILY_var aMEDFamily = aFamilies[iFamaily];
+ CORBA::String_var aFamilyName = aMEDFamily->getName();
+ TFindFamilyOnEntity aFindFamilyOnEntity =
+ FindFamilyOnEntity(aMeshName.in(), aVEntity, aFamilyName.in());
+ VISU::PCFamily aFamily = boost::get<2>(aFindFamilyOnEntity);
+ if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aGroup - aFamilyName = '"<<aFamilyName.in()<<"' = "<<bool(aFamily));
+ if(aFamily){
+ aFamilySet.insert(aFamily);
+ }
+ }
+
+ if(!aFamilySet.empty()){
+ VISU::TGroupMap& aGroupMap = aMesh->myGroupMap;
+ aGroupMap[aSupportName.in()] = aGroup;
+ }
+
+ }
}
}
}
if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aFieldName = '"<<GetSObjectName(aFieldSObj)<<"'");
SALOMEDS::ChildIterator_var aTimeStampIterator = aStudy->NewChildIterator(aFieldSObj);
for(; aTimeStampIterator->More(); aTimeStampIterator->Next()){
- SALOMEDS::SObject_var aTimeStampSObj = aTimeStampIterator->Value();
- if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aTimeStampSObj = '"<<GetSObjectName(aTimeStampSObj)<<"'");
- CORBA::Object_var aMedField = VISU::SObjectToObject(aTimeStampSObj);
- if(CORBA::is_nil(aMedField))
- continue;
-
- SALOME_MED::FIELD_var aMEDField = SALOME_MED::FIELD::_narrow(aMedField);
- if(aMEDField->_is_nil())
- continue;
-
- SALOME_MED::SUPPORT_var aMEDSupport = aMEDField->getSupport();
- if(aMEDSupport->_is_nil())
- continue;
-
- SALOME_MED::medEntityMesh aMEntity = aMEDSupport->getEntity();
- VISU::TEntity anEntity = MEDEntityToVTK(aMEntity);
- SALOME_MED::MESH_var aMEDMesh = aMEDSupport->getMesh();
- if(aMEDMesh->_is_nil())
- continue;
-
- CORBA::String_var aMeshName = aMEDMesh->getName();
- CORBA::String_var aFieldName = aMEDField->getName();
-
- VISU::TMeshMap::iterator aMeshMapIter = myMeshMap.find(aMeshName.in());
- if(aMeshMapIter == myMeshMap.end())
- continue;
-
- VISU::PCMesh aMesh = aMeshMapIter->second;
- VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
- VISU::TMeshOnEntityMap::iterator aMeshOnEntityMapIter = aMeshOnEntityMap.find(anEntity);
- if(aMeshOnEntityMapIter == aMeshOnEntityMap.end())
- continue;
-
- VISU::PCMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second;
- VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
- VISU::TFieldMap::iterator aFieldMapIter = aFieldMap.find(aFieldName.in());
- VISU::PCField aField;
- if(aFieldMapIter == aFieldMap.end()){
- aField = aFieldMap[aFieldName.in()](new VISU::TCField());
- aField->myId = iField;
- aField->myName = aFieldName.in();
- aField->myEntity = anEntity;
- aField->myMeshName = aMeshName.in();
- aField->myDataSize = aMeshOnEntity->myNbCells * aField->myNbComp;
-
- vtkIdType aDataType = VTK_DOUBLE;
- SALOME_MED::FIELDDOUBLE_ptr aFieldDouble = SALOME_MED::FIELDDOUBLE::_narrow(aMEDField);
- if(aFieldDouble->_is_nil()) {
+ SALOMEDS::SObject_var aTimeStampSObj = aTimeStampIterator->Value();
+ if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aTimeStampSObj = '"<<GetSObjectName(aTimeStampSObj)<<"'");
+ CORBA::Object_var aMedField = VISU::SObjectToObject(aTimeStampSObj);
+ if(CORBA::is_nil(aMedField))
+ continue;
+
+ SALOME_MED::FIELD_var aMEDField = SALOME_MED::FIELD::_narrow(aMedField);
+ if(aMEDField->_is_nil())
+ continue;
+
+ SALOME_MED::SUPPORT_var aMEDSupport = aMEDField->getSupport();
+ if(aMEDSupport->_is_nil())
+ continue;
+
+ SALOME_MED::medEntityMesh aMEntity = aMEDSupport->getEntity();
+ VISU::TEntity anEntity = MEDEntityToVTK(aMEntity);
+ SALOME_MED::MESH_var aMEDMesh = aMEDSupport->getMesh();
+ if(aMEDMesh->_is_nil())
+ continue;
+
+ CORBA::String_var aMeshName = aMEDMesh->getName();
+ CORBA::String_var aFieldName = aMEDField->getName();
+
+ VISU::TMeshMap::iterator aMeshMapIter = myMeshMap.find(aMeshName.in());
+ if(aMeshMapIter == myMeshMap.end())
+ continue;
+
+ VISU::PCMesh aMesh = aMeshMapIter->second;
+ VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
+ VISU::TMeshOnEntityMap::iterator aMeshOnEntityMapIter = aMeshOnEntityMap.find(anEntity);
+ if(aMeshOnEntityMapIter == aMeshOnEntityMap.end())
+ continue;
+
+ VISU::PCMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second;
+ VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
+ VISU::TFieldMap::iterator aFieldMapIter = aFieldMap.find(aFieldName.in());
+ VISU::PCField aField;
+ if(aFieldMapIter == aFieldMap.end()){
+ aField = aFieldMap[aFieldName.in()](new VISU::TCField());
+ aField->myId = iField;
+ aField->myName = aFieldName.in();
+ aField->myEntity = anEntity;
+ aField->myMeshName = aMeshName.in();
+ aField->myDataSize = aMeshOnEntity->myNbCells * aField->myNbComp;
+
+ vtkIdType aDataType = VTK_DOUBLE;
+ SALOME_MED::FIELDDOUBLE_ptr aFieldDouble = SALOME_MED::FIELDDOUBLE::_narrow(aMEDField);
+ if(aFieldDouble->_is_nil()) {
// PAL18313: Mandriva 64 porting: CRASH at creating presentation on "Import Structure".
if (sizeof(long) == 4 ) // Size of CORBA::Long is always 4 (see CORBA_basetypes.h)
aDataType = VTK_LONG;
continue;
}
}
- aField->Init(aMEDField->getNumberOfComponents(), aDataType);
-
- if(MYDEBUG)
- MESSAGE("VISU_MEDConvertor::Build - aMeshOnEntity->myNbCells = "<<aMeshOnEntity->myNbCells);
- }else
- aField = aFieldMapIter->second;
-
- VISU::TValField& aValField = aField->myValField;
- int anId = aMEDField->getIterationNumber();
- VISU::PCValForTime aValForTime = aValField[anId](new VISU::TCValForTime());
- aValForTime->myId = anId;
- CORBA::Double aDT = aMEDField->getTime();
- aValForTime->myTime = VISU::TTime(aDT,"");
- aValForTime->myField = aMEDField;
- if(MYDEBUG)
- MESSAGE("VISU_MEDConvertor::Build - aMeshName = '"<<aMeshName<<
- "'; myEntity = "<<anEntity<<"; myTime = "<<aDT);
+ aField->Init(aMEDField->getNumberOfComponents(), aDataType);
+
+ if(MYDEBUG)
+ MESSAGE("VISU_MEDConvertor::Build - aMeshOnEntity->myNbCells = "<<aMeshOnEntity->myNbCells);
+ }else
+ aField = aFieldMapIter->second;
+
+ VISU::TValField& aValField = aField->myValField;
+ int anId = aMEDField->getIterationNumber();
+ VISU::PCValForTime aValForTime = aValField[anId](new VISU::TCValForTime());
+ aValForTime->myId = anId;
+ CORBA::Double aDT = aMEDField->getTime();
+ aValForTime->myTime = VISU::TTime(aDT,"");
+ aValForTime->myField = aMEDField;
+ if(MYDEBUG)
+ MESSAGE("VISU_MEDConvertor::Build - aMeshName = '"<<aMeshName<<
+ "'; myEntity = "<<anEntity<<"; myTime = "<<aDT);
}
}
}
myMeshMap[aMeshName.in()] = aMesh;
if(MYDEBUG)
- MESSAGE("VISU_MEDConvertor::Build "<<
- "- aMeshName = '"<<aMeshName<<"'"<<
- "; aDim = "<<aMesh->myDim);
+ MESSAGE("VISU_MEDConvertor::Build "<<
+ "- aMeshName = '"<<aMeshName<<"'"<<
+ "; aDim = "<<aMesh->myDim);
}else
aMesh = aMeshMapIter->second;
aFieldMap[aFieldName.in()] = aField;
if(MYDEBUG)
- MESSAGE("VISU_MEDConvertor::Build - aMeshOnEntity->myNbCells = "<<aMeshOnEntity->myNbCells);
+ MESSAGE("VISU_MEDConvertor::Build - aMeshOnEntity->myNbCells = "<<aMeshOnEntity->myNbCells);
}else
aField = aFieldMapIter->second;
aValForTime->myField = aMEDField;
if(MYDEBUG)
MESSAGE("VISU_MEDConvertor::Build "<<
- "- aMeshName = '"<<aMeshName<<"'"<<
- "; myEntity = "<<aVEntity<<
- "; myTime = "<<aDT<<
- "; anId = "<<anId);
+ "- aMeshName = '"<<aMeshName<<"'"<<
+ "; myEntity = "<<aVEntity<<
+ "; myTime = "<<aDT<<
+ "; anId = "<<anId);
}
return this;
}
int
VISU_MEDConvertor
::LoadMeshOnEntity(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity)
+ VISU::PMeshOnEntityImpl theMeshOnEntity)
{
int anIsUpdated = LoadPoints(theMesh);
const VISU::TEntity& aVEntity = theMeshOnEntity->myEntity;
int
VISU_MEDConvertor
::LoadFamilyOnEntity(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity,
- VISU::PFamilyImpl theFamily)
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFamilyImpl theFamily)
{
int anIsUpdated = LoadPoints(theMesh);
const VISU::TEntity& anEntity = theMeshOnEntity->myEntity;
int
VISU_MEDConvertor
::LoadMeshOnGroup(VISU::PMeshImpl theMesh,
- const VISU::TFamilySet& theFamilySet)
+ const VISU::TFamilySet& theFamilySet)
{
//Main part of code
int anIsUpdated = LoadPoints(theMesh);
int
VISU_MEDConvertor
::LoadValForTimeOnMesh(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity,
- VISU::PFieldImpl theField,
- VISU::PValForTimeImpl theValForTime)
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFieldImpl theField,
+ VISU::PValForTimeImpl theValForTime)
{
//Main part of code
int anIsUpdated = LoadPoints(theMesh);
int
VISU_MEDConvertor
::LoadPointsOnFamily(VISU::PCMesh theMesh,
- VISU::PCFamily theFamily)
+ VISU::PCFamily theFamily)
{
VISU::PCMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[VISU::NODE_ENTITY];
for(int iElem = 0; iElem < aNbElem; iElem++){
int anID = aCellNumForType[iElem] - 1;
if(0 > anID || anID >= aSize){
- static QString aString;
- aString.sprintf("LoadPointsOnFamily - aSize(%d) <= aCellNumForType[%d] = %d < 0",aSize,iElem,anID);
- throw std::runtime_error((const char*)aString.toLatin1());
+ static QString aString;
+ aString.sprintf("LoadPointsOnFamily - aSize(%d) <= aCellNumForType[%d] = %d < 0",aSize,iElem,anID);
+ throw std::runtime_error((const char*)aString.toLatin1());
}
aSubMeshID.push_back(anID);
}
SALOME_MED::medEntityMesh theEntity)
{
{
- SALOME::SenderInt_var aSender =
- theMesh->getSenderForPolygonsConnectivity(SALOME_MED::MED_NODAL, theEntity);
- long int aSize;
- int* aValuePtr = ReceiverFactory::getValue(aSender.in(), aSize);
- myConn.assign(aValuePtr, aValuePtr + aSize);
+ SALOME::SenderInt_var aSender =
+ theMesh->getSenderForPolygonsConnectivity(SALOME_MED::MED_NODAL, theEntity);
+ long int aSize;
+ int* aValuePtr = ReceiverFactory::getValue(aSender.in(), aSize);
+ myConn.assign(aValuePtr, aValuePtr + aSize);
}
{
- SALOME::SenderInt_var aSender =
- theMesh->getSenderForPolygonsConnectivityIndex(SALOME_MED::MED_NODAL, theEntity);
- long int aSize;
- int* aValuePtr = ReceiverFactory::getValue(aSender, aSize);
- myConnIndex.assign(aValuePtr, aValuePtr + aSize);
+ SALOME::SenderInt_var aSender =
+ theMesh->getSenderForPolygonsConnectivityIndex(SALOME_MED::MED_NODAL, theEntity);
+ long int aSize;
+ int* aValuePtr = ReceiverFactory::getValue(aSender, aSize);
+ myConnIndex.assign(aValuePtr, aValuePtr + aSize);
}
}
MEDPolyhedraConnectivity(SALOME_MED::MESH_var theMesh)
{
{
- SALOME::SenderInt_var aSender =
- theMesh->getSenderForPolyhedronConnectivity(SALOME_MED::MED_NODAL);
- long int aSize;
- int* aValuePtr = ReceiverFactory::getValue(aSender, aSize);
- myConn.assign(aValuePtr, aValuePtr + aSize);
+ SALOME::SenderInt_var aSender =
+ theMesh->getSenderForPolyhedronConnectivity(SALOME_MED::MED_NODAL);
+ long int aSize;
+ int* aValuePtr = ReceiverFactory::getValue(aSender, aSize);
+ myConn.assign(aValuePtr, aValuePtr + aSize);
}
{
- SALOME::SenderInt_var aSender =
- theMesh->getSenderForPolyhedronIndex(SALOME_MED::MED_NODAL);
- long int aSize;
- int* aValuePtr = ReceiverFactory::getValue(aSender, aSize);
- myConnIndex.assign(aValuePtr, aValuePtr + aSize);
+ SALOME::SenderInt_var aSender =
+ theMesh->getSenderForPolyhedronIndex(SALOME_MED::MED_NODAL);
+ long int aSize;
+ int* aValuePtr = ReceiverFactory::getValue(aSender, aSize);
+ myConnIndex.assign(aValuePtr, aValuePtr + aSize);
}
{
- SALOME::SenderInt_var aSender =
- theMesh->getSenderForPolyhedronFacesIndex();
- long int aSize;
- int* aValuePtr = ReceiverFactory::getValue(aSender, aSize);
- myFaceIndex.assign(aValuePtr, aValuePtr + aSize);
+ SALOME::SenderInt_var aSender =
+ theMesh->getSenderForPolyhedronFacesIndex();
+ long int aSize;
+ int* aValuePtr = ReceiverFactory::getValue(aSender, aSize);
+ myFaceIndex.assign(aValuePtr, aValuePtr + aSize);
}
}
int
GetUniqueConn(int theId,
- TConnSet& theConnSet) const
+ TConnSet& theConnSet) const
{
theConnSet.clear();
int aStartFaceId = myConnIndex[theId] - 1;
TConnSet aConnSet;
int aCellSize = 0;
for(int anElemId = 0; anElemId < GetNbElem(); anElemId++)
- aCellSize += GetUniqueConn(anElemId, aConnSet);
+ aCellSize += GetUniqueConn(anElemId, aConnSet);
return aCellSize;
}
};
int
VISU_MEDConvertor
::LoadCellsOnEntity(VISU::PCMesh theMesh,
- VISU::PCMeshOnEntity theMeshOnEntity)
+ VISU::PCMeshOnEntity theMeshOnEntity)
{
if(theMeshOnEntity->myIsDone)
return 0;
if (aNbElem > 0) {
SALOME_MED::long_array_var aConn =
aMedMesh->getConnectivity(SALOME_MED::MED_FULL_INTERLACE,
- SALOME_MED::MED_NODAL,
- aMEntity,
- aMGeom);
+ SALOME_MED::MED_NODAL,
+ aMEntity,
+ aMGeom);
VISU::PSubMeshImpl aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TCSubMesh());
aSubMesh->myNbCells = aNbElem;
int
VISU_MEDConvertor
::LoadCellsOnFamily(VISU::PCMesh theMesh,
- VISU::PCMeshOnEntity theMeshOnEntity,
- VISU::PCFamily theFamily)
+ VISU::PCMeshOnEntity theMeshOnEntity,
+ VISU::PCFamily theFamily)
{
if(theFamily->myIsDone)
return 0;
VISU::TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[aEGeom];
if(MYDEBUG)
- MESSAGE("LoadCellsOnFamily "<<
- "- aMGeom = "<<aMGeom<<
- "; aNbElem = "<<aNbElem<<
- "; aSize = "<<aSize<<
- "; aCounter = "<<aCounter);
+ MESSAGE("LoadCellsOnFamily "<<
+ "- aMGeom = "<<aMGeom<<
+ "; aNbElem = "<<aNbElem<<
+ "; aSize = "<<aSize<<
+ "; aCounter = "<<aCounter);
for(int iElem = 0; iElem < aNbElem; iElem++){
- int anID = aCellNumForType[iElem] - aCounter - 1;
- if(0 > anID || anID >= aSize){
- static QString aString;
- aString.sprintf("LoadCellsOnFamily - aNbElem(%d) <= aCellNumForType[%d] = %d < 0 !!!",aNbElem,iElem,anID);
- throw std::runtime_error((const char*)aString.toLatin1());
- }
- aSubMeshID.push_back(anID);
+ int anID = aCellNumForType[iElem] - aCounter - 1;
+ if(0 > anID || anID >= aSize){
+ static QString aString;
+ aString.sprintf("LoadCellsOnFamily - aNbElem(%d) <= aCellNumForType[%d] = %d < 0 !!!",aNbElem,iElem,anID);
+ throw std::runtime_error((const char*)aString.toLatin1());
+ }
+ aSubMeshID.push_back(anID);
}
}
}else{
VISU::TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[aEGeom];
int iNumElemEnd = aCell2Connect.size();
for(int iNumElem = 0; iNumElem < iNumElemEnd; iNumElem++)
- aSubMeshID.push_back(iNumElem);
+ aSubMeshID.push_back(iNumElem);
}
}
template<class TValueType,
- class TContainerType>
+ class TContainerType>
void
ImportField(TContainerType& theContainer,
- VISU::PCMesh theMesh,
- VISU::PCField theField,
- VISU::PCValForTime theValForTime,
- VISU::PCMeshOnEntity theMeshOnEntity)
+ VISU::PCMesh theMesh,
+ VISU::PCField theField,
+ VISU::PCValForTime theValForTime,
+ VISU::PCMeshOnEntity theMeshOnEntity)
{
typedef VISU::TTCMEDMeshValue<TValueType, TContainerType> TVMeshValue;
vtkIdType aNbComp = theField->myNbComp;
const VISU::TCellsFirstIndex& aCellsFirstIndex = theMeshOnEntity->myCellsFirstIndex;
VISU::TCellsFirstIndex::const_iterator aCellsFirstIndexIter = aCellsFirstIndex.find(aMGeom);
if(aCellsFirstIndexIter != aCellsFirstIndex.end()){
- const VISU::TIndexAndSize& aIndexAndSize = aCellsFirstIndexIter->second;
- if(MYDEBUG)
- MESSAGE("ImportField - aMGeom = "<<aMGeom<<
- "; aIndexAndSize = {"<<aIndexAndSize.first<<
- ","<<aIndexAndSize.second<<"}");
-
- vtkIdType aNbElem = aIndexAndSize.second;
- vtkIdType aStart = aIndexAndSize.first * aNbComp;
- VISU::PMeshValue& aVMeshValue = theValForTime->GetMeshValue(aEGeom);
- TVMeshValue* aMeshValue = new TVMeshValue();
- aMeshValue->Init(aNbElem, aNbGauss, aNbComp, theContainer, aStart);
- aVMeshValue.reset(aMeshValue);
+ const VISU::TIndexAndSize& aIndexAndSize = aCellsFirstIndexIter->second;
+ if(MYDEBUG)
+ MESSAGE("ImportField - aMGeom = "<<aMGeom<<
+ "; aIndexAndSize = {"<<aIndexAndSize.first<<
+ ","<<aIndexAndSize.second<<"}");
+
+ vtkIdType aNbElem = aIndexAndSize.second;
+ vtkIdType aStart = aIndexAndSize.first * aNbComp;
+ VISU::PMeshValue& aVMeshValue = theValForTime->GetMeshValue(aEGeom);
+ TVMeshValue* aMeshValue = new TVMeshValue();
+ aMeshValue->Init(aNbElem, aNbGauss, aNbComp, theContainer, aStart);
+ aVMeshValue.reset(aMeshValue);
}
}
}
int
VISU_MEDConvertor
::LoadField(VISU::PCMesh theMesh,
- VISU::PCMeshOnEntity theMeshOnEntity,
- VISU::PField theField,
- VISU::PCValForTime theValForTime)
+ VISU::PCMeshOnEntity theMeshOnEntity,
+ VISU::PField theField,
+ VISU::PCValForTime theValForTime)
{
MESSAGE("VISU_MEDConvertor::LoadField");
//Check on loading already done
SALOME_MED::double_array_var anArray = aFieldDouble->getValue(SALOME_MED::MED_FULL_INTERLACE);
if(MYDEBUG) MESSAGE("VISU_MEDConvertor::LoadField - There is FIELDDOUBLE = "<<anArray->length());
ImportField<CORBA::Double>(anArray,
- theMesh,
- theField,
- theValForTime,
- theMeshOnEntity);
+ theMesh,
+ theField,
+ theValForTime,
+ theMeshOnEntity);
}
SALOME_MED::FIELDINT_ptr aFieldInt = SALOME_MED::FIELDINT::_narrow(aMEDField);
SALOME_MED::long_array_var anArray = aFieldInt->getValue(SALOME_MED::MED_FULL_INTERLACE);
if(MYDEBUG) MESSAGE("VISU_MEDConvertor::LoadField - There is FIELDINT = "<<anArray->length());
ImportField<CORBA::Long>(anArray,
- theMesh,
- theField,
- theValForTime,
- theMeshOnEntity);
+ theMesh,
+ theField,
+ theValForTime,
+ theMeshOnEntity);
}
anUnstructuredGridIDMapper->myIsVTKDone = true;
#include "VISU_PointCoords.hxx"
#include "VISU_MeshValue.hxx"
-#include <string>
+#include <string>
namespace VISU
{
//! To initilize the class instance
void
Init(vtkIdType theNbElem,
- vtkIdType theNbGauss,
- vtkIdType theNbComp,
- const TContainerType& theContainer,
- vtkIdType theStartIndex)
+ vtkIdType theNbGauss,
+ vtkIdType theNbComp,
+ const TContainerType& theContainer,
+ vtkIdType theStartIndex)
{
TSuperClass::Init(theNbElem, theNbGauss, theNbComp, theContainer);
myStartIndex = theStartIndex;
virtual
int
LoadMeshOnEntity(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity);
+ VISU::PMeshOnEntityImpl theMeshOnEntity);
virtual
int
LoadFamilyOnEntity(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity,
- VISU::PFamilyImpl theFamily);
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFamilyImpl theFamily);
virtual
int
LoadMeshOnGroup(VISU::PMeshImpl theMesh,
- const VISU::TFamilySet& theFamilySet);
+ const VISU::TFamilySet& theFamilySet);
virtual
int
LoadValForTimeOnMesh(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity,
- VISU::PFieldImpl theField,
- VISU::PValForTimeImpl theValForTime);
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFieldImpl theField,
+ VISU::PValForTimeImpl theValForTime);
virtual
int
LoadValForTimeOnGaussPts(VISU::PMeshImpl theMesh,
- VISU::PMeshOnEntityImpl theMeshOnEntity,
- VISU::PFieldImpl theField,
- VISU::PValForTimeImpl theValForTime)
+ VISU::PMeshOnEntityImpl theMeshOnEntity,
+ VISU::PFieldImpl theField,
+ VISU::PValForTimeImpl theValForTime)
{
return 0;
}
int
LoadPointsOnFamily(VISU::PCMesh theMesh,
- VISU::PCFamily theFamily) ;
+ VISU::PCFamily theFamily) ;
int
LoadCellsOnEntity(VISU::PCMesh theMesh,
- VISU::PCMeshOnEntity theMeshOnEntity);
+ VISU::PCMeshOnEntity theMeshOnEntity);
int
LoadCellsOnFamily(VISU::PCMesh theMesh,
- VISU::PCMeshOnEntity theMeshOnEntity,
- VISU::PCFamily theFamily);
+ VISU::PCMeshOnEntity theMeshOnEntity,
+ VISU::PCFamily theFamily);
int
LoadField(VISU::PCMesh theMesh,
- VISU::PCMeshOnEntity theMeshOnEntity,
- VISU::PField theField,
- VISU::PCValForTime theValForTime);
+ VISU::PCMeshOnEntity theMeshOnEntity,
+ VISU::PField theField,
+ VISU::PCValForTime theValForTime);
};
void
AddController(ColoredPrs3d_i* theReference,
- VISU::PMinMaxController theMinMaxController)
+ VISU::PMinMaxController theMinMaxController)
{
myMinMaxContainer[ TKey( theReference ) ] = theMinMaxController;
}
{
TMinMaxContainer::iterator anIter = myMinMaxContainer.find( TKey( theFromPrs3 ) );
if ( anIter != myMinMaxContainer.end() ) {
- myMinMaxContainer.erase( anIter );
- myMinMaxContainer[ TKey( theToPrs3d ) ] = VISU::CreateDefaultMinMaxController( theToPrs3d );
+ myMinMaxContainer.erase( anIter );
+ myMinMaxContainer[ TKey( theToPrs3d ) ] = VISU::CreateDefaultMinMaxController( theToPrs3d );
}
}
{
vtkFloatingPointType aMin = TMinMaxController::GetComponentMin(theCompID);
if ( !myMinMaxContainer.empty() ) {
- TMinMaxContainer::const_iterator anIter = myMinMaxContainer.begin();
- for(; anIter != myMinMaxContainer.end(); anIter++){
- VISU::PMinMaxController aMinMaxController = anIter->second;
- aMin = std::min(aMin, aMinMaxController->GetComponentMin(theCompID));
- }
+ TMinMaxContainer::const_iterator anIter = myMinMaxContainer.begin();
+ for(; anIter != myMinMaxContainer.end(); anIter++){
+ VISU::PMinMaxController aMinMaxController = anIter->second;
+ aMin = std::min(aMin, aMinMaxController->GetComponentMin(theCompID));
+ }
}
return aMin;
}
{
vtkFloatingPointType aMax = TMinMaxController::GetComponentMax(theCompID);
if ( !myMinMaxContainer.empty() ) {
- TMinMaxContainer::const_iterator anIter = myMinMaxContainer.begin();
- for(; anIter != myMinMaxContainer.end(); anIter++){
- VISU::PMinMaxController aMinMaxController = anIter->second;
- aMax = std::max(aMax, aMinMaxController->GetComponentMax(theCompID));
- }
+ TMinMaxContainer::const_iterator anIter = myMinMaxContainer.begin();
+ for(; anIter != myMinMaxContainer.end(); anIter++){
+ VISU::PMinMaxController aMinMaxController = anIter->second;
+ aMax = std::max(aMax, aMinMaxController->GetComponentMax(theCompID));
+ }
}
return aMax;
}
VISU::Storable::TRestoringMap aFMap = VISU::Storable::GetStorableMap(myFieldsLst.first().myField);
long aNumComp = VISU::Storable::FindValue(aFMap, "myNumComponent").toLong();
if ( aNumCompCurr != aNumComp )
- return false;
+ return false;
}
if ( !myFieldsLst.isEmpty() )
if (!theData.myActors.empty()) {
for (int i = 0, iEnd = theData.myActors.size(); i < iEnd; i++) {
if (theData.myActors[i] != 0) {
- theData.myActors[i]->RemoveFromRender(aRen);
+ theData.myActors[i]->RemoveFromRender(aRen);
}
}
theData.myActors.clear();
if (!theData.myPrs.empty()) {
for (int i = 0, iEnd = theData.myPrs.size(); i < iEnd; i++)
if (theData.myPrs[i] != 0) {
- theData.myPrs[i]->_remove_ref();
+ theData.myPrs[i]->_remove_ref();
}
theData.myPrs.clear();
}
template<class TPrs3d>
void
GeneratePresentations(_PTR(Study) theStudy,
- FieldData& theData,
- VISU::Result_i* theResult,
- bool theIsRangeDefined,
- CORBA::Double theTimeMin,
- CORBA::Double theTimeMax,
- QList<long> theSequence)
+ FieldData& theData,
+ VISU::Result_i* theResult,
+ bool theIsRangeDefined,
+ CORBA::Double theTimeMin,
+ CORBA::Double theTimeMax,
+ QList<long> theSequence)
{
_PTR(ChildIterator) anIter = theStudy->NewChildIterator(theData.myField);
anIter->Next(); // First is reference on support
long aSequenceIndex = 1;
for(; anIter->More(); anIter->Next(), aSequenceIndex++){
if (aFrameId == theData.myNbTimes) {
- MESSAGE("There are extra timestamps in field");
- return;
+ MESSAGE("There are extra timestamps in field");
+ return;
}
_PTR(SObject) aTimeStamp = anIter->Value();
if(!aTimeStamp)
- continue;
+ continue;
long aSequenceId = -1;
theData.myTiming[aFrameId] = VISU_TimeAnimation::getTimeValue(aTimeStamp);
if (theIsRangeDefined) {
- if (theData.myTiming[aFrameId] < theTimeMin)
- continue;
- if (theData.myTiming[aFrameId] > theTimeMax)
- break;
+ if (theData.myTiming[aFrameId] < theTimeMin)
+ continue;
+ if (theData.myTiming[aFrameId] > theTimeMax)
+ break;
}
else if (isSequenceDefined) {
- aSequenceId = theSequence.indexOf( aSequenceIndex );
- if( aSequenceId == -1 )
- continue;
+ aSequenceId = theSequence.indexOf( aSequenceIndex );
+ if( aSequenceId == -1 )
+ continue;
}
VISU::Storable::TRestoringMap aTimeMap = VISU::Storable::GetStorableMap(aTimeStamp);
#endif
if(aPresent->Apply(false)){
/*
- if(isSequenceDefined)
- {
- theData.myPrs[aSequenceId] = aPresent;
- aFrameId++;
- }
- else
+ if(isSequenceDefined)
+ {
+ theData.myPrs[aSequenceId] = aPresent;
+ aFrameId++;
+ }
+ else
*/
theData.myPrs[aFrameId++] = aPresent;
anIsCreated = true;
INFOS("Unknown exception was occured!");
}
if(!anIsCreated)
- aPresent->_remove_ref();
+ aPresent->_remove_ref();
}
theData.myNbFrames = aFrameId;
if (theData.myPrsType != VISU::TGAUSSPOINTS) {
for(long aFrameId = 0; aFrameId < theData.myNbFrames; aFrameId++) {
- if (VISU::ScalarMap_i* aPrs = dynamic_cast<VISU::ScalarMap_i*>(theData.myPrs[aFrameId])){
- aPrs->SetOffset(theData.myOffset);
- }
+ if (VISU::ScalarMap_i* aPrs = dynamic_cast<VISU::ScalarMap_i*>(theData.myPrs[aFrameId])){
+ aPrs->SetOffset(theData.myOffset);
+ }
}
}
}
switch (aData.myPrsType) {
case VISU::TSCALARMAP:
GeneratePresentations<ScalarMap_i>(myStudy,
- aData,
- aResult,
- isRangeDefined(),
- myTimeMinVal,
- myTimeMaxVal,
- aSequence);
+ aData,
+ aResult,
+ isRangeDefined(),
+ myTimeMinVal,
+ myTimeMaxVal,
+ aSequence);
break;
case VISU::TISOSURFACES: // Iso Surfaces
GeneratePresentations<IsoSurfaces_i>(myStudy,
- aData,
- aResult,
- isRangeDefined(),
- myTimeMinVal,
- myTimeMaxVal,
- aSequence);
+ aData,
+ aResult,
+ isRangeDefined(),
+ myTimeMinVal,
+ myTimeMaxVal,
+ aSequence);
break;
case VISU::TCUTPLANES: // Cut Planes
GeneratePresentations<CutPlanes_i>(myStudy,
- aData,
- aResult,
- isRangeDefined(),
- myTimeMinVal,
- myTimeMaxVal,
- aSequence);
+ aData,
+ aResult,
+ isRangeDefined(),
+ myTimeMinVal,
+ myTimeMaxVal,
+ aSequence);
break;
case VISU::TCUTLINES: // Cut Lines
GeneratePresentations<CutLines_i>(myStudy,
- aData,
- aResult,
- isRangeDefined(),
- myTimeMinVal,
- myTimeMaxVal,
- aSequence);
+ aData,
+ aResult,
+ isRangeDefined(),
+ myTimeMinVal,
+ myTimeMaxVal,
+ aSequence);
break;
case VISU::TCUTSEGMENT: // Cut Segment
GeneratePresentations<CutSegment_i>(myStudy,
- aData,
- aResult,
- isRangeDefined(),
- myTimeMinVal,
- myTimeMaxVal,
- aSequence);
+ aData,
+ aResult,
+ isRangeDefined(),
+ myTimeMinVal,
+ myTimeMaxVal,
+ aSequence);
break;
case VISU::TPLOT3D: // Plot3d
GeneratePresentations<Plot3D_i>(myStudy,
- aData,
- aResult,
- isRangeDefined(),
- myTimeMinVal,
- myTimeMaxVal,
- aSequence);
+ aData,
+ aResult,
+ isRangeDefined(),
+ myTimeMinVal,
+ myTimeMaxVal,
+ aSequence);
break;
case VISU::TDEFORMEDSHAPE: // Deformed Shape
GeneratePresentations<DeformedShape_i>(myStudy,
- aData,
- aResult,
- isRangeDefined(),
- myTimeMinVal,
- myTimeMaxVal,
- aSequence);
+ aData,
+ aResult,
+ isRangeDefined(),
+ myTimeMinVal,
+ myTimeMaxVal,
+ aSequence);
break;
case VISU::TVECTORS: // Vectors
GeneratePresentations<Vectors_i>(myStudy,
- aData,
- aResult,
- isRangeDefined(),
- myTimeMinVal,
- myTimeMaxVal,
- aSequence);
+ aData,
+ aResult,
+ isRangeDefined(),
+ myTimeMinVal,
+ myTimeMaxVal,
+ aSequence);
break;
case VISU::TSTREAMLINES: // Stream Lines
GeneratePresentations<StreamLines_i>(myStudy,
- aData,
- aResult,
- isRangeDefined(),
- myTimeMinVal,
- myTimeMaxVal,
- aSequence);
+ aData,
+ aResult,
+ isRangeDefined(),
+ myTimeMinVal,
+ myTimeMaxVal,
+ aSequence);
break;
case VISU::TGAUSSPOINTS: // Gauss Points
GeneratePresentations<GaussPoints_i>(myStudy,
- aData,
- aResult,
- isRangeDefined(),
- myTimeMinVal,
- myTimeMaxVal,
- aSequence);
+ aData,
+ aResult,
+ isRangeDefined(),
+ myTimeMinVal,
+ myTimeMaxVal,
+ aSequence);
break;
case VISU::TSCALARMAPONDEFORMEDSHAPE: // Scalar map on deformed shape
case VISU::TDEFORMEDSHAPEANDSCALARMAP:
GeneratePresentations<DeformedShapeAndScalarMap_i>(myStudy,
- aData,
- aResult,
- isRangeDefined(),
- myTimeMinVal,
- myTimeMaxVal,
- aSequence);
+ aData,
+ aResult,
+ isRangeDefined(),
+ myTimeMinVal,
+ myTimeMaxVal,
+ aSequence);
break;
default:
MESSAGE("Not implemented for this presentation type: " << aData.myPrsType);
if (theFieldNum == getNbFields() - 1) {
if ( aData.myPrsType != VISU::TGAUSSPOINTS && aData.myPrsType != TDEFORMEDSHAPEANDSCALARMAP && aData.myPrsType != TSCALARMAPONDEFORMEDSHAPE) {
- // Initialize the MinMax controller
- VISU::PCompositeMinMaxController aMinMaxController(new VISU::TCompositeMinMaxController());
- if ( myAnimationMode == VISU::Animation::PARALLEL ) {
- FieldData& aFieldData = getFieldData(theFieldNum);
- VISU::ColoredPrs3d_i* aPrs3d = aFieldData.myPrs[0];
- aMinMaxController->AddController( aPrs3d, VISU::CreateDefaultMinMaxController( aPrs3d ) );
- } else {
- for (int aFieldId = 0; aFieldId < getNbFields(); aFieldId++) {
- FieldData& aFieldData = getFieldData(aFieldId);
- VISU::ColoredPrs3d_i* aPrs3d = aFieldData.myPrs[0];
- aMinMaxController->AddController( aPrs3d, VISU::CreateDefaultMinMaxController( aPrs3d ) );
- }
- }
-
- double aMin = getMinFieldsValue(myFieldsLst);
- double aMax = getMaxFieldsValue(myFieldsLst);
-
- for (int aFieldId = 0; aFieldId < getNbFields(); aFieldId++) {
- FieldData& aFieldData = getFieldData(aFieldId);
- for (long aFrameId = 0; aFrameId < aFieldData.myNbFrames; aFrameId++) {
- VISU::ColoredPrs3d_i* aPrs3d = aFieldData.myPrs[aFrameId];
- aPrs3d->SetMinMaxController(aMinMaxController);
- if (VISU::IsoSurfaces_i* anIsoSurfaces = dynamic_cast<VISU::IsoSurfaces_i*>(aPrs3d))
- anIsoSurfaces->SetSubRange(aMin, aMax);
- }
- }
+ // Initialize the MinMax controller
+ VISU::PCompositeMinMaxController aMinMaxController(new VISU::TCompositeMinMaxController());
+ if ( myAnimationMode == VISU::Animation::PARALLEL ) {
+ FieldData& aFieldData = getFieldData(theFieldNum);
+ VISU::ColoredPrs3d_i* aPrs3d = aFieldData.myPrs[0];
+ aMinMaxController->AddController( aPrs3d, VISU::CreateDefaultMinMaxController( aPrs3d ) );
+ } else {
+ for (int aFieldId = 0; aFieldId < getNbFields(); aFieldId++) {
+ FieldData& aFieldData = getFieldData(aFieldId);
+ VISU::ColoredPrs3d_i* aPrs3d = aFieldData.myPrs[0];
+ aMinMaxController->AddController( aPrs3d, VISU::CreateDefaultMinMaxController( aPrs3d ) );
+ }
+ }
+
+ double aMin = getMinFieldsValue(myFieldsLst);
+ double aMax = getMaxFieldsValue(myFieldsLst);
+
+ for (int aFieldId = 0; aFieldId < getNbFields(); aFieldId++) {
+ FieldData& aFieldData = getFieldData(aFieldId);
+ for (long aFrameId = 0; aFrameId < aFieldData.myNbFrames; aFrameId++) {
+ VISU::ColoredPrs3d_i* aPrs3d = aFieldData.myPrs[aFrameId];
+ aPrs3d->SetMinMaxController(aMinMaxController);
+ if (VISU::IsoSurfaces_i* anIsoSurfaces = dynamic_cast<VISU::IsoSurfaces_i*>(aPrs3d))
+ anIsoSurfaces->SetSubRange(aMin, aMax);
+ }
+ }
}
}
}
for (long j = 0; j < aData.myNbFrames; j++) {
VISU_Actor* aActor = NULL;
try{
- aData.myPrs[j]->SetOffset(aData.myOffset);
- aActor = aData.myPrs[j]->CreateActor();
- myView->AddActor(aActor);
- bool condition = ( myAnimationMode == VISU::Animation::PARALLEL ) ? (j == 0) : (j == 0 && i == 0);
- if(condition)
- aActor->VisibilityOn();
- else
- aActor->VisibilityOff();
+ aData.myPrs[j]->SetOffset(aData.myOffset);
+ aActor = aData.myPrs[j]->CreateActor();
+ myView->AddActor(aActor);
+ bool condition = ( myAnimationMode == VISU::Animation::PARALLEL ) ? (j == 0) : (j == 0 && i == 0);
+ if(condition)
+ aActor->VisibilityOn();
+ else
+ aActor->VisibilityOff();
}catch(...){ //catch(std::runtime_error& exc){
- aNoError = false;
- myLastError += QString("%1 ").arg(aData.myTiming[j]);
+ aNoError = false;
+ myLastError += QString("%1 ").arg(aData.myTiming[j]);
}
aData.myActors[j] = aActor;
}
myFrame = 0;
myLastError += QString(" timestamp(s) cannot be created.");
ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
- myFrame, myFieldsLst[0].myTiming[myFrame]));
+ myFrame, myFieldsLst[0].myTiming[myFrame]));
myView->Repaint();
return aNoError;
}
FieldData& aData = myFieldsLst[i];
if (!aData.myActors.empty()) {
for (int i = 0, iEnd = aData.myActors.size(); i < iEnd; i++) {
- if (aData.myActors[i] != 0) {
- aData.myActors[i]->RemoveFromRender(aRen);
- }
+ if (aData.myActors[i] != 0) {
+ aData.myActors[i]->RemoveFromRender(aRen);
+ }
}
aData.myActors.clear();
}
if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
for (i = 0; i < getNbFields(); i++)
- if (myFieldsLst[i].myActors[myFrame] != 0)
- visibilityOff(i, myFrame);
+ if (myFieldsLst[i].myActors[myFrame] != 0)
+ visibilityOff(i, myFrame);
}
else { //successive animation mode
aPair = getRelativeFrameNumber(myFrame);
aFieldId = aPair.first;
aFrameId = aPair.second;
if (myFieldsLst[aFieldId].myActors[aFrameId] != 0)
- visibilityOff(aFieldId, aFrameId);
+ visibilityOff(aFieldId, aFrameId);
}
myFrame++;
if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
for (i = 0; i < getNbFields(); i++)
- if (myFieldsLst[i].myActors[myFrame] != 0)
- myFieldsLst[i].myActors[myFrame]->VisibilityOn();
+ if (myFieldsLst[i].myActors[myFrame] != 0)
+ myFieldsLst[i].myActors[myFrame]->VisibilityOn();
ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
- myFrame, myFieldsLst[0].myTiming[myFrame]));
+ myFrame, myFieldsLst[0].myTiming[myFrame]));
}
else { //successive animation mode
aPair = getRelativeFrameNumber(myFrame);
aFieldId = aPair.first;
aFrameId = aPair.second;
if (myFieldsLst[aFieldId].myActors[aFrameId] != 0)
- myFieldsLst[aFieldId].myActors[aFrameId]->VisibilityOn();
+ myFieldsLst[aFieldId].myActors[aFrameId]->VisibilityOn();
ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
- myFrame, myFieldsLst[aFieldId].myTiming[aFrameId]));
+ myFrame, myFieldsLst[aFieldId].myTiming[aFrameId]));
}
myView->Repaint();
}
if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
for (i = 0; i < getNbFields(); i++)
- if (myFieldsLst[i].myActors[myFrame] != 0)
- visibilityOff(i, myFrame);
+ if (myFieldsLst[i].myActors[myFrame] != 0)
+ visibilityOff(i, myFrame);
}
else { //successive animation mode
aPair = getRelativeFrameNumber(myFrame);
aFieldId = aPair.first;
aFrameId = aPair.second;
if (myFieldsLst[aFieldId].myActors[aFrameId] != 0)
- visibilityOff(aFieldId, aFrameId);
+ visibilityOff(aFieldId, aFrameId);
}
myFrame--;
if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
for (i = 0; i < getNbFields(); i++)
- if (myFieldsLst[i].myActors[myFrame] != 0)
- myFieldsLst[i].myActors[myFrame]->VisibilityOn();
+ if (myFieldsLst[i].myActors[myFrame] != 0)
+ myFieldsLst[i].myActors[myFrame]->VisibilityOn();
ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
- myFrame, myFieldsLst[0].myTiming[myFrame]));
+ myFrame, myFieldsLst[0].myTiming[myFrame]));
}
else { //successive animation mode
aPair = getRelativeFrameNumber(myFrame);
aFieldId = aPair.first;
aFrameId = aPair.second;
if (myFieldsLst[aFieldId].myActors[aFrameId] != 0)
- myFieldsLst[aFieldId].myActors[aFrameId]->VisibilityOn();
+ myFieldsLst[aFieldId].myActors[aFrameId]->VisibilityOn();
ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
- myFrame, myFieldsLst[aFieldId].myTiming[aFrameId]));
+ myFrame, myFieldsLst[aFieldId].myTiming[aFrameId]));
}
myView->Repaint();
}
if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
for (i = 0; i < getNbFields(); i++)
if(!myFieldsLst[i].myActors.empty())
- if (myFieldsLst[i].myActors[myFrame] != 0)
- visibilityOff(i, myFrame);
+ if (myFieldsLst[i].myActors[myFrame] != 0)
+ visibilityOff(i, myFrame);
}
else { //successive animation mode
std::pair<int,long> aPair = getRelativeFrameNumber(myFrame);
long aFrameId = aPair.second;
if(!myFieldsLst[aFieldId].myActors.empty())
if (myFieldsLst[aFieldId].myActors[aFrameId] != 0)
- visibilityOff(aFieldId, aFrameId);
+ visibilityOff(aFieldId, aFrameId);
}
myFrame = 0;
for (i = 0; i < imax; i++)
if(!myFieldsLst[i].myActors.empty())
if (myFieldsLst[i].myActors[myFrame] != 0)
- myFieldsLst[i].myActors[myFrame]->VisibilityOn();
+ myFieldsLst[i].myActors[myFrame]->VisibilityOn();
if(!myFieldsLst[0].myTiming.empty()){
ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
- myFrame, myFieldsLst[0].myTiming[myFrame]));
+ myFrame, myFieldsLst[0].myTiming[myFrame]));
myView->Repaint();
}
}
if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
for (i = 0; i < getNbFields(); i++)
if (myFieldsLst[i].myActors[myFrame] != 0)
- visibilityOff(i, myFrame);
+ visibilityOff(i, myFrame);
}
else { //successive animation mode
aPair = getRelativeFrameNumber(myFrame);
if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
for (i = 0; i < getNbFields(); i++)
if (myFieldsLst[i].myActors[myFrame] != 0)
- myFieldsLst[i].myActors[myFrame]->VisibilityOn();
+ myFieldsLst[i].myActors[myFrame]->VisibilityOn();
ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
- myFrame, myFieldsLst[0].myTiming[myFrame]));
+ myFrame, myFieldsLst[0].myTiming[myFrame]));
}
else { //successive animation mode
aPair = getRelativeFrameNumber(myFrame);
aFieldId = aPair.first;
aFrameId = aPair.second;
if (myFieldsLst[aFieldId].myActors[aFrameId] != 0)
- myFieldsLst[aFieldId].myActors[aFrameId]->VisibilityOn();
+ myFieldsLst[aFieldId].myActors[aFrameId]->VisibilityOn();
ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
- myFrame, myFieldsLst[aFieldId].myTiming[aFrameId]));
+ myFrame, myFieldsLst[aFieldId].myTiming[aFrameId]));
}
myView->Repaint();
if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
for (i = 0; i < getNbFields(); i++)
if (myFieldsLst[i].myActors[myFrame] != 0)
- visibilityOff(i, myFrame);
+ visibilityOff(i, myFrame);
}
else { //successive animation mode
aPair = getRelativeFrameNumber(myFrame);
aFieldId = aPair.first;
aFrameId = aPair.second;
if (myFieldsLst[aFieldId].myActors[aFrameId] != 0)
- visibilityOff(aFieldId, aFrameId);
+ visibilityOff(aFieldId, aFrameId);
}
myFrame = theFrame;
if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
for (i = 0; i < getNbFields(); i++)
if (myFieldsLst[i].myActors[myFrame] != 0)
- myFieldsLst[i].myActors[myFrame]->VisibilityOn();
+ myFieldsLst[i].myActors[myFrame]->VisibilityOn();
ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
- myFrame, myFieldsLst[0].myTiming[myFrame]));
+ myFrame, myFieldsLst[0].myTiming[myFrame]));
}
else { //successive animation mode
aPair = getRelativeFrameNumber(myFrame);
aFieldId = aPair.first;
aFrameId = aPair.second;
if (myFieldsLst[aFieldId].myActors[aFrameId] != 0)
- myFieldsLst[aFieldId].myActors[aFrameId]->VisibilityOn();
+ myFieldsLst[aFieldId].myActors[aFrameId]->VisibilityOn();
ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
- myFrame, myFieldsLst[aFieldId].myTiming[aFrameId]));
+ myFrame, myFieldsLst[aFieldId].myTiming[aFrameId]));
}
myView->Repaint();
}
else { //successive animation mode
if ( aFieldId == 0 && aFrameNum <= myFieldsAbsFrames[aFieldId] )
- aRes = aFrameNum;
+ aRes = aFrameNum;
else if ( aFieldId && aFrameNum <= myFieldsAbsFrames[aFieldId] - myFieldsAbsFrames[aFieldId-1] )
- aRes = myFieldsAbsFrames[aFieldId-1] + aFrameNum;
+ aRes = myFieldsAbsFrames[aFieldId-1] + aFrameNum;
}
}
return aRes - 1;
}
else { //successive animation mode
for (int i = 0, iEnd = myFieldsAbsFrames.size(); i < iEnd; i++)
- if ( myFieldsAbsFrames[i] >= theFrame ) {
- aRes.first = i;
- if ( i == 0 )
- aRes.second = theFrame - 1;
- else
- aRes.second = theFrame-myFieldsAbsFrames[i-1] - 1;
- break;
- }
+ if ( myFieldsAbsFrames[i] >= theFrame ) {
+ aRes.first = i;
+ if ( i == 0 )
+ aRes.second = theFrame - 1;
+ else
+ aRes.second = theFrame-myFieldsAbsFrames[i-1] - 1;
+ break;
+ }
}
}
return aRes;
if (myExecutionState->IsActive()) {
for (int i = 0; i < getNbFields(); i++) {
FieldData& aData = myFieldsLst[i];
- if (aData.myNbFrames == 0)
- continue;
+ if (aData.myNbFrames == 0)
+ continue;
if (myFrame > 0) {
if (aData.myActors[myFrame-1] != 0)
visibilityOff(i, myFrame-1);
} else {
- if (aData.myActors[aData.myNbFrames-1] != 0)
- visibilityOff(i, aData.myNbFrames-1);
+ if (aData.myActors[aData.myNbFrames-1] != 0)
+ visibilityOff(i, aData.myNbFrames-1);
}
if (aData.myActors[myFrame] != 0 && myView) {
ProcessVoidEvent(new TVoidMemFunEvent<VISU_Actor>(aData.myActors[myFrame],
}
}
if (!myView)
- return;
+ return;
bool repainArg = false;
ProcessVoidEvent(new TVoidMemFun1ArgEvent<SVTK_ViewWindow,bool>(myView,
&SVTK_ViewWindow::Repaint,
// We must unlock mutex for some time before grabbing to allow view updating
msleep(delay);
if (!myExecutionState->IsActive())
- return;
+ return;
if (!(aFirstFieldData.myField)) // break, if field was deleted.
- break;
+ break;
saveImages( 0, aOneVal, aNbFiles, theIndexList );
}
if (myFrame == aFirstFieldData.myNbFrames) {
if (!myCycling) {
aHasNextFrame = false;
- myFrame--;
+ myFrame--;
}
else
- myFrame = 0;
+ myFrame = 0;
}
} // while (aHasNextFrame && myExecutionState->IsActive())
}
if ( !aData.myPrs[0] ) continue;
for (; aFrame < aData.myNbFrames && myExecutionState->IsActive(); aFrame++, myFrame++)
{
- ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>
+ ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>
(this, &VISU_TimeAnimation::_emitFrameChanged,
myFrame, myFieldsLst[aFieldId].myTiming[aFrame]));
- if (myExecutionState->IsActive()) {
+ if (myExecutionState->IsActive()) {
if (aFrame > 0) {
if (aData.myActors[aFrame-1] != 0)
visibilityOff(aFieldId, aFrame-1);
&VISU_Actor::VisibilityOn));
}
- if (!myView)
- return;
+ if (!myView)
+ return;
bool repainArg = false;
ProcessVoidEvent(new TVoidMemFun1ArgEvent<SVTK_ViewWindow,bool>(myView,
&SVTK_ViewWindow::Repaint,
repainArg));
- }
-
- k = 1;
- if (myProportional) {
- switch (aFrame) {
- case 0:
- break;
- case 1:
- if (aFirstFieldData.myNbFrames > 2)
- k = (aFirstFieldData.myTiming[aFrame+1] -
- aFirstFieldData.myTiming[aFrame]) / aOneVal;
- break;
- default:
- if (aFrame < (aFirstFieldData.myNbFrames - 1))
- k = (aFirstFieldData.myTiming[aFrame+1] -
- aFirstFieldData.myTiming[aFrame]) / aOneVal;
- }
- }
- int delay = (int)(1000. * k / mySpeed);
- theIsDumping = !myDumpPath.isEmpty();
- if (delay < 1 && theIsDumping) {
- // We must unlock mutex for some time before grabbing to allow view updating
- delay = 1;
- }
- msleep(delay);
-
- if (!myExecutionState->IsActive()) return;
-
- if (theIsDumping) {
- // We must unlock mutex for some time before grabbing to allow view updating
- msleep(delay);
- if (!myExecutionState->IsActive()) return;
-
- if (!(myFieldsLst[aFieldId].myField)) // break, if field was deleted.
- break;
-
- saveImages( aFieldId, aOneVal, aNbFiles, theIndexList );
- }
+ }
+
+ k = 1;
+ if (myProportional) {
+ switch (aFrame) {
+ case 0:
+ break;
+ case 1:
+ if (aFirstFieldData.myNbFrames > 2)
+ k = (aFirstFieldData.myTiming[aFrame+1] -
+ aFirstFieldData.myTiming[aFrame]) / aOneVal;
+ break;
+ default:
+ if (aFrame < (aFirstFieldData.myNbFrames - 1))
+ k = (aFirstFieldData.myTiming[aFrame+1] -
+ aFirstFieldData.myTiming[aFrame]) / aOneVal;
+ }
+ }
+ int delay = (int)(1000. * k / mySpeed);
+ theIsDumping = !myDumpPath.isEmpty();
+ if (delay < 1 && theIsDumping) {
+ // We must unlock mutex for some time before grabbing to allow view updating
+ delay = 1;
+ }
+ msleep(delay);
+
+ if (!myExecutionState->IsActive()) return;
+
+ if (theIsDumping) {
+ // We must unlock mutex for some time before grabbing to allow view updating
+ msleep(delay);
+ if (!myExecutionState->IsActive()) return;
+
+ if (!(myFieldsLst[aFieldId].myField)) // break, if field was deleted.
+ break;
+
+ saveImages( aFieldId, aOneVal, aNbFiles, theIndexList );
+ }
} // for (; aFrame < aData.myNbFrames && myExecutionState->IsActive(); aFrame++, myFrame++)
} // for (int aFieldId = 0;
//------------------------------------------------------------------------
void VISU_TimeAnimation::saveImages( int theFieldId,
- double& theOneVal, int& theNbFiles,
- QList<int>& theIndexList )
+ double& theOneVal, int& theNbFiles,
+ QList<int>& theIndexList )
{
if (myDumpFormat.compare("AVI") != 0) {
QString aFile(myDumpPath);
aFile += ".";
aFile += myDumpFormat.toLower();
ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
- (myView,&SVTK_ViewWindow::RefreshDumpImage)); // IPAL13602
+ (myView,&SVTK_ViewWindow::RefreshDumpImage)); // IPAL13602
ProcessEvent(new TMemFun2ArgEvent<SUIT_ViewWindow,bool,const QString&,const QString&>
- (myView,&SUIT_ViewWindow::dumpViewToFormat,aFile,myDumpFormat));
+ (myView,&SUIT_ViewWindow::dumpViewToFormat,aFile,myDumpFormat));
} else {
QFileInfo aFileInfo(myDumpPath);
QString aDirPath = aFileInfo.absolutePath();
break;
default:
if (myProportional) {
- FieldData& aFirstFieldData = myFieldsLst[0];
- double p = (aFirstFieldData.myTiming[myFrame] -
- aFirstFieldData.myTiming[myFrame-1]) / theOneVal;
- myFileIndex += (long) (5*p);
+ FieldData& aFirstFieldData = myFieldsLst[0];
+ double p = (aFirstFieldData.myTiming[myFrame] -
+ aFirstFieldData.myTiming[myFrame-1]) / theOneVal;
+ myFileIndex += (long) (5*p);
} else {
- myFileIndex += 5;
+ myFileIndex += 5;
}
}
int height = img.height(); height = (height/16)*16;
QImage copy = img.copy(0, 0, width, height);
if (copy.save(aFile, "JPEG")) {
- theIndexList.append(myFileIndex);
- theNbFiles++;
+ theIndexList.append(myFileIndex);
+ theNbFiles++;
}
}
}
aFFile += QString("_%1.jpeg");
int aStartIndex = anIndexList[0], anEndIndex;
for (int i = 1; i < anIndexList.count(); i++) {
- anEndIndex = anIndexList[i];
- QString aCurFile = aFFile.arg(QString::number(aStartIndex).rightJustified(8, '0'));
- QStringList aCommands;
- for (int j = aStartIndex+1; j < anEndIndex; j++) {
- QString aFile = aFFile.arg(QString::number(j).rightJustified(8, '0'));
- aCommands.append(QString("ln -s %1 %2").arg(aCurFile).arg(aFile));
- }
- system(aCommands.join(" ; \\\n").toLatin1().data());
- aStartIndex = anEndIndex;
+ anEndIndex = anIndexList[i];
+ QString aCurFile = aFFile.arg(QString::number(aStartIndex).rightJustified(8, '0'));
+ QStringList aCommands;
+ for (int j = aStartIndex+1; j < anEndIndex; j++) {
+ QString aFile = aFFile.arg(QString::number(j).rightJustified(8, '0'));
+ aCommands.append(QString("ln -s %1 %2").arg(aCurFile).arg(aFile));
+ }
+ system(aCommands.join(" ; \\\n").toLatin1().data());
+ aStartIndex = anEndIndex;
}
}
ok = false;
int aLeftIndex = aLeftIndexStr.toLong( &ok );
if( !ok )
- continue;
+ continue;
ok = false;
int aRightIndex = aRightIndexStr.toLong( &ok );
if( !ok )
- continue;
+ continue;
if( aLeftIndex >= aRightIndex )
- continue;
+ continue;
for( int i = aLeftIndex; i <= aRightIndex; i++ )
- theIndices.append( i );
+ theIndices.append( i );
isCorrect = true;
}
{
if (myStudy->GetProperties()->IsLocked()) {
SUIT_MessageBox::warning(0,
- QObject::tr("WRN_VISU_WARNING"),
- QObject::tr("WRN_STUDY_LOCKED"),
- QObject::tr("BUT_OK"));
+ QObject::tr("WRN_VISU_WARNING"),
+ QObject::tr("WRN_STUDY_LOCKED"),
+ QObject::tr("BUT_OK"));
return SALOMEDS::SObject::_nil();
}
QString aComment;
aComment.sprintf("myComment=ANIMATION;myTimeMinVal=%g;myTimeMaxVal=%g;mySequence=%s;myMode=%d",
myTimeMinVal,
- myTimeMaxVal,
- mySequence.toLatin1().data(),
- myAnimationMode);
+ myTimeMaxVal,
+ mySequence.toLatin1().data(),
+ myAnimationMode);
string anEntry = VISU::CreateAttributes(myStudy,
- aSComponentEntry.c_str(),
- VISU::NO_ICON,
- VISU::NO_IOR,
+ aSComponentEntry.c_str(),
+ VISU::NO_ICON,
+ VISU::NO_IOR,
GenerateName().toLatin1().data(),
- VISU::NO_PERFSITENT_REF,
- aComment.toLatin1().data(),
- true);
+ VISU::NO_PERFSITENT_REF,
+ aComment.toLatin1().data(),
+ true);
myAnimEntry = anEntry.c_str();
_PTR(SObject) aAnimSObject = myStudy->FindObjectID(anEntry.c_str());
string aPrsComment = strOut.str();
string aPrsMyComment = aData.myPrs[0]->GetComment();
if(aPrsMyComment == "PRSMERGER")
- aPrsMyComment = "SCALARMAP";
+ aPrsMyComment = "SCALARMAP";
VISU::CreateAttributes(myStudy,
- newObj->GetID().c_str(),
- VISU::NO_ICON,
- VISU::NO_IOR,
- aPrsMyComment.c_str(),
- VISU::NO_PERFSITENT_REF,
- aPrsComment.c_str(),
- true);
+ newObj->GetID().c_str(),
+ VISU::NO_ICON,
+ VISU::NO_IOR,
+ aPrsMyComment.c_str(),
+ VISU::NO_PERFSITENT_REF,
+ aPrsComment.c_str(),
+ true);
}
}
aStudyBuilder->CommitCommand();
QString aComment;
aComment.sprintf("myComment=ANIMATION;myTimeMinVal=%g;myTimeMaxVal=%g;mySequence=%s;myMode=%d",
myTimeMinVal,
- myTimeMaxVal,
- mySequence.toLatin1().data(),
- myAnimationMode);
+ myTimeMaxVal,
+ mySequence.toLatin1().data(),
+ myAnimationMode);
_PTR(GenericAttribute) anAttr;
anAttr = aStudyBuilder->FindOrCreateAttribute(aAnimSObject, "AttributeString");
} else {
VISU::CreateAttributes(myStudy,
- aRefObj->GetID().c_str(),
- VISU::NO_ICON,
- VISU::NO_IOR,
+ aRefObj->GetID().c_str(),
+ VISU::NO_ICON,
+ VISU::NO_IOR,
aPrsNameTxt.c_str(),
- VISU::NO_PERFSITENT_REF,
- aPrsComment.c_str(),
- true);
+ VISU::NO_PERFSITENT_REF,
+ aPrsComment.c_str(),
+ true);
}
}
aStudyBuilder->CommitCommand();
}
for (int i = 1; i < aData.myNbFrames; i++) {
if (!aData.myPrs[0])
- continue;
+ continue;
bool anIsFixedRange = false;
if (aData.myPrsType != VISU::TGAUSSPOINTS) {
- if (VISU::ScalarMap_i* aPrs = dynamic_cast<VISU::ScalarMap_i*>(aData.myPrs[i]))
- anIsFixedRange = aPrs->IsRangeFixed();
+ if (VISU::ScalarMap_i* aPrs = dynamic_cast<VISU::ScalarMap_i*>(aData.myPrs[i]))
+ anIsFixedRange = aPrs->IsRangeFixed();
}
if (aData.myPrsType == VISU::TDEFORMEDSHAPEANDSCALARMAP) {
- if (VISU::DeformedShapeAndScalarMap_i* aDeformedPrs =
- dynamic_cast<VISU::DeformedShapeAndScalarMap_i*>(aData.myPrs[i])) {
- //Set correct time stamp number
- int aTimeStampNum = aDeformedPrs->GetScalarTimeStampNumber();
- aDeformedPrs->SameAs(aData.myPrs[0]);
- aDeformedPrs->SetScalarField(aDeformedPrs->GetScalarEntity(),
- aDeformedPrs->GetScalarFieldName(),
- aTimeStampNum);
- }
+ if (VISU::DeformedShapeAndScalarMap_i* aDeformedPrs =
+ dynamic_cast<VISU::DeformedShapeAndScalarMap_i*>(aData.myPrs[i])) {
+ //Set correct time stamp number
+ int aTimeStampNum = aDeformedPrs->GetScalarTimeStampNumber();
+ aDeformedPrs->SameAs(aData.myPrs[0]);
+ aDeformedPrs->SetScalarField(aDeformedPrs->GetScalarEntity(),
+ aDeformedPrs->GetScalarFieldName(),
+ aTimeStampNum);
+ }
}
else
- aData.myPrs[i]->SameAs(aData.myPrs[0]);
+ aData.myPrs[i]->SameAs(aData.myPrs[0]);
}
}
string aStr = aAnimSObject->GetID();
if ( !aPrs_i )
THROW_SALOME_CORBA_EXCEPTION("Error : invalid dynamic cast of the given presentation to VISU::ColoredPrs3d_i",
- SALOME::INTERNAL_ERROR);
+ SALOME::INTERNAL_ERROR);
if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
FieldData& aData = myFieldsLst[theFieldNum];
if ( aData.myPrs.empty() )
THROW_SALOME_CORBA_EXCEPTION("Error : presentations for the given field is not yet created!",
- SALOME::INTERNAL_ERROR);
+ SALOME::INTERNAL_ERROR);
if ( aPrs_i->GetCResult() != aData.myPrs[0]->GetCResult() )
THROW_SALOME_CORBA_EXCEPTION("Error : the MED file is not the same!",
- SALOME::INTERNAL_ERROR);
+ SALOME::INTERNAL_ERROR);
for (int i = 0; i < aData.myNbFrames; i++) {
bool anIsFixedRange = false;
if (aData.myPrsType != VISU::TGAUSSPOINTS) {
- if (VISU::ScalarMap_i* aPrs = dynamic_cast<VISU::ScalarMap_i*>(aData.myPrs[i]))
- anIsFixedRange = aPrs->IsRangeFixed();
+ if (VISU::ScalarMap_i* aPrs = dynamic_cast<VISU::ScalarMap_i*>(aData.myPrs[i]))
+ anIsFixedRange = aPrs->IsRangeFixed();
}
aData.myPrs[i]->SameAs(aPrs_i);
}
FieldData& aData = myFieldsLst[f];
if ( aData.myPrs.empty() )
- THROW_SALOME_CORBA_EXCEPTION("Error : presentations for the given field is not yet created!",
- SALOME::INTERNAL_ERROR);
+ THROW_SALOME_CORBA_EXCEPTION("Error : presentations for the given field is not yet created!",
+ SALOME::INTERNAL_ERROR);
for (int i = 0; i < aData.myNbFrames; i++) {
- aData.myPrs[i]->SameAs(aPrs_i);
+ aData.myPrs[i]->SameAs(aPrs_i);
}
}
}
static double getTimeValue (_PTR(SObject) theTimestamp);
VISU_TimeAnimation(_PTR(Study) theStudy,
- VISU::View3D_ptr theView3D = VISU::View3D::_nil());
+ VISU::View3D_ptr theView3D = VISU::View3D::_nil());
~VISU_TimeAnimation();
virtual VISU::VISUType GetType() { return VISU::TNONE;};
* Parameter \a frame may be NULL, in this case there is only update without display/erase
*/
VISU_I_EXPORT void UpdateCurve( VISU::Curve_i*,
- Plot2d_ViewFrame*,
- SPlot2d_Curve*,
- int theDisplaying );
+ Plot2d_ViewFrame*,
+ SPlot2d_Curve*,
+ int theDisplaying );
VISU_I_EXPORT void PlotTable( SalomeApp_Study*,
- Plot2d_ViewFrame*,
- VISU::Table_i*,
- int theDisplaying );
+ Plot2d_ViewFrame*,
+ VISU::Table_i*,
+ int theDisplaying );
VISU_I_EXPORT void PlotCurve( Plot2d_ViewFrame*,
- VISU::Curve_i*,
- int theDisplaying );
+ VISU::Curve_i*,
+ int theDisplaying );
VISU_I_EXPORT void PlotRemoveCurve(SalomeApp_Application*,
- VISU::Curve_i* );
+ VISU::Curve_i* );
VISU_I_EXPORT void PlotContainer( Plot2d_ViewFrame*,
- VISU::Container_i*,
- int theDisplaying );
+ VISU::Container_i*,
+ int theDisplaying );
VISU_I_EXPORT void CreatePlot( VISU_Gen_i*,
- Plot2d_ViewFrame*,
- _PTR(SObject) theTableSO );
+ Plot2d_ViewFrame*,
+ _PTR(SObject) theTableSO );
}
#endif
//----------------------------------------------------------------------------
VVTK_ImageWriter
::VVTK_ImageWriter(QSemaphore* theSemaphore,
- vtkImageData* theImageData,
- const std::string& theName,
- int theProgressive,
- int theQuality):
+ vtkImageData* theImageData,
+ const std::string& theName,
+ int theProgressive,
+ int theQuality):
mySemaphore(theSemaphore),
myImageData(theImageData),
myName(theName),
myImageData->Delete();
if(MYDEBUG) MESSAGE("VVTK_ImageWriter::run "<<
- "- this = "<<this<<
- //"; total = "<<mySemaphore->total()<<
- "; available = "<<mySemaphore->available() );
+ "- this = "<<this<<
+ //"; total = "<<mySemaphore->total()<<
+ "; available = "<<mySemaphore->available() );
mySemaphore->release();
}
{
public:
VVTK_ImageWriter(QSemaphore* theSemaphore,
- vtkImageData* theImageData,
- const std::string& theName,
- int theProgressive,
- int theQuality);
+ vtkImageData* theImageData,
+ const std::string& theName,
+ int theProgressive,
+ int theQuality);
~VVTK_ImageWriter();
mySemaphore = new QSemaphore(aMax);
mySemaphore->acquire( aMax );
if(MYDEBUG) MESSAGE("VVTK_ImageWriterMgr::VVTK_ImageWriterMgr "<<
- //"- total = "<<mySemaphore->total()<<
- "; available = "<<mySemaphore->available() );
+ //"- total = "<<mySemaphore->total()<<
+ "; available = "<<mySemaphore->available() );
}
void
VVTK_ImageWriterMgr
::StartImageWriter(vtkImageData *theImageData,
- const std::string& theName,
- const int theProgressive,
- const int theQuality)
+ const std::string& theName,
+ const int theProgressive,
+ const int theQuality)
{
VVTK_ImageWriter *anImageWriter =
new VVTK_ImageWriter(mySemaphore,
- theImageData,
- theName,
- theProgressive,
- theQuality);
+ theImageData,
+ theName,
+ theProgressive,
+ theQuality);
myThreads.push_back(anImageWriter);
anImageWriter->start();
::Stop()
{
if(MYDEBUG) MESSAGE("VVTK_ImageWriterMgr::Stop "<<
- //"- total = "<<mySemaphore->total()<<
- "; available = "<<mySemaphore->available() );
+ //"- total = "<<mySemaphore->total()<<
+ "; available = "<<mySemaphore->available() );
if(MYDEBUG) MESSAGE("VVTK_ImageWriterMgr::Stop - *mySemaphore += "<<myThreads.size() );
mySemaphore->acquire( myThreads.size() );
void
StartImageWriter(vtkImageData *theImageData,
- const std::string& theName,
- const int theProgressive,
- const int theQuality);
+ const std::string& theName,
+ const int theProgressive,
+ const int theQuality);
void
Stop();
void
VVTK_InteractorStyle
::OnLeftButtonDown(int ctrl, int shift,
- int x, int y)
+ int x, int y)
{
myIsLeftButtonDown = true;
else {
if (!(ctrl||shift)){
if (myIsMidButtonDown){
- startOperation(VTK_INTERACTOR_STYLE_CAMERA_ZOOM);
+ startOperation(VTK_INTERACTOR_STYLE_CAMERA_ZOOM);
}
else{
- startOperation(VTK_INTERACTOR_STYLE_CAMERA_ROTATE);
+ startOperation(VTK_INTERACTOR_STYLE_CAMERA_ROTATE);
}
}
}
void
VVTK_InteractorStyle
::OnMiddleButtonDown(int ctrl,
- int shift,
- int x, int y)
+ int shift,
+ int x, int y)
{
myIsMidButtonDown = true;
else {
if (!(ctrl||shift)){
if ( myIsLeftButtonDown ){
- startOperation(VTK_INTERACTOR_STYLE_CAMERA_ZOOM);
+ startOperation(VTK_INTERACTOR_STYLE_CAMERA_ZOOM);
}
else{
- startOperation(VTK_INTERACTOR_STYLE_CAMERA_PAN);
+ startOperation(VTK_INTERACTOR_STYLE_CAMERA_PAN);
}
}
}
void
VVTK_InteractorStyle
::ProcessEvents( vtkObject* object,
- unsigned long event,
- void* clientData,
- void* callData )
+ unsigned long event,
+ void* clientData,
+ void* callData )
{
if ( clientData ) {
vtkObject* anObject = reinterpret_cast<vtkObject*>( clientData );
if( self ){
switch ( event ) {
case VISU::SetSMDecreaseMagnificationEvent:
- self->mySMDecreaseMagnificationBtn = *((int*)callData);
- return;
+ self->mySMDecreaseMagnificationBtn = *((int*)callData);
+ return;
case VISU::SetSMIncreaseMagnificationEvent:
- self->mySMIncreaseMagnificationBtn = *((int*)callData);
- return;
+ self->mySMIncreaseMagnificationBtn = *((int*)callData);
+ return;
}
}
}
char key = pIS->GetInteractor()->GetKeyCode();
//
if (key == 'S') {
- pIS->ActionPicking();
- return false;
+ pIS->ActionPicking();
+ return false;
}
}
}
static
void
ProcessEvents(vtkObject* object,
- unsigned long event,
- void* clientData,
- void* callData );
+ unsigned long event,
+ void* clientData,
+ void* callData );
//! Redefine SVTK_InteractorStyle::onSpaceMouseButton
virtual void onSpaceMouseButton( int button );
//----------------------------------------------------------------------------
VVTK_MainWindow::VVTK_MainWindow(QWidget* theParent,
- const char* theName,
- SUIT_ResourceMgr* theResourceMgr,
- SUIT_ViewWindow* theViewWindow):
+ const char* theName,
+ SUIT_ResourceMgr* theResourceMgr,
+ SUIT_ViewWindow* theViewWindow):
SVTK_MainWindow(theParent,theName,theResourceMgr,theViewWindow),
myControllerIncrement(VVTK_ControllerIncrement::New()),
myControllerOnKeyDown(VVTK_ControllerOnKeyDown::New())
myStartAction = new QtxAction(tr("MNU_VVTK_RECORDING_START"),
- theResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_RECORDING_START" ) ),
- tr( "MNU_VVTK_RECORDING_START" ), 0, this);
+ theResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_RECORDING_START" ) ),
+ tr( "MNU_VVTK_RECORDING_START" ), 0, this);
myStartAction->setStatusTip(tr("DSC_VVTK_RECORDING_START"));
//myStartAction->addTo( myRecordingToolBar );
myRecordingToolBar->addAction( myStartAction );
connect( myStartAction, SIGNAL( triggered ( bool ) ), this, SLOT( OnStartRecording() ) );
myPlayAction = new QtxAction(tr("MNU_VVTK_RECORDING_PLAY"),
- theResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_RECORDING_PLAY" ) ),
- tr( "MNU_VVTK_RECORDING_PLAY" ), 0, this);
+ theResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_RECORDING_PLAY" ) ),
+ tr( "MNU_VVTK_RECORDING_PLAY" ), 0, this);
myPlayAction->setStatusTip(tr("DSC_VVTK_RECORDING_PLAY"));
myPlayAction->setEnabled( false );
//myPlayAction->addTo( myRecordingToolBar );
connect( myPlayAction, SIGNAL( triggered ( bool ) ), this, SLOT( OnPlayRecording() ) );
myPauseAction = new QtxAction(tr("MNU_VVTK_RECORDING_PAUSE"),
- theResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_RECORDING_PAUSE" ) ),
- tr( "MNU_VVTK_RECORDING_PAUSE" ), 0, this);
+ theResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_RECORDING_PAUSE" ) ),
+ tr( "MNU_VVTK_RECORDING_PAUSE" ), 0, this);
myPauseAction->setStatusTip(tr("DSC_VVTK_RECORDING_PAUSE"));
myPauseAction->setEnabled( false );
//myPauseAction->addTo( myRecordingToolBar );
connect( myPauseAction, SIGNAL( triggered ( bool ) ), this, SLOT( OnPauseRecording() ) );
myStopAction = new QtxAction(tr("MNU_VVTK_RECORDING_STOP"),
- theResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_RECORDING_STOP" ) ),
- tr( "MNU_VVTK_RECORDING_STOP" ), 0, this);
+ theResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_RECORDING_STOP" ) ),
+ tr( "MNU_VVTK_RECORDING_STOP" ), 0, this);
myStopAction->setStatusTip(tr("DSC_VVTK_RECORDING_STOP"));
myStopAction->setEnabled( false );
//myStopAction->addTo( myRecordingToolBar );
myRecorder->SetRenderWindow(theInteractor->getRenderWindow());
disconnect( SVTK_MainWindow::action( DumpId ), SIGNAL( activated() ),
- myViewWindow, SLOT( onDumpView() ) );
+ myViewWindow, SLOT( onDumpView() ) );
connect( SVTK_MainWindow::action( DumpId ), SIGNAL( activated() ),
- this, SLOT( onDumpView() ) );
+ this, SLOT( onDumpView() ) );
SVTK_MainWindow::Initialize(theInteractor);
addToolBar( Qt::LeftToolBarArea, getToolBar() );
SUIT_Application* app = SUIT_Session::session()->activeApplication();
QString fileName = app->getFileName( false, QString::null,
- tr( "TLT_IMAGE_FILES" ),
- tr( "TLT_DUMP_VIEW" ), 0 );
+ tr( "TLT_IMAGE_FILES" ),
+ tr( "TLT_DUMP_VIEW" ), 0 );
if( fileName.isEmpty() )
return;
//----------------------------------------------------------------------------
VVTK_MainWindow1::VVTK_MainWindow1(QSplitter* theParent,
- const char* theName,
- SUIT_ResourceMgr* theResourceMgr,
- SUIT_ViewWindow* theViewWindow):
+ const char* theName,
+ SUIT_ResourceMgr* theResourceMgr,
+ SUIT_ViewWindow* theViewWindow):
VVTK_MainWindow(theParent,theName,theResourceMgr,theViewWindow),
mySplitter(theParent),
myPickingDlg(NULL)
aPixmap = theResourceMgr->loadPixmap("VISU",tr("ICON_VVTK_SELECTION_MODE_SWITCH"));
myPickingAction = new QtxAction(tr("MNU_VVTK_SELECTION_MODE_SWITCH"),
- aPixmap,
- tr( "MNU_VVTK_SELECTION_MODE_SWITCH" ),
- 0,
- this,
- //"VVTK/SVTK SelectionSwitch",
- true);
+ aPixmap,
+ tr( "MNU_VVTK_SELECTION_MODE_SWITCH" ),
+ 0,
+ this,
+ //"VVTK/SVTK SelectionSwitch",
+ true);
myPickingAction->setCheckable(true);
myPickingAction->setStatusTip(tr("DSC_VVTK_SELECTION_MODE_SWITCH"));
myPtsToolBar->addAction( myPickingAction );
// Plane/Sphere Segmentation
aPixmap = theResourceMgr->loadPixmap("VISU",tr("ICON_VVTK_PLANE_SEGMENTATION_SWITCH"));
myPlaneSegmentationAction = new QtxAction(tr("MNU_VVTK_PLANE_SEGMENTATION_SWITCH"),
- aPixmap,
- tr( "MNU_VVTK_PLANE_SEGMENTATION_SWITCH" ),
- 0,
- this,
- //"VVTK/SVTK PlaneSegmentationSwitch",
- true);
+ aPixmap,
+ tr( "MNU_VVTK_PLANE_SEGMENTATION_SWITCH" ),
+ 0,
+ this,
+ //"VVTK/SVTK PlaneSegmentationSwitch",
+ true);
myPlaneSegmentationAction->setCheckable(true);
myPlaneSegmentationAction->setStatusTip(tr("DSC_VVTK_PLANE_SEGMENTATION_SWITCH"));
//myPlaneSegmentationAction->addTo( myPtsToolBar );
aPixmap = theResourceMgr->loadPixmap("VISU",tr("ICON_VVTK_SPHERE_SEGMENTATION_SWITCH"));
mySphereSegmentationAction = new QtxAction(tr("MNU_VVTK_SPHERE_SEGMENTATION_SWITCH"),
- aPixmap,
- tr( "MNU_VVTK_SPHERE_SEGMENTATION_SWITCH" ),
- 0,
- this,
- //"VVTK/SVTK SphereSegmentationSwitch",
- true);
+ aPixmap,
+ tr( "MNU_VVTK_SPHERE_SEGMENTATION_SWITCH" ),
+ 0,
+ this,
+ //"VVTK/SVTK SphereSegmentationSwitch",
+ true);
mySphereSegmentationAction->setCheckable(true);
mySphereSegmentationAction->setStatusTip(tr("DSC_VVTK_SPHERE_SEGMENTATION_SWITCH"));
//mySphereSegmentationAction->addTo( myPtsToolBar );
}
void VVTK_MainWindow1::Initialize(SVTK_RenderWindowInteractor* theInteractor,
- VVTK_Renderer1* theRenderer)
+ VVTK_Renderer1* theRenderer)
{
myRenderer = theRenderer;
VVTK_MainWindow::Initialize(theInteractor);
//----------------------------------------------------------------------------
VVTK_MainWindow2* VVTK_MainWindow1::CreateMainWindow2(QWidget* theParent,
- const char* theName,
- SUIT_ResourceMgr* theResourceMgr,
- SUIT_ViewWindow* theViewWindow)
+ const char* theName,
+ SUIT_ResourceMgr* theResourceMgr,
+ SUIT_ViewWindow* theViewWindow)
{
myMainWindow2 = new VVTK_MainWindow2(theParent,
- theName,
- theResourceMgr,
- theViewWindow);
+ theName,
+ theResourceMgr,
+ theViewWindow);
return myMainWindow2;
}
//----------------------------------------------------------------------------
VVTK_MainWindow2::VVTK_MainWindow2(QWidget* theParent,
- const char* theName,
- SUIT_ResourceMgr* theResourceMgr,
- SUIT_ViewWindow* theViewWindow):
+ const char* theName,
+ SUIT_ResourceMgr* theResourceMgr,
+ SUIT_ViewWindow* theViewWindow):
VVTK_MainWindow(theParent,theName,theResourceMgr,theViewWindow)
{}
public:
//! Construct instance of the class
VVTK_MainWindow(QWidget* theParent,
- const char* theName,
- SUIT_ResourceMgr* theResourceMgr,
- SUIT_ViewWindow* theViewWindow);
+ const char* theName,
+ SUIT_ResourceMgr* theResourceMgr,
+ SUIT_ViewWindow* theViewWindow);
//! Reimplement SVTK_MainWindow::Initialize
virtual void Initialize(SVTK_RenderWindowInteractor* theInteractor);
public:
//! Construct instance of the class
VVTK_MainWindow1(QSplitter* theParent,
- const char* theName,
- SUIT_ResourceMgr* theResourceMgr,
- SUIT_ViewWindow* theViewWindow);
+ const char* theName,
+ SUIT_ResourceMgr* theResourceMgr,
+ SUIT_ViewWindow* theViewWindow);
//! Reimplement VVTK_MainWindow::Initialize
virtual void Initialize(SVTK_RenderWindowInteractor* theInteractor,
- VVTK_Renderer1* theRenderer);
+ VVTK_Renderer1* theRenderer);
//! Destroy instance of the class
virtual ~VVTK_MainWindow1();
So, it is necessary to synhronize them through sharing some common pointers.
*/
VVTK_MainWindow2* CreateMainWindow2(QWidget* theParent,
- const char* theName,
- SUIT_ResourceMgr* theResourceMgr,
- SUIT_ViewWindow* theViewWindow);
+ const char* theName,
+ SUIT_ResourceMgr* theResourceMgr,
+ SUIT_ViewWindow* theViewWindow);
VISU_WidgetCtrl* GetWidgetCtrl();
//! Construct instance of the class
VVTK_MainWindow2(QWidget* theParent,
- const char* theName,
- SUIT_ResourceMgr* theResourceMgr,
- SUIT_ViewWindow* theViewWindow);
+ const char* theName,
+ SUIT_ResourceMgr* theResourceMgr,
+ SUIT_ViewWindow* theViewWindow);
public:
//! Destroy instance of the class
virtual ~VVTK_MainWindow2();
myActor = NULL;
if ( !myInteractor )
- return aResult;
+ return aResult;
mySelector = myInteractor->GetSelector();
if ( !mySelector )
- return aResult;
+ return aResult;
const SALOME_ListIO& aListIO = mySelector->StoredIObjects();
if ( aListIO.Extent() != 1 )
- return aResult;
+ return aResult;
myIO = aListIO.First();
if ( mySelector->HasIndex( myIO ) )
- mySelector->GetIndex(myIO, myMapIndex);
-
+ mySelector->GetIndex(myIO, myMapIndex);
+
VTK::ActorCollectionCopy aCopy(myInteractor->getRenderer()->GetActors());
myActor = SVTK::Find<VISU_GaussPtsAct>(aCopy.GetActors(),
- SVTK::TIsSameIObject<VISU_GaussPtsAct>( myIO ));
+ SVTK::TIsSameIObject<VISU_GaussPtsAct>( myIO ));
if ( !myActor )
- return aResult;
+ return aResult;
myPipeLine = myActor->GetGaussPointsPL();
{
public:
GaussPtsIDValidator( SVTK_RenderWindowInteractor* theInteractor,
- QObject * theParent ):
+ QObject * theParent ):
QIntValidator( 0, VTK_LARGE_ID, theParent ),
myHelper(theInteractor)
{}
validate ( QString & theInput, int & thePos ) const
{
if ( QIntValidator::validate( theInput, thePos ) == QValidator::Invalid)
- return QValidator::Invalid;
+ return QValidator::Invalid;
if ( !myHelper.get() )
- return QValidator::Invalid;
+ return QValidator::Invalid;
return QValidator::Acceptable;
}
{
public:
GaussCellIDValidator( QLineEdit* theLocalPointLabel,
- SVTK_RenderWindowInteractor* theInteractor,
- QObject * theParent ):
+ SVTK_RenderWindowInteractor* theInteractor,
+ QObject * theParent ):
GaussPtsIDValidator( theInteractor, theParent ),
myLocalPointLineEdit( theLocalPointLabel )
{}
validate ( QString & theInput, int & thePos ) const
{
if ( GaussPtsIDValidator::validate( theInput, thePos ) == QValidator::Invalid)
- return QValidator::Invalid;
+ return QValidator::Invalid;
VISU::TCellID aCellID = theInput.toInt();
VISU::TLocalPntID aLocalPntID = myLocalPointLineEdit->text().toInt();
VISU::PGaussPtsIDMapper anIDMapper = myHelper.myPipeLine->GetGaussPtsIDMapper();
if ( anIDMapper->GetVTKID( VISU::TGaussPointID( aCellID, aLocalPntID ) ) < 0 )
- return QValidator::Intermediate;
+ return QValidator::Intermediate;
return QValidator::Acceptable;
}
{
public:
GaussLocalPointIDValidator( QLineEdit* theParentElementLineEdit,
- SVTK_RenderWindowInteractor* theInteractor,
- QObject * theParent ):
+ SVTK_RenderWindowInteractor* theInteractor,
+ QObject * theParent ):
GaussPtsIDValidator( theInteractor, theParent ),
myParentElementLineEdit( theParentElementLineEdit )
{}
validate ( QString & theInput, int & thePos ) const
{
if ( GaussPtsIDValidator::validate( theInput, thePos ) == QValidator::Invalid)
- return QValidator::Invalid;
+ return QValidator::Invalid;
VISU::TLocalPntID aLocalPntID = theInput.toInt();
VISU::TCellID aCellID = myParentElementLineEdit->text().toInt();
VISU::PGaussPtsIDMapper anIDMapper = myHelper.myPipeLine->GetGaussPtsIDMapper();
if ( anIDMapper->GetVTKID( VISU::TGaussPointID( aCellID, aLocalPntID ) ) < 0 )
- return QValidator::Intermediate;
+ return QValidator::Intermediate;
return QValidator::Acceptable;
}
//---------------------------------------------------------------------------------
VVTK_PickingDlg::VVTK_PickingDlg(QtxAction* theAction,
- SVTK_MainWindow* theParent,
- const char* theName):
+ SVTK_MainWindow* theParent,
+ const char* theName):
SVTK_DialogBase(theAction,
- theParent,
- theName),
+ theParent,
+ theName),
myEventCallbackCommand( vtkCallbackCommand::New() ),
myPickingSettings( VISU_PickingSettings::New() )
{
//QPalette aPalette( mySelectionColorButton->palette() );
/*aPalette.setColor( mySelectionColorButton->backgroundRole(),
- QColor( ( int )( aColor[0] * 255.0 ),
- ( int )( aColor[1] * 255.0 ),
- ( int )( aColor[2] * 255.0 ) ) );
+ QColor( ( int )( aColor[0] * 255.0 ),
+ ( int )( aColor[1] * 255.0 ),
+ ( int )( aColor[2] * 255.0 ) ) );
mySelectionColorButton->setPalette( aPalette );*/
mySelectionColorButton->setColor(
QColor( ( int )( aColor[0] * 255.0 ),
- ( int )( aColor[1] * 255.0 ),
+ ( int )( aColor[1] * 255.0 ),
( int )( aColor[2] * 255.0 ) ) );
return;
myInteractor = theInteractor;
theInteractor->GetDevice()->AddObserver(vtkCommand::KeyPressEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
theInteractor->GetDevice()->AddObserver(vtkCommand::EndPickEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
{
QValidator* aValidator = new GaussCellIDValidator( myLocalPointLineEdit, theInteractor, myParentElementLineEdit );
myParentElementLineEdit->setValidator( aValidator );
}
void VVTK_PickingDlg::ProcessEvents(vtkObject* vtkNotUsed(theObject),
- unsigned long theEvent,
- void* theClientData,
- void* vtkNotUsed(theCallData))
+ unsigned long theEvent,
+ void* theClientData,
+ void* vtkNotUsed(theCallData))
{
VVTK_PickingDlg* self = reinterpret_cast<VVTK_PickingDlg*>(theClientData);
if (app)
app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- SUIT_MessageBox::warning( 0,
- QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning( 0,
+ QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
}
}
if( aColor.isValid() )
{
aPalette.setColor( mySelectionColorButton->backgroundRole(),
- aColor );
+ aColor );
mySelectionColorButton->setPalette( aPalette );
}
}*/
public:
VVTK_PickingDlg(QtxAction* theAction,
- SVTK_MainWindow* theParent,
- const char* theName);
+ SVTK_MainWindow* theParent,
+ const char* theName);
~VVTK_PickingDlg();
private:
static void ProcessEvents(vtkObject* theObject,
- unsigned long theEvent,
- void* theClientData,
- void* theCallData);
+ unsigned long theEvent,
+ void* theClientData,
+ void* theCallData);
void KeyPressed();
void keyPressEvent( QKeyEvent* e );
{
QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/";
QString aFileName = QFileDialog::getOpenFileName( this,
- 0,
- aRootDir,
- "Bitmap (*.bmp *.jpg *.png)" );
+ 0,
+ aRootDir,
+ "Bitmap (*.bmp *.jpg *.png)" );
if( aFileName.isNull() )
return;
{
QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/";
QString aFileName = QFileDialog::getOpenFileName( this,
- 0,
- aRootDir,
- "Bitmap (*.bmp *.jpg *.png)" );
+ 0,
+ aRootDir,
+ "Bitmap (*.bmp *.jpg *.png)" );
if( aFileName.isNull() )
return;
inline
void
GetNameJPEG(const std::string& thePreffix,
- const int theIndex,
- std::string& theName)
+ const int theIndex,
+ std::string& theName)
{
using namespace std;
ostringstream aStream;
void
VVTK_Recorder
::ProcessEvents(vtkObject* vtkNotUsed(theObject),
- unsigned long theEvent,
- void* theClientData,
- void* vtkNotUsed(theCallData))
+ unsigned long theEvent,
+ void* theClientData,
+ void* vtkNotUsed(theCallData))
{
if(vtkObject* anObj = reinterpret_cast<vtkObject*>(theClientData)){
if(VVTK_Recorder* aSelf = dynamic_cast<VVTK_Recorder*>(anObj)){
if(theEvent==vtkCommand::EndEvent){
- if(aSelf->State() == VVTK_Recorder::VVTK_Recorder_Record){
- aSelf->DoRecord();
- }
+ if(aSelf->State() == VVTK_Recorder::VVTK_Recorder_Record){
+ aSelf->DoRecord();
+ }
}
}
}
inline
int
GetFrameIndex(double theStartTime,
- double theFPS)
+ double theFPS)
{
double aTimeNow = vtkTimerLog::GetCurrentTime();
double aDelta = aTimeNow - theStartTime;
myFrameIndexes.back() = abs(myFrameIndexes.back());
double aPauseTime = fabs((double)(aFrameIndex - myFrameIndex - 1)) / myNbFPS;
if(MYDEBUG)
- MESSAGE("VVTK_Recorder::DoRecord - aFrameIndex = "<<aFrameIndex<<
- "; aPauseTime = "<<aPauseTime);
+ MESSAGE("VVTK_Recorder::DoRecord - aFrameIndex = "<<aFrameIndex<<
+ "; aPauseTime = "<<aPauseTime);
myTimeStart += aPauseTime;
}
anImageData->UpdateInformation();
int *anExtent = anImageData->GetWholeExtent();
anImageData->SetUpdateExtent(anExtent[0], anExtent[1],
- anExtent[2], anExtent[3],
- 0,0);
+ anExtent[2], anExtent[3],
+ 0,0);
anImageData->UpdateData();
}
GetNameJPEG(myName,anIndex,anCurrentName);
aStream<<"ln -s "<< anInitialName<<" "<<anCurrentName<<";";
if(anIndex + 1 < aFinishIndex)
- aStream<<" \\";
+ aStream<<" \\";
aStream<<endl;
}
std::string aString(aStream.str());
static
void
ProcessEvents(vtkObject* theObject,
- unsigned long theEvent,
- void* theClientData,
- void* theCallData);
+ unsigned long theEvent,
+ void* theClientData,
+ void* theCallData);
protected :
int myState;
if (app)
app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName) );
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName) );
}
}
aFilter.append( tr( "FLT_ALL_FILES" ) );
QString aFileName = SUIT_FileDlg::getFileName( this, getenv( "HOME" ), aFilter,
- tr( "FILE_NAME" ), false );
+ tr( "FILE_NAME" ), false );
if( aFileName.isNull() )
return false;
size_t aNumberOfCells = 0;
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
if(vtkActorCollection *anActorCollection = aCopy.GetActors()){
- anActorCollection->InitTraversal();
- while(vtkActor *anActor = anActorCollection->GetNextActor()){
- if(anActor->GetVisibility()){
- if(SALOME_Actor *aSActor = dynamic_cast<SALOME_Actor*>(anActor)){
- if(vtkMapper *aMapper = aSActor->GetMapper()){
- if(vtkDataSet *aDataSet = aMapper->GetInput()){
- aNumberOfCells += aDataSet->GetNumberOfCells();
- }
- }
- }
- }
- }
+ anActorCollection->InitTraversal();
+ while(vtkActor *anActor = anActorCollection->GetNextActor()){
+ if(anActor->GetVisibility()){
+ if(SALOME_Actor *aSActor = dynamic_cast<SALOME_Actor*>(anActor)){
+ if(vtkMapper *aMapper = aSActor->GetMapper()){
+ if(vtkDataSet *aDataSet = aMapper->GetInput()){
+ aNumberOfCells += aDataSet->GetNumberOfCells();
+ }
+ }
+ }
+ }
+ }
}
std::ostringstream aStr;
float aFPS = 1.0 / aLastRenderTimeInSeconds;
VISU_PlanesWidget *aPlanesWidget = myWidgetCtrl->GetPlanesWidget();
aPlanesWidget->InitialPlaceWidget(myBndBox);
aPlanesWidget->SetOrigin(0.5*(myBndBox[1] + myBndBox[0]),
- 0.5*(myBndBox[3] + myBndBox[2]),
- 0.5*(myBndBox[5] + myBndBox[4]));
+ 0.5*(myBndBox[3] + myBndBox[2]),
+ 0.5*(myBndBox[5] + myBndBox[4]));
//
VISU_SphereWidget *aSphereWidget = myWidgetCtrl->GetSphereWidget();
aSphereWidget->SetCenter(0.5*(myBndBox[1] + myBndBox[0]),
- 0.5*(myBndBox[3] + myBndBox[2]),
- 0.5*(myBndBox[5] + myBndBox[4]));
+ 0.5*(myBndBox[3] + myBndBox[2]),
+ 0.5*(myBndBox[5] + myBndBox[4]));
float aMinLength = VTK_LARGE_FLOAT;
for (int i=0; i<3; ++i) {
void
VVTK_Renderer1
::Initialize(vtkRenderWindowInteractor* theInteractor,
- SVTK_Selector* theSelector)
+ SVTK_Selector* theSelector)
{
SVTK_Renderer::Initialize(theInteractor,theSelector);
myWidgetCtrl->SetInteractor(theInteractor);
void VVTK_Renderer2::SetWidgetCtrl(VISU_WidgetCtrl* theWidgetCtrl)
{
theWidgetCtrl->AddObserver(vtkCommand::EndInteractionEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
theWidgetCtrl->AddObserver(vtkCommand::EnableEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
theWidgetCtrl->AddObserver(vtkCommand::DisableEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
myWidgetCtrl = theWidgetCtrl;
}
void
VVTK_Renderer2
::ProcessEvents(vtkObject* vtkNotUsed(theObject),
- unsigned long theEvent,
- void* theClientData,
- void* vtkNotUsed(theCallData))
+ unsigned long theEvent,
+ void* theClientData,
+ void* vtkNotUsed(theCallData))
{
VVTK_Renderer2* self = reinterpret_cast<VVTK_Renderer2*>(theClientData);
if(VISU_GaussPtsAct1* anActor = dynamic_cast<VISU_GaussPtsAct1*>(theActor)){
if(VISU::TGaussPtsActorFactory* aFactory = anActor->GetGaussPtsFactory()){
if(VISU_GaussPtsAct2* anActor2 = aFactory->CloneActor(anActor)){
- anActor2->SetWidgetCtrl(myWidgetCtrl);
- Superclass::AddActor(anActor2);
+ anActor2->SetWidgetCtrl(myWidgetCtrl);
+ Superclass::AddActor(anActor2);
}
}
}
virtual
void
Initialize(vtkRenderWindowInteractor* theInteractor,
- SVTK_Selector* theSelector);
+ SVTK_Selector* theSelector);
//! Reimplement VVTK_Renderer::AddActor to apply to the actor additional settings
virtual
static
void
ProcessEvents(vtkObject* theObject,
- unsigned long theEvent,
- void* theClientData,
- void* theCallData);
+ unsigned long theEvent,
+ void* theClientData,
+ void* theCallData);
//! Used to process VTK events
vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand;
//----------------------------------------------------------------
VVTK_SegmentationCursorDlg::VVTK_SegmentationCursorDlg( QWidget* parent, const char* name )
:QDialog( parent,
- Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
+ Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
myEventCallbackCommand( vtkCallbackCommand::New() ),
myInsideCursorSettings( VISU_InsideCursorSettings::New() ),
myOutsideCursorSettings( VISU_OutsideCursorSettings::New() ),
myEventCallbackCommand->SetCallback(VVTK_SegmentationCursorDlg::ProcessEvents);
myInsideCursorSettings->AddObserver(VISU::UpdateFromSettingsEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
setWindowTitle( tr( "SEGMENTATION_CURSOR_DLG_TITLE" ) );
setSizeGripEnabled(TRUE);
if(theWidgetCtrl)
theWidgetCtrl->AddObserver(vtkCommand::EndInteractionEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
}
void VVTK_SegmentationCursorDlg::ProcessEvents(vtkObject* vtkNotUsed(theObject),
- unsigned long theEvent,
- void* theClientData,
- void* vtkNotUsed(theCallData))
+ unsigned long theEvent,
+ void* theClientData,
+ void* vtkNotUsed(theCallData))
{
VVTK_SegmentationCursorDlg* self = reinterpret_cast<VVTK_SegmentationCursorDlg*>(theClientData);
vtkFloatingPointType* aColor = myOutsideCursorSettings->GetColor();
myOutsideSizeBox->setColor( QColor( ( int )( aColor[0] * 255.0 ),
- ( int )( aColor[1] * 255.0 ),
- ( int )( aColor[2] * 255.0 ) ) );
+ ( int )( aColor[1] * 255.0 ),
+ ( int )( aColor[2] * 255.0 ) ) );
return;
}
VISU::TTextureValue
VVTK_SegmentationCursorDlg
::MakeImageData( bool theInside,
- const QString& theMainTexture,
- const QString& theAlphaTexture )
+ const QString& theMainTexture,
+ const QString& theAlphaTexture )
{
if( theInside )
{
}
return VISU::GetTexture( (const char*)theMainTexture.toLatin1(),
- (const char*)theAlphaTexture.toLatin1());
+ (const char*)theAlphaTexture.toLatin1());
}
void VVTK_SegmentationCursorDlg::onClickApply()
aWarning.append( "Can you please confirm that you want to continue anyway?" );
bool toApply = CheckNumberOfFaces() ||
SUIT_MessageBox::warning( this, tr( "Warning" ), aWarning,
- tr( "&OK" ), tr( "&Cancel" ), 0, 1, 1 ) == 0;
+ tr( "&OK" ), tr( "&Cancel" ), 0, 1, 1 ) == 0;
if( toApply )
{
if (app)
app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
SUIT_MessageBox::warning( 0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName),
- QObject::tr("BUT_OK"));
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
}
}
aNumberOfPoints += aGaussActor->GetInput()->GetNumberOfCells();
}
return !( myInsidePrimitiveBox->getPrimitiveType() == VISU_OpenGLPointSpriteMapper::GeomSphere &&
- aNumberOfPoints * myInsidePrimitiveBox->getFaceNumber() * 2 > myInsidePrimitiveBox->getFaceLimit() ||
- myOutsidePrimitiveBox->getPrimitiveType() == VISU_OpenGLPointSpriteMapper::GeomSphere &&
- aNumberOfPoints * myOutsidePrimitiveBox->getFaceNumber() > myOutsidePrimitiveBox->getFaceLimit() );
+ aNumberOfPoints * myInsidePrimitiveBox->getFaceNumber() * 2 > myInsidePrimitiveBox->getFaceLimit() ||
+ myOutsidePrimitiveBox->getPrimitiveType() == VISU_OpenGLPointSpriteMapper::GeomSphere &&
+ aNumberOfPoints * myOutsidePrimitiveBox->getFaceNumber() > myOutsidePrimitiveBox->getFaceLimit() );
}
void VVTK_SegmentationCursorDlg::keyPressEvent( QKeyEvent* e )
VISU::TTextureValue
MakeImageData( bool theInside,
- const QString& theMainTexture,
- const QString& theAlphaTexture );
+ const QString& theMainTexture,
+ const QString& theAlphaTexture );
private:
static void ProcessEvents(vtkObject* theObject,
- unsigned long theEvent,
- void* theClientData,
- void* theCallData);
+ unsigned long theEvent,
+ void* theClientData,
+ void* theCallData);
void keyPressEvent( QKeyEvent* e );
//***************************************************************
VVTK_ViewManager
::VVTK_ViewManager( SUIT_Study* study,
- SUIT_Desktop* theDesktop )
+ SUIT_Desktop* theDesktop )
: SVTK_ViewManager( study, theDesktop )
{
myId = ++_VVTKViewMgr_Id;
if(vtkActorCollection* aCollection = aPrs->GetObjects()){
aCollection->InitTraversal();
while(VISU_ActorBase* anActor = dynamic_cast<VISU_ActorBase*>(aCollection->GetNextActor())){
- if(!anActor->GetFactory()->GetActiveState())
- continue;
- QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
- for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
- if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(aViews.at(i))){
- if(SVTK_View* aView = aViewWindow->getView()){
- aView->Display(anActor, false);
- }
- }
- }
+ if(!anActor->GetFactory()->GetActiveState())
+ continue;
+ QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
+ for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
+ if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(aViews.at(i))){
+ if(SVTK_View* aView = aViewWindow->getView()){
+ aView->Display(anActor, false);
+ }
+ }
+ }
}
}
}
operator()(SALOME_Actor* theActor)
{
if(!myResult)
- myResult = theActor->GetVisibility();
+ myResult = theActor->GetVisibility();
}
};
}
VVTK::TIsOneActorVisibleAction anAction(aResult);
VTK::ActorCollectionCopy aCopy(aViewWindow->getRenderer()->GetActors());
SVTK::ForEachIf<SALOME_Actor>(aCopy.GetActors(),
- SVTK::TIsSameIObject<SALOME_Actor>(theIO),
- anAction);
+ SVTK::TIsSameIObject<SALOME_Actor>(theIO),
+ anAction);
return anAction.myResult;
}
SVTK_Selector* aSelector = SVTK_Selector::New();
{
myMainWindow1 = new VVTK_MainWindow1(s,
- "VVTK_MainWindow",
- aResourceMgr,
- this);
+ "VVTK_MainWindow",
+ aResourceMgr,
+ this);
anInsideCursorSettings = myMainWindow1->GetInsideCursorSettings();
anOutsideCursorSettings = myMainWindow1->GetOutsideCursorSettings();
aPickingSettings = myMainWindow1->GetPickingSettings();
SVTK_RenderWindowInteractor* anIteractor =
- new SVTK_RenderWindowInteractor(myMainWindow1,"SVTK_RenderWindowInteractor1");
+ new SVTK_RenderWindowInteractor(myMainWindow1,"SVTK_RenderWindowInteractor1");
SVTK_GenericRenderWindowInteractor* aDevice =
- SVTK_GenericRenderWindowInteractor::New();
+ SVTK_GenericRenderWindowInteractor::New();
aDevice->SetRenderWidget(anIteractor);
aDevice->SetSelector(aSelector);
}
{
myMainWindow2 = myMainWindow1->CreateMainWindow2(s,
- "VVTK_SegmantationWindow",
- aResourceMgr,
- this);
+ "VVTK_SegmantationWindow",
+ aResourceMgr,
+ this);
SVTK_RenderWindowInteractor* anIteractor =
- new SVTK_RenderWindowInteractor(myMainWindow2,"SVTK_RenderWindowInteractor1");
+ new SVTK_RenderWindowInteractor(myMainWindow2,"SVTK_RenderWindowInteractor1");
SVTK_GenericRenderWindowInteractor* aDevice =
- SVTK_GenericRenderWindowInteractor::New();
+ SVTK_GenericRenderWindowInteractor::New();
aDevice->SetRenderWidget(anIteractor);
aDevice->SetSelector(aSelector);
void
VVTK_ViewWindow
::AddActor(VTKViewer_Actor* theActor,
- bool theIsUpdate)
+ bool theIsUpdate)
{
myMainWindow1->AddActor(theActor,theIsUpdate);
myMainWindow2->AddActor(theActor,theIsUpdate);
void
VVTK_ViewWindow
::RemoveActor(VTKViewer_Actor* theActor,
- bool theIsUpdate)
+ bool theIsUpdate)
{
myMainWindow1->RemoveActor(theActor,theIsUpdate);
myMainWindow2->RemoveActor(theActor,theIsUpdate);
void
VVTK_ViewWindow
::highlight(const Handle(SALOME_InteractiveObject)& theIO,
- bool theIsHighlight,
- bool theIsUpdate )
+ bool theIsHighlight,
+ bool theIsUpdate )
{
if(GetSelector()->AddIObject(theIO))
GetSelector()->EndPickCallback();
if( myMainWindow1->GetInteractor()->hasFocus() )
{
if ( myMainWindow1->getToolBar()->testAttribute(Qt::WA_UnderMouse) || myDumpImage.isNull() )
- return myMainWindow1->dumpView();
+ return myMainWindow1->dumpView();
else
- return myDumpImage;
+ return myDumpImage;
}
if( myMainWindow2->GetInteractor()->hasFocus() )
{
if ( myMainWindow1->getToolBar()->testAttribute(Qt::WA_UnderMouse) || myDumpImage.isNull() )
- return myMainWindow2->dumpView();
+ return myMainWindow2->dumpView();
else
- return myDumpImage;
+ return myDumpImage;
}
return QImage();
virtual
void
AddActor(VTKViewer_Actor* theActor,
- bool theIsUpdate = false);
+ bool theIsUpdate = false);
//! Redefine SVTK_ViewWindow::RemoveActor method
virtual
void
RemoveActor(VTKViewer_Actor* theActor,
- bool theIsUpdate = false);
+ bool theIsUpdate = false);
//! Redefine SVTK_ViewWindow::Repaint method
virtual
virtual
void
highlight(const Handle(SALOME_InteractiveObject)& theIO,
- bool theIsHighlight = true,
- bool theIsUpdate = true);
+ bool theIsHighlight = true,
+ bool theIsUpdate = true);
//! Redefine SVTK_ViewWindow::unHighlightAll method
virtual