return lstPointsZ;
}
-
+//------------------------------------------------------------------------
+ std::vector<std::string> WidgetShowNPoints::GetLstLabels()
+{
+ return lstLabels;
+}
+
+
//------------------------------------------------------------------------
lstPointsX.push_back( mpoint[0] );
lstPointsY.push_back( mpoint[1] );
lstPointsZ.push_back( mpoint[2] );
+ lstLabels.push_back( (const char*) ( textCtrl->GetValue().mb_str() ) );
// Sphere
vtkSphereSource *vtksphere = vtkSphereSource::New();
renderer->AddActor( sphereActor );
// Actor
- vtkTextActor3D *text = vtkTextActor3D::New();
- text->SetPosition( mradio+spc[0]*mpoint[0] , spc[1]*mpoint[1] , spc[2]*mpoint[2] );
- text->SetInput( (const char*) ( textCtrl->GetValue().mb_str() ) );
- renderer->AddActor( text );
- lstActorsText.push_back(text);
+ vtkTextActor3D *textActor = vtkTextActor3D::New();
+ textActor->SetPosition( mradio+spc[0]*mpoint[0] , spc[1]*mpoint[1] , spc[2]*mpoint[2] );
+ textActor->SetInput( (const char*) ( textCtrl->GetValue().mb_str() ) );
+ renderer->AddActor( textActor );
+ lstActorsText.push_back(textActor);
renderer->GetRenderWindow()->Render();
- //--BBTK
- mbbShowNPoints->bbSignalOutputModification(std::string("lstPointsX"));
- mbbShowNPoints->bbSignalOutputModification(std::string("lstPointsY"));
- mbbShowNPoints->bbSignalOutputModification(std::string("lstPointsZ"));
+ SetOutputBox();
} else {//mpoint.size
printf("creaMaracasVisu::ShowNPoints (not match point) \n");
} // renderer
}
+ void WidgetShowNPoints::SetOutputBox()
+ {
+ //--BBTK
+ mbbShowNPoints->bbSetOutputlstPointsX( GetLstPointsX() );
+ mbbShowNPoints->bbSetOutputlstPointsY( GetLstPointsY() );
+ mbbShowNPoints->bbSetOutputlstPointsZ( GetLstPointsZ() );
+ mbbShowNPoints->bbSetOutputlstLabels( GetLstLabels() );
+ mbbShowNPoints->bbSignalOutputModification(std::string("lstPointsX"));
+ mbbShowNPoints->bbSignalOutputModification(std::string("lstPointsY"));
+ mbbShowNPoints->bbSignalOutputModification(std::string("lstPointsZ"));
+ mbbShowNPoints->bbSignalOutputModification(std::string("lstLabels"));
+ }
//------------------------------------------------------------------------
void WidgetShowNPoints::ErasePoint(int id)
lstActorsText[id]->Delete();
lstActorsSphere.erase( lstActorsSphere.begin()+id );
lstActorsText.erase( lstActorsText.begin()+id );
+
lstPointsX.erase( lstPointsX.begin()+id );
lstPointsY.erase( lstPointsY.begin()+id );
lstPointsZ.erase( lstPointsZ.begin()+id );
+ lstLabels.erase( lstLabels.begin()+id );
+
renderer->GetRenderWindow()->Render();
- //--BBTK
- mbbShowNPoints->bbSignalOutputModification(std::string("lstPointsX"));
- mbbShowNPoints->bbSignalOutputModification(std::string("lstPointsY"));
- mbbShowNPoints->bbSignalOutputModification(std::string("lstPointsZ"));
+ SetOutputBox();
+
} // if id
} // if renderer
}
//------------------------------------------------------------------------
void WidgetShowNPoints::OnDeleteAllPoints(wxCommandEvent& event)
{
- int i,size=lstActorsSphere.size();
- if (this->renderer!=NULL){
- for (i=0;i<size;i++)
- {
- renderer->RemoveActor( lstActorsSphere[i] );
- renderer->RemoveActor( lstActorsText[i] );
- }
- lstActorsSphere.clear();
- lstActorsText.clear();
- lstPointsX.clear();
- lstPointsY.clear();
- lstPointsZ.clear();
- renderer->GetRenderWindow()->Render();
- //--BBTK
- mbbShowNPoints->bbSignalOutputModification(std::string("lstPointsX"));
- mbbShowNPoints->bbSignalOutputModification(std::string("lstPointsY"));
- mbbShowNPoints->bbSignalOutputModification(std::string("lstPointsZ"));
- } // renderer
+ int id,size=lstActorsSphere.size();
+ for (id=size-1;id>=0;id--)
+ {
+ ErasePoint(id);
+ }
+
}
-
-
BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ShowNPoints)
BBTK_BLACK_BOX_IMPLEMENTATION(ShowNPoints,bbtk::WxBlackBox);
bbSetOutputlstPointsX( mwxwidget->GetLstPointsX() );
bbSetOutputlstPointsY( mwxwidget->GetLstPointsY() );
bbSetOutputlstPointsZ( mwxwidget->GetLstPointsZ() );
+ bbSetOutputlstLabels( mwxwidget->GetLstLabels() );
} // mwxwidget
}
void OnEraseLastPoint(wxCommandEvent &event);
void OnDeleteAllPoints(wxCommandEvent &event);
+ void SetOutputBox();
void SetPoint(std::vector<int> ppoint);
void SetColour(std::vector<double> colour);
void SetOpacity(double opacity);
std::vector<int> GetLstPointsX();
std::vector<int> GetLstPointsY();
std::vector<int> GetLstPointsZ();
+ std::vector<std::string> GetLstLabels();
private:
- ShowNPoints *mbbShowNPoints;
- vtkRenderer *renderer;
- std::vector<int> lstPointsX;
- std::vector<int> lstPointsY;
- std::vector<int> lstPointsZ;
- std::vector<vtkProp3D*> lstActorsSphere;
- std::vector<vtkProp3D*> lstActorsText;
+ ShowNPoints *mbbShowNPoints;
+ vtkRenderer *renderer;
+ std::vector<int> lstPointsX;
+ std::vector<int> lstPointsY;
+ std::vector<int> lstPointsZ;
+ std::vector<std::string> lstLabels;
+ std::vector<vtkProp3D*> lstActorsSphere;
+ std::vector<vtkProp3D*> lstActorsText;
std::vector<int> mpoint;
vtkImageData *mimage;
BBTK_DECLARE_OUTPUT( lstPointsX, std::vector<int> );
BBTK_DECLARE_OUTPUT( lstPointsY, std::vector<int> );
BBTK_DECLARE_OUTPUT( lstPointsZ, std::vector<int> );
+ BBTK_DECLARE_OUTPUT( lstLabels, std::vector<std::string> );
BBTK_PROCESS(Process);
void Process();
BBTK_CREATE_WIDGET(CreateWidget);
};
BBTK_BEGIN_DESCRIBE_BLACK_BOX(ShowNPoints,bbtk::WxBlackBox);
-BBTK_NAME("ShowNPoints");
-BBTK_AUTHOR("Eduardo DAVILA");
-BBTK_DESCRIPTION("widget that shows N moints in 3D (vtkActors)");
-BBTK_CATEGORY("widgetVtk");
-BBTK_INPUT(ShowNPoints,In,"One Point",std::vector<int>,"");
-BBTK_INPUT(ShowNPoints,Renderer,"Renderer",vtkRenderer*,"");
-BBTK_INPUT(ShowNPoints,Image,"vktkImageData",vtkImageData*,"");
-BBTK_INPUT(ShowNPoints,Colour,"Colour of the actor",std::vector<double>,"colour");
-BBTK_INPUT(ShowNPoints,Opacity,"Opacity of the actor",double,"");
-BBTK_INPUT(ShowNPoints,Radio,"Radio of the spheres",double,"");
-BBTK_OUTPUT(ShowNPoints , lstPointsX , " list of points X ", std::vector<int> ,"");
-BBTK_OUTPUT(ShowNPoints , lstPointsY , " list of points Y ", std::vector<int> ,"");
-BBTK_OUTPUT(ShowNPoints , lstPointsZ , " list of points Z ", std::vector<int> ,"");
+ BBTK_NAME("ShowNPoints");
+ BBTK_AUTHOR("Eduardo DAVILA");
+ BBTK_DESCRIPTION("widget that shows N moints in 3D (vtkActors)");
+ BBTK_CATEGORY("widgetVtk");
+ BBTK_INPUT(ShowNPoints,In,"One Point",std::vector<int>,"");
+ BBTK_INPUT(ShowNPoints,Renderer,"Renderer",vtkRenderer*,"");
+ BBTK_INPUT(ShowNPoints,Image,"vktkImageData",vtkImageData*,"");
+ BBTK_INPUT(ShowNPoints,Colour,"Colour of the actor",std::vector<double>,"colour");
+ BBTK_INPUT(ShowNPoints,Opacity,"Opacity of the actor",double,"");
+ BBTK_INPUT(ShowNPoints,Radio,"Radio of the spheres",double,"");
+ BBTK_OUTPUT(ShowNPoints , lstPointsX , " list of points X ", std::vector<int> ,"");
+ BBTK_OUTPUT(ShowNPoints , lstPointsY , " list of points Y ", std::vector<int> ,"");
+ BBTK_OUTPUT(ShowNPoints , lstPointsZ , " list of points Z ", std::vector<int> ,"");
+ BBTK_OUTPUT(ShowNPoints , lstLabels , " list of labels ", std::vector<std::string> ,"");
BBTK_END_DESCRIBE_BLACK_BOX(ShowNPoints);
}
// EO namespace bbcreaMaracasVisu
//-------------------------------------------------------------
void bbwxMaracas_N_ViewersWidget::OnDClickLeft(wxCommandEvent & event)
{
-printf("EED bbwxMaracas_N_ViewersWidget::OnDClickLeft \n");
wxMaracas_N_ViewersWidget::OnDClickLeft(event);
mbbViewerNV->bbSignalOutputModification(std::string("Point"));
}
-
BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ViewerNV)
BBTK_BLACK_BOX_IMPLEMENTATION(ViewerNV,bbtk::WxBlackBox);
//-------------------------------------------------------------
vtkImageData* img = bbGetInputIn();
std::vector<int> type = bbGetInputnTypeView();
- std::cout<<"img "<<img<<std::endl;
- std::cout<<"widget "<<mwxwidget<<std::endl;
+// std::cout<<"img "<<img<<std::endl;
+// std::cout<<"widget "<<mwxwidget<<std::endl;
if(img != NULL && mwxwidget != NULL){// && !enter){
format 66
"wxVtkViwer" // wxVtkViwer
- revision 4
+ revision 5
modified_by 2 "davila"
// class settings
//class diagram settings
idl_decl ""
explicit_switch_type ""
+ classrelation 139010 // <unidirectional association>
+ relation 138882 --->
+ a role_name "" private
+ cpp default " ${comment}${static}${mutable}${volatile}${const}${type} * ${name}${value};
+"
+ classrelation_ref 139010 // <unidirectional association>
+ b parent class_ref 130818 // marImageData
+ end
end
class 128642 "vtkInfoTextImageInteractor"
classrelation_ref 133250 // <unidirectional association>
b parent class_ref 132354 // vtkMPRBaseDataViewer
end
+
+ classrelation 139138 // <unidirectional association>
+ relation 139010 --->
+ a role_name "" private
+ cpp default " ${comment}${static}${mutable}${volatile}${const}${type} * ${name}${value};
+"
+ classrelation_ref 139138 // <unidirectional association>
+ b parent class_ref 131458 // vtkMPRBaseData
+ end
end
class 131330 "wxMaracas_ViewerWidget"
classrelation_ref 136194 // <unidirectional association>
b parent class_ref 132354 // vtkMPRBaseDataViewer
end
+
+ classrelation 139266 // <unidirectional association>
+ relation 139138 --->
+ a role_name "" private
+ cpp default " ${comment}${static}${mutable}${volatile}${const}${type} * ${name}${value};
+"
+ classrelation_ref 139266 // <unidirectional association>
+ b parent class_ref 131458 // vtkMPRBaseData
+ end
end
class 131458 "vtkMPRBaseData"
idl_decl ""
explicit_switch_type ""
+ classrelation 138882 // <generalisation>
+ relation 138754 ---|>
+ a public
+ cpp default "${type}"
+ classrelation_ref 138882 // <generalisation>
+ b parent class_ref 128514 // vtkBaseData
+ end
end
class 131586 "wxWidgetMesure2D_Plane_inMPR"
classcanvas 128002 class_ref 128002 // vtkInfoTextImage
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default
- xyz 165 428 2000
+ xyz 165 450 2000
end
classcanvas 128130 class_ref 128130 // wxVtk2DBaseView
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default
end
classcanvas 128642 class_ref 128386 // vtkImageViewer2_XYZ
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default
- xyz 200 386 2000
+ xyz 190 390 2000
end
classcanvas 128898 class_ref 128514 // vtkBaseData
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default
- xyz 201 470 2000
+ xyz 219 154 2000
end
classcanvas 129026 class_ref 128642 // vtkInfoTextImageInteractor
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default
classcanvas 129922 class_ref 129026 // vtkInteractorStyleImage
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default
color magenta
- xyz 405 188 2000
+ xyz 407 173 2000
end
classcanvas 130946 class_ref 129154 // wxVrk3DBaseView
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default
color magenta
xyz 705 776 2000
end
+classcanvas 141314 class_ref 131458 // vtkMPRBaseData
+ draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default
+ xyz 173 261 2010
+end
relationcanvas 128258 relation_ref 128002 // <association>
from ref 128130 z 2001 to ref 128002
no_role_a no_role_b
no_multiplicity_a no_multiplicity_b
end
relationcanvas 132354 relation_ref 129538 // <unidirectional association>
- decenter_end 177
+ decenter_end 171
from ref 131202 z 2001 to point 430 648
line 139010 z 2001 to ref 132226
no_role_a no_role_b
no_role_a no_role_b
no_multiplicity_a no_multiplicity_b
end
+relationcanvas 141698 relation_ref 138754 // <generalisation>
+ from ref 141314 z 2011 to ref 128898
+ no_role_a no_role_b
+ no_multiplicity_a no_multiplicity_b
+end
+relationcanvas 141826 relation_ref 138882 // <unidirectional association>
+ from ref 128898 z 2001 to point 104 171
+ line 141954 z 2001 to ref 136450
+ no_role_a no_role_b
+ no_multiplicity_a no_multiplicity_b
+end
line 137474 -_-_
from ref 137346 z 2014 to ref 137218
end
classcanvas 128002 class_ref 131202 // wxMaracas_N_ViewersWidget
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default
color mediumyellow
- xyz 637 737 2000
+ xyz 601 736 2000
end
classcanvas 128130 class_ref 131330 // wxMaracas_ViewerWidget
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default
color mediumyellow
- xyz 649 472 2000
+ xyz 615 472 2000
end
note 128386 "wxwindow1
wxwindow2
wxwindow3
wxwindow4
"
- xyzwh 596 636 2005 118 92
+ xyzwh 574 633 2005 118 92
classcanvas 128642 class_ref 131458 // vtkMPRBaseData
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default
xyz 379 470 2000
mvtkmpr2Dview_y
mvtkmpr2Dview_z
"
- xyzwh 579 251 2000 133 60
+ xyzwh 571 248 2000 133 60
classcanvas 129794 class_ref 131586 // wxWidgetMesure2D_Plane_inMPR
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default
xyz 338 375 2000
end
note 140930 "see wxVtkViewer class Diagram 1"
xyzwh 429 127 2000 232 36
+classcanvas 142210 class_ref 131458 // vtkMPRBaseData
+ draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default
+ xyz 716 382 2000
+end
relationcanvas 128258 relation_ref 131842 // <unidirectional association>
from ref 128002 z 2001 to ref 128130
no_role_a no_role_b
no_multiplicity_a no_multiplicity_b
end
relationcanvas 129026 relation_ref 132098 // <unidirectional association>
- from ref 128130 z 2001 to point 734 232
+ decenter_begin 537
+ from ref 128130 z 2001 to point 706 233
line 132994 z 2001 to ref 128898
no_role_a no_role_b
no_multiplicity_a no_multiplicity_b
no_multiplicity_a no_multiplicity_b
end
relationcanvas 129922 relation_ref 132354 // mwidgetMesure
- from ref 128130 z 2001 label "mwidgetMesure" italic xyz 550 427 2001 to ref 129794
+ from ref 128130 z 2001 label "mwidgetMesure" italic xyz 532 427 2001 to ref 129794
no_role_a no_role_b
no_multiplicity_a no_multiplicity_b
end
no_role_a no_role_b
no_multiplicity_a no_multiplicity_b
end
+relationcanvas 142338 relation_ref 139010 // <unidirectional association>
+ decenter_end 710
+ from ref 128002 z 2001 to point 800 717
+ line 142594 z 2001 to ref 142210
+ no_role_a no_role_b
+ no_multiplicity_a no_multiplicity_b
+end
+relationcanvas 142466 relation_ref 139138 // <unidirectional association>
+ from ref 128130 z 2001 to ref 142210
+ no_role_a no_role_b
+ no_multiplicity_a no_multiplicity_b
+end
line 128514 -_-_
from ref 128386 z 2006 to ref 128258
line 129666 -_-_
window_sizes 1397 856 329 1062 729 70
diagrams
active classdiagram_ref 128002 // wxVtkViewer class Diagram 1
- 1058 709 100 4 443 0
+ 1058 709 100 4 180 0
classdiagram_ref 128130 // wxVtkViewer class Diagram 2
- 870 691 100 4 240 0
+ 870 691 100 4 9 0
end
show_stereotypes
selected classdiagram_ref 128002 // wxVtkViewer class Diagram 1
format 66
"wxVtkViewer"
- revision 4
+ revision 5
modified_by 2 "davila"
/*JCP 14/05/2009
* int z = (int)(_vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetVtkBaseData()->GetZ());*/
- int z = (int)((wxVtk2DBaseView*)_vtkInteractorStyleBaseView->GetWxVtk2DBaseView())->GetVtkBaseData()->GetZ();
- double xx=X,yy=Y,zz=z;
+ double xx,yy,zz;
+
+ int z = (int)((wxVtk2DBaseView*)_vtkInteractorStyleBaseView->GetWxVtk2DBaseView())->GetVtkBaseData()->GetZ();
+ xx=X;
+ yy=Y;
+ zz=z;
+
_vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->TransfromeCoordScreenToWorld(xx,yy,zz);
Program: wxMaracas
Module: $RCSfile: wxMaracas_N_ViewersWidget.cxx,v $
Language: C++
- Date: $Date: 2009/05/14 13:54:35 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2009/06/05 06:07:39 $
+ Version: $Revision: 1.10 $
Copyright: (c) 2002, 2003
License:
wxMaracas_N_ViewersWidget::wxMaracas_N_ViewersWidget(wxWindow *parent, vtkImageData* imagedata, std::vector<int> *nTypeView)
: wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL)
{
- wxwindow1 = NULL;
- wxwindow2 = NULL;
- wxwindow3 = NULL;
- wxwindow4 = NULL;
-
- _currentwxw = NULL;
-
+ wxwindow1 = NULL;
+ wxwindow2 = NULL;
+ wxwindow3 = NULL;
+ wxwindow4 = NULL;
+ _currentwxw = NULL;
+ mvtkmprbasedata = NULL;
+
wxSizer *sizer = new wxBoxSizer(wxVERTICAL);
this->SetSizer(sizer);
this->SetAutoLayout(true);
wxMaracas_N_ViewersWidget::~wxMaracas_N_ViewersWidget()
{
-
+ if (mvtkmprbasedata!=NULL)
+ {
+ delete mvtkmprbasedata;
+ }
+
}
//------------------------------------------------------------------------------------------------------------
// Methods
}
void wxMaracas_N_ViewersWidget::RefreshView()
- {
+ {
if (wxwindow1!=NULL) {wxwindow1->RefreshView(); }
if (wxwindow2!=NULL) {wxwindow2->RefreshView(); }
if (wxwindow3!=NULL) {wxwindow3->RefreshView(); }
}
//-------------------------------------------------------------------------
- void wxMaracas_N_ViewersWidget::Refresh(bool eraseBackground, const wxRect* rect )
- {
- wxPanel::Refresh(false);
- }
+ void wxMaracas_N_ViewersWidget::Refresh(bool eraseBackground, const wxRect* rect )
+ {
+ wxPanel::Refresh(false);
+ }
- void wxMaracas_N_ViewersWidget::UpdateLayout(vtkImageData* imagedata){
+ //-------------------------------------------------------------------------
+ void wxMaracas_N_ViewersWidget::UpdateLayout(vtkImageData* imagedata)
+ {
wxWindow *wxwindow = NULL;
- wxSizer *sizer = this->GetSizer();
+ wxSizer *sizer = this->GetSizer();
+
+ if (mvtkmprbasedata!=NULL)
+ {
+ delete mvtkmprbasedata;
+ }
+
+ marImageData *marimagedata = new marImageData( imagedata );
+ mvtkmprbasedata = new vtkMPRBaseData();
+ mvtkmprbasedata->SetMarImageData(marimagedata);
if(_currentwxw != NULL){
_currentwxw->Show(false);
//std::cout<<"size "<<nTypeView->size()<<std::endl;
if (nTypeView->size()==1)
{
- wxwindow1 = new wxMaracas_ViewerWidget(this, imagedata, (*nTypeView)[0]);
+ wxwindow1 = new wxMaracas_ViewerWidget(this, imagedata, (*nTypeView)[0],mvtkmprbasedata);
wxwindow1->ConfigureVTK();
wxwindow = wxwindow1;
}else if (nTypeView->size()==2) {
-
-
wxSplitterWindow *spliter = new wxSplitterWindow( this , -1);
- wxwindow1 = new wxMaracas_ViewerWidget(spliter, imagedata, (*nTypeView)[0]);
- wxwindow2 = new wxMaracas_ViewerWidget(spliter, imagedata, (*nTypeView)[1]);
+ spliter->SetMinimumPaneSize(1);
+ wxwindow1 = new wxMaracas_ViewerWidget(spliter, imagedata, (*nTypeView)[0],mvtkmprbasedata);
+ wxwindow2 = new wxMaracas_ViewerWidget(spliter, imagedata, (*nTypeView)[1],mvtkmprbasedata);
wxwindow1->ConfigureVTK();
wxwindow2->ConfigureVTK();
spliter -> SplitVertically( wxwindow1 , wxwindow2 );
{
wxSplitterWindow *spliter = new wxSplitterWindow( this , -1);
wxSplitterWindow *spliterA = new wxSplitterWindow( spliter , -1);
- wxwindow1 = new wxMaracas_ViewerWidget(spliter , imagedata, (*nTypeView)[0]);
- wxwindow2 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[1]);
- wxwindow3 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[2]);
+ spliter->SetMinimumPaneSize(1);
+ spliterA->SetMinimumPaneSize(1);
+ wxwindow1 = new wxMaracas_ViewerWidget(spliter , imagedata, (*nTypeView)[0],mvtkmprbasedata);
+ wxwindow2 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[1],mvtkmprbasedata);
+ wxwindow3 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[2],mvtkmprbasedata);
wxwindow1->ConfigureVTK();
wxwindow2->ConfigureVTK();
wxwindow3->ConfigureVTK();
wxSplitterWindow *spliter = new wxSplitterWindow( this , -1);
wxSplitterWindow *spliterA = new wxSplitterWindow( spliter , -1);
wxSplitterWindow *spliterB = new wxSplitterWindow( spliter , -1);
- wxwindow1 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[0]);
- wxwindow2 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[1]);
- wxwindow3 = new wxMaracas_ViewerWidget(spliterB, imagedata, (*nTypeView)[2]);
- wxwindow4 = new wxMaracas_ViewerWidget(spliterB, imagedata, (*nTypeView)[3]);
+ spliter->SetMinimumPaneSize(1);
+ spliterA->SetMinimumPaneSize(1);
+ spliterB->SetMinimumPaneSize(1);
+ wxwindow1 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[0],mvtkmprbasedata);
+ wxwindow2 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[1],mvtkmprbasedata);
+ wxwindow3 = new wxMaracas_ViewerWidget(spliterB, imagedata, (*nTypeView)[2],mvtkmprbasedata);
+ wxwindow4 = new wxMaracas_ViewerWidget(spliterB, imagedata, (*nTypeView)[3],mvtkmprbasedata);
wxwindow1->ConfigureVTK();
wxwindow2->ConfigureVTK();
wxwindow3->ConfigureVTK();
this->Refresh();
}
+
+//-----------------------------------------------------------------------------------
void wxMaracas_N_ViewersWidget::SetType(std::vector<int>* type){
nTypeView = type;
}
+
+
+
+//-----------------------------------------------------------------------------------
void wxMaracas_N_ViewersWidget::SetImage( vtkImageData *image )
{
if (wxwindow1!=NULL) {
}
-
+//-----------------------------------------------------------------------------------
double wxMaracas_N_ViewersWidget :: GetX()
{
- return wxwindow1->GetX();
+ return mvtkmprbasedata->GetX();
+// return wxwindow1->GetX();
}
+//-----------------------------------------------------------------------------------
double wxMaracas_N_ViewersWidget :: GetY()
{
- return wxwindow1->GetY();
+ return mvtkmprbasedata->GetY();
+// return wxwindow1->GetY();
}
+//-----------------------------------------------------------------------------------
double wxMaracas_N_ViewersWidget :: GetZ()
{
- return wxwindow1->GetZ();
+ return mvtkmprbasedata->GetZ();
+// return wxwindow1->GetZ();
}
-/*
-double wxMaracas_N_ViewersWidget :: GetZ(int iWin)
- {
- double answerVal = 0.0;
- if (iWin==1)
- {
- answerVal = wxwindow1->GetZ();
- }
- if (iWin==2)
- {
- answerVal = wxwindow2->GetZ();
- }
- if (iWin==3)
- {
- answerVal = wxwindow3->GetZ();
- }
- if (iWin==4)
- {
- answerVal = wxwindow4->GetZ();
- }
- return answerVal;
- }
-*/
Program: wxMaracas
Module: $RCSfile: wxMaracas_N_ViewersWidget.h,v $
Language: C++
- Date: $Date: 2009/05/14 13:54:35 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2009/06/05 06:07:39 $
+ Version: $Revision: 1.6 $
Copyright: (c) 2002, 2003
License:
std::vector<int> *nTypeView;
+ vtkMPRBaseData* mvtkmprbasedata;
+
DECLARE_EVENT_TABLE( );
};
Program: wxMaracas
Module: $RCSfile: wxMaracas_ViewerWidget.cxx,v $
Language: C++
- Date: $Date: 2009/05/14 13:54:35 $
- Version: $Revision: 1.12 $
+ Date: $Date: 2009/06/05 06:07:39 $
+ Version: $Revision: 1.13 $
Copyright: (c) 2002, 2003
License:
//------------------------------------------------------------------------------------------------------------
- wxMaracas_ViewerWidget::wxMaracas_ViewerWidget(wxWindow *parent, vtkImageData* imagedata, int type)
+ wxMaracas_ViewerWidget::wxMaracas_ViewerWidget(wxWindow *parent, vtkImageData* imagedata, int type, vtkMPRBaseData *vtkmprbasedata)
: wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL)
{
wxPanel *panel = this;
mType = type;
- marImageData *marimagedata = new marImageData( imagedata );
- mvtkmprbasedata = new vtkMPRBaseData();
- mvtkmprbasedata->SetMarImageData(marimagedata);
+
+ if (vtkmprbasedata==NULL)
+ {
+ minternalVtkmprbasedata = true;
+ mvtkmprbasedata = new vtkMPRBaseData();
+ marImageData *marimagedata = new marImageData( imagedata );
+ mvtkmprbasedata->SetMarImageData(marimagedata);
+ } else {
+ minternalVtkmprbasedata = false;
+ mvtkmprbasedata = vtkmprbasedata;
+ }
+
mvtk2Dbaseview = NULL;
mvtkmpr2Dview_X = NULL;
wxMaracas_ViewerWidget::~wxMaracas_ViewerWidget()
{
- if (mvtkmprbasedata) { delete mvtkmprbasedata; }
+
+ if (minternalVtkmprbasedata==true)
+ {
+ if (mvtkmprbasedata) { delete mvtkmprbasedata; }
+ }
+
if (mvtk2Dbaseview) { delete mvtk2Dbaseview; }
if (mvtkmpr2Dview_X) { delete mvtkmpr2Dview_X; }
if (mvtkmpr2Dview_Y) { delete mvtkmpr2Dview_Y; }
Program: wxMaracas
Module: $RCSfile: wxMaracas_ViewerWidget.h,v $
Language: C++
- Date: $Date: 2009/05/14 13:54:35 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2009/06/05 06:07:39 $
+ Version: $Revision: 1.6 $
Copyright: (c) 2002, 2003
License:
// Constructors & Destructors
//------------------------------------------------------------------------------------------------------------
- wxMaracas_ViewerWidget(wxWindow *parent, vtkImageData* imagedata, int type);
+ wxMaracas_ViewerWidget(wxWindow *parent, vtkImageData* imagedata, int type, vtkMPRBaseData *vtkmprbasedata=NULL);
~wxMaracas_ViewerWidget();
//------------------------------------------------------------------------------------------------------------
private:
int mType;
+ bool minternalVtkmprbasedata;
vtkMPRBaseData *mvtkmprbasedata;
wxVtk2DBaseView *mvtk2Dbaseview;
}
//----------------------------------------------------------------------------
-
+
void wxVtkBaseView::TransfromeCoordScreenToWorld(double &X, double &Y, double &Z, int type) // virtual
{
GetRenderer()->SetDisplayPoint((int)X, (int)Y, (int)Z);
}
*/
- if (_direction==0) {
+ if (_direction==0) { // YZ
camera->SetViewUp ( 0 , 1 , 0 );
camera->SetPosition ( 10000,(y1+y2)/2 , (z1+z2)/2 );
camera->SetFocalPoint ( 0 , (y1+y2)/2 , (z1+z2)/2 );
camera->SetParallelScale( (z2-z1)/3.0 );
}
- if (_direction==1) {
+ if (_direction==1) { // XZ
camera->SetViewUp ( 0 , 0 , -1 );
camera->SetPosition ((x1+x2)/2 , 10000 , (z1+z2)/2 );
camera->SetFocalPoint ((x1+x2)/2 , 0 , (z1+z2)/2 );
camera->SetParallelScale( (x2-x1)/3.0 );
}
- if (_direction==2) {
+ if (_direction==2) { // XY
camera->SetViewUp ( 0 , 1 , 0 );
camera->SetPosition ((x1+x2)/2 , (y1+y2)/2 , 10000);
camera->SetFocalPoint ((x1+x2)/2 , (y1+y2)/2 , 0 );
y = (int)(y*spc[1]);
z = (int)(z*spc[2]);
-
-
if ((x!=_backX) || (y!=_backY) || (z!=_backZ)) {
- if (_direction==0) {
+ if (_direction==0) { // YZ
_imageViewer2XYZ->SetXSlice( (int)(GetVtkmprbasedata()->GetX()) );
- _ptsA->SetPoint(0, -x2, y1 , z );
- _ptsA->SetPoint(1, -x2, y2 , z );
- _ptsB->SetPoint(0, -x2, y , z1);
- _ptsB->SetPoint(1, -x2, y , z2);
+ _ptsA->SetPoint(0, x2, y1 , z );
+ _ptsA->SetPoint(1, x2, y2 , z );
+ _ptsB->SetPoint(0, x2, y , z1);
+ _ptsB->SetPoint(1, x2, y , z2);
}
- if (_direction==1) {
+ if (_direction==1) { // XZ
_imageViewer2XYZ->SetYSlice( (int)(GetVtkmprbasedata()->GetY()) );
_ptsA->SetPoint(0, x1 , y2 , z );
_ptsA->SetPoint(1, x2 , y2 , z );
_ptsB->SetPoint(0, x , y2 , z1);
_ptsB->SetPoint(1, x , y2 , z2);
}
- if (_direction==2) {
+ if (_direction==2) { // XY
_imageViewer2XYZ->SetZSlice( (int)(GetVtkmprbasedata()->GetZ()) );
_imageViewer2XYZ->SetZSlice( (int)(GetVtkmprbasedata()->GetZ()) );
// _ptsA->SetPoint(0, x1 , y , -z2 );
}
Refresh();
}
+
//-------------------------------------------------------------------
-void wxVtkMPR2DView::TransfromeCoordViewWorld(double &X, double &Y, double &Z, int type) // virtual
+void wxVtkMPR2DView::TransfromeCoordScreenToWorld(double &X, double &Y, double &Z, int type) // virtual
{
+
wxVtkBaseView::TransfromeCoordScreenToWorld(X,Y,Z,_direction);
if (_direction==0)
void MoveY(double x, double y, double z);
void MoveZ(double x, double y, double z);
void ChangeAxisColor(double x, double y, double z);
- virtual void TransfromeCoordViewWorld(double &X, double &Y, double &Z, int type);
+// virtual void TransfromeCoordViewWorld(double &X, double &Y, double &Z, int type);
+ virtual void TransfromeCoordScreenToWorld(double &X, double &Y, double &Z, int type);
+
void SetVisibleAxis(bool ok);