Salome HOME
[EDF24911] : StaticMesh option in Ensight Reader + Force Static Mesh Plugin. Synchron...
[modules/paravis.git] / src / Plugins / StaticMesh / plugin / StaticMeshModule / vtkGenericStaticEnSightReader.cxx
1 /*=========================================================================
2
3   Program:   Visualization Toolkit
4   Module:    vtkGenericStaticEnSightReader.cxx
5
6   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7   All rights reserved.
8   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10      This software is distributed WITHOUT ANY WARRANTY; without even
11      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12      PURPOSE.  See the above copyright notice for more information.
13
14 =========================================================================*/
15 #include "vtkGenericStaticEnSightReader.h"
16 #include "vtkObjectFactory.h"
17
18 #include "vtkStaticEnSight6BinaryReader.h"
19 #include "vtkStaticEnSight6Reader.h"
20 #include "vtkStaticEnSightGoldBinaryReader.h"
21 #include "vtkStaticEnSightGoldReader.h"
22
23 vtkStandardNewMacro(vtkGenericStaticEnSightReader);
24
25 //------------------------------------------------------------------------------
26 int vtkGenericStaticEnSightReader::RequestInformation(
27   vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector)
28 {
29   int ri = this->Superclass::RequestInformation(request, inputVector, outputVector);
30
31   // 6 binary
32   vtkStaticEnSight6BinaryReader* es6binary =
33     vtkStaticEnSight6BinaryReader::SafeDownCast(this->Reader);
34   if (es6binary)
35   {
36     es6binary->SetUseStaticMesh(this->UseStaticMesh);
37     return ri;
38   }
39
40   // 6
41   vtkStaticEnSight6Reader* es6 = vtkStaticEnSight6Reader::SafeDownCast(this->Reader);
42   if (es6)
43   {
44     es6->SetUseStaticMesh(this->UseStaticMesh);
45     return ri;
46   }
47
48   // Gold binary
49   vtkStaticEnSightGoldBinaryReader* goldBinary =
50     vtkStaticEnSightGoldBinaryReader::SafeDownCast(this->Reader);
51   if (goldBinary)
52   {
53     goldBinary->SetUseStaticMesh(this->UseStaticMesh);
54     return ri;
55   }
56
57   // Gold
58   vtkStaticEnSightGoldReader* gold = vtkStaticEnSightGoldReader::SafeDownCast(this->Reader);
59   if (gold)
60   {
61     gold->SetUseStaticMesh(this->UseStaticMesh);
62     return ri;
63   }
64
65   vtkErrorMacro("Failed to determine static mesh version of the EnSight reader.");
66   return 0;
67 }
68
69 //------------------------------------------------------------------------------
70 void vtkGenericStaticEnSightReader::PrintSelf(ostream& os, vtkIndent indent)
71 {
72   this->Superclass::PrintSelf(os, indent);
73   os << "UseStaticMesh: " << this->UseStaticMesh << std::endl;
74 }