for(i=0;i<(int)_inputs.size();i++)
{
_inputs[i]->updatePortPosition();
- }
+ } // for i
//Refresh outputs position
for(i=0;i<(int)_outputs.size();i++)
{
_outputs[i]->updatePortPosition();
- }
+ }// for i
}
//=========================================================================
std::string GBoxModel::getStatusText()
{
std::string temp = "";
-
return temp;
}
_inputs[i]->updatePortPosition();
_inputs[i]->notifyObservers(_objectId);
}
-
for(int i = 0; i<_outputs.size();i++)
{
_outputs[i]->updatePortPosition();
}
}
- //=========================================================================
-
-
} // EO namespace bbtk
-
// EOF
private:
//Private Attributes
- GBoxModel *_parentBox;
+ GBoxModel *_parentBox;
// Port type (INPUT/OUTPUT)
- int _portType;
+ int _portType;
// The position of the port in the box
- int _posInBox;
- bool _isConnected;
+ int _posInBox;
+ bool _isConnected;
std::string _value;
- bool _isValueSet;
+ bool _isValueSet;
//Private Methods
protected:
//Protected methods
const double COMPLEXPORT_WIDTH = 3.3; // BOX_HEIGHT + PORT_HEIGHT
// Commands
- const int NO_COMMAND = 201;
- const int INIT_CREATION_CONTOUR = 202;
- const int FIN_CREATION_CONTOUR = 203;
- const int ADD_TO_SELECTED = 204;
- const int DRAG_OBJECTS = 205;
- const int EDIT_BLACKBOX = 206;
- const int REMOVE_FROM_SELECTED = 207;
- const int SELECTING_BOXES = 208;
+ const int NO_COMMAND = 201;
+ const int INIT_CREATION_CONTOUR = 202;
+ const int FIN_CREATION_CONTOUR = 203;
+ const int ADD_TO_SELECTED = 204;
+ const int DRAG_OBJECTS = 205;
+ const int EDIT_BLACKBOX = 206;
+ const int REMOVE_FROM_SELECTED = 207;
+ const int SELECTING_BOXES = 208;
+
+ const int COMMAND_CONNECTION_HIGHLIGHTED = 220;
+ const int STATE_CONNECTION_HIGHLIGHTED = 221;
+ const int STATE_CONNECTION_NORMAL = 222;
+ const double CONNECTION_HIGHLIGHTED = 1;
+ const double CONNECTION_NORMAL = 0.1;
//// COLORS (object_state_(R|G|B))
const double BOXFILL_SELECTED_G = 0.65;
const double BOXFILL_SELECTED_B = 0.05;
-
//Object Text colors
-
-
const double PORTFILL_NH_R = 0.0;
const double PORTFILL_NH_G = 0.0;
const double PORTFILL_NH_B = 0.0;
const int wxID_NOTEBOOK = 1018; // EED updated
- const int ID_bbEditor_Tool_Menu_CreatePackage = 1019; // EED
+ const int ID_bbEditor_Tool_Menu_CreatePackage = 1019; // EED
const int ID_bbEditor_Tool_Menu_CreateBlackBox = 1020; // EED
const int ID_bbEditor_Tool_Menu_PlugPackage = 1021; // EED
const int ID_bbEditor_Tool_Menu_EditConfig = 1022; // EED
const int ID_REDO = 1026; // FCY
const int ID_CHANGENAME = 1027;
- const int ID_EDITPROPERTIES = 1028; // RaC 2nd HackFest
- const int ID_SHOWTREE = 1029; // CFT
+ const int ID_EDITPROPERTIES = 1028; // RaC 2nd HackFest
+ const int ID_SHOWTREE = 1029; // CFT
//EED 2022-10-28
- const int ID_BTNSELETBOXES = 1032;
-
+ const int ID_BTNSELETBOXES = 1032;
-}
-// namespace bbtk
+}// namespace bbtk
#endif
* \brief Class bbtk::GObjectController
*/
-
#include "GObjectController.h"
-
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
namespace bbtk
{
//=========================================================================
-
- GObjectController::GObjectController( ) {
-
+ GObjectController::GObjectController( )
+ {
}
//=========================================================================
-
- GObjectController::~GObjectController( ) {
+ GObjectController::~GObjectController( )
+ {
}
//=========================================================================
-
- void GObjectController::setModelAndView( GObjectModel* model , vtkGObjectView* view ) {
+ void GObjectController::setModelAndView( GObjectModel* model , vtkGObjectView* view )
+ {
_model = model ;
_view = view ;
}
//=========================================================================
-
bool GObjectController::OnMouseMove( )
{
int X , Y ;
crea::wxVTKRenderWindowInteractor *_wxVTKiren ;
- _wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView( )->GetWxVTKRenderWindowInteractor( ) ;
+ _wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView( )->GetWxVTKRenderWindowInteractor( );
_wxVTKiren->GetEventPosition( X , Y ) ;
int state = _view->getState( ) ;
// EO JGRR & CM WH
_model->notifyObservers( getId( ) ) ;
-
-
return true ;
}
//=========================================================================
-
bool GObjectController::OnLeftButtonDown( )//virtual
{
int state = _view->getState( ) ;
-
//Evaluate new state
if ( state == HIGHLIGHTED ) {
_isLeftClickDown = true ;
}
//=========================================================================
-
bool GObjectController::OnLeftButtonUp( )//virtual
{
return true ;
}
//=========================================================================
-
bool GObjectController::OnLeftDClick( )//virtual
{
-
return true ;
}
}
//=========================================================================
-
- void GObjectController::moveObject( int X , int Y ) {
+ void GObjectController::moveObject( int X , int Y )
+ {
_view->moveObject( X , Y ) ;
}
//=========================================================================
-
- int GObjectController::getGObjectType( ) {
+ int GObjectController::getGObjectType( )
+ {
return _model->getGObjectType( ) ;
}
//=========================================================================
-
- GObjectModel* GObjectController::getModel( ) {
+ GObjectModel* GObjectController::getModel( )
+ {
return _model ;
}
//=========================================================================
-
- vtkGObjectView* GObjectController::getView( ) {
+ vtkGObjectView* GObjectController::getView( )
+ {
return _view ;
}
//=========================================================================
-
- int GObjectController::getId( ) {
+ int GObjectController::getId( )
+ {
return _model->getObjectId( ) ;
}
//=========================================================================
-
- void GObjectController::setId( int id ) {
+ void GObjectController::setId( int id )
+ {
_model->setObjectId( id ) ;
}
//=========================================================================
-
- std::string GObjectController::getStatusText( ) {
+ std::string GObjectController::getStatusText( )
+ {
return _model->getStatusText( ) ;
}
//=========================================================================
-
- void GObjectController::removeFromScene( ) {
+ void GObjectController::removeFromScene( )
+ {
_view->removeFromScene( ) ;
}
- //=========================================================================
-
} // EO namespace bbtk
-
// EOF
//Protected Attributes
GObjectModel *_model;
vtkGObjectView *_view;
- bool _isLeftClickDown;
+ bool _isLeftClickDown;
//Protected Methods
// Methods from InteractorStyleMaracas
virtual bool OnMouseMove( );
}
//=========================================================================
-
manualConnectorContourController::~manualConnectorContourController()
{
}
//=========================================================================
-
void manualConnectorContourController::MouseMove(int x, int y) // virtual
{
-
int z=GetZ();
-
GetManualViewBaseContour()->SelectPossiblePoint(x,y,z);
GetManualViewBaseContour()->SelectPossibleContour(x,y,z);
if (GetState()==1){ SetPoint( _bakIdPoint , x , y ,z); }
GetManualViewBaseContour()->Refresh();
this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
}
-
}
//=========================================================================
-
void manualConnectorContourController::MouseClickRight(int x, int y)
{
SetCompleteCreation( true );
SetKeyBoardMoving( false );
GetManualContourModel()->SetCloseContour(false);
-
SetEditable( false );
SetPossibleToMove( false );
SetState(0);
-
}
//=========================================================================
-
void manualConnectorContourController::MouseClickLeft(int x, int y)
{
-
- bool ok = false;
- int z=GetZ();
- int size= GetManualViewBaseContour()->GetNumberOfPoints();
-
-
+ bool ok = false;
+ int z = GetZ();
+ int size = GetManualViewBaseContour()->GetNumberOfPoints();
// Insert a Control Point with shift+ClickLeft
vtkRenderWindowInteractor *vtkrenderwindowinteractor = _vtkInteractorStyleBaseView->GetInteractor();
if( IsEditable() )
{
GetManualViewBaseContour()->Refresh();
}// ok
-
}
//=========================================================================
-
void manualConnectorContourController::endContourCreation()
{
SetCompleteCreation( true );
SetKeyBoardMoving( false );
GetManualContourModel()->SetCloseContour(false);
-
SetEditable( false );
SetPossibleToMove( false );
SetState(0);
}
-
- //=========================================================================
-
} // EO namespace bbtk
-
// EOF
* \brief Class bbtk::manualConnectorContourView
*/
-
#include "manualConnectorContourView.h"
namespace bbtk
{
-
//=========================================================================
-
manualConnectorContourView::manualConnectorContourView()
{
}
//=========================================================================
-
manualConnectorContourView::~manualConnectorContourView()
{
}
//=========================================================================
-
void manualConnectorContourView::TransfromCoordViewWorld(double &X, double &Y, double &Z, int type)
{
// Make the conversion using the system of creaMaracasVisu
}
//=========================================================================
-
void manualConnectorContourView::updateStartAndEnd(double* start , double* end)
{
// Update contour first and last point
}
//=========================================================================
-
void manualConnectorContourView::AddControlPoints()
{
vtkRenderer * theRenderer = _wxvtkbaseview->GetRenderer();
}
//=========================================================================
-
void manualConnectorContourView::RefreshText() // virtual
{
// The text that goes with the contour is not shown
}
-
} // EO namespace bbtk
-
// EOF
// _borderObjectActor->SetMapper(_borderPolyMapper);
// _borderPolyMapper->Modified();
-
///************************* FILL *************************
vtkCellArray *strip = vtkCellArray::New();
vtkPolyData *pdFill = vtkPolyData::New();
strip->InsertCellPoint(3);
pdFill->SetPoints( _pts );
pdFill->SetStrips( strip );
-
-
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
_fillPolyMapper->SetInput(pdFill);
#else
_fillPolyMapper->SetInputData(pdFill);
#endif
-
-
_fillObjectActor->SetMapper(_fillPolyMapper);
_fillPolyMapper->Modified();
///************************* FILL *************************
-
-
-
createVtkInputOutputPorts();
-
-
-
//------------
-
// _boxTextActor = vtkTextActor::New(); // for actor 2D
_boxTextActor = vtkTextActor3D::New();
vtkTextProperty *prop = vtkTextProperty::New();
prop->SetFontSize(40);
_boxTextActor->SetTextProperty(prop);
//------------
-
updatePositionTextActor( xInic, yInic, zInic);
}
//===============BoundaryEdgesOn==========================================================
-
void vtkGBlackBoxView::addVtkActors()//virtual
{
-
// _baseView->GetRenderer()->AddActor(_borderObjectActor);
vtkGBoxView::addVtkActors();
_baseView->GetRenderer()->AddActor(_boxTextActor);
-
}
//=========================================================================
-
void vtkGBlackBoxView::removeVtkActors()//virtual
{
_baseView->GetRenderer()->RemoveActor(_boxTextActor);
}
//=========================================================================
-
void vtkGBlackBoxView::updatePositionTextActor(double xInic, double yInic, double zInic)
{
std::string temp = _model->getBBTKType();
}
//=========================================================================
-
void vtkGBlackBoxView::updateColors()
{
_fillObjectActor->GetProperty()->SetAmbient(0.6);
-
if(_state==NOTHING_HAPPENS)
{
// _borderObjectActor->GetProperty()->SetLineWidth(1);
/// _borderObjectActor->GetProperty()->SetColor(BOXBORDER_NH_R,BOXBORDER_NH_G,BOXBORDER_NH_B);
_fillObjectActor->GetProperty()->SetColor(BOXFILL_NH_R,BOXFILL_NH_G,BOXFILL_NH_B);
_boxTextActor->GetTextProperty()->SetColor(BOXTEXT_NH_R,BOXTEXT_NH_G,BOXTEXT_NH_B);
-
GBlackBoxModel *bbmodel = (GBlackBoxModel*)_model;
if(bbmodel->isExecutable())
{
// _borderObjectActor->GetProperty()->SetColor(BOXBORDER_NH_R,0.9,BOXBORDER_HIGHLIGHTED_B);
_fillObjectActor->GetProperty()->SetColor(BOXFILL_NH_R,0.9,BOXFILL_HIGHLIGHTED_B);
}
-
}
else if(_state==HIGHLIGHTED)
{
_fillObjectActor->GetProperty()->SetColor(BOXFILL_SELECTED_R,BOXFILL_SELECTED_G,BOXFILL_SELECTED_B);
_boxTextActor->GetTextProperty()->SetColor(BOXTEXT_SELECTED_R,BOXTEXT_SELECTED_G,BOXTEXT_SELECTED_B);
}
-
updateColorsPorts();
-
}
- //=========================================================================
-
-
} // EO namespace bbtk
// EOF
* \brief Class bbtk::vtkGBoxView
*/
-
#include "vtkGBoxView.h"
#include "vtkUnsignedCharArray.h"
#include "vtkCellData.h"
namespace bbtk
{
-
-
//=========================================================================
vtkGBoxView::vtkGBoxView()
{
//=========================================================================
void vtkGBoxView::update(int idController,int command)
{
- updateColors();
+ updateColors();
double xInic, yInic,zInic,xFin, yFin,zFin;
_model->getInicPoint(xInic,yInic,zInic);
_model->getFinalPoint(xFin, yFin,zFin);
setRefreshWaiting();
}
-
//=========================================================================
//EED2017
void vtkGBoxView::createVtkInputOutputPorts()
_TrianglesInputsActor->SetMapper(_TrianglesInputsPolyMapper);
_TrianglesInputsPolyMapper->Modified();
-
///************************* Inputs Fill (triangles) *************************
///************************* Outputs Fill (triangles) *************************
///************************* Inputs Fill (triangles) *************************
}
-
//=========================================================================
-
void vtkGBoxView::createVtkObjects() //virtual
{
//------------
// vtkPolyData *_pd = vtkPolyData::New();
// _borderPolyMapper = vtkPolyDataMapper::New();
// _borderObjectActor = vtkActor::New();
-
_pts->SetNumberOfPoints(4);
-
double xInic, yInic,zInic,xFin, yFin,zFin;
_model->getInicPoint(xInic,yInic,zInic);
_model->getFinalPoint(xFin, yFin,zFin);
// _borderObjectActor->SetMapper(_borderPolyMapper);
// _borderPolyMapper->Modified();
-
///************************* FILL *************************
vtkCellArray *strip = vtkCellArray::New();
}
//=========================================================================
-
void vtkGBoxView::addVtkActors()//virtual
{
// _baseView->GetRenderer()->AddActor(_borderObjectActor);
}
//=========================================================================
-
void vtkGBoxView::removeVtkActors()//virtual
{
// _baseView->GetRenderer()->RemoveActor(_borderObjectActor);
}
//=========================================================================
-
void vtkGBoxView::updateColors()
{
printf("EED vtkGBoxView::updateColors\n");
_fillObjectActor->GetProperty()->SetAmbient(0.6);
-
if(_state==NOTHING_HAPPENS)
{
// _borderObjectActor->GetProperty()->SetLineWidth(1);
// _borderObjectActor->GetProperty()->SetColor(BOXBORDER_NH_R,BOXBORDER_NH_G,BOXBORDER_NH_B);
_fillObjectActor->GetProperty()->SetColor(BOXFILL_NH_R,BOXFILL_NH_G,BOXFILL_NH_B);
-
- }
- else if(_state==HIGHLIGHTED)
- {
-// _borderObjectActor->GetProperty()->SetLineWidth(2);
+ } else if(_state==HIGHLIGHTED) {
+// _borderObjectActor->GetProperty()->SetLineWidth(2);
// _borderObjectActor->GetProperty()->SetColor(BOXBORDER_HIGHLIGHTED_R,BOXBORDER_HIGHLIGHTED_G,BOXBORDER_HIGHLIGHTED_B);
_fillObjectActor->GetProperty()->SetColor(BOXFILL_HIGHLIGHTED_R,BOXFILL_HIGHLIGHTED_G,BOXFILL_HIGHLIGHTED_B);
- }
- else if(_state==DRAG)
- {
+ } else if(_state==DRAG) {
// _borderObjectActor->GetProperty()->SetLineWidth(1.2);
// _borderObjectActor->GetProperty()->SetColor(BOXBORDER_DRAG_R,BOXBORDER_DRAG_G,BOXBORDER_DRAG_B);
_fillObjectActor->GetProperty()->SetColor(BOXFILL_DRAG_R,BOXFILL_DRAG_G,BOXFILL_DRAG_B);
- }
- else if(_state==SELECTED)
- {
+ } else if(_state==SELECTED) {
// _borderObjectActor->GetProperty()->SetLineWidth(2);
// _borderObjectActor->GetProperty()->SetColor(BOXBORDER_SELECTED_R,BOXBORDER_SELECTED_G,BOXBORDER_SELECTED_B);
_fillObjectActor->GetProperty()->SetColor(BOXFILL_SELECTED_R,BOXFILL_SELECTED_G,BOXFILL_SELECTED_B);
} // if state box
-
updateColorsPorts();
}
-
//=========================================================================
void vtkGBoxView::updateColorsPorts()
{
} // for
}
-
//=========================================================================
void vtkGBoxView::updatePorts()
{
double xInic, yInic,zInic,xFin, yFin,zFin;
-
GBoxModel* boxModel = (GBoxModel*)_model;
boxModel->updatePorts();
-
// update position for one Actor that represents all InputPorts
GPortModel *portModel;
int numberOfTriangles = boxModel->getNumInputPorts();
// RaC In the actual version, zInic=zFin=GPOSITION_Z
_TrianglesInputsPts->SetPoint(i*3+0, xInic , yInic , zInic );
_TrianglesInputsPts->SetPoint(i*3+1, ( xInic + xFin ) / 2 , yFin , zInic );
- _TrianglesInputsPts->SetPoint(i*3+2, xFin , yInic , zFin );
+ _TrianglesInputsPts->SetPoint(i*3+2, xFin , yInic , zFin );
}
_TrianglesInputsPts->Modified();
_TrianglesInputsPolyMapper->Modified( ) ;
// RaC In the actual version, zInic=zFin=GPOSITION_Z
_TrianglesOutputsPts->SetPoint(i*3+0, xInic , yInic , zInic );
_TrianglesOutputsPts->SetPoint(i*3+1, ( xInic + xFin ) / 2 , yFin , zInic );
- _TrianglesOutputsPts->SetPoint(i*3+2, xFin , yInic , zFin );
+ _TrianglesOutputsPts->SetPoint(i*3+2, xFin , yInic , zFin );
}
_TrianglesOutputsPts->Modified();
_TrianglesOutputsPolyMapper->Modified( ) ;
-
-
-
}
//=========================================================================
_outputsG.push_back(outputport);
}
-
} // EO namespace bbtk
-
// EOF
namespace bbtk
{
-
-
//=========================================================================
-
vtkGConnectorView::vtkGConnectorView()
{
}
//=========================================================================
-
vtkGConnectorView::~vtkGConnectorView()
{
}
//=========================================================================
-
void vtkGConnectorView::setManualContourView(manualViewContour *viewContour)
{
manViewContour = viewContour;
}
//=========================================================================
-
manualViewContour* vtkGConnectorView::getManualContourView()
{
return manViewContour;
}
//=========================================================================
-
void vtkGConnectorView::updateStartEndPoints()
{
GConnectorModel* mod=(GConnectorModel*)_model;
mod->updateStartEndPoints();
manViewContour->RefreshContour();
}
-
-} // EO namespace bbtk
+//=========================================================================
+void vtkGConnectorView::update(int idController,int command)
+{
+ if ( command == COMMAND_CONNECTION_HIGHLIGHTED )
+ {
+ if (_state==STATE_CONNECTION_HIGHLIGHTED )
+ {
+ getManualContourView()->SetOpacity( CONNECTION_HIGHLIGHTED );
+ }
+ if (_state==STATE_CONNECTION_NORMAL )
+ {
+ getManualContourView()->SetOpacity( CONNECTION_NORMAL );
+ }
+ } // if command
+ getManualContourView()->UpdateColorActor();
+}
+
+} // EO namespace bbtk
// EOF
void setManualContourView(manualViewContour* viewContour);
manualViewContour* getManualContourView();
void updateStartEndPoints();
+ void update(int idController,int command);
private:
//Attributes
manualViewContour* manViewContour;
vtkActor * _fillObjectActor;
vtkPolyDataMapper * _fillPolyMapper;
// vtkPolyDataMapper * _borderPolyMapper;
- vtkPoints *_pts;
+ vtkPoints * _pts;
// State of the object (See GlobalConstants.h)
- int _state;
+ int _state;
//Protected Methods
virtual void removeVtkActors();
virtual void updateColors();
//=========================================================================
- vtkGPortView::vtkGPortView( ) {
+ vtkGPortView::vtkGPortView( )
+ {
}
//=========================================================================
- vtkGPortView::~vtkGPortView( ) {
+ vtkGPortView::~vtkGPortView( )
+ {
}
//=========================================================================
void vtkGPortView::update( int idController , int command )
-{
+ {
updateColors( ) ;
double xInic , yInic , zInic , xFin , yFin , zFin ;
_fillPolyMapper->Modified( ) ;
///************************* FILL *************************
-
+ ///
updateColors( ) ;
-
-
}
//=========================================================================
}
} // EO namespace bbtk
-
// EOF
~vtkGPortView();
//Public methods
virtual void update(int idController,int command);
- void getColors(float* rgb);
+ void getColors(float* rgb);
private:
//Private Attributes
k = GetBBTKFactory()->GetPackage(packageName);
mapDesc = k->GetDescriptorMap();
descriptor = mapDesc[boxType];
-
bool result=false;
descriptor->IsTypeOfScript_Application();
if (descriptor!=NULL)
} else {
printf("EED ERROR wxGUIEditorGraphicBBS::TryToOpenScript >> The descriptor of this box not exists (packageName:%s boxType:%s) this is not normal\n",packageName.c_str(), boxType.c_str() );
} // if descriptor NULL
-
return result;
}
} // EO namespace bbtk
-
// EOF
* \brief Class bbtk::wxGEditorTabPanel .
*/
-
#include "wxGEditorTabPanel.h"
#include "creaWx.h"
namespace bbtk
{
-
//=========================================================================
wxGEditorTabPanel::wxGEditorTabPanel()
{
wxGEditorTabPanel::~wxGEditorTabPanel()
{
//ED02JUIN2010 _sceneManager->disconnectDrop();
-
_panelsManager->VerifyLastTabPanel();
//FCY memory leaks
delete _panelAUIMgr;
bool wxGEditorTabPanel::OnDropText(wxCoord x, wxCoord y, const wxString& data)
{
-
/*
* DFGO
* To handle bbs and bbg:
* For a drag and drop tutorial read:
* http://zetcode.com/gui/wxwidgets/dragdrop/
*/
-
//wxMessageBox(data);
-
-
-
int posEndEED=data.find("<EndEED>");
wxString data2( data.substr(0,posEndEED) );
std::string stdData = crea::wx2std(data2);
{
return( this->_fileName );
}
-
//=========================================================================
// EED 2022-10-28
void wxGEditorTabPanel::SelectBoxWithPossibleName(std::string nameFilter )
getSceneManager()->SelectBoxWithPossibleName( nameFilter );
}
-
-
-
} // EO namespace bbtk
// EOF
* knowledge of the CeCILL-B license and that you accept its terms.
* ------------------------------------------------------------------------ */
-
-
/**
* \file
* \brief Class bbtk::BlackBox : abstract black-box interface.
void saveStringAction(const std::string &action);
// Load temporary diagram as BBG
- void loadTempDiagram(unsigned short un);
+ void loadTempDiagram(unsigned short un);
// evaluate the position in the undo actions list
unsigned short getUndoState(std::string &);
void displayBlackBoxInfo(std::string packageName, std::string boxName);
void updateStatusBar(std::string textStatus);
- int getPanelId();
+ int getPanelId();
bool isComplexBox();
void setComplexBox(bool val);
std::map<int,GObjectController*> getSelectedObjects();
void addObjects(std::map<int,GObjectController*> objectsMap);
- int getNumSelectedObjects();
+ int getNumSelectedObjects();
// Receives the string from a drag and drop source as for example the BBTK Package Browser
virtual bool OnDropText(wxCoord x, wxCoord y, const wxString& data);
std::string GetCbName();
std::string GetCbPackageName();
std::string GetAuthor();
- int GetExportFormat();
+ int GetExportFormat();
std::string GetDescription();
std::string GetCategory();
std::string GetMessageKind();
std::string _fileName;
protected:
Factory::Pointer _bbtkfactory;
-
};
-
-}
-// namespace bbtk
+}// namespace bbtk
#endif
namespace bbtk
{
-
-
//=========================================================================
wxTabPanelsManager::wxTabPanelsManager(wxGUIEditorGraphicBBS *parent)
{
addNewTab();
_notebook->Connect(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED,wxAuiNotebookEventHandler(wxTabPanelsManager::OnTabChanged),0,this);
_notebook->Connect(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE,wxAuiNotebookEventHandler(wxTabPanelsManager::OnTabClose),0,this);
-
}
//=========================================================================
_notebook->AddPage(newPanel, tabName ,true);
}
-
-
-
-
//=========================================================================
wxAuiNotebook* wxTabPanelsManager::getAuiNotebook()
{
_fillObjectActor->GetProperty()->SetOpacity(0);
_aPolygonMapper->Modified();
_baseView->GetRenderer()->AddActor(_fillObjectActor);
-
}
//=========================================================================
-
std::string wxVtkSceneManager::generateANewNameForABox() {
std::stringstream boxname;
if (_numBoxes < 10) {
}
//=========================================================================
-
std::string wxVtkSceneManager::findANewNameForABox()
{
std::string boxname = generateANewNameForABox();
//EED 15 oct 2012 BlackBoxDescriptor::Pointer descriptor = GObjectsMVCFactory::getInstance()->getBlackBoxDescriptor(packageName, boxType);
-
Package::Pointer k;
std::map< std::string, BlackBoxDescriptor::Pointer> mapDesc;
try{
{
return _baseView->GetRenWin();
}
-//=========================================================================
-
//=========================================================================
-int wxVtkSceneManager::GetIndexInSelected(int idControler)
+int wxVtkSceneManager::GetIndexInSelected(int idControler)
{
int index = -1;
for (int i = 0; i < (int) _selectedObjects.size(); i++)
}
return index;
}
-//=========================================================================
-
-void wxVtkSceneManager::update(int idController, int command) {
+//=========================================================================
+void wxVtkSceneManager::update(int idController, int command)
+{
if (command != NO_COMMAND)
{
if (command == ADD_TO_SELECTED)
}
connView->Refresh();
}
-
}
-
}
//=========================================================================
-
bool wxVtkSceneManager::OnMouseMove()
{
int X, Y;
crea::wxVTKRenderWindowInteractor *wxVTKiren;
wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
wxVTKiren->GetEventPosition(X, Y);
-
if (_worldState == DRAG_OBJECTS)
{
for (int i = 0; i < (int) _selectedObjects.size(); i++)
} // if state
} // for controllers it
} else if (_worldState == SELECTING_BOXES ) {
-
-
int sX1,sX2,sY1,sY2;
if (X<selectRegionX1)
{
desc = it->second;
type = desc->getGObjectType();
state = desc->getView()->getState();
-
if ( (type==GBLACKBOX) || (type==GCOMPLEXINPUTPORT) || (type==GCOMPLEXOUTPUTPORT) )
{
if ( desc->getView()->isBoxInsideRectangle( sX1 , sY1,sX2 , sY2 ) )
desc->getView()->setState(SELECTED);
id = desc->getModel()->getObjectId();
desc->getModel()->notifyObservers( id , ADD_TO_SELECTED );
+
+//EED 2025-11-29
+ // Aqui toca seleccionar los connector input y output de esta caja
+
}
} // if type == 1
- } // for
+ } // for it
+//EED 2025-11-29
+ for (int i = 0; i < (int) _selectedObjects.size(); i++)
+ {
+ int id = _selectedObjects[i];
+ GObjectController* cont = _controllers[id];
+ std::string name = cont->getModel()->getBBTKName();
+ printf("EED wxVtkSceneManager::OnMouseMove %d %s\n", id, name.c_str() );
+ }
+
} // if _worldState
{
for (int i = 0; i < (int) _selectedObjects.size(); i++)
{
- int id = _selectedObjects[i];
- GObjectController *cont = _controllers[id];
+ int id = _selectedObjects[i];
+ GObjectController *cont = _controllers[id];
cont->getView()->setState(DRAG);
cont->getModel()->notifyObservers(_idManager);
} // for
} // if _worldState DRAG_OBJECTS
- } // if _selectedObjects.size
+ } // if NOT INIT_CREATION_CONTOUR
return true;
}
if ( command == REMOVE_FROM_SELECTED ) {
std::cout << "COMMAND ----> REMOVE_FROM_SELECTED \n" ;
}
-
}
//=========================================================================
{
UnSelectBlackBoxes();
std::map<int, GObjectController*>::iterator it;
- GObjectController *desc;
- int type;
int id;
- int pos;
- std::string possibleNameAA = possibleName;
- std::string boxNameBB;
- int i,size;
- size = possibleNameAA.length();
- for (i=0;i<size;i++)
- {
- if ((possibleNameAA[i]>='A')&&(possibleNameAA[i]<='Z')) { possibleNameAA[i]=possibleNameAA[i]+32; }
- } //for i
+ int type;
+ GObjectController *desc;
+ std::string boxNameBB;
+ std::string possibleNameAA = possibleName;
+ //
+ bool ok;
+ GBoxModel *modelBoxStart;
+ GBoxModel *modelBoxEnd;
+ std:string boxNameStart;
+ std::string boxNameEnd;
+ std::transform( possibleNameAA.begin(),possibleNameAA.end(),possibleNameAA.begin(), ::toupper );
+
for (it = _controllers.begin(); it != _controllers.end(); ++it)
{
desc = it->second;
type = desc->getGObjectType();
+ // Select Box
if ( type==GBLACKBOX)
{
boxNameBB = desc->getModel()->getBBTKType() +":"+ desc->getModel()->getBBTKName();
- size=boxNameBB.length();
- for (i=0;i<size;i++)
- {
- if ((boxNameBB[i]>='A')&&(boxNameBB[i]<='Z')) { boxNameBB[i]=boxNameBB[i]+32; }
- } // for i
-
- pos=boxNameBB.find( possibleNameAA );
- if (pos>=0)
+ std::transform( boxNameBB.begin(),boxNameBB.end(),boxNameBB.begin(),::toupper);
+ if ( (int)(boxNameBB.find(possibleNameAA)) >= 0 )
{
desc->getView()->setState(SELECTED);
id = desc->getModel()->getObjectId();
desc->getModel()->notifyObservers( id , ADD_TO_SELECTED );
} // if pos
- } // if type == 1
+ } // if type == 1 GBLACKBOX // GlobalConstants.h
+
+//EED 2025-11-29
+ // Select Connector
+ if ( type==GCONNECTOR)
+ {
+ ok = false;
+ GConnectorModel *connectorModel = (GConnectorModel*) (desc->getModel());
+ vtkGConnectorView *connectorView = (vtkGConnectorView*) (desc->getView());
+
+// id = desc->getModel()->getObjectId();
+// desc->getModel()->notifyObservers( id , COMMAND_CONNECTION_NORMAL );
+//connectorView->getManualContourView()->SetOpacity(0.1);
+ desc->getView()->setState(STATE_CONNECTION_NORMAL);
+
+ //start
+ modelBoxStart = connectorModel->getStartPort()->getParentBox();
+ boxNameStart = modelBoxStart->getBBTKType() +":"+ modelBoxStart->getBBTKName();
+ std::transform( boxNameStart.begin(),boxNameStart.end(),boxNameStart.begin(),::toupper);
+ if ( (int)(boxNameStart.find(possibleNameAA)) >= 0 ) { ok= true;}
+ //end
+ modelBoxEnd = connectorModel->getEndPort()->getParentBox();
+ boxNameEnd = modelBoxEnd->getBBTKType() +":"+ modelBoxEnd->getBBTKName();
+ std::transform( boxNameEnd.begin(),boxNameEnd.end(),boxNameEnd.begin(),::toupper);
+ if ( (int)(boxNameEnd.find(possibleNameAA)) >= 0 ) { ok= true; }
+ //
+ if (ok==true)
+ {
+// id = desc->getModel()->getObjectId();
+// desc->getModel()->notifyObservers( id , COMMAND_CONNECTION_HIGHLIGHTED );
+ desc->getView()->setState(STATE_CONNECTION_HIGHLIGHTED);
+// connectorView->getManualContourView()->SetOpacity(1);
+// connectorView->getManualContourView()->UpdateColorActor();
+ } // if ok
+
+ id = desc->getModel()->getObjectId();
+ desc->getModel()->notifyObservers( id , COMMAND_CONNECTION_HIGHLIGHTED );
+
+// connectorView->getManualContourView()->UpdateColorActor();
+ } //if type== 2 GCONNECTOR // GlobalConstants.h
+
} // for it
refresh();
}
} // EO namespace bbtk
-
// EOF
* knowledge of the CeCILL-B license and that you accept its terms.
* ------------------------------------------------------------------------ */
-
-
/**
* \file
* \brief Class bbtk::BlackBox : abstract black-box interface.
#include <vtkActor.h>
#include <vtkPoints.h>
#include <vtkTextActor3D.h>
- #include <vtkDataSetMapper.h>
-
+#include <vtkDataSetMapper.h>
//Includes std
#include <iostream>
protected:
};
-
}
// namespace bbtk
#endif