All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Member Functions
QGpCoreTools::Plane Class Reference

A geometrical plane. More...

#include <Plane.h>

List of all members.

Public Member Functions

 Plane ()
 Plane (const Point &normal, const Point &reference)
 Plane (const Plane &o)
bool setNormalVector ()
void setNormalVectorXY ()
void setReference (int index, const Point &p)
void setZ (int index, double z)
double z (const Point &at)

Detailed Description

A geometrical plane.

A geometrical plane optimized to return the interpolated z at any postion.


Constructor & Destructor Documentation

{_d=0.0;}
QGpCoreTools::Plane::Plane ( const Point normal,
const Point reference 
)
{
  _normalVector=normal;
  _references[0]=reference;
  _d=d();
}
{
  _references[0]=o._references[0];
  _references[1]=o._references[1];
  _references[2]=o._references[2];
  _directionalVector[0]=o._directionalVector[0];
  _directionalVector[1]=o._directionalVector[1];
  _normalVector=o._normalVector;
  _d=o._d;
}

Member Function Documentation

Calculates internal normal vector from 3 references

References QGpCoreTools::endl(), setNormalVectorXY(), QGpCoreTools::Point2D::setX(), QGpCoreTools::Point2D::setY(), QGpCoreTools::Point::setZ(), QGpCoreTools::App::stream(), and QGpCoreTools::tr().

Referenced by QGpCoreWave::Seismic1DModel::interpole(), and DinverDCCore::TargetList2D::setParamProfiles().

{
  if(_references[0]==_references[1] ||
     _references[0]==_references[2] ||
     _references[1]==_references[2]) {
    App::stream() << tr("Some reference points have the same coordinates:\n"
                        "  %1\n  %2\n  %3")
                     .arg(_references[0].toString())
                     .arg(_references[1].toString())
                     .arg(_references[2].toString()) << endl;
    return false;
  } else {
    _directionalVector[0].setX(_references[0].x()-_references[1].x());
    _directionalVector[1].setX(_references[0].x()-_references[2].x());
    _directionalVector[0].setY(_references[0].y()-_references[1].y());
    _directionalVector[1].setY(_references[0].y()-_references[2].y());
    _normalVector.setZ(_directionalVector[0].x()*_directionalVector[1].y()-
                       _directionalVector[0].y()*_directionalVector[1].x());
    setNormalVectorXY();
    return true;
  }
}

Calculates internal normal vector from 3 references, valid only after altering z components from references points.

References QGpCoreTools::Point2D::setX(), QGpCoreTools::Point2D::setY(), QGpCoreTools::Point::setZ(), and z().

Referenced by QGpCoreWave::Seismic1DModel::interpole(), and setNormalVector().

{
  _directionalVector[0].setZ(_references[0].z()-_references[1].z());
  _directionalVector[1].setZ(_references[0].z()-_references[2].z());
  _normalVector.setX(_directionalVector[0].y()*_directionalVector[1].z()-
                     _directionalVector[0].z()*_directionalVector[1].y());
  _normalVector.setY(_directionalVector[1].x()*_directionalVector[0].z()-
                     _directionalVector[1].z()*_directionalVector[0].x());
  _d=d();
}
void QGpCoreTools::Plane::setReference ( int  index,
const Point p 
) [inline]

Referenced by QGpCoreWave::Seismic1DModel::interpole(), and DinverDCCore::TargetList2D::setParamProfiles().

{ASSERT(index<3); _references[index]=p;}
void QGpCoreTools::Plane::setZ ( int  index,
double  z 
) [inline]

index ranges from 0 to 2. setNormalVectorXY() must be called whenever z is changed.

Referenced by QGpCoreWave::Seismic1DModel::interpole().

{ASSERT(index<3); _references[index].setZ(z);}
double QGpCoreTools::Plane::z ( const Point at) [inline]

Returns the z value at at, only (x, y) are considered in at.

References TRACE, QGpCoreTools::Point2D::x(), QGpCoreTools::Point2D::y(), and QGpCoreTools::Point::z().

Referenced by QGpCoreWave::Seismic1DModel::interpole(), and setNormalVectorXY().

{
  TRACE;
  return (_d-_normalVector.x()*at.x()-_normalVector.y()*at.y())/_normalVector.z();
}

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