cgma
HexVolume Class Reference
Inheritance diagram for HexVolume:
SurfaceVolume

List of all members.

Public Member Functions

 HexVolume (const Vector3d &center_p, const Vector3d &h_p, const Vector3d &r_p, const Vector3d &s_p, const Vector3d &t_p)
 HexVolume (const Vector3d &center_p, const Vector3d &h_p, const Vector3d &r_p)
virtual double getFarthestExtentFromOrigin () const

Protected Member Functions

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

Protected Attributes

Vector3d base_center
Vector3d heightV
Vector3d RV
Vector3d SV
Vector3d TV

Detailed Description

Definition at line 692 of file volumes.cpp.


Constructor & Destructor Documentation

HexVolume::HexVolume ( const Vector3d center_p,
const Vector3d h_p,
const Vector3d r_p,
const Vector3d s_p,
const Vector3d t_p 
) [inline]

Definition at line 700 of file volumes.cpp.

                                                        :
    base_center(center_p), heightV(h_p), RV(r_p), SV(s_p), TV(t_p)
  {}
HexVolume::HexVolume ( const Vector3d center_p,
const Vector3d h_p,
const Vector3d r_p 
) [inline]

Definition at line 705 of file volumes.cpp.

                                                                                  :
    base_center(center_p), heightV(h_p), RV(r_p), SV( r_p.rotate_about(h_p,60.0) ), TV( r_p.rotate_about(h_p,120.0) )
  {
    if( OPT_DEBUG ){ 
      std::cout << "Inferred vectors for 9-args HEX/RHP:" << RV << SV << TV << std::endl;
    }
  }

Member Function Documentation

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

Implements SurfaceVolume.

Definition at line 713 of file volumes.cpp.

                                                       { 
    double hex_max = std::max( RV.length(), std::max( SV.length(), TV.length() ) );
    return base_center.length() + heightV.length() + hex_max; 
  }
virtual iBase_EntityHandle HexVolume::getHandle ( bool  positive,
iGeom_Instance igm,
double  world_size 
) [inline, protected, virtual]

Implements SurfaceVolume.

Definition at line 719 of file volumes.cpp.

                                                                                               {
    int igm_result;
    iBase_EntityHandle hex;

    hex = makeWorldSphere( igm, world_size );

    Vector3d b = - heightV.normalize();
    iGeom_sectionEnt( igm, hex, b.v[0], b.v[1], b.v[2], 0, true, &hex, &igm_result );
    CHECK_IGEOM( igm_result, "Sectioning world for a hex (1)" );

    b = -b;
    iGeom_sectionEnt( igm, hex, b.v[0], b.v[1], b.v[2], heightV.length(), true, &hex, &igm_result );
    CHECK_IGEOM( igm_result, "Sectioning world for a hex (2)" );


    
    const Vector3d* vec[3] = {&RV, &SV, &TV};
    for( int i = 0; i < 3; ++i ){
      Vector3d v = *(vec[i]);
      double length = v.length(); 
      v = v.normalize();
      
      iGeom_sectionEnt( igm, hex, v.v[0], v.v[1], v.v[2], length, true, &hex, &igm_result );
      CHECK_IGEOM( igm_result, "Sectioning world for a hex (3)" );
      
      v = -v;
      iGeom_sectionEnt( igm, hex, v.v[0], v.v[1], v.v[2], length, true, &hex, &igm_result );
      CHECK_IGEOM( igm_result, "Sectioning world for a hex (4)" );
      

    }

    iGeom_moveEnt( igm, hex, base_center.v[0], base_center.v[1], base_center.v[2], &igm_result );
    CHECK_IGEOM( igm_result, "Moving hex" );

    iBase_EntityHandle final_hex = embedWithinWorld( positive, igm, world_size, hex, false );
    return final_hex;

  }

Member Data Documentation

Definition at line 695 of file volumes.cpp.

Definition at line 696 of file volumes.cpp.

Vector3d HexVolume::RV [protected]

Definition at line 696 of file volumes.cpp.

Vector3d HexVolume::SV [protected]

Definition at line 696 of file volumes.cpp.

Vector3d HexVolume::TV [protected]

Definition at line 696 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