vtkParametricMobius.h 3.22 KB
Newer Older
1 2 3 4 5
/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkParametricMobius.h

6
  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 8 9
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

10 11
     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 13 14
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
15
// .NAME vtkParametricMobius - Generate a Mobius strip.
16
// .SECTION Description
17
// vtkParametricMobius generates a Mobius strip.
18
//
19 20
// For further information about this surface, please consult the
// technical description "Parametric surfaces" in http://www.vtk.org/documents.php
21 22
// in the "VTK Technical Documents" section in the VTk.org web pages.
//
23
// .SECTION Thanks
24
// Andrew Maclean andrew.amaclean@gmail.com for creating and contributing the
25 26
// class.
//
27 28
#ifndef vtkParametricMobius_h
#define vtkParametricMobius_h
29

30
#include "vtkCommonComputationalGeometryModule.h" // For export macro
31 32
#include "vtkParametricFunction.h"

33
class VTKCOMMONCOMPUTATIONALGEOMETRY_EXPORT vtkParametricMobius : public vtkParametricFunction
34 35
{
public:
36
  vtkTypeMacro(vtkParametricMobius,vtkParametricFunction);
37
  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
38

39 40
  // Description:
  // Construct a Mobius strip with the following parameters:
41
  // MinimumU = 0, MaximumU = 2*Pi,
42
  // MinimumV = -1, MaximumV = 1,
43 44
  // JoinU = 1, JoinV = 0,
  // TwistU = 0, TwistV = 0,
45
  // ClockwiseOrdering = 1,
46
  // DerivativesAvailable = 1,
47 48 49 50
  // Radius = 1.
  static vtkParametricMobius *New();

  // Description:
51
  // Set/Get the radius of the Mobius strip. Default is 1.
52 53 54 55 56
  vtkSetMacro(Radius,double);
  vtkGetMacro(Radius,double);

  // Description
  // Return the parametric dimension of the class.
57
  int GetDimension() VTK_OVERRIDE {return 2;}
58 59

  // Description:
60 61
  // The Mobius strip.
  //
62
  // This function performs the mapping \f$f(u,v) \rightarrow (x,y,x)\f$, returning it
63
  // as Pt. It also returns the partial derivatives Du and Dv.
64 65
  // \f$Pt = (x, y, z), Du = (dx/du, dy/du, dz/du), Dv = (dx/dv, dy/dv, dz/dv)\f$ .
  // Then the normal is \f$N = Du X Dv\f$ .
66
  void Evaluate(double uvw[3], double Pt[3], double Duvw[9]) VTK_OVERRIDE;
67 68

  // Description:
69
  // Calculate a user defined scalar using one or all of uvw, Pt, Duvw.
70
  //
71
  // uvw are the parameters with Pt being the the cartesian point,
72 73
  // Duvw are the derivatives of this point with respect to u, v and w.
  // Pt, Du, Dv are obtained from Evaluate().
74 75
  //
  // This function is only called if the ScalarMode has the value
76
  // vtkParametricFunctionSource::SCALAR_FUNCTION_DEFINED
77
  //
78 79
  // If the user does not need to calculate a scalar, then the
  // instantiated function should return zero.
80
  //
81
  double EvaluateScalar(double uvw[3], double Pt[3], double Duvw[9]) VTK_OVERRIDE;
82 83 84

protected:
  vtkParametricMobius();
85
  ~vtkParametricMobius() VTK_OVERRIDE;
86 87 88 89 90

  // Variables
  double Radius;

private:
91
  vtkParametricMobius(const vtkParametricMobius&) VTK_DELETE_FUNCTION;
92
  void operator=(const vtkParametricMobius&) VTK_DELETE_FUNCTION;
93 94 95
};

#endif