vtkVectorGlyph.h 4.67 KB
Newer Older
hrchilds's avatar
hrchilds committed
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
/*=========================================================================

  Program:   Visualization Toolkit
  Module:    $RCSfile: vtkVectorGlyph.h,v $
  Language:  C++
  Date:      $Date: 2001/03/21 14:10:58 $
  Version:   $Revision: 1.1 $
  Thanks:    Hank Childs, B Division, Lawrence Livermore Nat'l Laboratory

Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

 * Redistributions of source code must retain the above copyright notice,
   this list of conditions and the following disclaimer.

 * Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

 * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
   of any contributors may be used to endorse or promote products derived
   from this software without specific prior written permission.

 * Modified source versions must be plainly marked as such, and must not be
   misrepresented as being the original software.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


=========================================================================*/

// .NAME vtkVectorGlyph -- Creates the appropriate glyph for a vector.
//
// .SECTION Description
// Creates the poly data to be used by a glyph filter for vector data.  This
// is a line with a head.  The head is not capped.  The size of the head may
// be set and the head may be turned off completely.
//

#ifndef __vtkVectorGlyph_h
#define __vtkVectorGlyph_h
#include <visit_vtk_exports.h>

56
#include <vtkPolyDataAlgorithm.h>
hrchilds's avatar
hrchilds committed
57

hrchilds's avatar
hrchilds committed
58 59 60 61
//  Modifications:
//    Jeremy Meredith, Fri Nov 21 11:25:27 PST 2003
//    Added offset to allow glyphs to originate/terminate at the point.
//
hrchilds's avatar
hrchilds committed
62 63 64 65 66 67 68
//    Jeremy Meredith, Mon Mar 19 14:33:15 EDT 2007
//    Added "HighQuality", which ups the number of facets, "LineStem"
//    which determines if the stem is a line or a cylinder(3d)/rectangle(2d),
//    "CapEnds" which caps the cone's base (and the cylinder's if
//    we're in 3D, i.e. if ConeHead is true), and the "StemWidth" which
//    defines the width of the stem if we're drawing is as a cyl/rect.
//
pugmire's avatar
pugmire committed
69 70
//    Dave Pugmire, Mon Jul 19 09:38:17 EDT 2010
//    Add ellipsoid glyphing.        
hrchilds's avatar
hrchilds committed
71

72
class VISIT_VTK_API vtkVectorGlyph : public vtkPolyDataAlgorithm
hrchilds's avatar
hrchilds committed
73 74
{
public:
75
  vtkTypeMacro(vtkVectorGlyph, vtkPolyDataAlgorithm);
hrchilds's avatar
hrchilds committed
76 77
  void PrintSelf(ostream& os, vtkIndent indent);

78 79 80
  // Description:
  // Instantiate a stride filter that throws away nine of every ten elements.
  static vtkVectorGlyph *New();
bonnell's avatar
bonnell committed
81 82 83
  vtkSetMacro(HighQuality,bool);
  vtkGetMacro(HighQuality,bool);
  vtkBooleanMacro(HighQuality,bool);
hrchilds's avatar
hrchilds committed
84

bonnell's avatar
bonnell committed
85 86 87
  vtkSetMacro(CapEnds,bool);
  vtkGetMacro(CapEnds,bool);
  vtkBooleanMacro(CapEnds,bool);
hrchilds's avatar
hrchilds committed
88

bonnell's avatar
bonnell committed
89 90 91
  vtkSetMacro(Arrow,bool);
  vtkGetMacro(Arrow,bool);
  vtkBooleanMacro(Arrow,bool);
pugmire's avatar
pugmire committed
92

bonnell's avatar
bonnell committed
93 94 95
  vtkSetMacro(LineStem,bool);
  vtkGetMacro(LineStem,bool);
  vtkBooleanMacro(LineStem,bool);
hrchilds's avatar
hrchilds committed
96 97 98 99

  vtkSetClampMacro(StemWidth,float,0.0,0.5);
  vtkGetMacro(StemWidth,float);

bonnell's avatar
bonnell committed
100 101 102
  vtkSetMacro(MakeHead,bool);
  vtkGetMacro(MakeHead,bool);
  vtkBooleanMacro(MakeHead,bool);
hrchilds's avatar
hrchilds committed
103 104 105 106

  vtkSetClampMacro(HeadSize,float,0.0,1.0);
  vtkGetMacro(HeadSize,float);

hrchilds's avatar
hrchilds committed
107 108 109
  vtkSetClampMacro(OriginOffset,float,-.5,+.5);
  vtkGetMacro(OriginOffset,float);

bonnell's avatar
bonnell committed
110 111 112
  vtkSetMacro(ConeHead,bool);
  vtkGetMacro(ConeHead,bool);
  vtkBooleanMacro(ConeHead,bool);
hrchilds's avatar
hrchilds committed
113 114 115 116 117

protected:
  vtkVectorGlyph();
  ~vtkVectorGlyph() {};

118
  virtual int RequestData(vtkInformation *,
bonnell's avatar
bonnell committed
119 120
                  vtkInformationVector **,
                  vtkInformationVector *);
121
  virtual int FillInputPortInformation(int port, vtkInformation *info);
hrchilds's avatar
hrchilds committed
122

bonnell's avatar
bonnell committed
123 124 125 126
  bool HighQuality;
  bool CapEnds;
  bool Arrow;
  bool LineStem;
hrchilds's avatar
hrchilds committed
127
  float StemWidth;
bonnell's avatar
bonnell committed
128
  bool MakeHead;
hrchilds's avatar
hrchilds committed
129
  float HeadSize;
hrchilds's avatar
hrchilds committed
130
  float OriginOffset;
bonnell's avatar
bonnell committed
131
  bool ConeHead;
hrchilds's avatar
hrchilds committed
132 133 134 135 136 137 138

private:
  vtkVectorGlyph(const vtkVectorGlyph&);
  void operator=(const vtkVectorGlyph&);
};

#endif
bonnell's avatar
bonnell committed
139 140