|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
//文件: 剖面与平面测线类
|
|
|
//主要功能:
|
|
|
// 实现在平面测线上显示一条绑定的剖面图,剖面图的x坐标与平面测线的L相同
|
|
|
// 进行插值平面坐标
|
|
|
//程序编写: 2011-11-28
|
|
|
//
|
|
|
//
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
#pragma once
|
|
|
#include "MxnFormat/AttachBase.h"
|
|
|
#include "MxnFormat/Texture.h"
|
|
|
#include "CurveEx.h"
|
|
|
|
|
|
namespace N3D
|
|
|
{
|
|
|
|
|
|
//为了将一幅平面图按照材质生成方式显示到三维空间
|
|
|
class AFX_EXT_CLASS C3DMapTexture : public CAttachBase
|
|
|
{
|
|
|
public:
|
|
|
C3DMapTexture(void);
|
|
|
virtual ~C3DMapTexture(void);
|
|
|
|
|
|
void* GetSection() { return GetInput();} //指向一个CXy对象,该对象是一个完整的剖面图件
|
|
|
void operator = (C3DMapTexture& cs);
|
|
|
|
|
|
virtual void Clear();
|
|
|
virtual void GetRange(CPoint3D& minPoint, CPoint3D& maxPoint);
|
|
|
|
|
|
virtual void Serialize(CArchive& ar, const short &ver);
|
|
|
virtual void Write(CFile &fw, const short& ver);
|
|
|
virtual int Read(CFile& fr, const short& ver);
|
|
|
|
|
|
//根据指定的高宽生成图像,并将剖面内容显示的图像上生成绑定的材质
|
|
|
//为-1时自动获得高宽
|
|
|
bool CreateTexture(CTexture& tx);
|
|
|
void SetTextureSize(CSize sz) { m_size = sz; }
|
|
|
CSize GetTextureSize(void) { return m_size; }
|
|
|
|
|
|
void LoadSection(LPCTSTR strFileName);
|
|
|
|
|
|
protected:
|
|
|
//要显示的剖面图,剖面的X坐标与m_pCoor曲线l相对应,从而插值空间坐标xy
|
|
|
CString m_strSectionName;
|
|
|
CSize m_size;
|
|
|
};
|
|
|
|
|
|
//将一幅剖面图结合设置的平面测线显示到三维空间
|
|
|
class AFX_EXT_CLASS C3DCurveSection
|
|
|
: public CCurveEx
|
|
|
, public C3DMapTexture
|
|
|
{
|
|
|
public:
|
|
|
C3DCurveSection(void);
|
|
|
~C3DCurveSection(void);
|
|
|
|
|
|
virtual void Clear();
|
|
|
virtual void Serialize(CArchive& ar, const short &ver);
|
|
|
virtual void GetRange(CPoint3D& minPoint, CPoint3D& maxPoint);
|
|
|
|
|
|
virtual void Write(CFile &fw, const short& ver);
|
|
|
virtual int Read(CFile& fr, const short& ver);
|
|
|
|
|
|
//获得剖面对应的平面曲线坐标,需要从对应测线中插值得到,返回曲线节点个数
|
|
|
int GetSectionCurve(CCurveEx* pc, bool bIsMaxZ0 = false);
|
|
|
//leftLocation rightLocation对应的是剖面的左边X值与右边X值,为曲线的桩号坐标
|
|
|
int GetSectionCurve(CCurveEx* pc, double leftLocation, double rightLocation);
|
|
|
|
|
|
void operator = (C3DCurveSection& cs);
|
|
|
|
|
|
bool GetTraceCoord(double xTraceCDP, dfPoint& pt); //获得指定道的坐标
|
|
|
};
|
|
|
|
|
|
}//namesapce
|
|
|
|
|
|
using namespace N3D;
|