#include <vtkMath.h>
+#ifndef MESSAGE
+#define MESSAGE(msg) std::cout<<__FILE__<<"["<<__LINE__<<"]::"<<msg<<endl
+
+#undef EXCEPT
+#define EXCEPT(msg) QString(QString(__FILE__) + "[" + QString::number(__LINE__) + "]::" + msg)
+
+#undef EXCEPTION
+#define EXCEPTION(msg) EXCEPT(msg).latin1()
+
+#endif
+
namespace VISU{
void Mul(const float A[3], float b, float C[3]); // C = A * b
void Sub(const float A[3], const float B[3], float C[3]); // C = A - B
- template<class TItem> void CellDataToPoint(TItem* theTItem, vtkDataSet* theDataSet,
- VISU_FieldTransform *theFieldTransform)
+ template<class TItem>
+ void
+ CellDataToPoint(TItem* theTItem,
+ vtkCellDataToPointData *theFilter,
+ vtkDataSet* theDataSet,
+ VISU_FieldTransform *theFieldTransform)
{
if(theDataSet->GetCellData()->GetNumberOfArrays()){
- vtkCellDataToPointData *aFilter = vtkCellDataToPointData::New();
- aFilter->SetInput(theFieldTransform->GetUnstructuredGridOutput());
- aFilter->PassCellDataOn();
- theTItem->SetInput(aFilter->GetUnstructuredGridOutput());
- aFilter->Register(theTItem);
- aFilter->Delete();
+ theFilter->SetInput(theFieldTransform->GetUnstructuredGridOutput());
+ theFilter->PassCellDataOn();
+ theTItem->SetInput(theFilter->GetUnstructuredGridOutput());
}else
theTItem->SetInput(theFieldTransform->GetUnstructuredGridOutput());
}
- template<class TItem> void ToCellCenters(TItem* theTItem, vtkDataSet* theDataSet,
- VISU_FieldTransform *theFieldTransform)
+ template<class TItem>
+ void
+ ToCellCenters(TItem* theTItem,
+ vtkCellCenters *theFilter,
+ vtkDataSet* theDataSet,
+ VISU_FieldTransform *theFieldTransform)
{
if(theDataSet->GetCellData()->GetNumberOfArrays()){
- vtkCellCenters *aCenters = vtkCellCenters::New(); // for vectors on cells
- aCenters->SetInput(theFieldTransform->GetUnstructuredGridOutput());
- aCenters->VertexCellsOn();
- theTItem->SetInput(aCenters->GetOutput());
- aCenters->Register(theTItem);
- aCenters->Delete();
+ theFilter->SetInput(theFieldTransform->GetUnstructuredGridOutput());
+ theFilter->VertexCellsOn();
+ theTItem->SetInput(theFilter->GetOutput());
}else
theTItem->SetInput(theFieldTransform->GetUnstructuredGridOutput());
}