#include <wxVtkSceneManager.h>
Public Member Functions | |
wxVtkSceneManager (wxGEditorTabPanel *parent, wxVtk3DBaseView *baseView, int idManager) | |
~wxVtkSceneManager () | |
void | disconnectDrop () |
void | configureBaseView () |
void | registerController (InteractorStyleMaracas *param) |
void | unregisterController (InteractorStyleMaracas *param) |
virtual bool | OnChar () |
virtual bool | OnMouseMove () |
virtual bool | OnLeftButtonDown () |
virtual bool | OnLeftButtonUp () |
virtual bool | OnRightButtonUp () |
virtual bool | OnLeftDClick () |
virtual bool | OnMiddleButtonDown () |
JLGR 21-05-2012. | |
virtual bool | OnMiddleButtonUp () |
JLGR 21-05-2012. | |
int | createGBlackBox (int x, int y, std::string packageName, std::string boxType) |
JLGR 21-05-2012. | |
int | createGComplexBoxInputPort (std::string inputName) |
int | createGComplexBoxOutputPort (std::string outputName) |
GPortController * | createGPort (int portType, std::string bbtkName, std::string bbtkType, int posinBox, GBoxModel *blackBox) |
int | createGInputPort (int portType, int posinBox, GBoxModel *blackBox, BlackBoxInputDescriptor *desc) |
int | createGOutputPort (int portType, int posinBox, GBoxModel *blackBox, BlackBoxOutputDescriptor *desc) |
int | createGConnector (GPortModel *startPort) |
void | configGBlackBox (int idBox, double xIn, double yIn, double zIn, std::string name, bool boxExecutable, double xEn, double yEn, double zEn) |
int | configGConnetion (std::string nameStartBox, std::string nameStartPort, std::string nameEndBox, std::string nameEndPort) |
void | configGComBoxInputOutputPort (bool inputoutput, std::string inputPortName, double xIn, double yIn, double zIn) |
GBoxModel * | findGBox (std::string boxname) |
vtkRenderWindow * | getRenderWindow () |
vtkRenderer * | getRenderer () |
virtual void | update (int idController, int command) |
void | refresh () |
void | refreshScene () |
void | displayBlackBoxInfo (std::string packageName, std::string boxName) |
void | updateStatusBar (std::string textStatus) |
std::vector< int > | getBlackBoxes () |
std::vector< int > | getConnections () |
std::vector< int > | getComplexInputPorts () |
std::vector< int > | getComplexOutputPorts () |
std::map< int, GObjectController * > | getSelectedObjects () |
int | getNumSelectedObjects () |
bool | isComplexBox () |
void | setComplexBox (bool val) |
int | addObjectController (GObjectController *objController) |
void | addObjects (std::map< int, GObjectController * > objectsMap) |
void | DuplicateObjects (std::map< int, GObjectController * > objectsMap) |
Duplicates Objects to current a diagram. | |
bool | MakeBoxExecutable () |
JLGR 21-05-2012. | |
std::string | getDiagramBBS (bool wln=false) |
std::string | saveComplexBoxBBS () |
void | deleteObject (int id) |
void | AddControlerToBeRemove (std::vector< int > *controllersToRemove, int id) |
void | deleteAllBoxes () |
void | saveDiagram (std::string &content) |
void | loadDiagram (std::stringstream &inputStream) |
void | centerView () |
bool | boxExist (std::string boxname) |
std::string | generateANewNameForABox () |
std::string | findANewNameForABox () |
void | SetCbName (std::string cbNane) |
void | SetCbPackageName (std::string packagename) |
void | SetAuthor (std::string author) |
void | SetCategory (std::string category) |
void | SetDescription (std::string description) |
std::string | GetCbName () |
std::string | GetCbPackageName () |
std::string | GetAuthor () |
std::string | GetCategory () |
std::string | GetDescription () |
void | printAll (int com, int sta) |
Private Member Functions | |
std::string | LineNumber (bool withLineNumber, int &value) |
int | GetIndexInSelected (int idControler) |
void | UnSelectBlackBoxes () |
GObjectController * | GetGBlackBoxControlerPointedByMouse () |
void | CancelConnection () |
Private Attributes | |
std::string | _cbName |
std::string | _cbPackageName |
std::string | _Author |
std::string | _Category |
std::string | _Description |
wxGEditorTabPanel * | _parent |
int | _idManager |
int | _numBoxes |
bool | _startDragging |
wxVtk3DBaseView * | _baseView |
int | _worldState |
std::map< int, GObjectController * > | _controllers |
std::vector< int > | _selectedObjects |
bool | _isComplexBox |
int | _idConnectionInCreation |
int | _contLastId |
vtkTextActor3D * | _textActor |
vtkPoints * | _pts |
vtkActor * | _fillObjectActor |
vtkDataSetMapper * | _aPolygonMapper |
Definition at line 93 of file wxVtkSceneManager.h.
bbtk::wxVtkSceneManager::wxVtkSceneManager | ( | wxGEditorTabPanel * | parent, | |
wxVtk3DBaseView * | baseView, | |||
int | idManager | |||
) |
Definition at line 44 of file wxVtkSceneManager.cxx.
References _Author, _baseView, _Category, _cbName, _cbPackageName, _contLastId, _Description, _idConnectionInCreation, _idManager, _isComplexBox, _numBoxes, _parent, _startDragging, _worldState, configureBaseView(), bbtk::NOTHING_HAPPENS, and registerController().
00045 { 00046 _cbName = "ComplexBoxName"; 00047 _cbPackageName = "PackageName"; 00048 _Author = "Author ??"; 00049 _Category = "<VOID>"; 00050 _Description = "Description ??"; 00051 00052 _parent = parent; 00053 _numBoxes = 0; 00054 _idManager = idManager; 00055 _baseView = baseView; 00056 _startDragging = false; 00057 _isComplexBox = false; 00058 00059 if (_baseView != NULL) { 00060 //EED02JUIN2010 00061 printf( 00062 "RaC-EED 21-06-2010 %p wxVtkSceneManager::wxVtkSceneManager If you comment this line, the drag and drop functionnality is not initialized.\n", 00063 this); 00064 //#ifdef __APPLE__ 00065 _baseView->GetWxVTKRenderWindowInteractor()->SetDropTarget((wxDropTarget*)parent); 00066 //#endif 00067 00068 configureBaseView(); 00069 _worldState = NOTHING_HAPPENS; 00070 registerController(this); 00071 00072 } 00073 _idConnectionInCreation = -1; 00074 _contLastId = 0; 00075 00076 }
bbtk::wxVtkSceneManager::~wxVtkSceneManager | ( | ) |
Definition at line 88 of file wxVtkSceneManager.cxx.
References _baseView, and disconnectDrop().
00088 { 00089 //FCY memory leaks 00090 printf("EED %p ~wxVtkSceneManager() START\n", this); 00091 disconnectDrop(); 00092 delete _baseView; 00093 printf("EED %p ~wxVtkSceneManager() END\n", this); 00094 }
void bbtk::wxVtkSceneManager::AddControlerToBeRemove | ( | std::vector< int > * | controllersToRemove, | |
int | id | |||
) |
Definition at line 1125 of file wxVtkSceneManager.cxx.
Referenced by deleteObject().
01126 { 01127 01128 int i; 01129 bool ok = true; 01130 for (i = 0; i < (int) controllersToRemove->size(); i++) { 01131 if (id == (*controllersToRemove)[i]) { 01132 ok = false; 01133 } 01134 } 01135 01136 if (ok == true) { 01137 controllersToRemove->push_back(id); 01138 } 01139 01140 }
int bbtk::wxVtkSceneManager::addObjectController | ( | GObjectController * | objController | ) |
Definition at line 2286 of file wxVtkSceneManager.cxx.
References _contLastId, _controllers, and registerController().
Referenced by createGBlackBox(), createGComplexBoxInputPort(), createGComplexBoxOutputPort(), createGConnector(), and createGPort().
02286 { 02287 //Register the controller of the new object 02288 registerController((InteractorStyleMaracas*) objController); 02289 //Add the object to the objects list 02290 int newId = _contLastId;//_controllers.size(); 02291 objController->setId(newId); 02292 _controllers[newId] = objController; 02293 //std::cout << "DFCH: int wxVtkSceneManager::addObjectController(GObjectController* objController) ---- _contLastId = " << _contLastId << std::endl; 02294 _contLastId++; 02295 return newId; 02296 }
void bbtk::wxVtkSceneManager::addObjects | ( | std::map< int, GObjectController * > | objectsMap | ) |
Definition at line 2440 of file wxVtkSceneManager.cxx.
References _controllers, _idManager, createGBlackBox(), createGComplexBoxInputPort(), createGComplexBoxOutputPort(), createGConnector(), bbtk::GConnectorController::endContourCreation(), bbtk::GBLACKBOX, bbtk::GCONNECTOR, bbtk::GObjectModel::getBBTKName(), bbtk::GBlackBoxModel::getBBTKPackage(), bbtk::GObjectModel::getBBTKType(), bbtk::GBlackBoxModel::getConnectedInputs(), bbtk::GBlackBoxModel::getConnectedOutputs(), bbtk::GConnectorModel::getEndPort(), bbtk::GObjectController::getGObjectType(), bbtk::GObjectController::getId(), bbtk::GObjectModel::getInicPoint(), bbtk::GBoxModel::getInputPort(), bbtk::GObjectController::getModel(), bbtk::GBoxModel::getNumInputPorts(), bbtk::GObjectModel::getObjectId(), bbtk::GBoxModel::getOutputPort(), bbtk::GPortModel::getParentBox(), bbtk::GPortModel::getPosInBox(), bbtk::GConnectorModel::getStartPort(), bbtk::GBlackBoxModel::getValueInputPort(), bbtk::GObjectController::getView(), bbtk::Observable::notifyObservers(), bbtk::GConnectorModel::setEndPort(), bbtk::GBoxModel::setInicPoint(), bbtk::GBlackBoxModel::setValueToInputPort(), and bbtk::vtkGConnectorView::updateStartEndPoints().
Referenced by bbtk::wxGEditorTabPanel::addObjects().
02440 { 02441 02442 std::map<int, int> oldIdNewIdBoxes; 02443 std::vector<int> connections; 02444 02445 std::map<int, GObjectController*>::iterator it; 02446 for (it = objectsMap.begin(); it != objectsMap.end(); ++it) { 02447 GObjectController *cont = it->second; 02448 int type = cont->getGObjectType(); 02449 02450 if (type == GBLACKBOX) { 02451 // Copy black box 02452 double xInic, yInic, zInic; 02453 GBlackBoxModel* copyBox = (GBlackBoxModel*) cont->getModel(); 02454 copyBox->getInicPoint(xInic, yInic, zInic); 02455 int idBox = createGBlackBox(0, 0, copyBox->getBBTKPackage(), 02456 copyBox->getBBTKType()); 02457 02458 int idcB = copyBox->getObjectId(); 02459 oldIdNewIdBoxes[idcB] = idBox; 02460 cont = _controllers[idBox]; 02461 GBlackBoxModel* newbox = (GBlackBoxModel*) cont->getModel(); 02462 newbox->setInicPoint(xInic, yInic, zInic); 02463 int num = newbox->getNumInputPorts(); 02464 for (int j = 0; j < num; j++) { 02465 newbox->setValueToInputPort(j, copyBox->getValueInputPort(j)); 02466 } 02467 newbox->notifyObservers(_idManager); 02468 } else if (type == GCONNECTOR) { 02469 int idCon = cont->getId(); 02470 connections.push_back(idCon); 02471 } 02472 02473 } 02474 02475 for (int i = 0; i < (int) connections.size(); i++) { 02476 int objId = connections[i]; 02477 GObjectController *cont = objectsMap[objId]; 02478 GConnectorModel* connectModel = (GConnectorModel*) cont->getModel(); 02479 02480 GPortModel* startPort = connectModel->getStartPort(); 02481 int startPortIndex = startPort->getPosInBox(); 02482 GPortModel* endPort = connectModel->getEndPort(); 02483 int endPortIndex = endPort->getPosInBox(); 02484 02485 GBlackBoxModel* startPortParentBox = 02486 (GBlackBoxModel*) startPort->getParentBox(); 02487 GBlackBoxModel* endPortParentBox = 02488 (GBlackBoxModel*) endPort->getParentBox(); 02489 02490 int idNewStartBox = oldIdNewIdBoxes[startPortParentBox->getObjectId()]; 02491 int idNewEndBox = oldIdNewIdBoxes[endPortParentBox->getObjectId()]; 02492 02493 GBlackBoxModel* newStartBox = 02494 (GBlackBoxModel*) _controllers[idNewStartBox]->getModel(); 02495 GBlackBoxModel* newEndBox = 02496 (GBlackBoxModel*) _controllers[idNewEndBox]->getModel(); 02497 02498 GPortModel* newStartPort = newStartBox->getOutputPort(startPortIndex); 02499 GPortModel* newEndPort = newEndBox->getInputPort(endPortIndex); 02500 02501 // Creates connection 02502 int idCon = createGConnector(newStartPort); 02503 GConnectorController *tempp = 02504 (GConnectorController*) _controllers[idCon]; 02505 GConnectorModel *conMod = (GConnectorModel*) tempp->getModel(); 02506 vtkGConnectorView *conView = (vtkGConnectorView*) tempp->getView(); 02507 tempp->endContourCreation(); 02508 conMod->setEndPort(newEndPort); 02509 conView->updateStartEndPoints(); 02510 } 02511 02512 std::map<int, int>::iterator itIds; 02513 for (itIds = oldIdNewIdBoxes.begin(); itIds != oldIdNewIdBoxes.end(); ++itIds) { 02514 int idOld = itIds->first; 02515 int idNew = itIds->second; 02516 02517 GBlackBoxModel* oldBox = 02518 (GBlackBoxModel*) objectsMap[idOld]->getModel(); 02519 GBlackBoxModel* newBox = 02520 (GBlackBoxModel*) _controllers[idNew]->getModel(); 02521 02522 std::vector<int> oldInputConnections = oldBox->getConnectedInputs(); 02523 std::vector<int> oldOutputConnections = oldBox->getConnectedOutputs(); 02524 std::vector<int> newInputConnections = newBox->getConnectedInputs(); 02525 std::vector<int> newOutputConnections = newBox->getConnectedOutputs(); 02526 02527 for (int k = 0; k < (int) oldInputConnections.size(); k++) { 02528 bool exist = false; 02529 //EED int toCreate=-1; 02530 for (int l = 0; l < (int) newInputConnections.size() && !exist; l++) { 02531 if (oldInputConnections[k] == newInputConnections[l]) { 02532 exist = true; 02533 } 02534 } 02535 02536 if (exist == false) { 02537 //Create complex input 02538 int posInBox = oldInputConnections[k]; 02539 GPortModel* inputPort = oldBox->getInputPort(posInBox); 02540 std::string inputPortName = inputPort->getBBTKName(); 02541 int idInputPort = createGComplexBoxInputPort(inputPortName); 02542 GObjectController *cont = _controllers[idInputPort]; 02543 GBoxModel *cbmod = (GBoxModel*) cont->getModel(); 02544 double xIn, yIn, zIn; 02545 inputPort->getInicPoint(xIn, yIn, zIn); 02546 yIn += 20; 02547 cbmod->setInicPoint(xIn, yIn, zIn); 02548 cbmod->notifyObservers(_idManager); 02549 02550 GPortModel* inputPortEnd = newBox->getInputPort(posInBox); 02551 02552 // Creates connection 02553 int idCon = createGConnector(cbmod->getOutputPort(0)); 02554 GConnectorController *tempp = 02555 (GConnectorController*) _controllers[idCon]; 02556 GConnectorModel *conMod = (GConnectorModel*) tempp->getModel(); 02557 vtkGConnectorView *conView = 02558 (vtkGConnectorView*) tempp->getView(); 02559 tempp->endContourCreation(); 02560 conMod->setEndPort(inputPortEnd); 02561 conView->updateStartEndPoints(); 02562 02563 } 02564 02565 } 02566 02567 for (int k = 0; k < (int) oldOutputConnections.size(); k++) { 02568 bool exist = false; 02569 //EED int toCreate=-1; 02570 for (int l = 0; l < (int) newOutputConnections.size() && !exist; l++) { 02571 if (oldOutputConnections[k] == newOutputConnections[l]) { 02572 exist = true; 02573 } 02574 } 02575 02576 if (exist == false) { 02577 //Create complex output 02578 int posInBox = oldOutputConnections[k]; 02579 GPortModel* outputPort = oldBox->getOutputPort(posInBox); 02580 std::string outputPortName = outputPort->getBBTKName(); 02581 int idOutputPort = createGComplexBoxOutputPort(outputPortName); 02582 GObjectController *cont = _controllers[idOutputPort]; 02583 GBoxModel *cbmod = (GBoxModel*) cont->getModel(); 02584 double xIn, yIn, zIn; 02585 outputPort->getInicPoint(xIn, yIn, zIn); 02586 yIn -= 20; 02587 cbmod->setInicPoint(xIn, yIn, zIn); 02588 cbmod->notifyObservers(_idManager); 02589 02590 GPortModel* outputPortEnd = newBox->getOutputPort(posInBox); 02591 02592 // Creates connection 02593 int idCon = createGConnector(outputPortEnd); 02594 GConnectorController *tempp = 02595 (GConnectorController*) _controllers[idCon]; 02596 GConnectorModel *conMod = (GConnectorModel*) tempp->getModel(); 02597 vtkGConnectorView *conView = 02598 (vtkGConnectorView*) tempp->getView(); 02599 tempp->endContourCreation(); 02600 conMod->setEndPort(cbmod->getInputPort(0)); 02601 conView->updateStartEndPoints(); 02602 02603 } 02604 02605 } 02606 02607 } 02608 02609 }
bool bbtk::wxVtkSceneManager::boxExist | ( | std::string | boxname | ) |
Definition at line 2204 of file wxVtkSceneManager.cxx.
References _controllers, bbtk::GObjectModel::getBBTKName(), and bbtk::GObjectController::getModel().
Referenced by bbtk::wxGUIEditorGraphicBBS::boxNameExists(), and findANewNameForABox().
02204 { 02205 bool ok = false; 02206 std::map<int, GObjectController*>::iterator it; 02207 for (it = _controllers.begin(); it != _controllers.end(); ++it) { 02208 GObjectController *cont = it->second; 02209 if (cont->getModel()->getBBTKName() == boxname) { 02210 ok = true; 02211 } 02212 } 02213 return ok; 02214 }
void bbtk::wxVtkSceneManager::CancelConnection | ( | ) | [private] |
Definition at line 947 of file wxVtkSceneManager.cxx.
References _controllers, _idConnectionInCreation, _idManager, _worldState, bbtk::GObjectController::getModel(), bbtk::GObjectController::getView(), bbtk::INIT_CREATION_CONTOUR, bbtk::NOTHING_HAPPENS, bbtk::Observable::notifyObservers(), bbtk::GConnectorController::removeFromScene(), bbtk::vtkGObjectView::setState(), and unregisterController().
Referenced by OnLeftButtonDown(), and OnRightButtonUp().
00947 { 00948 if (_worldState == INIT_CREATION_CONTOUR) { 00949 _worldState = NOTHING_HAPPENS; 00950 //int lastId = _controllers.size()-1; 00951 00952 GConnectorController *connector = 00953 (GConnectorController*) _controllers[_idConnectionInCreation]; 00954 connector->removeFromScene(); 00955 unregisterController(connector); 00956 _controllers.erase(_idConnectionInCreation); 00957 00958 std::map<int, GObjectController*>::iterator it; 00959 for (it = _controllers.begin(); it != _controllers.end(); ++it) { 00960 GObjectController *desc = it->second; 00961 desc->SetActive(true); 00962 desc->getView()->setState(NOTHING_HAPPENS); 00963 desc->getModel()->notifyObservers(_idManager); 00964 } // for 00965 }// if 00966 }
void bbtk::wxVtkSceneManager::centerView | ( | ) |
Definition at line 1650 of file wxVtkSceneManager.cxx.
References _baseView.
Referenced by bbtk::wxGEditorTabPanel::centerView().
01650 { 01651 double temp[3]; 01652 _baseView->GetRenderer()->GetActiveCamera()->GetFocalPoint(temp); 01653 _baseView->GetRenderer()->GetActiveCamera()->SetFocalPoint(0, 0, temp[2]); 01654 _baseView->GetRenderer()->GetActiveCamera()->GetPosition(temp); 01655 _baseView->GetRenderer()->GetActiveCamera()->SetPosition(0, 0, temp[2]); 01656 }
void bbtk::wxVtkSceneManager::configGBlackBox | ( | int | idBox, | |
double | xIn, | |||
double | yIn, | |||
double | zIn, | |||
std::string | name, | |||
bool | boxExecutable, | |||
double | xEn, | |||
double | yEn, | |||
double | zEn | |||
) |
Definition at line 217 of file wxVtkSceneManager.cxx.
References _controllers, _idManager, bbtk::GObjectController::getModel(), bbtk::Observable::notifyObservers(), bbtk::GObjectModel::setBBTKName(), bbtk::GBlackBoxModel::setExecutable(), bbtk::GObjectModel::setFinalPoint(), and bbtk::GBoxModel::setInicPoint().
Referenced by bbtk::InterpreterBBS::commandNew().
00219 { 00220 GObjectController *cont = _controllers[idBox]; 00221 GBlackBoxModel *bbmod = (GBlackBoxModel*) cont->getModel(); 00222 bbmod->setBBTKName(name); 00223 bbmod->setInicPoint(xIn, yIn, zIn); 00224 bbmod->setFinalPoint(xEn, yEn, zEn); 00225 bbmod->setExecutable(boxExecutable); 00226 00227 bbmod->notifyObservers(_idManager); 00228 00229 }
void bbtk::wxVtkSceneManager::configGComBoxInputOutputPort | ( | bool | inputoutput, | |
std::string | inputPortName, | |||
double | xIn, | |||
double | yIn, | |||
double | zIn | |||
) |
Definition at line 2107 of file wxVtkSceneManager.cxx.
References _controllers, _idManager, createGComplexBoxInputPort(), createGComplexBoxOutputPort(), bbtk::GObjectController::getModel(), bbtk::Observable::notifyObservers(), and bbtk::GBoxModel::setInicPoint().
Referenced by bbtk::InterpreterBBS::commandInput(), and bbtk::InterpreterBBS::commandOutput().
02108 { 02109 int idPort; 02110 if (inputoutput == true) { 02111 idPort = createGComplexBoxInputPort(portName); 02112 } else { 02113 idPort = createGComplexBoxOutputPort(portName); 02114 } 02115 GObjectController *cont = _controllers[idPort]; 02116 GBoxModel *cbmod = (GBoxModel*) cont->getModel(); 02117 cbmod->setInicPoint(xIn, yIn, zIn); 02118 cbmod->notifyObservers(_idManager); 02119 }
int bbtk::wxVtkSceneManager::configGConnetion | ( | std::string | nameStartBox, | |
std::string | nameStartPort, | |||
std::string | nameEndBox, | |||
std::string | nameEndPort | |||
) |
Definition at line 2165 of file wxVtkSceneManager.cxx.
References _controllers, _worldState, createGConnector(), bbtk::GConnectorController::endContourCreation(), findGBox(), bbtk::GBoxModel::getInputPort(), bbtk::GObjectController::getModel(), bbtk::GBoxModel::getOutputPort(), bbtk::GObjectController::getView(), bbtk::NOTHING_HAPPENS, bbtk::GConnectorModel::setEndPort(), and bbtk::vtkGConnectorView::updateStartEndPoints().
Referenced by bbtk::InterpreterBBS::commandConnection(), bbtk::InterpreterBBS::commandInput(), and bbtk::InterpreterBBS::commandOutput().
02167 { 02168 02169 GBoxModel *boxModel; 02170 GPortModel *startP = NULL; 02171 GPortModel *endP = NULL; 02172 02173 boxModel = findGBox(nameStartBox); 02174 if (boxModel != NULL) { 02175 startP = boxModel->getOutputPort(nameStartPort); 02176 if(startP == NULL){ 02177 printf("SCP: ERROR in wxVtkSceneManager::configGConnetion start port %s is null. Port name is probably wrong.\n", nameStartPort.c_str()); 02178 } 02179 } 02180 02181 boxModel = findGBox(nameEndBox); 02182 if (boxModel != NULL) { 02183 endP = boxModel->getInputPort(nameEndPort); 02184 if(endP == NULL){ 02185 printf("SCP: ERROR in wxVtkSceneManager::configGConnetion end port %s is null. Port name is probably wrong\n", nameStartPort.c_str(), nameEndPort.c_str()); 02186 } 02187 } 02188 02189 //ups2 02190 int idCon = createGConnector(startP); 02191 _worldState = NOTHING_HAPPENS; 02192 GConnectorController *tempp = (GConnectorController*) _controllers[idCon]; 02193 02194 GConnectorModel *conMod = (GConnectorModel*) tempp->getModel(); 02195 vtkGConnectorView *conView = (vtkGConnectorView*) tempp->getView(); 02196 tempp->endContourCreation(); 02197 conMod->setEndPort(endP); 02198 conView->updateStartEndPoints(); 02199 return idCon; 02200 }
void bbtk::wxVtkSceneManager::configureBaseView | ( | ) |
Definition at line 98 of file wxVtkSceneManager.cxx.
References _aPolygonMapper, _baseView, _fillObjectActor, _pts, _textActor, bbtk::PORTFILL_NH_B, bbtk::PORTFILL_NH_G, bbtk::PORTFILL_NH_R, bbtk::PORTTEXT_NH_B, bbtk::PORTTEXT_NH_G, and bbtk::PORTTEXT_NH_R.
Referenced by wxVtkSceneManager().
00098 { 00099 printf("EED wxVtkSceneManager::configureBaseView 0\n"); 00100 vtkInteractorStyleBaseView2D *interactorstylebaseview = 00101 vtkInteractorStyleBaseView2D::New(); 00102 00103 _baseView->SetInteractorStyleBaseView(interactorstylebaseview); 00104 00105 // Important to activate the 2D interaction system 00106 wxVTKRenderWindowInteractor *iren = 00107 _baseView->GetWxVTKRenderWindowInteractor(); 00108 interactorstylebaseview->SetInteractor(iren); 00109 iren->SetInteractorStyle(interactorstylebaseview); 00110 interactorstylebaseview->SetwxVtkBaseView(_baseView); 00111 00112 _baseView->GetRenderer()->GetActiveCamera()->ParallelProjectionOn(); 00113 _baseView->GetRenderer()->ResetCamera(-100, 100, -100, 100, 800, 1100); 00114 00115 _baseView->GetRenderer()->SetBackground(0.9, 0.9, 0.9); 00116 _baseView->GetRenderer()->GradientBackgroundOn(); 00117 00118 // Actos Port_Text 00119 _textActor = vtkTextActor3D::New(); 00120 _textActor->SetPosition(-9999, -9999, 900); 00121 _textActor->SetInput("<void>"); 00122 _textActor->GetTextProperty()->SetFontSize(60); 00123 _textActor->GetTextProperty()->BoldOn(); 00124 _textActor->GetTextProperty()->SetColor(PORTTEXT_NH_R, PORTTEXT_NH_G, 00125 PORTTEXT_NH_B); 00126 00127 _baseView->GetRenderer()->AddActor(_textActor); 00128 00129 // Actor Fill_Port_Text 00130 00131 //------------ 00132 double xInic = 0; 00133 double yInic = 0; 00134 double zInic = 900; 00135 00136 vtkPolygon *aPolygon = vtkPolygon::New(); 00137 _fillObjectActor = vtkActor::New(); 00138 00139 _pts = vtkPoints::New(); 00140 00141 double w = 100, h = 10, b = h / 15, t = 3; 00142 _pts->SetNumberOfPoints(21); 00143 _pts->InsertPoint(0, xInic + w * 0.33 - t / 2, yInic, zInic); 00144 _pts->InsertPoint(1, xInic + w * 0.33, yInic - t, zInic); 00145 _pts->InsertPoint(2, xInic + w * 0.33 + t / 2, yInic, zInic); 00146 _pts->InsertPoint(3, xInic + w * 0.33 + t / 2, yInic, zInic); 00147 _pts->InsertPoint(4, xInic + w - b * 4, yInic + b * 0, zInic); 00148 00149 _pts->InsertPoint(5, xInic + w - b * 4, yInic + b * 0, zInic); 00150 _pts->InsertPoint(6, xInic + w - b * 2, yInic + b * 1, zInic); 00151 _pts->InsertPoint(7, xInic + w - b * 1, yInic + b * 2, zInic); 00152 _pts->InsertPoint(8, xInic + w - b * 0, yInic + b * 4, zInic); 00153 00154 _pts->InsertPoint(9, xInic + w - b * 0, yInic + h - b * 4, zInic); 00155 _pts->InsertPoint(10, xInic + w - b * 1, yInic + h - b * 2, zInic); 00156 _pts->InsertPoint(11, xInic + w - b * 2, yInic + h - b * 1, zInic); 00157 _pts->InsertPoint(12, xInic + w - b * 4, yInic + h - b * 0, zInic); 00158 00159 _pts->InsertPoint(13, xInic + b * 4, yInic + h - b * 0, zInic); 00160 _pts->InsertPoint(14, xInic + b * 2, yInic + h - b * 1, zInic); 00161 _pts->InsertPoint(15, xInic + b * 1, yInic + h - b * 2, zInic); 00162 _pts->InsertPoint(16, xInic + b * 0, yInic + h - b * 4, zInic); 00163 00164 _pts->InsertPoint(17, xInic + b * 0, yInic + b * 4, zInic); 00165 _pts->InsertPoint(18, xInic + b * 1, yInic + b * 2, zInic); 00166 _pts->InsertPoint(19, xInic + b * 2, yInic + b * 1, zInic); 00167 _pts->InsertPoint(20, xInic + b * 4, yInic + b * 0, zInic); 00168 00169 aPolygon->GetPointIds()->SetNumberOfIds(21); 00170 for (int i = 0; i < 21; i++) { 00171 aPolygon->GetPointIds()->SetId(i, i); 00172 } 00173 00174 vtkUnstructuredGrid *aPolygonGrid = vtkUnstructuredGrid::New(); 00175 aPolygonGrid->Allocate(1, 1); 00176 aPolygonGrid->InsertNextCell(aPolygon->GetCellType(), 00177 aPolygon->GetPointIds()); 00178 aPolygonGrid->SetPoints(_pts); 00179 _aPolygonMapper = vtkDataSetMapper::New(); 00180 _aPolygonMapper->SetInput(aPolygonGrid); 00181 _fillObjectActor->SetMapper(_aPolygonMapper); 00182 _fillObjectActor->GetProperty()->SetColor(PORTFILL_NH_R, PORTFILL_NH_G, 00183 PORTFILL_NH_B); 00184 _fillObjectActor->GetProperty()->SetOpacity(0); 00185 _aPolygonMapper->Modified(); 00186 00187 _baseView->GetRenderer()->AddActor(_fillObjectActor); 00188 printf("EED wxVtkSceneManager::configureBaseView 1\n"); 00189 }
int bbtk::wxVtkSceneManager::createGBlackBox | ( | int | x, | |
int | y, | |||
std::string | packageName, | |||
std::string | boxType | |||
) |
JLGR 21-05-2012.
Definition at line 233 of file wxVtkSceneManager.cxx.
References _baseView, _idManager, _worldState, addObjectController(), bbtk::Observable::addObserver(), createGInputPort(), bbtk::GObjectsMVCFactory::createGObjectController(), bbtk::GObjectsMVCFactory::createGObjectModel(), bbtk::GObjectsMVCFactory::createGObjectView(), createGOutputPort(), findANewNameForABox(), bbtk::GBLACKBOX, bbtk::GObjectsMVCFactory::getBlackBoxDescriptor(), bbtk::GObjectsMVCFactory::getInstance(), bbtk::GINPUTPORT, bbtk::GOUTPUTPORT, bbtk::vtkGObjectView::initVtkObjects(), bbtk::NOTHING_HAPPENS, bbtk::Observable::notifyObservers(), bbtk::vtkGObjectView::setBaseView(), bbtk::GObjectModel::setBBTKName(), bbtk::GBlackBoxModel::setBBTKPackage(), bbtk::GObjectModel::setBBTKType(), bbtk::GBoxModel::setInicPoint(), bbtk::vtkGObjectView::setModel(), and bbtk::GObjectController::setModelAndView().
Referenced by addObjects(), bbtk::InterpreterBBS::commandNew(), DuplicateObjects(), bbtk::wxGUIEditorGraphicBBS::OnClickBtnBox(), and bbtk::wxGEditorTabPanel::OnDropText().
00234 { 00235 _worldState = NOTHING_HAPPENS; 00236 //EED int windowWidth = _baseView->GetRenWin()->GetSize()[0]; 00237 int windowHeight = _baseView->GetRenWin()->GetSize()[1]; 00238 00239 int type = GBLACKBOX; 00240 00241 //Create the MVC Objects 00242 00243 GBlackBoxModel 00244 *model = 00245 (GBlackBoxModel*) GObjectsMVCFactory::getInstance()->createGObjectModel( 00246 type); 00247 vtkGObjectView *view = 00248 GObjectsMVCFactory::getInstance()->createGObjectView(type); 00249 GObjectController* controller = 00250 GObjectsMVCFactory::getInstance()->createGObjectController(type); 00251 00252 BlackBoxDescriptor::Pointer descriptor = 00253 GObjectsMVCFactory::getInstance()->getBlackBoxDescriptor( 00254 packageName, boxType); 00255 if (descriptor == NULL){ 00256 printf("SCP: ERROR in wxVtkSceneManager::createGBlackBox, box %s probably does not exist.\n", boxType.c_str()); 00257 } 00258 //Prepares the initial model 00259 //The coordinates obtained are the following. Top-Left:x=0,y=0 Bottom-Right:x=width,y=height 00260 00261 double xx = x; 00262 double yy = windowHeight - y; 00263 00264 //z value is not important yet, because it is only used a parallel projection 00265 double zz = 900; 00266 _baseView->TransCoordScreenToWorld(xx, yy, zz); 00267 model->setInicPoint(xx, yy, zz); 00268 00269 std::stringstream stream; 00270 00271 std::string newBoxName; 00272 newBoxName = findANewNameForABox(); 00273 00274 stream << newBoxName; 00275 00276 std::string arraystring = stream.str(); 00277 00278 model->setBBTKName(arraystring); 00279 model->setBBTKType(boxType); 00280 model->setBBTKPackage(packageName); 00281 00282 model->addObserver(view); 00283 model->addObserver(this); 00284 00285 //Iterate and create the input ports 00286 std::map<std::string, BlackBoxInputDescriptor*> descriptorInMap = 00287 descriptor->GetInputDescriptorMap(); 00288 std::map<std::string, BlackBoxInputDescriptor*>::iterator itInput; 00289 00290 int i = 0; 00291 for (itInput = descriptorInMap.begin(); itInput != descriptorInMap.end(); ++itInput) { 00292 BlackBoxInputDescriptor *desc = itInput->second; 00293 createGInputPort(GINPUTPORT, i, model, desc); 00294 i++; 00295 } 00296 00297 //Iterate and create the output ports 00298 std::map<std::string, BlackBoxOutputDescriptor*> descriptorOutMap = 00299 descriptor->GetOutputDescriptorMap(); 00300 std::map<std::string, BlackBoxOutputDescriptor*>::iterator itOutput; 00301 00302 i = 0; 00303 for (itOutput = descriptorOutMap.begin(); itOutput 00304 != descriptorOutMap.end(); ++itOutput) { 00305 BlackBoxOutputDescriptor *desc = itOutput->second; 00306 createGOutputPort(GOUTPUTPORT, i, model, desc); 00307 i++; 00308 } 00309 00310 //Associates the view with the correspondent renderer and the model. 00311 //(NOTE: Refresh is only made by the view) 00312 view->setModel(model); 00313 view->setBaseView(_baseView); 00314 view->initVtkObjects(); 00315 00316 //Associates the controller with the correspondent model and view 00317 controller->setModelAndView(model, view); 00318 00319 //Resgiter change to the observers of the actual model 00320 model->notifyObservers(_idManager); 00321 00322 int newId = addObjectController(controller); 00323 00324 return newId; 00325 00326 }
int bbtk::wxVtkSceneManager::createGComplexBoxInputPort | ( | std::string | inputName | ) |
Definition at line 330 of file wxVtkSceneManager.cxx.
References _baseView, _idManager, addObjectController(), bbtk::Observable::addObserver(), bbtk::GBoxModel::addOutputPort(), bbtk::GObjectsMVCFactory::createGObjectController(), bbtk::GObjectsMVCFactory::createGObjectModel(), bbtk::GObjectsMVCFactory::createGObjectView(), createGPort(), bbtk::GCOMPLEXINPUTPORT, bbtk::GObjectsMVCFactory::getInstance(), bbtk::GObjectController::getModel(), bbtk::GOUTPUTPORT, bbtk::vtkGObjectView::initVtkObjects(), bbtk::Observable::notifyObservers(), bbtk::vtkGObjectView::setBaseView(), bbtk::GObjectModel::setBBTKName(), bbtk::GObjectModel::setBBTKType(), bbtk::GComplexBoxPortModel::setComplexPortType(), bbtk::GComplexBoxPortModel::setInicPoint(), bbtk::vtkGObjectView::setModel(), and bbtk::GObjectController::setModelAndView().
Referenced by bbtk::wxGEditorTabPanel::addComplexInputPort(), addObjects(), and configGComBoxInputOutputPort().
00330 { 00331 //EED int windowWidth=_baseView->GetRenWin()->GetSize()[0]; 00332 int windowHeight = _baseView->GetRenWin()->GetSize()[1]; 00333 00334 int type = GCOMPLEXINPUTPORT; 00335 00336 //Create the MVC Objects 00337 00338 GComplexBoxPortModel 00339 *model = 00340 (GComplexBoxPortModel*) GObjectsMVCFactory::getInstance()->createGObjectModel( 00341 type); 00342 vtkGObjectView *view = 00343 GObjectsMVCFactory::getInstance()->createGObjectView(type); 00344 GObjectController* controller = 00345 GObjectsMVCFactory::getInstance()->createGObjectController(type); 00346 00347 //Prepares the initial model 00348 00349 double xx = 5; 00350 double yy = windowHeight - 5; 00351 00352 //z value is not important yet, because it is only used a parallel projection 00353 double zz = 900; 00354 printf("EED wxVtkSceneManager::createGComplexBoxInputPort 900-450\n"); 00355 00356 _baseView->TransCoordScreenToWorld(xx, yy, zz); 00357 model->setInicPoint(xx, yy, zz); 00358 00359 model->setBBTKName(inputName); 00360 model->setBBTKType("ComplexInputPort"); 00361 model->setComplexPortType(type); 00362 00363 model->addObserver(view); 00364 model->addObserver(this); 00365 00366 //create the output port 00367 GPortController* portController = createGPort(GOUTPUTPORT, inputName, 00368 "ComplexInputPort", 0, model); 00369 model->addOutputPort((GPortModel*) portController->getModel()); 00370 00371 //Associates the view with the correspondent renderer and the model. 00372 //(NOTE: Refresh is only made by the view) 00373 view->setModel(model); 00374 view->setBaseView(_baseView); 00375 view->initVtkObjects(); 00376 00377 //Associates the controller with the correspondent model and view 00378 controller->setModelAndView(model, view); 00379 00380 //Resgiter change to the observers of the actual model 00381 model->notifyObservers(_idManager); 00382 00383 int newId = addObjectController(controller); 00384 return newId; 00385 }
int bbtk::wxVtkSceneManager::createGComplexBoxOutputPort | ( | std::string | outputName | ) |
Definition at line 389 of file wxVtkSceneManager.cxx.
References _baseView, _idManager, bbtk::GBoxModel::addInputPort(), addObjectController(), bbtk::Observable::addObserver(), bbtk::GObjectsMVCFactory::createGObjectController(), bbtk::GObjectsMVCFactory::createGObjectModel(), bbtk::GObjectsMVCFactory::createGObjectView(), createGPort(), bbtk::GCOMPLEXOUTPUTPORT, bbtk::GObjectsMVCFactory::getInstance(), bbtk::GObjectController::getModel(), bbtk::GINPUTPORT, bbtk::vtkGObjectView::initVtkObjects(), bbtk::Observable::notifyObservers(), bbtk::vtkGObjectView::setBaseView(), bbtk::GObjectModel::setBBTKName(), bbtk::GObjectModel::setBBTKType(), bbtk::GComplexBoxPortModel::setComplexPortType(), bbtk::GComplexBoxPortModel::setInicPoint(), bbtk::vtkGObjectView::setModel(), and bbtk::GObjectController::setModelAndView().
Referenced by bbtk::wxGEditorTabPanel::addComplexOutputPort(), addObjects(), and configGComBoxInputOutputPort().
00389 { 00390 //EED int windowWidth=_baseView->GetRenWin()->GetSize()[0]; 00391 int windowHeight = _baseView->GetRenWin()->GetSize()[1]; 00392 00393 int type = GCOMPLEXOUTPUTPORT; 00394 00395 //Create the MVC Objects 00396 00397 GComplexBoxPortModel 00398 *model = 00399 (GComplexBoxPortModel*) GObjectsMVCFactory::getInstance()->createGObjectModel( 00400 type); 00401 vtkGObjectView *view = 00402 GObjectsMVCFactory::getInstance()->createGObjectView(type); 00403 GObjectController *controller = 00404 GObjectsMVCFactory::getInstance()->createGObjectController(type); 00405 00406 //Prepares the initial model 00407 00408 double xx = 5; 00409 double yy = windowHeight - 5; 00410 00411 //z value is not important yet, because it is only used a parallel projection 00412 double zz = 900; 00413 00414 printf("EED wxVtkSceneManager::createGComplexBoxOutputPort 900-450\n"); 00415 00416 _baseView->TransCoordScreenToWorld(xx, yy, zz); 00417 model->setInicPoint(xx, yy, zz); 00418 00419 model->setBBTKName(outputName); 00420 model->setBBTKType("ComplexOutputPort"); 00421 model->setComplexPortType(type); 00422 00423 model->addObserver(view); 00424 model->addObserver(this); 00425 00426 //create the output port 00427 GPortController* portController = createGPort(GINPUTPORT, outputName, 00428 "ComplexInputPort", 0, model); 00429 model->addInputPort((GPortModel*) portController->getModel()); 00430 00431 //Associates the view with the correspondent renderer and the model. 00432 //(NOTE: Refresh is only made by the view) 00433 view->setModel(model); 00434 view->setBaseView(_baseView); 00435 view->initVtkObjects(); 00436 00437 //Associates the controller with the correspondent model and view 00438 controller->setModelAndView(model, view); 00439 00440 //Resgiter change to the observers of the actual model 00441 model->notifyObservers(_idManager); 00442 00443 int newId = addObjectController(controller); 00444 return newId; 00445 }
int bbtk::wxVtkSceneManager::createGConnector | ( | GPortModel * | startPort | ) |
JGRR AND CM Width increased from 2 to 5, it simplifies line handling and spline control :P
WidthLine |
Definition at line 510 of file wxVtkSceneManager.cxx.
References _baseView, addObjectController(), bbtk::Observable::addObserver(), bbtk::GCONNECTOR, bbtk::GObjectModel::getInicPoint(), bbtk::vtkGObjectView::setBaseView(), bbtk::GObjectModel::setGObjectType(), bbtk::GConnectorController::setManualContourController(), bbtk::GConnectorModel::setManualContourModel(), bbtk::vtkGConnectorView::setManualContourView(), bbtk::vtkGObjectView::setModel(), bbtk::GObjectController::setModelAndView(), and bbtk::GConnectorModel::setStartPort().
Referenced by addObjects(), configGConnetion(), DuplicateObjects(), and update().
00510 { 00511 int type = GCONNECTOR; 00512 00513 manualConnectorContourController* manContourControl = 00514 new manualConnectorContourController(); 00515 manualConnectorContourView* manContourView = 00516 new manualConnectorContourView(); 00517 manualContourModel* manContourModel = new manualContourModel(); 00518 00519 GConnectorController* connectorcontroller = new GConnectorController(); 00520 GConnectorModel* connectorModel = new GConnectorModel(); 00521 vtkGConnectorView* connectorView = new vtkGConnectorView(); 00522 connectorModel->setGObjectType(type); 00523 00524 manContourModel->SetCloseContour(false); 00525 connectorModel->setStartPort(startPort); 00526 00527 manContourView->SetModel(manContourModel); 00528 manContourView->SetWxVtkBaseView(_baseView); 00529 manContourView->SetRange(0.5); 00530 manContourView->SetZ(900); 00531 00532 manContourView->SetColorNormalContour(0, 0, 1); 00533 manContourView->SetColorEditContour(0.5, 0.5, 0.5); 00534 manContourView->SetColorSelectContour(1, 0.8, 0); 00535 00541 manContourView->SetWidthLine( 3 ) ; 00542 manContourView->SetShowText(false); 00543 00544 manContourControl->SetModelView(manContourModel, manContourView); 00545 00546 manContourControl->CreateNewManualContour(); 00547 00548 00549 double x, y, z; 00550 connectorModel->getInicPoint(x, y, z); 00551 00552 manContourControl->SetState(1); 00553 manContourModel->SetCloseContour(false); 00554 00555 manContourModel->AddPoint(x, y, z); 00556 manContourView->AddPoint(); 00557 00558 manContourModel->AddPoint(x, y, z); 00559 manContourView->AddPoint(); 00560 00561 int bak = manContourControl->GetNumberOfPointsManualContour() - 1; 00562 manContourControl->_bakIdPoint = bak; 00563 00564 manContourControl->SetMoving(false); 00565 00566 connectorcontroller->setModelAndView(connectorModel, connectorView); 00567 00568 int newId = addObjectController(connectorcontroller); 00569 00570 connectorcontroller->setManualContourController(manContourControl); 00571 connectorModel->setManualContourModel(manContourModel); 00572 connectorView->setManualContourView(manContourView); 00573 connectorView->setModel(connectorModel); 00574 connectorView->setBaseView(_baseView); 00575 00576 connectorModel->addObserver(connectorView); 00577 connectorModel->addObserver(this); 00578 00579 manContourView->Refresh(); 00580 return newId; 00581 }
int bbtk::wxVtkSceneManager::createGInputPort | ( | int | portType, | |
int | posinBox, | |||
GBoxModel * | blackBox, | |||
BlackBoxInputDescriptor * | desc | |||
) |
Definition at line 449 of file wxVtkSceneManager.cxx.
References bbtk::GBoxModel::addInputPort(), createGPort(), bbtk::GObjectController::getId(), and bbtk::GObjectController::getModel().
Referenced by createGBlackBox().
00450 { 00451 GPortController* portController = createGPort(portType, desc->GetName(), 00452 desc->GetTypeName(), posinBox, blackBox); 00453 blackBox->addInputPort((GPortModel*) portController->getModel()); 00454 return portController->getId(); 00455 }
int bbtk::wxVtkSceneManager::createGOutputPort | ( | int | portType, | |
int | posinBox, | |||
GBoxModel * | blackBox, | |||
BlackBoxOutputDescriptor * | desc | |||
) |
Definition at line 459 of file wxVtkSceneManager.cxx.
References bbtk::GBoxModel::addOutputPort(), createGPort(), bbtk::GObjectController::getId(), and bbtk::GObjectController::getModel().
Referenced by createGBlackBox().
00460 { 00461 GPortController* portController = createGPort(portType, desc->GetName(), 00462 desc->GetTypeName(), posinBox, blackBox); 00463 blackBox->addOutputPort((GPortModel*) portController->getModel()); 00464 return portController->getId(); 00465 }
GPortController * bbtk::wxVtkSceneManager::createGPort | ( | int | portType, | |
std::string | bbtkName, | |||
std::string | bbtkType, | |||
int | posinBox, | |||
GBoxModel * | blackBox | |||
) |
Definition at line 469 of file wxVtkSceneManager.cxx.
References _baseView, _idManager, addObjectController(), bbtk::Observable::addObserver(), bbtk::GObjectsMVCFactory::createGObjectController(), bbtk::GObjectsMVCFactory::createGObjectModel(), bbtk::GObjectsMVCFactory::createGObjectView(), bbtk::GObjectsMVCFactory::getInstance(), bbtk::GPORT, bbtk::vtkGObjectView::initVtkObjects(), bbtk::Observable::notifyObservers(), bbtk::GPortModel::registerInBox(), bbtk::vtkGObjectView::setBaseView(), bbtk::GObjectModel::setBBTKName(), bbtk::GObjectModel::setBBTKType(), bbtk::vtkGObjectView::setModel(), and bbtk::GObjectController::setModelAndView().
Referenced by createGComplexBoxInputPort(), createGComplexBoxOutputPort(), createGInputPort(), and createGOutputPort().
00471 { 00472 int type = GPORT; 00473 00474 //Create the MVC Objects 00475 GPortModel 00476 *model = 00477 (GPortModel*) GObjectsMVCFactory::getInstance()->createGObjectModel( 00478 type); 00479 vtkGObjectView *view = 00480 GObjectsMVCFactory::getInstance()->createGObjectView(type); 00481 GObjectController* controller = 00482 GObjectsMVCFactory::getInstance()->createGObjectController(type); 00483 00484 model->registerInBox(blackBox, portType, posInBox); 00485 00486 model->setBBTKType(bbtkType); 00487 model->setBBTKName(bbtkName); 00488 00489 model->addObserver(view); 00490 model->addObserver(this); 00491 00492 //Associates the view with the correspondent renderer and the model. 00493 //(NOTE: Refresh is only made by the view) 00494 view->setModel(model); 00495 view->setBaseView(_baseView); 00496 view->initVtkObjects(); 00497 00498 //Associates the controller with the correspondent model and view 00499 controller->setModelAndView(model, view); 00500 00501 model->notifyObservers(_idManager); 00502 00503 addObjectController(controller); 00504 00505 return (GPortController*) controller; 00506 }
void bbtk::wxVtkSceneManager::deleteAllBoxes | ( | ) |
Definition at line 1625 of file wxVtkSceneManager.cxx.
References _controllers, _selectedObjects, bbtk::GObjectController::removeFromScene(), and unregisterController().
Referenced by bbtk::wxGEditorTabPanel::deleteAllBoxes().
01625 { 01626 std::map<int, GObjectController*>::iterator it; 01627 for (it = _controllers.begin(); it != _controllers.end(); ++it) { 01628 GObjectController *cont = it->second; 01629 cont->removeFromScene(); 01630 unregisterController((InteractorStyleMaracas*) cont); 01631 } 01632 _selectedObjects.clear(); 01633 _controllers.clear(); 01634 }
void bbtk::wxVtkSceneManager::deleteObject | ( | int | id | ) |
Definition at line 1144 of file wxVtkSceneManager.cxx.
References _controllers, _parent, AddControlerToBeRemove(), bbtk::GBLACKBOX, bbtk::GCOMPLEXINPUTPORT, bbtk::GCOMPLEXOUTPUTPORT, bbtk::GCONNECTOR, bbtk::GConnectorModel::getEndPort(), bbtk::GObjectController::getGObjectType(), bbtk::GBoxModel::getInputPorts(), bbtk::GObjectController::getModel(), bbtk::GObjectModel::getObjectId(), bbtk::GBoxModel::getOutputPorts(), bbtk::GPortModel::getParentBox(), bbtk::GConnectorModel::getStartPort(), bbtk::GObjectController::removeFromScene(), bbtk::wxGEditorTabPanel::saveTempandUpdate(), and unregisterController().
Referenced by OnChar().
01144 { 01145 GObjectController *control = _controllers[id]; 01146 std::vector<int> controllersToRemove; 01147 01148 if (control->getGObjectType() == GBLACKBOX || control->getGObjectType() 01149 == GCOMPLEXINPUTPORT || control->getGObjectType() 01150 == GCOMPLEXOUTPUTPORT) { 01151 GBoxModel *bbmod = (GBoxModel*) control->getModel(); 01152 std::vector<GPortModel*> inputs = bbmod->getInputPorts(); 01153 01154 bool boxConnected = false; 01155 01156 // Add box input controllers to be removed 01157 for (int i = 0; i < (int) inputs.size(); i++) { 01158 AddControlerToBeRemove(&controllersToRemove, 01159 inputs[i]->getObjectId()); 01160 if (inputs[i]->isConnected()) { 01161 boxConnected = true; 01162 } 01163 } 01164 01165 std::vector<GPortModel*> outputs = bbmod->getOutputPorts(); 01166 01167 // Add box output controllers to be removed 01168 for (int i = 0; i < (int) outputs.size(); i++) { 01169 AddControlerToBeRemove(&controllersToRemove, 01170 outputs[i]->getObjectId()); 01171 if (outputs[i]->isConnected()) { 01172 boxConnected = true; 01173 } 01174 } 01175 01176 // Add connection controllers to be removed 01177 std::map<int, GObjectController*>::iterator it; 01178 for (it = _controllers.begin(); it != _controllers.end(); ++it) { 01179 GObjectController *cont = it->second; 01180 int type = cont->getGObjectType(); 01181 if (type == GCONNECTOR) { 01182 GConnectorModel *conMod = (GConnectorModel*) cont->getModel(); 01183 if (conMod->getStartPort() != NULL 01184 && conMod->getStartPort()->getParentBox()->getObjectId() 01185 == bbmod->getObjectId()) { 01186 AddControlerToBeRemove(&controllersToRemove, 01187 conMod->getObjectId()); 01188 } 01189 if (conMod->getEndPort() != NULL 01190 && conMod->getEndPort()->getParentBox()->getObjectId() 01191 == bbmod->getObjectId()) { 01192 AddControlerToBeRemove(&controllersToRemove, 01193 conMod->getObjectId()); 01194 } 01195 } 01196 } 01197 01198 // Add box controller to be removed 01199 AddControlerToBeRemove(&controllersToRemove, bbmod->getObjectId()); 01200 } else if (control->getGObjectType() == GCONNECTOR) { 01201 GConnectorModel *conMod = (GConnectorModel*) control->getModel(); 01202 AddControlerToBeRemove(&controllersToRemove, conMod->getObjectId()); 01203 } 01204 01205 std::map<int, GObjectController*>::iterator it; 01206 01207 for (int i = 0; i < (int) controllersToRemove.size(); i++) { 01208 int key = controllersToRemove[i]; 01209 it = _controllers.find(key); 01210 GObjectController *cont = _controllers[key]; 01211 if (cont != NULL) { 01212 cont->removeFromScene(); 01213 unregisterController((InteractorStyleMaracas*) cont); 01214 _controllers.erase(it); 01215 }//if 01216 }// for 01217 _parent->saveTempandUpdate("delete object"); 01218 }
void bbtk::wxVtkSceneManager::disconnectDrop | ( | ) |
Definition at line 80 of file wxVtkSceneManager.cxx.
Referenced by ~wxVtkSceneManager().
00080 { 00081 printf("EED %p ~wxVtkSceneManager::disconnectDrop()\n", this); 00082 //EED02JUIN2010 _baseView->GetWxVTKRenderWindowInteractor()->SetDropTarget(NULL); 00083 // _baseView->GetWxVTKRenderWindowInteractor()->SetDropTarget( new tmpClasswxTextDropTarget() ); 00084 }
void bbtk::wxVtkSceneManager::displayBlackBoxInfo | ( | std::string | packageName, | |
std::string | boxName | |||
) |
Definition at line 1222 of file wxVtkSceneManager.cxx.
References _parent, and bbtk::wxGEditorTabPanel::displayBlackBoxInfo().
01223 { 01224 _parent->displayBlackBoxInfo(packageName, boxName); 01225 }
void bbtk::wxVtkSceneManager::DuplicateObjects | ( | std::map< int, GObjectController * > | objectsMap | ) |
Duplicates Objects to current a diagram.
the new selected boxes are the duplicate ones
Definition at line 2300 of file wxVtkSceneManager.cxx.
References _controllers, _idManager, _selectedObjects, createGBlackBox(), createGConnector(), bbtk::GConnectorController::endContourCreation(), bbtk::GBLACKBOX, bbtk::GCONNECTOR, bbtk::GBlackBoxModel::getBBTKPackage(), bbtk::GObjectModel::getBBTKType(), bbtk::GConnectorModel::getEndPort(), bbtk::GObjectController::getGObjectType(), bbtk::GObjectController::getId(), bbtk::GObjectModel::getInicPoint(), bbtk::GBoxModel::getInputPort(), bbtk::GObjectController::getModel(), bbtk::GBoxModel::getNumInputPorts(), bbtk::GObjectModel::getObjectId(), bbtk::GBoxModel::getOutputPort(), bbtk::GPortModel::getParentBox(), bbtk::GPortModel::getPosInBox(), bbtk::GConnectorModel::getStartPort(), bbtk::GBlackBoxModel::getValueInputPort(), bbtk::GObjectController::getView(), bbtk::GBoxModel::move(), bbtk::Observable::notifyObservers(), bbtk::SELECTED, bbtk::GConnectorModel::setEndPort(), bbtk::GBoxModel::setInicPoint(), bbtk::vtkGObjectView::setState(), bbtk::GBlackBoxModel::setValueToInputPort(), UnSelectBlackBoxes(), and bbtk::vtkGConnectorView::updateStartEndPoints().
Referenced by OnChar().
02300 { 02301 02302 std::map<int, int> oldIdNewIdBoxes; 02303 std::vector<int> connections; 02304 02305 std::vector<int> newBoxesID; 02306 02307 std::map<int, GObjectController*>::iterator it; 02308 for (it = objectsMap.begin(); it != objectsMap.end(); ++it) { 02309 GObjectController *cont = it->second; 02310 int type = cont->getGObjectType(); 02311 02312 if (type == GBLACKBOX) { 02313 // Copy black box 02314 double xInic, yInic, zInic; 02315 GBlackBoxModel* copyBox = (GBlackBoxModel*) cont->getModel(); 02316 copyBox->getInicPoint(xInic, yInic, zInic); 02317 int idBox = createGBlackBox(0, 0, copyBox->getBBTKPackage(), 02318 copyBox->getBBTKType()); 02319 02320 int idcB = copyBox->getObjectId(); 02321 oldIdNewIdBoxes[idcB] = idBox; 02322 cont = _controllers[idBox]; 02323 GBlackBoxModel* newbox = (GBlackBoxModel*) cont->getModel(); 02324 newbox->setInicPoint(xInic, yInic, zInic); 02325 int num = newbox->getNumInputPorts(); 02326 for (int j = 0; j < num; j++) { 02327 newbox->setValueToInputPort(j, copyBox->getValueInputPort(j)); 02328 } 02329 newbox->move(xInic + 20, yInic + 20, zInic); 02330 newbox->notifyObservers(_idManager); 02331 newBoxesID.push_back(newbox->getObjectId()); 02332 02333 } else if (type == GCONNECTOR) { 02334 int idCon = cont->getId(); 02335 connections.push_back(idCon); 02336 } 02337 02338 } 02339 02340 for (int i = 0; i < (int) connections.size(); i++) { 02341 int objId = connections[i]; 02342 GObjectController *cont = objectsMap[objId]; 02343 GConnectorModel* connectModel = (GConnectorModel*) cont->getModel(); 02344 02345 GPortModel* startPort = connectModel->getStartPort(); 02346 int startPortIndex = startPort->getPosInBox(); 02347 GPortModel* endPort = connectModel->getEndPort(); 02348 int endPortIndex = endPort->getPosInBox(); 02349 02350 GBlackBoxModel* startPortParentBox = 02351 (GBlackBoxModel*) startPort->getParentBox(); 02352 GBlackBoxModel* endPortParentBox = 02353 (GBlackBoxModel*) endPort->getParentBox(); 02354 02355 int idNewStartBox = oldIdNewIdBoxes[startPortParentBox->getObjectId()]; 02356 int idNewEndBox = oldIdNewIdBoxes[endPortParentBox->getObjectId()]; 02357 02358 GBlackBoxModel* newStartBox = 02359 (GBlackBoxModel*) _controllers[idNewStartBox]->getModel(); 02360 GBlackBoxModel* newEndBox = 02361 (GBlackBoxModel*) _controllers[idNewEndBox]->getModel(); 02362 02363 GPortModel* newStartPort = newStartBox->getOutputPort(startPortIndex); 02364 GPortModel* newEndPort = newEndBox->getInputPort(endPortIndex); 02365 02366 // Creates connection 02367 int idCon = createGConnector(newStartPort); 02368 GConnectorController *tempp = 02369 (GConnectorController*) _controllers[idCon]; 02370 GConnectorModel *conMod = (GConnectorModel*) tempp->getModel(); 02371 vtkGConnectorView *conView = (vtkGConnectorView*) tempp->getView(); 02372 tempp->endContourCreation(); 02373 conMod->setEndPort(newEndPort); 02374 conView->updateStartEndPoints(); 02375 } 02376 02378 02379 UnSelectBlackBoxes(); 02380 for (int i = 0; i < newBoxesID.size(); i++) { 02381 _selectedObjects.push_back(newBoxesID.at(i)); 02382 } 02383 02384 for (int i = 0; i < (int) _selectedObjects.size(); i++) { 02385 int id = _selectedObjects[i]; 02386 GObjectController* cont = _controllers[id]; 02387 02388 cont->getView()->setState(SELECTED); 02389 cont->getModel()->notifyObservers(_idManager); 02390 02391 } 02392 }
std::string bbtk::wxVtkSceneManager::findANewNameForABox | ( | ) |
Definition at line 206 of file wxVtkSceneManager.cxx.
References boxExist(), and generateANewNameForABox().
Referenced by createGBlackBox().
00206 { 00207 std::string boxname = generateANewNameForABox(); 00208 00209 while (boxExist(boxname) == true) { 00210 boxname = generateANewNameForABox(); 00211 } // while 00212 00213 return boxname; 00214 }
GBoxModel * bbtk::wxVtkSceneManager::findGBox | ( | std::string | boxname | ) |
Definition at line 2124 of file wxVtkSceneManager.cxx.
References _controllers, _isComplexBox, getBlackBoxes(), getComplexInputPorts(), and getComplexOutputPorts().
Referenced by bbtk::InterpreterBBS::commandExec(), bbtk::InterpreterBBS::commandSet(), and configGConnetion().
02124 { 02125 int j; 02126 int idB; 02127 GBoxModel *bMod; 02128 GBoxModel *boxModel = NULL; 02129 std::vector<int> lstB = getBlackBoxes(); 02130 for (j = 0; j < (int) lstB.size(); j++) { 02131 idB = lstB[j]; 02132 bMod = (GBoxModel*) _controllers[idB]->getModel(); 02133 if (_controllers[idB]->getModel()->getBBTKName() == boxname) { 02134 boxModel = bMod; 02135 } 02136 } // for 02137 02138 if ((_isComplexBox) && (boxModel == NULL)) { 02139 std::vector<int> lstInputs = getComplexInputPorts(); 02140 for (j = 0; j < (int) lstInputs.size(); j++) { 02141 idB = lstInputs[j]; 02142 bMod = (GBoxModel*) _controllers[idB]->getModel(); 02143 if (_controllers[idB]->getModel()->getBBTKName() == boxname) { 02144 boxModel = bMod; 02145 } 02146 } // for 02147 02148 std::vector<int> lstOutputs = getComplexOutputPorts(); 02149 for (j = 0; j < (int) lstOutputs.size(); j++) { 02150 int idB = lstOutputs[j]; 02151 bMod = (GBoxModel*) _controllers[idB]->getModel(); 02152 if (_controllers[idB]->getModel()->getBBTKName() == boxname) { 02153 boxModel = bMod; 02154 } 02155 } // for 02156 02157 } // complex box 02158 02159 return boxModel; 02160 }
std::string bbtk::wxVtkSceneManager::generateANewNameForABox | ( | ) |
Definition at line 193 of file wxVtkSceneManager.cxx.
References _numBoxes.
Referenced by findANewNameForABox().
00193 { 00194 std::stringstream boxname; 00195 if (_numBoxes < 10) { 00196 boxname << "Box0" << _numBoxes; 00197 } else { 00198 boxname << "Box" << _numBoxes; 00199 } 00200 _numBoxes++; 00201 return boxname.str(); 00202 }
std::string bbtk::wxVtkSceneManager::GetAuthor | ( | ) |
Definition at line 2646 of file wxVtkSceneManager.cxx.
References _Author.
Referenced by bbtk::wxGEditorTabPanel::GetAuthor(), and saveDiagram().
02646 { 02647 return _Author; 02648 }
std::vector< int > bbtk::wxVtkSceneManager::getBlackBoxes | ( | ) |
Definition at line 2218 of file wxVtkSceneManager.cxx.
References _controllers, bbtk::GBLACKBOX, bbtk::GObjectController::getGObjectType(), and bbtk::GObjectController::getId().
Referenced by findGBox(), and saveDiagram().
02218 { 02219 std::vector<int> vect; 02220 std::map<int, GObjectController*>::iterator it; 02221 for (it = _controllers.begin(); it != _controllers.end(); ++it) { 02222 GObjectController *cont = it->second; 02223 if (cont->getGObjectType() == GBLACKBOX) { 02224 vect.push_back(cont->getId()); 02225 } 02226 } 02227 return vect; 02228 }
std::string bbtk::wxVtkSceneManager::GetCategory | ( | ) |
Definition at line 2659 of file wxVtkSceneManager.cxx.
References _Category.
Referenced by bbtk::wxGEditorTabPanel::GetCategory(), and saveDiagram().
02659 { 02660 return _Category; 02661 }
std::string bbtk::wxVtkSceneManager::GetCbName | ( | ) |
Definition at line 2620 of file wxVtkSceneManager.cxx.
References _cbName.
Referenced by bbtk::wxGEditorTabPanel::GetCbName(), and saveDiagram().
02620 { 02621 return _cbName; 02622 }
std::string bbtk::wxVtkSceneManager::GetCbPackageName | ( | ) |
Definition at line 2633 of file wxVtkSceneManager.cxx.
References _cbPackageName.
Referenced by bbtk::wxGEditorTabPanel::GetCbPackageName(), and saveDiagram().
02633 { 02634 return _cbPackageName; 02635 }
std::vector< int > bbtk::wxVtkSceneManager::getComplexInputPorts | ( | ) |
Definition at line 2232 of file wxVtkSceneManager.cxx.
References _controllers, bbtk::GCOMPLEXINPUTPORT, bbtk::GObjectController::getGObjectType(), and bbtk::GObjectController::getId().
Referenced by findGBox(), and saveDiagram().
02232 { 02233 std::vector<int> vect; 02234 std::map<int, GObjectController*>::iterator it; 02235 for (it = _controllers.begin(); it != _controllers.end(); ++it) { 02236 GObjectController *cont = it->second; 02237 if (cont->getGObjectType() == GCOMPLEXINPUTPORT) { 02238 vect.push_back(cont->getId()); 02239 } 02240 } 02241 return vect; 02242 }
std::vector< int > bbtk::wxVtkSceneManager::getComplexOutputPorts | ( | ) |
Definition at line 2246 of file wxVtkSceneManager.cxx.
References _controllers, bbtk::GCOMPLEXOUTPUTPORT, bbtk::GObjectController::getGObjectType(), and bbtk::GObjectController::getId().
Referenced by findGBox(), and saveDiagram().
02246 { 02247 std::vector<int> vect; 02248 std::map<int, GObjectController*>::iterator it; 02249 for (it = _controllers.begin(); it != _controllers.end(); ++it) { 02250 GObjectController *cont = it->second; 02251 if (cont->getGObjectType() == GCOMPLEXOUTPUTPORT) { 02252 vect.push_back(cont->getId()); 02253 } 02254 } 02255 return vect; 02256 }
std::vector< int > bbtk::wxVtkSceneManager::getConnections | ( | ) |
Definition at line 2260 of file wxVtkSceneManager.cxx.
References _controllers, bbtk::GCONNECTOR, bbtk::GObjectController::getGObjectType(), and bbtk::GObjectController::getId().
Referenced by saveDiagram().
02260 { 02261 std::vector<int> vect; 02262 std::map<int, GObjectController*>::iterator it; 02263 for (it = _controllers.begin(); it != _controllers.end(); ++it) { 02264 GObjectController *cont = it->second; 02265 if (cont->getGObjectType() == GCONNECTOR) { 02266 vect.push_back(cont->getId()); 02267 } 02268 } 02269 return vect; 02270 }
std::string bbtk::wxVtkSceneManager::GetDescription | ( | ) |
Definition at line 2672 of file wxVtkSceneManager.cxx.
References _Description.
Referenced by bbtk::wxGEditorTabPanel::GetDescription(), and saveDiagram().
02672 { 02673 return _Description; 02674 }
std::string bbtk::wxVtkSceneManager::getDiagramBBS | ( | bool | wln = false |
) |
Definition at line 1281 of file wxVtkSceneManager.cxx.
References _Author, _Category, _controllers, _Description, bbtk::GBLACKBOX, bbtk::GCONNECTOR, bbtk::GObjectModel::getBBTKName(), bbtk::GBlackBoxModel::getBBTKPackage(), bbtk::GObjectModel::getBBTKType(), bbtk::GConnectorModel::getEndPort(), bbtk::GObjectController::getGObjectType(), bbtk::GBoxModel::getInputPorts(), bbtk::GObjectController::getModel(), bbtk::GPortModel::getParentBox(), bbtk::GConnectorModel::getStartPort(), bbtk::GPortModel::getValue(), bbtk::GBlackBoxModel::isExecutable(), bbtk::GPortModel::isValueSet(), and LineNumber().
Referenced by bbtk::wxGEditorTabPanel::getDiagramBBS().
01281 { 01282 bool existsExec = false; 01283 01284 std::vector<std::string> packages; 01285 std::vector<int> boxes; 01286 std::vector<int> connections; 01287 std::vector<int> execBoxes; 01288 01289 std::map<int, GObjectController*>::iterator it; 01290 01291 for (it = _controllers.begin(); it != _controllers.end(); ++it) { 01292 GObjectController *desc = it->second; 01293 int type = desc->getGObjectType(); 01294 01295 if (type == GBLACKBOX) { 01296 GBlackBoxModel *mod = (GBlackBoxModel*) desc->getModel(); 01297 01298 std::string pkg = mod->getBBTKPackage(); 01299 bool existsPkg = false; 01300 for (int t = 0; t < (int) packages.size() && existsPkg == false; t++) { 01301 if (packages[t] == pkg) { 01302 existsPkg = true; 01303 } 01304 } 01305 if (!existsPkg) { 01306 packages.push_back(pkg); 01307 } 01308 01309 boxes.push_back(it->first); 01310 if (mod->isExecutable()) { 01311 execBoxes.push_back(it->first); 01312 existsExec = true; 01313 } 01314 } else if (type == GCONNECTOR) { 01315 connections.push_back(it->first); 01316 } 01317 } 01318 01319 int lnNmbr = 0; 01320 std::string script = ""; 01321 script += LineNumber(wln, lnNmbr) + "# BBTK GEditor Script\n"; 01322 script += LineNumber(wln, lnNmbr) + "# ----------------------\n"; 01323 script += LineNumber(wln, lnNmbr) + "\n"; 01324 if (existsExec) { 01325 script += LineNumber(wln, lnNmbr) + "include std\n"; // EED 01326 script += LineNumber(wln, lnNmbr) + "include itkvtk\n"; // EED 01327 int i; 01328 for (i = 0; i < (int) packages.size(); i++) { 01329 script += LineNumber(wln, lnNmbr); 01330 script += "include "; 01331 script += packages[i]; 01332 script += "\n"; 01333 } 01334 01335 script += LineNumber(wln, lnNmbr); 01336 script += "\n"; 01337 01338 //ups2 01339 01340 script += LineNumber(wln, lnNmbr); 01341 script += "author \""; 01342 script += _Author; 01343 script += "\"\n"; 01344 01345 script += LineNumber(wln, lnNmbr); 01346 script += "description \""; 01347 script += _Description; 01348 script += "\"\n"; 01349 01350 script += LineNumber(wln, lnNmbr); 01351 script += "category \""; 01352 script += _Category; 01353 script += "\"\n"; 01354 01355 script += LineNumber(wln, lnNmbr); 01356 script += "\n"; 01357 01358 // script+="include std\n"; // JPR 01359 01360 for (i = 0; i < (int) boxes.size(); i++) { 01361 script += LineNumber(wln, lnNmbr); 01362 script += "new "; 01363 int id = boxes[i]; 01364 GObjectController *control = _controllers[id]; 01365 GBlackBoxModel *model = (GBlackBoxModel*) control->getModel(); 01366 01367 script += model->getBBTKType(); 01368 script += " "; 01369 script += model->getBBTKName(); 01370 script += "\n"; 01371 01372 std::vector<GPortModel*> inputs = model->getInputPorts(); 01373 for (int j = 0; j < (int) inputs.size(); j++) { 01374 GPortModel* inputPort = inputs[j]; 01375 if (inputPort->isValueSet()) { 01376 script += LineNumber(wln, lnNmbr); 01377 script += " set "; 01378 script += model->getBBTKName(); 01379 script += "."; 01380 script += inputPort->getBBTKName(); 01381 script += " "; 01382 script += inputPort->getValue(); 01383 script += "\n"; 01384 } 01385 } 01386 01387 script += LineNumber(wln, lnNmbr); 01388 script += "\n"; 01389 01390 } 01391 01392 script += LineNumber(wln, lnNmbr); 01393 script += "\n"; 01394 01395 for (i = 0; i < (int) connections.size(); i++) { 01396 script += LineNumber(wln, lnNmbr); 01397 script += "connect "; 01398 int id = connections[i]; 01399 GObjectController *control = _controllers[id]; 01400 GConnectorModel *model = (GConnectorModel*) control->getModel(); 01401 01402 //Start Connection info 01403 GPortModel *start = model->getStartPort(); 01404 script += start->getParentBox()->getBBTKName(); 01405 script += "."; 01406 script += start->getBBTKName(); 01407 01408 script += " "; 01409 01410 //End Connection info 01411 GPortModel *end = model->getEndPort(); 01412 script += end->getParentBox()->getBBTKName(); 01413 script += "."; 01414 script += end->getBBTKName(); 01415 01416 script += "\n"; 01417 } 01418 01419 script += LineNumber(wln, lnNmbr); 01420 script += "\n"; 01421 for (i = 0; i < (int) execBoxes.size(); i++) { 01422 script += LineNumber(wln, lnNmbr); 01423 script += "exec "; 01424 int id = execBoxes[i]; 01425 GObjectController *control = _controllers[id]; 01426 GBlackBoxModel *model = (GBlackBoxModel*) control->getModel(); 01427 01428 script += model->getBBTKName(); 01429 script += "\n"; 01430 } 01431 01432 } 01433 01434 return script; 01435 }
GObjectController * bbtk::wxVtkSceneManager::GetGBlackBoxControlerPointedByMouse | ( | ) | [private] |
Definition at line 1000 of file wxVtkSceneManager.cxx.
References _controllers, bbtk::GBLACKBOX, bbtk::GObjectController::getGObjectType(), bbtk::GObjectController::getView(), and bbtk::vtkGObjectView::isPointInside().
Referenced by OnLeftButtonDown(), and OnLeftDClick().
01000 { 01001 GObjectController *result = NULL; 01002 int X, Y; 01003 wxVTKRenderWindowInteractor *wxVTKiren; 01004 wxVTKiren 01005 = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor(); 01006 wxVTKiren->GetEventPosition(X, Y); 01007 01008 std::map<int, GObjectController*>::iterator it; 01009 01010 for (it = _controllers.begin(); it != _controllers.end(); ++it) { 01011 GObjectController *cont = it->second; 01012 int type = cont->getGObjectType(); 01013 01014 if (cont->getView()->isPointInside(X, Y) == true) { 01015 if (type == GBLACKBOX) { 01016 result = cont; 01017 } // if type 01018 } // if isPointInside 01019 } // for it 01020 return result; 01021 }
int bbtk::wxVtkSceneManager::GetIndexInSelected | ( | int | idControler | ) | [private] |
Definition at line 616 of file wxVtkSceneManager.cxx.
References _selectedObjects.
Referenced by update().
00616 { 00617 int index = -1; 00618 for (int i = 0; i < (int) _selectedObjects.size(); i++) { 00619 if (_selectedObjects[i] == idControler) { 00620 index = i; 00621 break; 00622 } 00623 } 00624 return index; 00625 }
int bbtk::wxVtkSceneManager::getNumSelectedObjects | ( | ) |
Definition at line 2397 of file wxVtkSceneManager.cxx.
References _selectedObjects.
Referenced by bbtk::wxGEditorTabPanel::getNumSelectedObjects().
02397 { 02398 return _selectedObjects.size(); 02399 }
vtkRenderer * bbtk::wxVtkSceneManager::getRenderer | ( | ) |
Definition at line 603 of file wxVtkSceneManager.cxx.
References _baseView.
00603 { 00604 return _baseView->GetRenderer(); 00605 }
vtkRenderWindow * bbtk::wxVtkSceneManager::getRenderWindow | ( | ) |
Definition at line 609 of file wxVtkSceneManager.cxx.
References _baseView.
00609 { 00610 return _baseView->GetRenWin(); 00611 }
std::map< int, GObjectController * > bbtk::wxVtkSceneManager::getSelectedObjects | ( | ) |
Definition at line 2403 of file wxVtkSceneManager.cxx.
References _controllers, bbtk::GBLACKBOX, bbtk::GCONNECTOR, bbtk::GConnectorModel::getEndPort(), bbtk::GObjectController::getGObjectType(), bbtk::GObjectController::getId(), bbtk::GObjectController::getModel(), bbtk::GObjectModel::getObjectId(), bbtk::GPortModel::getParentBox(), bbtk::GConnectorModel::getStartPort(), bbtk::vtkGObjectView::getState(), bbtk::GObjectController::getView(), and bbtk::SELECTED.
Referenced by bbtk::wxGEditorTabPanel::getSelectedObjects(), MakeBoxExecutable(), and OnChar().
02403 { 02404 std::map<int, GObjectController*> mapSelected; 02405 02406 std::map<int, GObjectController*>::iterator it; 02407 for (it = _controllers.begin(); it != _controllers.end(); ++it) { 02408 GObjectController *cont = it->second; 02409 if (cont->getGObjectType() == GBLACKBOX && cont->getView()->getState() 02410 == SELECTED) { 02411 mapSelected[cont->getId()] = cont; 02412 } 02413 } 02414 02415 std::map<int, GObjectController*>::iterator it2; 02416 for (it2 = _controllers.begin(); it2 != _controllers.end(); ++it2) { 02417 GObjectController *cont = it2->second; 02418 if (cont->getGObjectType() == GCONNECTOR) { 02419 GConnectorModel* cmod = (GConnectorModel*) cont->getModel(); 02420 GBoxModel* endPortParentBox = cmod->getEndPort()->getParentBox(); 02421 GBoxModel* startPortParentBox = 02422 cmod->getStartPort()->getParentBox(); 02423 02424 std::map<int, GObjectController*>::iterator iterOBJ1 = 02425 mapSelected.find(startPortParentBox->getObjectId()); 02426 std::map<int, GObjectController*>::iterator iterOBJ2 = 02427 mapSelected.find(endPortParentBox->getObjectId()); 02428 02429 if (iterOBJ1 != mapSelected.end() && iterOBJ2 != mapSelected.end()) { 02430 int ID = cont->getId(); 02431 mapSelected[ID] = cont; 02432 } 02433 } 02434 } 02435 return mapSelected; 02436 }
bool bbtk::wxVtkSceneManager::isComplexBox | ( | ) |
Definition at line 2274 of file wxVtkSceneManager.cxx.
References _isComplexBox.
Referenced by bbtk::wxGEditorTabPanel::isComplexBox().
02274 { 02275 return _isComplexBox; 02276 }
std::string bbtk::wxVtkSceneManager::LineNumber | ( | bool | withLineNumber, | |
int & | value | |||
) | [private] |
Definition at line 1234 of file wxVtkSceneManager.cxx.
Referenced by getDiagramBBS().
01234 { 01235 std::string result = ""; 01236 if (withLineNumber == true) { 01237 value++; 01238 stringstream StrStream; 01239 StrStream << value; 01240 std::string strValue = StrStream.str(); 01241 if (value < 10) { 01242 result += " "; 01243 } else if (value < 100) { 01244 result += " "; 01245 } 01246 01247 result += strValue + ": "; 01248 } 01249 return result; 01250 }
void bbtk::wxVtkSceneManager::loadDiagram | ( | std::stringstream & | inputStream | ) |
Referenced by bbtk::wxGEditorTabPanel::loadDiagram(), and bbtk::wxGEditorTabPanel::loadTempDiagram().
bool bbtk::wxVtkSceneManager::MakeBoxExecutable | ( | ) |
JLGR 21-05-2012.
Definition at line 1253 of file wxVtkSceneManager.cxx.
References bbtk::GObjectController::getId(), bbtk::GObjectController::getModel(), getSelectedObjects(), bbtk::GObjectController::getView(), bbtk::HIGHLIGHTED, bbtk::GBlackBoxModel::isExecutable(), bbtk::Observable::notifyObservers(), bbtk::GBlackBoxModel::setExecutable(), and bbtk::vtkGObjectView::setState().
Referenced by bbtk::wxGUIEditorGraphicBBS::OnClickBtnExecutableBox().
01253 { 01254 std::map<int, GObjectController*> selected = getSelectedObjects(); 01255 if( selected.empty() ) 01256 return false; 01257 bool ret = false; 01258 std::map<int, GObjectController*>::iterator it; 01259 for (it = selected.begin(); it != selected.end(); ++it) { 01260 GObjectController* lastSelected = it->second; 01261 if (lastSelected) { 01262 vtkGObjectView* view = (vtkGObjectView*) lastSelected->getView(); 01263 GBlackBoxModel *bbmodel = 01264 (GBlackBoxModel*) lastSelected->getModel(); 01265 view->setState(HIGHLIGHTED); 01266 if (bbmodel->isExecutable()) { 01267 bbmodel->setExecutable(false); 01268 } else { 01269 bbmodel->setExecutable(true); 01270 } 01271 bbmodel->notifyObservers(lastSelected->getId()); 01272 ret = true; 01273 } 01274 } 01275 return ret; 01276 }
bool bbtk::wxVtkSceneManager::OnChar | ( | ) | [virtual] |
Duplicate
Definition at line 1087 of file wxVtkSceneManager.cxx.
References _controllers, _selectedObjects, deleteObject(), DuplicateObjects(), and getSelectedObjects().
01087 { 01088 char keyCode = _vtkInteractorStyleBaseView->GetInteractor()-> GetKeyCode(); 01089 int ctrlkey = _vtkInteractorStyleBaseView->GetInteractor()->GetControlKey(); 01090 01091 // KeyCode 127 : Delete Key 01092 // KeyCode 8 : Backspace Key 01093 if (keyCode == 8 || keyCode == 127) { 01094 if (_selectedObjects.size() > 0) { 01095 for (int i = 0; i < (int) _selectedObjects.size(); i++) { 01096 int id = _selectedObjects[i]; 01097 std::map<int, GObjectController*>::iterator it; 01098 it = _controllers.find(id); 01099 if (it != _controllers.end()) { 01100 deleteObject(id); 01101 } 01102 } 01103 _selectedObjects.clear(); 01104 } 01105 } 01106 ctrlkey+=keyCode; 01108 if(ctrlkey==5){ 01109 if(_selectedObjects.size()){ 01110 std::cout<<"objects to copy :"; 01111 for(int i=0;i<_selectedObjects.size();i++){ 01112 std::cout<<_selectedObjects.at(i)<<" "; 01113 } 01114 DuplicateObjects(getSelectedObjects()); 01115 }else{ 01116 std::cout<<"No objects to copy\n"; 01117 } 01118 } 01119 01120 return true; 01121 }
bool bbtk::wxVtkSceneManager::OnLeftButtonDown | ( | ) | [virtual] |
Definition at line 867 of file wxVtkSceneManager.cxx.
References _controllers, _idManager, _selectedObjects, _startDragging, _worldState, CancelConnection(), bbtk::DRAG, bbtk::DRAG_OBJECTS, GetGBlackBoxControlerPointedByMouse(), bbtk::GObjectController::getGObjectType(), bbtk::GObjectController::getModel(), bbtk::GPortModel::getPortType(), bbtk::vtkGObjectView::getState(), bbtk::GObjectController::getView(), bbtk::GINPUTPORT, bbtk::GPORT, bbtk::HIGHLIGHTED, bbtk::INIT_CREATION_CONTOUR, bbtk::Observable::notifyObservers(), bbtk::SELECTED_POSSIBLE_CONNECTION, bbtk::vtkGObjectView::setState(), and UnSelectBlackBoxes().
00867 { 00868 00869 if (_worldState == INIT_CREATION_CONTOUR) { 00870 bool isOverPort = false; 00871 std::map<int, GObjectController*>::iterator it; 00872 for (it = _controllers.begin(); it != _controllers.end() && isOverPort 00873 == false; ++it) { 00874 GObjectController *desc = it->second; 00875 if (desc->getGObjectType() == GPORT) { 00876 GPortModel *portmod = (GPortModel*) desc->getModel(); 00877 vtkGObjectView *portView = desc->getView(); 00878 if (portmod->getPortType() == GINPUTPORT 00879 && portView->getState() == HIGHLIGHTED) { 00880 isOverPort = true; 00881 } // if 00882 // JGRR & CM 00883 if ( portmod->getPortType( ) == GINPUTPORT && portView->getState( ) == SELECTED_POSSIBLE_CONNECTION ) { 00884 isOverPort = true ; 00885 portView->setState( HIGHLIGHTED); 00886 } 00887 // EO JGRR & CM 00888 00889 } // if 00890 } // for 00891 00892 if (isOverPort == false) { 00893 CancelConnection(); 00894 UnSelectBlackBoxes(); 00895 } // isOverPort 00896 00897 00898 } else { //_worldState 00899 00900 _worldState = DRAG_OBJECTS; 00901 _startDragging = true; 00902 00903 int shiftkey = 00904 _vtkInteractorStyleBaseView->GetInteractor()->GetShiftKey(); 00905 int ctrlkey = 00906 _vtkInteractorStyleBaseView->GetInteractor()->GetControlKey(); 00907 ctrlkey = ctrlkey + shiftkey; 00908 00909 GObjectController *cont = GetGBlackBoxControlerPointedByMouse(); 00910 00911 if (GetGBlackBoxControlerPointedByMouse() != NULL) { 00912 int state = cont->getView()->getState(); 00913 if ((ctrlkey == 0) && (state == HIGHLIGHTED)) { 00914 UnSelectBlackBoxes(); 00915 } 00916 } 00917 for (int i = 0; i < (int) _selectedObjects.size(); i++) { 00918 int id = _selectedObjects[i]; 00919 GObjectController* cont = _controllers[id]; 00920 cont->getView()->setState(DRAG); 00921 cont->getModel()->notifyObservers(_idManager); 00922 } // for 00923 00924 } // if _selectedObjects.size 00925 00926 00927 return true; 00928 }
bool bbtk::wxVtkSceneManager::OnLeftButtonUp | ( | ) | [virtual] |
Definition at line 932 of file wxVtkSceneManager.cxx.
References _controllers, _idManager, _selectedObjects, _worldState, bbtk::DRAG_OBJECTS, bbtk::GObjectController::getModel(), bbtk::GObjectController::getView(), bbtk::NOTHING_HAPPENS, bbtk::Observable::notifyObservers(), bbtk::SELECTED, and bbtk::vtkGObjectView::setState().
00932 { 00933 if (_worldState == DRAG_OBJECTS) { 00934 _worldState = NOTHING_HAPPENS; 00935 00936 for (int i = 0; i < (int) _selectedObjects.size(); i++) { 00937 int id = _selectedObjects[i]; 00938 GObjectController* cont = _controllers[id]; 00939 cont->getView()->setState(SELECTED); 00940 cont->getModel()->notifyObservers(_idManager); 00941 } 00942 } 00943 return true; 00944 }
bool bbtk::wxVtkSceneManager::OnLeftDClick | ( | ) | [virtual] |
Definition at line 1035 of file wxVtkSceneManager.cxx.
References _parent, bbtk::wxGEditorTabPanel::editBlackBox(), GetGBlackBoxControlerPointedByMouse(), bbtk::GObjectController::getModel(), and UnSelectBlackBoxes().
01035 { 01036 GObjectController *cont = GetGBlackBoxControlerPointedByMouse(); 01037 if (cont != NULL) { 01038 UnSelectBlackBoxes(); 01039 _parent->editBlackBox((GBlackBoxModel*) cont->getModel()); 01040 } 01041 01042 /*EED Borrame 01043 01044 int X,Y; 01045 wxVTKRenderWindowInteractor *wxVTKiren; 01046 wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor(); 01047 wxVTKiren->GetEventPosition(X,Y); 01048 01049 std::map<int, GObjectController*>::iterator it; 01050 01051 bool clickOnObject = false; 01052 01053 for(it = _controllers.begin(); it != _controllers.end() && clickOnObject==false; ++it) 01054 { 01055 GObjectController *cont = it->second; 01056 int type = cont->getGObjectType(); 01057 01058 if(cont->getView()->isPointInside(X,Y)) 01059 { 01060 if(type==GBLACKBOX) 01061 { 01062 for (int i=0; i< (int)_selectedObjects.size(); i++) 01063 { 01064 int id = _selectedObjects[i]; 01065 GObjectController* control = _controllers[id]; 01066 control->getView()->setState(NOTHING_HAPPENS); 01067 } 01068 _selectedObjects.clear(); 01069 01070 GBlackBoxModel *bbmodel = (GBlackBoxModel*)cont->getModel(); 01071 _parent->editBlackBox(bbmodel); 01072 } 01073 clickOnObject = true; 01074 } 01075 } 01076 01077 if(clickOnObject==false) 01078 { 01079 //_parent->editDiagramParameters(this); 01080 } 01081 */ 01082 return true; 01083 }
bool bbtk::wxVtkSceneManager::OnMiddleButtonDown | ( | ) | [virtual] |
JLGR 21-05-2012.
Definition at line 980 of file wxVtkSceneManager.cxx.
00980 { 00981 00982 00983 this->_vtkInteractorStyleBaseView->StartPan(); 00984 00985 return true; 00986 }
bool bbtk::wxVtkSceneManager::OnMiddleButtonUp | ( | ) | [virtual] |
JLGR 21-05-2012.
Definition at line 988 of file wxVtkSceneManager.cxx.
00988 { 00989 00990 00991 this->_vtkInteractorStyleBaseView->EndPan(); 00992 00993 00994 return true; 00995 }
bool bbtk::wxVtkSceneManager::OnMouseMove | ( | ) | [virtual] |
Definition at line 781 of file wxVtkSceneManager.cxx.
References _aPolygonMapper, _controllers, _fillObjectActor, _idManager, _parent, _selectedObjects, _startDragging, _textActor, _worldState, bbtk::wxGEditorTabPanel::displayBlackBoxInfo(), bbtk::DRAG, bbtk::DRAG_OBJECTS, bbtk::GBLACKBOX, bbtk::GCONNECTOR, bbtk::GBlackBoxModel::getBBTKPackage(), bbtk::GObjectModel::getBBTKType(), bbtk::GObjectModel::getCenter(), bbtk::GObjectController::getGObjectType(), bbtk::GObjectController::getModel(), bbtk::vtkGObjectView::getState(), bbtk::GObjectController::getStatusText(), bbtk::GObjectController::getView(), bbtk::GPORT, bbtk::HIGHLIGHTED, bbtk::INIT_CREATION_CONTOUR, bbtk::vtkGObjectView::moveObject(), bbtk::NOTHING_HAPPENS, bbtk::Observable::notifyObservers(), bbtk::SELECTED_POSSIBLE_CONNECTION, bbtk::vtkGObjectView::setStartDragging(), bbtk::vtkGObjectView::setState(), bbtk::vtkGConnectorView::updateStartEndPoints(), and updateStatusBar().
00781 { 00782 int X, Y; 00783 bool okStatusMessage = false; 00784 bool okPortMessage = false; 00785 wxVTKRenderWindowInteractor *wxVTKiren; 00786 wxVTKiren 00787 = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor(); 00788 wxVTKiren->GetEventPosition(X, Y); 00789 00790 if (_worldState == DRAG_OBJECTS) { 00791 for (int i = 0; i < (int) _selectedObjects.size(); i++) { 00792 int id = _selectedObjects[i]; 00793 GObjectController* cont = _controllers[id]; 00794 if (_startDragging) { 00795 cont->getView()->setStartDragging(true); 00796 } 00797 cont->getView()->moveObject(X, Y); 00798 cont->getView()->setState(DRAG); 00799 cont->getModel()->notifyObservers(_idManager); 00800 } 00801 00802 std::map<int, GObjectController*>::iterator it; 00803 00804 for (it = _controllers.begin(); it != _controllers.end(); ++it) { 00805 GObjectController *desc = it->second; 00806 if (desc->getGObjectType() == GCONNECTOR) { 00807 vtkGConnectorView* vconn = (vtkGConnectorView*) desc->getView(); 00808 vconn->updateStartEndPoints(); 00809 } 00810 } 00811 00812 _startDragging = false; 00813 00814 } else if (_worldState == NOTHING_HAPPENS || _worldState 00815 == INIT_CREATION_CONTOUR) { 00816 std::map<int, GObjectController*>::iterator it; 00817 double px, py, pz; 00818 for (it = _controllers.begin(); it != _controllers.end(); ++it) { 00819 GObjectController *desc = it->second; 00820 int type = desc->getGObjectType(); 00821 int state = desc->getView()->getState(); 00822 desc->getModel()->getCenter(px, py, pz); 00823 00824 // JGRR & CM 00825 if ((state == HIGHLIGHTED) || (state == SELECTED_POSSIBLE_CONNECTION )) { 00826 // EO JGRR & CM 00827 okStatusMessage = true; 00828 updateStatusBar(desc->getStatusText()); 00829 if (type == GBLACKBOX) { 00830 GBlackBoxModel *mod = (GBlackBoxModel*) desc->getModel(); 00831 _parent->displayBlackBoxInfo(mod->getBBTKPackage(), 00832 mod->getBBTKType()); 00833 } // if GBLACKBOX 00834 if (type == GPORT) { 00835 // PortText 00836 okPortMessage = true; 00837 py = py + 5; 00838 _textActor->SetInput(desc->getStatusText().c_str()); 00839 _textActor->SetScale(0.1); 00840 _textActor->SetPosition(px - 25, py + 1, pz + 2); 00841 00842 // FillPortText 00843 px = px - 33; 00844 py = py; 00845 _fillObjectActor->SetScale(1); 00846 _fillObjectActor->GetProperty()->SetOpacity(0.50); 00847 _fillObjectActor->SetPosition(px, py, 1); 00848 _aPolygonMapper->Modified(); 00849 } // if GPORT 00850 00851 } // for controllers it 00852 } 00853 } 00854 if (okStatusMessage == false) { 00855 updateStatusBar(""); 00856 } 00857 00858 if (okPortMessage == false) { 00859 _textActor->SetScale(0.0001); 00860 _fillObjectActor->SetScale(0.0001); 00861 } 00862 return true; 00863 }
bool bbtk::wxVtkSceneManager::OnRightButtonUp | ( | ) | [virtual] |
Definition at line 970 of file wxVtkSceneManager.cxx.
References _worldState, CancelConnection(), bbtk::INIT_CREATION_CONTOUR, and UnSelectBlackBoxes().
00970 { 00971 if (_worldState == INIT_CREATION_CONTOUR) { 00972 CancelConnection(); 00973 } 00974 UnSelectBlackBoxes(); 00975 return true; 00976 }
void bbtk::wxVtkSceneManager::printAll | ( | int | com, | |
int | sta | |||
) |
Definition at line 2679 of file wxVtkSceneManager.cxx.
References bbtk::ADD_TO_SELECTED, bbtk::CLICKED, bbtk::CREATING_CONTOUR, bbtk::DRAG, bbtk::DRAG_OBJECTS, bbtk::EDIT_BLACKBOX, bbtk::FIN_CREATION_CONTOUR, bbtk::HIGHLIGHTED, bbtk::INIT_CREATION_CONTOUR, bbtk::NOTHING_HAPPENS, bbtk::POSSIBLE_CONNECTION, bbtk::REMOVE_FROM_SELECTED, bbtk::SELECTED, and bbtk::SELECTED_POSSIBLE_CONNECTION.
02679 { 02680 02681 int tmpState = sta ; 02682 if ( tmpState == NOTHING_HAPPENS ) { 02683 std::cout << "CONTROLER STATE---->NOTHING_HAPPENS\n" ; 02684 } 02685 if ( tmpState == HIGHLIGHTED ) { 02686 std::cout << "CONTROLER STATE---->HIGHLIGHTED\n" ; 02687 } 02688 if ( tmpState == POSSIBLE_CONNECTION ) { 02689 std::cout << "CONTROLER STATE---->POSSIBLE_CONNECTION\n" ; 02690 } 02691 if ( tmpState == SELECTED_POSSIBLE_CONNECTION ) { 02692 std::cout << "CONTROLER STATE---->SELECTED_POSSIBLE_CONNECTION\n" ; 02693 } 02694 if ( tmpState == CLICKED ) { 02695 std::cout << "CONTROLER STATE---->CLICKED\n" ; 02696 } 02697 if ( tmpState == DRAG ) { 02698 std::cout << "CONTROLER STATE---->DRAG\n" ; 02699 } 02700 if ( tmpState == SELECTED ) { 02701 std::cout << "CONTROLER STATE---->SELECTED\n" ; 02702 } 02703 if ( tmpState == CREATING_CONTOUR ) { 02704 std::cout << "CONTROLER STATE---->CREATING_CONTOUR\n" ; 02705 } 02706 02707 // :P 02708 02709 int command = com ; 02710 if ( command == INIT_CREATION_CONTOUR ) { 02711 std::cout << "COMMAND ----> INIT_CREATION_CONTOUR \n" ; 02712 } 02713 if ( command == FIN_CREATION_CONTOUR ) { 02714 std::cout << "COMMAND ----> FIN_CREATION_CONTOUR \n" ; 02715 } 02716 if ( command == ADD_TO_SELECTED ) { 02717 std::cout << "COMMAND ----> ADD_TO_SELECTED \n" ; 02718 } 02719 if ( command == DRAG_OBJECTS ) { 02720 std::cout << "COMMAND ----> DRAG_OBJECTS \n" ; 02721 } 02722 if ( command == EDIT_BLACKBOX ) { 02723 std::cout << "COMMAND ----> EDIT_BLACKBOX \n" ; 02724 } 02725 if ( command == REMOVE_FROM_SELECTED ) { 02726 std::cout << "COMMAND ----> REMOVE_FROM_SELECTED \n" ; 02727 } 02728 02729 }
void bbtk::wxVtkSceneManager::refresh | ( | ) |
Definition at line 1639 of file wxVtkSceneManager.cxx.
References _baseView.
Referenced by bbtk::wxGUIEditorGraphicBBS::OnClickBtnBox().
01639 { 01640 _baseView->Refresh(); 01641 }
void bbtk::wxVtkSceneManager::refreshScene | ( | ) |
Definition at line 1644 of file wxVtkSceneManager.cxx.
References _baseView.
01644 { 01645 _baseView->RefreshView(); 01646 }
void bbtk::wxVtkSceneManager::registerController | ( | InteractorStyleMaracas * | param | ) |
Definition at line 585 of file wxVtkSceneManager.cxx.
References _baseView.
Referenced by addObjectController(), and wxVtkSceneManager().
00585 { 00586 vtkInteractorStyleBaseView 00587 * baseViewControlManager = 00588 (vtkInteractorStyleBaseView*) _baseView->GetInteractorStyleBaseView(); 00589 baseViewControlManager->AddInteractorStyleMaracas(param); 00590 }
std::string bbtk::wxVtkSceneManager::saveComplexBoxBBS | ( | ) |
Definition at line 1439 of file wxVtkSceneManager.cxx.
References _Author, _Category, _cbName, _cbPackageName, _controllers, _Description, bbtk::GBLACKBOX, bbtk::GCOMPLEXINPUTPORT, bbtk::GCOMPLEXOUTPUTPORT, bbtk::GCONNECTOR, bbtk::GObjectModel::getBBTKName(), bbtk::GBlackBoxModel::getBBTKPackage(), bbtk::GObjectModel::getBBTKType(), bbtk::GConnectorModel::getEndPort(), bbtk::GObjectModel::getGObjectType(), bbtk::GObjectController::getGObjectType(), bbtk::GBoxModel::getInputPorts(), bbtk::GObjectController::getModel(), bbtk::GPortModel::getParentBox(), bbtk::GConnectorModel::getStartPort(), bbtk::GPortModel::getValue(), bbtk::GBlackBoxModel::isExecutable(), and bbtk::GPortModel::isValueSet().
Referenced by bbtk::wxGEditorTabPanel::saveComplexBoxBBS().
01439 { 01440 std::vector<std::string> packages; 01441 std::vector<int> boxes; 01442 std::vector<int> connections; 01443 std::vector<int> execBoxes; 01444 01445 std::map<int, GObjectController*>::iterator it; 01446 01447 for (it = _controllers.begin(); it != _controllers.end(); ++it) { 01448 GObjectController *desc = it->second; 01449 int type = desc->getGObjectType(); 01450 01451 if (type == GBLACKBOX) { 01452 GBlackBoxModel *mod = (GBlackBoxModel*) desc->getModel(); 01453 01454 std::string pkg = mod->getBBTKPackage(); 01455 bool existsPkg = false; 01456 for (int t = 0; t < (int) packages.size() && existsPkg == false; t++) { 01457 if (packages[t] == pkg) { 01458 existsPkg = true; 01459 } 01460 } 01461 if (!existsPkg) { 01462 packages.push_back(pkg); 01463 } 01464 01465 boxes.push_back(it->first); 01466 if (mod->isExecutable()) { 01467 execBoxes.push_back(it->first); 01468 } 01469 } else if (type == GCONNECTOR) { 01470 connections.push_back(it->first); 01471 } 01472 } 01473 01474 std::string script = ""; 01475 01476 script += "include std\n"; // EED 01477 script += "include itkvtk\n"; // EED 01478 int i; 01479 for (i = 0; i < (int) packages.size(); i++) { 01480 script += "include "; 01481 script += packages[i]; 01482 script += "\n"; 01483 } 01484 script += "\n"; 01485 01486 // Definition of a complex box 01487 script += "define "; 01488 script += _cbName + " " + _cbPackageName; 01489 script += "\n"; 01490 script += "\n"; 01491 01492 script += "author \""; 01493 script += _Author; 01494 script += "\"\n"; 01495 01496 script += "description \""; 01497 script += _Description; 01498 script += "\"\n"; 01499 script += "\n"; 01500 01501 script += "category \""; 01502 script += _Category; 01503 script += "\"\n"; 01504 script += "\n"; 01505 01506 // Create boxes 01507 for (i = 0; i < (int) boxes.size(); i++) { 01508 script += "new "; 01509 int id = boxes[i]; 01510 GObjectController *control = _controllers[id]; 01511 GBlackBoxModel *model = (GBlackBoxModel*) control->getModel(); 01512 01513 script += model->getBBTKType(); 01514 script += " "; 01515 script += model->getBBTKName(); 01516 script += "\n"; 01517 01518 std::vector<GPortModel*> inputs = model->getInputPorts(); 01519 for (int j = 0; j < (int) inputs.size(); j++) { 01520 GPortModel* inputPort = inputs[j]; 01521 if (inputPort->isValueSet()) { 01522 script += " set "; 01523 script += model->getBBTKName(); 01524 script += "."; 01525 script += inputPort->getBBTKName(); 01526 script += " "; 01527 script += inputPort->getValue(); 01528 script += "\n"; 01529 } 01530 } 01531 script += "\n"; 01532 01533 } 01534 01535 // Create connections in the script. If the connection is made with a complex port, it is created the input or output 01536 01537 std::string complexInputs = ""; 01538 std::string complexOutputs = ""; 01539 script += "\n"; 01540 01541 for (i = 0; i < (int) connections.size(); i++) { 01542 int id = connections[i]; 01543 GObjectController *control = _controllers[id]; 01544 GConnectorModel *model = (GConnectorModel*) control->getModel(); 01545 01546 //Connection info 01547 GPortModel *start = model->getStartPort(); 01548 GBoxModel *startBox = start->getParentBox(); 01549 01550 GPortModel *end = model->getEndPort(); 01551 GBoxModel *endBox = end->getParentBox(); 01552 01553 if (startBox->getGObjectType() == GCOMPLEXINPUTPORT) { 01554 complexInputs += "input "; 01555 complexInputs += startBox->getBBTKName(); 01556 01557 complexInputs += " "; 01558 complexInputs += endBox->getBBTKName(); 01559 complexInputs += "."; 01560 complexInputs += end->getBBTKName(); 01561 01562 complexInputs += " "; 01563 complexInputs += "\" \""; 01564 01565 complexInputs += "\n"; 01566 } else if (endBox->getGObjectType() == GCOMPLEXOUTPUTPORT) { 01567 complexOutputs += "output "; 01568 complexOutputs += endBox->getBBTKName(); 01569 01570 complexOutputs += " "; 01571 complexOutputs += startBox->getBBTKName(); 01572 complexOutputs += "."; 01573 complexOutputs += start->getBBTKName(); 01574 01575 complexOutputs += " "; 01576 complexOutputs += "\" \""; 01577 01578 complexOutputs += "\n"; 01579 } else { 01580 script += "connect "; 01581 script += startBox->getBBTKName(); 01582 script += "."; 01583 script += start->getBBTKName(); 01584 01585 script += " "; 01586 01587 //End Connection info 01588 script += endBox->getBBTKName(); 01589 script += "."; 01590 script += end->getBBTKName(); 01591 01592 script += "\n"; 01593 } 01594 } 01595 01596 script += "\n"; 01597 01598 for (i = 0; i < (int) execBoxes.size(); i++) { 01599 script += "exec "; 01600 int id = execBoxes[i]; 01601 GObjectController *control = _controllers[id]; 01602 GBlackBoxModel *model = (GBlackBoxModel*) control->getModel(); 01603 01604 script += model->getBBTKName(); 01605 script += "\n"; 01606 } 01607 01608 script += "\n"; 01609 script += "# Complex input ports\n"; 01610 script += complexInputs; 01611 01612 script += "\n"; 01613 script += "# Complex output ports\n"; 01614 script += complexOutputs; 01615 01616 script += "\n"; 01617 script += "endefine"; 01618 script += "\n"; 01619 01620 return script; 01621 }
void bbtk::wxVtkSceneManager::saveDiagram | ( | std::string & | content | ) |
Definition at line 1660 of file wxVtkSceneManager.cxx.
References _controllers, _isComplexBox, GetAuthor(), getBlackBoxes(), GetCategory(), GetCbName(), GetCbPackageName(), getComplexInputPorts(), getComplexOutputPorts(), getConnections(), GetDescription(), bbtk::GObjectController::getModel(), and bbtk::GObjectModel::save().
Referenced by bbtk::wxGEditorTabPanel::saveDiagram(), and bbtk::wxGEditorTabPanel::saveTempDiagram().
01660 { 01661 char buffer[50]; 01662 01663 content += "CATEGORY:"; 01664 content += GetCategory(); 01665 content += "\n"; 01666 01667 content += "DESCRIPTION:"; 01668 content += GetDescription(); 01669 content += "\n"; 01670 01671 content += "AUTHOR:"; 01672 content += GetAuthor(); 01673 content += "\n"; 01674 01675 //Print info IF COMPLEX BOX 01676 content += "COMPLEXBOX:"; 01677 if (_isComplexBox) { 01678 content += "TRUE\n"; 01679 //ups1 01680 content += "COMPLEXBOXNAME:"; 01681 content += GetCbName(); 01682 content += "\n"; 01683 01684 content += "PACKAGENAME:"; 01685 content += GetCbPackageName(); 01686 content += "\n"; 01687 01688 //Print info complex input ports 01689 std::vector<int> inputs = getComplexInputPorts(); 01690 int insize = inputs.size(); 01691 content += "COMPLEXINPUTS:"; 01692 sprintf(buffer, "%d", insize); 01693 content += buffer; 01694 content += "\n"; 01695 01696 for (int i = 0; i < insize; i++) { 01697 int id = inputs[i]; 01698 GObjectController *cont = _controllers[id]; 01699 cont->getModel()->save(content); 01700 } 01701 01702 //Print info complex output ports 01703 std::vector<int> outputs = getComplexOutputPorts(); 01704 int outsize = outputs.size(); 01705 content += "COMPLEXOUTPUTS:"; 01706 sprintf(buffer, "%d", outsize); 01707 content += buffer; 01708 content += "\n"; 01709 01710 for (int i = 0; i < outsize; i++) { 01711 int id = outputs[i]; 01712 GObjectController *cont = _controllers[id]; 01713 cont->getModel()->save(content); 01714 } 01715 } // _isComplexBox 01716 else { 01717 content += "FALSE\n"; 01718 } 01719 01720 //Print boxes 01721 std::vector<int> boxes = getBlackBoxes(); 01722 int bsize = boxes.size(); 01723 content += "BOXES:"; 01724 sprintf(buffer, "%d", bsize); 01725 content += buffer; 01726 content += "\n"; 01727 01728 for (int i = 0; i < bsize; i++) { 01729 int id = boxes[i]; 01730 GObjectController *cont = _controllers[id]; 01731 cont->getModel()->save(content); 01732 } 01733 01734 //Print connections 01735 std::vector<int> connections = getConnections(); 01736 int csize = connections.size(); 01737 content += "CONNECTIONS:"; 01738 sprintf(buffer, "%d", csize); 01739 content += buffer; 01740 content += "\n"; 01741 01742 for (int i = 0; i < csize; i++) { 01743 int id = connections[i]; 01744 GObjectController *cont = _controllers[id]; 01745 cont->getModel()->save(content); 01746 } 01747 01748 }
void bbtk::wxVtkSceneManager::SetAuthor | ( | std::string | author | ) |
Definition at line 2638 of file wxVtkSceneManager.cxx.
References _Author.
Referenced by bbtk::InterpreterBBS::commandAuthor(), and bbtk::wxGEditorTabPanel::SetAuthor().
02638 { 02639 _Author = author; 02640 if (_Author == "") { 02641 _Author = "<author of the box>"; 02642 } 02643 }
void bbtk::wxVtkSceneManager::SetCategory | ( | std::string | category | ) |
Definition at line 2651 of file wxVtkSceneManager.cxx.
References _Category.
Referenced by bbtk::InterpreterBBS::commandCategory(), and bbtk::wxGEditorTabPanel::SetCategory().
02651 { 02652 _Category = category; 02653 if (_Category == "") { 02654 _Category = "<category of the box>"; 02655 } 02656 }
void bbtk::wxVtkSceneManager::SetCbName | ( | std::string | cbNane | ) |
Definition at line 2612 of file wxVtkSceneManager.cxx.
References _cbName.
Referenced by bbtk::InterpreterBBS::commandDefine(), and bbtk::wxGEditorTabPanel::SetCbName().
02612 { 02613 _cbName = cbName; 02614 if (_cbName == "") { 02615 _cbName = "<complex box name>"; 02616 } 02617 }
void bbtk::wxVtkSceneManager::SetCbPackageName | ( | std::string | packagename | ) |
Definition at line 2625 of file wxVtkSceneManager.cxx.
References _cbPackageName.
Referenced by bbtk::InterpreterBBS::commandDefine(), and bbtk::wxGEditorTabPanel::SetCbPackageName().
02625 { 02626 _cbPackageName = packagename; 02627 if (_cbPackageName == "") { 02628 _cbPackageName = "<package name of the complex box>"; 02629 } 02630 }
void bbtk::wxVtkSceneManager::setComplexBox | ( | bool | val | ) |
Definition at line 2280 of file wxVtkSceneManager.cxx.
References _isComplexBox.
Referenced by bbtk::InterpreterBBS::commandDefine(), and bbtk::wxGEditorTabPanel::setComplexBox().
02280 { 02281 _isComplexBox = val; 02282 }
void bbtk::wxVtkSceneManager::SetDescription | ( | std::string | description | ) |
Definition at line 2664 of file wxVtkSceneManager.cxx.
References _Description.
Referenced by bbtk::InterpreterBBS::commandDescription(), and bbtk::wxGEditorTabPanel::SetDescription().
02664 { 02665 _Description = description; 02666 if (_Description == "") { 02667 _Description = "<description of the box>"; 02668 } 02669 }
void bbtk::wxVtkSceneManager::unregisterController | ( | InteractorStyleMaracas * | param | ) |
Definition at line 594 of file wxVtkSceneManager.cxx.
References _baseView.
Referenced by CancelConnection(), deleteAllBoxes(), and deleteObject().
00594 { 00595 vtkInteractorStyleBaseView 00596 * baseViewControlManager = 00597 (vtkInteractorStyleBaseView*) _baseView->GetInteractorStyleBaseView(); 00598 baseViewControlManager->RemoveInteractorStyleMaracas(param); 00599 }
void bbtk::wxVtkSceneManager::UnSelectBlackBoxes | ( | ) | [private] |
Definition at line 1024 of file wxVtkSceneManager.cxx.
References _controllers, _idManager, _selectedObjects, bbtk::GObjectController::getModel(), bbtk::GObjectController::getView(), bbtk::NOTHING_HAPPENS, bbtk::Observable::notifyObservers(), and bbtk::vtkGObjectView::setState().
Referenced by DuplicateObjects(), OnLeftButtonDown(), OnLeftDClick(), and OnRightButtonUp().
01024 { 01025 for (int i = 0; i < (int) _selectedObjects.size(); i++) { 01026 int id = _selectedObjects[i]; 01027 GObjectController* control = _controllers[id]; 01028 control->getView()->setState(NOTHING_HAPPENS); 01029 control->getModel()->notifyObservers(_idManager); 01030 }// for _selectedObjects 01031 _selectedObjects.clear(); 01032 }
void bbtk::wxVtkSceneManager::update | ( | int | idController, | |
int | command | |||
) | [virtual] |
Reimplemented from bbtk::Observer.
Definition at line 628 of file wxVtkSceneManager.cxx.
References _controllers, _idConnectionInCreation, _idManager, _parent, _selectedObjects, _worldState, bbtk::ADD_TO_SELECTED, createGConnector(), bbtk::FIN_CREATION_CONTOUR, bbtk::GObjectModel::getBBTKType(), bbtk::GObjectController::getGObjectType(), bbtk::GObjectModel::getGObjectType(), GetIndexInSelected(), bbtk::GObjectController::getModel(), bbtk::GPortModel::getPortType(), bbtk::vtkGObjectView::getState(), bbtk::GObjectController::getView(), bbtk::GINPUTPORT, bbtk::GPORT, bbtk::HIGHLIGHTED, bbtk::INIT_CREATION_CONTOUR, bbtk::NO_COMMAND, bbtk::NOTHING_HAPPENS, bbtk::Observable::notifyObservers(), bbtk::POSSIBLE_CONNECTION, bbtk::REMOVE_FROM_SELECTED, bbtk::wxGEditorTabPanel::saveTempandUpdate(), bbtk::SELECTED_POSSIBLE_CONNECTION, bbtk::GConnectorModel::setEndPort(), and bbtk::vtkGObjectView::setState().
00628 { 00629 00630 if (command != NO_COMMAND) { 00631 if (command == ADD_TO_SELECTED) { 00632 //EEDBorrame GObjectController* cont = _controllers[idController]; 00633 00634 if (GetIndexInSelected(idController) == -1) { 00635 _selectedObjects.push_back(idController); 00636 } 00637 00638 //EEDBorrame 00639 // bool foundID=false; 00640 // for (int i=0; i<(int)_selectedObjects.size() && foundID==false; i++) 00641 // { 00642 // if(_selectedObjects[i]==idController) 00643 // { 00644 // foundID = true; 00645 // } 00646 // } 00647 // if(!foundID) 00648 // { 00649 // _selectedObjects.push_back(idController); 00650 // } 00651 00652 } else if (command == REMOVE_FROM_SELECTED) { 00653 int index = GetIndexInSelected(idController); 00654 if (index >= 0) { 00655 _selectedObjects.erase(_selectedObjects.begin() + index); 00656 } 00657 } else if (command == INIT_CREATION_CONTOUR) { 00658 00659 // JGRR & CM WH 00660 typedef std::map<int , GObjectController*>::iterator TIterator ; 00661 TIterator iter ; 00662 TIterator iter_end ; 00663 // Find current item in the controller 00664 iter = _controllers.find( idController ) ; 00665 iter_end = _controllers.end( ) ; 00666 // If item exist 00667 if ( iter != iter_end ) { 00668 GObjectController* gobjc = iter->second ; 00669 00670 std::string bbtkType = gobjc->getModel( )->getBBTKType( ) ; 00671 // And if the item is a port 00672 if ( gobjc->getModel( )->getGObjectType( ) == GPORT ) { 00673 TIterator c_it = _controllers.begin( ) ; 00674 // Go through all componets 00675 for ( c_it ; c_it != iter_end ; c_it++ ) { 00676 GObjectController* obc = c_it->second ; 00677 int obc_type = obc->getModel( )->getGObjectType( ) ; 00678 std::string obc_bbtkType = obc->getModel( )->getBBTKType( ) ; 00679 // if the component is a port and the type is the same of that selected 00680 if ( ( obc_type == GPORT ) && ( obc_bbtkType == bbtkType ) ) { 00681 // Highliht element 00682 obc->getView( )->setState( POSSIBLE_CONNECTION ) ; 00683 //obc->getView( )->setState( HIGHLIGHTED ) ; 00684 } 00685 } 00686 } 00687 } 00688 00689 // EO JGRR & CM WH 00690 00691 _worldState = INIT_CREATION_CONTOUR; 00692 GObjectController* cont = _controllers[idController]; 00693 GPortModel* startOutputPort = (GPortModel*) cont->getModel(); 00694 00695 // The last one is the controller of the connector 00696 std::map<int, GObjectController*>::iterator it2; 00697 00698 for (it2 = _controllers.begin(); it2 != _controllers.end(); ++it2) { 00699 GObjectController *cont = it2->second; 00700 if (cont->getGObjectType() == GPORT) { 00701 GPortModel* port = (GPortModel*) cont->getModel(); 00702 if (port->getPortType() == GINPUTPORT) { 00703 cont->SetActive(true); 00704 } else { 00705 cont->getView()->setState(NOTHING_HAPPENS); 00706 cont->getModel()->notifyObservers(_idManager); 00707 cont->SetActive(false); 00708 } 00709 } else { 00710 cont->getView()->setState(NOTHING_HAPPENS); 00711 cont->getModel()->notifyObservers(_idManager); 00712 cont->SetActive(false); 00713 } 00714 } 00715 _selectedObjects.clear(); 00716 _idConnectionInCreation = createGConnector(startOutputPort); 00717 } else if (command == FIN_CREATION_CONTOUR && _worldState 00718 == INIT_CREATION_CONTOUR) { 00719 _worldState = NOTHING_HAPPENS; 00720 //int id = _controllers.size()-1; 00721 GObjectController *cont = _controllers[_idConnectionInCreation]; 00722 GConnectorModel *modelContour = (GConnectorModel*) cont->getModel(); 00723 GObjectController *finPort = _controllers[idController]; 00724 00725 if (finPort->getGObjectType() == GPORT) { 00726 GPortModel* modelPort = (GPortModel*) finPort->getModel(); 00727 modelContour->setEndPort(modelPort); 00728 00729 // JGRR CM 00730 typedef std::map<int, GObjectController*>::iterator TIterator; 00731 TIterator c_it = _controllers.begin(); 00732 TIterator iter_end = _controllers.end(); 00733 // Go through all componets 00734 for (c_it; c_it != iter_end; c_it++) { 00735 GObjectController* obc = c_it->second; 00736 int obc_type = obc->getModel()->getGObjectType(); 00737 int obc_state = obc->getView()->getState(); 00738 // if the component is a port and the type is the same of that selected 00739 if ((obc_type == GPORT) && (obc_state == POSSIBLE_CONNECTION)) { 00740 // Return element to neutral state if not selected 00741 obc->getView()->setState(NOTHING_HAPPENS); 00742 } 00743 if ((obc_type == GPORT) && (obc_state == SELECTED_POSSIBLE_CONNECTION)) { 00744 // Change element to connected state 00745 obc->getView()->setState(HIGHLIGHTED); 00746 00747 } 00748 00749 } 00750 // EO JGRR CM 00751 00752 _parent->saveTempandUpdate("create connection"); 00753 } 00754 00755 manualConnectorContourController 00756 * manCont = 00757 ((GConnectorController*) cont)->getManualContourController(); 00758 manualConnectorContourView 00759 * connView = 00760 (manualConnectorContourView*) manCont->GetManualViewBaseContour(); 00761 00762 std::map<int, GObjectController*>::iterator it2; 00763 00764 for (it2 = _controllers.begin(); it2 != _controllers.end(); ++it2) { 00765 GObjectController *cont = it2->second; 00766 if (cont->getView() != NULL) { 00767 cont->getView()->setState(NOTHING_HAPPENS); 00768 cont->getModel()->notifyObservers(_idManager); 00769 } 00770 cont->SetActive(true); 00771 } 00772 connView->Refresh(); 00773 } 00774 00775 } 00776 00777 }
void bbtk::wxVtkSceneManager::updateStatusBar | ( | std::string | textStatus | ) |
Definition at line 1229 of file wxVtkSceneManager.cxx.
References _parent, and bbtk::wxGEditorTabPanel::updateStatusBar().
Referenced by OnMouseMove().
01229 { 01230 _parent->updateStatusBar(textStatus); 01231 }
vtkDataSetMapper* bbtk::wxVtkSceneManager::_aPolygonMapper [private] |
Definition at line 258 of file wxVtkSceneManager.h.
Referenced by configureBaseView(), and OnMouseMove().
std::string bbtk::wxVtkSceneManager::_Author [private] |
Definition at line 220 of file wxVtkSceneManager.h.
Referenced by GetAuthor(), getDiagramBBS(), saveComplexBoxBBS(), SetAuthor(), and wxVtkSceneManager().
wxVtk3DBaseView* bbtk::wxVtkSceneManager::_baseView [private] |
Definition at line 237 of file wxVtkSceneManager.h.
Referenced by centerView(), configureBaseView(), createGBlackBox(), createGComplexBoxInputPort(), createGComplexBoxOutputPort(), createGConnector(), createGPort(), getRenderer(), getRenderWindow(), refresh(), refreshScene(), registerController(), unregisterController(), wxVtkSceneManager(), and ~wxVtkSceneManager().
std::string bbtk::wxVtkSceneManager::_Category [private] |
Definition at line 221 of file wxVtkSceneManager.h.
Referenced by GetCategory(), getDiagramBBS(), saveComplexBoxBBS(), SetCategory(), and wxVtkSceneManager().
std::string bbtk::wxVtkSceneManager::_cbName [private] |
Definition at line 218 of file wxVtkSceneManager.h.
Referenced by GetCbName(), saveComplexBoxBBS(), SetCbName(), and wxVtkSceneManager().
std::string bbtk::wxVtkSceneManager::_cbPackageName [private] |
Definition at line 219 of file wxVtkSceneManager.h.
Referenced by GetCbPackageName(), saveComplexBoxBBS(), SetCbPackageName(), and wxVtkSceneManager().
int bbtk::wxVtkSceneManager::_contLastId [private] |
Definition at line 253 of file wxVtkSceneManager.h.
Referenced by addObjectController(), and wxVtkSceneManager().
std::map<int,GObjectController*> bbtk::wxVtkSceneManager::_controllers [private] |
Definition at line 243 of file wxVtkSceneManager.h.
Referenced by addObjectController(), addObjects(), boxExist(), CancelConnection(), configGBlackBox(), configGComBoxInputOutputPort(), configGConnetion(), deleteAllBoxes(), deleteObject(), DuplicateObjects(), findGBox(), getBlackBoxes(), getComplexInputPorts(), getComplexOutputPorts(), getConnections(), getDiagramBBS(), GetGBlackBoxControlerPointedByMouse(), getSelectedObjects(), OnChar(), OnLeftButtonDown(), OnLeftButtonUp(), OnMouseMove(), saveComplexBoxBBS(), saveDiagram(), UnSelectBlackBoxes(), and update().
std::string bbtk::wxVtkSceneManager::_Description [private] |
Definition at line 222 of file wxVtkSceneManager.h.
Referenced by GetDescription(), getDiagramBBS(), saveComplexBoxBBS(), SetDescription(), and wxVtkSceneManager().
vtkActor* bbtk::wxVtkSceneManager::_fillObjectActor [private] |
Definition at line 257 of file wxVtkSceneManager.h.
Referenced by configureBaseView(), and OnMouseMove().
int bbtk::wxVtkSceneManager::_idConnectionInCreation [private] |
Definition at line 251 of file wxVtkSceneManager.h.
Referenced by CancelConnection(), update(), and wxVtkSceneManager().
int bbtk::wxVtkSceneManager::_idManager [private] |
Definition at line 228 of file wxVtkSceneManager.h.
Referenced by addObjects(), CancelConnection(), configGBlackBox(), configGComBoxInputOutputPort(), createGBlackBox(), createGComplexBoxInputPort(), createGComplexBoxOutputPort(), createGPort(), DuplicateObjects(), OnLeftButtonDown(), OnLeftButtonUp(), OnMouseMove(), UnSelectBlackBoxes(), update(), and wxVtkSceneManager().
bool bbtk::wxVtkSceneManager::_isComplexBox [private] |
Definition at line 249 of file wxVtkSceneManager.h.
Referenced by findGBox(), isComplexBox(), saveDiagram(), setComplexBox(), and wxVtkSceneManager().
int bbtk::wxVtkSceneManager::_numBoxes [private] |
Definition at line 231 of file wxVtkSceneManager.h.
Referenced by generateANewNameForABox(), and wxVtkSceneManager().
Definition at line 225 of file wxVtkSceneManager.h.
Referenced by deleteObject(), displayBlackBoxInfo(), OnLeftDClick(), OnMouseMove(), update(), updateStatusBar(), and wxVtkSceneManager().
vtkPoints* bbtk::wxVtkSceneManager::_pts [private] |
std::vector<int> bbtk::wxVtkSceneManager::_selectedObjects [private] |
Definition at line 246 of file wxVtkSceneManager.h.
Referenced by deleteAllBoxes(), DuplicateObjects(), GetIndexInSelected(), getNumSelectedObjects(), OnChar(), OnLeftButtonDown(), OnLeftButtonUp(), OnMouseMove(), UnSelectBlackBoxes(), and update().
bool bbtk::wxVtkSceneManager::_startDragging [private] |
Definition at line 234 of file wxVtkSceneManager.h.
Referenced by OnLeftButtonDown(), OnMouseMove(), and wxVtkSceneManager().
vtkTextActor3D* bbtk::wxVtkSceneManager::_textActor [private] |
Definition at line 255 of file wxVtkSceneManager.h.
Referenced by configureBaseView(), and OnMouseMove().
int bbtk::wxVtkSceneManager::_worldState [private] |
Definition at line 240 of file wxVtkSceneManager.h.
Referenced by CancelConnection(), configGConnetion(), createGBlackBox(), OnLeftButtonDown(), OnLeftButtonUp(), OnMouseMove(), OnRightButtonUp(), update(), and wxVtkSceneManager().