summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
30ec99c)
Erase wrong connections
Simple selection of a box not possible
// if(state == HIGHLIGHTED)
//EED3oct2010 if ( (state == HIGHLIGHTED) && (ctrlkey==1 ) )
// 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);
}
ok=false;
_view->setState(SELECTED);
_model->notifyObservers(getId(),ADD_TO_SELECTED);
}
int shiftkey = _vtkInteractorStyleBaseView->GetInteractor()->GetShiftKey();
int ctrlkey = _vtkInteractorStyleBaseView->GetInteractor()->GetControlKey();
ctrlkey = ctrlkey + shiftkey;
int shiftkey = _vtkInteractorStyleBaseView->GetInteractor()->GetShiftKey();
int ctrlkey = _vtkInteractorStyleBaseView->GetInteractor()->GetControlKey();
ctrlkey = ctrlkey + shiftkey;
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 GBoxController::OnLeftButtonDown()
{
bool ok=true;
bool GBoxController::OnLeftButtonDown()
{
bool ok=true;
-printf("EED GBoxController::OnLeftButtonDown \n");
int state = _view->getState();
//Evaluate new state
int state = _view->getState();
//Evaluate new state
ok=false;
_isLeftClickDown=true;
_view->setState(SELECTED);
ok=false;
_isLeftClickDown=true;
_view->setState(SELECTED);
- _model->notifyObservers(getId(),ADD_TO_SELECTED);
+// _model->notifyObservers(getId(),ADD_TO_SELECTED);
+ _model->notifyObservers(getId());
bool GConnectorController::OnMouseMove()
{
bool GConnectorController::OnMouseMove()
{
+ printf("EED GConnectorController::OnMouseMove state%d\n", _view->getState() );
+
+ if (_view->getState() ==SELECTED)
+ {
+ _controller->GetManualViewBaseContour()->SetSelected(true);
+ }
+
if ( _vtkInteractorStyleBaseView!=NULL)
{
int X,Y;
if ( _vtkInteractorStyleBaseView!=NULL)
{
int X,Y;
//=========================================================================
//=========================================================================
-bool wxVtkSceneManager::OnMouseMove() {
+bool wxVtkSceneManager::OnMouseMove()
+{
int X, Y;
bool okStatusMessage = false;
bool okPortMessage = false;
int X, Y;
bool okStatusMessage = false;
bool okPortMessage = false;
desc->getModel()->getCenter(px, py, pz);
// JGRR & CM
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());
// EO JGRR & CM
okStatusMessage = true;
updateStatusBar(desc->getStatusText());
- if (type == GBLACKBOX) {
+ if (type == GBLACKBOX)
+ {
GBlackBoxModel *mod = (GBlackBoxModel*) desc->getModel();
GBlackBoxModel *mod = (GBlackBoxModel*) desc->getModel();
- _parent->displayBlackBoxInfo(mod->getBBTKPackage(),
- mod->getBBTKType());
+ _parent->displayBlackBoxInfo(mod->getBBTKPackage(),mod->getBBTKType());
// PortText
okPortMessage = true;
py = py + 5;
// PortText
okPortMessage = true;
py = py + 5;
} // for controllers it
}
}
} // for controllers it
}
}
- if (okStatusMessage == false) {
+ if (okStatusMessage == false)
+ {
- if (okPortMessage == false) {
+ if (okPortMessage == false)
+ {
_textActor->SetScale(0.0001);
_fillObjectActor->SetScale(0.0001);
}
_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;
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;
GObjectController *desc = it->second;
- if (desc->getGObjectType() == GPORT) {
+ if (desc->getGObjectType() == GPORT)
+ {
GPortModel *portmod = (GPortModel*) desc->getModel();
vtkGObjectView *portView = desc->getView();
GPortModel *portmod = (GPortModel*) desc->getModel();
vtkGObjectView *portView = desc->getView();
- if (portmod->getPortType() == GINPUTPORT
- && portView->getState() == HIGHLIGHTED) {
+ if (portmod->getPortType() == GINPUTPORT && portView->getState() == HIGHLIGHTED)
+ {
- } // 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
- if (isOverPort == false) {
+ if (isOverPort == false)
+ {
CancelConnection();
UnSelectBlackBoxes();
} // isOverPort
CancelConnection();
UnSelectBlackBoxes();
} // isOverPort
GObjectController *cont = GetGBlackBoxControlerPointedByMouse();
GObjectController *cont = GetGBlackBoxControlerPointedByMouse();
- if (GetGBlackBoxControlerPointedByMouse() != NULL) {
int state = cont->getView()->getState();
if ((ctrlkey == 0) && (state == HIGHLIGHTED)) {
UnSelectBlackBoxes();
}
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];
}
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
cont->getView()->setState(DRAG);
cont->getModel()->notifyObservers(_idManager);
} // for
} // if _selectedObjects.size
} // if _selectedObjects.size
//=========================================================================
//=========================================================================
-bool wxVtkSceneManager::OnLeftButtonUp() {
+bool wxVtkSceneManager::OnLeftButtonUp()
+{
if (_worldState == DRAG_OBJECTS) {
_worldState = NOTHING_HAPPENS;
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;
_worldState = NOTHING_HAPPENS;
//int lastId = _controllers.size()-1;
_controllers.erase(_idConnectionInCreation);
std::map<int, GObjectController*>::iterator it;
_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);
GObjectController *desc = it->second;
desc->SetActive(true);
desc->getView()->setState(NOTHING_HAPPENS);
#endif
if(_selectedObjects.size()){
std::cout<<"objects to copy :";
#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());
std::cout<<_selectedObjects.at(i)<<" ";
}
DuplicateObjects(getSelectedObjects());