VTK
dox/Infovis/vtkCollapseVerticesByArray.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkCollapseVerticesByArray.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00032 #ifndef __vtkCollapseVerticesByArray_h__
00033 #define __vtkCollapseVerticesByArray_h__
00034 
00035 #include "vtkGraphAlgorithm.h"
00036 
00037 class vtkCollapseVerticesByArrayInternal;
00038 
00039 class VTK_INFOVIS_EXPORT vtkCollapseVerticesByArray : public vtkGraphAlgorithm
00040 {
00041 public:
00042     static vtkCollapseVerticesByArray* New();
00043     vtkTypeMacro(vtkCollapseVerticesByArray, vtkGraphAlgorithm);
00044 
00045     void PrintSelf(ostream &os, vtkIndent indent);
00046 
00048 
00049     vtkGetMacro(AllowSelfLoops, bool);
00050     vtkSetMacro(AllowSelfLoops, bool);
00051     vtkBooleanMacro(AllowSelfLoops, bool);
00053 
00056     void AddAggregateEdgeArray(const char* arrName);
00057 
00058 
00060     void ClearAggregateEdgeArray();
00061 
00063 
00064     vtkGetStringMacro(VertexArray);
00065     vtkSetStringMacro(VertexArray);
00067 
00068 
00070 
00071     vtkGetMacro(CountEdgesCollapsed, bool);
00072     vtkSetMacro(CountEdgesCollapsed, bool);
00073     vtkBooleanMacro(CountEdgesCollapsed, bool);
00075 
00077 
00080     vtkGetStringMacro(EdgesCollapsedArray);
00081     vtkSetStringMacro(EdgesCollapsedArray);
00083 
00084 
00086 
00087     vtkGetMacro(CountVerticesCollapsed, bool);
00088     vtkSetMacro(CountVerticesCollapsed, bool);
00089     vtkBooleanMacro(CountVerticesCollapsed, bool);
00091 
00093 
00096     vtkGetStringMacro(VerticesCollapsedArray);
00097     vtkSetStringMacro(VerticesCollapsedArray);
00099 
00100 protected:
00101 
00102     vtkCollapseVerticesByArray();
00103    ~vtkCollapseVerticesByArray();
00104 
00106 
00107    virtual int RequestData(vtkInformation* request,
00108                            vtkInformationVector** inputVector,
00109                            vtkInformationVector* outputVector);
00111 
00113    virtual int FillOutputPortInformation(int port, vtkInformation* info);
00114 
00115 
00117    vtkGraph* Create(vtkGraph* inGraph);
00118 
00120 
00121    void FindEdge(vtkGraph* outGraph, vtkIdType source,
00122                  vtkIdType target, vtkIdType& edgeId);
00124 
00125 private:
00127   vtkCollapseVerticesByArray(const vtkCollapseVerticesByArray&); // Not implemented
00128   void operator=(const vtkCollapseVerticesByArray&);             // Not implemented
00130 
00131 
00132 protected:
00133   bool            AllowSelfLoops;
00134   char*           VertexArray;
00135 
00136   bool            CountEdgesCollapsed;
00137   char*           EdgesCollapsedArray;
00138 
00139   bool            CountVerticesCollapsed;
00140   char*           VerticesCollapsedArray;
00141 
00142   vtkCollapseVerticesByArrayInternal* Internal;
00143 };
00144 
00145 #endif // __vtkCollapseVerticesByArray_h__