/usr/include/vtk-7.1/vtkSimple3DCirclesStrategy.h is in libvtk7-dev 7.1.1+dfsg1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 | /*=========================================================================
Program: Visualization Toolkit
Module: vtkSimple3DCirclesStrategy.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/**
* @class vtkSimple3DCirclesStrategy
* @brief places vertices on circles in 3D
*
*
* Places vertices on circles depending on the graph vertices hierarchy level.
* The source graph could be vtkDirectedAcyclicGraph or vtkDirectedGraph if MarkedStartPoints array was added.
* The algorithm collects the standalone points, too and take them to a separated circle. If method is FixedRadiusMethod,
* the radius of the circles will be equal. If method is FixedDistanceMethod, the distance beetwen the points on circles will
* be equal.
*
* In first step initial points are searched. A point is initial, if its in degree equal zero and out degree is greater than zero (or
* marked by MarkedStartVertices and out degree is greater than zero). Independent vertices (in and out degree equal zero) are collected
* separatelly. In second step the hierarchical level is generated for every vertex. In third step the hierarchical order is generated.
* If a vertex has no hierarchical level and it is not independent, the graph has loop so the algorithm exit with error message. Finally
* the vertices positions are calculated by the hierarchical order and by the vertices hierarchy levels.
*
* @par Thanks:
* Ferenc Nasztanovics, naszta@naszta.hu, Budapest University of Technology and Economics, Department of Structural Mechanics
*
* @par References:
* in 3D rotation was used: http://en.citizendium.org/wiki/Rotation_matrix
*/
#ifndef vtkSimple3DCirclesStrategy_h
#define vtkSimple3DCirclesStrategy_h
#include "vtkInfovisLayoutModule.h" // For export macro
#include "vtkGraphLayoutStrategy.h"
#include "vtkVariant.h" // For variant API
class vtkAbstractArray;
class vtkDirectedGraph;
class vtkIdTypeArray;
class vtkIntArray;
class vtkSimple3DCirclesStrategyInternal;
class VTKINFOVISLAYOUT_EXPORT vtkSimple3DCirclesStrategy : public vtkGraphLayoutStrategy
{
public:
static vtkSimple3DCirclesStrategy * New();
vtkTypeMacro(vtkSimple3DCirclesStrategy,vtkGraphLayoutStrategy);
void PrintSelf( ostream& os, vtkIndent indent );
enum
{
FixedRadiusMethod = 0, FixedDistanceMethod = 1
};
//@{
/**
* Set or get cicrle generating method (FixedRadiusMethod/FixedDistanceMethod). Default is FixedRadiusMethod.
*/
vtkSetMacro(Method,int);
vtkGetMacro(Method,int);
//@}
//@{
/**
* If Method is FixedRadiusMethod: Set or get the radius of the circles.
* If Method is FixedDistanceMethod: Set or get the distance of the points in the circle.
*/
vtkSetMacro(Radius,double);
vtkGetMacro(Radius,double);
//@}
//@{
/**
* Set or get the vertical (local z) distance between the circles. If AutoHeight is on, this is the minimal height between
* the circle layers
*/
vtkSetMacro(Height,double);
vtkGetMacro(Height,double);
//@}
//@{
/**
* Set or get the origin of the geometry. This is the center of the first circle. SetOrigin(x,y,z)
*/
vtkSetVector3Macro(Origin,double);
vtkGetVector3Macro(Origin,double);
//@}
//@{
/**
* Set or get the normal vector of the circles plain. The height is growing in this direction. The direction must not be zero vector.
* The default vector is (0.0,0.0,1.0)
*/
virtual void SetDirection( double dx, double dy, double dz );
virtual void SetDirection( double d[3] );
vtkGetVector3Macro(Direction,double);
//@}
//@{
/**
* Set or get initial vertices. If MarkedStartVertices is added, loop is accepted in the graph. (If all of the loop start vertices are
* marked in MarkedStartVertices array.) MarkedStartVertices size must be equal with the number of the vertices in the graph. Start
* vertices must be marked by MarkedValue. (E.g.: if MarkedValue=3 and MarkedStartPoints is { 0, 3, 5, 3 }, the start points ids will
* be {1,3}.) )
*/
virtual void SetMarkedStartVertices( vtkAbstractArray * _arg );
vtkGetObjectMacro(MarkedStartVertices,vtkAbstractArray);
//@}
//@{
/**
* Set or get MarkedValue. See: MarkedStartVertices.
*/
virtual void SetMarkedValue( vtkVariant _arg );
virtual vtkVariant GetMarkedValue( void );
//@}
//@{
/**
* Set or get ForceToUseUniversalStartPointsFinder. If ForceToUseUniversalStartPointsFinder is true, MarkedStartVertices won't be used.
* In this case the input graph must be vtkDirectedAcyclicGraph (Defualt: false).
*/
vtkSetMacro(ForceToUseUniversalStartPointsFinder,int);
vtkGetMacro(ForceToUseUniversalStartPointsFinder,int);
vtkBooleanMacro(ForceToUseUniversalStartPointsFinder,int);
//@}
//@{
/**
* Set or get auto height (Default: false). If AutoHeight is true, (r(i+1) - r(i-1))/Height will be smaller than tan(MinimumRadian).
* If you want equal distances and parallel circles, you should turn off AutoHeight.
*/
vtkSetMacro(AutoHeight,int);
vtkGetMacro(AutoHeight,int);
vtkBooleanMacro(AutoHeight,int);
//@}
//@{
/**
* Set or get minimum radian (used by auto height).
*/
vtkSetMacro(MinimumRadian,double);
vtkGetMacro(MinimumRadian,double);
//@}
//@{
/**
* Set or get minimum degree (used by auto height). There is no separated minimum degree, so minimum radian will be changed.
*/
virtual void SetMinimumDegree( double degree );
virtual double GetMinimumDegree( void );
//@}
//@{
/**
* Set or get hierarchical layers id by vertices (An usual vertex's layer id is greater or equal to zero. If a vertex is standalone, its
* layer id is -2.) If no HierarchicalLayers array is defined, vtkSimple3DCirclesStrategy will generate it automatically (default).
*/
virtual void SetHierarchicalLayers( vtkIntArray * _arg );
vtkGetObjectMacro(HierarchicalLayers,vtkIntArray);
//@}
//@{
/**
* Set or get hierarchical ordering of vertices (The array starts from the first vertex's id. All id must be greater or equal to zero!)
* If no HierarchicalOrder is defined, vtkSimple3DCirclesStrategy will generate it automatically (default).
*/
virtual void SetHierarchicalOrder( vtkIdTypeArray * _arg );
vtkGetObjectMacro(HierarchicalOrder,vtkIdTypeArray);
//@}
/**
* Standard layout method
*/
virtual void Layout( void );
/**
* Set graph (warning: HierarchicalOrder and HierarchicalLayers will set to zero. These reference counts will be decreased!)
*/
virtual void SetGraph( vtkGraph * graph );
protected:
vtkSimple3DCirclesStrategy( void );
virtual ~vtkSimple3DCirclesStrategy( void );
inline void Transform( double Local[], double Global[] );
double Radius;
double Height;
double Origin[3];
double Direction[3];
int Method;
vtkAbstractArray * MarkedStartVertices;
vtkVariant MarkedValue;
int ForceToUseUniversalStartPointsFinder;
int AutoHeight;
double MinimumRadian;
vtkIntArray * HierarchicalLayers;
vtkIdTypeArray * HierarchicalOrder;
private:
/**
* Search and fill in target all zero input degree vertices where the output degree is more than zero. The finded vertices hierarchical
* layer ID will be zero.
*/
virtual int UniversalStartPoints( vtkDirectedGraph * input, vtkSimple3DCirclesStrategyInternal * target, vtkSimple3DCirclesStrategyInternal *StandAlones, vtkIntArray * layers );
/**
* Build hierarchical layers in the graph. A vertices hierarchical layer number is equal the maximum of its inputs hierarchical layer numbers plus one.
*/
virtual int BuildLayers( vtkDirectedGraph * input, vtkSimple3DCirclesStrategyInternal * source, vtkIntArray * layers );
/**
* Build hierarchical ordering of the graph points.
*/
virtual void BuildPointOrder( vtkDirectedGraph * input, vtkSimple3DCirclesStrategyInternal *source, vtkSimple3DCirclesStrategyInternal *StandAlones, vtkIntArray * layers, vtkIdTypeArray * order );
double T[3][3];
vtkSimple3DCirclesStrategy(const vtkSimple3DCirclesStrategy&) VTK_DELETE_FUNCTION;
void operator=(const vtkSimple3DCirclesStrategy&) VTK_DELETE_FUNCTION;
};
#endif
|