Back to index

salome-paravis  6.5.0
vtkExtractGroup.h
Go to the documentation of this file.
00001 // Copyright (C) 2010-2012  CEA/DEN, EDF R&D
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 #ifndef vtkExtractGroup_h__
00021 #define vtkExtractGroup_h__
00022 
00023 #include "vtkMultiBlockDataSetAlgorithm.h"
00024 class vtkMutableDirectedGraph;
00025 class vtkInformation;
00026 class vtkInformationVector;
00027 class vtkDataArraySelection;
00028 class vtkTimeStamp;
00029 class vtkStringArray;
00030 
00031 class VTK_EXPORT vtkExtractGroup: public vtkMultiBlockDataSetAlgorithm
00032 {
00033 public:
00034   static vtkExtractGroup* New();
00035 vtkTypeRevisionMacro(vtkExtractGroup, vtkMultiBlockDataSetAlgorithm)
00036   void PrintSelf(ostream& os, vtkIndent indent);
00037 
00038   // Description:
00039   // Every time the SIL is updated a this will return a different value.
00040   virtual int GetSILUpdateStamp();
00041 
00042   // Description:
00043   // use this method to enable/disable cell types
00044   // the key is encoded with the vtkMedUtilities::CellTypeKey method
00045   // which returns a string
00046   // CELL_TYPE/MED_ENTITE_MAILLAGE/MED_GEOMETRIE_ELEMENT
00047   virtual void SetEntityStatus(const char* key, int flag);
00048 
00049   // Description:
00050   // use this method to enable/disable a family support
00051   // the key is formatted by the vtkMedUtilities::FamilyKey method which
00052   // returns a string
00053   // GROUP/MESH_NAME/OnPoint/FAMILY_NAME or GROUP/MESH_NAME/OnCell/FAMILY_NAME
00054   virtual void SetGroupStatus(const char* key, int flag);
00055 
00056   // Description :
00057   // If set to 1, this filter will prune the empty parts in the output.
00058   // If not, then empty datasets will be kept
00059   vtkSetMacro(PruneOutput, int);
00060   vtkGetMacro(PruneOutput, int);
00061 
00062   int ModifyRequest(vtkInformation* request, int when);
00063 
00064 protected:
00065   vtkExtractGroup();
00066   ~vtkExtractGroup();
00067 
00068   int RequestInformation(vtkInformation *request,
00069       vtkInformationVector **inputVector, vtkInformationVector *outputVector);
00070 
00071   int RequestData(vtkInformation *request, vtkInformationVector **inputVector,
00072       vtkInformationVector *outputVector);
00073 
00074   // Description :
00075   // returns 1 if this cell type is to be passed through
00076   int IsEntitySelected(const char*);
00077 
00078   // Description :
00079   // returns 1 if this family is to be passed through
00080   int IsFamilySelected(const char* meshName, const char* cellOrPoint,
00081       const char* familyName);
00082 
00083   // Description :
00084   // removes empty blocks from the vtkMultiBlockDataSet.
00085   void PruneEmptyBlocks(vtkMultiBlockDataSet* mb);
00086 
00087   // Description:
00088   // This SIL stores the structure of the mesh/groups/cell types
00089   // that can be selected.
00090   virtual void SetSIL(vtkMutableDirectedGraph*);
00091   vtkGetObjectMacro(SIL, vtkMutableDirectedGraph);
00092 
00093   virtual void BuildDefaultSIL(vtkMutableDirectedGraph*);
00094 
00095   // Description:
00096   // use this method to enable/disable a family support
00097   // the key is formatted by the vtkMedUtilities::FamilyKey method which
00098   // returns a string
00099   // FAMILY/MESH_NAME/OnPoint/FAMILY_NAME or MESH_NAME/OnCell/FAMILY_NAME
00100   virtual void SetFamilyStatus(const char* key, int flag);
00101 
00102   // Description:
00103   // Update the Family status from te group status.
00104   // The family status is lazily updated when GetFamilyStatus is called.
00105   virtual void SelectFamiliesFromGroups();
00106 
00107   // Description:
00108   // returns true if the block described by the given information
00109   // is selected.
00110   virtual int IsBlockSelected(vtkStringArray* path);
00111 
00112   virtual void ClearSelections();
00113 
00114   virtual vtkIdType FindVertex(const char* name);
00115 
00116   vtkMutableDirectedGraph* SIL;
00117 
00118   // Support selection
00119   vtkDataArraySelection* Entities;
00120   vtkDataArraySelection* Families;
00121   vtkDataArraySelection* Groups;
00122 
00123   vtkTimeStamp SILTime;
00124   vtkTimeStamp FamilySelectionTime;
00125   vtkTimeStamp GroupSelectionTime;
00126 
00127   int PruneOutput;
00128 
00129 private:
00130   vtkExtractGroup(const vtkExtractGroup&);
00131   void operator=(const vtkExtractGroup&); // Not implemented.
00132 };
00133 
00134 #endif