1 // Copyright (C) 2010-2011 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 :
18 // webmaster.salome@opencascade.com
21 #ifndef vtkExtractGroup_h__
22 #define vtkExtractGroup_h__
24 #include "vtkMultiBlockDataSetAlgorithm.h"
25 class vtkMutableDirectedGraph;
27 class vtkInformationVector;
28 class vtkDataArraySelection;
32 class VTK_EXPORT vtkExtractGroup: public vtkMultiBlockDataSetAlgorithm
35 static vtkExtractGroup* New();
36 vtkTypeMacro(vtkExtractGroup, vtkMultiBlockDataSetAlgorithm)
37 void PrintSelf(ostream& os, vtkIndent indent);
40 // Every time the SIL is updated a this will return a different value.
41 virtual int GetSILUpdateStamp();
44 // use this method to enable/disable cell types
45 // the key is encoded with the vtkMedUtilities::CellTypeKey method
46 // which returns a string
47 // CELL_TYPE/MED_ENTITE_MAILLAGE/MED_GEOMETRIE_ELEMENT
48 virtual void SetEntityStatus(const char* key, int flag);
51 // use this method to enable/disable a family support
52 // the key is formatted by the vtkMedUtilities::FamilyKey method which
54 // GROUP/MESH_NAME/OnPoint/FAMILY_NAME or GROUP/MESH_NAME/OnCell/FAMILY_NAME
55 virtual void SetGroupStatus(const char* key, int flag);
58 // If set to 1, this filter will prune the empty parts in the output.
59 // If not, then empty datasets will be kept
60 vtkSetMacro(PruneOutput, int);
61 vtkGetMacro(PruneOutput, int);
63 int ModifyRequest(vtkInformation* request, int when);
69 int RequestInformation(vtkInformation *request,
70 vtkInformationVector **inputVector, vtkInformationVector *outputVector);
72 int RequestData(vtkInformation *request, vtkInformationVector **inputVector,
73 vtkInformationVector *outputVector);
76 // returns 1 if this cell type is to be passed through
77 int IsEntitySelected(const char*);
80 // returns 1 if this family is to be passed through
81 int IsFamilySelected(const char* meshName, const char* cellOrPoint,
82 const char* familyName);
85 // removes empty blocks from the vtkMultiBlockDataSet.
86 void PruneEmptyBlocks(vtkMultiBlockDataSet* mb);
89 // This SIL stores the structure of the mesh/groups/cell types
90 // that can be selected.
91 virtual void SetSIL(vtkMutableDirectedGraph*);
92 vtkGetObjectMacro(SIL, vtkMutableDirectedGraph);
94 virtual void BuildDefaultSIL(vtkMutableDirectedGraph*);
97 // use this method to enable/disable a family support
98 // the key is formatted by the vtkMedUtilities::FamilyKey method which
100 // FAMILY/MESH_NAME/OnPoint/FAMILY_NAME or MESH_NAME/OnCell/FAMILY_NAME
101 virtual void SetFamilyStatus(const char* key, int flag);
104 // Update the Family status from te group status.
105 // The family status is lazily updated when GetFamilyStatus is called.
106 virtual void SelectFamiliesFromGroups();
109 // returns true if the block described by the given information
111 virtual int IsBlockSelected(vtkStringArray* path);
113 virtual void ClearSelections();
115 virtual vtkIdType FindVertex(const char* name);
117 vtkMutableDirectedGraph* SIL;
120 vtkDataArraySelection* Entities;
121 vtkDataArraySelection* Families;
122 vtkDataArraySelection* Groups;
124 vtkTimeStamp SILTime;
125 vtkTimeStamp FamilySelectionTime;
126 vtkTimeStamp GroupSelectionTime;
131 vtkExtractGroup(const vtkExtractGroup&);
132 void operator=(const vtkExtractGroup&); // Not implemented.