- New version of file bbg bbs v1.2 -> 1.3
- New position of the graphical objects -900
- Reconfiguration of the camera BoxRenderRegion
16 files changed:
- * \mainpage bbtk documentation
+ * \mainpage bbtkGEditor documentation
\htmlonly
"A black box is any system in which only the input and output characteristics are of interest - without regard to its internal mechanism or structure" (from <A href="http://en.wikipedia.org/wiki/Black_box_%28disambiguation%29" > wikipedia </A>)
\htmlonly
"A black box is any system in which only the input and output characteristics are of interest - without regard to its internal mechanism or structure" (from <A href="http://en.wikipedia.org/wiki/Black_box_%28disambiguation%29" > wikipedia </A>)
-<li>
-<A href="../CodingStyle.html"> Coding Style </A>
-</li>
// Refresh the position of the contourModel last point with the data of the connector model
point = _model->GetManualPoint(_model->GetSizeLstPoints()-1);
point->SetPoint(xCenter,yport,zCenter);
// Refresh the position of the contourModel last point with the data of the connector model
point = _model->GetManualPoint(_model->GetSizeLstPoints()-1);
point->SetPoint(xCenter,yport,zCenter);
}
//=========================================================================
}
//=========================================================================
}
//=========================================================================
}
//=========================================================================
//=========================================================================
GPortModel::GPortModel( ) {
//=========================================================================
GPortModel::GPortModel( ) {
- _parentBox = NULL ;
- _portType = -1 ;
- _posInBox = 0 ;
- _isConnected = false ;
- _value = "" ;
- _isValueSet = false ;
+ _parentBox = NULL ;
+ _portType = -1 ;
+ _posInBox = 0 ;
+ _isConnected = false ;
+ _value = "" ;
+ _isValueSet = false ;
}
//=========================================================================
}
//=========================================================================
//=========================================================================
void GPortModel::registerInBox( GBoxModel *blackBox , int portType , int pos ) {
//=========================================================================
void GPortModel::registerInBox( GBoxModel *blackBox , int portType , int pos ) {
- _parentBox = blackBox ;
- _portType = portType ;
- _posInBox = pos ;
-
+ _parentBox = blackBox ;
+ _portType = portType ;
+ _posInBox = pos ;
}
//=========================================================================
}
//=========================================================================
//=========================================================================
GBoxModel* GPortModel::getParentBox( ) {
//=========================================================================
GBoxModel* GPortModel::getParentBox( ) {
}
//=========================================================================
}
//=========================================================================
const int GCOMPLEXINPUTPORT = 6;
const int GCOMPLEXOUTPUTPORT = 7;
const int GCOMPLEXINPUTPORT = 6;
const int GCOMPLEXOUTPUTPORT = 7;
+ const double GPOSITION_Z = -900;
+
{
if ( _vtkInteractorStyleBaseView!=NULL )
{
{
if ( _vtkInteractorStyleBaseView!=NULL )
{
+ int X, Y, Z=GPOSITION_Z;
wxVTKRenderWindowInteractor *wxVTKiren;
wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
wxVTKiren->GetEventPosition(X, Y);
wxVTKRenderWindowInteractor *wxVTKiren;
wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
wxVTKiren->GetEventPosition(X, Y);
-
- printf("EED MACHETE con int z=-GetZ(); en manualConnectorContourController::MouseMove z=%d\n", z );
- z=-z;
GetManualViewBaseContour()->SelectPosiblePoint(x,y,z);
GetManualViewBaseContour()->SelectPosibleContour(x,y,z);
GetManualViewBaseContour()->SelectPosiblePoint(x,y,z);
GetManualViewBaseContour()->SelectPosibleContour(x,y,z);
int size= GetManualViewBaseContour()->GetNumberOfPoints();
int size= GetManualViewBaseContour()->GetNumberOfPoints();
- printf("\nEED manualConnectorContourController::MouseClickLeft z=%d estado=%d\n", z,GetState());
- if (IsEditable())
- {
- printf(" Editable\n");
- } else {
- printf(" NO Editable\n");
- }
-
-
- if (GetManualViewBaseContour()->GetPosibleSelected())
- {
- printf(" PosibleSelected\n");
- } else {
- printf(" NO PosibleSelected\n");
- }
-
-
// Insert a Control Point with shift+ClickLeft
vtkRenderWindowInteractor *vtkrenderwindowinteractor = _vtkInteractorStyleBaseView->GetInteractor();
if( IsEditable() )
// Insert a Control Point with shift+ClickLeft
vtkRenderWindowInteractor *vtkrenderwindowinteractor = _vtkInteractorStyleBaseView->GetInteractor();
if( IsEditable() )
update_X_Fin();
_model->getFinalPoint(xFin, yFin,zFin);
update_X_Fin();
_model->getFinalPoint(xFin, yFin,zFin);
- // RaC In the actual version, zInic=zFin=900
+ // RaC In the actual version, zInic=zFin=GPOSITION_Z
_pts->SetPoint(0, xInic, yInic, zInic );
_pts->SetPoint(1, xInic, yFin, zInic );
_pts->SetPoint(0, xInic, yInic, zInic );
_pts->SetPoint(1, xInic, yFin, zInic );
_model->getInicPoint(xInic,yInic,zInic);
_model->getFinalPoint(xFin, yFin,zFin);
_model->getInicPoint(xInic,yInic,zInic);
_model->getFinalPoint(xFin, yFin,zFin);
- // RaC In the actual version, zInic=zFin=900
+ // RaC In the actual version, zInic=zFin=GPOSITION_Z
//EED _pts->SetPoint(0, xInic, yInic, zInic );
//EED _pts->SetPoint(1, xInic, yFin, zInic );
//EED _pts->SetPoint(0, xInic, yInic, zInic );
//EED _pts->SetPoint(1, xInic, yFin, zInic );
_fillPolyMapper = vtkPolyDataMapper::New();
_fillObjectActor = vtkActor::New();
_fillPolyMapper = vtkPolyDataMapper::New();
_fillObjectActor = vtkActor::New();
- // RaC In the actual version, zInic=zFin=900
+ // RaC In the actual version, zInic=zFin=GPOSITION_Z
strip->InsertNextCell(5);
strip->InsertCellPoint(0);
strip->InsertNextCell(5);
strip->InsertCellPoint(0);
_model->getInicPoint(xInic,yInic,zInic);
_model->getFinalPoint(xFin, yFin,zFin);
_model->getInicPoint(xInic,yInic,zInic);
_model->getFinalPoint(xFin, yFin,zFin);
- // RaC In the actual version, zInic=zFin=900
+ // RaC In the actual version, zInic=zFin=GPOSITION_Z
_pts->SetPoint(0, xInic, yInic, zInic );
_pts->SetPoint(1, xInic, yFin, zInic );
_pts->SetPoint(0, xInic, yInic, zInic );
_pts->SetPoint(1, xInic, yFin, zInic );
_model->getInicPoint(xInic,yInic,zInic);
_model->getFinalPoint(xFin, yFin,zFin);
_model->getInicPoint(xInic,yInic,zInic);
_model->getFinalPoint(xFin, yFin,zFin);
- // RaC In the actual version, zInic=zFin=900
+ // RaC In the actual version, zInic=zFin=GPOSITION_Z
//EED _pts->SetPoint(0, xInic, yInic, zInic );
//EED _pts->SetPoint(1, xInic, yFin, zInic );
//EED _pts->SetPoint(0, xInic, yInic, zInic );
//EED _pts->SetPoint(1, xInic, yFin, zInic );
_fillPolyMapper = vtkPolyDataMapper::New();
_fillObjectActor = vtkActor::New();
_fillPolyMapper = vtkPolyDataMapper::New();
_fillObjectActor = vtkActor::New();
- // RaC In the actual version, zInic=zFin=900
+ // RaC In the actual version, zInic=zFin=GPOSITION_Z
strip->InsertNextCell(5);
strip->InsertCellPoint(0);
strip->InsertNextCell(5);
strip->InsertCellPoint(0);
_model->getInicPoint( xInic , yInic , zInic ) ;
_model->getFinalPoint( xFin , yFin , zFin ) ;
_model->getInicPoint( xInic , yInic , zInic ) ;
_model->getFinalPoint( xFin , yFin , zFin ) ;
- // RaC In the actual version, zInic=zFin=900
+ // RaC In the actual version, zInic=zFin=GPOSITION_Z
_pts->SetPoint( 0 , xInic , yInic , zInic ) ;
_pts->SetPoint( 1 , xInic , yFin , zInic ) ;
_pts->SetPoint( 0 , xInic , yInic , zInic ) ;
_pts->SetPoint( 1 , xInic , yFin , zInic ) ;
_model->getInicPoint( xInic , yInic , zInic ) ;
_model->getFinalPoint( xFin , yFin , zFin ) ;
_model->getInicPoint( xInic , yInic , zInic ) ;
_model->getFinalPoint( xFin , yFin , zFin ) ;
- // RaC In the actual version, zInic=zFin=900
+ // RaC In the actual version, zInic=zFin=GPOSITION_Z
//EED _pts->SetPoint(0, xInic, yInic, zInic );
//EED _pts->SetPoint(1, xInic, yFin, zInic );
//EED _pts->SetPoint(0, xInic, yInic, zInic );
//EED _pts->SetPoint(1, xInic, yFin, zInic );
_fillPolyMapper = vtkPolyDataMapper::New( ) ;
_fillObjectActor = vtkActor::New( ) ;
_fillPolyMapper = vtkPolyDataMapper::New( ) ;
_fillObjectActor = vtkActor::New( ) ;
- // RaC In the actual version, zInic=zFin=900
+ // RaC In the actual version, zInic=zFin=GPOSITION_Z
strip->InsertNextCell( 5 ) ;
strip->InsertCellPoint( 0 ) ;
strip->InsertNextCell( 5 ) ;
strip->InsertCellPoint( 0 ) ;
bool vtkGObjectView::isPointInside(int X,int Y) //virtual
{
bool vtkGObjectView::isPointInside(int X,int Y) //virtual
{
- // RaC In the actual version, always z=900
- double xx=X,yy=Y,zz=900;
+ // RaC In the actual version, always z=GPOSITION_Z
+ double xx=X,yy=Y,zz=GPOSITION_Z;
_baseView->TransCoordScreenToWorld(xx,yy,zz);
return _model->isPointInside(xx,yy,zz);
}
_baseView->TransCoordScreenToWorld(xx,yy,zz);
return _model->isPointInside(xx,yy,zz);
}
void vtkGObjectView::moveObject(int X,int Y) //virtual
{
void vtkGObjectView::moveObject(int X,int Y) //virtual
{
- // RaC In the actual version, always z=900
- double xx=X,yy=Y,zz=900;
+ // RaC In the actual version, always z=GPOSITION_Z
+ double xx=X,yy=Y,zz=GPOSITION_Z;
_baseView->TransCoordScreenToWorld(xx,yy,zz);
if(_isStartDragging)
_baseView->TransCoordScreenToWorld(xx,yy,zz);
if(_isStartDragging)
_model->getInicPoint( xInic , yInic , zInic ) ;
_model->getFinalPoint( xFin , yFin , zFin ) ;
_model->getInicPoint( xInic , yInic , zInic ) ;
_model->getFinalPoint( xFin , yFin , zFin ) ;
- // RaC In the actual version, zInic=zFin=900
+ // RaC In the actual version, zInic=zFin=GPOSITION_Z
double mid = ( xInic + xFin ) / 2 ;
double mid = ( xInic + xFin ) / 2 ;
_model->getInicPoint( xInic , yInic , zInic ) ;
_model->getFinalPoint( xFin , yFin , zFin ) ;
_model->getInicPoint( xInic , yInic , zInic ) ;
_model->getFinalPoint( xFin , yFin , zFin ) ;
- // RaC In the actual version, zInic=zFin=900
+ // RaC In the actual version, zInic=zFin=GPOSITION_Z
double mid = ( xInic + xFin ) / 2 ;
double mid = ( xInic + xFin ) / 2 ;
_fillPolyMapper = vtkPolyDataMapper::New( ) ;
_fillObjectActor = vtkActor::New( ) ;
_fillPolyMapper = vtkPolyDataMapper::New( ) ;
_fillObjectActor = vtkActor::New( ) ;
- // RaC In the actual version, zInic=zFin=900
+ // RaC In the actual version, zInic=zFin=GPOSITION_Z
strip->InsertNextCell( 3 ) ;
strip->InsertCellPoint( 0 ) ;
strip->InsertNextCell( 3 ) ;
strip->InsertCellPoint( 0 ) ;
_xGeneral = -100;
_yGeneral = 100;
_xGeneral = -100;
_yGeneral = 100;
- _zGeneral = 900; // ?????
-printf("EED InterpreterBBS::createGBlackBox 900-450\n");
+ _zGeneral = GPOSITION_Z; // ?????
_countBoxes = 0;
_countInputs = 0;
_countBoxes = 0;
_countInputs = 0;
{
double xIn = -100+50+_countInputs*50;
double yIn = 100;
{
double xIn = -100+50+_countInputs*50;
double yIn = 100;
+ double zIn = GPOSITION_Z;
_sceneManager->configGComBoxInputOutputPort(true,name,xIn,yIn,zIn);
_sceneManager->configGConnetion( name,name,box,input);
_countInputs++;
_sceneManager->configGComBoxInputOutputPort(true,name,xIn,yIn,zIn);
_sceneManager->configGConnetion( name,name,box,input);
_countInputs++;
_yGeneral = _yGeneral - 30;
double xIn = -100+_countOutputs*30;
double yIn = _yGeneral;
_yGeneral = _yGeneral - 30;
double xIn = -100+_countOutputs*30;
double yIn = _yGeneral;
+ double zIn = GPOSITION_Z;
_sceneManager->configGComBoxInputOutputPort(false,name,xIn,yIn,zIn);
_sceneManager->configGConnetion( box,output,name,name);
_countOutputs++;
_sceneManager->configGComBoxInputOutputPort(false,name,xIn,yIn,zIn);
_sceneManager->configGConnetion( box,output,name,name);
_countOutputs++;
std::string content = "";
// writing file header
content += "# ----------------------------------\n";
std::string content = "";
// writing file header
content += "# ----------------------------------\n";
- content += "# - BBTKGEditor v 1.2 BBS BlackBox Script\n";
+ content += "# - BBTKGEditor v 1.3 BBS BlackBox Script\n";
content += "# - ";
content += filename;
content += "\n";
content += "# - ";
content += filename;
content += "\n";
// writing file header
content += "# ----------------------------------\n";
// writing file header
content += "# ----------------------------------\n";
- content += "# - BBTKGEditor v 1.2 BBS BlackBox Script (Complex Box)\n";
+ content += "# - BBTKGEditor v 1.3 BBS BlackBox Script (Complex Box)\n";
content += "# - ";
content += filename;
content += "\n";
content += "# - ";
content += filename;
content += "\n";
// writing file header
content += "# ----------------------------------\n";
// writing file header
content += "# ----------------------------------\n";
- content += "# - BBTKGEditor v 1.2 BBG BlackBox Diagram file\n";
+ content += "# - BBTKGEditor v 1.3 BBG BlackBox Diagram file\n";
content += "# - ";
content += filename;
content += "# - ";
content += filename;
std::string content = "";
// writing file header
content += "# ----------------------------------\n";
std::string content = "";
// writing file header
content += "# ----------------------------------\n";
- content += "# - BBTKGEditor v 1.2 BBG BlackBox Diagram file\n";
+ content += "# - BBTKGEditor v 1.3 BBG BlackBox Diagram file\n";
content += "# - ";
content += "temp";
content += "\n";
content += "# - ";
content += "temp";
content += "\n";
interactorstylebaseview->SetwxVtkBaseView(_baseView);
_baseView->GetRenderer()->GetActiveCamera()->ParallelProjectionOn();
interactorstylebaseview->SetwxVtkBaseView(_baseView);
_baseView->GetRenderer()->GetActiveCamera()->ParallelProjectionOn();
- _baseView->GetRenderer()->ResetCamera(-100, 100, -100, 100, 800, 1100);
+ _baseView->GetRenderer()->ResetCamera(-100, 100, -100, 100, -1000, 1000);
+ _baseView->GetRenderer()->GetActiveCamera()->Zoom(10);
+
_baseView->GetRenderer()->SetBackground(0.9, 0.9, 0.9);
_baseView->GetRenderer()->GradientBackgroundOn();
// Actos Port_Text
_textActor = vtkTextActor3D::New();
_baseView->GetRenderer()->SetBackground(0.9, 0.9, 0.9);
_baseView->GetRenderer()->GradientBackgroundOn();
// Actos Port_Text
_textActor = vtkTextActor3D::New();
- _textActor->SetPosition(-9999, -9999, 900);
+ _textActor->SetPosition(-9999, -9999, GPOSITION_Z);
_textActor->SetInput("<void>");
_textActor->GetTextProperty()->SetFontSize(60);
_textActor->GetTextProperty()->BoldOn();
_textActor->SetInput("<void>");
_textActor->GetTextProperty()->SetFontSize(60);
_textActor->GetTextProperty()->BoldOn();
//------------
double xInic = 0;
double yInic = 0;
//------------
double xInic = 0;
double yInic = 0;
+ double zInic = GPOSITION_Z;
vtkPolygon *aPolygon = vtkPolygon::New();
_fillObjectActor = vtkActor::New();
vtkPolygon *aPolygon = vtkPolygon::New();
_fillObjectActor = vtkActor::New();
double yy = windowHeight - y;
//z value is not important yet, because it is only used a parallel projection
double yy = windowHeight - y;
//z value is not important yet, because it is only used a parallel projection
+ double zz = GPOSITION_Z;
_baseView->TransCoordScreenToWorld(xx, yy, zz);
model->setInicPoint(xx, yy, zz);
_baseView->TransCoordScreenToWorld(xx, yy, zz);
model->setInicPoint(xx, yy, zz);
double yy = windowHeight - 5;
//z value is not important yet, because it is only used a parallel projection
double yy = windowHeight - 5;
//z value is not important yet, because it is only used a parallel projection
- double zz = 900;
- printf("EED wxVtkSceneManager::createGComplexBoxInputPort 900-450\n");
+ double zz = GPOSITION_Z;
_baseView->TransCoordScreenToWorld(xx, yy, zz);
model->setInicPoint(xx, yy, zz);
_baseView->TransCoordScreenToWorld(xx, yy, zz);
model->setInicPoint(xx, yy, zz);
double yy = windowHeight - 5;
//z value is not important yet, because it is only used a parallel projection
double yy = windowHeight - 5;
//z value is not important yet, because it is only used a parallel projection
- double zz = 900;
-
- printf("EED wxVtkSceneManager::createGComplexBoxOutputPort 900-450\n");
+ double zz = GPOSITION_Z;
_baseView->TransCoordScreenToWorld(xx, yy, zz);
model->setInicPoint(xx, yy, zz);
_baseView->TransCoordScreenToWorld(xx, yy, zz);
model->setInicPoint(xx, yy, zz);
int wxVtkSceneManager::createGConnector(GPortModel* startPort) {
int type = GCONNECTOR;
int wxVtkSceneManager::createGConnector(GPortModel* startPort) {
int type = GCONNECTOR;
- manualConnectorContourController* manContourControl =
- new manualConnectorContourController();
- manualConnectorContourView* manContourView =
- new manualConnectorContourView();
- manualContourModel* manContourModel = new manualContourModel();
-
- GConnectorController* connectorcontroller = new GConnectorController();
- GConnectorModel* connectorModel = new GConnectorModel();
- vtkGConnectorView* connectorView = new vtkGConnectorView();
+ manualConnectorContourController *manContourControl = new manualConnectorContourController();
+ manualConnectorContourView *manContourView = new manualConnectorContourView();
+ manualContourModel *manContourModel = new manualContourModel();
+ GConnectorController *connectorcontroller = new GConnectorController();
+ GConnectorModel *connectorModel = new GConnectorModel();
+ vtkGConnectorView *connectorView = new vtkGConnectorView();
connectorModel->setGObjectType(type);
manContourModel->SetCloseContour(false);
connectorModel->setGObjectType(type);
manContourModel->SetCloseContour(false);
manContourView->SetModel(manContourModel);
manContourView->SetWxVtkBaseView(_baseView);
manContourView->SetRange(0.5);
manContourView->SetModel(manContourModel);
manContourView->SetWxVtkBaseView(_baseView);
manContourView->SetRange(0.5);
- manContourView->SetZ(900);
+ manContourView->SetZ(GPOSITION_Z);
manContourView->SetColorNormalContour(0, 0, 1);
manContourView->SetColorEditContour(0.5, 0.5, 0.5);
manContourView->SetColorNormalContour(0, 0, 1);
manContourView->SetColorEditContour(0.5, 0.5, 0.5);
- * Width increased from 2 to 5, it simplifies line handling and spline control :P
+ * Width increased from 2 to 3, it simplifies line handling and spline control :P
* @param WidthLine
*/
manContourView->SetWidthLine( 3 ) ;
* @param WidthLine
*/
manContourView->SetWidthLine( 3 ) ;
double x, y, z;
connectorModel->getInicPoint(x, y, z);
double x, y, z;
connectorModel->getInicPoint(x, y, z);
manContourControl->SetState(1);
manContourModel->SetCloseContour(false);
manContourControl->SetState(1);
manContourModel->SetCloseContour(false);
connectorModel->addObserver(connectorView);
connectorModel->addObserver(this);
connectorModel->addObserver(connectorView);
connectorModel->addObserver(this);
- manContourView->Refresh();
+// manContourView->Refresh();
+
if (command != NO_COMMAND) {
if (command == ADD_TO_SELECTED) {
if (command != NO_COMMAND) {
if (command == ADD_TO_SELECTED) {
- //EEDBorrame GObjectController* cont = _controllers[idController];
-
if (GetIndexInSelected(idController) == -1) {
_selectedObjects.push_back(idController);
}
if (GetIndexInSelected(idController) == -1) {
_selectedObjects.push_back(idController);
}
-
- //EEDBorrame
- // bool foundID=false;
- // for (int i=0; i<(int)_selectedObjects.size() && foundID==false; i++)
- // {
- // if(_selectedObjects[i]==idController)
- // {
- // foundID = true;
- // }
- // }
- // if(!foundID)
- // {
- // _selectedObjects.push_back(idController);
- // }
-
} else if (command == REMOVE_FROM_SELECTED) {
int index = GetIndexInSelected(idController);
if (index >= 0) {
} else if (command == REMOVE_FROM_SELECTED) {
int index = GetIndexInSelected(idController);
if (index >= 0) {
- _worldState = INIT_CREATION_CONTOUR;
- GObjectController* cont = _controllers[idController];
+ _worldState = INIT_CREATION_CONTOUR;
+ GObjectController* cont = _controllers[idController];
GPortModel* startOutputPort = (GPortModel*) cont->getModel();
// The last one is the controller of the connector
GPortModel* startOutputPort = (GPortModel*) cont->getModel();
// The last one is the controller of the connector
}
_selectedObjects.clear();
_idConnectionInCreation = createGConnector(startOutputPort);
}
_selectedObjects.clear();
_idConnectionInCreation = createGConnector(startOutputPort);
- } else if (command == FIN_CREATION_CONTOUR && _worldState
- == INIT_CREATION_CONTOUR) {
+ } else if (command == FIN_CREATION_CONTOUR && _worldState == INIT_CREATION_CONTOUR) {
_worldState = NOTHING_HAPPENS;
//int id = _controllers.size()-1;
_worldState = NOTHING_HAPPENS;
//int id = _controllers.size()-1;
- GObjectController *cont = _controllers[_idConnectionInCreation];
- GConnectorModel *modelContour = (GConnectorModel*) cont->getModel();
- GObjectController *finPort = _controllers[idController];
+ GObjectController *cont = _controllers[_idConnectionInCreation];
+ GConnectorModel *modelContour = (GConnectorModel*) cont->getModel();
+ GObjectController *finPort = _controllers[idController];
if (finPort->getGObjectType() == GPORT) {
GPortModel* modelPort = (GPortModel*) finPort->getModel();
if (finPort->getGObjectType() == GPORT) {
GPortModel* modelPort = (GPortModel*) finPort->getModel();
_parent->saveTempandUpdate("create connection");
}
_parent->saveTempandUpdate("create connection");
}
- manualConnectorContourController
- * manCont =
- ((GConnectorController*) cont)->getManualContourController();
- manualConnectorContourView
- * connView =
- (manualConnectorContourView*) manCont->GetManualViewBaseContour();
+ manualConnectorContourController *manCont = ((GConnectorController*) cont)->getManualContourController();
+ manualConnectorContourView *connView = (manualConnectorContourView*) manCont->GetManualViewBaseContour();
std::map<int, GObjectController*>::iterator it2;
std::map<int, GObjectController*>::iterator it2;
}
cont->SetActive(true);
}
}
cont->SetActive(true);
}
bool wxVtkSceneManager::OnMouseMove() {
int X, Y;
bool wxVtkSceneManager::OnMouseMove() {
int X, Y;
- bool okStatusMessage = false;
- bool okPortMessage = false;
+ bool okStatusMessage = false;
+ bool okPortMessage = false;
wxVTKRenderWindowInteractor *wxVTKiren;
wxVTKRenderWindowInteractor *wxVTKiren;
- wxVTKiren
- = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
+ wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
wxVTKiren->GetEventPosition(X, Y);
if (_worldState == DRAG_OBJECTS) {
wxVTKiren->GetEventPosition(X, Y);
if (_worldState == DRAG_OBJECTS) {
- } else if (_worldState == NOTHING_HAPPENS || _worldState
- == INIT_CREATION_CONTOUR) {
+ } else if (_worldState == NOTHING_HAPPENS || _worldState == INIT_CREATION_CONTOUR) {
std::map<int, GObjectController*>::iterator it;
double px, py, pz;
for (it = _controllers.begin(); it != _controllers.end(); ++it) {
GObjectController *desc = it->second;
std::map<int, GObjectController*>::iterator it;
double px, py, pz;
for (it = _controllers.begin(); it != _controllers.end(); ++it) {
GObjectController *desc = it->second;
- int type = desc->getGObjectType();
- int state = desc->getView()->getState();
+ int type = desc->getGObjectType();
+ int state = desc->getView()->getState();
desc->getModel()->getCenter(px, py, pz);
// JGRR & CM
desc->getModel()->getCenter(px, py, pz);
// JGRR & CM
- _worldState = DRAG_OBJECTS;
- _startDragging = true;
+ _worldState = DRAG_OBJECTS;
+ _startDragging = true;
- int shiftkey =
- _vtkInteractorStyleBaseView->GetInteractor()->GetShiftKey();
- int ctrlkey =
- _vtkInteractorStyleBaseView->GetInteractor()->GetControlKey();
- ctrlkey = ctrlkey + shiftkey;
+ int shiftkey = _vtkInteractorStyleBaseView->GetInteractor()->GetShiftKey();
+ int ctrlkey = _vtkInteractorStyleBaseView->GetInteractor()->GetControlKey();
+ ctrlkey = ctrlkey + shiftkey;
GObjectController *cont = GetGBlackBoxControlerPointedByMouse();
GObjectController *cont = GetGBlackBoxControlerPointedByMouse();
int type = cont->getGObjectType();
if (type == GCONNECTOR) {
GConnectorModel *conMod = (GConnectorModel*) cont->getModel();
int type = cont->getGObjectType();
if (type == GCONNECTOR) {
GConnectorModel *conMod = (GConnectorModel*) cont->getModel();
- if (conMod->getStartPort() != NULL
- && conMod->getStartPort()->getParentBox()->getObjectId()
- == bbmod->getObjectId()) {
- AddControlerToBeRemove(&controllersToRemove,
- conMod->getObjectId());
+ if (conMod->getStartPort() != NULL && conMod->getStartPort()->getParentBox()->getObjectId() == bbmod->getObjectId())
+ {
+ AddControlerToBeRemove(&controllersToRemove,conMod->getObjectId());
- if (conMod->getEndPort() != NULL
- && conMod->getEndPort()->getParentBox()->getObjectId()
- == bbmod->getObjectId()) {
- AddControlerToBeRemove(&controllersToRemove,
- conMod->getObjectId());
+ if (conMod->getEndPort() != NULL && conMod->getEndPort()->getParentBox()->getObjectId() == bbmod->getObjectId())
+ {
+ AddControlerToBeRemove(&controllersToRemove,conMod->getObjectId());
if (line == "# - BBTKGEditor v 1.2 BBG BlackBox Diagram file") {
version = line.substr(18, 3);
}
if (line == "# - BBTKGEditor v 1.2 BBG BlackBox Diagram file") {
version = line.substr(18, 3);
}
+ if (line == "# - BBTKGEditor v 1.3 BBG BlackBox Diagram file") {
+ version = line.substr(18, 3);
+ }
} else if (line == "APP_START") {
start = true;
break;
} else if (line == "APP_START") {
start = true;
break;
std::istringstream zSt(zInic);
zSt >> zIn;
std::istringstream zSt(zInic);
zSt >> zIn;
+ if (version<="1.2")
+ {
+ if (zIn==900) zIn=GPOSITION_Z;
+ }
+
getline(inputStream, line);//FIN_COMPLEX_PORT
configGComBoxInputOutputPort(true, inputPortName, xIn, yIn, zIn);
getline(inputStream, line);//FIN_COMPLEX_PORT
configGComBoxInputOutputPort(true, inputPortName, xIn, yIn, zIn);
std::istringstream zSt(zInic);
zSt >> zIn;
std::istringstream zSt(zInic);
zSt >> zIn;
+ if (version<="1.2")
+ {
+ if (zIn==900) zIn=GPOSITION_Z;
+ }
+
getline(inputStream, line);//FIN_COMPLEX_PORT
getline(inputStream, line);//FIN_COMPLEX_PORT
- configGComBoxInputOutputPort(false, outputPortName, xIn, yIn,
- zIn);
+ configGComBoxInputOutputPort(false, outputPortName, xIn, yIn, zIn);
} // for output complex box
} // for output complex box
std::istringstream zSt(zInic);
zSt >> zIn;
std::istringstream zSt(zInic);
zSt >> zIn;
+
+ if (version<="1.2")
+ {
+ if (zIn==900) zIn=GPOSITION_Z;
+ }
+
+
//----------
getline(inputStream, line);//xEnd:yEnd:zEnd
strcpy(coord, line.c_str());
//----------
getline(inputStream, line);//xEnd:yEnd:zEnd
strcpy(coord, line.c_str());
std::istringstream zEt(zEnd);
zEt >> zEn;
std::istringstream zEt(zEnd);
zEt >> zEn;
+ if (version<="1.2")
+ {
+ if (zEn==900) zEn=GPOSITION_Z;
+ }
+
+
bool boxExecutable = false;
if (isExec == "TRUE") {
boxExecutable = true;
}
int idBox = createGBlackBox(xIn, yIn, package, type);
bool boxExecutable = false;
if (isExec == "TRUE") {
boxExecutable = true;
}
int idBox = createGBlackBox(xIn, yIn, package, type);
- configGBlackBox(idBox, xIn, yIn, zIn, name, boxExecutable, xEn,
- yEn, zEn);
+ configGBlackBox(idBox, xIn, yIn, zIn, name, boxExecutable, xEn, yEn, zEn);
GObjectController *cont = _controllers[idBox];
GBlackBoxModel *bbmod = (GBlackBoxModel*) cont->getModel();
GObjectController *cont = _controllers[idBox];
GBlackBoxModel *bbmod = (GBlackBoxModel*) cont->getModel();
result = strtok(NULL, delims);
std::string nameEndPort(result);
result = strtok(NULL, delims);
std::string nameEndPort(result);
- int idCon = configGConnetion(nameStartBox, nameStartPort,
- nameEndBox, nameEndPort);
+ int idCon = configGConnetion(nameStartBox, nameStartPort,nameEndBox, nameEndPort);
if (version != "1.0") {
//Readding control points of the manualContour
if (version != "1.0") {
//Readding control points of the manualContour
- //ups1
- GConnectorController *tempp =
- (GConnectorController*) _controllers[idCon];
- GConnectorModel *conMod = (GConnectorModel*) tempp->getModel();
- vtkGConnectorView *conView =
- (vtkGConnectorView*) tempp->getView();
+ GConnectorController *tempp = (GConnectorController*) _controllers[idCon];
+ GConnectorModel *conMod = (GConnectorModel*) tempp->getModel();
+ vtkGConnectorView *conView = (vtkGConnectorView*) tempp->getView();
getline(inputStream, line); //NumberOfControlPoints:##
strcpy(conns, line.c_str());
result = strtok(conns, delims);
getline(inputStream, line); //NumberOfControlPoints:##
strcpy(conns, line.c_str());
result = strtok(conns, delims);
result = strtok(NULL, delims);
std::istringstream isPointZ(result);
isPointZ >> pz;
result = strtok(NULL, delims);
std::istringstream isPointZ(result);
isPointZ >> pz;
-
- conMod->getManualContourModel()->InsertPoint_id(ii + 1, px,
- py, pz);
+
+ if (version<="1.2")
+ {
+ if (pz==900) pz=GPOSITION_Z;
+ }
+
+ conMod->getManualContourModel()->InsertPoint_id(ii + 1, px, py, pz);
conView->getManualContourView()->AddPoint();
}
}// version !=1.0
conView->getManualContourView()->AddPoint();
}
}// version !=1.0