cgma
TorusSurface Class Reference
Inheritance diagram for TorusSurface:
SurfaceVolume

List of all members.

Public Member Functions

 TorusSurface (axis_t axis_p, const Vector3d &center_p, double A, double B, double C)
virtual double getFarthestExtentFromOrigin () const

Protected Member Functions

virtual iBase_EntityHandle getHandle (bool positive, iGeom_Instance &igm, double world_size)

Protected Attributes

Vector3d center
axis_t axis
double radius
double ellipse_axis_rad
double ellipse_perp_rad

Detailed Description

Definition at line 328 of file volumes.cpp.


Constructor & Destructor Documentation

TorusSurface::TorusSurface ( axis_t  axis_p,
const Vector3d center_p,
double  A,
double  B,
double  C 
) [inline]

Definition at line 338 of file volumes.cpp.

                                                                                        :
    center(center_p), axis( axis_p ), radius(A), ellipse_axis_rad( B ), ellipse_perp_rad( C )
  {}

Member Function Documentation

virtual double TorusSurface::getFarthestExtentFromOrigin ( ) const [inline, virtual]

Implements SurfaceVolume.

Definition at line 342 of file volumes.cpp.

                                                       {
    return center.length() + radius + std::max( ellipse_axis_rad, ellipse_perp_rad );
  }
virtual iBase_EntityHandle TorusSurface::getHandle ( bool  positive,
iGeom_Instance igm,
double  world_size 
) [inline, protected, virtual]

Implements SurfaceVolume.

Definition at line 347 of file volumes.cpp.

                                                                                               {

    int igm_result;

    iBase_EntityHandle torus;

    iGeom_createTorus( igm, radius, ellipse_perp_rad, &torus, &igm_result );
    CHECK_IGEOM( igm_result, "Creating initial torus");

    if( ellipse_axis_rad != ellipse_perp_rad ){
      double scalef = ellipse_axis_rad / ellipse_perp_rad;
      iGeom_scaleEnt( igm, torus, 0, 0, 0, 1.0, 1.0, scalef, &igm_result );
      CHECK_IGEOM( igm_result, "Scaling torus" );
    }
    
    if( axis == X ){
      iGeom_rotateEnt( igm, torus, 90, 0, 1, 0, &igm_result );
      CHECK_IGEOM( igm_result, "rotating torus (X)" );
    }
    else if( axis == Y ){
      iGeom_rotateEnt( igm, torus, -90, 1, 0, 0, &igm_result );
      CHECK_IGEOM( igm_result, "rotating torus (Y)" );
    }

    iGeom_moveEnt( igm, torus, center.v[0], center.v[1], center.v[2], &igm_result);
    CHECK_IGEOM( igm_result, "moving torus to its center point" );
    
    
    iBase_EntityHandle final_torus = embedWithinWorld( positive, igm, world_size, torus, false );

    return final_torus;

  }

Member Data Documentation

Definition at line 332 of file volumes.cpp.

Definition at line 331 of file volumes.cpp.

double TorusSurface::ellipse_axis_rad [protected]

Definition at line 334 of file volumes.cpp.

double TorusSurface::ellipse_perp_rad [protected]

Definition at line 335 of file volumes.cpp.

double TorusSurface::radius [protected]

Definition at line 333 of file volumes.cpp.


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