MOAB: Mesh Oriented datABase  (version 5.4.1)
PatchScale Class Reference
+ Inheritance diagram for PatchScale:
+ Collaboration diagram for PatchScale:

Public Member Functions

 PatchScale (double s)
virtual ~PatchScale ()
virtual void xform (PatchData &pd, PlanarDomain *dom)
virtual void xform_grad (std::vector< Vector3D > &)

Private Attributes

double scaleFactor

Detailed Description

Definition at line 1477 of file QualityMetricTester.cpp.


Constructor & Destructor Documentation

PatchScale::PatchScale ( double  s) [inline]

Definition at line 1482 of file QualityMetricTester.cpp.

: scaleFactor( s ) {}
PatchScale::~PatchScale ( ) [virtual]

Definition at line 1488 of file QualityMetricTester.cpp.

{}

Member Function Documentation

void PatchScale::xform ( PatchData pd,
PlanarDomain dom 
) [virtual]

Implements QualityMetricTester::PatchXform.

Definition at line 1489 of file QualityMetricTester.cpp.

References CPPUNIT_ASSERT, geom, MBMesquite::PatchData::get_domain(), MBMesquite::PlanarDomain::get_normal(), MBMesquite::PlanarDomain::get_origin(), MBMesquite::PatchData::num_nodes(), scaleFactor, MBMesquite::PatchData::set_domain(), MBMesquite::PlanarDomain::set_plane(), MBMesquite::PatchData::set_vertex_coordinates(), and MBMesquite::PatchData::vertex_by_index().

{
    // If patch has associated planar geometry, scale distance from origin
    MeshDomain* geom = pd.get_domain();
    if( geom )
    {
        PlanarDomain* plane = dynamic_cast< PlanarDomain* >( geom );
        CPPUNIT_ASSERT( plane );
        CPPUNIT_ASSERT( dom );

        Vector3D norm  = plane->get_normal();
        Vector3D point = scaleFactor * plane->get_origin();
        dom->set_plane( norm, point );
        pd.set_domain( dom );
    }

    // Scale about origin
    MsqError err;
    for( size_t i = 0; i < pd.num_nodes(); ++i )
        pd.set_vertex_coordinates( pd.vertex_by_index( i ) * scaleFactor, i, err );
}
void PatchScale::xform_grad ( std::vector< Vector3D > &  ) [virtual]

Implements QualityMetricTester::PatchXform.

Definition at line 1510 of file QualityMetricTester.cpp.

{}

Member Data Documentation

double PatchScale::scaleFactor [private]

Definition at line 1479 of file QualityMetricTester.cpp.

Referenced by xform().

List of all members.


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