1 // VISU OBJECT : interactive object for VISU entities implementation
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
23 // File: VISU_PipeLine.hxx
24 // Author: Alexey PETROV
27 #ifndef VISU_PipeLineUtils_HeaderFile
28 #define VISU_PipeLineUtils_HeaderFile
30 #include "VISU_FieldTransform.hxx"
31 #include "VISU_LookupTable.hxx"
32 #include "VISU_Extractor.hxx"
34 #include <vtkProperty.h>
35 #include <vtkObjectFactory.h>
36 #include <vtkDataSetMapper.h>
37 #include <vtkUnstructuredGrid.h>
39 #include <vtkCellDataToPointData.h>
40 #include <vtkCellCenters.h>
41 #include <vtkPointData.h>
42 #include <vtkCellData.h>
43 #include <vtkPolyData.h>
48 #define MESSAGE(msg) std::cout<<__FILE__<<"["<<__LINE__<<"]::"<<msg<<endl
51 #define EXCEPT(msg) QString(QString(__FILE__) + "[" + QString::number(__LINE__) + "]::" + msg)
54 #define EXCEPTION(msg) EXCEPT(msg).latin1()
59 void Mul(const float A[3], float b, float C[3]); // C = A * b
60 void Sub(const float A[3], const float B[3], float C[3]); // C = A - B
64 CellDataToPoint(TItem* theTItem,
65 vtkCellDataToPointData *theFilter,
66 vtkDataSet* theDataSet,
67 VISU_FieldTransform *theFieldTransform)
69 if(theDataSet->GetCellData()->GetNumberOfArrays()){
70 theFilter->SetInput(theFieldTransform->GetUnstructuredGridOutput());
71 theFilter->PassCellDataOn();
72 theTItem->SetInput(theFilter->GetUnstructuredGridOutput());
74 theTItem->SetInput(theFieldTransform->GetUnstructuredGridOutput());
79 ToCellCenters(TItem* theTItem,
80 vtkCellCenters *theFilter,
81 vtkDataSet* theDataSet,
82 VISU_FieldTransform *theFieldTransform)
84 if(theDataSet->GetCellData()->GetNumberOfArrays()){
85 theFilter->SetInput(theFieldTransform->GetUnstructuredGridOutput());
86 theFilter->VertexCellsOn();
87 theTItem->SetInput(theFilter->GetOutput());
89 theTItem->SetInput(theFieldTransform->GetUnstructuredGridOutput());