ホーム » 2013 » 4月

月別アーカイブ: 4月 2013

2013年4月
 123456
78910111213
14151617181920
21222324252627
282930  

カテゴリー

アーカイブ

ブログ統計情報

  • 77,437 アクセス



3D ビューア

対応形式は,3DS , OBJ , STL , DXF (3D FACE) , VRML 1 .
テスクチャは,BMP , TGA , 一部の JPG .
i3DV 2013.04
i3DV.2013.04.26.zip


2013/05/08
i3DV.2013.05.08.zip


2013/05/10
i3DV.2013.05.10.zip


i_Tools Vector

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

MDI のステータスバー

以下の情報と,The MFC Answer Book とで.
すべての MDI 子ウィンドウのステータス バーを作成する方法
How to Create a Status Bar in Every MDI Child Window
https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/121946
static UINT indicators[] = { ID_INDICATOR_MDI } ; として,ID をシンボルブラウザで追加.
ビルド,実行すると,CChildFrame::OnCreate のステータスバーの Create で失敗.
 String Table で定義されてないとダメな様で適当な文字列を追加.
 ビューで,OnUpdateIndicatorMDI を追加(表示されないメニューに ID を追加して ClassWizard で).
  pCmdUI->SetText(_T(“ステータスバーに表示する情報”)) ;
これで実行すると,追加した文字列の幅で表示された.
MDI StatusBar
CChildFrame::OnCreate の,
ステータスバーを生成した後,SetPaneInfo(0,ID,SBPS_STRETCH,0)
  これにより,ウィンドウ幅いっぱいに.
MDI StatusBar width
幅は広がったが表示される文字列は,128 文字まで?

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

MFC と STL – 2

Xml_E で,MFC を使用しない様に変更中.
XML のデータを用意して,以下の様に単純に 100 個の配列にコピーする時間を計測しようとした.
   ElapseTick et ;
   CArray xmlAry ;                   // std::vector xmlAry ;
   for (int index=0 ; index<100 ; index++) {
     xmlAry.Add(Xml_Data) ;           // xmlAry.push_back(Xml_Data) ;
     }
   CString etStr = ::ToString(et.GetElapse()/1000.0) ;
   m_CtrlResult.SetWindowText(etStr) ;
データによっては期待した結果(MFC 版と同等またはそれより高速)が出たが,
この SVG を使用してメモリが少ない環境では極端に遅くなってしまった.
そこで,それぞれのサイズを調べてみた.

VC 6 VC 7 VC 8 VC 9 VC 10 VC 8 Debug VC 9 Debug VC 10 Debug VC 8 x64 VC 9 x64 VC 10 x64 VC 9 x64 Debug VC10 x64 Debug Xcode 64 Debug
CString 4 4 4 4 4 4 4 4 8 8 8 8 8
CArray 20 20 20 20 20 20 20 20 40 40 40 40 40
tstring 16 28 28 28 28 32 32 32 40 40 40 48 48 8
vector 16 16 16 24 16 20 20 20 32 48 32 40 40 24
Xml_E 68 92 92 108 92 108 108 108 152 184 152 184 184 72

tstring は,std::string または std::wstring .
vector は, <int> のサイズ.sizeof (std::vector<bool>) は vector<int> などより大きくなることがあるみたい.
Xml_E の MFC 版のデータメンバは,
CString Name , CString Text , CArray<Xml_Attribute,Xml_Attribute> Attribute , CArray<Xml_E,Xml_E> Child .
STL 版は tstring と std::vector に置換えた.

MFC Xml_Attribute 12 4 + 4*2
MFC Xml_E 52 4 + 4*2 + 20*2
STL Xml_Attribute 36 4 + 16*2
STL Xml_E 68 4 + 16*2 + 16*2

2013/04/22
SVG の全要素数は 5,557 ,属性は 19,103 .MFC 版では 518,200 ,STL 版では 1,065,584 となる.
つまり 50 M ~ 100 M 位が一時的に必要となってしまっていた(200 個にした時もあり).


ループ部分を 2 重ループとして,内側を 10 で 10 個の配列が必要となる様に改良.
時間を計測すると環境にもよるがほぼ同等の結果が得られた,
T5400 では MFC 6 秒と STL 3 秒.

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

DImage の利用

Shell Extension を利用した画像表示.ダイアログにファイルをドロップすると表示する様に.
1. CStatic を用意.ピクチャコントロールを配置して ClassWizard で変数を追加.
2. DImageS の領域を確保.通常はヘッダに.
3. OnDropFiles で
    // CString dropFile = …. ;
    ImageS.SetFileName(dropFile) ;
    ImageS.Draw(&m_Image) ;
    {
      m_Image.ShowWindow(SW_HIDE) ;
      m_Image.ShowWindow(SW_SHOW) ;
      }
    // …
4. OnPaint で
    ImageS.Draw(&m_Image) ;
DImage サンプル
DImage では,ImageDMF が追加される.
DImage.zip

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

::SetCursor

使い方がわからなかったので,
最初,こんな感じにしたら,SetCursor 直後は変更されるが保持されない.
void CVEyeCSView::OnVEyeDrag()
{
  VEyeChgView::OnVEye() ;
  if (GetEyeChg().CanMouseEyeChange()) {
    ::SetCursor(m_DragEye) ;
    }
  else {
    ::SetCursor(NULL) ;
    }
  }
SetCursor 直後と言ってもデバッガでブレイクしている状態でないと確認はできない.
CWaitCursor と似た様な動作となる.


やりたかったのは,
BOOL CVEyeCSView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
  if (nHitTest == HTCLIENT) {
    if (GetEyeChg().CanMouseEyeChange()) {
      ::SetCursor(m_DragEye) ;
      return TRUE ;
      }
    }
  return VEyeChgView::OnSetCursor(pWnd, nHitTest, message);
  }
The MFC Anser Book より

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.