-//
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// Copyright (C) 2003-2007 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
// File :
// Author : Alexey PETROV
// Module : VISU
-
+//
#ifndef VISU_Structures_impl_HeaderFile
#define VISU_Structures_impl_HeaderFile
//---------------------------------------------------------------
//! 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
/*!
This container allow to combine other VTK representation into single one.
*/
- class VISU_CONVERTOR_EXPORT TCommonCellsFilterHolder: public virtual TMemoryCheckIDMapper
- {
- protected:
- mutable PCommonCellsFilter myFilter;
- mutable PMergeFilter myMergeFilter;
- public:
- TCommonCellsFilterHolder();
-
- //! This method allow to create corresponding VTK filter by demand (not at once)
- const PCommonCellsFilter&
- GetFilter() const;
-
- //! Reimplement the TNamedIDMapper::GetUnstructuredGridOutput
- virtual
- vtkUnstructuredGrid*
- GetUnstructuredGridOutput();
-
- virtual
- unsigned long int
- GetMemorySize();
-
- //! if false, TIDCommonCellsFilter - same as TIDMapperFilter
- //! if true, TIDCommonCellsFilter - use VISU_CommonCellsFilter
- bool myIsSpecialKey;
-
- //! Vector of id mappers, which consist of meshonentity in next sequence:
- //! CELL_ENTITY,FACE_ENTITY,EDGE_ENTITY
- PNamedIDMapperMap myMappers;
- };
-
//---------------------------------------------------------------
//! Define a container for VTK representation
/*!
//---------------------------------------------------------------
//! 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();
//! Get object number of mesh cell by its VTK one
virtual
vtkIdType
- GetElemObjID(int theVtkI) const;
+ GetElemObjID(vtkIdType theVtkI) const;
//! Get cell VTK ID for corresponding object ID
virtual
vtkIdType
GetElemVTKID(vtkIdType theID) const;
+
+ //! Return true in case if it is default profile,
+ //! i.e myName == "" (MED_NOPFL, see med.h)
+ virtual
+ bool
+ isDefault() const;
//! Gets memory size used by the instance (bytes).
virtual
//! 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;
- TUnstructuredGridHolder mySource; //!< Keeps assigned data
+ PAppendFilterHolder myIDMapper; //!< Responsible for numbering
+ PCommonCellsFilter myCommonCellsFilter;
TUnstructuredGridIDMapperImpl();
unsigned long int
GetMemorySize();
- //! if false, Not using CommonCellsFilter
- //! if true, Using CommonCellsFilter
- bool myIsSpecialKey;
+ void
+ SetReferencedMesh( const PNamedIDMapper& theNamedIDMapper );
+
+ PUnstructuredGrid
+ GetSource();
- //! Vector of id mappers, which consist of meshonentity in next sequence:
- //! CELL_ENTITY,FACE_ENTITY,EDGE_ENTITY
- PNamedIDMapperMap myMappers;
+ protected:
+ void Build();
+
+ TUnstructuredGridHolder mySource; //!< Keeps assigned data
};
//---------------------------------------------------------------
//! Specialize TIDMapper to provide VTK mapping for MED TIMESTAMP mesh
struct TPolyDataIDMapperImpl: virtual TMergeFilterHolder,
- virtual TPolyDataIDMapper
+ virtual TPolyDataIDMapper
{
PAppendPolyDataHolder myIDMapper; //!< Responsible for numbering
- TPolyDataHolder mySource; //!< Keeps assigned data
//! Reimplement the TIDMapper::GetNodeObjID
virtual
virtual
unsigned long int
GetMemorySize();
+
+ PPolyData
+ GetSource();
+
+ protected:
+ void Build();
+
+ TPolyDataHolder mySource; //!< Keeps assigned data
};
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;
GetVTKID(const TGaussPointID& theID) const;
//! Reimplements the TGaussPtsIDMapper::GetParent
+ //! Reimplement the TGaussPtsIDMapper::GetParent
virtual
TNamedIDMapper*
GetParent() const;
{
TSubMeshImpl();
+ //! Reimplements the TStructured::CopyStructure
+ virtual
+ void
+ CopyStructure( PStructured theStructured );
+
//! To implement the TIDMapper::GetElemObjID
virtual
vtkIdType
//! 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();
+ //! Reimplements the TStructured::CopyStructure
+ virtual
+ void
+ CopyStructure( PStructured theStructured );
+
//! Reimplement the TIDMapper::GetNodeVTKID
virtual
vtkIdType
//! 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
+ void
+ CopyStructure( PStructured theStructured );
+
//! Reimplement the TIDMapper::GetNodeObjID
vtkIdType
GetNodeObjID(vtkIdType theID) const ;
TSubMeshID myMeshID; //!< Keeps numbers of mesh elements that belongs to the MED FAMILY
TGeom2SubMeshID myGeom2SubMeshID; //!< Keeps TSubMeshID according to their geometrical type
+
+ TNames myGroupNames; //!< Keeps names of groups that refer to the family
};
//! 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
+ void
+ CopyStructure( PStructured theStructured );
+
//! Calculate pair of values - number of cells and its size
TNbASizeCells
GetNbASizeCells() const;
//---------------------------------------------------------------
- typedef TVector<TMinMax> TMinMaxArr;
+ typedef TVector<TMinMax> TComp2MinMax;
+ typedef TVector<TComp2MinMax> TMetric2Comp2MinMax;
+
+ typedef std::map<TName,TMinMax> TGroup2MinMax;
+ typedef TVector<TGroup2MinMax> TComp2Group2MinMax;
+ typedef TVector<TComp2Group2MinMax> TMetric2Comp2Group2MinMax;
//! Specialize TField to provide VTK mapping for the entity
struct VISU_CONVERTOR_EXPORT TFieldImpl: virtual TField
//! To initialize the data structure
void
Init(vtkIdType theNbComp,
- vtkIdType theDataType);
+ vtkIdType theDataType);
//! Gets type idetificator of the mesh data.
vtkIdType
//! Implement the TField::GetMinMax
virtual
TMinMax
- GetMinMax(vtkIdType theCompID);
+ GetMinMax(vtkIdType theCompID, const TNames& theGroupNames, TGaussMetric theGaussMetric = VISU::AVERAGE_METRIC);
+
+ //! Implement the TField::GetAverageMinMax
+ virtual
+ TMinMax
+ GetAverageMinMax(vtkIdType theCompID, const TNames& theGroupNames, TGaussMetric theGaussMetric = VISU::AVERAGE_METRIC);
vtkIdType myDataSize; //!< Keeps size of the assigned data
vtkIdType myDataType; //!< Keeps type idetificator of the mesh data
- TMinMaxArr myMinMaxArr; //!< Keeps min/max values for each component of the MED FIELD
+ TMetric2Comp2MinMax myMetric2Comp2MinMax; //!< Keeps min/max values for each component of the MED FIELD
+ TMetric2Comp2MinMax myMetric2Comp2AverageMinMax; //!< Keeps average by Gauss Points min/max values for each component of the MED FIELD
+ //!< If Nb of Gauss Points <=1 myAverageMinMaxArr equal myMinMaxArr
+
+ TMetric2Comp2Group2MinMax myMetric2Comp2Group2MinMax;
+ TMetric2Comp2Group2MinMax myMetric2Comp2Group2AverageMinMax;
};
PUnstructuredGridIDMapperImpl myUnstructuredGridIDMapper; //!< Keep VTK representation for ordinary mesh and data
TGeom2Value myGeom2Value; //!< Keep value that is assigned to the mesh
TGeom2NbGauss myGeom2NbGauss; //!< Keep number of Gauss Points
+ bool myIsFilled; //!< Keep the status of the TValForTime (true - already filled, false - not filled);
TValForTimeImpl();
int
GetNbGauss(EGeometry theGeom) const;
+ //! Get maximum number of Gauss Points among all geometrical types (provided for convenience)
+ virtual
+ int
+ GetMaxNbGauss() const;
+
//! Gets memory size used by the instance (bytes).
virtual
unsigned long int