cgma
PlanarParamTool.cpp
Go to the documentation of this file.
00001 //- Class: PlanarParamTool
00002 //-------------------------------------------------------------------------
00003 // Filename      : PlanarParamTool.cpp
00004 //
00005 // Purpose       : Surface Parameterization for mesh by triangulation flattening
00006 //
00007 // Creator       : Christopher Hynes
00008 //
00009 // Creation Date : 7/10/2002
00010 //
00011 // Owner         : Christopher Hynes
00012 //-------------------------------------------------------------------------
00013 
00014 #include "PlanarParamTool.hpp"
00015 #include "CastTo.hpp"
00016 #include "GeometryDefines.h"
00017 
00018 
00019 //-------------------------------------------------------------------------
00020 // Function:    PlanarParamTool
00021 // Description: constructor
00022 // Author:      chynes
00023 // Date:        7/10/2002
00024 //-------------------------------------------------------------------------
00025 PlanarParamTool::PlanarParamTool()
00026 {
00027 }
00028 
00029 //-------------------------------------------------------------------------
00030 // Function:    PlanarParamTool
00031 // Description: deconstructor
00032 // Author:      chynes
00033 // Date:        7/10/2002
00034 //-------------------------------------------------------------------------
00035 PlanarParamTool::~PlanarParamTool() {}
00036 
00037 //===================================================================================
00038 // Function: set_up_space (Public)
00039 // Description: sets up space of flattening
00040 // Author: chynes
00041 // Date: 7/10/02
00042 //===================================================================================
00043 CubitStatus PlanarParamTool::set_up_space(CubitVector& du, CubitVector& dv, CubitVector& uv_center)
00044 {
00045         Du = du;
00046         Dv = dv;
00047         uvCenter = uv_center;
00048 
00049     return CUBIT_SUCCESS; 
00050 }
00051 
00052 //===================================================================================
00053 // Function: transform_to_uv (Public)
00054 // Description: same as title
00055 // Author: chynes
00056 // Date: 7/10/02
00057 //===================================================================================
00058 CubitStatus PlanarParamTool::transform_to_uv(const CubitVector &xyz_location, CubitVector &uv_location) 
00059 {
00060   // Translate to local origin at center
00061 
00062   CubitVector vect = xyz_location - uvCenter;
00063 
00064    // Multiply by transpose (inverse) of transformation vector
00065 
00066   uv_location.x( vect % Du );
00067   uv_location.y( vect % Dv );
00068   uv_location.z( 0.0 );
00069 
00070   return CUBIT_SUCCESS;
00071 }
00072 
00073 //===================================================================================
00074 // Function: transform_to_xyz (Public)
00075 // Description: same as title
00076 // Author: chynes
00077 // Date: 7/10/02
00078 //===================================================================================
00079 CubitStatus PlanarParamTool::transform_to_xyz(CubitVector &xyz_location, const CubitVector &uv_location) 
00080 {
00081 // Multiply by transformation matrix
00082 
00083   CubitVector vect;
00084   vect.x( uv_location.x() * Du.x() +
00085           uv_location.y() * Dv.x() );
00086   vect.y( uv_location.x() * Du.y() +
00087           uv_location.y() * Dv.y() );
00088   vect.z( uv_location.x() * Du.z() +
00089           uv_location.y() * Dv.z() );
00090 
00091    // Translate from origin
00092 
00093   xyz_location = vect + uvCenter;
00094 
00095   return CUBIT_SUCCESS;
00096 }
00097 
00098 CubitStatus PlanarParamTool::uv_derivitives( double u_param, double v_param, 
00099                                                  CubitVector &du, CubitVector &dv )
00100 {
00101   (void)u_param;
00102   (void)v_param;
00103   du = Du;
00104   dv = Dv;
00105   return CUBIT_SUCCESS;
00106 }
00107 
00108 //EOF
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines