// if(state == HIGHLIGHTED)
//EED3oct2010 if ( (state == HIGHLIGHTED) && (ctrlkey==1 ) )
+
+ if(state == SELECTED)
{
+ _view->setState(NOTHING_HAPPENS);
+ _model->notifyObservers(getId(),REMOVE_FROM_SELECTED);
+ } else {
ok=false;
_view->setState(SELECTED);
_model->notifyObservers(getId(),ADD_TO_SELECTED);
}
-
+
int shiftkey = _vtkInteractorStyleBaseView->GetInteractor()->GetShiftKey();
int ctrlkey = _vtkInteractorStyleBaseView->GetInteractor()->GetControlKey();
ctrlkey = ctrlkey + shiftkey;
ctrlkey = ctrlkey + shiftkey;
- if ( (state==SELECTED) && (ctrlkey==0) && (_objHasBeenMoved==false))
- {
- _view->setState(NOTHING_HAPPENS);
- _model->notifyObservers(getId(),REMOVE_FROM_SELECTED);
- }
+//EED 12/07/2012
+// if ( (state==SELECTED) && (ctrlkey==0) && (_objHasBeenMoved==false))
+// {
+// _view->setState(NOTHING_HAPPENS);
+// _model->notifyObservers(getId(),REMOVE_FROM_SELECTED);
+// }
//=========================================================================
-bool wxVtkSceneManager::OnMouseMove() {
+bool wxVtkSceneManager::OnMouseMove()
+{
int X, Y;
bool okStatusMessage = false;
bool okPortMessage = false;
desc->getModel()->getCenter(px, py, pz);
// JGRR & CM
- if ((state == HIGHLIGHTED) || (state == SELECTED_POSSIBLE_CONNECTION )) {
+ if ((state == HIGHLIGHTED) || (state == SELECTED_POSSIBLE_CONNECTION ))
+ {
// EO JGRR & CM
okStatusMessage = true;
updateStatusBar(desc->getStatusText());
- if (type == GBLACKBOX) {
+ if (type == GBLACKBOX)
+ {
GBlackBoxModel *mod = (GBlackBoxModel*) desc->getModel();
- _parent->displayBlackBoxInfo(mod->getBBTKPackage(),
- mod->getBBTKType());
+ _parent->displayBlackBoxInfo(mod->getBBTKPackage(),mod->getBBTKType());
} // if GBLACKBOX
- if (type == GPORT) {
+ if (type == GPORT)
+ {
// PortText
okPortMessage = true;
py = py + 5;
} // for controllers it
}
}
- if (okStatusMessage == false) {
+ if (okStatusMessage == false)
+ {
updateStatusBar("");
}
- if (okPortMessage == false) {
+ if (okPortMessage == false)
+ {
_textActor->SetScale(0.0001);
_fillObjectActor->SetScale(0.0001);
}
//=========================================================================
-bool wxVtkSceneManager::OnLeftButtonDown() {
-
- if (_worldState == INIT_CREATION_CONTOUR) {
+bool wxVtkSceneManager::OnLeftButtonDown()
+{
+ if (_worldState == INIT_CREATION_CONTOUR)
+ {
bool isOverPort = false;
std::map<int, GObjectController*>::iterator it;
- for (it = _controllers.begin(); it != _controllers.end() && isOverPort
- == false; ++it) {
+ for (it = _controllers.begin(); it != _controllers.end() && isOverPort== false; ++it)
+ {
GObjectController *desc = it->second;
- if (desc->getGObjectType() == GPORT) {
+ if (desc->getGObjectType() == GPORT)
+ {
GPortModel *portmod = (GPortModel*) desc->getModel();
vtkGObjectView *portView = desc->getView();
- if (portmod->getPortType() == GINPUTPORT
- && portView->getState() == HIGHLIGHTED) {
+ if (portmod->getPortType() == GINPUTPORT && portView->getState() == HIGHLIGHTED)
+ {
isOverPort = true;
- } // if
- // JGRR & CM
- if ( portmod->getPortType( ) == GINPUTPORT && portView->getState( ) == SELECTED_POSSIBLE_CONNECTION ) {
- isOverPort = true ;
- portView->setState( HIGHLIGHTED);
- }
- // EO JGRR & CM
-
- } // if
+ } // if
+ // JGRR & CM
+ if ( portmod->getPortType( ) == GINPUTPORT && portView->getState( ) == SELECTED_POSSIBLE_CONNECTION ) {
+ isOverPort = true ;
+ portView->setState( HIGHLIGHTED);
+ }
+ // EO JGRR & CM
+
+ } // if
} // for
- if (isOverPort == false) {
+ if (isOverPort == false)
+ {
CancelConnection();
UnSelectBlackBoxes();
} // isOverPort
GObjectController *cont = GetGBlackBoxControlerPointedByMouse();
- if (GetGBlackBoxControlerPointedByMouse() != NULL) {
+ if (cont != NULL) {
int state = cont->getView()->getState();
if ((ctrlkey == 0) && (state == HIGHLIGHTED)) {
UnSelectBlackBoxes();
}
+ } else {
+ UnSelectBlackBoxes(); // EED 12/07/2012
}
for (int i = 0; i < (int) _selectedObjects.size(); i++) {
int id = _selectedObjects[i];
- GObjectController* cont = _controllers[id];
+ GObjectController *cont = _controllers[id];
cont->getView()->setState(DRAG);
cont->getModel()->notifyObservers(_idManager);
} // for
-
} // if _selectedObjects.size
//=========================================================================
-bool wxVtkSceneManager::OnLeftButtonUp() {
+bool wxVtkSceneManager::OnLeftButtonUp()
+{
if (_worldState == DRAG_OBJECTS) {
_worldState = NOTHING_HAPPENS;
}
//=========================================================================
-void wxVtkSceneManager::CancelConnection() {
- if (_worldState == INIT_CREATION_CONTOUR) {
+void wxVtkSceneManager::CancelConnection()
+{
+ if (_worldState == INIT_CREATION_CONTOUR)
+ {
_worldState = NOTHING_HAPPENS;
//int lastId = _controllers.size()-1;
_controllers.erase(_idConnectionInCreation);
std::map<int, GObjectController*>::iterator it;
- for (it = _controllers.begin(); it != _controllers.end(); ++it) {
+ for (it = _controllers.begin(); it != _controllers.end(); ++it)
+ {
GObjectController *desc = it->second;
desc->SetActive(true);
desc->getView()->setState(NOTHING_HAPPENS);
#endif
if(_selectedObjects.size()){
std::cout<<"objects to copy :";
- for(int i=0;i<_selectedObjects.size();i++){
+ for(int i=0;i<_selectedObjects.size();i++)
+ {
std::cout<<_selectedObjects.at(i)<<" ";
}
DuplicateObjects(getSelectedObjects());