1 // Copyright (C) 2010-2012 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef vtkExtractGroup_h__
21 #define vtkExtractGroup_h__
23 #include "vtkMultiBlockDataSetAlgorithm.h"
24 class vtkMutableDirectedGraph;
26 class vtkInformationVector;
27 class vtkDataArraySelection;
31 class VTK_EXPORT vtkExtractGroup: public vtkMultiBlockDataSetAlgorithm
34 static vtkExtractGroup* New();
35 vtkTypeRevisionMacro(vtkExtractGroup, vtkMultiBlockDataSetAlgorithm)
36 void PrintSelf(ostream& os, vtkIndent indent);
39 // Every time the SIL is updated a this will return a different value.
40 virtual int GetSILUpdateStamp();
43 // use this method to enable/disable cell types
44 // the key is encoded with the vtkMedUtilities::CellTypeKey method
45 // which returns a string
46 // CELL_TYPE/MED_ENTITE_MAILLAGE/MED_GEOMETRIE_ELEMENT
47 virtual void SetEntityStatus(const char* key, int flag);
50 // use this method to enable/disable a family support
51 // the key is formatted by the vtkMedUtilities::FamilyKey method which
53 // GROUP/MESH_NAME/OnPoint/FAMILY_NAME or GROUP/MESH_NAME/OnCell/FAMILY_NAME
54 virtual void SetGroupStatus(const char* key, int flag);
57 // If set to 1, this filter will prune the empty parts in the output.
58 // If not, then empty datasets will be kept
59 vtkSetMacro(PruneOutput, int);
60 vtkGetMacro(PruneOutput, int);
62 int ModifyRequest(vtkInformation* request, int when);
68 int RequestInformation(vtkInformation *request,
69 vtkInformationVector **inputVector, vtkInformationVector *outputVector);
71 int RequestData(vtkInformation *request, vtkInformationVector **inputVector,
72 vtkInformationVector *outputVector);
75 // returns 1 if this cell type is to be passed through
76 int IsEntitySelected(const char*);
79 // returns 1 if this family is to be passed through
80 int IsFamilySelected(const char* meshName, const char* cellOrPoint,
81 const char* familyName);
84 // removes empty blocks from the vtkMultiBlockDataSet.
85 void PruneEmptyBlocks(vtkMultiBlockDataSet* mb);
88 // This SIL stores the structure of the mesh/groups/cell types
89 // that can be selected.
90 virtual void SetSIL(vtkMutableDirectedGraph*);
91 vtkGetObjectMacro(SIL, vtkMutableDirectedGraph);
93 virtual void BuildDefaultSIL(vtkMutableDirectedGraph*);
96 // use this method to enable/disable a family support
97 // the key is formatted by the vtkMedUtilities::FamilyKey method which
99 // FAMILY/MESH_NAME/OnPoint/FAMILY_NAME or MESH_NAME/OnCell/FAMILY_NAME
100 virtual void SetFamilyStatus(const char* key, int flag);
103 // Update the Family status from te group status.
104 // The family status is lazily updated when GetFamilyStatus is called.
105 virtual void SelectFamiliesFromGroups();
108 // returns true if the block described by the given information
110 virtual int IsBlockSelected(vtkStringArray* path);
112 virtual void ClearSelections();
114 virtual vtkIdType FindVertex(const char* name);
116 vtkMutableDirectedGraph* SIL;
119 vtkDataArraySelection* Entities;
120 vtkDataArraySelection* Families;
121 vtkDataArraySelection* Groups;
123 vtkTimeStamp SILTime;
124 vtkTimeStamp FamilySelectionTime;
125 vtkTimeStamp GroupSelectionTime;
130 vtkExtractGroup(const vtkExtractGroup&);
131 void operator=(const vtkExtractGroup&); // Not implemented.