⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rtview.cpp

📁 自己毕业时做的程序
💻 CPP
字号:
// RTView.cpp : implementation of the CRTView class
//

#include "stdafx.h"
#include "RT.h"
#include "DlgRT.h"
#include "RTDoc.h"
#include "RTView.h"
#include "DLGX.h"
#include "DlgHeBing.h"
#include "Dlgnc.h"
#include "DLGSORT.h"
#include "DLGpinjie.h"
#include "DLGSTL.h"
#include "DLGNCCODE.h"
#include "DLGDEL.h"
#include "Matrix.h"
#include "Complex.h"
#include "PandL.h"

#include<stdio.h>
#include<iostream.h>
#include<fstream.h>
#include<stdlib.h>
#include<iomanip.h>
#include<cstring>
#include<string.h>

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CRTView

IMPLEMENT_DYNCREATE(CRTView, CView)

BEGIN_MESSAGE_MAP(CRTView, CView)
	//{{AFX_MSG_MAP(CRTView)
	ON_COMMAND(ID_RT, OnRt)
	ON_COMMAND(ID_CHANGE_MID, OnChangeMid)
	ON_COMMAND(ID_NC1, OnNc1)
	ON_COMMAND(ID_RT_SORT, OnRtSort)
	ON_COMMAND(ID_STL, OnStl)
	ON_COMMAND(ID_RT_HE_BING, OnRtHeBing)
	ON_COMMAND(ID_PINJIE_SIMPLE, OnPinjieSimple)
	ON_COMMAND(ID_PARA_SELECT, OnParaSelect)
	ON_COMMAND(ID_RT_DEL, OnRtDel)
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CRTView construction/destruction

CRTView::CRTView()
{
	// TODO: add construction code here

}

CRTView::~CRTView()
{
}

BOOL CRTView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CRTView drawing

void CRTView::OnDraw(CDC* pDC)
{
	CRTDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
}

/////////////////////////////////////////////////////////////////////////////
// CRTView printing

BOOL CRTView::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}

void CRTView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add extra initialization before printing
}

void CRTView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add cleanup after printing
}

/////////////////////////////////////////////////////////////////////////////
// CRTView diagnostics

#ifdef _DEBUG
void CRTView::AssertValid() const
{
	CView::AssertValid();
}

void CRTView::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}

CRTDoc* CRTView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CRTDoc)));
	return (CRTDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CRTView message handlers

void CRTView::OnRt() 
{
	// TODO: Add your command handler code here
	CDlgRT DlgRT;
	DlgRT.DoModal();
}

void CRTView::OnChangeMid() 
{
	// TODO: Add your command handler code here
	CDLGX Dlgx;
	Dlgx.DoModal();	
}

/*void CRTView::OnRtHebing() 
{

	DlgHeBing dlg;
	dlg.DoModal();
/*	int i,j;
	i=0;j=0;
	double rtFirst[3],rtLast[3];
	for(int t=0;t<3;t++)
	{
		rtFirst[t]=0;
		rtLast[t]=0;
	}
	// TODO: Add your command handler code here
	CFileDialog dlg(TRUE,"txt",NULL,
		OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
		"txt File(*.txt)|*.txt", NULL );

	if(dlg.DoModal()==IDOK){

		CALine Line;

		CString strName = dlg.GetPathName();
		Line.LoadTXTFile(strName);
	

          rtFirst[0]=Line.m_LineList2[0]->m_PointList2[0]->pt3.x;
		  rtFirst[1]=Line.m_LineList2[0]->m_PointList2[0]->pt3.y;
		  rtFirst[2]=Line.m_LineList2[0]->m_PointList2[0]->pt3.z;  

		i=Line.m_LineList2.GetSize();

          rtLast[0]=Line.m_LineList2[i-1]->m_PointList2[0]->pt3.x;
		  rtLast[1]=Line.m_LineList2[i-1]->m_PointList2[0]->pt3.y;
		  rtLast[2]=Line.m_LineList2[i-1]->m_PointList2[0]->pt3.z;

    }

	char save[200]="";
	CFileDialog dlgs(FALSE,"txt",NULL,
		OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
		"txt File(*.txt)|*.txt", NULL );

	if(dlgs.DoModal()==IDOK){

		CString strSaveName= dlgs.GetPathName();
		strcat( save, strSaveName);	
	}

	ofstream outstuf;  //建立输出文件流对象
    outstuf.open(save,ios::out);  //连接文件,指定打开方式 

	outstuf<<rtFirst[0]<<" "<<rtFirst[1]<<" "<<rtFirst[2]<<endl;
    outstuf<<rtLast[0]<<" "<<rtLast[1]<<" "<<rtLast[2]<<endl;

}*/

void CRTView::OnNc1() 
{
	// TODO: Add your command handler code here
	CDLGNC DlgRT;
	DlgRT.DoModal();
}

void CRTView::OnRtSort() 
{
	// TODO: Add your command handler code here
	CDLGSORT DlgRT;
	DlgRT.DoModal();
}

/*void CRTView::OnPinjie() 
{
	// TODO: Add your command handler code here
	CDLGpinjie DlgRT;
	DlgRT.DoModal();
}*/

void CRTView::OnStl() 
{
	// TODO: Add your command handler code here
	DLGSTL DlgRT;
	DlgRT.DoModal();
}

void CRTView::OnRtHeBing() 
{
	// TODO: Add your command handler code here
	DlgHeBing dlg;
	dlg.DoModal();
}

void CRTView::OnPinjieSimple() 
{
	// TODO: Add your command handler code here
	CDLGpinjie DlgRT;
	DlgRT.DoModal();
}

void CRTView::OnParaSelect() 
{
	// TODO: Add your command handler code here
	CDLGNCCODE DlgCode;
	DlgCode.DoModal();
}

void CRTView::OnRtDel() 
{
	// TODO: Add your command handler code here
	CDLGDEL dlgdel;
	dlgdel.DoModal();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -