////////////////////////////////////////////////////////////////////////////// //文件: SegY文件操作类 //主要功能: // 三维地震测网信息定义,完成线道号与坐标的相互转换工作 // //程序编写: 2011-4-1 // // ///////////////////////////////////////////////////////////////////////////// #pragma once #include "RowColRange.h" #include "CoorTransform.h" #include "SeisSampleInfo.h" #include "SeisSurvey2D.h" namespace NSeis { enum EOrientation { oriInline = 0, oriCrossline = 1, oriZslice = 2, oriRandline = 3 //仅在CSeisLineData中使用 }; //! Defines policy for 2D and 3D Data type enum EPolicy2D3D { polOnly3D = 0, polBoth2DAnd3D = 1, polOnly2D = 2 }; enum EAreaStyle { areaWork = 0x00000001, //使用工作区 areaSnapStep = 0x00000002, //按照整步长计算 areaAutoDelete = 0x00000004, //是否自动删除 }; //三维地震测网信息,包括该测网的: // 1、坐标与线道号的相互转换 // 2、经纬度定义信息 // 3、内部包括两个体:用户显示的线道号及Z方向范围及步长(工作体),测网体 class AFX_EXT_CLASS CSeisSurvey3D { public: CSeisSurvey3D(void); ~CSeisSurvey3D(void); public: CPoint2D toXY(int row, int col) { return m_b2c.toXY(row, col); } CPoint2D toXY( const CRowCol& rc ) { return m_b2c.toXY(rc); } CPoint2D toXY( const CPoint2D& rc ) { return m_b2c.toXY(rc.x0, rc.y0); } CRowCol toRC( const CPoint2D& pt ); CRowCol toRC( double x, double y ); CPoint2D toRCF( const CPoint2D& pt ); CPoint2D toRCF( double x, double y ); void toRCF( CCurve& cv, bool bAutoLocation = true ); //将实际坐标转换为线道号坐标 void toXY( CCurve& cv, bool bAutoLocation = true ); //将线道号坐标转换为实际坐标 CRowCol RCF2RC( const CPoint2D& pt ); /*!<\note CRowCol will be snapped using work step. */ //////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////// //Start Work bool IsWork() { return (m_nFlags & areaWork) ? true:false; } void EnableWork(bool bWork); //根据EnableWork设定的状态获得是整个工区还是工作工区的参数 TIntervalStep inlRange(); TIntervalStep crlRange(); TIntervalStep& zRange(); CCubeRange& GetCubeRange() { return IsWork() ? m_workCube : m_surveyCube; } void GetRange(CPoint3D& minpt, CPoint3D& maxpt); CPoint3D minCoord(); CPoint3D maxCoord(); bool isInside(const CRowCol&) const; void WriteSurvey(LPCTSTR lpszFileName); //生成实际二维曲线 bool GetSurvey2D(CSeisSurvey2D& sd, LPCTSTR lpszInlHead = NULL, LPCTSTR lpszCrlHead = NULL); //End Work //////////////////////////////////////////////////////////////////////////////////////// int inlSnap(double row); int crlSnap(double col); float zSnap(double z); int inlStep() const; int crlStep() const; float zStep() const; double inlDistance(); //!< 获得实际线间隔步长,单位:米…… double crlDistance(); //!< 获得实际道间隔步长,单位:米…… void Write(CFile& fw, const short& ver); int Read(CFile& fr, const short& ver); void Serialize(CArchive& ar, const short &ver); public: void setWorkRange(const CCubeRange& cr); //!< 根据坐标设置工作范围 //!< 参数: bGetSnapPoint 是否根据整步长线道号设置最大最小范围坐标 void setWorkRangeXY(CPoint3D& ptMin, CPoint3D& ptMax, bool bGetSnapPoint=false); void setWorkRangeRC(CPoint3D& ptMin, CPoint3D& ptMax, bool bGetSnapPoint=false); bool IsSnapStep() { return (m_nFlags & areaSnapStep) ? true:false; } void EnableSnapStep(bool bSnap); /*!< Orientation is determined by rotating the inline axis to the crossline axis. */ bool isClockWise() const; /*!< It's the angle (0 to pi/2) between the X-axis and the Inline-axis (not an inline) */ double computeAngleXInl(); /*!