-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File:
+
+// File:
// Author: Alexey PETROV
// Module : VISU
//
{
/* vtkIdType
VISUGeom2NbNodes(EGeometry theGeom)
- {
+ {
switch(theGeom){
#ifndef VISU_ENABLE_QUADRATIC
- case VISU::eSEG3:
+ case VISU::eSEG3:
return 2;
- case VISU::eTRIA6:
+ case VISU::eTRIA6:
return 3;
- case VISU::eQUAD8:
+ case VISU::eQUAD8:
return 4;
- case VISU::eTETRA10:
+ case VISU::eTETRA10:
return 4;
- case VISU::eHEXA20:
+ case VISU::eHEXA20:
return 8;
- case VISU::ePENTA15:
+ case VISU::ePENTA15:
return 6;
- case VISU::ePYRA13:
+ case VISU::ePYRA13:
return 5;
#endif
- case VISU::ePOLYGONE:
- case VISU::ePOLYEDRE:
+ case VISU::ePOLYGONE:
+ case VISU::ePOLYEDRE:
return -1;
default:
return theGeom % 100;
vtkIdType
VISUGeom2VTK(EGeometry theGeom)
- {
+ {
switch(theGeom){
- case VISU::ePOINT1:
+ case VISU::ePOINT1:
return VTK_VERTEX;
- case VISU::eSEG2:
+ case VISU::eSEG2:
return VTK_LINE;
- case VISU::eTRIA3:
+ case VISU::eTRIA3:
return VTK_TRIANGLE;
- case VISU::eQUAD4:
+ case VISU::eQUAD4:
return VTK_QUAD;
- case VISU::eTETRA4:
+ case VISU::eTETRA4:
return VTK_TETRA;
- case VISU::eHEXA8:
+ case VISU::eHEXA8:
return VTK_HEXAHEDRON;
- case VISU::ePENTA6:
+ case VISU::ePENTA6:
return VTK_WEDGE;
- case VISU::ePYRA5:
+ case VISU::ePYRA5:
return VTK_PYRAMID;
- case VISU::ePOLYGONE:
+ case VISU::ePOLYGONE:
return VTK_POLYGON;
- case VISU::ePOLYEDRE:
+ case VISU::ePOLYEDRE:
return VTK_CONVEX_POINT_SET;
#ifndef VISU_ENABLE_QUADRATIC
- case VISU::eSEG3:
+ case VISU::eSEG3:
return VTK_LINE;
- case VISU::eTRIA6:
+ case VISU::eTRIA6:
return VTK_TRIANGLE;
- case VISU::eQUAD8:
+ case VISU::eQUAD8:
return VTK_QUAD;
- case VISU::eTETRA10:
+ case VISU::eTETRA10:
return VTK_TETRA;
- case VISU::eHEXA20:
+ case VISU::eHEXA20:
return VTK_HEXAHEDRON;
- case VISU::ePENTA15:
+ case VISU::ePENTA15:
return VTK_WEDGE;
- case VISU::ePYRA13:
+ case VISU::ePYRA13:
return VTK_PYRAMID;
#else
- case VISU::eSEG3:
+ case VISU::eSEG3:
#if defined(VTK_QUADRATIC_EDGE) && defined(VISU_USE_VTK_QUADRATIC)
return VTK_QUADRATIC_EDGE;
#else
return VTK_POLY_LINE;
#endif
- case VISU::eTRIA6:
+ case VISU::eTRIA6:
#if defined(VTK_QUADRATIC_TRIANGLE) && defined(VISU_USE_VTK_QUADRATIC)
return VTK_QUADRATIC_TRIANGLE;
#else
return VTK_POLYGON;
#endif
- case VISU::eQUAD8:
+ case VISU::eQUAD8:
#if defined(VTK_QUADRATIC_QUAD) && defined(VISU_USE_VTK_QUADRATIC)
return VTK_QUADRATIC_QUAD;
#else
return VTK_POLYGON;
#endif
- case VISU::eTETRA10:
+ case VISU::eTETRA10:
#if defined(VTK_QUADRATIC_TETRA) && defined(VISU_USE_VTK_QUADRATIC)
return VTK_QUADRATIC_TETRA;
#else
return VTK_CONVEX_POINT_SET;
#endif
- case VISU::eHEXA20:
+ case VISU::eHEXA20:
#if defined(VTK_QUADRATIC_HEXAHEDRON) && defined(VISU_USE_VTK_QUADRATIC)
return VTK_QUADRATIC_HEXAHEDRON;
#else
return VTK_CONVEX_POINT_SET;
#endif
- case VISU::ePENTA15:
+ case VISU::ePENTA15:
#if defined(VTK_QUADRATIC_WEDGE) && defined(VISU_USE_VTK_QUADRATIC)
return VTK_QUADRATIC_WEDGE;
#else
return VTK_CONVEX_POINT_SET;
#endif
- case VISU::ePYRA13:
+ case VISU::ePYRA13:
#if defined(VTK_QUADRATIC_PYRAMID) && defined(VISU_USE_VTK_QUADRATIC)
return VTK_QUADRATIC_PYRAMID;
#else
EGeometry
VTKGeom2VISU(vtkIdType theGeom)
- {
+ {
switch(theGeom){
- case VTK_VERTEX:
+ case VTK_VERTEX:
return VISU::ePOINT1;
- case VTK_LINE:
+ case VTK_LINE:
return VISU::eSEG2;
- case VTK_TRIANGLE:
+ case VTK_TRIANGLE:
return VISU::eTRIA3;
- case VTK_QUAD:
+ case VTK_QUAD:
return VISU::eQUAD4;
- case VTK_TETRA:
+ case VTK_TETRA:
return VISU::eTETRA4;
- case VTK_HEXAHEDRON:
+ case VTK_HEXAHEDRON:
return VISU::eHEXA8;
- case VTK_WEDGE:
+ case VTK_WEDGE:
return VISU::ePENTA6;
- case VTK_PYRAMID:
+ case VTK_PYRAMID:
return VISU::ePYRA5;
- case VTK_POLYGON:
+ case VTK_POLYGON:
return VISU::ePOLYGONE;
- case VTK_CONVEX_POINT_SET:
+ case VTK_CONVEX_POINT_SET:
return VISU::ePOLYEDRE;
#if defined(VISU_ENABLE_QUADRATIC) && defined(VISU_USE_VTK_QUADRATIC)
#if defined(VTK_QUADRATIC_EDGE)
- case VTK_QUADRATIC_EDGE:
+ case VTK_QUADRATIC_EDGE:
return VISU::eSEG3;
#endif
#if defined(VTK_QUADRATIC_TRIANGLE)
- case VTK_QUADRATIC_TRIANGLE:
+ case VTK_QUADRATIC_TRIANGLE:
return VISU::eTRIA6;
#endif
#if defined(VTK_QUADRATIC_QUAD)
- case VTK_QUADRATIC_QUAD:
+ case VTK_QUADRATIC_QUAD:
return VISU::eQUAD8;
#endif
#if defined(VTK_QUADRATIC_TETRA)
- case VTK_QUADRATIC_TETRA:
+ case VTK_QUADRATIC_TETRA:
return VISU::eTETRA10;
#endif
#if defined(VTK_QUADRATIC_HEXAHEDRON)
- case VTK_QUADRATIC_HEXAHEDRON:
+ case VTK_QUADRATIC_HEXAHEDRON:
return VISU::eHEXA20;
#endif
#if defined(VTK_QUADRATIC_WEDGE)
- case VTK_QUADRATIC_WEDGE:
+ case VTK_QUADRATIC_WEDGE:
return VISU::ePENTA15;
#endif
#if defined(VTK_QUADRATIC_PYRAMID)
- case VTK_QUADRATIC_PYRAMID:
+ case VTK_QUADRATIC_PYRAMID:
return VISU::ePYRA13;
#endif
*/
size_t
GetDataSetSize(size_t theNbOfPoints,
- size_t theNbOfCells,
- size_t theCellsSize,
- bool theComputeLinks)
+ size_t theNbOfCells,
+ size_t theCellsSize,
+ bool theComputeLinks)
{
size_t aPointsSize = 3*theNbOfPoints*sizeof(VISU::TCoord);
size_t aConnectivityAndTypesSize = theCellsSize*sizeof(vtkIdType);
::TPolyDataHolder()
{}
- const PPolyData&
+ const PPolyData&
TPolyDataHolder
::GetSource() const
{
return mySource;
}
- vtkPolyData*
+ vtkPolyData*
TPolyDataHolder
::GetPolyDataOutput()
{
::TUnstructuredGridHolder()
{}
- const PUnstructuredGrid&
+ const PUnstructuredGrid&
TUnstructuredGridHolder
::GetSource() const
{
return mySource;
}
- vtkUnstructuredGrid*
+ vtkUnstructuredGrid*
TUnstructuredGridHolder
::GetUnstructuredGridOutput()
{
{
if(myIsVTKDone){
if(vtkDataSet* anOutput = GetOutput()){
- anOutput->Update();
- return anOutput->GetActualMemorySize() * 1024;
+ anOutput->Update();
+ return anOutput->GetActualMemorySize() * 1024;
}
}
throw std::runtime_error("TMemoryCheckIDMapper::GetMemorySize - myIsVTKDone == false !!!");
::TAppendFilterHolder()
{}
- const PAppendFilter&
+ const PAppendFilter&
TAppendFilterHolder
::GetFilter() const
{
return myFilter;
}
- vtkUnstructuredGrid*
+ vtkUnstructuredGrid*
TAppendFilterHolder
::GetUnstructuredGridOutput()
{
::TAppendPolyDataHolder()
{}
- const PAppendPolyData&
+ const PAppendPolyData&
TAppendPolyDataHolder
::GetFilter() const
{
return myFilter;
}
- vtkPolyData*
+ vtkPolyData*
TAppendPolyDataHolder
::GetPolyDataOutput()
{
::TMergeFilterHolder()
{}
- const PMergeFilter&
+ const PMergeFilter&
TMergeFilterHolder
::GetFilter() const
{
return myFilter;
}
- vtkDataSet*
+ vtkDataSet*
TMergeFilterHolder
::GetOutput()
{
//---------------------------------------------------------------
TMeshImpl
- ::TMeshImpl():
+ ::TMeshImpl():
myNbPoints(0)
{}
{
return myNbPoints;
}
-
+
vtkIdType
TMeshImpl::
GetDim() const
{
return myDim;
}
-
+
vtkPointSet*
TMeshImpl::
GetPointSet()
{
if ( !mySubMeshID.empty() )
return mySubMeshID[theID];
-
+
return theID;
}
::GetElemVTKID(vtkIdType theID) const
{
if ( !mySubMeshID.empty() )
- for ( size_t anId = 0; anId < mySubMeshID.size(); anId++ )
- if ( mySubMeshID[ anId ] == theID )
- return anId;
+ for ( size_t anId = 0; anId < mySubMeshID.size(); anId++ )
+ if ( mySubMeshID[ anId ] == theID )
+ return anId;
return theID;
}
{
return myNamedPointCoords->GetObjID(theID);
}
-
+
vtkIdType
TProfileImpl
::GetNodeVTKID(vtkIdType theID) const
return myNamedPointCoords->GetVTKID(theID);
}
- vtkFloatingPointType*
+ vtkFloatingPointType*
TProfileImpl
::GetNodeCoord(vtkIdType theObjID)
{
return VISU::GetElemVTKID(GetFilter()->GetOutput(), theID);
}
- vtkCell*
+ vtkCell*
TProfileImpl
::GetElemCell(vtkIdType theObjID)
{
vtkIdType aVtkID = GetElemVTKID(theObjID);
return GetFilter()->GetOutput()->GetCell(aVtkID);
}
-
- vtkUnstructuredGrid*
+
+ vtkUnstructuredGrid*
TProfileImpl
::GetUnstructuredGridOutput()
{
return aSize;
}
- std::string
+ std::string
TProfileImpl
::GetNodeName(vtkIdType theObjID) const
{
return myNamedPointCoords->GetNodeName(theObjID);
}
- std::string
+ std::string
TProfileImpl
::GetElemName(vtkIdType theObjID) const
{
{
return myIDMapper->GetNodeObjID(theID);
}
-
+
vtkIdType
TUnstructuredGridIDMapperImpl
::GetNodeVTKID(vtkIdType theID) const
return myIDMapper->GetNodeVTKID(theID);
}
- vtkFloatingPointType*
+ vtkFloatingPointType*
TUnstructuredGridIDMapperImpl
::GetNodeCoord(vtkIdType theObjID)
{
return myIDMapper->GetElemVTKID(theID);
}
- vtkCell*
+ vtkCell*
TUnstructuredGridIDMapperImpl
::GetElemCell(vtkIdType theObjID)
{
return myIDMapper->GetElemCell(theObjID);
}
-
- void
+
+ void
TUnstructuredGridIDMapperImpl
::SetReferencedMesh( const PNamedIDMapper& theNamedIDMapper )
{
myCommonCellsFilter->SetCellsUG( theNamedIDMapper->GetUnstructuredGridOutput() );
}
- void
+ void
TUnstructuredGridIDMapperImpl
::Build()
{
aFilter->SetScalars( aDataSet );
aFilter->SetVectors( aDataSet );
aFilter->AddField( "VISU_FIELD", aDataSet );
+ aFilter->AddField( "VISU_FIELD_GAUSS_MIN", aDataSet );
+ aFilter->AddField( "VISU_FIELD_GAUSS_MAX", aDataSet );
+ aFilter->AddField( "VISU_FIELD_GAUSS_MOD", aDataSet );
aFilter->AddField( "VISU_CELLS_MAPPER", aDataSet );
aFilter->AddField( "ELNO_FIELD", aDataSet );
aFilter->AddField( "ELNO_COMPONENT_MAPPER", aDataSet );
aFilter->AddField( "VISU_POINTS_MAPPER", aDataSet );
-
+
myCommonCellsFilter->SetProfileUG( aFilter->GetUnstructuredGridOutput() );
- }
+ }
}
- vtkUnstructuredGrid*
+ vtkUnstructuredGrid*
TUnstructuredGridIDMapperImpl
::GetUnstructuredGridOutput()
{
return myCommonCellsFilter->GetOutput();
}
- vtkDataSet*
+ vtkDataSet*
TUnstructuredGridIDMapperImpl
::GetOutput()
{
return GetUnstructuredGridOutput();
}
- PUnstructuredGrid
+ PUnstructuredGrid
TUnstructuredGridIDMapperImpl
::GetSource()
{
{
return myIDMapper->GetNodeObjID(theID);
}
-
+
vtkIdType
TPolyDataIDMapperImpl
::GetNodeVTKID(vtkIdType theID) const
return myIDMapper->GetNodeVTKID(theID);
}
- vtkFloatingPointType*
+ vtkFloatingPointType*
TPolyDataIDMapperImpl
::GetNodeCoord(vtkIdType theObjID)
{
return myIDMapper->GetElemVTKID(theID);
}
- vtkCell*
+ vtkCell*
TPolyDataIDMapperImpl
::GetElemCell(vtkIdType theObjID)
{
return myIDMapper->GetElemCell(theObjID);
}
-
- void
+
+ void
TPolyDataIDMapperImpl
::Build()
{
if ( !myFilter.GetPointer() ) {
const PAppendPolyData& anAppendFilter = myIDMapper->GetFilter();
vtkPolyData* aGeometry = anAppendFilter->GetOutput();
-
+
const PPolyData& aSource = mySource.GetSource();
vtkPolyData* aDataSet = aSource.GetPointer();
aDataSet->ShallowCopy( aGeometry );
-
+
const PMergeFilter& aFilter = GetFilter();
aFilter->SetGeometry( aGeometry );
aFilter->SetScalars( aDataSet );
aFilter->SetVectors( aDataSet );
aFilter->AddField( "VISU_FIELD", aDataSet );
+ aFilter->AddField( "VISU_FIELD_GAUSS_MIN", aDataSet );
+ aFilter->AddField( "VISU_FIELD_GAUSS_MAX", aDataSet );
+ aFilter->AddField( "VISU_FIELD_GAUSS_MOD", aDataSet );
aFilter->AddField( "VISU_CELLS_MAPPER", aDataSet );
aFilter->AddField( "VISU_POINTS_MAPPER", aDataSet );
}
}
- vtkPolyData*
+ vtkPolyData*
TPolyDataIDMapperImpl
::GetPolyDataOutput()
{
return myFilter->GetPolyDataOutput();
}
- vtkDataSet*
+ vtkDataSet*
TPolyDataIDMapperImpl
::GetOutput()
{
return GetPolyDataOutput();
}
- PPolyData
+ PPolyData
TPolyDataIDMapperImpl
::GetSource()
{
myGeom(EGeometry(-1)),
myNbPoints(0)
{}
-
+
void
TGaussImpl
::LessThan(const PGaussImpl& theGauss,
- bool& theResult) const
+ bool& theResult) const
{
theResult = false;
}
myStatus(eNone),
myStartID(0)
{}
-
+
TGaussPointID
TGaussSubMeshImpl
::GetObjID(vtkIdType theID) const
{
TCellID aCellID = myStartID + theID / myGauss->myNbPoints;
TLocalPntID aLocalPntID = theID % myGauss->myNbPoints;
-
+
return TGaussPointID(aCellID, aLocalPntID);
}
TCellID aCellID = theID.first;
TLocalPntID aLocalPntID = theID.second;
-
+
vtkIdType aNbPoints = myGauss->myNbPoints;
if ( aLocalPntID >= aNbPoints )
return aResult;
{
return mySubProfile->GetElemObjID( theID );
}
-
-
+
+
vtkIdType
VISU::TGaussSubMeshImpl
::GetElemVTKID(vtkIdType theID) const
return mySubProfile->GetElemVTKID( theID );
}
- vtkIdType
+ vtkIdType
TGaussSubMeshImpl
::GetGlobalID(vtkIdType theID) const
{
PGaussSubMeshImpl aLeft(theLeft), aRight(theRight);
const PGaussImpl& aGaussLeft = aLeft->myGauss;
const PGaussImpl& aGaussRight = aRight->myGauss;
-
+
if(aGaussLeft->myGeom != aGaussRight->myGeom)
return aGaussLeft->myGeom < aGaussRight->myGeom;
myParent(NULL)
{}
- TGaussPointID
+ TGaussPointID
TGaussMeshImpl
::GetObjID(vtkIdType theID) const
{
return VISU::GetObjID(aFilter->GetOutput(), theID);
}
- vtkIdType
+ vtkIdType
TGaussMeshImpl
::GetVTKID(const TGaussPointID& theID) const
{
TCellID aCellID = theID.first;
vtkIdType aVTKCellId = GetParent()->GetElemVTKID( aCellID );
- if ( aVTKCellId < 0 )
+ if ( aVTKCellId < 0 )
return aResult;
-
+
vtkCell* aCell = GetParent()->GetElemCell( aCellID );
if ( !aCell )
return aResult;
EGeometry aVGeom = VISU::VTKGeom2VISU( aCell->GetCellType() );
- if ( aVGeom < EGeometry(0) )
+ if ( aVGeom < EGeometry(0) )
return aResult;
-
+
TGeom2GaussSubMesh::const_iterator anIter = myGeom2GaussSubMesh.find( aVGeom );
if ( anIter == myGeom2GaussSubMesh.end() )
return aResult;
-
+
size_t aSubMeshEnd = myGaussSubMeshArr.size();
const PGaussSubMeshImpl& aGaussSubMesh = anIter->second;
for ( size_t aSubMeshId = 0; aSubMeshId < aSubMeshEnd; aSubMeshId++ ) {
const PGaussSubMeshImpl& aSubMesh = myGaussSubMeshArr[aSubMeshId];
if ( aGaussSubMesh.get() == aSubMesh.get() ) {
- return aGaussSubMesh->GetVTKID(theID);
+ return aGaussSubMesh->GetVTKID(theID);
}
}
return aResult;
}
- vtkPolyData*
+ vtkPolyData*
TGaussMeshImpl
::GetPolyDataOutput()
{
return aSize;
}
- TNamedIDMapper*
+ TNamedIDMapper*
TGaussMeshImpl
::GetParent() const
{
//---------------------------------------------------------------
- TGaussPointID
+ TGaussPointID
TGaussPtsIDFilter
::GetObjID(vtkIdType theID) const
{
return myGaussPtsIDMapper->GetObjID(theID);
}
- vtkIdType
+ vtkIdType
TGaussPtsIDFilter
::GetVTKID(const TGaussPointID& theID) const
{
return myGaussPtsIDMapper->GetVTKID(theID);
}
-
- TNamedIDMapper*
+
+ TNamedIDMapper*
TGaussPtsIDFilter
::GetParent() const
{
return myGaussPtsIDMapper->GetParent();
}
- vtkPolyData*
+ vtkPolyData*
TGaussPtsIDFilter
::GetPolyDataOutput()
{
return TPolyDataIDMapperImpl::GetPolyDataOutput();
}
- vtkDataSet*
+ vtkDataSet*
TGaussPtsIDFilter
::GetOutput()
{
{
TStructured::CopyStructure( theStructured );
- if ( PMeshImpl aMesh = theStructured )
- GetSource()->ShallowCopy( aMesh->GetPointSet() );
+ if ( PMeshImpl aMesh = theStructured )
+ GetSource()->ShallowCopy( aMesh->GetPointSet() );
}
vtkIdType
return myStartID + theID;
}
- std::string
+ std::string
TSubMeshImpl
::GetElemName(vtkIdType theObjID) const
{
{
TStructured::CopyStructure( theStructured );
- if ( PMeshImpl aMesh = theStructured )
- myNamedPointCoords = aMesh->myNamedPointCoords;
+ if ( PMeshImpl aMesh = theStructured )
+ myNamedPointCoords = aMesh->myNamedPointCoords;
}
vtkIdType
return VISU::GetElemObjID(GetFilter()->GetOutput(), theID);
}
- std::string
+ std::string
TMeshOnEntityImpl
::GetNodeName(vtkIdType theObjID) const
{
return myNamedPointCoords->GetNodeName(theObjID);
}
- std::string
+ std::string
TMeshOnEntityImpl
::GetElemName(vtkIdType theObjID) const
{
return aSubMesh->GetElemName(anInputCellID.second);
}
- vtkUnstructuredGrid*
+ vtkUnstructuredGrid*
TMeshOnEntityImpl
::GetUnstructuredGridOutput()
{
else{
TID2ID::const_iterator anIter = myElemObj2VTKID.find(theID);
if(anIter != myElemObj2VTKID.end())
- return anIter->second;
+ return anIter->second;
}
return -1;
}
return myMeshID[theID];
}
- vtkIdType
+ vtkIdType
TFamilyImpl
- ::GetNodeObjID(vtkIdType theID) const
+ ::GetNodeObjID(vtkIdType theID) const
{
return myNamedPointCoords->GetObjID(theID);
}
vtkIdType
TFamilyImpl
- ::GetNodeVTKID(vtkIdType theID) const
+ ::GetNodeVTKID(vtkIdType theID) const
{
return myNamedPointCoords->GetVTKID(theID);
}
- vtkUnstructuredGrid*
+ vtkUnstructuredGrid*
TFamilyImpl
::GetUnstructuredGridOutput()
{
{
TStructured::CopyStructure( theStructured );
- if ( PMeshImpl aMesh = theStructured )
+ if ( PMeshImpl aMesh = theStructured )
myNamedPointCoords = aMesh->myNamedPointCoords;
}
- TNbASizeCells
+ TNbASizeCells
TGroupImpl
::GetNbASizeCells() const
{
vtkIdType aNbCells = 0, aCellsSize = 0;
TFamilySet::const_iterator anIter = myFamilySet.begin();
for(; anIter != myFamilySet.end(); anIter++){
- PFamilyImpl aFamily = *anIter;
+ PFamilyImpl aFamily = (*anIter).second;
aNbCells += aFamily->myNbCells;
aCellsSize += aFamily->myCellsSize;
}
else{
TID2ID::const_iterator anIter = myElemObj2VTKID.find(theID);
if(anIter != myElemObj2VTKID.end())
- return anIter->second;
+ return anIter->second;
}
return -1;
}
return VISU::GetElemObjID(GetFilter()->GetOutput(), theID);
}
- vtkIdType
+ vtkIdType
TGroupImpl
- ::GetNodeObjID(vtkIdType theID) const
+ ::GetNodeObjID(vtkIdType theID) const
{
return myNamedPointCoords->GetObjID(theID);
}
vtkIdType
TGroupImpl
- ::GetNodeVTKID(vtkIdType theID) const
+ ::GetNodeVTKID(vtkIdType theID) const
{
return myNamedPointCoords->GetVTKID(theID);
}
- vtkUnstructuredGrid*
+ vtkUnstructuredGrid*
TGroupImpl
::GetUnstructuredGridOutput()
{
}
-
+
//---------------------------------------------------------------
TFieldImpl
::TFieldImpl()
, myDataType( 0 )
{}
- void
+ void
TFieldImpl
::Init(vtkIdType theNbComp,
- vtkIdType theDataType)
+ vtkIdType theDataType)
{
myNbComp = theNbComp;
myDataType = theDataType;
myCompNames.resize(theNbComp);
myUnitNames.resize(theNbComp);
- myMinMaxArr.resize(theNbComp + 1);
- myAverageMinMaxArr.resize(theNbComp + 1);
- for(vtkIdType iComp = 0; iComp <= theNbComp; iComp++){
- TMinMax& aMinMax = myMinMaxArr[iComp];
- aMinMax.first = VTK_LARGE_FLOAT;
- aMinMax.second = -VTK_LARGE_FLOAT;
- TMinMax& anAverageMinMax = myAverageMinMaxArr[iComp];
- anAverageMinMax.first = VTK_LARGE_FLOAT;
- anAverageMinMax.second = -VTK_LARGE_FLOAT;
+
+ myMetric2Comp2MinMax.resize(3);
+ myMetric2Comp2AverageMinMax.resize(3);
+ myMetric2Comp2Group2MinMax.resize(3);
+ myMetric2Comp2Group2AverageMinMax.resize(3);
+ for(int aGaussMetric = (int)VISU::AVERAGE_METRIC; aGaussMetric <= (int)VISU::MAXIMUM_METRIC; aGaussMetric++){
+ TComp2MinMax& aComp2MinMax = myMetric2Comp2MinMax[aGaussMetric];
+ TComp2MinMax& aComp2AverageMinMax = myMetric2Comp2AverageMinMax[aGaussMetric];
+ TComp2Group2MinMax& aComp2Group2MinMax = myMetric2Comp2Group2MinMax[aGaussMetric];
+ TComp2Group2MinMax& aComp2Group2AverageMinMax = myMetric2Comp2Group2AverageMinMax[aGaussMetric];
+
+ aComp2MinMax.resize(theNbComp + 1);
+ aComp2AverageMinMax.resize(theNbComp + 1);
+ aComp2Group2MinMax.resize(theNbComp + 1);
+ aComp2Group2AverageMinMax.resize(theNbComp + 1);
+ for(vtkIdType iComp = 0; iComp <= theNbComp; iComp++){
+ TMinMax& aMinMax = aComp2MinMax[iComp];
+ aMinMax.first = VTK_LARGE_FLOAT;
+ aMinMax.second = -VTK_LARGE_FLOAT;
+ TMinMax& anAverageMinMax = aComp2AverageMinMax[iComp];
+ anAverageMinMax.first = VTK_LARGE_FLOAT;
+ anAverageMinMax.second = -VTK_LARGE_FLOAT;
+ }
}
}
- vtkIdType
+ vtkIdType
TFieldImpl
::GetDataType() const
{
return myDataType;
}
- TMinMax
+ TMinMax
TFieldImpl
- ::GetMinMax(vtkIdType theCompID)
+ ::GetMinMax(vtkIdType theCompID, const TNames& theGroupNames, TGaussMetric theGaussMetric)
{
- return myMinMaxArr[theCompID];
+ TMinMax aMinMax;
+ bool anIsMinMaxInitialized = false;
+ if( !theGroupNames.empty() ) {
+ aMinMax.first = VTK_LARGE_FLOAT;
+ aMinMax.second = -VTK_LARGE_FLOAT;
+
+ const TGroup2MinMax& aGroup2MinMax = myMetric2Comp2Group2MinMax[theGaussMetric][theCompID];
+ TNames::const_iterator aNameIter = theGroupNames.begin();
+ for( ; aNameIter != theGroupNames.end(); aNameIter++ ) {
+ TGroup2MinMax::const_iterator aGroup2MinMaxIter = aGroup2MinMax.find( *aNameIter );
+ if( aGroup2MinMaxIter != aGroup2MinMax.end() ) {
+ const TMinMax& aGroupMinMax = aGroup2MinMaxIter->second;
+ aMinMax.first = std::min( aMinMax.first, aGroupMinMax.first );
+ aMinMax.second = std::max( aMinMax.second, aGroupMinMax.second );
+ anIsMinMaxInitialized = true;
+ }
+ }
+ }
+
+ if( !anIsMinMaxInitialized )
+ aMinMax = myMetric2Comp2MinMax[theGaussMetric][theCompID];
+
+ return aMinMax;
}
- TMinMax
+ TMinMax
TFieldImpl
- ::GetAverageMinMax(vtkIdType theCompID)
+ ::GetAverageMinMax(vtkIdType theCompID, const TNames& theGroupNames, TGaussMetric theGaussMetric)
{
- return myAverageMinMaxArr[theCompID];
+ TMinMax aMinMax;
+ bool anIsMinMaxInitialized = false;
+ if( !theGroupNames.empty() ) {
+ aMinMax.first = VTK_LARGE_FLOAT;
+ aMinMax.second = -VTK_LARGE_FLOAT;
+
+ const TGroup2MinMax& aGroup2MinMax = myMetric2Comp2Group2AverageMinMax[theGaussMetric][theCompID];
+ TNames::const_iterator aNameIter = theGroupNames.begin();
+ for( ; aNameIter != theGroupNames.end(); aNameIter++ ) {
+ TGroup2MinMax::const_iterator aGroup2MinMaxIter = aGroup2MinMax.find( *aNameIter );
+ if( aGroup2MinMaxIter != aGroup2MinMax.end() ) {
+ const TMinMax& aGroupMinMax = aGroup2MinMaxIter->second;
+ aMinMax.first = std::min( aMinMax.first, aGroupMinMax.first );
+ aMinMax.second = std::max( aMinMax.second, aGroupMinMax.second );
+ anIsMinMaxInitialized = true;
+ }
+ }
+ }
+
+ if( !anIsMinMaxInitialized )
+ aMinMax = myMetric2Comp2AverageMinMax[theGaussMetric][theCompID];
+
+ return aMinMax;
}
-
+
//----------------------------------------------------------------------------
- const PMeshValue&
+ const PMeshValue&
TGeom2Value
::GetMeshValue(EGeometry theGeom) const
{
EXCEPTION(std::runtime_error,"TGeom2Value::GetMeshValue - myGeom2MeshValue.find(theGeom) fails");
return anIter->second;
}
-
- PMeshValue&
+
+ PMeshValue&
TGeom2Value
::GetMeshValue(EGeometry theGeom)
{
//----------------------------------------------------------------------------
- TGeom2MeshValue&
+ TGeom2MeshValue&
TGeom2Value
::GetGeom2MeshValue()
{
return myGeom2MeshValue;
}
-
- const TGeom2MeshValue&
+
+ const TGeom2MeshValue&
TGeom2Value
::GetGeom2MeshValue() const
{
return myGeom2MeshValue;
}
- PMeshValue
+ PMeshValue
TGeom2Value
::GetFirstMeshValue() const
{
myUnstructuredGridIDMapper(new TUnstructuredGridIDMapperImpl())
{}
- const PMeshValue&
+ const PMeshValue&
TValForTimeImpl
::GetMeshValue(EGeometry theGeom) const
{
return myGeom2Value.GetMeshValue(theGeom);
}
-
- PMeshValue&
+
+ PMeshValue&
TValForTimeImpl
::GetMeshValue(EGeometry theGeom)
{
return myGeom2Value.GetMeshValue(theGeom);
}
- TGeom2MeshValue&
+ TGeom2MeshValue&
TValForTimeImpl
::GetGeom2MeshValue()
{
return myGeom2Value.GetGeom2MeshValue();
}
- const TGeom2MeshValue&
+ const TGeom2MeshValue&
TValForTimeImpl
::GetGeom2MeshValue() const
{
return myGeom2Value.GetGeom2MeshValue();
}
- PMeshValue
+ PMeshValue
TValForTimeImpl
::GetFirstMeshValue() const
{
}
return anIter->second;
}
-
+
+ int
+ TValForTimeImpl
+ ::GetMaxNbGauss() const
+ {
+ int aNbGauss = 1;
+ TGeom2NbGauss::const_iterator anIter = myGeom2NbGauss.begin();
+ for(; anIter != myGeom2NbGauss.end(); anIter++){
+ aNbGauss = std::max<int>(aNbGauss, anIter->second);
+ }
+ return aNbGauss;
+ }
+
unsigned long int
TValForTimeImpl
::GetMemorySize()
return aSize;
}
-
//---------------------------------------------------------------
}