manContourView->SetColorEditContour(0.5, 0.5, 0.5);
manContourView->SetColorSelectContour(1, 0.8, 0);
manContourView->SetWidthLine(1);
+ manContourView->SetShowText(false);
manContourControl->SetModelView( manContourModel , manContourView );
connectorView->setBaseView(_baseView);
connectorcontroller->setModelAndView(connectorModel,connectorView);
+ connectorModel->addObserver(connectorView);
+ connectorModel->addObserver(this);
+
int newId = _controllers.size();
connectorcontroller->setId(newId);
_controllers[newId] = connectorcontroller;
{
int id = idController;
_selectedObjects.push_back(id);
+ cout<<"RaC wxVtkSceneManager::update _selectedObjects.push_back id:"<<id<<endl;
}
}
// Add box controller to be removed
controllersToRemove.push_back(bbmod->getObjectId());
}
+ else if(control->getGObjectType()==GCONNECTOR)
+ {
+ GConnectorModel *conMod = (GConnectorModel*)control->getModel();
+ cout<<"RaC wxVtkSceneManager::deleteObject id:"<<id<<" modelId:" <<conMod->getObjectId()<<endl;
+ controllersToRemove.push_back(conMod->getObjectId());
+ }
for(int i = 0;i<controllersToRemove.size();i++)
{
wxVTKiren->GetEventPosition(X, Y);
_controller->MouseReleaseLeft(X,Y);
+ if(_controller->GetManualViewBaseContour()->GetSelected()==true)
+ {
+ cout<<"RaC GConnectorController::OnLeftButtonUp GetSelected():"<<_controller->GetManualViewBaseContour()->GetSelected() <<endl;
+ _view->setState(SELECTED);
+ _model->notifyObservers(getId(),ADD_TO_SELECTED);
+ }
}
return true;
GConnectorModel *conMod = (GConnectorModel*)_model;
conMod->disconnectConnection();
- _controller->SetEditable(true);
+ _controller->SetEditable(false);
_controller->DeleteContour();
}
}
//=========================================================================
+
manualConnectorContourController::~manualConnectorContourController()
{
}
+
+ //=========================================================================
+
+ void manualConnectorContourController::MouseMove(int x, int y) // virtual
+ {
+ int z=GetZ();
+ GetManualViewBaseContour()->SelectPosiblePoint(x,y,z);
+ GetManualViewBaseContour()->SelectPosibleContour(x,y,z);
+ if (GetState()==1){ SetPoint( _bakIdPoint , x , y ,z); }
+ if (GetState()==5){ SetPoint( _bakIdPoint , x , y ,z); }
+ if ( GetState()==6 && !IsEditable() && GetPosibleToMove() &&IsMoving() )
+ {
+ //GetManualViewBaseContour()->MoveContour(x,y,z);
+ }
+ if (GetState()!=7 || GetManualViewBaseContour()->GetPosibleSelected() ){
+ GetManualViewBaseContour()->Refresh();
+ this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
+ }
+ if (!IsEditable())
+ {
+ GetManualViewBaseContour()->RemoveControlPoints();
+ GetManualViewBaseContour()->Refresh();
+ this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
+ }
+
+ }
+
//=========================================================================
void manualConnectorContourController::MouseClickRight(int x, int y)
SetEditable( false );
SetPosibleToMove( false );
SetState(0);
-
- if(!_created)
- {
- //DeleteContour();
- }
+
}
//=========================================================================
//Public methods
virtual void MouseClickRight(int x, int y);
virtual void MouseClickLeft(int x, int y);
+ virtual void MouseMove(int x, int y);
private:
}
}
}
+
//=========================================================================
+ void manualConnectorContourView::RefreshText() // virtual
+ {
+
+ }
+
} // EO namespace bbtk
//Public methods
virtual void TransfromCoordViewWorld(double &X, double &Y, double &Z, int type=2);
void updateStartAndEnd(double* start , double* end);
- virtual void AddControlPoints();
+ virtual void AddControlPoints();
+ virtual void RefreshText();
private: