File: vtkTriangularTexture.h

package info (click to toggle)
vtk9 9.0.1%2Bdfsg1-8
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 133,688 kB
  • sloc: cpp: 1,568,287; ansic: 208,587; python: 87,847; xml: 8,022; java: 4,509; yacc: 4,027; sh: 2,515; perl: 2,183; lex: 1,766; objc: 143; makefile: 126; tcl: 59
file content (102 lines) | stat: -rw-r--r-- 2,828 bytes parent folder | download
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
/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkTriangularTexture.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   vtkTriangularTexture
 * @brief   generate 2D triangular texture map
 *
 * vtkTriangularTexture is a filter that generates a 2D texture map based on
 * the paper "Opacity-modulating Triangular Textures for Irregular Surfaces,"
 * by Penny Rheingans, IEEE Visualization '96, pp. 219-225.
 * The textures assume texture coordinates of (0,0), (1.0) and
 * (.5, sqrt(3)/2). The sequence of texture values is the same along each
 * edge of the triangular texture map. So, the assignment order of texture
 * coordinates is arbitrary.
 *
 * @sa
 * vtkTriangularTCoords
 */

#ifndef vtkTriangularTexture_h
#define vtkTriangularTexture_h

#include "vtkImageAlgorithm.h"
#include "vtkImagingHybridModule.h" // For export macro

class VTKIMAGINGHYBRID_EXPORT vtkTriangularTexture : public vtkImageAlgorithm
{
public:
  vtkTypeMacro(vtkTriangularTexture, vtkImageAlgorithm);
  void PrintSelf(ostream& os, vtkIndent indent) override;

  /**
   * Instantiate object with XSize and YSize = 64; the texture pattern =1
   * (opaque at centroid); and the scale factor set to 1.0.
   */
  static vtkTriangularTexture* New();

  //@{
  /**
   * Set a Scale Factor.
   */
  vtkSetMacro(ScaleFactor, double);
  vtkGetMacro(ScaleFactor, double);
  //@}

  //@{
  /**
   * Set the X texture map dimension. Default is 64.
   */
  vtkSetMacro(XSize, int);
  vtkGetMacro(XSize, int);
  //@}

  //@{
  /**
   * Set the Y texture map dimension. Default is 64.
   */
  vtkSetMacro(YSize, int);
  vtkGetMacro(YSize, int);
  //@}

  //@{
  /**
   * Set the texture pattern.
   * 1 = opaque at centroid (default)
   * 2 = opaque at vertices
   * 3 = opaque in rings around vertices
   */
  vtkSetClampMacro(TexturePattern, int, 1, 3);
  vtkGetMacro(TexturePattern, int);
  //@}

protected:
  vtkTriangularTexture();
  ~vtkTriangularTexture() override {}

  int RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
  void ExecuteDataWithInformation(vtkDataObject* data, vtkInformation* outInfo) override;

  int XSize;
  int YSize;
  double ScaleFactor;

  int TexturePattern;

private:
  vtkTriangularTexture(const vtkTriangularTexture&) = delete;
  void operator=(const vtkTriangularTexture&) = delete;
};

#endif