@COMMENCE@
-EXPORT_HEADERS = VISU_Convertor.hxx \
+EXPORT_HEADERS = \
+ VISU_IDMapper.hxx \
+ VISU_Convertor.hxx \
VISU_Convertor_impl.hxx \
VISU_ConvertorUtils.hxx \
VISU_ExtractUnstructuredGrid.hxx
const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter;
+ //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);
+ }
+
+ continue;
+
//Import fields
aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
for(; aValFieldIter != aValField.end(); aValFieldIter++){
int aTimeStamp = aValFieldIter->first;
- VISU_Convertor::TOutput* aDataSet =
+ VISU::PIDMapper anIDMapper =
aCon->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
+ VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput();
- VISU::PIDMapper aPIDMapper =
- aCon->GetTimeStampOnMeshIDMapper(aMeshName,anEntity,aFieldName,aTimeStamp);
int aNbCells = aDataSet->GetNumberOfCells();
for(int anCellId = 0; anCellId < aNbCells; anCellId++){
- int anObjID = aPIDMapper->GetElemObjID(anCellId);
- int aVTKID = aPIDMapper->GetElemVTKID(anObjID);
+ int anObjID = anIDMapper->GetElemObjID(anCellId);
+ int aVTKID = anIDMapper->GetElemVTKID(anObjID);
cout<<anObjID<<"; "<<aVTKID<<endl;
}
//goto OK;
if(anEntity != VISU::NODE_ENTITY)
aCon->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp);
- else
+ else{
aCon->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
+ }
}
}
}
aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
- VISU_Convertor::TOutput* aDataSet = aCon->GetMeshOnEntity(aMeshName,anEntity);
- //pkv f
+ VISU::PIDMapper anIDMapper = aCon->GetMeshOnEntity(aMeshName,anEntity);
+ VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput();
{
int aNbCells, anCellId, anObjID, aVTKID;
- //
- VISU::PIDMapper aPIDMapper=aCon->GetMeshOnEntityIDMapper(aMeshName,anEntity);
aNbCells = aDataSet->GetNumberOfCells();
for(anCellId = 0; anCellId < aNbCells; anCellId++){
- anObjID = aPIDMapper->GetElemObjID(anCellId);
- aVTKID = aPIDMapper->GetElemVTKID(anObjID);
+ anObjID = anIDMapper->GetElemObjID(anCellId);
+ aVTKID = anIDMapper->GetElemVTKID(anObjID);
cout<<anObjID<<"; "<<aVTKID<<endl;
}
}
- //pkv t
}
- //continue;
-
//Import families
aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
aCon->GetFamilyOnEntity(aMeshName,anEntity,aFamilyName);
}
}
-
- //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);
- }
-
}
OK:
MSG(MYDEBUG,"OK");
#include <string>
#include <stdexcept>
-#include "MED_SharedPtr.hxx"
#include "MED_Vector.hxx"
-
-#include <vtkSystemIncludes.h>
-
-class vtkUnstructuredGrid;
-class vtkCell;
+#include "VISU_IDMapper.hxx"
namespace VISU
{
- using MED::SharedPtr;
using MED::TVector;
//---------------------------------------------------------------
struct TProfile;
typedef SharedPtr<TProfile> PProfile;
- //pkv f
- struct TIDMapper;
- typedef SharedPtr<TIDMapper> PIDMapper;
- // pkv t
+
struct TMeshOnEntity;
typedef SharedPtr<TMeshOnEntity> PMeshOnEntity;
typedef TVector<TName> TNames;
- //---------------------------------------------------------------
- struct TBaseStructure
- {
- virtual ~TBaseStructure()
- {}
- };
-
-
//---------------------------------------------------------------
struct TIntId: virtual TBaseStructure
{
- int myId;
+ vtkIdType myId;
TIntId(): myId(0)
{}
struct TSubProfile: virtual TBaseStructure
{};
- //pkv f
- //---------------------------------------------------------------
- // TIDMapper
- //
- struct TIDMapper: virtual TBaseStructure
- {
- virtual
- vtkIdType
- GetNodeObjID(vtkIdType theID) const = 0;
-
- virtual
- vtkIdType
- GetNodeVTKID(vtkIdType theID) const = 0;
-
- virtual
- float*
- GetNodeCoord(vtkIdType theObjID) = 0;
-
- virtual
- vtkIdType
- GetElemObjID(vtkIdType theID) const = 0;
- virtual
- vtkIdType
- GetElemVTKID(vtkIdType theID) const = 0;
-
- virtual
- vtkCell*
- GetElemCell(vtkIdType theObjID) = 0;
- };
- //pkv t
-
//---------------------------------------------------------------
- struct TProfile: virtual TBaseStructure, virtual TIDMapper
- {
- //pkv f
- /*
- virtual
- vtkIdType
- GetNodeObjID(vtkIdType theID) const = 0;
-
- virtual
- vtkIdType
- GetNodeVTKID(vtkIdType theID) const = 0;
-
- virtual
- float*
- GetNodeCoord(vtkIdType theObjID) = 0;
-
- virtual
- vtkIdType
- GetElemObjID(vtkIdType theID) const = 0;
-
- virtual
- vtkIdType
- GetElemVTKID(vtkIdType theID) const = 0;
-
- virtual
- vtkCell*
- GetElemCell(vtkIdType theObjID) = 0;
- */
- //pkv t
- };
+ struct TProfile: virtual TIDMapper
+ {};
//---------------------------------------------------------------
typedef std::map<TName,PFamily> TFamilyMap;
typedef std::map<TName,PField> TFieldMap;
- struct TMeshOnEntity: virtual TBaseStructure,
- virtual TIDMapper //pkv ft
+ struct TMeshOnEntity: virtual TIDMapper
{
TGaussMeshMap myGaussMeshMap;
TProfileMap myProfileMap;
//---------------------------------------------------------------
struct TFamily: virtual TIntId,
- virtual TIDMapper //pkv ft
+ virtual TIDMapper
{
TEntity myEntity;
TName myName;
//---------------------------------------------------------------
typedef std::set<PFamily> TFamilySet;
- struct TGroup: virtual TBaseStructure,
- virtual TIDMapper //pkv ft
+ struct TGroup: virtual TIDMapper
{
TFamilySet myFamilySet;
};
int
IsDone() const { return myIsDone; }
- typedef vtkUnstructuredGrid TOutput;
+ typedef VISU::TVTKOutput TOutput;
virtual
VISU_Convertor*
GetSize() = 0;
virtual
- TOutput*
+ VISU::PIDMapper
GetMeshOnEntity(const std::string& theMeshName,
const VISU::TEntity& theEntity) = 0;
- virtual
- TOutput*
- GetFamilyOnEntity(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFamilyName) = 0;
virtual
float
GetMeshOnEntitySize(const std::string& theMeshName,
const VISU::TEntity& theEntity) = 0;
virtual
+ VISU::PIDMapper
+ GetFamilyOnEntity(const std::string& theMeshName,
+ const VISU::TEntity& theEntity,
+ const std::string& theFamilyName) = 0;
+ virtual
float
GetFamilyOnEntitySize(const std::string& theMeshName,
const VISU::TEntity& theEntity,
const std::string& theFamilyName) = 0;
virtual
- TOutput*
+ VISU::PIDMapper
GetMeshOnGroup(const std::string& theMeshName,
const std::string& theGroupName) = 0;
const std::string& theGroupName) = 0;
virtual
- TOutput*
+ VISU::PIDMapper
GetTimeStampOnMesh(const std::string& theMeshName,
const VISU::TEntity& theEntity,
const std::string& theFieldName,
int theStampsNum) = 0;
- virtual
- //pkv f
- //VISU::PProfile
- VISU::PIDMapper
- //pkv t
- GetTimeStampOnMeshIDMapper(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theStampsNum) = 0;
- //pkv f
- virtual
- VISU::PIDMapper
- GetFamilyOnEntityIDMapper(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFamilyName) = 0;
-
- virtual
- VISU::PIDMapper
- GetMeshOnEntityIDMapper(const std::string& theMeshName,
- const VISU::TEntity& theEntity) = 0;
-
- virtual
- VISU::PIDMapper
- GetMeshOnGroupIDMapper(const std::string& theMeshName,
- const std::string& theGroupName)=0;
- //pkv t
-
virtual
TOutput*
GetTimeStampOnGaussPts(const std::string& theMeshName,
#ifdef _DEBUG_
static int MYDEBUG = 1;
-static int MYDEBUGWITHFILES = 1;
+static int MYDEBUGWITHFILES = 0;
+//#define _DEXCEPT_
#else
static int MYDEBUG = 0;
static int MYDEBUGWITHFILES = 0;
#endif
-//#define _DEXCEPT_
-
namespace VISU
{
//---------------------------------------------------------------
return mySource;
}
+ TVTKOutput*
+ TSource
+ ::GetVTKOutput()
+ {
+ return GetSource().GetPointer();
+ }
+
//---------------------------------------------------------------
TAppendFilter::TAppendFilter()
return myFilter;
}
- TDataSet*
+ TVTKOutput*
TAppendFilter
- ::GetDataSet() const
+ ::GetVTKOutput()
{
return GetFilter()->GetOutput();
}
{
vtkIdType aNbCells = 0, aCellsSize = 0;
TFamilySet::const_iterator anIter = myFamilySet.begin();
- for(; anIter == myFamilySet.end(); anIter++){
+ for(; anIter != myFamilySet.end(); anIter++){
PFamilyImpl aFamily = *anIter;
aNbCells += aFamily->myNbCells;
aCellsSize += aFamily->myCellsSize;
anAppendFilter->SetPoints(GetPoints(theMesh));
if(theProfile->myIsAll){
- TDataSet* aDataSet = theMeshOnEntity->GetDataSet();
+ TVTKOutput* aDataSet = theMeshOnEntity->GetVTKOutput();
anAppendFilter->AddInput(aDataSet);
theProfile->myMeshOnEntity = theMeshOnEntity.get();
}else{
//---------------------------------------------------------------
-VISU_Convertor::TOutput*
+VISU::PIDMapper
VISU_Convertor_impl
::GetMeshOnEntity(const string& theMeshName,
const VISU::TEntity& theEntity)
PMeshOnEntityImpl aMeshOnEntity = boost::get<1>(aFindMeshOnEntity);
//Main part of code
- const TVTKAppendFilter& anAppendFilter = aMeshOnEntity->GetFilter();
#ifndef _DEXCEPT_
try{
#endif
if(!aMeshOnEntity->myIsVTKDone){
+ const TVTKAppendFilter& anAppendFilter = aMeshOnEntity->GetFilter();
if(MYVTKDEBUG) anAppendFilter->DebugOn();
LoadMeshOnEntity(aMesh,aMeshOnEntity);
aFileName += aMeshName + dtos("-%d-",int(theEntity)) + "-Conv.vtk";
VISU::WriteToFile(anAppendFilter->GetOutput(),aFileName);
}
- }
- if(MYVTKDEBUG){
- GetMeshOnEntitySize(theMeshName,theEntity);
- PrintMemorySize(anAppendFilter->GetOutput());
+ if(MYVTKDEBUG){
+ GetMeshOnEntitySize(theMeshName,theEntity);
+ PrintMemorySize(anAppendFilter->GetOutput());
+ }
}
#ifndef _DEXCEPT_
}
#endif
- return anAppendFilter->GetOutput();
+ return aMeshOnEntity;
}
//---------------------------------------------------------------
-VISU_Convertor::TOutput*
+VISU::PIDMapper
VISU_Convertor_impl
::GetFamilyOnEntity(const std::string& theMeshName,
const VISU::TEntity& theEntity,
PFamilyImpl aFamily = boost::get<2>(aFindFamilyOnEntity);
//Main part of code
- const TVTKSource& aSource = aFamily->GetSource();
#ifndef _DEXCEPT_
try{
#endif
if(!aFamily->myIsVTKDone){
+ const TVTKSource& aSource = aFamily->GetSource();
if(MYVTKDEBUG) aSource->DebugOn();
GetMeshOnEntity(theMeshName,theEntity);
aFileName += aMeshName + dtos("-%d-",int(theEntity)) + aFamilyName + "-Conv.vtk";
VISU::WriteToFile(aSource.GetPointer(),aFileName);
}
- }
- if(MYVTKDEBUG){
- GetFamilyOnEntitySize(theMeshName,theEntity,theFamilyName);
- PrintMemorySize(aSource.GetPointer());
+ if(MYVTKDEBUG){
+ GetFamilyOnEntitySize(theMeshName,theEntity,theFamilyName);
+ PrintMemorySize(aSource.GetPointer());
+ }
}
#ifndef _DEXCEPT_
}
#endif
- return aSource.GetPointer();
+ return aFamily;
}
//---------------------------------------------------------------
-VISU_Convertor::TOutput*
+VISU::PIDMapper
VISU_Convertor_impl
::GetMeshOnGroup(const string& theMeshName,
const string& theGroupName)
PGroupImpl aGroup = boost::get<1>(aFindMeshOnGroup);
//Main part of code
- const TVTKAppendFilter& anAppendFilter = aGroup->GetFilter();
#ifndef _DEXCEPT_
try{
#endif
if(!aGroup->myIsVTKDone){
+ const TVTKAppendFilter& anAppendFilter = aGroup->GetFilter();
const VISU::TFamilySet& aFamilySet = aGroup->myFamilySet;
+
LoadMeshOnGroup(aMesh,aFamilySet);
anAppendFilter->SetPoints(GetPoints(aMesh));
PFamilyImpl aFamily = *anIter;
const std::string& aFamilyName = aFamily->myName;
const VISU::TEntity& anEntity = aFamily->myEntity;
- TOutput* anOutput = GetFamilyOnEntity(theMeshName,anEntity,aFamilyName);
+
+ VISU::PIDMapper anIDMapper = GetFamilyOnEntity(theMeshName,anEntity,aFamilyName);
+ VISU::TVTKOutput* anOutput = anIDMapper->GetVTKOutput();
anAppendFilter->AddInput(anOutput);
vtkIdType aNbCells = anOutput->GetNumberOfCells();
}
#endif
- return anAppendFilter->GetOutput();
+ return aGroup;
}
//---------------------------------------------------------------
-VISU_Convertor::TOutput*
+VISU::PIDMapper
VISU_Convertor_impl
::GetTimeStampOnMesh(const string& theMeshName,
const VISU::TEntity& theEntity,
PFieldImpl aField = boost::get<3>(aFindTimeStamp);
//Main part of code
- TSource& aMeshSource = aValForTime->myMeshSource;
- const TVTKSource& aSource = aMeshSource.GetSource();
+ PProfileImpl aProfile = aValForTime->myProfile;
+ TSource& aProfileSource = aProfile->mySource;
#ifndef _DEXCEPT_
try{
#endif
- if(!aMeshSource.myIsVTKDone){
+ if(!aProfileSource.myIsVTKDone){
LoadValForTimeOnMesh(aMesh,aMeshOnEntity,aField,aValForTime);
try{
MSG(MYDEBUG,"Unknown exception was occured!");
}
- GetMeshOnEntity(aVTKMeshOnEntity->myMeshName,aVTKMeshOnEntity->myEntity);
-
- PProfileImpl aProfile = aValForTime->myProfile;
+ GetMeshOnEntity(aVTKMeshOnEntity->myMeshName,aVTKMeshOnEntity->myEntity);
GetMeshOnProfile(aMesh,aVTKMeshOnEntity,aProfile);
const TVTKAppendFilter& anAppendFilter = aProfile->GetFilter();
+ const TVTKSource& aSource = aProfile->mySource.GetSource();
aSource->ShallowCopy(anAppendFilter->GetOutput());
GetTimeStampOnProfile(aSource,aField,aValForTime);
- aMeshSource.myIsVTKDone = true;
+ aProfileSource.myIsVTKDone = true;
if(MYDEBUGWITHFILES){
string aMeshName = QString(theMeshName.c_str()).simplifyWhiteSpace().latin1();
}
#endif
- return aSource.GetPointer();
+ return aValForTime->myProfile;
}
-//---------------------------------------------------------------
-//pkv f
-//VISU::PProfile
-VISU::PIDMapper
-//pkv t
-VISU_Convertor_impl::GetTimeStampOnMeshIDMapper(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theStampsNum)
-{
- GetTimeStampOnMesh(theMeshName, theEntity, theFieldName, theStampsNum);
- TFindTimeStamp aFindTimeStamp = FindTimeStamp(theMeshName,
- theEntity,
- theFieldName,
- theStampsNum);
- PValForTimeImpl aValForTime = boost::get<4>(aFindTimeStamp);
- PProfileImpl aProfile = aValForTime->myProfile;
- return aProfile;
-}
-//modified by NIZNHY-PKV Thu Sep 1 15:38:49 2005f
-//---------------------------------------------------------------
-VISU::PIDMapper
-VISU_Convertor_impl::
-GetMeshOnGroupIDMapper(const std::string& theMeshName,
- const std::string& theGroupName)
-{
- TFindMeshOnGroup aFindMeshOnGroup = FindMeshOnGroup(theMeshName,theGroupName);
- PMeshImpl aMesh = boost::get<0>(aFindMeshOnGroup);
- PGroupImpl aGroup = boost::get<1>(aFindMeshOnGroup);
- return aGroup;
-}
-//---------------------------------------------------------------
-VISU::PIDMapper
-VISU_Convertor_impl::
-GetMeshOnEntityIDMapper(const string& theMeshName,
- const VISU::TEntity& theEntity)
-{
- TFindMeshOnEntity aFindMeshOnEntity =
- FindMeshOnEntity(theMeshName,theEntity);
-
- PMeshImpl aMesh = boost::get<0>(aFindMeshOnEntity);;
- PMeshOnEntityImpl aMeshOnEntity = boost::get<1>(aFindMeshOnEntity);
- return aMeshOnEntity;
-}
-//---------------------------------------------------------------
-VISU::PIDMapper
-VISU_Convertor_impl::
-GetFamilyOnEntityIDMapper(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFamilyName)
-{
- TFindFamilyOnEntity aFindFamilyOnEntity =
- FindFamilyOnEntity(theMeshName,theEntity,theFamilyName);
-
- PMeshImpl aMesh = boost::get<0>(aFindFamilyOnEntity);;
- PMeshOnEntityImpl aMeshOnEntity = boost::get<1>(aFindFamilyOnEntity);
- PFamilyImpl aFamily = boost::get<2>(aFindFamilyOnEntity);
- return aFamily;
-}
-//modified by NIZNHY-PKV Thu Sep 1 15:38:54 2005t
//---------------------------------------------------------------
VISU_Convertor::TOutput*
VISU_Convertor_impl
const TVTKSource&
GetSource() const;
+
+ TVTKOutput*
+ GetVTKOutput();
};
//---------------------------------------------------------------
- struct TAppendFilter: public virtual TIsVTKDone
+ class TAppendFilter: public virtual TIsVTKDone
{
mutable TVTKAppendFilter myFilter;
public:
const TVTKAppendFilter&
GetFilter() const;
- TDataSet*
- GetDataSet() const;
+ virtual
+ TVTKOutput*
+ GetVTKOutput();
};
vtkCell*
GetElemCell(vtkIdType theObjID);
+ virtual
+ TVTKOutput*
+ GetVTKOutput()
+ {
+ return mySource.GetVTKOutput();
+ }
+
TID2ID myElemObj2VTKID;
TSubProfileArr mySubProfileArr;
PNamedPointCoords myNamedPointCoords;
TMeshOnEntityImpl* myMeshOnEntity;
+ TSource mySource;
TGeom2SubProfile myGeom2SubProfile;
};
typedef SharedPtr<TProfileImpl> PProfileImpl;
vtkIdType
GetElemObjID(vtkIdType theID) const;
+ virtual
+ TVTKOutput*
+ GetVTKOutput()
+ {
+ return TAppendFilter::GetVTKOutput();
+ }
+
TID2ID myElemObj2VTKID;
TSubMeshArr mySubMeshArr;
PNamedPointCoords myNamedPointCoords;
vtkIdType
GetElemObjID(vtkIdType theID) const;
+ virtual
+ TVTKOutput*
+ GetVTKOutput()
+ {
+ return TSource::GetVTKOutput();
+ }
+
PNamedPointCoords myNamedPointCoords;
TID2ID myElemObj2VTKID;
TSubMeshID myMeshID;
float*
GetNodeCoord(vtkIdType theObjID);
+ virtual
+ TVTKOutput*
+ GetVTKOutput()
+ {
+ return TAppendFilter::GetVTKOutput();
+ }
+
TID2ID myElemObj2VTKID;
TFamilyArr myFamilyArr;
PNamedPointCoords myNamedPointCoords;
class VISU_Convertor_impl: public VISU_Convertor
{
public:
+ VISU_Convertor_impl();
+
+ virtual
+ ~VISU_Convertor_impl();
+
+ virtual
+ VISU_Convertor*
+ Build()
+ {
+ return this;
+ }
+
virtual
float
GetSize();
+ virtual
+ VISU::PIDMapper
+ GetMeshOnEntity(const std::string& theMeshName,
+ const VISU::TEntity& theEntity);
+
virtual
float
GetMeshOnEntitySize(const std::string& theMeshName,
const VISU::TEntity& theEntity);
+ virtual
+ VISU::PIDMapper
+ GetFamilyOnEntity(const std::string& theMeshName,
+ const VISU::TEntity& theEntity,
+ const std::string& theFamilyName);
+
virtual
float
GetFamilyOnEntitySize(const std::string& theMeshName,
const VISU::TEntity& theEntity,
const std::string& theFamilyName);
+ virtual
+ VISU::PIDMapper
+ GetMeshOnGroup(const std::string& theMeshName,
+ const std::string& theGroupName);
+
virtual
float
GetMeshOnGroupSize(const std::string& theMeshName,
const std::string& theGroupName);
+ virtual
+ VISU::PIDMapper
+ GetTimeStampOnMesh(const std::string& theMeshName,
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theStampsNum);
+
virtual
float
GetTimeStampSize(const std::string& theMeshName,
const std::string& theFieldName,
int theStampsNum);
+ virtual
+ TOutput*
+ GetTimeStampOnGaussPts(const std::string& theMeshName,
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theStampsNum);
+
+ virtual
+ VISU::PGaussMesh
+ GetGaussMesh(const std::string& theMeshName,
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theStampsNum);
+
virtual
float
GetFieldOnMeshSize(const std::string& theMeshName,
const std::string& theFieldName,
int theStampsNum);
-public:
- VISU_Convertor_impl();
-
- virtual
- ~VISU_Convertor_impl();
-
- virtual
- VISU_Convertor* Build() { return this;};
-
- virtual
- TOutput*
- GetMeshOnEntity(const std::string& theMeshName,
- const VISU::TEntity& theEntity);
-
- virtual
- TOutput*
- GetFamilyOnEntity(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFamilyName);
-
- virtual
- TOutput*
- GetMeshOnGroup(const std::string& theMeshName,
- const std::string& theGroupName);
-
- virtual
- TOutput*
- GetTimeStampOnMesh(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theStampsNum);
- virtual
- //pkv f
- //VISU::PProfile
- VISU::PIDMapper
- //pkv t
- GetTimeStampOnMeshIDMapper(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theStampsNum);
- //pkv f
- virtual
- VISU::PIDMapper
- GetFamilyOnEntityIDMapper(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFamilyName);
- virtual
- VISU::PIDMapper
- GetMeshOnEntityIDMapper(const std::string& theMeshName,
- const VISU::TEntity& theEntity);
- virtual
- VISU::PIDMapper
- GetMeshOnGroupIDMapper(const std::string& theMeshName,
- const std::string& theGroupName);
- //pkv t
-
- virtual
- TOutput*
- GetTimeStampOnGaussPts(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theStampsNum);
-
- virtual
- VISU::PGaussMesh
- GetGaussMesh(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theStampsNum);
-
protected:
VISU::PMeshImpl
FindMesh(const std::string& theMeshName);
--- /dev/null
+// VISU CONVERTOR :
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+// File : VISU_Convertor.hxx
+// Author : Alexey PETROV
+// Module : VISU
+
+#ifndef VISU_IDMapper_HeaderFile
+#define VISU_IDMapper_HeaderFile
+
+#include "MED_SharedPtr.hxx"
+
+#include <vtkSystemIncludes.h>
+
+class vtkUnstructuredGrid;
+class vtkCell;
+
+namespace VISU
+{
+ using MED::SharedPtr;
+
+ //---------------------------------------------------------------
+ struct TBaseStructure
+ {
+ virtual ~TBaseStructure()
+ {}
+ };
+ typedef SharedPtr<TBaseStructure> PBaseStructure;
+
+ //---------------------------------------------------------------
+ typedef vtkUnstructuredGrid TVTKOutput;
+
+ struct TIDMapper: virtual TBaseStructure
+ {
+ virtual
+ vtkIdType
+ GetNodeObjID(vtkIdType theID) const = 0;
+
+ virtual
+ vtkIdType
+ GetNodeVTKID(vtkIdType theID) const = 0;
+
+ virtual
+ float*
+ GetNodeCoord(vtkIdType theObjID) = 0;
+
+ virtual
+ vtkIdType
+ GetElemObjID(vtkIdType theID) const = 0;
+
+ virtual
+ vtkIdType
+ GetElemVTKID(vtkIdType theID) const = 0;
+
+ virtual
+ vtkCell*
+ GetElemCell(vtkIdType theObjID) = 0;
+
+ virtual
+ TVTKOutput*
+ GetVTKOutput() = 0;
+ };
+ typedef SharedPtr<TIDMapper> PIDMapper;
+
+}
+
+#endif
#include <vtkCellType.h>
-#define _EDF_NODE_IDS_
-//#define _DEXCEPT_
-
using namespace std;
using namespace VISU;
static int MYVALUEDEBUG = 0;
static int MY_FAMILY_DEBUG = 0;
static int MY_GROUP_DEBUG = 0;
+//#define _DEXCEPT_
#else
static int MYDEBUG = 0;
static int MYVALUEDEBUG = 0;
#endif
#define _LOAD_FAMILIES_
+#define _EDF_NODE_IDS_
namespace
{
vtkStandardNewMacro(VISU_Actor);
-VISU_Actor::VISU_Actor(){
+VISU_Actor::VISU_Actor():
+ myIsVTKMapping(false),
+ myParent(this),
+ myPrs3d(NULL),
+ myPipeLine(NULL),
+ myMapper(vtkDataSetMapper::New()),
+ myIsShrunk(false),
+ myIsShrinkable(false),
+ myShrinkFilter(VTKViewer_ShrinkFilter::New())
+{
SetDebug(MYVTKDEBUG);
- myParent = this;
- myPipeLine = NULL;
- myPrs3d = NULL;
myStoreMapping = true;
- myIsShrunk = false;
- myIsShrinkable = false;
- myShrinkFilter = VTKViewer_ShrinkFilter::New();
myShrinkFilter->SetStoreMapping(true);
- SetShrinkFactor();
-
- myMapper = vtkDataSetMapper::New();
-
- myIO = NULL;
- myName = "";
+ SetShrinkFactor();
}
VISU_Actor::~VISU_Actor(){
SALOME_Actor::SetProperty(NULL);
- myMapper->RemoveAllInputs();
myMapper->Delete();
if(myPipeLine)
myPipeLine->UnRegister(this);
- myShrinkFilter->UnRegisterAllOutputs();
myShrinkFilter->Delete();
}
SALOME_Actor::ShallowCopy(prop);
}
+//----------------------------------------------------------------------------
+void
+VISU_Actor
+::SetVTKMapping(bool theIsVTKMapping)
+{
+ myIsVTKMapping = theIsVTKMapping;
+}
+
//----------------------------------------------------------------------------
vtkDataSet*
VISU_Actor
::GetInput()
{
+ if(myIsVTKMapping)
+ return Superclass::GetInput();
+
return myPipeLine->GetInput();
}
VISU_Actor
::GetNodeObjId(vtkIdType theID)
{
+ if(myIsVTKMapping)
+ return Superclass::GetNodeObjId(theID);
+
vtkIdType anID = myGeomFilter->GetNodeObjId(theID);
if(myIsShrunk)
VISU_Actor
::GetNodeVTKID(vtkIdType theID)
{
+ if(myIsVTKMapping)
+ return theID;
+
return myPipeLine->GetNodeVTKID(theID);
}
VISU_Actor
::GetNodeCoord(int theObjID)
{
+ if(myIsVTKMapping)
+ return Superclass::GetNodeCoord(theObjID);
+
return myPipeLine->GetNodeCoord(theObjID);
}
VISU_Actor
::GetElemObjId(vtkIdType theID)
{
+ if(myIsVTKMapping)
+ return Superclass::GetElemObjId(theID);
+
vtkIdType anID = myGeomFilter->GetElemObjId(theID);
if(myIsShrunk)
VISU_Actor
::GetElemVTKID(vtkIdType theID)
{
+ if(myIsVTKMapping)
+ return theID;
+
return myPipeLine->GetElemVTKID(theID);
}
VISU_Actor
::GetElemCell(vtkIdType theObjID)
{
+ if(myIsVTKMapping)
+ return Superclass::GetElemCell(theObjID);
+
return myPipeLine->GetElemCell(theObjID);
}
#define VTKOCC_EXPORT VTK_EXPORT
#endif
-class VTKOCC_EXPORT VISU_Actor : public SALOME_Actor {
+class VTKOCC_EXPORT VISU_Actor : public SALOME_Actor
+{
public:
vtkTypeMacro(VISU_Actor,SALOME_Actor);
void ShallowCopy(vtkProp *prop);
virtual void SetLineWidth(float theLineWidth);
virtual float GetLineWidth();
+ virtual
+ void
+ SetVTKMapping(bool theIsVTKMapping);
+
+ virtual
+ bool
+ IsVTKMapping() const
+ {
+ return myIsVTKMapping;
+ }
+
virtual
vtkDataSet*
GetInput();
protected:
VISU_Actor();
+ bool myIsVTKMapping;
VISU_Actor* myParent;
VISU::Prs3d_i* myPrs3d;
VISU_PipeLine* myPipeLine;
#include "VISU_GaussPointsPL.hxx"
#include "VISU_Plot3DPL.hxx"
-typedef VISU_GaussPointsPL TPresent;
+typedef VISU_ScalarMapPL TPresent;
#include <vtkUnstructuredGrid.h>
#include <vtkDataSetMapper.h>
if(isOnlyMesh){
const VISU::TEntity& anEntity = VISU::CELL_ENTITY;
aMeshOnEntityMapIter = aMeshOnEntityMap.find(anEntity);
- vtkUnstructuredGrid* aDataSet = aConvertor->GetMeshOnEntity(aMeshName,anEntity);
+
+ VISU::PIDMapper anIDMapper =
+ aConvertor->GetMeshOnEntity(aMeshName,anEntity);
+ VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput();
VISU_MeshPL* aPresent = VISU_MeshPL::New();
aPresent->SetInput(aDataSet);
VISU::TValField::const_iterator aValFieldIter = aValField.begin();
if(aValFieldIter == aValField.end()) return 0;
int aTimeStamp = aValFieldIter->first;
- vtkUnstructuredGrid* aDataSet;
+
+ VISU::PIDMapper anIDMapper;
+ VISU::TVTKOutput* aDataSet;
if(anEntity != VISU::NODE_ENTITY)
aDataSet = aConvertor->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp);
else{
- continue;
- aDataSet = aConvertor->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
+ //continue;
+ anIDMapper = aConvertor->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
+ aDataSet = anIDMapper->GetVTKOutput();
}
TPresent* aPresent = TPresent::New();
return false;
}
+//=======================================================================
vtkIdType
VISU_PipeLine
::GetNodeObjID(vtkIdType theID)
{
return myIDMapper->GetNodeCoord(theObjID);
}
-//modified by NIZNHY-PKV Thu Sep 1 18:15:13 2005f
-//=======================================================================
-//function : VISU_PipeLine::GetElemObjID
-//purpose :
+
//=======================================================================
-vtkIdType VISU_PipeLine::GetElemObjID(vtkIdType theID)
+vtkIdType
+VISU_PipeLine
+::GetElemObjID(vtkIdType theID)
{
vtkIdType anID=myExtractGeometry->GetElemObjId(theID);
return myIDMapper->GetElemObjID(anID);
}
-//=======================================================================
-//function : VISU_PipeLine::GetElemVTKID
-//purpose :
-//=======================================================================
-vtkIdType VISU_PipeLine::GetElemVTKID(vtkIdType theID)
+
+vtkIdType
+VISU_PipeLine
+::GetElemVTKID(vtkIdType theID)
{
return myIDMapper->GetElemVTKID(theID);
}
-//=======================================================================
-//function : VISU_PipeLine::GetElemCell
-//purpose :
-//=======================================================================
-vtkCell* VISU_PipeLine::GetElemCell(vtkIdType theObjID)
+
+vtkCell*
+VISU_PipeLine
+::GetElemCell(vtkIdType theObjID)
{
return myIDMapper->GetElemCell(theObjID);
}
+
//=======================================================================
-//function : VISU_PipeLine::SetIdMapper
-//purpose :
-//=======================================================================
-void VISU_PipeLine::SetIDMapper(const VISU::PIDMapper& theIDMapper)
+void
+VISU_PipeLine
+::SetIDMapper(const VISU::PIDMapper& theIDMapper)
{
- myIDMapper=theIDMapper;
+ myIDMapper = theIDMapper;
+ SetInput(myIDMapper->GetVTKOutput());
}
-//=======================================================================
-//function : VISU_PipeLine::GetIDMapper
-//purpose :
-//=======================================================================
-const VISU::PIDMapper& VISU_PipeLine::GetIDMapper()const
+
+const VISU::PIDMapper&
+VISU_PipeLine
+::GetIDMapper() const
{
return myIDMapper;
}
-//modified by NIZNHY-PKV Thu Sep 1 16:16:15 2005t
#ifndef VISU_PipeLine_HeaderFile
#define VISU_PipeLine_HeaderFile
+#include <vector>
#include <vtkObject.h>
#include <vtkSmartPointer.h>
-#include <vector>
-//pkv f
-#include <VISU_Convertor.hxx>
-//pkv t
+#include "VISU_IDMapper.hxx"
class vtkCell;
+
template <class T>
class TVTKSmartPtr: public vtkSmartPointer<T>
{
public:
- TVTKSmartPtr() {}
- TVTKSmartPtr(T* r, bool theIsOwner = false): vtkSmartPointer<T>(r) {
+ TVTKSmartPtr()
+ {}
+
+ TVTKSmartPtr(T* r, bool theIsOwner = false): vtkSmartPointer<T>(r)
+ {
if(r && theIsOwner)
r->Delete();
}
- TVTKSmartPtr& operator()(T* r, bool theIsOwner = false){
+
+ TVTKSmartPtr& operator()(T* r, bool theIsOwner = false)
+ {
vtkSmartPointer<T>::operator=(r);
if(r && theIsOwner)
r->Delete();
return *this;
}
- TVTKSmartPtr& operator=(T* r){
+
+ TVTKSmartPtr& operator=(T* r)
+ {
vtkSmartPointer<T>::operator=(r);
return *this;
}
- operator T* () const {
+
+ operator T* () const
+ {
return vtkSmartPointer<T>::GetPointer();
}
};
class SALOME_ExtractGeometry;
-typedef vtkUnstructuredGrid TInput;
+typedef VISU::TVTKOutput TInput;
class VISU_PipeLine : public vtkObject{
public:
vtkCell*
GetElemCell(vtkIdType theObjID);
- void SetIDMapper(const VISU::PIDMapper& theIDMapper);
+ void
+ SetIDMapper(const VISU::PIDMapper& theIDMapper);
- const VISU::PIDMapper& GetIDMapper()const;
+ const VISU::PIDMapper&
+ GetIDMapper()const;
protected:
VISU_PipeLine();
bool myIsShrinkable;
- TInput *myInput;
+ TInput *myInput;
+ VISU::PIDMapper myIDMapper;
vtkDataSetMapper *myMapper;
// Clipping planes
TVTKSmartPtr<SALOME_ExtractGeometry> myExtractGeometry;
- //
- //pkv f
- VISU::PIDMapper myIDMapper;
- //pkv t
};
#endif
ScalarMap_i::DoHook();
}
+VISU_Actor*
+VISU::CutLines_i
+::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
+{
+ if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){
+ anActor->SetVTKMapping(true);
+ return anActor;
+ }
+ return NULL;
+}
+
void VISU::CutLines_i::BuildTableOfReal(SALOMEDS::SObject_ptr theSObject){
try{
if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal");
virtual Storable* Restore(const Storable::TRestoringMap& theMap);
+ virtual
+ VISU_Actor*
+ CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+
void BuildTableOfReal(SALOMEDS::SObject_ptr theSObject);
static const std::string myComment;
ScalarMap_i::DoHook();
}
+
+VISU_Actor*
+VISU::CutPlanes_i
+::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
+{
+ if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){
+ anActor->SetVTKMapping(true);
+ return anActor;
+ }
+ return NULL;
+}
+
virtual Storable* Restore(const Storable::TRestoringMap& theMap);
+ virtual
+ VISU_Actor*
+ CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+
static const std::string myComment;
virtual const char* GetComment() const;
virtual QString GenerateName();
}
-VISU_Actor* VISU::DeformedShape_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
+VISU_Actor*
+VISU::DeformedShape_i
+::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
{
VISU_Actor* anActor = VISU::ScalarMap_i::CreateActor(theIO);
anActor->SetRepresentation(1);
anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
+ anActor->SetVTKMapping(false);
return anActor;
}
virtual void SetMapScale(double theMapScale = 1.0);
- virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+ virtual
+ VISU_Actor*
+ CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
virtual void UpdateActor(VISU_Actor* theActor) ;
};
const char* theFieldName, int theIteration, int isMemoryCheck)
{
try{
- if(theEntity != VISU::NODE_ENTITY)
+ if(theEntity != VISU::NODE)
return VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck);
else
return false;
VISU_GaussPtsAct* anActor = VISU_GaussPtsAct::New();
try{
VISU::Prs3d_i::CreateActor(anActor,theIO);
+ anActor->SetRepresentation(VTK_POINTS);
+ anActor->SetVTKMapping(true);
UpdateActor(anActor);
}catch(...){
anActor->Delete();
virtual Storable* Restore(const Storable::TRestoringMap& theMap);
- virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+ virtual
+ VISU_Actor*
+ CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
virtual void UpdateActor(VISU_Actor* theActor) ;
};
}
#endif
+
}
+VISU_Actor*
+VISU::IsoSurfaces_i
+::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
+{
+ if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){
+ anActor->SetVTKMapping(true);
+ return anActor;
+ }
+ return NULL;
+}
+
void VISU::IsoSurfaces_i::SetMapScale(double theMapScale){
myIsoSurfacesPL->SetMapScale(theMapScale);
}
virtual Storable* Restore(const Storable::TRestoringMap& theMap);
+ virtual
+ VISU_Actor*
+ CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+
virtual void SetMapScale(double theMapScale = 1.0);
};
}
myNodeColor.R = myNodeColor.G = 1.0; myNodeColor.B = 1.0;
myLinkColor.R = myLinkColor.G = myLinkColor.B = 83/255.;
}
- //jfa IPAL9284:if (int(myEntity) >= 0)
- if (myEntity >= 0) //jfa IPAL9284
- if (mySubMeshName == "")
+
+ if(myEntity >= 0)
+ if(mySubMeshName == "")
myType = VISU::TENTITY;
else
myType = VISU::TFAMILY;
else
myType = VISU::TGROUP;
+
if(MYDEBUG) MESSAGE("Mesh_i::Build - myType = "<<myType);
QString aComment;
- VISU_Convertor::TOutput *anOutput;
+ VISU::PIDMapper anIDMapper;
switch(myType){
case VISU::TENTITY :
- anOutput = myResult->GetInput()->GetMeshOnEntity(myMeshName,(VISU::TEntity)myEntity);//jfa IPAL9284
+ anIDMapper = myResult->GetInput()->GetMeshOnEntity(myMeshName,(VISU::TEntity)myEntity);//jfa IPAL9284
aComment.sprintf("myComment=ENTITY;myType=%d;myMeshName=%s;myId=%d",
VISU::TENTITY,myMeshName.c_str(),myEntity);
- //pkv f
- myMeshPL->SetIDMapper(myResult->GetInput()-> // i.e. the VISU_Convertor
- GetMeshOnEntityIDMapper(myMeshName,(VISU::TEntity)myEntity));
- //pkv t
break;
case VISU::TFAMILY :
- anOutput = myResult->GetInput()->GetFamilyOnEntity(myMeshName,(VISU::TEntity)myEntity,mySubMeshName);
+ anIDMapper = myResult->GetInput()->GetFamilyOnEntity(myMeshName,(VISU::TEntity)myEntity,mySubMeshName);
aComment.sprintf("myComment=FAMILY;myType=%d;myMeshName=%s;myEntityId=%d;myName=%s",
VISU::TFAMILY,myMeshName.c_str(),myEntity,mySubMeshName.c_str());
- //pkv f
- myMeshPL->SetIDMapper(myResult->GetInput()-> // i.e. the VISU_Convertor
- GetFamilyOnEntityIDMapper(myMeshName,(VISU::TEntity)myEntity,mySubMeshName));
- //pkv t
-
break;
case VISU::TGROUP :
- anOutput = myResult->GetInput()->GetMeshOnGroup(myMeshName,mySubMeshName);
+ anIDMapper = myResult->GetInput()->GetMeshOnGroup(myMeshName,mySubMeshName);
aComment.sprintf("myComment=GROUP;myType=%d;myMeshName=%s;myName=%s",
VISU::TGROUP,myMeshName.c_str(),mySubMeshName.c_str());
-
- //pkv f
- myMeshPL->SetIDMapper(myResult->GetInput()-> // i.e. the VISU_Convertor
- GetMeshOnGroupIDMapper(myMeshName,mySubMeshName));
- //pkv t
break;
}
- if(anOutput == NULL) throw std::runtime_error("Mesh_i::Build - anOutput == NULL !!!");
- //
- myMeshPL->SetInput(anOutput);
+ if(!anIDMapper)
+ throw std::runtime_error("Mesh_i::Build - !anIDMapper !!!");
+
+ myMeshPL->SetIDMapper(anIDMapper);
myMeshPL->Build();
- //
+
if(!theRestoring) { //Setting IOR on the label
myMeshPL->Init();
string aResultEntry = myResult->GetEntry();
ScalarMap_i::DoHook();
}
+VISU_Actor*
+VISU::Plot3D_i
+::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
+{
+ if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){
+ anActor->SetVTKMapping(true);
+ return anActor;
+ }
+ return NULL;
+}
+
void VISU::Plot3D_i::SetMapScale(double theMapScale)
{
myPlot3DPL->SetMapScale(theMapScale);
virtual Storable* Restore (const Storable::TRestoringMap& theMap);
+ virtual
+ VISU_Actor*
+ CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+
static const std::string myComment;
virtual const char* GetComment() const;
virtual QString GenerateName();
MESSAGE("No mesh named " << theMeshName );
return components;
}
- VISU_Convertor::TOutput* vtkMesh = myInput->GetMeshOnEntity (theMeshName,
- CELL_ENTITY);
- if ( !vtkMesh || vtkMesh->GetNumberOfCells() == 0 ) {
+
+ VISU::PIDMapper anIDMapper = myInput->GetMeshOnEntity(theMeshName,
+ CELL_ENTITY);
+ VISU::TVTKOutput* aMesh = anIDMapper->GetVTKOutput();
+
+ if ( !aMesh || aMesh->GetNumberOfCells() == 0 ) {
MESSAGE( "No cells in the mesh: " << theMeshName );
return components;
}
gp_Vec axDirs[ nbAxes ];
float minSize[3] = { FLT_MAX, FLT_MAX, FLT_MAX };
bool axesComputed = false;
- for ( vtkIdType iCell = 0; iCell < vtkMesh->GetNumberOfCells(); ++iCell )
+ for ( vtkIdType iCell = 0; iCell < aMesh->GetNumberOfCells(); ++iCell )
{
- vtkCell* cell = vtkMesh->GetCell( iCell );
+ vtkCell* cell = aMesh->GetCell( iCell );
int nbPnt = cell->GetNumberOfPoints();
if ( nbPnt != 8 )
continue;
// on axis direction; define bnd box
set< float > comps[ 3 ];
Bnd_Box box;
- vtkPoints * points = vtkMesh->GetPoints();
- vtkIdType iP, nbP = vtkMesh->GetNumberOfPoints();
+ vtkPoints * points = aMesh->GetPoints();
+ vtkIdType iP, nbP = aMesh->GetNumberOfPoints();
for ( iP = 0; iP < nbP; ++iP )
{
float* coo = points->GetPoint( iP );
void VISU::ScalarMap_i::DoSetInput(Result_i* theResult){
if(theResult->GetInput() == NULL)
throw std::runtime_error("Mesh_i::Build - theResult->GetInput() == NULL !!!");
+
myField = theResult->GetInput()->GetField(myMeshName,myEntity,myFieldName);
if(myField == NULL)
throw std::runtime_error("There is no Field with the parameters !!!");
- VISU_Convertor::TOutput *anOutput =
+
+ VISU::PIDMapper anIDMapper =
theResult->GetInput()->GetTimeStampOnMesh(myMeshName,myEntity,myFieldName,myIteration);
- if(anOutput == NULL)
+
+ if(!anIDMapper)
throw std::runtime_error("There is no TimeStamp with the parameters !!!");
- myScalarMapPL->SetInput(anOutput);
- //pkv f
- //myScalarMapPL->SetProfile(theResult->GetInput()->GetProfile(myMeshName,myEntity,myFieldName,myIteration));
- myScalarMapPL->SetIDMapper(theResult->GetInput()-> // i.e. the VISU_Convertor
- GetTimeStampOnMeshIDMapper(myMeshName,myEntity,myFieldName,myIteration));
- //pkv t
+
+ myScalarMapPL->SetIDMapper(anIDMapper);
myScalarMapPL->Build();
}
myScalarMapPL->SetMapScale(theMapScale);
}
-VISU_Actor* VISU::ScalarMap_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
+VISU_Actor*
+VISU::ScalarMap_i
+::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
{
VISU_ScalarMapAct* anActor = VISU_ScalarMapAct::New();
try{
virtual int GetIteration() { return myIteration; }
- virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+ virtual
+ VISU_Actor*
+ CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
virtual void UpdateActor(VISU_Actor* theActor) ;
};
const char* theFieldName, int theIteration, int isMemoryCheck)
{
try{
- if(!VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,false)) return 0;
- VISU_Convertor::TOutput *anOutput =
+ if(!VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,false))
+ return 0;
+
+ VISU::PIDMapper anIDMapper =
theResult->GetInput()->GetTimeStampOnMesh(theMeshName,VISU::TEntity(theEntity),theFieldName,theIteration);
- bool aResult = VISU_StreamLinesPL::IsPossible(anOutput);
+ VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput();
+ bool aResult = VISU_StreamLinesPL::IsPossible(aDataSet);
MESSAGE("StreamLines_i::IsPossible - aResult = "<<aResult);
return aResult;
}catch(std::exception& exc){
}
-VISU_Actor* VISU::StreamLines_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
+VISU_Actor*
+VISU::StreamLines_i
+::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
{
- return VISU::DeformedShape_i::CreateActor(theIO);
+ if(VISU_Actor* anActor = VISU::DeformedShape_i::CreateActor(theIO)){
+ anActor->SetVTKMapping(true);
+ return anActor;
+ }
+ return NULL;
}
virtual void Update();
- virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+ virtual
+ VISU_Actor*
+ CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
virtual void UpdateActor(VISU_Actor* theActor);
VISU_VectorsAct* anActor = VISU_VectorsAct::New();
try{
VISU::Prs3d_i::CreateActor(anActor,theIO);
+ anActor->SetVTKMapping(true);
anActor->SetBarVisibility(true);
anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
anActor->GetProperty()->SetLineWidth(GetLineWidth());
virtual const char* GetComment() const;
virtual QString GenerateName();
- virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+ virtual
+ VISU_Actor*
+ CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
virtual void UpdateActor(VISU_Actor* theActor) ;
};