vtkParametricMobius.h 3.22 KB
 Will Schroeder committed Jan 24, 2005 1 2 3 4 5 /*========================================================================= Program: Visualization Toolkit Module: vtkParametricMobius.h  VTK Developers committed Apr 09, 2012 6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen  Will Schroeder committed Jan 24, 2005 7 8 9  All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details.  VTK Developers committed Apr 09, 2012 10 11  This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR  Will Schroeder committed Jan 24, 2005 12 13 14  PURPOSE. See the above copyright notice for more information. =========================================================================*/  15 // .NAME vtkParametricMobius - Generate a Mobius strip.  Will Schroeder committed Jan 24, 2005 16 // .SECTION Description  17 // vtkParametricMobius generates a Mobius strip.  18 //  VTK Developers committed Apr 09, 2012 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. //  Will Schroeder committed Jan 24, 2005 23 // .SECTION Thanks  Andrew Maclean committed Jun 02, 2014 24 // Andrew Maclean andrew.amaclean@gmail.com for creating and contributing the  Will Schroeder committed Jan 24, 2005 25 26 // class. //  Sean McBride committed Dec 18, 2014 27 28 #ifndef vtkParametricMobius_h #define vtkParametricMobius_h  Will Schroeder committed Jan 24, 2005 29   VTK Developers committed Apr 09, 2012 30 #include "vtkCommonComputationalGeometryModule.h" // For export macro  Will Schroeder committed Jan 24, 2005 31 32 #include "vtkParametricFunction.h"  VTK Developers committed Apr 09, 2012 33 class VTKCOMMONCOMPUTATIONALGEOMETRY_EXPORT vtkParametricMobius : public vtkParametricFunction  Will Schroeder committed Jan 24, 2005 34 35 { public:  Mark Olesen committed Apr 23, 2010 36  vtkTypeMacro(vtkParametricMobius,vtkParametricFunction);  Robert Maynard committed Aug 19, 2016 37  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;  VTK Developers committed Apr 09, 2012 38   Will Schroeder committed Jan 24, 2005 39 40  // Description: // Construct a Mobius strip with the following parameters:  Andrew Maclean committed Feb 08, 2005 41  // MinimumU = 0, MaximumU = 2*Pi,  VTK Developers committed Apr 09, 2012 42  // MinimumV = -1, MaximumV = 1,  Andrew Maclean committed Feb 08, 2005 43 44  // JoinU = 1, JoinV = 0, // TwistU = 0, TwistV = 0,  VTK Developers committed Apr 09, 2012 45  // ClockwiseOrdering = 1,  Andrew Maclean committed Feb 08, 2005 46  // DerivativesAvailable = 1,  Will Schroeder committed Jan 24, 2005 47 48 49 50  // Radius = 1. static vtkParametricMobius *New(); // Description:  Andrew Maclean committed Jun 02, 2014 51  // Set/Get the radius of the Mobius strip. Default is 1.  Will Schroeder committed Jan 24, 2005 52 53 54 55 56  vtkSetMacro(Radius,double); vtkGetMacro(Radius,double); // Description // Return the parametric dimension of the class.  Robert Maynard committed Sep 23, 2016 57  int GetDimension() VTK_OVERRIDE {return 2;}  Will Schroeder committed Jan 24, 2005 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  Will Schroeder committed Jan 24, 2005 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$ .  Robert Maynard committed Sep 23, 2016 66  void Evaluate(double uvw[3], double Pt[3], double Duvw[9]) VTK_OVERRIDE;  Will Schroeder committed Jan 24, 2005 67 68  // Description:  Andrew Maclean committed Mar 12, 2005 69  // Calculate a user defined scalar using one or all of uvw, Pt, Duvw.  Will Schroeder committed Jan 24, 2005 70  //  VTK Developers committed Apr 09, 2012 71  // uvw are the parameters with Pt being the the cartesian point,  Andrew Maclean committed Feb 08, 2005 72 73  // Duvw are the derivatives of this point with respect to u, v and w. // Pt, Du, Dv are obtained from Evaluate().  Will Schroeder committed Jan 24, 2005 74 75  // // This function is only called if the ScalarMode has the value  76  // vtkParametricFunctionSource::SCALAR_FUNCTION_DEFINED  Will Schroeder committed Jan 24, 2005 77  //  VTK Developers committed Apr 09, 2012 78 79  // If the user does not need to calculate a scalar, then the // instantiated function should return zero.  Will Schroeder committed Jan 24, 2005 80  //  Robert Maynard committed Sep 23, 2016 81  double EvaluateScalar(double uvw[3], double Pt[3], double Duvw[9]) VTK_OVERRIDE;  Will Schroeder committed Jan 24, 2005 82 83 84  protected: vtkParametricMobius();  Robert Maynard committed Sep 23, 2016 85  ~vtkParametricMobius() VTK_OVERRIDE;  Will Schroeder committed Jan 24, 2005 86 87 88 89 90  // Variables double Radius; private:  Sean McBride committed Jul 07, 2016 91  vtkParametricMobius(const vtkParametricMobius&) VTK_DELETE_FUNCTION;  Sean McBride committed Jul 07, 2016 92  void operator=(const vtkParametricMobius&) VTK_DELETE_FUNCTION;  Will Schroeder committed Jan 24, 2005 93 94 95 }; #endif