JunkBox_Win_Lib 1.5.3
Loading...
Searching...
No Matches
CRwGRDoc Class Reference

#include <RwGRDoc.h>

Inheritance diagram for CRwGRDoc:
Collaboration diagram for CRwGRDoc:

Public Member Functions

virtual BOOL ReadDataFile (LPCTSTR str)
 
virtual BOOL MakeViewData ()
 
virtual CmnHead TranslateData ()
 
virtual void Serialize (CArchive &ar)
 
virtual ~CRwGRDoc ()
 
virtual void AssertValid () const
 
virtual void Dump (CDumpContext &dc) const
 
- Public Member Functions inherited from CExDocument
CExViewGetView ()
 
virtual BOOL WriteDataFile (LPCTSTR)
 
virtual BOOL OnNewDocument ()
 
virtual BOOL OnOpenDocument (LPCTSTR lpszPathName)
 
virtual ~CExDocument ()
 

Protected Member Functions

 CRwGRDoc ()
 
- Protected Member Functions inherited from CExDocument
 CExDocument ()
 

Additional Inherited Members

- Public Attributes inherited from CExDocument
CmnHead infHead
 
ExMSGraph< sWordmsGraph
 
ExCmnHead cmnHead
 
CExViewpView
 
CExFramepFrame
 
CAppCallBackpApp
 
voidanyData
 
CString Title
 
CString preTitle
 
CString pstTitle
 
int vMax
 
int vMin
 
int cMax
 
int cMin
 
int base
 
int colorMode
 
int startNo
 
int endNo
 
BOOL multiSliceData
 
BOOL hasReadData
 
BOOL hasViewData
 
BOOL ctrlCntrst
 
BOOL notFreeMSGraph
 
BOOL notFreeCmnHead
 

Detailed Description

Definition at line 30 of file RwGRDoc.h.

Constructor & Destructor Documentation

◆ CRwGRDoc()

CRwGRDoc ( )
protected

Definition at line 28 of file RwGRDoc.cpp.

29{
30// multiSliceData = FALSE;
31// nonCmnHead = FALSE;
32}

◆ ~CRwGRDoc()

~CRwGRDoc ( )
virtual

Definition at line 35 of file RwGRDoc.cpp.

36{
37}

Member Function Documentation

◆ AssertValid()

void AssertValid ( ) const
virtual

Reimplemented from CExDocument.

Reimplemented in CvThumbNailDoc.

Definition at line 52 of file RwGRDoc.cpp.

53{
55}
virtual void AssertValid() const

References CExDocument::AssertValid().

Referenced by CvThumbNailDoc::AssertValid().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dump()

void Dump ( CDumpContext & dc) const
virtual

Reimplemented from CExDocument.

Reimplemented in CvThumbNailDoc.

Definition at line 59 of file RwGRDoc.cpp.

60{
62}
virtual void Dump(CDumpContext &dc) const

References CExDocument::cMin, and CExDocument::Dump().

Referenced by CvThumbNailDoc::Dump().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MakeViewData()

BOOL MakeViewData ( )
virtual

Reimplemented from CExDocument.

Definition at line 226 of file RwGRDoc.cpp.

227{
229
230 // カウンタの設定
232 if (msGraph.zs > 10) {
233 //counter = new CProgressBarDLG(IDD_PROGBAR, NULL, NULL, FALSE);
234 counter = new CProgressBarDLG(IDD_PROGBAR, NULL, TRUE); // ディスパッチャー有効
235 if (counter!=NULL) {
236 mesg.LoadString(IDS_STR_TRNS_DISPDATA);
238 char* mbstr = ts2mbs(mesg);
239 counter->Start(0, mbstr);
240 ::free(mbstr);
241 }
242 }
243
244 // データ変換
246
247 // カウンタの停止と削除
248 if (counter!=NULL) {
249 counter->Stop();
251 delete counter;
252 }
253
254 // エラー処理
255 if (cmnHead.kind==HEADER_NONE) {
256 if (cmnHead.xsize==JBXL_GRAPH_MEMORY_ERROR) {
257 mesg.LoadString(IDS_STR_ERR_MEMORY);
258 noti.LoadString(IDS_STR_ERROR);
259 MessageBox(pFrame->m_hWnd, _T("CRwGRDoc::MakeViewData():\n\n") + mesg, noti, MB_OK);
260 }
261 else if (cmnHead.xsize==JBXL_GRAPH_CANCEL) {
262 mesg.LoadString(IDS_STR_CANCEL_TRNS_DATA);
263 noti.LoadString(IDS_STR_CANCEL);
264 MessageBox(pFrame->m_hWnd, _T("CRwGRDoc::MakeViewData():\n\n") + mesg, noti, MB_OK);
266 }
267 else {
268 mesg.LoadString(IDS_STR_ERR_UNKWN);
269 noti.LoadString(IDS_STR_ERROR);
270 MessageBox(pFrame->m_hWnd, _T("CRwGRDoc::MakeViewData():\n\n") + mesg, noti, MB_OK);
271 }
273 return FALSE;
274 }
275
276 return TRUE;
277}
ExCmnHead cmnHead
Definition ExDocument.h:53
CExFrame * pFrame
Definition ExDocument.h:56
ExMSGraph< sWord > msGraph
Definition ExDocument.h:52
bool cancelOperation
Definition ExFrame.h:52
bool doneErrorMessage
Definition ExFrame.h:51
virtual CmnHead TranslateData()
Definition RwGRDoc.cpp:281
char * ts2mbs(LPCTSTR str)
Definition WinTools.h:57
#define IDS_STR_ERROR
Definition resource.h:98
#define IDS_STR_ERR_MEMORY
Definition resource.h:82
#define IDS_STR_ERR_UNKWN
Definition resource.h:84
#define IDS_STR_CANCEL_TRNS_DATA
Definition resource.h:85
#define IDS_STR_CANCEL
Definition resource.h:101
#define IDS_STR_TRNS_DISPDATA
Definition resource.h:110
#define IDD_PROGBAR
Definition resource.h:6

References CExFrame::cancelOperation, CExDocument::cMin, CExDocument::cmnHead, CExFrame::doneErrorMessage, IDD_PROGBAR, IDS_STR_CANCEL, IDS_STR_CANCEL_TRNS_DATA, IDS_STR_ERR_MEMORY, IDS_STR_ERR_UNKWN, IDS_STR_ERROR, IDS_STR_TRNS_DISPDATA, CExDocument::msGraph, CExDocument::pFrame, CRwGRDoc::TranslateData(), and jbxwl::ts2mbs().

Here is the call graph for this function:

◆ ReadDataFile()

BOOL ReadDataFile ( LPCTSTR str)
virtual

機能: 画像データを読み込む. 引数: ファイル名 戻値: TRUE: 成功,FALSE: 失敗 説明: 読み込んだグラフィックデータ(msGraphメンバ)

Reimplemented from CExDocument.

Definition at line 87 of file RwGRDoc.cpp.

88{
89 CString message = _T("");
90 CString fnm = get_file_name_t(fname); // ファイル名のみ
91 CString err_fname = _T(""); // エラーを起こしたファイル名
92 CmnHead hd;
93
94 // グローバルカウンタの設定
96 counter = new CProgressBarDLG(IDD_PROGBAR, NULL, TRUE); // ディスパッチャー有効
97 if (counter!=NULL) {
99 }
100
102
103 // マルチスライス読み込み
104 if (multiSliceData) {
105 // ファイル読み込み設定
107 if (rsdlg==NULL) return FALSE;
108 if (rsdlg->DoModal()!=IDOK) { // キャンセルボタン
111 delete (rsdlg);
112 return FALSE;
113 }
114 startNo = rsdlg->fromNum;
115 endNo = rsdlg->toNum;
116 CString mfname = rsdlg->fName;
117 delete (rsdlg);
118
119 if (counter!=NULL) {
121 mesg.LoadString(IDS_STR_RDNG_FILE);
122 char* mbstr = ts2mbs(mesg);
123 counter->Start(0, mbstr);
124 ::free(mbstr);
125 }
126
127 Title = mfname;
128 char* fname_str = ts2mbs(mfname);
129
130 // データの読み込み
132
133 DEBUG_INFO("CRwGRDoc::ReadDataFile(): Multi Slice: file = %s, start = %d, end = %d\n", fname_str, startNo, endNo);
135
136 if (msGraph.state>=0 && msGraph.state!=Xabs(endNo-startNo)+1) {
139 ::free(numf);
140
142 noti.LoadString(IDS_STR_CNFRM_CNTNUE);
143 mesg.LoadString(IDS_STR_ERR_OPEN_FILE);
144 message = _T("CRwGRDoc::ReadDataFile():\n\n") + mesg + _T(" ") + err_fname;
145 MessageBox(pFrame->m_hWnd, message, noti, MB_OK);
146 }
147 if (msGraph.state>0) msGraph.state = 0;
148
149 if (msGraph.isNull() && msGraph.state==JBXL_GRAPH_HEADER_ERROR) {
151 }
152
153 ::free(fname_str);
154 }
155
156 // 通常の読み込み.
157 else {
159 mesg.LoadString(IDS_STR_RDNG_FILE);
160 char* mbstr = ts2mbs(mesg);
161 if (counter!=NULL) counter->Start(0, mbstr);
162 ::free(mbstr);
163 Title = fnm;
165
166 char* fname_str = ts2mbs(fname);
168 ::free(fname_str);
169 }
170
171 //
172 this->infHead = getinfo_CmnHead(hd);
173 this->colorMode = msGraph.color;
174 free_CmnHead(&hd);
175
176 // グローバルカウンタの削除
177 if (counter!=NULL) {
178 counter->Stop();
180 delete counter;
181 }
182
183 // エラー処理
184 if (msGraph.isNull()) {
186
187 if (msGraph.state==JBXL_GRAPH_OPFILE_ERROR) {
188 mesg.LoadString(IDS_STR_ERR_OPEN_FILE);
189 noti.LoadString(IDS_STR_ERROR);
190 if (multiSliceData) {
191 message = _T("CRwGRDoc::ReadDataFile():\n\n") + mesg + _T(" ") + err_fname;
192 MessageBox(pFrame->m_hWnd, message, noti, MB_OK);
193 }
194 else {
195 MessageBox(pFrame->m_hWnd, _T("CRwGRDoc::ReadDataFile():\n\n") + mesg, noti, MB_OK);
196 }
197 }
198 else if (msGraph.state==JBXL_GRAPH_MEMORY_ERROR) {
199 mesg.LoadString(IDS_STR_ERR_MEMORY);
200 noti.LoadString(IDS_STR_ERROR);
201 MessageBox(pFrame->m_hWnd, _T("CRwGRDoc::ReadDataFile():\n\n") + mesg, noti, MB_OK);
202 }
203 else if (msGraph.state==JBXL_GRAPH_CANCEL) {
204 mesg.LoadString(IDS_STR_CANCEL_OPNFILE);
205 noti.LoadString(IDS_STR_CANCEL);
206 MessageBox(pFrame->m_hWnd, _T("CRwGRDoc::ReadDataFile():\n\n") + mesg, noti, MB_OK);
208 }
209 else {
210 mesg.LoadString(IDS_STR_ERR_UNKWN);
211 noti.LoadString(IDS_STR_ERROR);
212 MessageBox(pFrame->m_hWnd, _T("CRwGRDoc::ReadDataFile():\n\n") + mesg, noti, MB_OK);
213 }
215
216 return FALSE;
217 }
218
219 return TRUE;
220}
CSetHeaderDLG SetHeaderDLG
CString get_file_name_t(LPCTSTR str)
Definition WinTools.cpp:277
CString mbs2ts(char *str)
Definition WinTools.cpp:79
CString numbering_name_t(LPCTSTR fmt, int n)
Definition WinTools.cpp:403
#define IDS_STR_RDNG_FILE
Definition resource.h:107
#define IDS_STR_ERR_OPEN_FILE
Definition resource.h:79
#define IDS_STR_CANCEL_OPNFILE
Definition resource.h:86
#define IDS_STR_CNFRM_CNTNUE
Definition resource.h:109

References CExFrame::cancelOperation, CExDocument::cMin, CExDocument::colorMode, CExFrame::doneErrorMessage, CExDocument::endNo, jbxwl::get_file_name_t(), CSetHeaderDLG::getCmnHead(), IDD_PROGBAR, IDS_STR_CANCEL, IDS_STR_CANCEL_OPNFILE, IDS_STR_CNFRM_CNTNUE, IDS_STR_ERR_MEMORY, IDS_STR_ERR_OPEN_FILE, IDS_STR_ERR_UNKWN, IDS_STR_ERROR, IDS_STR_RDNG_FILE, CExDocument::infHead, jbxwl::mbs2ts(), CExDocument::msGraph, CExDocument::multiSliceData, jbxwl::numbering_name_t(), CExDocument::pFrame, jbxwl::SetHeaderDLG, CExDocument::startNo, CExDocument::Title, and jbxwl::ts2mbs().

Here is the call graph for this function:

◆ Serialize()

void Serialize ( CArchive & ar)
virtual

Reimplemented from CExDocument.

Reimplemented in CvThumbNailDoc.

Definition at line 70 of file RwGRDoc.cpp.

71{
72 if (ar.IsStoring())
73 {
74 // TODO: この位置に保存用のコードを追加してください
75 }
76 else
77 {
78 // TODO: この位置に読み込み用のコードを追加してください
79 }
80}

References CExDocument::cMin.

◆ TranslateData()

CmnHead TranslateData ( )
virtual

Reimplemented in CvThumbNailDoc.

Definition at line 281 of file RwGRDoc.cpp.

282{
283 CmnHead chd;
284
285 int mode = 0;
286 if (msGraph.color==GRAPH_COLOR_MONO || msGraph.color==GRAPH_COLOR_MONO16 || // 表示は 8bit
290 // 8bit/pixcel
292 }
293 if (ctrlCntrst || msGraph.color==GRAPH_COLOR_MONO16) {
295 }
296 //
297 chd = copyMSGraph2CmnHead(msGraph, mode, true); // msGraphは参照渡し
298 //
299 cMax = vMax = msGraph.max;
300 cMin = vMin = msGraph.min;
301
303 || msGraph.color==GRAPH_COLOR_RGBA16) {
304 // 16bit/pixcel
305 //vMax = cMax = UWORDMAX;
306 //vMin = cMin = 0;
307 }
308 else if (!ctrlCntrst && cMin>=0 && cMax<=VIEW_8_MAX) {
309 vMax = cMax = VIEW_8_MAX;
310 vMin = cMin = 0;
311 }
312
313 base = msGraph.base;
314
315 return chd;
316}
#define VIEW_8_MAX
Definition ExView.h:39

References CExDocument::base, CExDocument::cMax, CExDocument::cMin, CExDocument::ctrlCntrst, CExDocument::msGraph, VIEW_8_MAX, CExDocument::vMax, and CExDocument::vMin.

Referenced by CRwGRDoc::MakeViewData().

Here is the caller graph for this function:

The documentation for this class was generated from the following files: