bbtk::vtkGBoxView Class Reference

#include <vtkGBoxView.h>

Inheritance diagram for bbtk::vtkGBoxView:

Inheritance graph
[legend]
Collaboration diagram for bbtk::vtkGBoxView:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 vtkGBoxView ()
 ~vtkGBoxView ()
void setModel (GObjectModel *model)
void setBaseView (wxVtkBaseView *baseView)
void initVtkObjects ()
void setStartDragging (bool param)
void setState (int state)
int getState ()
void setRefreshWaiting ()
virtual bool isPointInside (int X, int Y)
virtual void moveObject (int X, int Y)
virtual void removeFromScene ()

Protected Member Functions

virtual void addVtkActors ()
virtual void removeVtkActors ()
virtual void createVtkObjects ()
virtual void update (int idController, int command)
virtual void updateColors ()
void updatePorts ()

Protected Attributes

wxVtkBaseView * _baseView
GObjectModel_model
vtkActor * _borderObjectActor
vtkActor * _fillObjectActor
vtkPolyDataMapper * _fillPolyMapper
vtkPolyDataMapper * _borderPolyMapper
vtkPoints * _pts
int _state


Detailed Description

Definition at line 75 of file vtkGBoxView.h.


Constructor & Destructor Documentation

bbtk::vtkGBoxView::vtkGBoxView (  ) 

Definition at line 44 of file vtkGBoxView.cxx.

00045         {                       
00046         }

bbtk::vtkGBoxView::~vtkGBoxView (  ) 

Definition at line 49 of file vtkGBoxView.cxx.

00050         {
00051         }


Member Function Documentation

void bbtk::vtkGBoxView::addVtkActors (  )  [protected, virtual]

Reimplemented from bbtk::vtkGObjectView.

Reimplemented in bbtk::vtkGBlackBoxView, and bbtk::vtkGComplexBoxPortView.

Definition at line 155 of file vtkGBoxView.cxx.

References bbtk::vtkGObjectView::_baseView, and bbtk::vtkGObjectView::_borderObjectActor.

00156         {
00157                 _baseView->GetRenderer()->AddActor(_borderObjectActor);
00158                 vtkGObjectView::addVtkActors();
00159         }

void bbtk::vtkGBoxView::createVtkObjects (  )  [protected, virtual]

************************* FILL *************************

************************* FILL *************************

Reimplemented from bbtk::vtkGObjectView.

Reimplemented in bbtk::vtkGBlackBoxView, and bbtk::vtkGComplexBoxPortView.

Definition at line 81 of file vtkGBoxView.cxx.

References bbtk::vtkGObjectView::_borderObjectActor, bbtk::vtkGObjectView::_borderPolyMapper, bbtk::vtkGObjectView::_fillObjectActor, bbtk::vtkGObjectView::_fillPolyMapper, bbtk::vtkGObjectView::_model, bbtk::vtkGObjectView::_pts, bbtk::GObjectModel::getFinalPoint(), and bbtk::GObjectModel::getInicPoint().

00082         {
00083 
00084                 //------------
00085                 _pts                            = vtkPoints::New();     
00086                 vtkCellArray *lines = vtkCellArray::New();
00087                 vtkPolyData *_pd        = vtkPolyData::New();
00088                 _borderPolyMapper       = vtkPolyDataMapper::New();
00089                 _borderObjectActor      = vtkActor::New();
00090                                 
00091                 _pts->SetNumberOfPoints(4);
00092 
00093                 double xInic, yInic,zInic,xFin, yFin,zFin;
00094                 _model->getInicPoint(xInic,yInic,zInic);
00095                 _model->getFinalPoint(xFin, yFin,zFin);
00096 
00097                 // RaC In the actual version, zInic=zFin=900
00098 
00099 //EED           _pts->SetPoint(0, xInic, yInic, zInic );
00100 //EED           _pts->SetPoint(1, xInic, yFin, zInic );
00101 //EED           _pts->SetPoint(2, xFin, yFin, zFin );
00102 //EED           _pts->SetPoint(3, xFin, yInic, zFin );
00103 
00104                 _pts->SetPoint(0, -1000, -1000, -1000 );
00105                 _pts->SetPoint(1, xInic, yFin, zInic );
00106                 _pts->SetPoint(2, 1000, 1000, 1000 );
00107                 _pts->SetPoint(3, xFin, yInic, zFin );
00108                 
00109                 
00110                 
00111                 lines->InsertNextCell(5);
00112                 lines->InsertCellPoint(0);
00113                 lines->InsertCellPoint(1);
00114                 lines->InsertCellPoint(2);
00115                 lines->InsertCellPoint(3);
00116                 lines->InsertCellPoint(0);
00117                         
00118                 _pd->SetPoints( _pts );
00119                 _pd->SetLines( lines );
00120 
00121                 _borderPolyMapper->SetInput(_pd);
00122                 _borderObjectActor->SetMapper(_borderPolyMapper);
00123                 _borderPolyMapper->Modified();
00124 
00125                 
00127 
00128                 vtkCellArray *strip             = vtkCellArray::New();
00129                 vtkPolyData *pdFill             = vtkPolyData::New();
00130                 _fillPolyMapper                 = vtkPolyDataMapper::New();
00131                 _fillObjectActor                = vtkActor::New();
00132 
00133                 // RaC In the actual version, zInic=zFin=900
00134 
00135                 strip->InsertNextCell(5);
00136                 strip->InsertCellPoint(0);
00137                 strip->InsertCellPoint(1);
00138                 strip->InsertCellPoint(2);
00139                 strip->InsertCellPoint(0);
00140                 strip->InsertCellPoint(3);
00141                         
00142                 pdFill->SetPoints( _pts );
00143                 pdFill->SetStrips( strip );
00144 
00145                 _fillPolyMapper->SetInput(pdFill);
00146                 _fillObjectActor->SetMapper(_fillPolyMapper);
00147                 _fillPolyMapper->Modified();
00148 
00150 
00151         }

Here is the call graph for this function:

int bbtk::vtkGObjectView::getState (  )  [inherited]

void bbtk::vtkGObjectView::initVtkObjects (  )  [inherited]

bool bbtk::vtkGObjectView::isPointInside ( int  X,
int  Y 
) [virtual, inherited]

Definition at line 119 of file vtkGObjectView.cxx.

References bbtk::vtkGObjectView::_baseView, bbtk::vtkGObjectView::_model, and bbtk::GObjectModel::isPointInside().

Referenced by bbtk::wxVtkSceneManager::GetGBlackBoxControlerPointedByMouse(), bbtk::GBlackBoxController::OnLeftButtonDown(), bbtk::GBoxController::OnLeftButtonUp(), bbtk::GBlackBoxController::OnMiddleButtonDown(), bbtk::GObjectController::OnMouseMove(), bbtk::GBoxController::OnMouseMove(), and bbtk::GBlackBoxController::OnMouseMove().

00120         {
00121                 // RaC In the actual version, always z=900
00122                 double xx=X,yy=Y,zz=900;
00123                 _baseView->TransCoordScreenToWorld(xx,yy,zz);
00124                 return _model->isPointInside(xx,yy,zz);
00125         }

Here is the call graph for this function:

Here is the caller graph for this function:

void bbtk::vtkGObjectView::moveObject ( int  X,
int  Y 
) [virtual, inherited]

Definition at line 129 of file vtkGObjectView.cxx.

References bbtk::vtkGObjectView::_baseView, bbtk::vtkGObjectView::_isStartDragging, bbtk::vtkGObjectView::_model, bbtk::vtkGObjectView::dragDifX, bbtk::vtkGObjectView::dragDifY, bbtk::GObjectModel::getInicPoint(), and bbtk::GObjectModel::move().

Referenced by bbtk::GObjectController::moveObject(), and bbtk::wxVtkSceneManager::OnMouseMove().

00130         {               
00131                 // RaC In the actual version, always z=900
00132                 double xx=X,yy=Y,zz=900;
00133                 _baseView->TransCoordScreenToWorld(xx,yy,zz);
00134 
00135                 if(_isStartDragging)
00136                 {
00137                         _isStartDragging=false;
00138                         
00139                         double xInic,yInic,zInic;
00140                         _model->getInicPoint(xInic,yInic,zInic);                        
00141                         dragDifX=xx-xInic;
00142                         dragDifY=yy-yInic;      
00143                 }
00144                 _model->move(xx-dragDifX,yy-dragDifY,zz);
00145 
00146         }

Here is the call graph for this function:

Here is the caller graph for this function:

void bbtk::vtkGObjectView::removeFromScene (  )  [virtual, inherited]

Definition at line 180 of file vtkGObjectView.cxx.

References bbtk::vtkGObjectView::removeVtkActors(), and bbtk::vtkGObjectView::setRefreshWaiting().

Referenced by bbtk::GObjectController::removeFromScene().

00181         {
00182                 removeVtkActors();
00183                 setRefreshWaiting();
00184         }

Here is the call graph for this function:

Here is the caller graph for this function:

void bbtk::vtkGBoxView::removeVtkActors (  )  [protected, virtual]

Reimplemented from bbtk::vtkGObjectView.

Reimplemented in bbtk::vtkGBlackBoxView, and bbtk::vtkGComplexBoxPortView.

Definition at line 163 of file vtkGBoxView.cxx.

References bbtk::vtkGObjectView::_baseView, and bbtk::vtkGObjectView::_borderObjectActor.

00164         {
00165                 _baseView->GetRenderer()->RemoveActor(_borderObjectActor);
00166                 vtkGObjectView::removeVtkActors();
00167         }

void bbtk::vtkGObjectView::setBaseView ( wxVtkBaseView *  baseView  )  [inherited]

void bbtk::vtkGObjectView::setModel ( GObjectModel model  )  [inherited]

void bbtk::vtkGObjectView::setRefreshWaiting (  )  [inherited]

Definition at line 173 of file vtkGObjectView.cxx.

References bbtk::vtkGObjectView::_baseView.

Referenced by bbtk::vtkGObjectView::removeFromScene(), bbtk::vtkGPortView::update(), bbtk::vtkGComplexBoxPortView::update(), update(), and bbtk::vtkGBlackBoxView::update().

00174         {
00175                 ((vtkInteractorStyleBaseView*)_baseView->GetInteractorStyleBaseView())->SetRefresh_waiting();
00176         }

Here is the caller graph for this function:

void bbtk::vtkGObjectView::setStartDragging ( bool  param  )  [inherited]

Definition at line 150 of file vtkGObjectView.cxx.

References bbtk::vtkGObjectView::_isStartDragging, and bbtk::vtkGObjectView::dragDifX.

Referenced by bbtk::wxVtkSceneManager::OnMouseMove().

00151         {
00152                 _isStartDragging=param;
00153                 dragDifX=0;
00154                 dragDifX=0;
00155         }

Here is the caller graph for this function:

void bbtk::vtkGObjectView::setState ( int  state  )  [inherited]

void bbtk::vtkGBoxView::update ( int  idController,
int  command 
) [protected, virtual]

Reimplemented from bbtk::vtkGObjectView.

Reimplemented in bbtk::vtkGBlackBoxView, and bbtk::vtkGComplexBoxPortView.

Definition at line 54 of file vtkGBoxView.cxx.

References bbtk::vtkGObjectView::_borderPolyMapper, bbtk::vtkGObjectView::_fillPolyMapper, bbtk::vtkGObjectView::_model, bbtk::vtkGObjectView::_pts, bbtk::GObjectModel::getFinalPoint(), bbtk::GObjectModel::getInicPoint(), bbtk::vtkGObjectView::setRefreshWaiting(), updateColors(), and updatePorts().

00055         {
00056                 updateColors();
00057                 
00058                 double xInic, yInic,zInic,xFin, yFin,zFin;
00059                 _model->getInicPoint(xInic,yInic,zInic);
00060                 _model->getFinalPoint(xFin, yFin,zFin);
00061 
00062                 // RaC In the actual version, zInic=zFin=900
00063 
00064                 _pts->SetPoint(0, xInic, yInic, zInic );
00065                 _pts->SetPoint(1, xInic, yFin, zInic );
00066                 _pts->SetPoint(2, xFin, yFin, zFin );
00067                 _pts->SetPoint(3, xFin, yInic, zFin );
00068 
00069                 updatePorts();
00070 
00071                 _borderPolyMapper->Modified();
00072                 _fillPolyMapper->Modified();
00073                 //-----------
00074 
00075                 //-----------
00076                 setRefreshWaiting();
00077         }

Here is the call graph for this function:

void bbtk::vtkGBoxView::updateColors (  )  [protected, virtual]

Reimplemented from bbtk::vtkGObjectView.

Reimplemented in bbtk::vtkGBlackBoxView, and bbtk::vtkGComplexBoxPortView.

Definition at line 171 of file vtkGBoxView.cxx.

References bbtk::vtkGObjectView::_borderObjectActor, bbtk::vtkGObjectView::_fillObjectActor, bbtk::vtkGObjectView::_state, bbtk::BOXBORDER_DRAG_B, bbtk::BOXBORDER_DRAG_G, bbtk::BOXBORDER_DRAG_R, bbtk::BOXBORDER_HIGHLIGHTED_B, bbtk::BOXBORDER_HIGHLIGHTED_G, bbtk::BOXBORDER_HIGHLIGHTED_R, bbtk::BOXBORDER_NH_B, bbtk::BOXBORDER_NH_G, bbtk::BOXBORDER_NH_R, bbtk::BOXBORDER_SELECTED_B, bbtk::BOXBORDER_SELECTED_G, bbtk::BOXBORDER_SELECTED_R, bbtk::BOXFILL_DRAG_B, bbtk::BOXFILL_DRAG_G, bbtk::BOXFILL_DRAG_R, bbtk::BOXFILL_HIGHLIGHTED_B, bbtk::BOXFILL_HIGHLIGHTED_G, bbtk::BOXFILL_HIGHLIGHTED_R, bbtk::BOXFILL_NH_B, bbtk::BOXFILL_NH_G, bbtk::BOXFILL_NH_R, bbtk::BOXFILL_SELECTED_B, bbtk::BOXFILL_SELECTED_G, bbtk::BOXFILL_SELECTED_R, bbtk::DRAG, bbtk::HIGHLIGHTED, bbtk::NOTHING_HAPPENS, and bbtk::SELECTED.

Referenced by update().

00172         {
00173                 _fillObjectActor->GetProperty()->SetAmbient(0.6);
00174 
00175                 if(_state==NOTHING_HAPPENS)
00176                 {
00177                         _borderObjectActor->GetProperty()->SetLineWidth(1);
00178                         _borderObjectActor->GetProperty()->SetColor(BOXBORDER_NH_R,BOXBORDER_NH_G,BOXBORDER_NH_B);
00179                         _fillObjectActor->GetProperty()->SetColor(BOXFILL_NH_R,BOXFILL_NH_G,BOXFILL_NH_B);
00180                         
00181                 }
00182                 else if(_state==HIGHLIGHTED)
00183                 {
00184                         _borderObjectActor->GetProperty()->SetLineWidth(2);
00185                         
00186                         _borderObjectActor->GetProperty()->SetColor(BOXBORDER_HIGHLIGHTED_R,BOXBORDER_HIGHLIGHTED_G,BOXBORDER_HIGHLIGHTED_B);
00187                         _fillObjectActor->GetProperty()->SetColor(BOXFILL_HIGHLIGHTED_R,BOXFILL_HIGHLIGHTED_G,BOXFILL_HIGHLIGHTED_B);
00188                 }
00189                 else if(_state==DRAG)
00190                 {
00191                         _borderObjectActor->GetProperty()->SetLineWidth(1.2);
00192                         _borderObjectActor->GetProperty()->SetColor(BOXBORDER_DRAG_R,BOXBORDER_DRAG_G,BOXBORDER_DRAG_B);
00193                         _fillObjectActor->GetProperty()->SetColor(BOXFILL_DRAG_R,BOXFILL_DRAG_G,BOXFILL_DRAG_B);
00194                 }
00195                 else if(_state==SELECTED)
00196                 {
00197                         _borderObjectActor->GetProperty()->SetLineWidth(2);
00198                         _borderObjectActor->GetProperty()->SetColor(BOXBORDER_SELECTED_R,BOXBORDER_SELECTED_G,BOXBORDER_SELECTED_B);
00199                         _fillObjectActor->GetProperty()->SetColor(BOXFILL_SELECTED_R,BOXFILL_SELECTED_G,BOXFILL_SELECTED_B);
00200                 }
00201         }

Here is the caller graph for this function:

void bbtk::vtkGBoxView::updatePorts (  )  [protected]

Definition at line 205 of file vtkGBoxView.cxx.

References bbtk::vtkGObjectView::_model, and bbtk::GBoxModel::updatePorts().

Referenced by bbtk::vtkGComplexBoxPortView::update(), update(), and bbtk::vtkGBlackBoxView::update().

00206         {
00207                 GBoxModel* bmod =(GBoxModel*)_model;
00208                 bmod->updatePorts();
00209         }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

wxVtkBaseView* bbtk::vtkGObjectView::_baseView [protected, inherited]

vtkActor* bbtk::vtkGObjectView::_borderObjectActor [protected, inherited]

vtkPolyDataMapper* bbtk::vtkGObjectView::_borderPolyMapper [protected, inherited]

vtkActor* bbtk::vtkGObjectView::_fillObjectActor [protected, inherited]

vtkPolyDataMapper* bbtk::vtkGObjectView::_fillPolyMapper [protected, inherited]

GObjectModel* bbtk::vtkGObjectView::_model [protected, inherited]

vtkPoints* bbtk::vtkGObjectView::_pts [protected, inherited]

int bbtk::vtkGObjectView::_state [protected, inherited]


The documentation for this class was generated from the following files:

Generated on Thu May 31 15:13:46 2012 for bbtkGEditor by  doxygen 1.5.7.1