Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef VISU_PipeLineUtils_HeaderFile
00029 #define VISU_PipeLineUtils_HeaderFile
00030
00031 #include "VISUPipeline.hxx"
00032 #include "VISU_ConvertorUtils.hxx"
00033 #include "VISU_CellDataToPointData.hxx"
00034
00035 #include <vtkProperty.h>
00036 #include <vtkObjectFactory.h>
00037 #include <vtkDataSetMapper.h>
00038 #include <vtkUnstructuredGrid.h>
00039
00040 #include <vtkPointData.h>
00041 #include <vtkCellData.h>
00042 #include <vtkPolyData.h>
00043
00044 #include <vtkMath.h>
00045
00046 #ifndef MESSAGE
00047 #define MESSAGE(msg) std::cout<<__FILE__<<"["<<__LINE__<<"]::"<<msg<<endl
00048
00049 #undef EXCEPT
00050 #define EXCEPT(msg) QString(QString(__FILE__) + "[" + QString::number(__LINE__) + "]::" + msg)
00051
00052 #undef EXCEPTION
00053 #define EXCEPTION(msg) EXCEPT(msg).latin1()
00054
00055 #endif
00056
00057 class VISU_OpenGLPointSpriteMapper;
00058
00059 namespace VISU
00060 {
00061
00062 void
00063 Mul(const vtkFloatingPointType A[3],
00064 vtkFloatingPointType b,
00065 vtkFloatingPointType C[3]);
00066
00067
00068
00069 void
00070 Sub(const vtkFloatingPointType A[3],
00071 const vtkFloatingPointType B[3],
00072 vtkFloatingPointType C[3]);
00073
00074
00075
00076 template<class TOutputFilter>
00077 void
00078 CellDataToPoint(TOutputFilter* theOutputFilter,
00079 VISU_CellDataToPointData *theCellDataToPointData,
00080 vtkDataSet* theDataSet)
00081
00082 {
00083 if(VISU::IsDataOnCells(theDataSet)){
00084 theCellDataToPointData->SetInput(theDataSet);
00085 theCellDataToPointData->PassCellDataOn();
00086 theOutputFilter->SetInput(theCellDataToPointData->GetUnstructuredGridOutput());
00087 }else
00088 theOutputFilter->SetInput(theDataSet);
00089 }
00090
00091
00093 bool VISU_PIPELINE_EXPORT
00094 CheckIsSameValue(vtkFloatingPointType theTarget,
00095 vtkFloatingPointType theSource);
00096
00098 bool VISU_PIPELINE_EXPORT
00099 CheckIsSameRange(vtkFloatingPointType* theTarget,
00100 vtkFloatingPointType* theSource);
00101
00103 void VISU_PIPELINE_EXPORT
00104 CopyMapper(vtkMapper* theTarget,
00105 vtkMapper* theSource,
00106 bool theIsCopyInput);
00107
00109 void VISU_PIPELINE_EXPORT
00110 CopyDataSetMapper(vtkDataSetMapper* theTarget,
00111 vtkDataSetMapper* theSource,
00112 bool theIsCopyInput);
00113
00115 void VISU_PIPELINE_EXPORT
00116 CopyPolyDataMapper(vtkPolyDataMapper* theTarget,
00117 vtkPolyDataMapper* theSource,
00118 bool theIsCopyInput);
00119
00121 void VISU_PIPELINE_EXPORT
00122 CopyPointSpriteDataMapper(VISU_OpenGLPointSpriteMapper* theTarget,
00123 VISU_OpenGLPointSpriteMapper* theSource,
00124 bool theIsCopyInput);
00125
00126
00127
00128 void VISU_PIPELINE_EXPORT
00129 ComputeBoundsParam(vtkFloatingPointType theBounds[6],
00130 vtkFloatingPointType theDirection[3],
00131 vtkFloatingPointType theMinPnt[3],
00132 vtkFloatingPointType& theMaxBoundPrj,
00133 vtkFloatingPointType& theMinBoundPrj);
00134
00135
00136
00137 void VISU_PIPELINE_EXPORT
00138 DistanceToPosition(vtkFloatingPointType theBounds[6],
00139 vtkFloatingPointType theDirection[3],
00140 vtkFloatingPointType theDist,
00141 vtkFloatingPointType thePos[3]);
00142
00143
00144
00145 void VISU_PIPELINE_EXPORT
00146 PositionToDistance(vtkFloatingPointType theBounds[6],
00147 vtkFloatingPointType theDirection[3],
00148 vtkFloatingPointType thePos[3],
00149 vtkFloatingPointType& theDist);
00150
00151
00152
00153 bool VISU_PIPELINE_EXPORT
00154 IsQuadraticData(vtkDataSet* theDataSet);
00155
00156
00157 void VISU_PIPELINE_EXPORT
00158 ComputeVisibleBounds(vtkDataSet* theDataSet,
00159 vtkFloatingPointType theBounds[6]);
00160
00161
00162 void VISU_PIPELINE_EXPORT
00163 ComputeBoxCenter(vtkFloatingPointType theBounds[6], vtkFloatingPointType theCenter[3]);
00164
00165
00166 double VISU_PIPELINE_EXPORT
00167 ComputeBoxDiagonal(vtkFloatingPointType theBounds[6]);
00168
00169 }
00170
00171 #endif
00172