// Object states
// JGRR
- const int POSSIBLE_CONNECTION = 107;
+ const int POSSIBLE_CONNECTION = 107;
const int SELECTED_POSSIBLE_CONNECTION = 108;
// EO JGRR
//=========================================================================
void vtkGBlackBoxView::update(int idController,int command)
{
- updateColors();
-
+//EED 2017-03)02
+ update_X_Fin();
+ vtkGBoxView::update(idController,command);
double xInic, yInic,zInic,xFin, yFin,zFin;
_model->getInicPoint(xInic,yInic,zInic);
-
updatePositionTextActor(xInic, yInic,zInic);
- update_X_Fin();
- _model->getFinalPoint(xFin, yFin,zFin);
-
- // RaC In the actual version, zInic=zFin=GPOSITION_Z
-
- _pts->SetPoint(0, xInic, yInic, zInic );
- _pts->SetPoint(1, xInic, yFin, zInic );
- _pts->SetPoint(2, xFin, yFin, zFin );
- _pts->SetPoint(3, xFin, yInic, zFin );
-
- updatePorts();
-
-
-// update position for one Actor that represents all OutputPorts
-
-
-// _borderPolyMapper->Modified();
- _fillPolyMapper->Modified();
- //-----------
-
- //-----------
setRefreshWaiting();
}
//EED _pts->SetPoint(1, xInic, yFin, zInic );
//EED _pts->SetPoint(2, xFin, yFin, zFin );
//EED _pts->SetPoint(3, xFin, yInic, zFin );
- _pts->SetPoint(0, -1000, -1000, -1000 );
- _pts->SetPoint(1, xInic, yFin, zInic );
- _pts->SetPoint(2, 1000, 1000, 1000 );
- _pts->SetPoint(3, xFin, yInic, zFin );
+
+//EED 2017-03-02
+// _pts->SetPoint(0, -1000, -1000, -1000 );
+// _pts->SetPoint(1, xInic, yFin, zInic );
+// _pts->SetPoint(2, 1000, 1000, 1000 );
+// _pts->SetPoint(3, xFin, yInic, zFin );
+
// lines->InsertNextCell(5);
// lines->InsertCellPoint(0);
updatePositionTextActor( xInic, yInic, zInic);
}
- //=========================================================================
+ //===============BoundaryEdgesOn==========================================================
void vtkGBlackBoxView::addVtkActors()//virtual
{
//=========================================================================
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);
-
// RaC In the actual version, zInic=zFin=GPOSITION_Z
-
_pts->SetPoint(0, xInic, yInic, zInic );
_pts->SetPoint(1, xInic, yFin, zInic );
_pts->SetPoint(2, xFin, yFin, zFin );
_pts->SetPoint(3, xFin, yInic, zFin );
-
+ _pts->Modified();
updatePorts();
-
// _borderPolyMapper->Modified();
_fillPolyMapper->Modified();
- //-----------
-
- //-----------
setRefreshWaiting();
}
-
//=========================================================================
//EED2017
void vtkGBoxView::createVtkInputOutputPorts()
int numberOfTriangles = boxModel->getNumInputPorts();
_TrianglesInputsPts = vtkPoints::New();
_TrianglesInputsPts->SetNumberOfPoints( 3*numberOfTriangles );
+
+//EED 2017-03-02
+// if (numberOfTriangles>0)
+// {
+// _TrianglesInputsPts->SetPoint(0, -1000, -1000, -1000 );
+// _TrianglesInputsPts->SetPoint(1, 1000, 1000, 1000 );
+// }
+
vtkCellArray *stripTrianglesInputs = vtkCellArray::New();
vtkPolyData *pdTrianglesInputs = vtkPolyData::New();
_TrianglesInputsPolyMapper = vtkPolyDataMapper::New();
numberOfTriangles = boxModel->getNumOutputPorts();
_TrianglesOutputsPts = vtkPoints::New();
_TrianglesOutputsPts->SetNumberOfPoints( 3*numberOfTriangles );
+
+//EED 2017-03-02
+// if (numberOfTriangles>0)
+// {
+// _TrianglesOutputsPts->SetPoint(0, -1000, -1000, -1000 );
+// _TrianglesOutputsPts->SetPoint(1, 1000, 1000, 1000 );
+// }
+
vtkCellArray *stripTrianglesOutputs = vtkCellArray::New();
vtkPolyData *pdTrianglesOutputs = vtkPolyData::New();
_TrianglesOutputsPolyMapper = vtkPolyDataMapper::New();
//EED _pts->SetPoint(1, xInic, yFin, zInic );
//EED _pts->SetPoint(2, xFin, yFin, zFin );
//EED _pts->SetPoint(3, xFin, yInic, zFin );
- _pts->SetPoint(0, -1000, -1000, -1000 );
- _pts->SetPoint(1, xInic, yFin, zInic );
- _pts->SetPoint(2, 1000, 1000, 1000 );
- _pts->SetPoint(3, xFin, yInic, zFin );
+
+//EED 2017-03-02
+// _pts->SetPoint(0, -1000, -1000, -1000 );
+// _pts->SetPoint(1, xInic, yFin, zInic );
+// _pts->SetPoint(2, 1000, 1000, 1000 );
+// _pts->SetPoint(3, xFin, yInic, zFin );
// lines->InsertNextCell(5);
// lines->InsertCellPoint(0);
_TrianglesInputsPts->SetPoint(i*3+1, ( xInic + xFin ) / 2 , yFin , zInic );
_TrianglesInputsPts->SetPoint(i*3+2, xFin , yInic , zFin );
}
+ _TrianglesInputsPts->Modified();
_TrianglesInputsPolyMapper->Modified( ) ;
// update position for one Actor that represents all OutputPorts
_TrianglesOutputsPts->SetPoint(i*3+1, ( xInic + xFin ) / 2 , yFin , zInic );
_TrianglesOutputsPts->SetPoint(i*3+2, xFin , yInic , zFin );
}
+ _TrianglesOutputsPts->Modified();
_TrianglesOutputsPolyMapper->Modified( ) ;
//Private Attributes
// Input Triangles
- vtkPoints *_TrianglesInputsPts;
+ vtkPoints *_TrianglesInputsPts;
vtkPolyDataMapper *_TrianglesInputsPolyMapper;
- vtkActor *_TrianglesInputsActor;
+ vtkActor *_TrianglesInputsActor;
// Output Triangles
- vtkPoints *_TrianglesOutputsPts;
+ vtkPoints *_TrianglesOutputsPts;
vtkPolyDataMapper *_TrianglesOutputsPolyMapper;
- vtkActor *_TrianglesOutputsActor;
+ vtkActor *_TrianglesOutputsActor;
//Private Methods
{
}
- //=========================================================================
+/*EED Borrame
+ //=========================================================================
void vtkGComplexBoxPortView::update( int idController , int command )
{
updateColors( ) ;
setRefreshWaiting( ) ;
}
+*/
//=========================================================================
//EED _pts->SetPoint(1, xInic, yFin, zInic );
//EED _pts->SetPoint(2, xFin, yFin, zFin );
//EED _pts->SetPoint(3, xFin, yInic, zFin );
- _pts->SetPoint( 0 , -1000 , -1000 , -1000 ) ;
- _pts->SetPoint( 1 , xInic , yFin , zInic ) ;
- _pts->SetPoint( 2 , 1000 , 1000 , 1000 ) ;
- _pts->SetPoint( 3 , xFin , yInic , zFin ) ;
+
+//EED 2017-03-02
+// _pts->SetPoint( 0 , -1000 , -1000 , -1000 ) ;
+// _pts->SetPoint( 1 , xInic , yFin , zInic ) ;
+// _pts->SetPoint( 2 , 1000 , 1000 , 1000 ) ;
+// _pts->SetPoint( 3 , xFin , yInic , zFin ) ;
// lines->InsertNextCell( 5 ) ;
virtual void removeVtkActors();
virtual void createVtkObjects();
- virtual void update(int idController,int command);
+//EED Borrame virtual void update(int idController,int command);
virtual void updateColors();
};
void vtkGObjectView::moveObject(int X,int Y) //virtual
{
+
// RaC In the actual version, always z=GPOSITION_Z
double xx=X,yy=Y,zz=GPOSITION_Z;
_baseView->TransCoordScreenToWorld(xx,yy,zz);
-
if(_isStartDragging)
{
_isStartDragging=false;
_pts = vtkPoints::New( ) ;
_pts->SetNumberOfPoints( 3 ) ;
- _pts->SetPoint( 0 , -1000 , -1000 , -1000 ) ;
- _pts->SetPoint( 1 , mid , yFin , zInic ) ;
- _pts->SetPoint( 2 , 1000 , 1000 , 1000 ) ;
+//EED 2017-03-02
+// _pts->SetPoint( 0 , -1000 , -1000 , -1000 ) ;
+// _pts->SetPoint( 1 , mid , yFin , zInic ) ;
+// _pts->SetPoint( 2 , 1000 , 1000 , 1000 ) ;
///************************* FILL *************************
}
//=========================================================================
-void wxVtkSceneManager::refreshScene() {
+void wxVtkSceneManager::refreshScene()
+{
_baseView->RefreshView();
}
//=========================================================================
-void wxVtkSceneManager::centerView() {
+void wxVtkSceneManager::centerView()
+{
+ double bb[6];
+ _baseView->GetRenderer()->ComputeVisiblePropBounds(bb);
+
double temp[3];
_baseView->GetRenderer()->GetActiveCamera()->GetFocalPoint(temp);
_baseView->GetRenderer()->GetActiveCamera()->SetFocalPoint(0, 0, temp[2]);
_baseView->GetRenderer()->GetActiveCamera()->GetPosition(temp);
_baseView->GetRenderer()->GetActiveCamera()->SetPosition(0, 0, temp[2]);
+
+ _baseView->GetRenderer()->ResetCamera();
+ _baseView->GetRenderer()->ResetCameraClippingRange();
+
+/*
+ double tt=_baseView->GetRenderer()->GetNearClippingPlaneTolerance();
+ printf("EED wxVtkSceneManager::centerView() tolerance=%f\n",tt);
+ double cr1,cr2;
+ _baseView->GetRenderer()->GetActiveCamera()->GetClippingRange(cr1,cr2);
+ printf("EED wxVtkSceneManager::centerView() cr1=%f cr2=%f\n",cr1,cr2);
+ _baseView->GetRenderer()->GetActiveCamera()->SetClippingRange(0.01,100000);
+ _baseView->GetRenderer()->GetActiveCamera()->GetClippingRange(cr1,cr2);
+ printf("EED wxVtkSceneManager::centerView() cr1=%f cr2=%f\n",cr1,cr2);
+*/
+
+ _baseView->GetRenderer()->Render();
}
//=========================================================================
-void wxVtkSceneManager::saveDiagram(std::string &content) {
+void wxVtkSceneManager::saveDiagram(std::string &content)
+{
char buffer[50];
content += "CATEGORY:";
//=========================================================================
void wxVtkSceneManager::loadDiagram(stringstream &inputStream)
{
-
int size;
std::string version = "<void>";
std::string line = "";