--- /dev/null
+/* XPM */
+static const char * centerview_xpm[] = {
+"17 15 3 1",
+" c None",
+". c #101010",
+"+ c #404040",
+" ............... ",
+" . . ",
+" . . ",
+" . +++++++++ . ",
+" . + + . ",
+" . + + . ",
+" . + + . ",
+" . + + + . ",
+" . + + . ",
+" . + + . ",
+" . + + . ",
+" . +++++++++ . ",
+" . . ",
+" . . ",
+" ............... ",
+};
//=========================================================================
void wxVtkSceneManager::deleteAllBoxes()
- {
+ {
std::map<int, GObjectController*>::iterator it;
for(it = _controllers.begin(); it != _controllers.end(); ++it)
{
}
//=========================================================================
+
+ void wxVtkSceneManager::centerView()
+ {
+ double temp[3];
+ _baseView->GetRenderer()->GetActiveCamera()->GetFocalPoint(temp);
+ printf("RaC wxVtkSceneManager::deleteAllBoxes() GetFocalPoint x:%f y:%f z:%f \n",temp[0],temp[1],temp[2]);
+ _baseView->GetRenderer()->GetActiveCamera()->SetFocalPoint(0,0,temp[2]);
+ _baseView->GetRenderer()->GetActiveCamera()->GetPosition(temp);
+ printf("RaC wxVtkSceneManager::deleteAllBoxes() GetPosition x:%f y:%f z:%f \n",temp[0],temp[1],temp[2]);
+ _baseView->GetRenderer()->GetActiveCamera()->SetPosition(0,0,temp[2]);
+ _baseView->RefreshView();
+
+ }
+
+ //=========================================================================
} // EO namespace bbtk
std::string getDiagramScript();
void deleteObject(int id);
void deleteAllBoxes();
+
+ void centerView();
void refreshScene();
{
ok=true;
_bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
- SetState(5);
+ if(_bakIdPoint!=0 && _bakIdPoint!=GetManualViewBaseContour()->GetNumberOfPoints()-1)
+ {
+ SetState(5);
+ }
}
// If nothing selected _state=7
if ( (GetState()==0) && (GetManualViewBaseContour()->GetIdPoint(x,y,z)==-1 ) )
wxBitmap bmp_new(new_xpm);
wxBitmap bmp_run(run_xpm);
wxBitmap bmp_delete(delete_xpm);
+ wxBitmap bmp_centerview(centerview_xpm);
wxToolBar *_toolbar = new wxToolBar(this, wxID_ANY);
_toolbar->AddTool(1000,_T("New"),bmp_new, wxNullBitmap, wxITEM_NORMAL,_T("New tab"), _T("Create a new panel tab"));
_toolbar->AddTool(1001,_T("Execute"),bmp_run, wxNullBitmap, wxITEM_NORMAL,_T("Execute actual diagram"), _T("Execute actual diagram"));
_toolbar->AddTool(1002,_T("Delete all"),bmp_delete, wxNullBitmap, wxITEM_NORMAL,_T("Delete all boxes"), _T("Delete all boxes"));
+ _toolbar->AddTool(1003,_T("Center view"),bmp_centerview, wxNullBitmap, wxITEM_NORMAL,_T("Center view"), _T("Center view"));
_toolbar->SetMargins( 2, 2 );
_toolbar->Realize();
Connect(1000,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCreateNewTab));
Connect(1001,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnExecuteActualDiagram));
Connect(1002,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnDeleteAllBoxesActualDiagram));
+ Connect(1003,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCenterViewActualDiagram));
}
//=========================================================================
//=========================================================================
+ void wxGUIEditorGraphicBBS::OnCenterViewActualDiagram(wxCommandEvent& event)
+ {
+ _tabsMgr->centerViewActualDiagram();
+ }
+
+ //=========================================================================
+
void wxGUIEditorGraphicBBS::OnExit(wxCommandEvent& event)
{
Close(true);
}
+
} // EO namespace bbtk
// EOF
#include "wxart_new.xpm" // JPR
#include "wxart_run.xpm"
#include "wxart_delete.xpm"
+#include "wxart_centerview.xpm"
//Includes creaMaracasVisu
void OnCreateNewTab(wxCommandEvent& event);
void OnExecuteActualDiagram(wxCommandEvent& event);
void OnDeleteAllBoxesActualDiagram(wxCommandEvent& event);
+ void OnCenterViewActualDiagram(wxCommandEvent& event);
void OnExit(wxCommandEvent& event);
//=========================================================================
+ void wxGEditorTabPanel::centerView()
+ {
+ _sceneManager->centerView();
+ }
+
+ //=========================================================================
+
} // EO namespace bbtk
// EOF
void editBlackBox(GBlackBoxModel *bbmodel);
void editDiagramParameters(wxVtkSceneManager* scene);
void deleteAllBoxes();
+ void centerView();
+
+ //=========================================================================
private:
//=========================================================================
+ void wxTabPanelsManager::centerViewActualDiagram()
+ {
+ _actual->centerView();
+ }
+
+ //=========================================================================
+
} // EO namespace bbtk
// EOF
void editBlackBox(GBlackBoxModel *bbmodel);
void editDiagramParameters(wxVtkSceneManager* scene);
void deleteAllBoxesActualDiagram();
+ void centerViewActualDiagram();
private: