static int MYDEBUG = 0;
#endif
+//#define _DEBUG_ID_MAPPING_
#define _DEXCEPT_
typedef vtkUnstructuredGrid TOutput;
if(anEntity != VISU::NODE_ENTITY){
VISU::PGaussPtsIDMapper aGaussMesh =
aCon->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp);
- /*
- VISU::TVTKOutput* aDataSet = aGaussMesh->GetVTKOutput();
+#ifdef _DEBUG_ID_MAPPING_
+ vtkDataSet* aDataSet = aGaussMesh->GetOutput();
+ aDataSet->Update();
int aNbCells = aDataSet->GetNumberOfCells();
+ cout<<"aNbCells = "<<aNbCells<<endl;
for(int anCellId = 0; anCellId < aNbCells; anCellId++){
VISU::TGaussPointID anObjID = aGaussMesh->GetObjID(anCellId);
- cout<<anObjID.first<<"; "<<anObjID.second<<endl;
+ cout<<anObjID.first<<"; "<<anObjID.second<<"; "<<aGaussMesh->GetNodeVTKID(anObjID.first)<<endl;
+ vtkFloatingPointType* aCoord = aGaussMesh->GetNodeCoord(anCellId);
+ cout<<aCoord[0]<<"; "<<aCoord[1]<<"; "<<aCoord[2]<<endl;
}
- */
+#endif
}else{
+ continue;
VISU::PIDMapper anIDMapper =
aCon->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
- /*
- VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput();
+#ifdef _DEBUG_ID_MAPPING_
+ vtkDataSet* aDataSet = anIDMapper->GetOutput();
+ aDataSet->Update();
int aNbCells = aDataSet->GetNumberOfCells();
for(int anCellId = 0; anCellId < aNbCells; anCellId++){
int anObjID = anIDMapper->GetElemObjID(anCellId);
int aVTKID = anIDMapper->GetElemVTKID(anObjID);
cout<<anObjID<<"; "<<aVTKID<<endl;
}
- */
+#endif
}
//goto OK;
}
for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
VISU::PIDMapper anIDMapper = aCon->GetMeshOnEntity(aMeshName,anEntity);
- {
- /*
- VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput();
- int aNbCells, anCellId, anObjID, aVTKID;
- aNbCells = aDataSet->GetNumberOfCells();
- for(anCellId = 0; anCellId < aNbCells; anCellId++){
- anObjID = anIDMapper->GetElemObjID(anCellId);
- aVTKID = anIDMapper->GetElemVTKID(anObjID);
- cout<<anObjID<<"; "<<aVTKID<<endl;
- }
- */
+#ifdef _DEBUG_ID_MAPPING_
+ vtkDataSet* aDataSet = anIDMapper->GetOutput();
+ int aNbCells, anCellId, anObjID, aVTKID;
+ aNbCells = aDataSet->GetNumberOfCells();
+ for(anCellId = 0; anCellId < aNbCells; anCellId++){
+ anObjID = anIDMapper->GetElemObjID(anCellId);
+ aVTKID = anIDMapper->GetElemVTKID(anObjID);
+ cout<<anObjID<<"; "<<aVTKID<<endl;
}
+#endif
}
//Import families
GetMeshOnProfile(aMesh, aVTKMeshOnEntity, aProfile);
VISU::PGaussMeshImpl aGaussMesh = aValForTime->myGaussMesh;
- VISU::TPolyDataHolder& aGaussPtsSource = aGaussMesh->mySource;
- if(!aGaussPtsSource.myIsVTKDone){
+ if(!aGaussMesh->myIsVTKDone){
BuildGaussMesh(aMesh, aVTKMeshOnEntity, aGaussMesh);
aGaussMesh->myParent = aProfile.get();
- aGaussPtsSource.myIsVTKDone = true;
+ aGaussMesh->myIsVTKDone = true;
}
aGaussPtsIDFilter->myIDMapper = aGaussMesh;
return aSubMeshImpl.GetObjID(anInputID,aStartId);
}
-
+
vtkPolyData*
TGaussMeshImpl
::GetPolyDataOutput()
{
- return mySource.GetPolyDataOutput();
- }
-
- vtkDataSet*
- TGaussMeshImpl
- ::GetOutput()
- {
- return GetPolyDataOutput();
+ return TAppendPolyDataHolder::GetPolyDataOutput();
}
unsigned long int
::GetMemorySize()
{
size_t aSize = TAppendPolyDataHolder::GetMemorySize();
- aSize += mySource.GetMemorySize();
TGeom2GaussSubMesh::const_iterator anIter = myGeom2GaussSubMesh.begin();
TGeom2GaussSubMesh::const_iterator anIterEnd = myGeom2GaussSubMesh.end();
for(; anIter != anIterEnd; anIter++){
vtkPolyData*
GetPolyDataOutput();
- //! Reimplement the TIDMapper::GetOutput
- virtual
- vtkDataSet*
- GetOutput();
-
//! Gets memory size used by the instance (bytes).
virtual
unsigned long int
TNamedIDMapper*
GetParent();
- TPolyDataHolder 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 TAppendFilterHolder
TGeom2GaussSubMesh myGeom2GaussSubMesh; //!< Keeps TGaussSubMesh according to their geometrical type
#include <vtkTextMapper.h>
#include <vtkTextProperty.h>
-#include <vtkCellData.h>
#include <vtkPointData.h>
-
#include <vtkDataArray.h>
-#include <vtkFloatArray.h>
#include <vtkSphereSource.h>
#include <vtkPolyDataMapper.h>
if(anIsChanged){
vtkFloatingPointType* aNodeCoord = GetNodeCoord(anObjId);
vtkDataSet* aDataSet = GetInput();
- vtkCellData* aCellData = aDataSet->GetCellData();
- if(vtkDataArray *aScalarArray = aCellData->GetScalars()){
+ vtkPointData* aPointData = aDataSet->GetPointData();
+ if(vtkDataArray *aScalarArray = aPointData->GetScalars()){
vtkFloatingPointType aPyramidHeight = myPickingSettings->GetPyramidHeight();
aPyramidHeight = aPyramidHeight*myGaussPointsPL->GetMaxPointSize();
//vtkFloatingPointType aColor[3] = myPreHighlightActor->GetProperty()->GetColor();
vtkFloatingPointType aWorldCoord[4] = {aNodeCoord[0], aNodeCoord[1], aNodeCoord[2], 1.};
//
vtkDataSet* aDataSet = GetInput();
- vtkCellData* aDataSetAttributes = aDataSet->GetCellData();
+ vtkPointData* aDataSetAttributes = aDataSet->GetPointData();
//
if(vtkDataArray* aScalarArray = aDataSetAttributes->GetScalars()){
vtkFloatingPointType aVal = aScalarArray->GetTuple1(aVtkId);
}
if(vtkDataArray* aFieldArray = aDataSetAttributes->GetArray("VISU_FIELD")){
- if(vtkFloatArray *aFloatArray = dynamic_cast<vtkFloatArray*>(aFieldArray)){
- int aNbComp = aFloatArray->GetNumberOfComponents();
- aStr<<"\nData: {";
- int anId = 0;
- while(anId < aNbComp){
- vtkFloatingPointType aComp = aFloatArray->GetComponent(aVtkId,anId++);
- aStr<<aComp;
- if(anId < aNbComp)
- aStr<<"; ";
- }
- aStr<<"}";
+ int aNbComp = aFieldArray->GetNumberOfComponents();
+ std::vector<vtkFloatingPointType> aTuple(aNbComp);
+ aFieldArray->GetTuple(aVtkId, &aTuple[0]);
+
+ aStr<<"\nData: {";
+ int anId = 0;
+ while(anId < aNbComp){
+ vtkFloatingPointType aComp = aTuple[anId++];
+ aStr<<aComp;
+ if(anId < aNbComp)
+ aStr<<"; ";
}
+ aStr<<"}";
}
//
// myTextActor
#include "VISU_Convertor.hxx"
-typedef VISU_DeformedShapePL TPresent;
+typedef VISU_GaussPointsPL TPresent;
#include <vtkUnstructuredGrid.h>
#include <vtkDataSetMapper.h>
static int isOnlyMesh = false;
+//#define _DEBUG_ID_MAPPING_
//----------------------------------------------------------------------------
template<class TPipeLine>
aPresent->Update();
+#ifdef _DEBUG_ID_MAPPING_
+ vtkDataSet* aDataSet = aPresent->GetOutput();
+ aDataSet->Update();
+ int aNbCells = aDataSet->GetNumberOfCells();
+ cout<<"aNbCells = "<<aNbCells<<endl;
+ for(int anCellId = 0; anCellId < aNbCells; anCellId++){
+ vtkIdType anObjID = aPresent->GetNodeObjID(anCellId);
+ vtkIdType aVtkID = aPresent->GetNodeVTKID(anObjID);
+ cout<<anObjID<<"; "<<aVtkID<<"; - ";
+ vtkFloatingPointType* aCoord = aPresent->GetNodeCoord(anObjID);
+ cout<<aCoord[0]<<"; "<<aCoord[1]<<"; "<<aCoord[2]<<endl;
+ }
+#endif
+
return aPresent;
}
VISU::TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin();
for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++){
const VISU::PField aField = aFieldMapIter->second;
- ///*
+ /*
if(aField->myNbComp == 1)
continue;
- //*/
+ */
const string& aFieldName = aFieldMapIter->first;
const VISU::TValField& aValField = aField->myValField;
VISU::TValField::const_iterator aValFieldIter = aValField.begin();
aFieldName,
aTimeStamp);
}else{
- //continue;
+ continue;
aPresent = CreateColoredPL<TPresent>(aConvertor,
aMeshName,
anEntity,