version 1.2, 2001/10/09 01:36:28 |
version 1.5, 2014/05/13 20:07:23 |
Line 13 static char THIS_FILE[] = __FILE__; |
|
Line 13 static char THIS_FILE[] = __FILE__; |
|
|
|
#include <math.h> |
#include <math.h> |
|
|
|
#include "gmpxx.h" |
extern "C" { |
extern "C" { |
#include "ca.h" |
#include "ca.h" |
#include "ifplot.h" |
#include "ifplot.h" |
Line 80 void CChildView::OnPaint() |
|
Line 81 void CChildView::OnPaint() |
|
// TODO: メッセージ ハンドラのコードをここに追加してください。 |
// TODO: メッセージ ハンドラのコードをここに追加してください。 |
|
|
// 描画のために CWnd::OnPaint を呼び出してはいけません。 |
// 描画のために CWnd::OnPaint を呼び出してはいけません。 |
if ( can->mode == MODE_INTERACTIVE ) { |
if ( can->mode == modeNO(INTERACTIVE) ) { |
::BitBlt(dc.m_hDC,0,0,can->width,can->height,can->pix,0,0,SRCCOPY); |
::BitBlt(dc.m_hDC,0,0,can->width,can->height,can->pix,0,0,SRCCOPY); |
} else { |
} else { |
if ( !can->wide ) { |
if ( !can->wide ) { |
Line 96 void CChildView::OnPrint(CDC &dc) |
|
Line 97 void CChildView::OnPrint(CDC &dc) |
|
{ |
{ |
DOCINFO docinfo; |
DOCINFO docinfo; |
NODE n; |
NODE n; |
int width,height,ratio,x,y; |
int width,height,ratio,x,y,step; |
|
|
memset(&docinfo,0,sizeof(DOCINFO)); |
memset(&docinfo,0,sizeof(DOCINFO)); |
docinfo.cbSize = sizeof(DOCINFO); |
docinfo.cbSize = sizeof(DOCINFO); |
Line 122 void CChildView::OnPrint(CDC &dc) |
|
Line 123 void CChildView::OnPrint(CDC &dc) |
|
dc.StartDoc(&docinfo); |
dc.StartDoc(&docinfo); |
dc.StartPage(); |
dc.StartPage(); |
|
|
if ( can->mode == MODE_INTERACTIVE ) { |
if ( can->mode == modeNO(INTERACTIVE) ) { |
// We want to associate precisely one printer pixel to |
|
|
// We want to associate a rectangle of a fixed size to |
// one bitmap pixel |
// one bitmap pixel |
// if can->width/can->height > width/height |
// if can->width/can->height > width/height |
// then match the widths, else match the height |
// then match the widths, else match the height |
Line 139 void CChildView::OnPrint(CDC &dc) |
|
Line 141 void CChildView::OnPrint(CDC &dc) |
|
dc.SetViewportOrg(width/18,height/18); |
dc.SetViewportOrg(width/18,height/18); |
dc.SetViewportExt(width,height); |
dc.SetViewportExt(width,height); |
|
|
|
step = (ratio+4)/5; |
for ( n = can->history; n; n = NEXT(n) ) { |
for ( n = can->history; n; n = NEXT(n) ) { |
RealVect *rv = (RealVect *)n->body; |
RealVect *rv = (RealVect *)n->body; |
if ( rv->len == 2 ) { |
if ( rv->len == 2 ) { |
Line 146 void CChildView::OnPrint(CDC &dc) |
|
Line 149 void CChildView::OnPrint(CDC &dc) |
|
x = rv->body[0]*ratio; |
x = rv->body[0]*ratio; |
y = rv->body[1]*ratio; |
y = rv->body[1]*ratio; |
// dc.FillRect(CRect(x,y,x+1,y+1),&brush); |
// dc.FillRect(CRect(x,y,x+1,y+1),&brush); |
dc.FillRect(CRect(x-1,y-1,x+1,y+1),&brush); |
// dc.FillRect(CRect(x-1,y-1,x+1,y+1),&brush); |
|
dc.FillRect(CRect(x,y,x+step,y+step),&brush); |
} else if ( rv->len == 4 ) { |
} else if ( rv->len == 4 ) { |
dc.MoveTo(rv->body[0]*ratio,rv->body[1]*ratio); |
dc.MoveTo(rv->body[0]*ratio,rv->body[1]*ratio); |
dc.LineTo(rv->body[2]*ratio,rv->body[3]*ratio); |
dc.LineTo(rv->body[2]*ratio,rv->body[3]*ratio); |
Line 160 void CChildView::OnPrint(CDC &dc) |
|
Line 164 void CChildView::OnPrint(CDC &dc) |
|
dc.SetViewportOrg(width/18,height/18); |
dc.SetViewportOrg(width/18,height/18); |
dc.SetViewportExt(width,height); |
dc.SetViewportExt(width,height); |
|
|
if ( can->mode == MODE_PLOT ) |
if ( can->mode == modeNO(PLOT) ) |
dc.Polyline(can->pa[0].pos,can->pa[0].length); |
dc.Polyline(can->pa[0].pos,can->pa[0].length); |
else |
else |
::StretchBlt(dc.m_hDC,0,0,can->width,can->height,can->pix, |
::StretchBlt(dc.m_hDC,0,0,can->width,can->height,can->pix, |
Line 180 void CChildView::PrintAxis(CDC &dc) |
|
Line 184 void CChildView::PrintAxis(CDC &dc) |
|
char buf[BUFSIZ]; |
char buf[BUFSIZ]; |
|
|
/* XXX : should be cleaned up */ |
/* XXX : should be cleaned up */ |
if ( can->noaxis || (can->mode == MODE_PLOT && !can->pa) ) |
if ( can->noaxis || (can->mode == modeNO(PLOT) && !can->pa) ) |
return; |
return; |
if ( can->mode == MODE_INTERACTIVE ) |
if ( can->mode == modeNO(INTERACTIVE) ) |
return; |
return; |
|
|
xadj = yadj = 0; |
xadj = yadj = 0; |