#pragma once #include "xjobject.h" #include "AlgoPeriodicLattice.h" #include "OMUndoRedo.h" class XJ_OM_EXPORT OMPeriodicLattice : public CXJObject { public: friend class CXJObjectManager; friend class CXJObjectGroup; //加载文件 int LoadData(const char* fname, bool isOffset); //保存文件 int SaveData(const char* fname); //创建 int Create(unsigned int numx, unsigned int numy, double x0, double y0, double dx, double dy, double* values); //设置Z值范围 void SetZRange(double zMin, double zMax); //设置颜色 void SetColorList(const std::vector& colorList); //设置等值线 void SetContourList(const std::vector& contourList); //设置断层线 void SetFaultList(const std::vector& faultList, bool isOffset); //设置控制点 void SetControlPointList(const std::vector& pointList); //设置边界线 void SetBound(const PlineList& bound); void SetOtherLines(const PlineList& lines); //更新计算等值线 void UpdateIsopleth(); //设置无效值颜色 void SetInvalidColor(int r, int g, int b); //设置井点颜色 void SetWellColor(int r, int g, int b); const Point3D& GetWellColor() const { return m_wellColor; } void SetWellTxtSize(float size) { m_wellTxtSize = size; } float GetWellTxtSize() { return m_wellTxtSize; } double* GetValue(); double GetZMin() const; double GetZMax() const; void GetContourList(std::vector& contourList); const AlgoPeriodicLattice* GetData() const {return m_periodicLattice;} void GetVerData(std::vector& data); void BrushMesh(const Point3D& cen, float rad, float per, int type, float wellrad = 0); void DuabMesh(const Point3D& cen1, const Point3D& cen2, float rad, float per, int type, float wellrad = 0); void SmoothMesh(const Point3D& cen, float rad, float per, int type, float wellrad = 0); void ShowIsopleth(bool bFlag); bool IsShowIsopleth() const { return m_bShowIsopleth; } void ShowFault(bool bFlag); bool IsShowFault() const { return m_bShowFault; } void ShowControlPoint(bool bFlag); bool IsShowControlPoint() const {return m_bShowControlPoint;} void ShowBound(bool bFlag); bool IsShowBound() const { return m_bShowBound; } void ShowOtherLines(bool bFlag); bool IsShowOtherLines() const { return m_bShowOtherLine; } void ShowMeshVertex(bool bFlag); bool IsShowVertex() const { return m_bShowVertex; } void ShowFilledFault(bool bFlag); bool IsShowFilledFault() const { return m_bFillFault; } //获取等值线间隔 void GetIsoplethProperty(double& isopStep, int& markStep, double& minIsop, double& maxIsop, double& zMin, double& zMax) const; void SetIsoplethProperty(double isopStep, int markStep, double minIsop, double maxIsop, double zMin, double zMax); //表达式合法检测 bool CompileExpressionZ(const char* expression); //计算Z值 bool CalculateZByExpression(const char* expression); //优化等值线 void OptimizeIsopleths(); //内缩断层区域 void OffsetFault(); //求最近点 double GetNearPoint(Point2D& pt); //井点匹配 void AdjuestWithWellPoint(double rad, double range, double miu); //过滤等值线 void FilterIsopleths(int per); //设置修改范围多边形 void SetPolygon(const std::vector& poly); void StretchlUpPolygon(const std::vector& poly, float per, float wellrad, bool state = false); void SmoothPolygon(const std::vector& poly, float per, float wellrad, bool state = false); //平滑断层 void TransitFault(const Point3D& cen1, const Point3D& cen2, float rad, float per = 0.5f); //**************************对象操作************************ virtual void CopyProperty(const CXJObject* pObj); void ExchangeData(CommandInfo& info, MeshDataInfo& dataInfo); void Clear(); void GetBoundingBox(Point2D& minPt, Point2D& maxPt); void SetDecimalNumber(int num); int GetDecimalNumber(); void SetFaultControlState(bool state); bool GetFaultControlState(); bool RectificationMeshWellCompute(double deltaz, int type = 0, double factor = 1); void MeshWellThreadStop(); int GetMeshWellRectificationProgress(); void UpdataMeshWellRectificationView(); protected: OMPeriodicLattice(void); OMPeriodicLattice(OMPeriodicLattice*obj); ~OMPeriodicLattice(void); virtual OMPeriodicLattice* Copy(); private: AlgoPeriodicLattice* m_periodicLattice; bool m_bShowIsopleth; bool m_bShowFault; bool m_bShowControlPoint; bool m_bShowBound; bool m_bShowOtherLine; bool m_bShowVertex; Point3D m_wellColor; //井口颜色 float m_wellTxtSize; //井口字体大小 bool m_bFillFault; //是否填充断层 };