cgma
PeriodicParamTool Class Reference

#include <PeriodicParamTool.hpp>

Inheritance diagram for PeriodicParamTool:
ParamTool

List of all members.

Public Member Functions

 PeriodicParamTool (Surface *surf)
 ~PeriodicParamTool ()
CubitStatus set_up_space (double u_period, double v_period, double u_offset, double v_offset)
CubitStatus transform_to_uv (const CubitVector &xyz_location, CubitVector &uv_location)
CubitStatus transform_to_xyz (CubitVector &xyz_location, const CubitVector &uv_location)
void mirror_surface (bool true_false)
CubitStatus uv_derivitives (double u_param, double v_param, CubitVector &du, CubitVector &dv)

Private Attributes

SurfacerefSurf
double uPeriod
double vPeriod
double uOffset
double vOffset
bool mirrorSurface

Detailed Description

Definition at line 26 of file PeriodicParamTool.hpp.


Constructor & Destructor Documentation

Definition at line 28 of file PeriodicParamTool.cpp.

{
    //- update private variables
    refSurf = surf;
    uOffset = 0.0;
    vOffset = 0.0;
  uPeriod = 0.0;
  vPeriod = 0.0;
  mirrorSurface = false;

}

Member Function Documentation

void PeriodicParamTool::mirror_surface ( bool  true_false)

Definition at line 134 of file PeriodicParamTool.cpp.

{
  mirrorSurface = true_false;
  if (mirrorSurface)
    PRINT_INFO("Loops appear backwards, mirroring surface...\n");
 
}
CubitStatus PeriodicParamTool::set_up_space ( double  u_period,
double  v_period,
double  u_offset,
double  v_offset 
)

Definition at line 54 of file PeriodicParamTool.cpp.

{
    // store the u and periods 

    uPeriod = u_period;
    vPeriod = v_period;
    uOffset = u_offset;
    vOffset = v_offset;

    
    CubitStatus rv = CUBIT_SUCCESS;

    return rv; 
}
CubitStatus PeriodicParamTool::transform_to_uv ( const CubitVector xyz_location,
CubitVector uv_location 
) [virtual]

Implements ParamTool.

Definition at line 75 of file PeriodicParamTool.cpp.

{
     
    double u,v;

    CubitStatus rv = refSurf->u_v_from_position(xyz_location, u, v);

    // offset values to avoid parameter discontinuity

    if (uPeriod && u < uOffset)
    {
        u += uPeriod;
    }
  
  // mirror surface if required to get correct loop orientation
  if (mirrorSurface)
  {
    u = -u;
  }

    if (vPeriod && v < vOffset)
    {
        v += vPeriod;
    }

    uv_location.set(u,v,1.0);


    return rv;
}
CubitStatus PeriodicParamTool::transform_to_xyz ( CubitVector xyz_location,
const CubitVector uv_location 
) [virtual]

Implements ParamTool.

Definition at line 112 of file PeriodicParamTool.cpp.

{
    double u = uv_location.x(); 
  if (mirrorSurface)
  {
    u = -u;
  }
    if (u > uPeriod)
    {
        u = u - uPeriod;
    }
    double v = uv_location.y();
    if (v > vPeriod)
    {
        v = v - vPeriod;
    }
    xyz_location = refSurf->position_from_u_v(u,v);


    return CUBIT_SUCCESS;
}
CubitStatus PeriodicParamTool::uv_derivitives ( double  u_param,
double  v_param,
CubitVector du,
CubitVector dv 
) [virtual]

Reimplemented from ParamTool.

Definition at line 142 of file PeriodicParamTool.cpp.

{
  if (mirrorSurface)
    u_param = -u_param;
  if (u_param > uPeriod)
    u_param = u_param-uPeriod;
  if (v_param > vPeriod)
    v_param = v_param-vPeriod;
  refSurf->uv_derivitives(u_param, v_param, du, dv);
  return CUBIT_SUCCESS;
}

Member Data Documentation

Definition at line 54 of file PeriodicParamTool.hpp.

Definition at line 49 of file PeriodicParamTool.hpp.

double PeriodicParamTool::uOffset [private]

Definition at line 52 of file PeriodicParamTool.hpp.

double PeriodicParamTool::uPeriod [private]

Definition at line 50 of file PeriodicParamTool.hpp.

double PeriodicParamTool::vOffset [private]

Definition at line 53 of file PeriodicParamTool.hpp.

double PeriodicParamTool::vPeriod [private]

Definition at line 51 of file PeriodicParamTool.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines