}
//=========================================================================
-
bool GObjectModel::isPointInside(double x,double y, double z)//virtual
{
if(x>=_xInic && x<=_xFin && y<=_yInic && y>=_yFin)
}
}
- //=========================================================================
+ //=========================================================================
+ bool GObjectModel::isBoxInsideRectangle(double x1,double y1, double z1,double x2,double y2, double z2)//virtual
+ {
+ if(_xInic>x1 && _xInic<x2 && _xFin>x1 && _xFin<x2 &&
+ _yInic>y1 && _yInic<y2 && _yFin>y1 && _yFin<y2 )
+ {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ //=========================================================================
void GObjectModel::move(double xx,double yy,double zz)//virtual
{
setInicPoint(xx,yy,zz);
// Returns true if (x,y,z) is inside the rectangle
virtual bool isPointInside( double x, double y, double z );
+ bool isBoxInsideRectangle(double x1,double y1, double z1,double x2,double y2, double z2);
// Get the type of the graphical objects (See the GlobalConstants.h file)
int getGObjectType( );
const int DRAG_OBJECTS = 205;
const int EDIT_BLACKBOX = 206;
const int REMOVE_FROM_SELECTED = 207;
+ const int SELECTING_BOXES = 208;
//// COLORS (object_state_(R|G|B))
GBlackBoxController::~GBlackBoxController()
{
}
- //=========================================================================
+/*
+ //=========================================================================
bool GBlackBoxController::OnMouseMove()
{
-
if ( _vtkInteractorStyleBaseView!=NULL)
{
int X,Y;
crea::wxVTKRenderWindowInteractor *_wxVTKiren;
_wxVTKiren= _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
_wxVTKiren->GetEventPosition( X , Y );
-
int state = _view->getState();
-
//Evaluate new state
-
if(state == NOTHING_HAPPENS)
{
if(_view->isPointInside(X,Y))
}
return true; // to avoid to redraw all if nothing
} // state
-
if( state==HIGHLIGHTED)
{
if(!_view->isPointInside(X,Y))
_view->setState(NOTHING_HAPPENS);
}
} // state
-
-
- if ((state==DRAG) && (_isLeftClickDown==true) )
- {
- _objHasBeenMoved=true;
- } // state
-
+// if ((state==DRAG) && (_isLeftClickDown==true) )
+// {
+// _objHasBeenMoved=true;
+// } // state
_model->notifyObservers(getId());
-
}
return true;
}
+*/
//=========================================================================
+/*
bool GBlackBoxController::OnLeftButtonDown()
{
- _objHasBeenMoved = false;
+// _objHasBeenMoved = false;
_isLeftClickDown = true;
bool ok=true;
-
int X,Y;
crea::wxVTKRenderWindowInteractor *_wxVTKiren;
_wxVTKiren= _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
_wxVTKiren->GetEventPosition( X , Y );
-
-
-
int state = _view->getState();
//Evaluate new state
-
if(_view->isPointInside(X,Y))
-
-// 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);
- }
-
-
+ {
+ // 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);
+ }
+ } // EED 2022-09-16
int shiftkey = _vtkInteractorStyleBaseView->GetInteractor()->GetShiftKey();
int ctrlkey = _vtkInteractorStyleBaseView->GetInteractor()->GetControlKey();
ctrlkey = ctrlkey + shiftkey;
-
-
if ( (state==DRAG) && (ctrlkey==1) && (_view->isPointInside(X,Y)==true) )
{
_view->setState(NOTHING_HAPPENS);
_model->notifyObservers(getId(),REMOVE_FROM_SELECTED);
}
-
return ok;
}
+*/
+/*
//=========================================================================
bool GBlackBoxController::OnLeftButtonUp()
{
// }
return true;
}
+*/
//=========================================================================
bool GBlackBoxController::OnRightButtonUp()
//Includes std
#include <iostream>
-
namespace bbtk
{
-
class GBlackBoxController : public GBoxController
{
-
public:
-
//Constructors
GBlackBoxController();
~GBlackBoxController();
-
//Public methods
-
-
-
private:
-
//Attributes
- bool _objHasBeenMoved;
-
+// bool _objHasBeenMoved;
//Private Methods
-
protected:
-
// Methods from InteractorStyleMaracas
- virtual bool OnMouseMove();
- virtual bool OnLeftButtonDown();
- virtual bool OnLeftButtonUp();
+// virtual bool OnMouseMove();
+// virtual bool OnLeftButtonDown();
+// virtual bool OnLeftButtonUp();
virtual bool OnMiddleButtonDown();
virtual bool OnRightButtonUp();
-
-
};
-
-
}
// namespace bbtk
#endif
}
//=========================================================================
+/*
bool GBoxController::OnMouseMove()
{
-
if ( _vtkInteractorStyleBaseView!=NULL)
{
int X,Y;
crea::wxVTKRenderWindowInteractor *_wxVTKiren;
_wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
_wxVTKiren->GetEventPosition( X , Y );
-
int state = _view->getState();
-
//Evaluate new state
-
if(state == NOTHING_HAPPENS)
{
if(_view->isPointInside(X,Y))
_view->setState(NOTHING_HAPPENS);
}
}
-
_model->notifyObservers(getId());
-
}
return true;
}
+ */
+
+//=========================================================================
+bool GBoxController::OnMouseMove()
+{
+ if ( _vtkInteractorStyleBaseView!=NULL)
+ {
+ int X,Y;
+ crea::wxVTKRenderWindowInteractor *_wxVTKiren;
+ _wxVTKiren= _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
+ _wxVTKiren->GetEventPosition( X , Y );
+ int state = _view->getState();
+ //Evaluate new state
+ if(state == NOTHING_HAPPENS)
+ {
+ if(_view->isPointInside(X,Y))
+ {
+ _view->setState(HIGHLIGHTED);
+ }
+ return true; // to avoid to redraw all if nothing
+ } // state
+ if( state==HIGHLIGHTED)
+ {
+ if(!_view->isPointInside(X,Y))
+ {
+ _view->setState(NOTHING_HAPPENS);
+ }
+ } // state
+// if ((state==DRAG) && (_isLeftClickDown==true) )
+// {
+// _objHasBeenMoved=true;
+// } // state
+ _model->notifyObservers(getId());
+ }
+ return true;
+}
+
+
+
+
//=========================================================================
+/*
bool GBoxController::OnLeftButtonDown()
{
bool ok=true;
int state = _view->getState();
-
//Evaluate new state
if(state == HIGHLIGHTED)
{
- ok=false;
- _isLeftClickDown=true;
+ ok = false;
+ _isLeftClickDown = true;
_view->setState(SELECTED);
_model->notifyObservers(getId(),ADD_TO_SELECTED);
}
return ok;
-
}
+*/
+
+bool GBoxController::OnLeftButtonDown()
+{
+// _objHasBeenMoved = false;
+ _isLeftClickDown = true;
+ bool ok=true;
+ int X,Y;
+ crea::wxVTKRenderWindowInteractor *_wxVTKiren;
+ _wxVTKiren= _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
+ _wxVTKiren->GetEventPosition( X , Y );
+ int state = _view->getState();
+ //Evaluate new state
+ if(_view->isPointInside(X,Y))
+ {
+// 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);
+ }
+ } // EED 2022-09-16
+ int shiftkey = _vtkInteractorStyleBaseView->GetInteractor()->GetShiftKey();
+ int ctrlkey = _vtkInteractorStyleBaseView->GetInteractor()->GetControlKey();
+ ctrlkey = ctrlkey + shiftkey;
+ if ( (state==DRAG) && (ctrlkey==1) && (_view->isPointInside(X,Y)==true) )
+ {
+ _view->setState(NOTHING_HAPPENS);
+ _model->notifyObservers(getId(),REMOVE_FROM_SELECTED);
+ }
+ return ok;
+}
+
+
//=========================================================================
wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
wxVTKiren->GetEventPosition(X,Y);
+ /*
int state = _view->getState();
//Evaluate new state
if(_isLeftClickDown)
_model->notifyObservers(getId());
}
}
+*/
return true;
}
//=========================================================================
- bool GObjectController::OnMouseMove( ) {
+ bool GObjectController::OnMouseMove( )
+ {
int X , Y ;
crea::wxVTKRenderWindowInteractor *_wxVTKiren ;
_wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView( )->GetWxVTKRenderWindowInteractor( ) ;
_wxVTKiren->GetEventPosition( X , Y ) ;
int state = _view->getState( ) ;
-
//Evaluate new state
- if ( state == NOTHING_HAPPENS ) {
- if ( _view->isPointInside( X , Y ) ) {
+ if ( state == NOTHING_HAPPENS )
+ {
+ if ( _view->isPointInside( X , Y ) )
+ {
_view->setState( HIGHLIGHTED ) ;
}
}
- if ( state == HIGHLIGHTED ) {
- if ( !_view->isPointInside( X , Y ) ) {
+ if ( state == HIGHLIGHTED )
+ {
+ if ( !_view->isPointInside( X , Y ) )
+ {
_view->setState( NOTHING_HAPPENS ) ;
}
}
// JGRR & CM WH
- if ( state == POSSIBLE_CONNECTION ) {
- if ( _view->isPointInside( X , Y ) ) {
+ if ( state == POSSIBLE_CONNECTION )
+ {
+ if ( _view->isPointInside( X , Y ) )
+ {
_view->setState( SELECTED_POSSIBLE_CONNECTION ) ;
}
}
- if ( state == SELECTED_POSSIBLE_CONNECTION ) {
- if ( !_view->isPointInside( X , Y ) ) {
+ if ( state == SELECTED_POSSIBLE_CONNECTION )
+ {
+ if ( !_view->isPointInside( X , Y ) )
+ {
_view->setState( POSSIBLE_CONNECTION ) ;
}
}
return _model->isPointInside(xx,yy,zz);
}
+ //=========================================================================
+ bool vtkGObjectView::isBoxInsideRectangle(int X1,int Y1, int X2, int Y2) //virtual
+ {
+ // RaC In the actual version, always z=GPOSITION_Z
+ double xx1=X1,yy1=Y1,zz1=GPOSITION_Z;
+ _baseView->TransCoordScreenToWorld(xx1,yy1,zz1);
+ double xx2=X2,yy2=Y2,zz2=GPOSITION_Z;
+ _baseView->TransCoordScreenToWorld(xx2,yy2,zz2);
+
+ return _model->isBoxInsideRectangle(xx1,yy1,zz1, xx2,yy2,zz2 );
+ }
+
//=========================================================================
void vtkGObjectView::moveObject(int X,int Y) //virtual
{
// Method to force a vtk refresh to the list of controllers of the wxVtkBaseView
void setRefreshWaiting();
virtual bool isPointInside(int X,int Y);
+ virtual bool isBoxInsideRectangle(int X1,int Y1, int X2, int Y2) ;
+
virtual void moveObject(int X, int Y);
virtual void removeFromScene();
virtual void update(int idController,int command);
result = strtok( NULL, delims );
boxType += result;
*/
- printf("EED wxGEditorTabPanel::OnDropText <%s> length %d %d \n", stdData.c_str(), stdData.length(), data.Len() );
- printf("EED wxGEditorTabPanel::OnDropText <%s> wxString\n",(const char*)data.mb_str() );
+// printf("EED wxGEditorTabPanel::OnDropText <%s> length %d %d \n", stdData.c_str(), stdData.length(), data.Len() );
+// printf("EED wxGEditorTabPanel::OnDropText <%s> wxString\n",(const char*)data.mb_str() );
if ( _panelsManager->TryToOpenScriptApplication(packageName,boxType) == false )
{
_sceneManager->createGBlackBox(x,y,packageName, boxType);
}
_idConnectionInCreation = -1;
_contLastId = 0;
+
+ selectRegionX1 = -1;
+ selectRegionY1 = -1;
+ selectRegionX2 = -1;
+ selectRegionY2 = -1;
}
//=========================================================================
//=========================================================================
-std::string wxVtkSceneManager::findANewNameForABox() {
+std::string wxVtkSceneManager::findANewNameForABox()
+{
std::string boxname = generateANewNameForABox();
-
- while (boxExist(boxname) == true) {
+ while (boxExist(boxname) == true)
+ {
boxname = generateANewNameForABox();
} // while
-
return boxname;
}
//=========================================================================
void wxVtkSceneManager::configGBlackBox(int idBox, double xIn, double yIn,
double zIn, std::string name, bool boxExecutable, double xEn,
- double yEn, double zEn) {
+ double yEn, double zEn)
+{
GObjectController *cont = _controllers[idBox];
GBlackBoxModel *bbmod = (GBlackBoxModel*) cont->getModel();
bbmod->setBBTKName(name);
bbmod->setInicPoint(xIn, yIn, zIn);
bbmod->setFinalPoint(xEn, yEn, zEn);
bbmod->setExecutable(boxExecutable);
-
bbmod->notifyObservers(_idManager);
-
}
//=========================================================================
{
int X, Y;
bool okStatusMessage = false;
- bool okPortMessage = false;
+ bool okPortMessage = false;
crea::wxVTKRenderWindowInteractor *wxVTKiren;
wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
wxVTKiren->GetEventPosition(X, Y);
- if (_worldState == DRAG_OBJECTS) {
- for (int i = 0; i < (int) _selectedObjects.size(); i++) {
+ if (_worldState == DRAG_OBJECTS)
+ {
+ for (int i = 0; i < (int) _selectedObjects.size(); i++)
+ {
int id = _selectedObjects[i];
GObjectController* cont = _controllers[id];
- if (_startDragging) {
+ if (_startDragging)
+ {
cont->getView()->setStartDragging(true);
}
cont->getView()->moveObject(X, Y);
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;
- if (desc->getGObjectType() == GCONNECTOR) {
+ if (desc->getGObjectType() == GCONNECTOR)
+ {
vtkGConnectorView* vconn = (vtkGConnectorView*) desc->getView();
vconn->updateStartEndPoints();
- }
- }
+ } // if
+ } // for
_startDragging = false;
} else if (_worldState == NOTHING_HAPPENS || _worldState == INIT_CREATION_CONTOUR) {
std::map<int, GObjectController*>::iterator it;
double px, py, pz;
- for (it = _controllers.begin(); it != _controllers.end(); ++it) {
+ for (it = _controllers.begin(); it != _controllers.end(); ++it)
+ {
GObjectController *desc = it->second;
int type = desc->getGObjectType();
int state = desc->getView()->getState();
_bugTextActor_status= 2;
} // _bugTextActor_tex
_bugTextActor_text = desc->getStatusText();
-
} // if GPORT
- } //if state
+ } // if state
} // for controllers it
- }
- if (okStatusMessage == false)
+ } else if (_worldState == SELECTING_BOXES ) {
+
+
+ int sX1,sX2,sY1,sY2;
+ if (X<selectRegionX1)
+ {
+ sX1=X; sX2=selectRegionX1;
+ } else {
+ sX1=selectRegionX1; sX2=X;
+ }
+
+ if (Y<selectRegionY1)
+ {
+ sY1=Y; sY2=selectRegionY1;
+ } else {
+ sY1=selectRegionY1; sY2=Y;
+ }
+
+ UnSelectBlackBoxes();
+
+ std::map<int, GObjectController*>::iterator it;
+ GObjectController *desc;
+ int type;
+ int state;
+ int id;
+ for (it = _controllers.begin(); it != _controllers.end(); ++it)
+ {
+ desc = it->second;
+ type = desc->getGObjectType();
+ state = desc->getView()->getState();
+
+ if ( (type==GBLACKBOX) || (type==GCOMPLEXINPUTPORT) || (type==GCOMPLEXOUTPUTPORT) )
+ {
+ if ( desc->getView()->isBoxInsideRectangle( sX1 , sY1,sX2 , sY2 ) )
+ {
+ desc->getView()->setState(SELECTED);
+ id = desc->getModel()->getObjectId();
+ desc->getModel()->notifyObservers( id , ADD_TO_SELECTED );
+ }
+ } // if type == 1
+ } // for
+
+
+ } // if _worldState
+
+ if (okStatusMessage == false)
{
updateStatusBar("");
}
} // if
} // for
-
if (isOverPort == false)
{
CancelConnection();
UnSelectBlackBoxes();
} // isOverPort
-
-
} else { //_worldState
-
- _worldState = DRAG_OBJECTS;
- _startDragging = true;
-
- int shiftkey = _vtkInteractorStyleBaseView->GetInteractor()->GetShiftKey();
- int ctrlkey = _vtkInteractorStyleBaseView->GetInteractor()->GetControlKey();
- ctrlkey = ctrlkey + shiftkey;
-
- GObjectController *cont = GetGBlackBoxControlerPointedByMouse();
-
- if (cont != NULL) {
+ _startDragging = true;
+ int shiftkey = _vtkInteractorStyleBaseView->GetInteractor()->GetShiftKey();
+ int ctrlkey = _vtkInteractorStyleBaseView->GetInteractor()->GetControlKey();
+ ctrlkey = ctrlkey + shiftkey;
+ GObjectController *cont = GetGBoxControlerPointedByMouse();
+ if (cont != NULL)
+ {
+ _worldState = DRAG_OBJECTS;
int state = cont->getView()->getState();
- if ((ctrlkey == 0) && (state == HIGHLIGHTED)) {
+ if ((ctrlkey == 0) && (state == HIGHLIGHTED))
+ {
UnSelectBlackBoxes();
- }
+ } // if ctrlkey state
} else {
UnSelectBlackBoxes(); // EED 12/07/2012
- }
- for (int i = 0; i < (int) _selectedObjects.size(); i++) {
- int id = _selectedObjects[i];
- GObjectController *cont = _controllers[id];
- cont->getView()->setState(DRAG);
- cont->getModel()->notifyObservers(_idManager);
- } // for
- } // if _selectedObjects.size
-
+ _worldState = SELECTING_BOXES;
+ } // if cont
+
+ if (_worldState==SELECTING_BOXES)
+ {
+ crea::wxVTKRenderWindowInteractor *wxVTKiren;
+ wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
+ wxVTKiren->GetEventPosition(selectRegionX1, selectRegionY1);
+ } // if _worldState SELECTING_BOXES
+
+ if (_worldState==DRAG_OBJECTS)
+ {
+ for (int i = 0; i < (int) _selectedObjects.size(); i++)
+ {
+ int id = _selectedObjects[i];
+ GObjectController *cont = _controllers[id];
+ cont->getView()->setState(DRAG);
+ cont->getModel()->notifyObservers(_idManager);
+ } // for
+ } // if _worldState DRAG_OBJECTS
+ } // if _selectedObjects.size
return true;
}
bool wxVtkSceneManager::OnLeftButtonUp()
{
- if (_worldState == DRAG_OBJECTS) {
+ if ( (_worldState == DRAG_OBJECTS) || (_worldState == SELECTING_BOXES) )
+ {
_worldState = NOTHING_HAPPENS;
-
- for (int i = 0; i < (int) _selectedObjects.size(); i++) {
+ for (int i = 0; i < (int) _selectedObjects.size(); i++)
+ {
int id = _selectedObjects[i];
GObjectController* cont = _controllers[id];
cont->getView()->setState(SELECTED);
}
//=========================================================================
-
bool wxVtkSceneManager::OnRightButtonUp()
{
if (_worldState == INIT_CREATION_CONTOUR)
}
///JLGR 21-05-2012
-
-bool wxVtkSceneManager::OnMiddleButtonDown() {
-
-
+//=========================================================================
+bool wxVtkSceneManager::OnMiddleButtonDown()
+{
this->_vtkInteractorStyleBaseView->StartPan();
-
return true;
- }
-
-bool wxVtkSceneManager::OnMiddleButtonUp() {
-
+}
+//=========================================================================
+bool wxVtkSceneManager::OnMiddleButtonUp()
+{
this->_vtkInteractorStyleBaseView->EndPan();
-
-
return true;
- }
-
+}
//=========================================================================
-
-GObjectController *wxVtkSceneManager::GetGBlackBoxControlerPointedByMouse() {
+GObjectController *wxVtkSceneManager::GetGBoxControlerPointedByMouse()
+{
GObjectController *result = NULL;
int X, Y;
crea::wxVTKRenderWindowInteractor *wxVTKiren;
- wxVTKiren
- = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
+ wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
wxVTKiren->GetEventPosition(X, Y);
-
std::map<int, GObjectController*>::iterator it;
-
- for (it = _controllers.begin(); it != _controllers.end(); ++it) {
+ for (it = _controllers.begin(); it != _controllers.end(); ++it)
+ {
GObjectController *cont = it->second;
int type = cont->getGObjectType();
-
- if (cont->getView()->isPointInside(X, Y) == true) {
- if (type == GBLACKBOX) {
+ if (cont->getView()->isPointInside(X, Y) == true)
+ {
+ if ( (type == GBLACKBOX) || (type == GCOMPLEXINPUTPORT) || (type == GCOMPLEXOUTPUTPORT))
+ {
result = cont;
} // if type
} // if isPointInside
}
//=========================================================================
-void wxVtkSceneManager::UnSelectBlackBoxes() {
- for (int i = 0; i < (int) _selectedObjects.size(); i++) {
+void wxVtkSceneManager::UnSelectBlackBoxes()
+{
+ for (int i = 0; i < (int) _selectedObjects.size(); i++)
+ {
int id = _selectedObjects[i];
GObjectController* control = _controllers[id];
control->getView()->setState(NOTHING_HAPPENS);
}
//=========================================================================
-bool wxVtkSceneManager::OnLeftDClick() {
- GObjectController *cont = GetGBlackBoxControlerPointedByMouse();
- if (cont != NULL) {
- UnSelectBlackBoxes();
- _parent->editBlackBox((GBlackBoxModel*) cont->getModel());
- }
+bool wxVtkSceneManager::OnLeftDClick()
+{
+ GObjectController *cont = GetGBoxControlerPointedByMouse();
+ if (cont != NULL)
+ {
+ int type = cont->getGObjectType();
+ if (type==GBLACKBOX)
+ {
+ UnSelectBlackBoxes();
+ _parent->editBlackBox((GBlackBoxModel*) cont->getModel());
+ } // if type
+ } // if cont
return true;
}
//=========================================================================
-
bool wxVtkSceneManager::OnChar()
{
bool ok=false;
bool oktmp;
char keyCode = _vtkInteractorStyleBaseView->GetInteractor()-> GetKeyCode();
- int ctrlkey = _vtkInteractorStyleBaseView->GetInteractor()->GetControlKey();
-
+ int ctrlkey = _vtkInteractorStyleBaseView->GetInteractor()->GetControlKey();
// KeyCode 127 : Delete Key
// KeyCode 8 : Backspace Key
-
-
if (keyCode == 8 || keyCode == 127 || keyCode == 27)
{
if (_worldState == INIT_CREATION_CONTOUR)
{
CancelConnection();
- UnSelectBlackBoxes();
- }
+ UnSelectBlackBoxes();
+ } // if _worldState
}
-
-
if (keyCode == 8 || keyCode == 127)
{
-
for (int i = 0; i < (int) _selectedObjects.size(); i++)
{
int id = _selectedObjects[i];
if (ok) _selectedObjects.clear();
_parent->saveTempandUpdate("delete object");
}// if keyCode
-
// Duplicate
ctrlkey+=keyCode;
if(ctrlkey==5){
}else{
std::cout<<"No objects to copy\n";
} // _selectedObjects.size
- } // ctrlkey 5
-
+ } // ctrlkey 5
return true;
}
//=========================================================================
-
-void wxVtkSceneManager::AddControlerToBeRemove(
- std::vector<int> *controllersToRemove, int id) {
-
+void wxVtkSceneManager::AddControlerToBeRemove( std::vector<int> *controllersToRemove, int id)
+{
int i;
bool ok = true;
- for (i = 0; i < (int) controllersToRemove->size(); i++) {
- if (id == (*controllersToRemove)[i]) {
+ for (i = 0; i < (int) controllersToRemove->size(); i++)
+ {
+ if (id == (*controllersToRemove)[i])
+ {
ok = false;
- }
- }
-
- if (ok == true) {
+ } // if id
+ } // for i
+ if (ok == true)
+ {
controllersToRemove->push_back(id);
- }
-
+ } //if ok
}
//=========================================================================
std::string LineNumber(bool withLineNumber, int &value);
int GetIndexInSelected(int idControler);
void UnSelectBlackBoxes();
- GObjectController *GetGBlackBoxControlerPointedByMouse();
+ GObjectController *GetGBoxControlerPointedByMouse();
void CancelConnection();
+
+ int selectRegionX1;
+ int selectRegionY1;
+ int selectRegionX2;
+ int selectRegionY2;
+
protected:
};