# Libraries targets
LIB = libVisuConvertor.la
-LIB_SRC = VISU_Convertor.cxx \
+LIB_SRC = \
+ VISU_IDMapper.cxx \
+ VISU_Convertor.cxx \
VISU_Convertor_impl.cxx \
VISU_ConvertorUtils.cxx \
VISU_ExtractUnstructuredGrid.cxx \
int aTimeStamp = aValFieldIter->first;
if(anEntity != VISU::NODE_ENTITY){
- VISU::TVTKOutput* aDataSet =
- aCon->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp);
VISU::PGaussMesh aGaussMesh =
- aCon->GetGaussMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
+ aCon->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp);
+ VISU::TVTKOutput* aDataSet = aGaussMesh->GetVTKOutput();
int aNbCells = aDataSet->GetNumberOfCells();
for(int anCellId = 0; anCellId < aNbCells; anCellId++){
typedef vtkIdType TLocalPntID;
typedef std::pair<TCellID,TLocalPntID> TGaussPointID;
- struct TGaussMesh: virtual TBaseStructure
+ struct TGaussMesh: virtual TIDMapper
{
virtual
TGaussPointID
int theStampsNum) = 0;
virtual
- TOutput*
+ VISU::PGaussMesh
GetTimeStampOnGaussPts(const std::string& theMeshName,
const VISU::TEntity& theEntity,
const std::string& theFieldName,
int theStampsNum) = 0;
- virtual
- VISU::PGaussMesh
- GetGaussMesh(const std::string& theMeshName,
- const VISU::TEntity& theEntity,
- const std::string& theFieldName,
- int theStampsNum) = 0;
-
virtual
float
GetTimeStampSize(const std::string& theMeshName,
//---------------------------------------------------------------
-VISU_Convertor::TOutput*
+VISU::PGaussMesh
VISU_Convertor_impl
::GetTimeStampOnGaussPts(const string& theMeshName,
const VISU::TEntity& theEntity,
PFieldImpl aField = boost::get<3>(aFindTimeStamp);
//Main part of code
- TSource& aGaussPtsSource = aValForTime->myGaussPtsSource;
- const TVTKSource& aSource = aGaussPtsSource.GetSource();
+ PGaussMeshImpl aGaussMesh = aValForTime->myGaussMesh;
+ TSource& aGaussPtsSource = aGaussMesh->mySource;
#ifndef _DEXCEPT_
try{
#endif
BuildGaussMesh(aMesh,aVTKMeshOnEntity,aGaussMesh);
const TVTKAppendFilter& anAppendFilter = aGaussMesh->GetFilter();
+ const TVTKSource& aSource = aGaussPtsSource.GetSource();
aSource->ShallowCopy(anAppendFilter->GetOutput());
GetTimeStampOnGaussMesh(aSource,aField,aValForTime);
}
#endif
- return aSource.GetPointer();
-}
-
-//---------------------------------------------------------------
-VISU::PGaussMesh
-VISU_Convertor_impl
-::GetGaussMesh(const string& theMeshName,
- const VISU::TEntity& theEntity,
- const string& theFieldName,
- int theStampsNum)
-{
- GetTimeStampOnGaussPts(theMeshName, theEntity, theFieldName, theStampsNum);
-
- TFindTimeStamp aFindTimeStamp = FindTimeStamp(theMeshName,
- theEntity,
- theFieldName,
- theStampsNum);
- PValForTimeImpl aValForTime = boost::get<4>(aFindTimeStamp);
- PGaussMeshImpl aGaussMesh=aValForTime->myGaussMesh;
-
return aGaussMesh;
}
-
//---------------------------------------------------------------
VISU::PMeshImpl
VISU_Convertor_impl
const TVTKSource&
GetSource() const;
+ virtual
TVTKOutput*
GetVTKOutput();
};
//---------------------------------------------------------------
- class TAppendFilter: public virtual TIsVTKDone
+ class TAppendFilter: public virtual TIsVTKDone,
+ public virtual TIDMapper
{
mutable TVTKAppendFilter myFilter;
public:
vtkCell*
GetElemCell(vtkIdType theObjID);
- virtual
- TVTKOutput*
- GetVTKOutput()
- {
- return mySource.GetVTKOutput();
- }
-
TID2ID myElemObj2VTKID;
TSubProfileArr mySubProfileArr;
PNamedPointCoords myNamedPointCoords;
GetObjID(int theVtkI) const;
TGaussSubMeshArr myGaussSubMeshArr;
+
+ TSource mySource;
TGeom2GaussSubMesh myGeom2GaussSubMesh;
};
typedef SharedPtr<TGaussMeshImpl> PGaussMeshImpl;
vtkIdType
GetElemObjID(vtkIdType theID) const;
- virtual
- TVTKOutput*
- GetVTKOutput()
- {
- return TAppendFilter::GetVTKOutput();
- }
-
TID2ID myElemObj2VTKID;
TSubMeshArr mySubMeshArr;
PNamedPointCoords myNamedPointCoords;
TMeshValue&
GetMeshValue(vtkIdType theGeom);
- TSource myMeshSource;
- TSource myGaussPtsSource;
-
- int myNbGauss;
+ vtkIdType myNbGauss;
virtual
int
int theStampsNum);
virtual
- TOutput*
+ VISU::PGaussMesh
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,
--- /dev/null
+// VISU OBJECT : interactive object for VISU entities implementation
+//
+// 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:
+// Author:
+// Module : VISU
+
+#include "VISU_IDMapper.hxx"
+
+#include <vtkUnstructuredGrid.h>
+
+namespace VISU
+{
+ //---------------------------------------------------------------
+ float*
+ TIDMapper
+ ::GetNodeCoord(vtkIdType theObjID)
+ {
+ vtkIdType aVTKID = GetNodeVTKID(theObjID);
+ return GetVTKOutput()->GetPoint(aVTKID);
+ }
+
+ vtkIdType
+ TIDMapper
+ ::GetNodeVTKID(vtkIdType theID) const
+ {
+ return theID;
+ }
+
+ vtkIdType
+ TIDMapper
+ ::GetNodeObjID(vtkIdType theID) const
+ {
+ return theID;
+ }
+
+ vtkCell*
+ TIDMapper
+ ::GetElemCell(int theObjID)
+ {
+ vtkIdType aVtkID = GetElemVTKID(theObjID);
+ return GetVTKOutput()->GetCell(aVtkID);
+ }
+
+ vtkIdType
+ TIDMapper
+ ::GetElemVTKID(vtkIdType theID) const
+ {
+ return theID;
+ }
+
+ vtkIdType
+ TIDMapper
+ ::GetElemObjID(vtkIdType theID) const
+ {
+ return theID;
+ }
+}
{
virtual
vtkIdType
- GetNodeObjID(vtkIdType theID) const = 0;
+ GetNodeObjID(vtkIdType theID) const;
virtual
vtkIdType
- GetNodeVTKID(vtkIdType theID) const = 0;
+ GetNodeVTKID(vtkIdType theID) const;
virtual
float*
- GetNodeCoord(vtkIdType theObjID) = 0;
+ GetNodeCoord(vtkIdType theObjID);
virtual
vtkIdType
- GetElemObjID(vtkIdType theID) const = 0;
+ GetElemObjID(vtkIdType theID) const;
virtual
vtkIdType
- GetElemVTKID(vtkIdType theID) const = 0;
+ GetElemVTKID(vtkIdType theID) const;
virtual
vtkCell*
- GetElemCell(vtkIdType theObjID) = 0;
+ GetElemCell(vtkIdType theObjID);
virtual
TVTKOutput*
VISU::PMEDField theField,
VISU::PMEDValForTime theValForTime)
{
- TSource& aMeshSource = theValForTime->myMeshSource;
+ PProfileImpl aProfile = theValForTime->myProfile;
+ TSource& aProfileSource = aProfile->mySource;
return LoadValForTime(theMed,
theMesh,
theMeshOnEntity,
theField,
theValForTime,
false,
- aMeshSource.myIsDone);
+ aProfileSource.myIsDone);
}
VISU::PMEDField theField,
VISU::PMEDValForTime theValForTime)
{
- TSource& aGaussPtsSource = theValForTime->myGaussPtsSource;
+ PGaussMeshImpl aGaussMesh = theValForTime->myGaussMesh;
+ TSource& aGaussPtsSource = aGaussMesh->mySource;
return LoadValForTime(theMed,
theMesh,
theMeshOnEntity,
int aTimeStamp = aValFieldIter->first;
VISU::PIDMapper anIDMapper;
- VISU::TVTKOutput* aDataSet;
- if(anEntity != VISU::NODE_ENTITY)
- aDataSet = aConvertor->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp);
- else{
+ if(anEntity != VISU::NODE_ENTITY){
+ anIDMapper = aConvertor->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp);
+ }else{
continue;
anIDMapper = aConvertor->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
- aDataSet = anIDMapper->GetVTKOutput();
}
+ VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput();
TPresent* aPresent = TPresent::New();
aPresent->SetInput(aDataSet);
this->myGeomFilter = NULL;
}
}
+
+//=======================================================================
+void
+VISU_GaussPointsPL
+::SetGaussMesh(const VISU::PGaussMesh& theGaussMesh)
+{
+ myGaussMesh = theGaussMesh;
+ SetIDMapper(myGaussMesh);
+}
+
+const VISU::PGaussMesh&
+VISU_GaussPointsPL
+::GetGaussMesh() const
+{
+ return myGaussMesh;
+}
#define VISU_GaussPointsPL_HeaderFile
#include "VISU_ScalarMapPL.hxx"
+#include "VISU_Convertor.hxx"
class VISU_OpenGLPointSpriteMapper;
virtual void Build();
virtual void Update();
+ void
+ SetGaussMesh(const VISU::PGaussMesh& theGaussMesh);
+
+ const VISU::PGaussMesh&
+ GetGaussMesh()const;
+
protected:
VISU_OpenGLPointSpriteMapper* myPSMapper;
vtkGeometryFilter* myGeomFilter;
+ VISU::PGaussMesh myGaussMesh;
};
#endif
VISU::PCValForTime theValForTime)
{
//Check on loading already done
- TSource& aMeshSource = theValForTime->myMeshSource;
+ PProfileImpl aProfile = theValForTime->myProfile;
+ TSource& aMeshSource = aProfile->mySource;
if(aMeshSource.myIsDone)
return 0;
{
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::PGaussMesh aGaussMesh =
theResult->GetInput()->GetTimeStampOnGaussPts(myMeshName,myEntity,myFieldName,myIteration);
- if(anOutput == NULL)
+ if(!aGaussMesh)
throw std::runtime_error("There is no TimeStamp with the parameters !!!");
- myScalarMapPL->SetInput(anOutput);
- myScalarMapPL->Build();
+
+ myGaussPointsPL->SetGaussMesh(aGaussMesh);
+ myGaussPointsPL->Build();
}
: myScalarMap(NULL)
{
if(VISU_Convertor* aConvertor = theConvertor->GetImpl()){
- vtkUnstructuredGrid* aDataSet =
+ VISU::PIDMapper anIDMapper =
aConvertor->GetTimeStampOnMesh(theMeshName,VISU::TEntity(theEntity),theFieldName,theIteration);
+ VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput();
if(aDataSet){
myScalarMap = VISU_ScalarMapPL::New();
myScalarMap->SetInput(aDataSet);