File: vtkImplicitTextureCoords.h

package info (click to toggle)
vtk7 7.1.1%2Bdfsg2-8
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 127,396 kB
  • sloc: cpp: 1,539,584; ansic: 124,382; python: 78,038; tcl: 47,013; xml: 8,142; yacc: 5,040; java: 4,439; perl: 3,132; lex: 1,926; sh: 1,500; makefile: 126; objc: 83
file content (120 lines) | stat: -rw-r--r-- 4,139 bytes parent folder | download | duplicates (2)
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
/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkImplicitTextureCoords.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   vtkImplicitTextureCoords
 * @brief   generate 1D, 2D, or 3D texture coordinates based on implicit function(s)
 *
 * vtkImplicitTextureCoords is a filter to generate 1D, 2D, or 3D texture
 * coordinates from one, two, or three implicit functions, respectively.
 * In combinations with a vtkBooleanTexture map (or another texture map of
 * your own creation), the texture coordinates can be used to highlight
 *(via color or intensity) or cut (via transparency) dataset geometry without
 * any complex geometric processing. (Note: the texture coordinates are
 * referred to as r-s-t coordinates.)
 *
 * The texture coordinates are automatically normalized to lie between (0,1).
 * Thus, no matter what the implicit functions evaluate to, the resulting
 * texture coordinates lie between (0,1), with the zero implicit function
 * value mapped to the 0.5 texture coordinates value. Depending upon the
 * maximum negative/positive implicit function values, the full (0,1) range
 * may not be occupied (i.e., the positive/negative ranges are mapped using
 * the same scale factor).
 *
 * A boolean variable InvertTexture is available to flip the texture
 * coordinates around 0.5 (value 1.0 becomes 0.0, 0.25->0.75). This is
 * equivalent to flipping the texture map (but a whole lot easier).
 *
 * @warning
 * You can use the transformation capabilities of vtkImplicitFunction to
 * orient, translate, and scale the implicit functions. Also, the dimension of
 * the texture coordinates is implicitly defined by the number of implicit
 * functions defined.
 *
 * @sa
 * vtkImplicitFunction vtkTexture vtkBooleanTexture vtkTransformTexture
*/

#ifndef vtkImplicitTextureCoords_h
#define vtkImplicitTextureCoords_h

#include "vtkFiltersTextureModule.h" // For export macro
#include "vtkDataSetAlgorithm.h"

class vtkImplicitFunction;

class VTKFILTERSTEXTURE_EXPORT vtkImplicitTextureCoords : public vtkDataSetAlgorithm
{
public:
  vtkTypeMacro(vtkImplicitTextureCoords,vtkDataSetAlgorithm);
  void PrintSelf(ostream& os, vtkIndent indent);

  /**
   * Create object with texture dimension=2 and no r-s-t implicit functions
   * defined and FlipTexture turned off.
   */
  static vtkImplicitTextureCoords *New();

  //@{
  /**
   * Specify an implicit function to compute the r texture coordinate.
   */
  virtual void SetRFunction(vtkImplicitFunction*);
  vtkGetObjectMacro(RFunction,vtkImplicitFunction);
  //@}

  //@{
  /**
   * Specify an implicit function to compute the s texture coordinate.
   */
  virtual void SetSFunction(vtkImplicitFunction*);
  vtkGetObjectMacro(SFunction,vtkImplicitFunction);
  //@}

  //@{
  /**
   * Specify an implicit function to compute the t texture coordinate.
   */
  virtual void SetTFunction(vtkImplicitFunction*);
  vtkGetObjectMacro(TFunction,vtkImplicitFunction);
  //@}

  //@{
  /**
   * If enabled, this will flip the sense of inside and outside the implicit
   * function (i.e., a rotation around the r-s-t=0.5 axis).
   */
  vtkSetMacro(FlipTexture,int);
  vtkGetMacro(FlipTexture,int);
  vtkBooleanMacro(FlipTexture,int);
  //@}

protected:
  vtkImplicitTextureCoords();
  ~vtkImplicitTextureCoords();

  int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);

  vtkImplicitFunction *RFunction;
  vtkImplicitFunction *SFunction;
  vtkImplicitFunction *TFunction;
  int FlipTexture;
private:
  vtkImplicitTextureCoords(const vtkImplicitTextureCoords&) VTK_DELETE_FUNCTION;
  void operator=(const vtkImplicitTextureCoords&) VTK_DELETE_FUNCTION;
};

#endif