////////////////////////////////////////////////////////////////////////////// //文件: SegY文件操作类 //主要功能: // //程序编写: 2011-4-21 // // ///////////////////////////////////////////////////////////////////////////// #pragma once #include "rowcol.h" #include "TInterval.h" namespace NCube { //线道号范围类,用户有可能需要设置线道号显示范围或设置线道号步长 //当在2D剖面中使用时,线号将相等 class AFX_EXT_CLASS CRowColRange { public: CRowColRange(void); ~CRowColRange(void); TIntervalStep getInlRange(); TIntervalStep getCrlRange(); void setInlRange(const TIntervalStep& inl); void setCrlRange(const TIntervalStep& crl); void getRange(TIntervalStep& inl, TIntervalStep& crl) const; int getInlWidth() { return (stop.row-start.row)/step.row + 1; } int getCrlWidth() { return (stop.col-start.col)/step.col + 1; } int atInlIndex( int idx ) { return start.row + step.row * idx; } int atCrlIndex( int idx ) { return start.col + step.col * idx; } int nearestInlIndex( const double& t ) const; int nearestCrlIndex( const double& t ) const; int snapInl( const double& t ); int snapCrl( const double& t ); void Normalise(); //!< Makes sure start= start.row && inl <= stop.row && !( (inl-start.row) % step.row ); } inline bool IsCrosslineOK( int crl ) const { return crl >= start.col && crl <= stop.col && !( (crl-start.col) % step.col ); } inline bool IsInlineOK( float inl ) const { if(inlstop.row) return false; return true; } inline bool IsCrosslineOK( float crl ) const { if(crlstop.col) return false; return true; } protected: bool Intersect( int start1, int stop1, int step1, int start2, int stop2, int step2, int& outstart, int& outstop, int& outstep ); public: CRowCol start; CRowCol stop; CRowCol step; }; //数据体范围 class AFX_EXT_CLASS CCubeRange : public CRowColRange { public: CCubeRange(); ~CCubeRange(); void Normalise(); //!< Makes sure start zRange; }; }//namespace using namespace NCube;