MOAB: Mesh Oriented datABase  (version 5.4.1)
MBMesquite::MsqCommonIGeom Class Reference

Common code for specific implementations of MeshDomain on ITAPS interfaces. More...

#include <MsqIGeom.hpp>

+ Inheritance diagram for MBMesquite::MsqCommonIGeom:
+ Collaboration diagram for MBMesquite::MsqCommonIGeom:

Public Member Functions

 MsqCommonIGeom (iGeom_Instance geom)
virtual ~MsqCommonIGeom ()
int move_to (iBase_EntityHandle geom_handle, Vector3D &coord) const
int normal (iBase_EntityHandle geom_handle, Vector3D &coord) const
int normal (iBase_EntityHandle geom_handle, Vector3D coords[], unsigned count) const
int normal (const iBase_EntityHandle geom_handles[], Vector3D coords[], unsigned count) const
int closest_and_normal (iBase_EntityHandle geom_handle, const Vector3D &position, Vector3D &closest, Vector3D &normal) const
int get_dimension (iBase_EntityHandle const *geom_handle, unsigned short *dof_out, size_t count) const

Public Attributes

iGeom_Instance geomIFace

Private Attributes

std::vector< iBase_EntityHandlegeomHandles
std::vector< double > coordArray
std::vector< int > typeArray

Detailed Description

Common code for specific implementations of MeshDomain on ITAPS interfaces.

This class contains the common functionality used by concrete implementations of MeshDomain on the ITAPS geometry interface.

Definition at line 49 of file MsqIGeom.hpp.


Constructor & Destructor Documentation

Parameters:
geomThe ITAPS geometry interface implementation to query

Definition at line 104 of file MsqIGeom.cpp.

: geomIFace( geom ) {}

Definition at line 106 of file MsqIGeom.cpp.

{}

Member Function Documentation

int MBMesquite::MsqCommonIGeom::closest_and_normal ( iBase_EntityHandle  geom_handle,
const Vector3D position,
Vector3D closest,
Vector3D normal 
) const

Given a geometric entity and a position, get point on the geometric entity closest to the input position, and the surface normal at that position.

Definition at line 154 of file MsqIGeom.cpp.

References geomIFace, and ierr.

Referenced by MBMesquite::MsqIRel::closest_point(), and MBMesquite::MsqIGeom::closest_point().

{
    int ierr;
    iGeom_getEntNrmlPlXYZ( geomIFace, geom, position[0], position[1], position[2], &closest[0], &closest[1],
                           &closest[2], &p_normal[0], &p_normal[1], &p_normal[2], &ierr );
    return ierr;
}
int MBMesquite::MsqCommonIGeom::get_dimension ( iBase_EntityHandle const *  geom_handle,
unsigned short *  dof_out,
size_t  count 
) const

Definition at line 165 of file MsqIGeom.cpp.

References MBMesquite::arrptr(), geomIFace, ierr, and typeArray.

Referenced by MBMesquite::MsqIGeom::domain_DoF().

{
    int ierr;
    typeArray.resize( count );

    // define junk variables required for ITAPS "consistancy"
    int junk_1 = count, junk_2 = count;
    int* type_ptr = arrptr( typeArray );

    // get the types
    iGeom_getArrType( geomIFace, geom_handle, count, &type_ptr, &junk_1, &junk_2, &ierr );

    // convert from int to unsigned short
    std::copy( typeArray.begin(), typeArray.end(), dof_out );
    return ierr;
}
int MBMesquite::MsqCommonIGeom::move_to ( iBase_EntityHandle  geom_handle,
Vector3D coord 
) const

Evaluate the closest point to the input position on the specified geometric entity and return the result in the passed position argument (move the passed position onto the geometry.)

Definition at line 108 of file MsqIGeom.cpp.

References geomIFace, ierr, MBMesquite::Vector3D::set(), and z.

Referenced by MBMesquite::MsqIRel::snap_to(), and MBMesquite::MsqIGeom::snap_to().

{
    double x, y, z;
    int ierr;
    iGeom_getEntClosestPt( geomIFace, geom, coord[0], coord[1], coord[2], &x, &y, &z, &ierr );
    coord.set( x, y, z );
    return ierr;
}
int MBMesquite::MsqCommonIGeom::normal ( iBase_EntityHandle  geom_handle,
Vector3D coord 
) const

Given a geometric entity and a position, evaluate the normal on the geometric entity at the closest point on that entity to the input position, and pass back the result in the input coord vector.

Definition at line 117 of file MsqIGeom.cpp.

References geomIFace, ierr, and MBMesquite::Vector3D::set().

Referenced by MBMesquite::MsqIGeom::element_normal_at(), normal(), MBMesquite::MsqIRel::vertex_normal_at(), and MBMesquite::MsqIGeom::vertex_normal_at().

{
    double i, j, k;
    int ierr;
    iGeom_getEntNrmlXYZ( geomIFace, geom, coord[0], coord[1], coord[2], &i, &j, &k, &ierr );
    coord.set( i, j, k );
    return ierr;
}
int MBMesquite::MsqCommonIGeom::normal ( iBase_EntityHandle  geom_handle,
Vector3D  coords[],
unsigned  count 
) const

Given a geometric entity and a position, evaluate the normal on the geometric entity at the closest point on that entity to the input position, and pass back the result in the input coord vector.

Definition at line 126 of file MsqIGeom.cpp.

References MBMesquite::arrptr(), geomHandles, and normal().

{
    geomHandles.resize( count, geom );
    return normal( arrptr( geomHandles ), coords, count );
}
int MBMesquite::MsqCommonIGeom::normal ( const iBase_EntityHandle  geom_handles[],
Vector3D  coords[],
unsigned  count 
) const

Given a geometric entity and a position, evaluate the normal on the geometric entity at the closest point on that entity to the input position, and pass back the result in the input coord vector.


Member Data Documentation

std::vector< double > MBMesquite::MsqCommonIGeom::coordArray [mutable, private]

Definition at line 99 of file MsqIGeom.hpp.

Reimplemented in MBMesquite::MsqIRel.

Definition at line 98 of file MsqIGeom.hpp.

Referenced by normal().

std::vector< int > MBMesquite::MsqCommonIGeom::typeArray [mutable, private]

Definition at line 100 of file MsqIGeom.hpp.

Referenced by get_dimension().

List of all members.


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