00001 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE 00002 // 00003 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, 00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 00005 // 00006 // This library is free software; you can redistribute it and/or 00007 // modify it under the terms of the GNU Lesser General Public 00008 // License as published by the Free Software Foundation; either 00009 // version 2.1 of the License. 00010 // 00011 // This library is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 // Lesser General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU Lesser General Public 00017 // License along with this library; if not, write to the Free Software 00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 // 00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com 00021 // 00022 00023 // VISU OBJECT : interactive object for VISU entities implementation 00024 // File: VISU_DataSetMapperHolder.hxx 00025 // Author: Alexey PETROV 00026 // Module : VISU 00027 // 00028 #ifndef VISU_DataSetMapperHolder_HeaderFile 00029 #define VISU_DataSetMapperHolder_HeaderFile 00030 00031 #include "VISU_MapperHolder.hxx" 00032 00033 class vtkDataSetMapper; 00034 class vtkUnstructuredGrid; 00035 class SALOME_ExtractGeometry; 00036 class VISU_ElnoDisassembleFilter; 00037 00038 00039 //---------------------------------------------------------------------------- 00040 class VISU_DataSetMapperHolder : public VISU_MapperHolder 00041 { 00042 public: 00043 vtkTypeMacro(VISU_DataSetMapperHolder, VISU_MapperHolder); 00044 00045 static 00046 VISU_DataSetMapperHolder* 00047 New(); 00048 00049 //---------------------------------------------------------------------------- 00050 virtual 00051 void 00052 ShallowCopy(VISU_MapperHolder *theMapperHolder, 00053 bool theIsCopyInput); 00054 00055 void 00056 SetElnoDisassembleState( bool theIsShrunk ); 00057 00059 virtual 00060 unsigned long int 00061 GetMemorySize(); 00062 00063 //---------------------------------------------------------------------------- 00064 void 00065 SetUnstructuredGridIDMapper(const VISU::PUnstructuredGridIDMapper& theIDMapper); 00066 00067 const VISU::PUnstructuredGridIDMapper& 00068 GetUnstructuredGridIDMapper(); 00069 00070 virtual 00071 vtkUnstructuredGrid* 00072 GetUnstructuredGridInput(); 00073 00074 virtual 00075 vtkDataSetMapper* 00076 GetDataSetMapper(); 00077 00078 //---------------------------------------------------------------------------- 00079 virtual 00080 vtkIdType 00081 GetNodeObjID(vtkIdType theID); 00082 00083 virtual 00084 vtkIdType 00085 GetNodeVTKID(vtkIdType theID); 00086 00087 virtual 00088 vtkFloatingPointType* 00089 GetNodeCoord(vtkIdType theObjID); 00090 00091 virtual 00092 vtkIdType 00093 GetElemObjID(vtkIdType theID); 00094 00095 virtual 00096 vtkIdType 00097 GetElemVTKID(vtkIdType theID); 00098 00099 virtual 00100 vtkCell* 00101 GetElemCell(vtkIdType theObjID); 00102 00103 //---------------------------------------------------------------------------- 00104 virtual 00105 void 00106 SetImplicitFunction(vtkImplicitFunction *theFunction); 00107 00108 virtual 00109 vtkImplicitFunction* 00110 GetImplicitFunction(); 00111 00112 virtual 00113 void 00114 SetExtractInside(bool theMode); 00115 00116 virtual 00117 void 00118 SetExtractBoundaryCells(bool theMode); 00119 00120 //---------------------------------------------------------------------------- 00121 // Clipping planes 00122 virtual 00123 void 00124 RemoveAllClippingPlanes(); 00125 00126 virtual 00127 vtkIdType 00128 GetNumberOfClippingPlanes(); 00129 00130 virtual 00131 bool 00132 AddClippingPlane(vtkPlane* thePlane); 00133 00134 virtual 00135 vtkPlane* 00136 GetClippingPlane(vtkIdType theID); 00137 00138 virtual void RemoveClippingPlane(vtkIdType theID); 00139 00140 protected: 00141 //---------------------------------------------------------------------------- 00142 VISU_DataSetMapperHolder(); 00143 VISU_DataSetMapperHolder(const VISU_DataSetMapperHolder&); 00144 00145 virtual 00146 ~VISU_DataSetMapperHolder(); 00147 00148 //---------------------------------------------------------------------------- 00149 virtual 00150 void 00151 OnCreateMapper(); 00152 00153 void 00154 SetDataSetMapper(vtkDataSetMapper* theMapper); 00155 00156 //---------------------------------------------------------------------------- 00157 virtual 00158 void 00159 SetLookupTable(VISU_LookupTable* theLookupTable); 00160 00161 virtual 00162 vtkPointSet* 00163 GetClippedInput(); 00164 00165 private: 00166 //---------------------------------------------------------------------------- 00167 VISU::PUnstructuredGridIDMapper myUnstructuredGridIDMapper; 00168 vtkSmartPointer< VISU_ElnoDisassembleFilter > myElnoDisassembleFilter; 00169 vtkSmartPointer< SALOME_ExtractGeometry > myExtractGeometry; 00170 vtkSmartPointer< vtkDataSetMapper > myDataSetMapper; 00171 }; 00172 00173 #endif