CPPFLAGS+= -ftemplate-depth-32 $(VTK_INCLUDES) $(HDF5_INCLUDES) $(QT_INCLUDES) \
-I${KERNEL_ROOT_DIR}/include/salome \
-I${MED_ROOT_DIR}/include/salome \
+ -I${GUI_ROOT_DIR}/include/salome \
$(BOOST_CPPFLAGS)
-LDFLAGS+= $(VTK_LIBS) $(QT_LIBS) -L${MED_ROOT_DIR}/lib/salome -lMEDWrapper
-
-LDFLAGSFORBIN=$(LDFLAGS) -lMEDWrapper_V2_2 -lMEDWrapper_V2_1 -lMEDWrapperBase
+LDFLAGS+= $(VTK_LIBS) $(QT_LIBS) -L${MED_ROOT_DIR}/lib/salome -L${GUI_ROOT_DIR}/lib/salome -lMEDWrapper -lVTKViewer
+LDFLAGSFORBIN=$(LDFLAGS) -lMEDWrapper_V2_2 -lMEDWrapper_V2_1 -lMEDWrapperBase -lVTKViewer
@CONCLUDE@
#include <qfileinfo.h>
#include <qstringlist.h>
#include <memory>
+#include "VISU_Convertor_impl.hxx"
+
+#include <vtkUnstructuredGrid.h>
using namespace std;
#define _DEXCEPT_
-void parseFile(const char* theFileName) {
+typedef vtkUnstructuredGrid TOutput;
+
+void parseFile(const char* theFileName)
+{
#ifndef _DEXCEPT_
try{
#endif
VISU::TValField::const_iterator aValFieldIter = aValField.begin();
for(; aValFieldIter != aValField.end(); aValFieldIter++){
int aTimeStamp = aValFieldIter->first;
- aCon->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
+ //
+ vtkUnstructuredGrid *aOut;
+ //int aNbNodes, aNbCells, i;
+ //VISU::TGaussPointID aID;
+ //
+ aOut=aCon->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
+
+ //aNbNodes=aOut->GetNumberOfPoints();
+ //aNbCells=aOut->GetNumberOfCells();
+ //printf("aNbNodes =%d\n", aNbNodes);
+ //printf("aNbCells =%d\n", aNbCells);
+ //
+ //VISU::PGaussMesh pGaussMesh=aCon->GetGaussMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
+ //
+ //for (i=0; i<aNbCells; ++i) {
+ // aID=pGaussMesh->GetObjId(i);
+ // }
+ //
//goto OK;
}
}
typedef std::pair<TCellID,TLocalPntID> TGaussPointID;
struct TGaussMesh: virtual TBaseStructure
- {};
+ {
+ virtual TGaussPointID GetObjId(int theVtkI)=0;
+ };
//---------------------------------------------------------------
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,
#include <valarray>
#include <memory>
+#include "VTKViewer_AppendFilter.h"
using namespace std;
using namespace VISU;
::GetFilter() const
{
if(!myFilter.GetPointer()){
- myFilter = vtkAppendFilter::New();
+ myFilter = VTKViewer_AppendFilter::New();
myFilter->Delete();
}
return myFilter;
::TGaussMeshImpl()
{}
+ //---------------------------------------------------------------
+ TGaussPointID TGaussMeshImpl::GetObjId(int theVtkI)
+ {
+ TGaussPointID aRetVID;
+ int aID, anIndexDS;
+ vtkIdType aVID;//, aRetVID=-1;
+ //
+ const TVTKAppendFilter& anAppendFilter = GetFilter();
+ aID=anAppendFilter->GetElemObjId(theVtkI, anIndexDS);
+ //
+ TGaussSubMeshImpl& aSubMeshImpl=myGaussSubMeshArr[anIndexDS];
+ aVID=(vtkIdType)aID;
+ aRetVID=aSubMeshImpl.GetObjID(aVID);
+ return aRetVID;
+ }
//---------------------------------------------------------------
pair<int,int>
theGaussSubMesh->myIsVTKDone = true;
}
-
+
//---------------------------------------------------------------
void
- GetGaussMesh(const PMeshImpl& theMesh,
+ BuildGaussMesh(const PMeshImpl& theMesh,
const PMeshOnEntityImpl& theMeshOnEntity,
const PGaussMeshImpl& theGaussMesh)
{
if(theGaussMesh->myIsVTKDone)
return;
-
- INITMSG(MYDEBUG,"GetGaussMesh"<<endl);
+
+ INITMSG(MYDEBUG,"BuildGaussMesh"<<endl);
const TVTKAppendFilter& anAppendFilter = theGaussMesh->GetFilter();
const TGeom2GaussSubMesh& aGeom2GaussSubMesh = theGaussMesh->myGeom2GaussSubMesh;
TGeom2GaussSubMesh::const_iterator anIter = aGeom2GaussSubMesh.begin();
aGaussSubMesh);
const TVTKSource& aSource = aGaussSubMesh->GetSource();
+
anAppendFilter->AddInput(aSource.GetPointer());
}
anAppendFilter->Update(); // Fix on VTK
theGaussMesh->myIsVTKDone = true;
}
-
-
+
+
}
PGaussMeshImpl aGaussMesh = aValForTime->myGaussMesh;
INITMSG(MYDEBUG,"aGaussMesh = "<<bool(aGaussMesh)<<endl);
const TGeom2GaussSubMesh& aGeom2GaussSubMesh = aGaussMesh->myGeom2GaussSubMesh;
- GetGaussMesh(aMesh,aVTKMeshOnEntity,aGaussMesh);
+ BuildGaussMesh(aMesh,aVTKMeshOnEntity,aGaussMesh);
+ //GetGaussMesh(aMesh,aVTKMeshOnEntity,aGaussMesh);
const TVTKAppendFilter& anAppendFilter = aGaussMesh->GetFilter();
aSource->ShallowCopy(anAppendFilter->GetOutput());
return aSource.GetPointer();
}
+//---------------------------------------------------------------
+VISU::PGaussMesh VISU_Convertor_impl::GetGaussMesh(const string& theMeshName,
+ const VISU::TEntity& theEntity,
+ const string& theFieldName,
+ int theStampsNum)
+{
+ GetTimeStampOnMesh(theMeshName, theEntity, theFieldName, theStampsNum);
+
+ TFindTimeStamp aFindTimeStamp = FindTimeStamp(theMeshName,
+ theEntity,
+ theFieldName,
+ theStampsNum);
+ PGaussPtsValForTimeImpl aValForTime = boost::get<4>(aFindTimeStamp);
+ PGaussMeshImpl aGaussMesh=aValForTime->myGaussMesh;
+
+ return aGaussMesh;
+}
+
//---------------------------------------------------------------
VISU::PMeshImpl
#include <boost/tuple/tuple.hpp>
+
+
class vtkPoints;
-class vtkAppendFilter;
+class VTKViewer_AppendFilter;
class vtkUnstructuredGrid;
#include "VISU_Convertor.hxx"
typedef vtkSmartPointer<vtkPoints> TVTKPoints;
typedef vtkSmartPointer<vtkUnstructuredGrid> TVTKSource;
- typedef vtkSmartPointer<vtkAppendFilter> TVTKAppendFilter;
-
+ typedef vtkSmartPointer<VTKViewer_AppendFilter> TVTKAppendFilter;
typedef float TCoord;
//---------------------------------------------------------------
struct TGaussMeshImpl: virtual TGaussMesh, virtual TAppendFilter
{
TGaussMeshImpl();
+ virtual TGaussPointID GetObjId(int theVtkI);
TGaussSubMeshArr myGaussSubMeshArr;
TGeom2GaussSubMesh myGeom2GaussSubMesh;
};
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
TOutput*