vtkParametricKlein.h 3.58 KB
 Will Schroeder committed Jan 24, 2005 1 2 3 4 5 /*========================================================================= Program: Visualization Toolkit Module: vtkParametricKlein.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. =========================================================================*/  Andrew Maclean committed Mar 05, 2005 15 // .NAME vtkParametricKlein - Generates a "classical" representation of a Klein bottle.  Will Schroeder committed Jan 24, 2005 16 // .SECTION Description  Andrew Maclean committed Mar 05, 2005 17 // vtkParametricKlein generates a "classical" representation of a Klein  Will Schroeder committed Jan 24, 2005 18 19 // bottle. A Klein bottle is a closed surface with no interior and only one // surface. It is unrealisable in 3 dimensions without intersecting  Andrew Maclean committed Mar 11, 2005 20 // surfaces. It can be  Andrew Maclean committed Mar 11, 2005 21 // realised in 4 dimensions by considering the map \f$F:R^2 \rightarrow R^4\f$ given by:  Andrew Maclean committed Mar 11, 2005 22 //  Andrew Maclean committed Mar 11, 2005 23 // - \f$f(u,v) = ((r*cos(v)+a)*cos(u),(r*cos(v)+a)*sin(u),r*sin(v)*cos(u/2),r*sin(v)*sin(u/2))\f$  Mathieu Malaterre committed Feb 15, 2005 24 //  Andrew Maclean committed Mar 11, 2005 25 // The classical representation of the immersion in \f$R^3\f$ is returned by this function.  Will Schroeder committed Jan 24, 2005 26 //  27 //  VTK Developers committed Apr 09, 2012 28 29 // For further information about this surface, please consult the // technical description "Parametric surfaces" in http://www.vtk.org/documents.php  30 31 // in the "VTK Technical Documents" section in the VTk.org web pages. //  Will Schroeder committed Jan 24, 2005 32 // .SECTION Thanks  Andrew Maclean committed Jun 02, 2014 33 // Andrew Maclean andrew.amaclean@gmail.com for creating and contributing the  Will Schroeder committed Jan 24, 2005 34 35 // class. //  Sean McBride committed Dec 18, 2014 36 37 #ifndef vtkParametricKlein_h #define vtkParametricKlein_h  Will Schroeder committed Jan 24, 2005 38   VTK Developers committed Apr 09, 2012 39 #include "vtkCommonComputationalGeometryModule.h" // For export macro  Will Schroeder committed Jan 24, 2005 40 41 #include "vtkParametricFunction.h"  VTK Developers committed Apr 09, 2012 42 class VTKCOMMONCOMPUTATIONALGEOMETRY_EXPORT vtkParametricKlein : public vtkParametricFunction  Will Schroeder committed Jan 24, 2005 43 44 { public:  Mark Olesen committed Apr 23, 2010 45  vtkTypeMacro(vtkParametricKlein,vtkParametricFunction);  Robert Maynard committed Aug 19, 2016 46  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;  VTK Developers committed Apr 09, 2012 47   Will Schroeder committed Jan 24, 2005 48 49  // Description: // Construct a Klein Bottle with the following parameters:  Andrew Maclean committed Feb 08, 2005 50  // MinimumU = 0, MaximumU = 2*Pi,  VTK Developers committed Apr 09, 2012 51  // MinimumV = -Pi, MaximumV = Pi,  Andrew Maclean committed Feb 08, 2005 52 53  // JoinU = 0, JoinV = 1, // TwistU = 0, TwistV = 0,  VTK Developers committed Apr 09, 2012 54  // ClockwiseOrdering = 1,  Andrew Maclean committed Feb 08, 2005 55  // DerivativesAvailable = 1,  Will Schroeder committed Jan 24, 2005 56  static vtkParametricKlein *New(); //! Initialise the parameters for the Klein bottle  VTK Developers committed Apr 09, 2012 57   Will Schroeder committed Jan 24, 2005 58 59  // Description // Return the parametric dimension of the class.  Robert Maynard committed Sep 23, 2016 60  int GetDimension() VTK_OVERRIDE {return 2;}  Will Schroeder committed Jan 24, 2005 61 62  // Description:  Andrew Maclean committed Mar 05, 2005 63  // A Klein bottle.  Will Schroeder committed Jan 24, 2005 64  //  Andrew Maclean committed Mar 11, 2005 65  // This function performs the mapping \f$f(u,v) \rightarrow (x,y,x)\f$, returning it  Will Schroeder committed Jan 24, 2005 66  // as Pt. It also returns the partial derivatives Du and Dv.  Andrew Maclean committed Mar 11, 2005 67 68  // \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 69  void Evaluate(double uvw[3], double Pt[3], double Duvw[9]) VTK_OVERRIDE;  Will Schroeder committed Jan 24, 2005 70 71  // Description:  Andrew Maclean committed Mar 12, 2005 72  // Calculate a user defined scalar using one or all of uvw, Pt, Duvw.  Will Schroeder committed Jan 24, 2005 73  //  VTK Developers committed Apr 09, 2012 74  // uvw are the parameters with Pt being the the cartesian point,  Andrew Maclean committed Feb 08, 2005 75 76  // Duvw are the derivatives of this point with respect to u, v and w. // Pt, Duvw are obtained from Evaluate().  Will Schroeder committed Jan 24, 2005 77 78  // // This function is only called if the ScalarMode has the value  Andrew Maclean committed Mar 05, 2005 79  // vtkParametricFunctionSource::SCALAR_FUNCTION_DEFINED  Will Schroeder committed Jan 24, 2005 80  //  VTK Developers committed Apr 09, 2012 81 82  // If the user does not need to calculate a scalar, then the // instantiated function should return zero.  Will Schroeder committed Jan 24, 2005 83  //  Robert Maynard committed Sep 23, 2016 84  double EvaluateScalar(double uvw[3], double Pt[3], double Duvw[9]) VTK_OVERRIDE;  Will Schroeder committed Jan 24, 2005 85 86 87  protected: vtkParametricKlein();  Robert Maynard committed Sep 23, 2016 88  ~vtkParametricKlein() VTK_OVERRIDE;  Will Schroeder committed Jan 24, 2005 89 90  private:  Sean McBride committed Jul 07, 2016 91  vtkParametricKlein(const vtkParametricKlein&) VTK_DELETE_FUNCTION;  Sean McBride committed Jul 07, 2016 92  void operator=(const vtkParametricKlein&) VTK_DELETE_FUNCTION;  Will Schroeder committed Jan 24, 2005 93 94 95 }; #endif