2009年4月27日月曜日

wxDocViewでまたハマる。

wxUSE_STD_IOSTREAMを有効にしてwxWidgetsライブラリを作っていなかったから、保存読み込みができなかった。トホホ。

2009年4月24日金曜日

wxStringへの数値を代入するには

float size=0.1;
wxString str;
str << size;
でOK

解決

4月21日のエントリーで「wxVTKRenderWindowInteractorは、vtk5.0なら動くけれどvtk5.4では一部動かない。」と書いたが解決。Joystickのタイマー作ってるmethodが変更になったみたいで、ヘッダーファイルに、
#if (VTK_MAJOR_VERSION >= 5 && VTK_MINOR_VERSION > 0)
int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
int InternalDestroyTimer(int platformTimerId);
#else
int CreateTimer(int timertype);
int DestroyTimer();
#endif
ソースに
#if (VTK_MAJOR_VERSION >= 5 && VTK_MINOR_VERSION > 0)
//---------------------------------------------------------------------------
int wxVTKRenderWindowInteractor::InternalCreateTimer(int timerId, int timerType, unsigned long duration)
{
bool oneShoot(false);
if (timerType==1){
oneShoot=false;
}
if (!timer.Start(duration, oneShoot))
assert(false);
wxLogDebug(wxT("Create Internal Timer"));
return timerId;
}
//---------------------------------------------------------------------------
int wxVTKRenderWindowInteractor::InternalDestroyTimer(int platformTimerId)
{
// do nothing
wxLogDebug(wxT("Destry Internal Timer"));
return 1;
}
#else
//---------------------------------------------------------------------------
int wxVTKRenderWindowInteractor::CreateTimer(int WXUNUSED(timertype))
{
// it's a one shot timer
if (!timer.Start(10, TRUE))
assert(false);
wxLogDebug(wxT("Create Timer"));
return 1;

}
//---------------------------------------------------------------------------
int wxVTKRenderWindowInteractor::DestroyTimer()
{
// do nothing
wxLogDebug(wxT("Destry Timer"));
return 1;
}
#endif
で動きました。(環境はWindows XP、VC++2005、VTK-5.4.0)

2009年4月21日火曜日

wxVTKRenderWindowInteractorに嵌まる。

wxVTKRenderWindowInteractorは、vtk5.0なら動くけれどvtk5.4では一部動かない。
wxSampleでいきなりマウスでポイントしてジョイスティックで回転させようとするとError吐いて動かない。

2009年4月14日火曜日

boost::shared_ptrをキャスト

boost::shared_ptrをキャストするときは
boost::shared_polymorphic_castを使おう
boost::shared_dynamic_castは、キャストが失敗した時に例外を投げない。

と書いていたが、boost::shared_polymorphic_castは非標準らしい。
ラッパーを書くのがベター。boost

2009年4月8日水曜日

cmakeで作成したCodeBlocksのプロジェクトでデバッグするには

cmakeで作成したCodeBlocksのプロジェクトでデバッグするには、
cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles"

http://www.cmake.org/Wiki/CMake_FAQ
How can I build multiple modes without switching ? 辺りを参照するといい。
CodeBlocksのブレークポイントも効く。