//=========================================================================
GBlackBoxModel::GBlackBoxModel()
{
+ _isExecutable = false;
}
//=========================================================================
}
//=========================================================================
-
std::string GBlackBoxModel::getBBTKPackage()
{
//=========================================================================
+ bool GBlackBoxModel::isExecutable()
+ {
+ return _isExecutable;
+ }
+
+ //=========================================================================
+
+ void GBlackBoxModel::setExecutable(bool executable)
+ {
+ _isExecutable = executable;
+ }
+
+ //=========================================================================
+
std::string GBlackBoxModel::getStatusText()
{
std::string temp = "";
virtual std::string getStatusText();
+ bool isExecutable();
+ void setExecutable(bool executable);
+
private:
//Private Attributes
std::vector<GPortModel*> _inputs;
std::vector<GPortModel*> _outputs;
+ bool _isExecutable;
//Private Methods
const double BOXFILL_NH_B=0.15;
const double BOXFILL_HIGHLIGHTED_R=0.05;
- const double BOXFILL_HIGHLIGHTED_G=0.45;
- const double BOXFILL_HIGHLIGHTED_B=0.65;
+ const double BOXFILL_HIGHLIGHTED_G=0.30;
+ const double BOXFILL_HIGHLIGHTED_B=0.45;
const double BOXFILL_DRAG_R=0.75;
const double BOXFILL_DRAG_G=0.75;
void wxVtkSceneManager::disconnectDrop()
{
_baseView->GetWxVTKRenderWindowInteractor()->SetDropTarget(NULL);
- }
+ }
//=========================================================================
//=========================================================================
- bool GBlackBoxController::OnRightButtonDown()
+ bool GBlackBoxController::OnRightButtonUp()
{
+ GBlackBoxModel *bbmodel = (GBlackBoxModel*)_model;
+ if(bbmodel->isExecutable())
+ {
+ bbmodel->setExecutable(false);
+ }
+
+ return true;
+ }
+
+ //=========================================================================
+
+ bool GBlackBoxController::OnMiddleButtonDown()
+ {
+ int X,Y;
+ wxVTKRenderWindowInteractor *wxVTKiren;
+ wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
+ wxVTKiren->GetEventPosition(X,Y);
+
+ int state = _view->getState();
+
+ //Evaluate new state
+ if(_view->isPointInside(X,Y))
+ {
+ GBlackBoxModel *bbmodel = (GBlackBoxModel*)_model;
+ _view->setState(HIGHLIGHTED);
+ bbmodel->setExecutable(true);
+ bbmodel->notifyObservers(_id);
+ }
+
return true;
}
//Includes same project
#include "GlobalConstants.h"
#include "GObjectController.h"
+#include "GBlackBoxModel.h"
//Includes creaMaracasVisu
~GBlackBoxController();
//Public methods
- virtual bool OnMouseMove();
- virtual bool OnLeftButtonDown();
- virtual bool OnLeftButtonUp();
- virtual bool OnLeftDClick();
- virtual bool OnRightButtonDown();
+
private:
//Private Methods
protected:
+ virtual bool OnMouseMove();
+ virtual bool OnLeftButtonDown();
+ virtual bool OnLeftButtonUp();
+ virtual bool OnMiddleButtonDown();
+ virtual bool OnLeftDClick();
+ virtual bool OnRightButtonUp();
+
};
return true;
}
+ //=========================================================================
+
+ bool GObjectController::OnMiddleButtonDown()//virtual
+ {
+ return true;
+ }
+
//=========================================================================
void GObjectController::moveObject(int X,int Y)
virtual bool OnLeftButtonDown();
virtual bool OnLeftButtonUp();
virtual bool OnLeftDClick();
+ virtual bool OnMiddleButtonDown();
virtual void moveObject(int X,int Y);
_fillObjectActor->GetProperty()->SetColor(BOXFILL_NH_R,BOXFILL_NH_G,BOXFILL_NH_B);
_nameActor->GetTextProperty()->SetColor(BOXTEXT_NH_R,BOXTEXT_NH_G,BOXTEXT_NH_B);
_typeActor->GetTextProperty()->SetColor(BOXTEXT_NH_R,BOXTEXT_NH_G,BOXTEXT_NH_B);
+
+ GBlackBoxModel *bbmodel = (GBlackBoxModel*)_model;
+ if(bbmodel->isExecutable())
+ {
+ _borderObjectActor->GetProperty()->SetColor(BOXBORDER_NH_R,0.9,BOXBORDER_HIGHLIGHTED_B);
+ _fillObjectActor->GetProperty()->SetColor(BOXFILL_NH_R,0.9,BOXFILL_HIGHLIGHTED_B);
+ }
}
else if(_state==HIGHLIGHTED)
{
_borderObjectActor->GetProperty()->SetLineWidth(2);
+
_borderObjectActor->GetProperty()->SetColor(BOXBORDER_HIGHLIGHTED_R,BOXBORDER_HIGHLIGHTED_G,BOXBORDER_HIGHLIGHTED_B);
_fillObjectActor->GetProperty()->SetColor(BOXFILL_HIGHLIGHTED_R,BOXFILL_HIGHLIGHTED_G,BOXFILL_HIGHLIGHTED_B);
_nameActor->GetTextProperty()->SetColor(BOXTEXT_HIGHLIGHTED_R,BOXTEXT_HIGHLIGHTED_G,BOXTEXT_HIGHLIGHTED_B);
//Includes same project
#include "GlobalConstants.h"
#include "vtkGObjectView.h"
+#include "GBlackBoxModel.h"
//Includes creaMaracasVisu