BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,InteractorStyleMaracas_Model)
BBTK_BLACK_BOX_IMPLEMENTATION(InteractorStyleMaracas_Model,bbtk::AtomicBlackBox);
-//=====
+
+//=====
// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
//=====
void InteractorStyleMaracas_Model::Process()
{
-// THE MAIN PROCESSING METHOD BODY
-// Here we simply set the input 'In' value to the output 'Out'
-// And print out the output value
-// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
-// void bbSet{Input|Output}NAME(const TYPE&)
-// const TYPE& bbGet{Input|Output}NAME() const
-// Where :
-// * NAME is the name of the input/output
-// (the one provided in the attribute 'name' of the tag 'input')
-// * TYPE is the C++ type of the input/output
-// (the one provided in the attribute 'type' of the tag 'input')
-// bbSetOutputOut( bbGetInputIn() );
-// std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
-
- if (bbGetInputInteractorStyleMaracas()!=NULL) { bbGetInputInteractorStyleMaracas() ->SetActive( bbGetInputActive() ); }
+ if (bbGetInputInteractorStyleMaracas() !=NULL) { bbGetInputInteractorStyleMaracas() ->SetActive( bbGetInputActive() ); }
if (bbGetInputInteractorStyleMaracas2()!=NULL) { bbGetInputInteractorStyleMaracas2()->SetActive( bbGetInputActive() ); }
if (bbGetInputInteractorStyleMaracas3()!=NULL) { bbGetInputInteractorStyleMaracas3()->SetActive( bbGetInputActive() ); }
if (bbGetInputInteractorStyleMaracas4()!=NULL) { bbGetInputInteractorStyleMaracas4()->SetActive( bbGetInputActive() ); }
}
-//=====
+
+//=====
// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
//=====
void InteractorStyleMaracas_Model::bbUserSetDefaultValues()
{
-
// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
// Here we initialize the input 'In' to 0
bbSetInputActive(true);
bbSetInputInteractorStyleMaracas3(NULL);
bbSetInputInteractorStyleMaracas4(NULL);
}
-//=====
+
+//=====
// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
//=====
void InteractorStyleMaracas_Model::bbUserInitializeProcessing()
{
-
// THE INITIALIZATION METHOD BODY :
// Here does nothing
// but this is where you should allocate the internal/output pointers
-// if any
-
-
+// if any
}
-//=====
+
+//=====
// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
//=====
void InteractorStyleMaracas_Model::bbUserFinalizeProcessing()
{
-
// THE FINALIZATION METHOD BODY :
// Here does nothing
// but this is where you should desallocate the internal/output pointers
// if any
-
-}
}
-// EO namespace bbcreaMaracasVisu
+
+}// EO namespace bbcreaMaracasVisu
#include "InteractorStyleMaracas.h"
-
namespace bbcreaMaracasVisu
{
class bbcreaMaracasVisu_EXPORT InteractorStyleMaracas_Model
- :
- public bbtk::AtomicBlackBox
+:
+public bbtk::AtomicBlackBox
{
- BBTK_BLACK_BOX_INTERFACE(InteractorStyleMaracas_Model,bbtk::AtomicBlackBox);
-//=====
-// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
-//=====
- BBTK_DECLARE_INPUT(Active,bool);
- BBTK_DECLARE_INPUT(InteractorStyleMaracas,InteractorStyleMaracas*);
- BBTK_DECLARE_INPUT(InteractorStyleMaracas2,InteractorStyleMaracas*);
- BBTK_DECLARE_INPUT(InteractorStyleMaracas3,InteractorStyleMaracas*);
- BBTK_DECLARE_INPUT(InteractorStyleMaracas4,InteractorStyleMaracas*);
-// BBTK_DECLARE_OUTPUT(Out,double);
- BBTK_PROCESS(Process);
- void Process();
-//=====
-// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
-//=====
+ BBTK_BLACK_BOX_INTERFACE(InteractorStyleMaracas_Model,bbtk::AtomicBlackBox);
+ //=====
+ // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+ //=====
+ BBTK_DECLARE_INPUT(Active,bool);
+ BBTK_DECLARE_INPUT(InteractorStyleMaracas,InteractorStyleMaracas*);
+ BBTK_DECLARE_INPUT(InteractorStyleMaracas2,InteractorStyleMaracas*);
+ BBTK_DECLARE_INPUT(InteractorStyleMaracas3,InteractorStyleMaracas*);
+ BBTK_DECLARE_INPUT(InteractorStyleMaracas4,InteractorStyleMaracas*);
+ // BBTK_DECLARE_OUTPUT(Out,double);
+ BBTK_PROCESS(Process);
+ void Process();
+ //=====
+ // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+ //=====
};
BBTK_BEGIN_DESCRIBE_BLACK_BOX(InteractorStyleMaracas_Model,bbtk::AtomicBlackBox);
BBTK_AUTHOR("InfoDev");
BBTK_DESCRIPTION("No Description.");
BBTK_CATEGORY("empty");
-
BBTK_INPUT(InteractorStyleMaracas_Model,Active,"(default true)",bool,"");
BBTK_INPUT(InteractorStyleMaracas_Model,InteractorStyleMaracas,"InteractorStyleMaracas",InteractorStyleMaracas*,"");
BBTK_INPUT(InteractorStyleMaracas_Model,InteractorStyleMaracas2,"InteractorStyleMaracas2",InteractorStyleMaracas*,"");
BBTK_INPUT(InteractorStyleMaracas_Model,InteractorStyleMaracas3,"InteractorStyleMaracas3",InteractorStyleMaracas*,"");
- BBTK_INPUT(InteractorStyleMaracas_Model,InteractorStyleMaracas4,"InteractorStyleMaracas4",InteractorStyleMaracas*,"");
+BBTK_INPUT(InteractorStyleMaracas_Model,InteractorStyleMaracas4,"InteractorStyleMaracas4",InteractorStyleMaracas*,"");
// BBTK_OUTPUT(InteractorStyleMaracas_Model,Out,"First output",double,"");
BBTK_END_DESCRIBE_BLACK_BOX(InteractorStyleMaracas_Model);
-//=====
+//=====
// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
-//=====
-}
-// EO namespace bbcreaMaracasVisu
+//=====
+}// EO namespace bbcreaMaracasVisu
#endif // __bbcreaMaracasVisuInteractorStyleMaracas_Model_h_INCLUDED__
} // if Type
if (bbGetInputType()==40)
{
- bbGetInputWidgetShowNPoints()->OnErasePoint_();
+ bbGetInputWidgetShowNPoints()->OnErasePoint_(false);
} // if Type
+ if (bbGetInputType()==41)
+ {
+ bbGetInputWidgetShowNPoints()->OnErasePoint_(true);
+ } // if Type
+
if (bbGetInputType()==50)
{
bbGetInputWidgetShowNPoints()->OnDeleteAllPoints_();
BBTK_INPUT(ShowNPoints_Tools,WidgetShowNPoints,"WidgetShowNPoints",WidgetShowNPoints*,"");
BBTK_INPUT(ShowNPoints_Tools,Spacing,"(default [1,1,1] )Spacing",std::vector<double>,"");
BBTK_INPUT(ShowNPoints_Tools,Mesh,"Mesh en format vtkPolyData ",vtkPolyData*,"");
- BBTK_INPUT(ShowNPoints_Tools,Type,"(default 0) 0:Nothing 1:Auto add points 5:Add Point 10:Insert Point 20:TrackPoint 30:Set nearest point 35:Set Label to actual point 40:Erase point 50:Deleta all points 100:Insert group after 110:Delete group 120:Reset collection 200:Tool 3 or 4 points to patch surface - Create Mesh (based on 1 group and 3 or 4 points) 205:Tool 3 or 4 points to volume surface - Create Mesh (based on 1 group and 3 or 4 points) 210: Invert points 220: Move patch center (param is the step ex [-1] or [1]) 230: Move point in normal of surface (Params [-1] or [1]) 235: ChangeCurrentPoint (Params [-1] or [1]) 240: Join all start-end points to the start-end points on selected spline 250: Set Mesh SPC (Params: [0]:Patch [1]:CloseSpline1 [2]:CloseSpline2) 300: Create expanded surface 310: Create wide expanded surface 320: Expand Surface, 330: Widen surface, 340: Expand patch, 400: Separate and Order Splines given a rotation origin, 500:Load collection (ParamStr filenaname.xls 501:Save collection (ParamStr filenaname.xls)",int,"");
+ BBTK_INPUT(ShowNPoints_Tools,Type,"(default 0) 0:Nothing 1:Auto add points 5:Add Point 10:Insert Point 20:TrackPoint 30:Set nearest point 35:Set Label to actual point 40:Erase point 41:Erase point and Unselect point 50:Deleta all points 100:Insert group after 110:Delete group 120:Reset collection 200:Tool 3 or 4 points to patch surface - Create Mesh (based on 1 group and 3 or 4 points) 205:Tool 3 or 4 points to volume surface - Create Mesh (based on 1 group and 3 or 4 points) 210: Invert points 220: Move patch center (param is the step ex [-1] or [1]) 230: Move point in normal of surface (Params [-1] or [1]) 235: ChangeCurrentPoint (Params [-1] or [1]) 240: Join all start-end points to the start-end points on selected spline 250: Set Mesh SPC (Params: [0]:Patch [1]:CloseSpline1 [2]:CloseSpline2) 300: Create expanded surface 310: Create wide expanded surface 320: Expand Surface, 330: Widen surface, 340: Expand patch, 400: Separate and Order Splines given a rotation origin, 500:Load collection (ParamStr filenaname.xls 501:Save collection (ParamStr filenaname.xls)",int,"");
BBTK_INPUT(ShowNPoints_Tools, Params,"Optional params for the tools, (type:200): normal and direction, (type:235):step, (type:320): centroid and direction, (type:330): normal and direction, (type:340): centroid and direction, (type:400): reference point", std::vector<double>,"");
BBTK_INPUT(ShowNPoints_Tools, ParamsStr,"Optional params for the tools, required for 35:New Label 500:filename.xls", std::vector<std::string>,"");
public:
InteractorwxVtkBaseView( wxVtkBaseView_Info *box );
~InteractorwxVtkBaseView();
- virtual bool OnLeftButtonDown();
- virtual bool OnLeftButtonUp();
- virtual bool OnMouseMove();
- virtual bool OnRightButtonDown();
- virtual bool OnRightButtonUp();
- virtual bool OnMiddleButtonDown();
- virtual bool OnMiddleButtonUp();
- virtual bool OnLeftDClick();
- virtual bool OnRightDClick();
+ virtual bool OnChar();
+ virtual bool OnLeftButtonDown();
+ virtual bool OnLeftButtonUp();
+ virtual bool OnMouseMove();
+ virtual bool OnRightButtonDown();
+ virtual bool OnRightButtonUp();
+ virtual bool OnMiddleButtonDown();
+ virtual bool OnMiddleButtonUp();
+ virtual bool OnLeftDClick();
+ virtual bool OnRightDClick();
private:
wxVtkBaseView_Info *_box;
bool flagDrag;
{
}
+bool InteractorwxVtkBaseView::OnChar()
+{
+ if (_box!=NULL)
+ {
+ if ( (_box->bbGetInputInteractionType()==20 ) && (_wxvtkbaseview!=NULL) )
+ {
+ printf("EED InteractorwxVtkBaseView::OnChar \n");
+ _box->SetwxVtkBaseViewOutputs( _wxvtkbaseview );
+ _box->bbSignalOutputModification();
+ return false;
+ }
+ } // if _box
+ return true;
+}
+
bool InteractorwxVtkBaseView::OnLeftButtonDown()
{
if (_box!=NULL)
bbSetOutputNormal( lstNormal );
bbSetOutputInterpolation( vtkbasedata->GetInterpolate() );
+
+ int systelCtrlKey = wxvtkbaseview->GetInteractorStyleBaseView()->GetInteractor()->GetControlKey();
+ int systelKeyCode = wxvtkbaseview->GetInteractorStyleBaseView()->GetInteractor()->GetKeyCode();
+ std::vector<char> lstKeyboard;
+ lstKeyboard.push_back(systelCtrlKey);
+ lstKeyboard.push_back(systelKeyCode);
+ bbSetOutputKeyboard( lstKeyboard );
+
} // BaseData
} // if wxvtkbaseview
}
bbSetOutputvtkRenderer(NULL);
bbSetInputWithEventPropagation(false);
interactorwxvtkbaseview = NULL;
+ interactorwxvtkbaseview1 = NULL;
interactorwxvtkbaseview2 = NULL;
interactorwxvtkbaseview3 = NULL;
bbSetOutputInteractorwxVtkBaseView_model( interactorwxvtkbaseview );
bbSetOutputInteractorwxVtkBaseView_model1( interactorwxvtkbaseview1 );
bbSetOutputInteractorwxVtkBaseView_model2( interactorwxvtkbaseview2 );
bbSetOutputInteractorwxVtkBaseView_model3( interactorwxvtkbaseview3 );
+
+ std::vector<char> lstKeyboard;
+ lstKeyboard.push_back(-1);
+ lstKeyboard.push_back(-1);
+ bbSetOutputKeyboard(lstKeyboard);
+
}
//=====
BBTK_DECLARE_OUTPUT(Point,std::vector<double>);
BBTK_DECLARE_OUTPUT(PointMouse,std::vector<double>);
BBTK_DECLARE_OUTPUT(Normal,std::vector<double>);
+ BBTK_DECLARE_OUTPUT(Keyboard,std::vector<char>);
BBTK_DECLARE_OUTPUT(InteractorwxVtkBaseView_model,InteractorwxVtkBaseView_model*);
BBTK_DECLARE_OUTPUT(InteractorwxVtkBaseView_model1,InteractorwxVtkBaseView_model*);
BBTK_DECLARE_OUTPUT(InteractorwxVtkBaseView_model2,InteractorwxVtkBaseView_model*);
BBTK_INPUT(wxVtkBaseView_Info,wxVtkBaseView1,"Used in case of InteractionType!=0",wxVtkBaseView*,"");
BBTK_INPUT(wxVtkBaseView_Info,wxVtkBaseView2,"Used in case of InteractionType!=0",wxVtkBaseView*,"");
BBTK_INPUT(wxVtkBaseView_Info,wxVtkBaseView3,"Used in case of InteractionType!=0",wxVtkBaseView*,"");
- BBTK_INPUT(wxVtkBaseView_Info,InteractionType,"(default 0) 0:Nothing 1:LeftButtonDown 2:LeftButtonUp 3:MouseMove 4:RightButtonDown 5:RightButtonUp 6:LeftDClick 7:RightDClick 8:DragLeft 9:DragRight 10:MiddleButtonDown 11:MiddleButtonUp 12:DragMiddle ",int,"");
+ BBTK_INPUT(wxVtkBaseView_Info,InteractionType,"(default 0) 0:Nothing 1:LeftButtonDown 2:LeftButtonUp 3:MouseMove 4:RightButtonDown 5:RightButtonUp 6:LeftDClick 7:RightDClick 8:DragLeft 9:DragRight 10:MiddleButtonDown 11:MiddleButtonUp 12:DragMiddle 20:Char",int,"");
BBTK_INPUT(wxVtkBaseView_Info,WithEventPropagation,"(default false) (In LeftDClick envet) false:No Event propagation true:With event propagation",bool,"");
BBTK_OUTPUT(wxVtkBaseView_Info,Direction,"Direction -1=3D 0=YZ 1=XZ 2=XY(default)",int,"");
BBTK_OUTPUT(wxVtkBaseView_Info,Point,"Axis positon of the viewer",std::vector<double>,"");
BBTK_OUTPUT(wxVtkBaseView_Info,PointMouse,"Actual Point Mouse",std::vector<double>,"");
BBTK_OUTPUT(wxVtkBaseView_Info,Normal,"Normal of plane viewe",std::vector<double>,"");
+ BBTK_OUTPUT(wxVtkBaseView_Info,Keyboard,"default [-1 -1] : [ctrl keycode]",std::vector<char>,"");
BBTK_OUTPUT(wxVtkBaseView_Info,InteractorwxVtkBaseView_model,"Interactor wxVtkBaseView Model", InteractorwxVtkBaseView_model* ,"");
BBTK_OUTPUT(wxVtkBaseView_Info,InteractorwxVtkBaseView_model1,"Interactor wxVtkBaseView Model", InteractorwxVtkBaseView_model* ,"");
BBTK_OUTPUT(wxVtkBaseView_Info,InteractorwxVtkBaseView_model2,"Interactor wxVtkBaseView Model", InteractorwxVtkBaseView_model* ,"");
_active = true;
_vtkInteractorStyleBaseView = NULL;
}
+
//---------------------------------------------------------------------------
InteractorStyleMaracas::~InteractorStyleMaracas()
{
{
return true;
}
+
//---------------------------------------------------------------------------
bool InteractorStyleMaracas::OnMiddleDClick() //virtual
{
return true;
}
+
//---------------------------------------------------------------------------
bool InteractorStyleMaracas::OnRightButtonDown() //virtual
{
return true;
}
+
//---------------------------------------------------------------------------
bool InteractorStyleMaracas::OnRightButtonUp() //virtual
{
return true;
}
+
//---------------------------------------------------------------------------
bool InteractorStyleMaracas::OnRightDClick() //virtual
{
if (idCurrentPoint>=GetLstPointsSize() ) {idCurrentPoint=GetLstPointsSize()-1; }
} // if Size==0
}
+
+//----------------------------------------------------------------------
+void ModelShowNPoints::ForceIdCurrentPoint(int idPoint)
+{
+ idCurrentPoint=idPoint;
+}
void InversLstPoints();
int GetIdCurrentPoint();
void SetIdCurrentPoint(int idPoint);
+ void ForceIdCurrentPoint(int idPoint);
private:
std::vector<double> lstPointsX;
}
//------------------------------------------------------------------------
- void WidgetShowNPoints::OnErasePoint_()
+ void WidgetShowNPoints::OnErasePoint_(bool forceUnselectPoint)
{
StopAutoAddPoints();
StopTrackPoint();
UndoRedo_SaveCollection(); //A
if (ErasePoint( GetModelShowNPoints()->GetIdCurrentPoint() ) == true)
{
+ if (forceUnselectPoint==true)
+ {
+ GetModelShowNPoints()->ForceIdCurrentPoint(-1);
+ } // if forceUnselectPoint
SetOutputBox();
// EED 2022-05-19
//renderer->GetRenderWindow()->Render();
//------------------------------------------------------------------------
void WidgetShowNPoints::OnErasePoint(wxCommandEvent& event)
{
- OnErasePoint_();
+ OnErasePoint_(false);
}
//------------------------------------------------------------------------
RefreshColourCollection();
}
-
-
-
//------------------------------------------------------------------------
void WidgetShowNPoints::RefreshColourCollection()
{
UpdatePoints_();
std::vector<double> colourAll;
- colourAll.push_back(0);
- colourAll.push_back(1);
- colourAll.push_back(1);
+ // magenta
+ colourAll.push_back(0.5);
+ colourAll.push_back(0.9);
+ colourAll.push_back(0.9);
std::vector<double> colourActualGroup;
- colourActualGroup.push_back(1);
- colourActualGroup.push_back(0);
- colourActualGroup.push_back(0);
+ // red
+// colourActualGroup.push_back(1);
+// colourActualGroup.push_back(0.4);
+// colourActualGroup.push_back(0.4);
+ // red
+ colourActualGroup.push_back(0.8);
+ colourActualGroup.push_back(0.4);
+ colourActualGroup.push_back(0.4);
+
+
// For all collections
SetColour( colourAll );
int sizeLstPoints;
if ((curPnt>=0) && (curPnt<sizeLstPoints ) )
{
std::vector<double> colourActualPoint;
- colourActualPoint.push_back(1);
- colourActualPoint.push_back(1);
- colourActualPoint.push_back(0);
+ // yellow
+ colourActualPoint.push_back(1.0);
+ colourActualPoint.push_back(1.0);
+ colourActualPoint.push_back(0.2);
double radio = GetModelShowNPoints()->GetRadio();
lstViewShowNPoints[mActualCollection] -> mcolour = colourActualPoint;
lstViewShowNPoints[mActualCollection]->RefreshPoint( curPnt );
void OnRenamePoint_(std::string label);
void OnRenamePoint(wxCommandEvent& event);
- void OnErasePoint_();
+ void OnErasePoint_(bool forceUnselectPoint);
void OnErasePoint(wxCommandEvent& event);
void OnEraseLastPoint(wxCommandEvent &event);
void DeleteAllPoints_();
#include "vtkPointPicker.h"
#include "UtilVtk3DGeometriSelection.h"
+//---------------------------------------------------------------------------
vtkInteractorStyle3DView::vtkInteractorStyle3DView()
{
}
+
//---------------------------------------------------------------------------
vtkInteractorStyle3DView::~vtkInteractorStyle3DView()
{
}
+
//---------------------------------------------------------------------------
bool vtkInteractorStyle3DView::OnLeftDClick()
{
SelectMarchibCubePoint();
return true;
}
+
//---------------------------------------------------------------------------
bool vtkInteractorStyle3DView::SelectMarchibCubePoint()
{
pp( 0 ) = pickPoint[ 0 ]; pp( 1 ) = pickPoint[ 1 ]; pp( 2 ) = pickPoint[ 2 ];
cp( 0 ) = cameraPos[ 0 ]; cp( 1 ) = cameraPos[ 1 ]; cp( 2 ) = cameraPos[ 2 ];
-
//EED 27 sep 2006 (1/2)
// wxVtkMPR3DView *wxvtkmpr3Dview = (wxVtkMPR3DView *)_vtkInteractorStyleBaseView->GetWxVtk3DBaseView();
// double spc[3];
// wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetSpacing(spc);
-
vtkImageData *imageData = GetWxVtkMPR3DView()->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
int dim[3];
double spc[3];
imageData->GetDimensions(dim);
imageData->GetSpacing(spc);
-
vtkMarchingCubes *mcubes = _wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetMCubes(0);
-
UtilVtk3DGeometriSelection utilVtk3DGeometriSelection;
utilVtk3DGeometriSelection.SetDimentions(dim[0],dim[1],dim[2]);
double fac;
fac = GTM_MAX( dim[0], dim[2] );
-
if( utilVtk3DGeometriSelection.FindCubePointsFromPoints(
pO.GetAnsiRef( ), pF.GetAnsiRef( ),
pp.GetAnsiRef( ), cp.GetAnsiRef( ) ) )
}
}
}
-
-
return ok;
}
+
//-------------------------------------------------------------------
void vtkInteractorStyle3DView::SetWxVtkMPR3DView( wxVtkMPR3DView *wxvtkmpr3Dview )
{
_wxvtkmpr3Dview = wxvtkmpr3Dview;
}
+
//-------------------------------------------------------------------
wxVtkMPR3DView *vtkInteractorStyle3DView::GetWxVtkMPR3DView()
{
return _wxvtkmpr3Dview;
}
+
//-------------------------------------------------------------------
wxVtkClipping3DView *vtkInteractorStyle3DView::GetWxVtkClipping3DView()
{
return _wxvtkclipping3Dview;
}
+
//-------------------------------------------------------------------
void vtkInteractorStyle3DView::SetWxVtkClipping3DView( wxVtkClipping3DView *wxvtkclipping3Dview)
{
}
}
if (type==10)
- { // OnMiddleButtonUp
+ { // OnChar
if (intStyMar->OnChar()==false)
{
i=size;
}
//---------------------------------------------------------------------------
-void vtkInteractorStyleBaseView::OnChar() // virtual
+void vtkInteractorStyleBaseView::OnChar() // virtual
{
// char a=GetInteractor()->GetKeyCode();
CallLstInteractorStyleMaracas(10);
{
_parent_refresh_waiting=true;
}
+
//---------------------------------------------------------------------------
bool vtkInteractorStyleBaseView::GetParent_refresh_waiting()
{
return _parent_refresh_waiting;
}
+
//---------------------------------------------------------------------------
void vtkInteractorStyleBaseView::EvaluateToRefresh()
{
}//if
}//if _blockRefresh
}
+
//---------------------------------------------------------------------------
void vtkInteractorStyleBaseView::BlockRefresh()
{
_blockRefresh=true;
}
+
//---------------------------------------------------------------------------
void vtkInteractorStyleBaseView::UnBlockRefresh()
{
vtkStandardNewMacro(vtkInteractorStyleBaseView3D);
//---------------------------------------------------------------------------
-vtkInteractorStyleBaseView3D::vtkInteractorStyleBaseView3D(){
+vtkInteractorStyleBaseView3D::vtkInteractorStyleBaseView3D()
+{
}
+
//---------------------------------------------------------------------------
-vtkInteractorStyleBaseView3D::~vtkInteractorStyleBaseView3D(){
+vtkInteractorStyleBaseView3D::~vtkInteractorStyleBaseView3D()
+{
}
+
//---------------------------------------------------------------------------
void vtkInteractorStyleBaseView3D::OnRightButtonDown ()
{
this->vtkInteractorStyleTrackballCamera::OnRightButtonDown();
}
*/
- this->FindPokedRenderer(this->Interactor->GetEventPosition()[0],
+ this->FindPokedRenderer(this->Interactor->GetEventPosition()[0],
this->Interactor->GetEventPosition()[1]);
- if (this->CurrentRenderer == NULL)
+ if (this->CurrentRenderer == NULL)
{
- return;
- }
-
- if (this->Interactor->GetControlKey()) {
- this->StartDolly();
- }
+ return;
+ } // if renderer
+ if (this->Interactor->GetControlKey()) {
+ this->StartDolly();
+ } // if Control key
}
+
//---------------------------------------------------------------------------
void vtkInteractorStyleBaseView3D::OnRightButtonUp ()
{
vtkInteractorStyleBaseView::OnRightButtonUp();
-
/*
if (GetInteractor()->GetControlKey()==1 ){
this->vtkInteractorStyleTrackballCamera::OnRightButtonUp();
}
*/
-
-
switch (this->State)
{
case VTKIS_DOLLY:
break;
}
}
+
//---------------------------------------------------------------------------
void vtkInteractorStyleBaseView3D::OnMouseMove ()
{
// int dx = rwi->GetEventPosition()[0] ; // JPRx
// int dy = rwi->GetEventPosition()[1] ; // JPRx
-
switch (this->State)
{
case VTKIS_ROTATE:
// this->InvokeEvent(vtkCommand::InteractionEvent, NULL);
break;
}
-
-
-
}
+
//---------------------------------------------------------------------------
void vtkInteractorStyleBaseView3D::OnLeftButtonDown()
{
}
*/
-
this->FindPokedRenderer(this->Interactor->GetEventPosition()[0],
this->Interactor->GetEventPosition()[1]);
if (this->CurrentRenderer == NULL)
return;
}
-
if ((GetInteractor()->GetControlKey()==0) && (GetInteractor()->GetShiftKey()==1) )
{
this->vtkInteractorStyleImage::OnLeftButtonDown();
}
-
if (this->Interactor->GetControlKey()) {
this->StartPan();
} else {
this->StartRotate();
}
-
-
-
-
- /*
- if (this->Interactor->GetShiftKey())
- {
- if (this->Interactor->GetControlKey())
- {
- this->StartDolly();
- }
- else
- {
- this->StartPan();
- }
- }
- else
- {
- if (this->Interactor->GetControlKey())
- {
- this->StartSpin();
- }
- else
- {
- this->StartRotate();
- }
- }
-*/
-
-
}
+
//---------------------------------------------------------------------------
void vtkInteractorStyleBaseView3D::OnLeftButtonUp ()
{
- vtkInteractorStyleBaseView::OnLeftButtonUp();
-
-/*
- if (GetInteractor()->GetControlKey()==1 ){
- this->vtkInteractorStyleTrackballCamera::OnMiddleButtonUp();
- } else {
- this->vtkInteractorStyleTrackballCamera::OnLeftButtonUp();
- }
-*/
- switch (this->State)
+ vtkInteractorStyleBaseView::OnLeftButtonUp();
+ switch (this->State)
{
-
- case VTKIS_PAN:
- this->EndPan();
- break;
-
- case VTKIS_ROTATE:
- this->EndRotate();
- break;
- }
+ case VTKIS_PAN:
+ this->EndPan();
+ break;
+ case VTKIS_ROTATE:
+ this->EndRotate();
+ break;
+ } // switch
}
+
//---------------------------------------------------------------------------
void vtkInteractorStyleBaseView3D::OnMiddleButtonDown ()
{
vtkInteractorStyleBaseView::OnMiddleButtonDown();
// this->vtkInteractorStyleTrackballCamera::OnMiddleButtonDown();
}
+
//---------------------------------------------------------------------------
void vtkInteractorStyleBaseView3D::OnMiddleButtonUp ()
{
// this->vtkInteractorStyleTrackballCamera::OnMiddleButtonUp();
}
-
//---------------------------------------------------------------------------
void vtkInteractorStyleBaseView3D::OnMouseWheelForward () // virtual
{
_stateMoveAxisY = false;
_stateMoveAxisZ = false;
}
+
//---------------------------------------------------------------------------
vtkInteractorStyleMPRView::~vtkInteractorStyleMPRView()
{
_xBack=xx;
_yBack=yy;
*/
-
_stateMoveAxisX = wxvtkmpr2Dview->IfMouseTouchX(x,y,z);
_stateMoveAxisY = wxvtkmpr2Dview->IfMouseTouchY(x,y,z);
_stateMoveAxisZ = wxvtkmpr2Dview->IfMouseTouchZ(x,y,z);
-
return true;
}
+
//---------------------------------------------------------------------------
bool vtkInteractorStyleMPRView::OnLeftButtonUp ()
{
}
return true;
}
+
//---------------------------------------------------------------------------
bool vtkInteractorStyleMPRView::OnMouseMove ()
{
double x = _vtkInteractorStyleBaseView->GetInteractor()->GetEventPosition()[0];
double y = _vtkInteractorStyleBaseView->GetInteractor()->GetEventPosition()[1];
- double z=1;
- _vtkInteractorStyleBaseView->TransformCoordinate(x,y,z);
+ double z = 1;
+ _vtkInteractorStyleBaseView->TransformCoordinate(x,y,z);
wxVtkMPR2DView *wxvtkmpr2Dview = (wxVtkMPR2DView*)(_vtkInteractorStyleBaseView->GetWxVtk2DBaseView());
// wxvtkmpr2Dview->TransfromCoordViewWorld(x,y,z);
wxvtkmpr2Dview->ChangeAxisColor(x,y,z);
isbv->SetParent_refresh_waiting();
isbv->EvaluateToRefresh();
}
- } // Execute
+
+ } // Execute
vtkWindowLevelImagePlaneWidgetCallback(){}
wxVtkMPR3DView *_wxvtkmpr3Dview;
};
//-------------------------------------------------------------------
void wxVtkMPR3DView::ConfigureFreePlanes()
{
- // The shared picker enables us to use 3 planes at one time
- // and gets the picking order right
- vtkCellPicker* picker = vtkCellPicker::New();
- picker->SetTolerance(0.005);
- // The 3 image plane widgets
- _planeWidgetX = GetPlaneWidget('x', 1, 0, 0, picker);
- _planeWidgetY = GetPlaneWidget('y', 1, 1, 0, picker);
- _planeWidgetZ = GetPlaneWidget('z', 0, 0, 1, picker);
- _planeWidgetY->SetLookupTable(_planeWidgetX->GetLookupTable());
- _planeWidgetZ->SetLookupTable(_planeWidgetX->GetLookupTable());
- picker->UnRegister(NULL);
-
- // ColorWindow ColorLevel Callback
- vtkWindowLevelImagePlaneWidgetCallback *wlipwc = vtkWindowLevelImagePlaneWidgetCallback::New();
- wlipwc->_wxvtkmpr3Dview = this;
- _planeWidgetX->AddObserver(vtkCommand::WindowLevelEvent, wlipwc );
- _planeWidgetY->AddObserver(vtkCommand::WindowLevelEvent, wlipwc );
- _planeWidgetZ->AddObserver(vtkCommand::WindowLevelEvent, wlipwc );
-
- // Cursor Callback
- _planeWidgetX->AddObserver(vtkCommand::InteractionEvent, wlipwc );
- _planeWidgetY->AddObserver(vtkCommand::InteractionEvent, wlipwc );
- _planeWidgetZ->AddObserver(vtkCommand::InteractionEvent, wlipwc );
+ // The shared picker enables us to use 3 planes at one time
+ // and gets the picking order right
+ vtkCellPicker* picker = vtkCellPicker::New();
+ picker->SetTolerance(0.005);
+ // The 3 image plane widgets
+ _planeWidgetX = GetPlaneWidget('x', 1, 0, 0, picker);
+ _planeWidgetY = GetPlaneWidget('y', 1, 1, 0, picker);
+ _planeWidgetZ = GetPlaneWidget('z', 0, 0, 1, picker);
+
+ _planeWidgetY->SetLookupTable(_planeWidgetX->GetLookupTable());
+ _planeWidgetZ->SetLookupTable(_planeWidgetX->GetLookupTable());
+ picker->UnRegister(NULL);
+
+ // ColorWindow ColorLevel Callback
+ vtkWindowLevelImagePlaneWidgetCallback *wlipwc = vtkWindowLevelImagePlaneWidgetCallback::New();
+ wlipwc->_wxvtkmpr3Dview = this;
+ _planeWidgetX->AddObserver(vtkCommand::WindowLevelEvent, wlipwc );
+ _planeWidgetY->AddObserver(vtkCommand::WindowLevelEvent, wlipwc );
+ _planeWidgetZ->AddObserver(vtkCommand::WindowLevelEvent, wlipwc );
+ // Cursor Callback
+ _planeWidgetX->AddObserver(vtkCommand::InteractionEvent, wlipwc );
+ _planeWidgetY->AddObserver(vtkCommand::InteractionEvent, wlipwc );
+ _planeWidgetZ->AddObserver(vtkCommand::InteractionEvent, wlipwc );
+
}
-
//-------------------------------------------------------------------
void wxVtkMPR3DView::SetImage()
{
_probe->SetSource( imageData );
#else
-
// double colorWindow = _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetColorWindow();
// double colorLevel = _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetColorLevel();
//showOutlineActor(false);
// step 1, step 2
vtkActorCollection *tmpCollection = vtkActorCollection::New();
- vtkActorCollection *collectionActors = _wxvtk3Dbaseview->GetRenderer()->GetActors();
+ vtkActorCollection *collectionActors = _wxvtk3Dbaseview->GetRenderer()->GetActors();
int i,size=collectionActors->GetNumberOfItems();
for (i=0; i<size; i++)
{
tmpCollection->AddItem ( (vtkActor*)collectionActors->GetItemAsObject(0) );
- _wxvtk3Dbaseview->GetRenderer()->RemoveActor( (vtkProp*)tmpCollection->GetItemAsObject(i) );
+ _wxvtk3Dbaseview->GetRenderer()->RemoveActor( (vtkProp*)tmpCollection->GetItemAsObject(i) );
} // for
// step 3
_wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkmpr3Ddataviewer->GetImageActor(idPosition) );
// step 4
for (i=0; i<size; i++)
{
- _wxvtk3Dbaseview->GetRenderer()->AddActor( (vtkProp*)tmpCollection->GetItemAsObject(i) );
+ _wxvtk3Dbaseview->GetRenderer()->AddActor( (vtkProp*)tmpCollection->GetItemAsObject(i) );
} // for
tmpCollection->Delete();
// step 5 Refresh