00001 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE 00002 // 00003 // This library is free software; you can redistribute it and/or 00004 // modify it under the terms of the GNU Lesser General Public 00005 // License as published by the Free Software Foundation; either 00006 // version 2.1 of the License. 00007 // 00008 // This library is distributed in the hope that it will be useful, 00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 // Lesser General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU Lesser General Public 00014 // License along with this library; if not, write to the Free Software 00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00016 // 00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com 00018 // 00019 00020 // VISU OBJECT : interactive object for VISU entities implementation 00021 // File: VISU_DeformedShapeAndScalarMapPL.hxx 00022 // Author: Eugeny Nikolaev 00023 // Module : VISU 00024 // 00025 #ifndef VISU_DeformedShapeAndScalarMapPL_HeaderFile 00026 #define VISU_DeformedShapeAndScalarMapPL_HeaderFile 00027 00028 #include "VISUPipeline.hxx" 00029 #include "VISU_ScalarMapPL.hxx" 00030 00031 class VISU_MergeFilter; 00032 class vtkWarpVector; 00033 class vtkUnstructuredGrid; 00034 class VISU_CellDataToPointData; 00035 class vtkPointDataToCellData; 00036 class VISU_ElnoDisassembleFilter; 00037 class SALOME_ExtractGeometry; 00038 class vtkImplicitFunction; 00039 00040 00041 //---------------------------------------------------------------------------- 00042 class VISU_PIPELINE_EXPORT VISU_DeformedShapeAndScalarMapPL : public VISU_ScalarMapPL 00043 { 00044 public: 00045 vtkTypeMacro(VISU_DeformedShapeAndScalarMapPL, VISU_ScalarMapPL); 00046 00047 static 00048 VISU_DeformedShapeAndScalarMapPL* 00049 New(); 00050 00051 virtual 00052 void 00053 SetScale(vtkFloatingPointType theScale); 00054 00055 virtual 00056 vtkFloatingPointType 00057 GetScale(); 00058 00059 virtual 00060 int 00061 GetScalarMode(); 00062 00063 virtual 00064 void 00065 SetScalarMode(int theScalarMode = 0); 00066 00067 virtual 00068 void 00069 SetScaling(int theScaling); 00070 00071 virtual 00072 void 00073 SetScalarRange(vtkFloatingPointType theRange[2]); 00074 00075 virtual 00076 vtkFloatingPointType* 00077 GetScalarRange(); 00078 00079 virtual 00080 void 00081 GetSourceRange(vtkFloatingPointType theRange[2]); 00082 00083 virtual 00084 void 00085 SetGaussMetric(VISU::TGaussMetric theGaussMetric); 00086 00087 virtual 00088 VISU::TGaussMetric 00089 GetGaussMetric(); 00090 00091 virtual 00092 void 00093 SetScalars(vtkDataSet *theScalars); 00094 00095 virtual 00096 vtkDataSet* 00097 GetScalars(); 00098 00099 virtual 00100 void 00101 RemoveAllClippingPlanes(); 00102 00103 virtual 00104 void 00105 RemoveClippingPlane(vtkIdType theID); 00106 00107 virtual 00108 bool 00109 AddClippingPlane(vtkPlane* thePlane); 00110 00111 virtual 00112 void 00113 SetImplicitFunction(vtkImplicitFunction *theFunction); 00114 00115 virtual 00116 vtkImplicitFunction* 00117 GetImplicitFunction(); 00118 00119 public: 00121 virtual 00122 void 00123 Init(); 00124 00126 virtual 00127 void 00128 Build(); 00129 00131 virtual 00132 void 00133 Update(); 00134 00136 virtual 00137 unsigned long int 00138 GetMemorySize(); 00139 00141 void 00142 UpdateScalars(); 00143 00144 virtual 00145 void 00146 SetMapScale(vtkFloatingPointType theMapScale = 1.0); 00147 00148 protected: 00149 VISU_DeformedShapeAndScalarMapPL(); 00150 00151 virtual 00152 ~VISU_DeformedShapeAndScalarMapPL(); 00153 00154 virtual 00155 vtkDataSet* 00156 InsertCustomPL(); 00157 00158 virtual 00159 void 00160 DoShallowCopy(VISU_PipeLine *thePipeLine, 00161 bool theIsCopyInput); 00162 00163 private: 00164 VISU_DeformedShapeAndScalarMapPL(const VISU_DeformedShapeAndScalarMapPL&); 00165 00166 vtkFloatingPointType myScaleFactor; 00167 vtkFloatingPointType myMapScaleFactor; 00168 vtkWarpVector *myWarpVector; 00169 VISU_MergeFilter *myScalarsMergeFilter; 00170 vtkSmartPointer<vtkUnstructuredGrid> myScalars; 00171 VISU_CellDataToPointData* myCellDataToPointData; 00172 VISU_FieldTransform* myScalarsFieldTransform; 00173 VISU_Extractor* myScalarsExtractor; 00174 VISU_ElnoDisassembleFilter* myScalarsElnoDisassembleFilter; 00175 SALOME_ExtractGeometry* myExtractGeometry; 00176 }; 00177 00178 #endif