-
- //---------------------------------------------------------------
- //! Define an utility base class which allow to keep calculated number of cells and their size
- struct TSizeCounter: virtual TIsVTKDone
- {
- TSizeCounter();
- vtkIdType myNbCells; //!< Number of cells contained into corresponding sublclass
- vtkIdType myCellsSize; //!< Size of cells contained into corresponding sublclass
- };
-
-
- //---------------------------------------------------------------
- //! Define a container for VTK representation
- class TSource: public virtual TSizeCounter
- {
- protected:
- mutable TVTKSource mySource;
- public:
- TSource();
-
- //! This method allow to create corresponding VTK data set by demand (not at once)
- const TVTKSource&
- GetSource() const;
-
- //! Reimplement the TIDMapper::GetVTKOutput
- virtual
- TVTKOutput*
- GetVTKOutput();
- };
-
-
- //---------------------------------------------------------------
- //! Define a container for VTK representation
- /*!
- This container allow to combine other VTK representation into single one.
- */
- class TAppendFilter: public virtual TIsVTKDone,
- public virtual TIDMapper
- {
- protected:
- mutable TVTKAppendFilter myFilter;
- public:
- TAppendFilter();
-
- //! This method allow to create corresponding VTK filter by demand (not at once)
- const TVTKAppendFilter&
- GetFilter() const;
-
- //! Reimplement the TIDMapper::GetVTKOutput
- virtual
- TVTKOutput*
- GetVTKOutput();
- };
-
-
- //---------------------------------------------------------------
- //! Define a container for VTK representation
- /*!
- This container allow to assign data to mesh and represent them into single VTK representation
- */
- class TMergeFilter: public virtual TIsVTKDone,
- public virtual TIDMapper
- {
- protected:
- mutable TVTKMergeFilter myFilter;
- public:
- TMergeFilter();
-
- //! This method allow to create corresponding VTK filter by demand (not at once)
- const TVTKMergeFilter&
- GetFilter() const;
-
- //! Reimplement the TIDMapper::GetVTKOutput
- virtual
- TVTKOutput*
- GetVTKOutput();
- };
-
-
- //---------------------------------------------------------------
- typedef TVector<TCoord> TCoordArray;
- typedef TSlice<TCoordArray> TCoordSlice;
- typedef TCSlice<TCoordArray> TCCoordSlice;
-
- //! This class is responsible for representation of mesh nodes
- class TPointCoords: public virtual TBaseStructure
- {
- protected:
- vtkIdType myDim; //!< Dimension of the nodal coordinates
- vtkIdType myNbPoints; //!< Number of nodes in corresponding mesh
-
- //! An container for coordinates of the nodes
- /*!
- Usage of slices allow to minimize amount of memory to store the nodal coordinates and
- provide unifirm way of conversation with this coordinates (independant from mesh dimension)
- */
- TCoordArray myCoord;
- TVTKPoints myPoints; //!< VTK representation for the mesh nodes
-
- public:
- TPointCoords();
-
- //! To initilize the class
- void
- Init(vtkIdType theNbPoints,
- vtkIdType theDim);
-
- //! Get slice of coordinates for defined node (const version)
- TCCoordSlice
- GetCoordSlice(vtkIdType theNodeId) const;
-
- //! Get slice of coordinates for defined node
- TCoordSlice
- GetCoordSlice(vtkIdType theNodeId);
-
- vtkIdType
- GetNbPoints() const { return myNbPoints; }
-
- vtkIdType
- GetDim() const { return myDim; }
-
- vtkIdType
- size() const { return GetNbPoints(); }
-
- const TVTKPoints&
- GetPoints() const { return myPoints;}
- };
- typedef SharedPtr<TPointCoords> PPointCoords;
-
-
- //---------------------------------------------------------------
- typedef TVector<vtkIdType> TVectorID;
- typedef std::map<vtkIdType,vtkIdType> TObj2VTKID;
-
- //! This class is responsible for representation of mesh nodes
- /*!
- In additition to its base functionlity it support mapping of VTK to object numeration and
- keeps names for each of nodes.
- */
- class TNamedPointCoords: public virtual TPointCoords
- {
- protected:
- typedef TVector<std::string> TPointsDim;
- TPointsDim myPointsDim; //!< Keeps name of each dimension
- TVectorID myVectorID; //!< Keeps object¶ numeration
- TObj2VTKID myObj2VTKID; //!< Keeps mapping from object number to VTK one
-
- public:
-
- //! To initilize the class (numeration of the nodes can be missed)
- void
- Init(vtkIdType theNbPoints,
- vtkIdType theDim,
- const TVectorID& theVectorID = TVectorID());
-
- //! Get name for defined dimension
- std::string&
- GetName(vtkIdType theDim);
-
- //! Get name for defined dimension (const version)
- const std::string&
- GetName(vtkIdType theDim) const;
-
- //! Get object number for node by its VTK one
- virtual
- vtkIdType
- GetObjID(vtkIdType theID) const;
-
- //! Get VTK number for node by its object one
- virtual
- vtkIdType
- GetVTKID(vtkIdType theID) const;
-
- //! Get name of node by its object number
- virtual
- std::string
- GetNodeName(vtkIdType theObjID) const;
- };
- typedef SharedPtr<TNamedPointCoords> PNamedPointCoords;
-
-
- //---------------------------------------------------------------
- //! Specialize TMesh to provide VTK mapping for nodes
- struct TMeshImpl: virtual TMesh,
- virtual TIsVTKDone
- {
- PNamedPointCoords myNamedPointCoords; //!< Keeps intermediate representation of the nodes
-
- TVTKPoints myPoints; //!< Keeps VTK representation of the nodes
- vtkIdType myNbPoints; //!< Keeps number of the nodes
-
- TMeshImpl();
- };
- typedef SharedPtr<TMeshImpl> PMeshImpl;
-
-
- //---------------------------------------------------------------
- typedef TVector<vtkIdType> TSubMeshID;
- typedef enum {eRemoveAll, eAddAll, eAddPart, eNone} ESubMeshStatus;
-
- //! Specialize TSubProfile to provide VTK mapping
- struct TSubProfileImpl: virtual TSubProfile,
- virtual TSource
- {
- TSubProfileImpl();
-
- EGeometry myGeom; //!< Defines to what geometrical type the MED PROFILE belong to
- std::string myName; //!< Keeps its name
-
- //! Get object number of mesh cell by its VTK one
- virtual
- vtkIdType
- GetElemObjID(int theVtkI) const;
-
- //! Keeps status of the structure
- /*!
- In some cases MED file does not use MED PROFILES, but at VISU creates corresponding data strucutre
- in order to construct mesh for MED TIEMSTAMPS in uniform way.
- */
- ESubMeshStatus myStatus;
- TSubMeshID mySubMeshID; //!< Keeps numbers of mesh cell which contain the MED PROFILE
- };
- typedef SharedPtr<TSubProfileImpl> PSubProfileImpl;
-
-
- //---------------------------------------------------------------
- struct TMeshOnEntityImpl;
-
- typedef std::map<vtkIdType,vtkIdType> TID2ID;
- typedef TVector<PSubProfileImpl> TSubProfileArr;
- typedef std::map<EGeometry,PSubProfileImpl> TGeom2SubProfile;
-
- //! Specialize TProfile to provide VTK mapping for MED TIMESTAMP mesh
- struct TProfileImpl: virtual TProfile,
- virtual TAppendFilter
- {
- TProfileImpl();
- bool myIsAll; //!< Say, whether the MED TIMESTAMP defined on all MED ENTITY or not
-
- //! Reimplement the TIDMapper::GetNodeObjID
- virtual
- vtkIdType
- GetNodeObjID(vtkIdType theID) const;
-
- //! Reimplement the TIDMapper::GetNodeVTKID
- virtual
- vtkIdType
- GetNodeVTKID(vtkIdType theID) const;
-
- //! Reimplement the TIDMapper::GetNodeCoord
- virtual
- vtkFloatingPointType*
- GetNodeCoord(vtkIdType theObjID);
-
- //! Reimplement the TIDMapper::GetElemObjID
- virtual
- vtkIdType
- GetElemObjID(vtkIdType theID) const;
-
- //! Reimplement the TIDMapper::GetElemVTKID
- virtual
- vtkIdType
- GetElemVTKID(vtkIdType theID) const;
-
- //! Reimplement the TIDMapper::GetElemCell
- virtual
- vtkCell*
- GetElemCell(vtkIdType theObjID);
-
- //! Reimplement the TIDMapper::GetVTKOutput
- virtual
- TVTKOutput*
- GetVTKOutput();
-
- //! Reimplement the TNamedIDMapper::GetNodeName
- virtual
- std::string
- GetNodeName(vtkIdType theObjID) const;
-
- //! Reimplement the TNamedIDMapper::GetElemName
- virtual
- std::string
- GetElemName(vtkIdType theObjID) const;
-
- TID2ID myElemObj2VTKID; //!< Keeps object to VTK numeration mapping
- TSubProfileArr mySubProfileArr; //!< Keeps sequence of TSubProfiles as they were added into TAppendFilter
- PNamedPointCoords myNamedPointCoords; //!< Keeps reference on the same TNamedPointCoords as TMesh
- TMeshOnEntityImpl* myMeshOnEntity; //<! Keeps backward reference to corresponding MED ENTITY mesh
-
- TSource mySource; //!< Keeps VTK representation of the MED TIMESTAMP mesh
- TGeom2SubProfile myGeom2SubProfile; //!< Keeps TSubProfiles according to their geometrical type
- };
- typedef SharedPtr<TProfileImpl> PProfileImpl;
-
-
- //---------------------------------------------------------------
- //! Specialize TIDMapper to provide VTK mapping for MED TIMESTAMP mesh
- struct TIDMapperFilter: virtual TMergeFilter
- {
- TAppendFilter myIDMapper; //!< Responsible for numbering
- TSource mySource; //!< Keeps assigned data
-
- //! Reimplement the TIDMapper::GetNodeObjID
- virtual
- vtkIdType
- GetNodeObjID(vtkIdType theID) const;
-
- //! Reimplement the TIDMapper::GetNodeVTKID
- virtual
- vtkIdType
- GetNodeVTKID(vtkIdType theID) const;
-
- //! Reimplement the TIDMapper::GetNodeCoord
- virtual
- vtkFloatingPointType*
- GetNodeCoord(vtkIdType theObjID);
-
- //! Reimplement the TIDMapper::GetElemObjID
- virtual
- vtkIdType
- GetElemObjID(vtkIdType theID) const;
-
- //! Reimplement the TIDMapper::GetElemVTKID
- virtual
- vtkIdType
- GetElemVTKID(vtkIdType theID) const;
-
- //! Reimplement the TIDMapper::GetElemCell
- virtual
- vtkCell*
- GetElemCell(vtkIdType theObjID);
-
- //! Reimplement the TIDMapper::GetVTKOutput
- virtual
- TVTKOutput*
- GetVTKOutput();
- };
- typedef SharedPtr<TIDMapperFilter> PIDMapperFilter;
-
-
- //---------------------------------------------------------------
- struct TGaussImpl;
- typedef SharedPtr<TGaussImpl> PGaussImpl;
-
- //! Specialize TGauss to provide more detail information of the MED GAUSS entity for VTK mapping
- struct TGaussImpl: virtual TGauss
- {
- EGeometry myGeom; //!< Define, to which geometrical type the MED GAUSS entity belongs
- std::string myName; //!< Keeps name of the MED GAUSS entity
- vtkIdType myNbPoints; //<! Keeps number of points for the MED GAUSS entity
-
- //! To define a way to implement more detail comparision of the TGaussSubMesh instances
- virtual
- void
- LessThan(const PGaussImpl& theGauss,
- bool& theResult) const;
- };
-
-
- //---------------------------------------------------------------
- //! Specialize TGaussSubMesh to provide VTK mapping for the entity
- struct TGaussSubMeshImpl: virtual TGaussSubMesh,
- virtual TSource
- {
- TGaussSubMeshImpl();
-
- //! To implement the TGaussPtsIDMapper::GetObjID
- virtual
- TGaussPointID
- GetObjID(vtkIdType theID,
- vtkIdType theStartID) const;
-
- PGaussImpl myGauss; //<! Keep reference to corresponding TGauss structure
-
- //! Keeps status of the structure
- /*!
- In some cases MED file does not use MED GAUSS, but at VISU creates corresponding data strucutre
- in order to construct mesh for MED TIEMSTAMPS in uniform way.
- */
- ESubMeshStatus myStatus;
-
- TPointCoords myPointCoords; //!< Keeps coordinates of Gauss Points
- };
- typedef SharedPtr<TGaussSubMeshImpl> PGaussSubMeshImpl;
-
-
- //---------------------------------------------------------------
- typedef TVector<PGaussSubMeshImpl> TGaussSubMeshArr;
- typedef std::map<EGeometry,PGaussSubMeshImpl> TGeom2GaussSubMesh;
-
- //! Specialize TGaussMesh to provide VTK mapping for the entity
- struct TGaussMeshImpl: virtual TGaussMesh,
- virtual TAppendFilter
- {
- TGaussMeshImpl();
-
- //! Reimplement the TGaussPtsIDMapper::GetObjID
- virtual
- TGaussPointID
- GetObjID(vtkIdType theID) const;
-
- //! Reimplement the TIDMapper::GetVTKOutput
- virtual
- TVTKOutput*
- GetVTKOutput();
-
- //! Reimplement the TGaussPtsIDMapper::GetParent
- virtual
- TNamedIDMapper*
- GetParent();
-
- TSource mySource; //!< Keeps VTK representation of the Gauss Points
- TNamedIDMapper* myParent; //!< Refer to parent mesh
- TGaussSubMeshArr myGaussSubMeshArr; //!< Keeps sequence of TGaussSubMesh as they were added into TAppendFilter
- TGeom2GaussSubMesh myGeom2GaussSubMesh; //!< Keeps TGaussSubMesh according to their geometrical type
- };
- typedef SharedPtr<TGaussMeshImpl> PGaussMeshImpl;
-
-
- //---------------------------------------------------------------
- //! Specialize TGaussPtsIDMapper to provide VTK mapping for MED TIMESTAMP mesh
- struct TGaussPtsIDFilter: virtual TIDMapperFilter,
- virtual TGaussPtsIDMapper
- {
- PGaussPtsIDMapper myGaussPtsIDMapper;
-
- //! Reimplement the TGaussPtsIDMapper::GetObjID
- virtual
- TGaussPointID
- GetObjID(vtkIdType theID) const;
-
- //! Reimplement the TGaussPtsIDMapper::GetParent
- virtual
- TNamedIDMapper*
- GetParent();
- };
- typedef SharedPtr<TGaussPtsIDFilter> PGaussPtsIDFilter;
-
-
- //---------------------------------------------------------------
- typedef TVector<vtkIdType> TConnect;
- typedef TVector<TConnect> TCell2Connect;
-
- //! The class is responsible for mapping of cells of defined geometrical type
- struct TSubMeshImpl: virtual TSource
- {
-
- //! To implement the TIDMapper::GetElemObjID
- virtual
- vtkIdType
- GetElemObjID(vtkIdType theID) const;
-
- //! To implement the TNamedIDMapper::GetElemName
- virtual
- std::string
- GetElemName(vtkIdType theObjID) const;
-
- vtkIdType myStartID;
- TCell2Connect myCell2Connect; //!< Contains connectivity for the cells
- };
- typedef SharedPtr<TSubMeshImpl> PSubMeshImpl;
-
-
- //---------------------------------------------------------------
- typedef std::map<EGeometry,PSubMeshImpl> TGeom2SubMesh;
- typedef TVector<PSubMeshImpl> TSubMeshArr;
-
- //! Specialize TMeshOnEntity to provide VTK mapping for the entity
- struct TMeshOnEntityImpl: virtual TMeshOnEntity,
- virtual TAppendFilter,
- virtual TSizeCounter
- {
- //! Reimplement the TIDMapper::GetNodeVTKID
- virtual
- vtkIdType
- GetNodeVTKID(vtkIdType theID) const;
-
- //! Reimplement the TIDMapper::GetNodeObjID
- virtual
- vtkIdType
- GetNodeObjID(vtkIdType theID) const;
-
- //! Reimplement the TIDMapper::GetElemVTKID
- virtual
- vtkIdType
- GetElemVTKID(vtkIdType theID) const;
-
- //! Reimplement the TIDMapper::GetElemObjID
- virtual
- vtkIdType
- GetElemObjID(vtkIdType theID) const;
-
- //! Reimplement the TNamedIDMapper::GetNodeName
- virtual
- std::string
- GetNodeName(vtkIdType theObjID) const;
-
- //! Reimplement the TNamedIDMapper::GetElemName
- virtual
- std::string
- GetElemName(vtkIdType theObjID) const;
-
- TID2ID myElemObj2VTKID; //!< To support object to VTK number mapping
- TSubMeshArr mySubMeshArr; //!< Keeps sequence of TSubMeshImpl as they were added into TAppendFilter
- PNamedPointCoords myNamedPointCoords; //!< Share the same instance with TMesh to implement nodal mapping
-
- TGeom2SubMesh myGeom2SubMesh; //!< Keeps TSubMeshImpl according to their geometrical type
- };
- typedef SharedPtr<TMeshOnEntityImpl> PMeshOnEntityImpl;
-
-
- //---------------------------------------------------------------
- typedef std::map<EGeometry,TSubMeshID> TGeom2SubMeshID;
-
- //! Specialize TFamily to provide VTK mapping for the entity
- struct TFamilyImpl: virtual TFamily,
- virtual TSource
- {
- //! Reimplement the TIDMapper::GetNodeObjID
- vtkIdType
- GetNodeObjID(vtkIdType theID) const ;
-
- //! Reimplement the TIDMapper::GetNodeVTKID
- virtual
- vtkIdType
- GetNodeVTKID(vtkIdType theID) const ;
-
- //! Reimplement the TIDMapper::GetElemVTKID
- virtual
- vtkIdType
- GetElemVTKID(vtkIdType theID) const;
-
- //! Reimplement the TIDMapper::GetElemObjID
- virtual
- vtkIdType
- GetElemObjID(vtkIdType theID) const;
-
- //! Reimplement the TIDMapper::GetVTKOutput
- virtual
- TVTKOutput*
- GetVTKOutput();
-
- PNamedPointCoords myNamedPointCoords; //!< Share the same instance with TMesh to implement nodal mapping
- TID2ID myElemObj2VTKID; //!< To support object to VTK number mapping
- TSubMeshID myMeshID; //!< Keeps numbers of mesh elements that belongs to the MED FAMILY
-
- TGeom2SubMeshID myGeom2SubMeshID; //!< Keeps TSubMeshID according to their geometrical type
- };
- typedef SharedPtr<TFamilyImpl> PFamilyImpl;
-
-
- //---------------------------------------------------------------
- typedef std::pair<vtkIdType,vtkIdType> TNbASizeCells;
- typedef TVector<PFamilyImpl> TFamilyArr;
-
- //! Specialize TGroup to provide VTK mapping for the entity
- struct TGroupImpl: virtual TGroup,
- virtual TAppendFilter
- {
- //! Calculate pair of values - number of cells and its size
- TNbASizeCells
- GetNbASizeCells() const;
-
- //! Reimplement the TIDMapper::GetElemVTKID
- virtual
- vtkIdType
- GetElemVTKID(vtkIdType theID) const;
-
- //! Reimplement the TIDMapper::GetElemObjID
- virtual
- vtkIdType
- GetElemObjID(vtkIdType theID) const;
-
- //! Reimplement the TIDMapper::GetNodeObjID
- virtual
- vtkIdType
- GetNodeObjID(vtkIdType theID) const;
-
- //! Reimplement the TIDMapper::GetNodeVTKID
- virtual
- vtkIdType
- GetNodeVTKID(vtkIdType theID) const;
-
- TID2ID myElemObj2VTKID; //!< To support object to VTK number mapping
- TFamilyArr myFamilyArr; //!< Keeps sequence of TFamily as they were added into TAppendFilter
- PNamedPointCoords myNamedPointCoords; //!< Share the same instance with TMesh to implement nodal mapping
- };
- typedef SharedPtr<TGroupImpl> PGroupImpl;
-
-
- //---------------------------------------------------------------
- typedef TVector<TMinMax> TMinMaxArr;
-
- //! Specialize TField to provide VTK mapping for the entity
- struct TFieldImpl: virtual TField
- {
- vtkIdType myDataSize; //!< Keeps size of the assigned data
-
- TMinMaxArr myMinMaxArr; //!< Keeps min/max values for each component of the MED FIELD
-
- //! Implement the TField::GetMinMax
- virtual
- TMinMax
- GetMinMax(vtkIdType theCompID);
-
- //! To initialize the data structure
- void
- InitArrays(vtkIdType theNbComp);
-
- TFieldImpl();
- };
- typedef SharedPtr<TFieldImpl> PFieldImpl;
-
-
- //---------------------------------------------------------------
- typedef TVector<vtkFloatingPointType> TValue;
- typedef TSlice<TValue> TValueSlice;
- typedef TCSlice<TValue> TCValueSlice;
-
- typedef TVector<TCValueSlice> TCValueSliceArr;
- typedef TVector<TValueSlice> TValueSliceArr;
-
- //! Define a container to get access to data assigned to mesh
- struct TMeshValue
- {
- TValue myValue; //!< Keeps all values as one dimensional sequence
-
- vtkIdType myNbElem; //!< Defines number of mesh elements where the data assigned to
- vtkIdType myNbComp; //!< Keeps number of components of corresponding MED FIELD
- vtkIdType myNbGauss; //!< Defines number of Gauss Points
- vtkIdType myStep; //! Internal variable
-
- //! To intitilize the data strucutre
- void
- Init(vtkIdType theNbElem,
- vtkIdType theNbGauss,
- vtkIdType theNbComp);
-
- //! To get assigned values first by Gauss Points and then by components (constant version)
- TCValueSliceArr
- GetGaussValueSliceArr(vtkIdType theElemId) const;
-
- //! To get assigned values first by Gauss Points and then by components
- TValueSliceArr
- GetGaussValueSliceArr(vtkIdType theElemId);
-
- //! To get assigned values first by components and then by Gauss Points (constant version)
- TCValueSliceArr
- GetCompValueSliceArr(vtkIdType theElemId) const;
-
- //! To get assigned values first by components and then by Gauss Points
- TValueSliceArr
- GetCompValueSliceArr(vtkIdType theElemId);
- };
-
-
- //---------------------------------------------------------------
- typedef std::map<EGeometry,TMeshValue> TGeom2Value;
- typedef std::map<EGeometry,vtkIdType> TGeom2NbGauss;
-
- //! Specialize TValForTime to provide VTK mapping for the entity
- struct TValForTimeImpl: virtual TValForTime
- {
- PGaussPtsIDFilter myGaussPtsIDFilter; //!< Keep VTK representation for mesh and data on Gauss Points
- PIDMapperFilter myIDMapperFilter; //!< 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
-
- TValForTimeImpl();
-
- //! Get mesh data for defined geometrical type (constant version)
- const TMeshValue&
- GetMeshValue(EGeometry theGeom) const;
-
- //! Get mesh data for defined geometrical type
- TMeshValue&
- GetMeshValue(EGeometry theGeom);
-
- //! Get number of Gauss Points for defined geometrical type
- virtual
- int
- GetNbGauss(EGeometry theGeom) const;
- };
- typedef SharedPtr<TValForTimeImpl> PValForTimeImpl;
-}