std::string GBlackBoxModel::getStatusText()
{
std::string temp = "";
+ temp+=_bbtkPackage;
+ temp+=":";
temp+=_bbtkType;
temp+=":";
- temp+=_bbtkPackage;
+ temp+=_bbtkName;
+
return temp;
}
std::string GPortModel::getStatusText()
{
- std::string temp = "Name:";
+ std::string temp = "";
temp+=_bbtkName;
- temp+=" Type:";
- temp+=_bbtkType;
- temp+=" Box:";
- temp+=_parentBox->getBBTKType();
- if(_portType==GOUTPUTPORT)
- {
- temp+=" [Output Port]";
- }
- else if(_portType==GINPUTPORT)
+ if(isValueSet())
{
- if(isValueSet())
- {
- temp+=" Value:";
- temp+=_value;
- }
- temp+=" [Input Port]";
+ temp+="(";
+ temp+=_value;
+ temp+=")";
}
+ temp+=" ";
+ temp+=_bbtkType;
return temp;
}
const int CREATING_CONTOUR=106;
// Object dimensions
- const double BOX_HEIGHT = 15;
+ const double BOX_HEIGHT = 10;
const double BOX_WIDTH = 100;
- const double PORT_HEIGHT = 2.5;
- const double PORT_WIDTH = 2.5;
+ const double PORT_HEIGHT = 2.8;
+ const double PORT_WIDTH = 2.8;
// Commands
const int NO_COMMAND = 201;
_fillPolyMapper->Modified();
//-----------
- updatePositionTextActors(xInic, yInic,zInic);
+ updatePositionTextActor(xInic, yInic,zInic);
//-----------
setRefreshWaiting();
//------------
- _nameActor = vtkTextActor3D::New();
- std::string temp = _model->getBBTKName();
- _nameActor->GetTextProperty()->SetFontSize(80);
- _nameActor->GetTextProperty()->BoldOn();
- _nameActor->SetInput(temp.c_str());
+ _boxTextActor = vtkTextActor3D::New();
+ std::string temp = _model->getBBTKType();
+ temp+=":";
+ temp+=_model->getBBTKName();
+ _boxTextActor->GetTextProperty()->SetFontSize(80);
+ _boxTextActor->GetTextProperty()->BoldOn();
+ _boxTextActor->SetInput(temp.c_str());
//------------
- _typeActor = vtkTextActor3D::New();
- temp = _model->getBBTKType();
- _typeActor->GetTextProperty()->SetFontSize(80);
- _typeActor->GetTextProperty()->BoldOn();
- _typeActor->SetInput(temp.c_str());
-
- //------------
-
- updatePositionTextActors( xInic, yInic, zInic);
+ updatePositionTextActor( xInic, yInic, zInic);
}
//=========================================================================
void vtkGBlackBoxView::addVtkActors()//virtual
{
- _baseView->GetRenderer()->AddActor(_nameActor);
- _baseView->GetRenderer()->AddActor(_typeActor);
+ _baseView->GetRenderer()->AddActor(_borderObjectActor);
+ _baseView->GetRenderer()->AddActor(_boxTextActor);
vtkGObjectView::addVtkActors();
}
void vtkGBlackBoxView::removeVtkActors()//virtual
{
- _baseView->GetRenderer()->RemoveActor(_nameActor);
- _baseView->GetRenderer()->RemoveActor(_typeActor);
+ _baseView->GetRenderer()->RemoveActor(_borderObjectActor);
+ _baseView->GetRenderer()->RemoveActor(_boxTextActor);
vtkGObjectView::removeVtkActors();
}
//=========================================================================
- void vtkGBlackBoxView::updatePositionTextActors(double xInic, double yInic, double zInic)
+ void vtkGBlackBoxView::updatePositionTextActor(double xInic, double yInic, double zInic)
{
- _nameActor->SetPosition(xInic+4,yInic-5,zInic);
- _nameActor->SetScale(0.04,0.04,1);
-
- _typeActor->SetPosition(xInic+4,yInic-10,zInic);
- _typeActor->SetScale(0.04,0.04,1);
+ _boxTextActor->SetPosition(xInic+4,yInic-7,zInic);
+ _boxTextActor->SetScale(0.05,0.05,1);
}
//=========================================================================
_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);
- _nameActor->GetTextProperty()->SetColor(BOXTEXT_NH_R,BOXTEXT_NH_G,BOXTEXT_NH_B);
- _typeActor->GetTextProperty()->SetColor(BOXTEXT_NH_R,BOXTEXT_NH_G,BOXTEXT_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_HIGHLIGHTED_R,BOXBORDER_HIGHLIGHTED_G,BOXBORDER_HIGHLIGHTED_B);
_fillObjectActor->GetProperty()->SetColor(BOXFILL_HIGHLIGHTED_R,BOXFILL_HIGHLIGHTED_G,BOXFILL_HIGHLIGHTED_B);
- _nameActor->GetTextProperty()->SetColor(BOXTEXT_HIGHLIGHTED_R,BOXTEXT_HIGHLIGHTED_G,BOXTEXT_HIGHLIGHTED_B);
- _typeActor->GetTextProperty()->SetColor(BOXTEXT_HIGHLIGHTED_R,BOXTEXT_HIGHLIGHTED_G,BOXTEXT_HIGHLIGHTED_B);
+ _boxTextActor->GetTextProperty()->SetColor(BOXTEXT_HIGHLIGHTED_R,BOXTEXT_HIGHLIGHTED_G,BOXTEXT_HIGHLIGHTED_B);
}
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);
- _nameActor->GetTextProperty()->SetColor(BOXTEXT_DRAG_R,BOXTEXT_DRAG_G,BOXTEXT_DRAG_B);
- _typeActor->GetTextProperty()->SetColor(BOXTEXT_DRAG_R,BOXTEXT_DRAG_G,BOXTEXT_DRAG_B);
+ _boxTextActor->GetTextProperty()->SetColor(BOXTEXT_DRAG_R,BOXTEXT_DRAG_G,BOXTEXT_DRAG_B);
}
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);
- _nameActor->GetTextProperty()->SetColor(BOXTEXT_SELECTED_R,BOXTEXT_SELECTED_G,BOXTEXT_SELECTED_B);
- _typeActor->GetTextProperty()->SetColor(BOXTEXT_SELECTED_R,BOXTEXT_SELECTED_G,BOXTEXT_SELECTED_B);
+ _boxTextActor->GetTextProperty()->SetColor(BOXTEXT_SELECTED_R,BOXTEXT_SELECTED_G,BOXTEXT_SELECTED_B);
}
}
private:
//Private Attributes
- vtkTextActor3D* _nameActor;
- vtkTextActor3D* _typeActor;
+ vtkTextActor3D* _boxTextActor;
//Private Methods
- void updatePositionTextActors(double xInic, double yInic, double zInic);
+ void updatePositionTextActor(double xInic, double yInic, double zInic);
protected:
//=========================================================================
void vtkGObjectView::addVtkActors()//virtual
- {
- _baseView->GetRenderer()->AddActor(_borderObjectActor);
+ {
_baseView->GetRenderer()->AddActor(_fillObjectActor);
_baseView->GetRenderer()->Render();
}
void vtkGObjectView::removeVtkActors()//virtual
{
- _baseView->GetRenderer()->RemoveActor(_borderObjectActor);
_baseView->GetRenderer()->RemoveActor(_fillObjectActor);
_baseView->GetRenderer()->Render();
}
_pts->SetPoint(1, mid, yFin, zInic );
_pts->SetPoint(2, xFin, yInic, zFin );
- _borderObjectActor->Modified();
_fillPolyMapper->Modified();
setRefreshWaiting();
void vtkGPortView::createVtkObjects() //virtual
{
_pts = vtkPoints::New();
- vtkCellArray *lines = vtkCellArray::New();
- vtkPolyData *_pd = vtkPolyData::New();
- _borderPolyMapper=vtkPolyDataMapper::New();
- _borderObjectActor=vtkActor::New();
-
_pts->SetNumberOfPoints(3);
double xInic, yInic,zInic,xFin, yFin,zFin;
_pts->SetPoint(0, xInic, yInic, zInic );
_pts->SetPoint(1, mid, yFin, zInic );
- _pts->SetPoint(2, xFin, yInic, zFin );
-
- lines->InsertNextCell(4);
- lines->InsertCellPoint(0);
- lines->InsertCellPoint(1);
- lines->InsertCellPoint(2);
- lines->InsertCellPoint(0);
+ _pts->SetPoint(2, xFin, yInic, zFin );
- _pd->SetPoints( _pts );
- _pd->SetLines( lines );
-
- _borderPolyMapper->SetInput(_pd);
- _borderObjectActor->SetMapper(_borderPolyMapper);
- _borderPolyMapper->Modified();
-
-
///************************* FILL *************************
vtkCellArray *strip = vtkCellArray::New();
void vtkGPortView::updateColors()
{
- _borderObjectActor->GetProperty()->SetColor(BOXBORDER_NH_R,BOXBORDER_NH_G,BOXBORDER_NH_B);
- _fillObjectActor->GetProperty()->SetColor(0.6,0.6,0.6);
+ _fillObjectActor->GetProperty()->SetColor(0.5,0.45,0.45);
if(_state==HIGHLIGHTED)
{
- _borderObjectActor->GetProperty()->SetColor(0.35,0.15,0.1);
_fillObjectActor->GetProperty()->SetColor(0.8,0.8,0.8);
}
else
{
GPortModel* portm = (GPortModel*)_model;
- _borderObjectActor->GetProperty()->SetColor(0.15,0.15,0.15);
if(portm->isConnected())
{
- _fillObjectActor->GetProperty()->SetColor(0.2,0.2,0.2);
+ _fillObjectActor->GetProperty()->SetColor(0.15,0.15,0.15);
}
else if(portm->isValueSet())
{
- _fillObjectActor->GetProperty()->SetColor(0.5,0.2,0.2);
+ _fillObjectActor->GetProperty()->SetColor(0.55,0.25,0.25);
}
else
{
- _fillObjectActor->GetProperty()->SetColor(0.6,0.6,0.6);
+ _fillObjectActor->GetProperty()->SetColor(0.5,0.45,0.45);
}
}
}
wxBlackBoxEditionDialog::wxBlackBoxEditionDialog(wxGUIEditorGraphicBBS *parent,GBlackBoxModel *model):wxDialog(parent,wxID_ANY,_T(""), wxDefaultPosition, wxSize(480, 640),wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
_model=model;
- std::string title("BlackBox Editing - Name:");
- title+=_model->getBBTKName();
- title+=" Type:";
+ std::string title("BlackBox Editing - ");
+ title+=_model->getBBTKPackage();
+ title+=":";
title+=_model->getBBTKType();
+ title+=":";
+ title+=_model->getBBTKName();
SetTitle(std2wx(title));
constructBlackBoxEditionDialog();
for(int i = 0;i<lstInputs.size();i++)
{
GPortModel* port = lstInputs[i];
+ std::string type = port->getBBTKType();
wxStaticText *lblName = new wxStaticText(this, -1, std2wx(port->getBBTKName()),wxDefaultPosition,wxSize(100,25));
- wxStaticText *lblType = new wxStaticText(this, -1, std2wx(port->getBBTKType()),wxDefaultPosition,wxSize(250,25));
+ wxStaticText *lblType = new wxStaticText(this, -1, std2wx(type),wxDefaultPosition,wxSize(250,25));
wxTextCtrl *txtValue = new wxTextCtrl(this, -1, _T(""),wxDefaultPosition,wxSize(90,25));
-
+
if(port->getValue()!="")
{
txtValue->SetLabel(crea::std2wx(port->getValue()));
txtValue->SetEditable(false);
}
- _lstNames.push_back(lblName);
- _lstTypes.push_back(lblType);
+ char et = '*';
+ if(type.find(et)!=-1)
+ {
+ std::string noEditable("--No editable--");
+ txtValue->SetLabel(crea::std2wx(noEditable));
+ txtValue->SetEditable(false);
+ }
+
+ _lstNames.push_back(lblName);
_lstValues.push_back(txtValue);
+ _lstTypes.push_back(lblType);
- sizer->Add(lblName,1,wxEXPAND,5);
- sizer->Add(lblType,1,wxCENTRE|wxEXPAND,5);
+ sizer->Add(lblName,1,wxEXPAND,5);
sizer->Add(txtValue,1,wxEXPAND,5);
+ sizer->Add(lblType,1,wxCENTRE|wxEXPAND,5);
}
sizerDialog->Add(text,0,wxALIGN_TOP|wxALIGN_CENTER);
sizerDialog->AddSpacer(15);
sizerDialog->Add(sizer,0,wxALIGN_CENTER);
+ sizerDialog->AddSpacer(15);
sizerDialog->Add(buts,0,wxALIGN_CENTER | wxTOP | wxBOTTOM);
SetSizer(sizerDialog);