printf("PG ShowNPoints_Tools::MovePointInNormal No direction provided, must be 1 or -1");
return;
} // if Params
- int step=bbGetInputParams()[0];
+ int step = bbGetInputParams()[0];
WidgetShowNPoints *wsp = bbGetInputWidgetShowNPoints();
int idControlPoint = wsp->GetModelShowNPoints()->GetIdCurrentPoint() + step;
int size=wsp->GetModelShowNPoints()->GetLstPointsSize();
} // if Type
if (bbGetInputType()==35)
{
- printf("EED ShowNPoints_Tools::Process 35 size %d", bbGetInputParamsStr().size() );
if (bbGetInputParamsStr().size()==1)
{
- printf("EED ShowNPoints_Tools::Process 35 s:>%s<", bbGetInputParamsStr()[1].c_str() );
- std::string label = bbGetInputParamsStr()[1];
+ std::string label = bbGetInputParamsStr()[0];
bbGetInputWidgetShowNPoints()->OnRenamePoint_( label );
}
} // if Type
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 poits 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, Params,"Optional params for the tools, required for 200: normal and direction, 320: centroid and direction, 330: normal and direction, 340: centroid and direction, 400: reference point", std::vector<double>,"");
+ 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>,"");
BBTK_OUTPUT(ShowNPoints_Tools, Out, "Output", std::vector<double>, "");
mbbShowNPoints->bbSetOutputlstPointsZ( GetLstPointsZ() );
mbbShowNPoints->bbSetOutputlstLabels( GetLstLabels() );
mbbShowNPoints->bbSetOutputlstIndexs( GetLstIndexs() );
- mbbShowNPoints->bbSetOutputlstSelectedIndexs( GetLstSelectedIndexs() );
+ mbbShowNPoints->bbSetOutputlstSelectedIndexs( GetLstSelectedIndexs() ); // Get id Current Collection
+ mbbShowNPoints->bbSetOutputlstSelectedIdCurrentPoints( GetLstCurrentPoints() ); // Get id Current Point
// mbbShowNPoints->bbSetOutputlstPointsX( GetModelShowNPoints()->GetLstPointsX() );
// mbbShowNPoints->bbSetOutputlstPointsY( GetModelShowNPoints()->GetLstPointsY() );
// mbbShowNPoints->bbSetOutputlstPointsZ( GetModelShowNPoints()->GetLstPointsZ() );
} // if onshowwidget
_mwxwidget->AutoAddPoints();
_mwxwidget->TrackingPoint();
- bbSetOutputlstPointsX( _mwxwidget->GetLstPointsX() );
- bbSetOutputlstPointsY( _mwxwidget->GetLstPointsY() );
- bbSetOutputlstPointsZ( _mwxwidget->GetLstPointsZ() );
- bbSetOutputlstLabels( _mwxwidget->GetLstLabels() );
- bbSetOutputlstIndexs( _mwxwidget->GetLstIndexs() );
- bbSetOutputlstSelectedIndexs( _mwxwidget->GetLstSelectedIndexs() );
+ bbSetOutputlstPointsX( _mwxwidget->GetLstPointsX() );
+ bbSetOutputlstPointsY( _mwxwidget->GetLstPointsY() );
+ bbSetOutputlstPointsZ( _mwxwidget->GetLstPointsZ() );
+ bbSetOutputlstLabels( _mwxwidget->GetLstLabels() );
+ bbSetOutputlstIndexs( _mwxwidget->GetLstIndexs() );
+ bbSetOutputlstSelectedIndexs( _mwxwidget->GetLstSelectedIndexs() ); // Get id Current Collection
+ bbSetOutputlstSelectedIdCurrentPoints( _mwxwidget->GetLstCurrentPoints() ); // Get id Current Point
+
bbSetOutputWidgetShowNPoints( (WidgetShowNPoints*)_mwxwidget );
} // mwxwidget
}
BBTK_DECLARE_OUTPUT( lstLabels , std::vector<std::string> );
BBTK_DECLARE_OUTPUT( lstIndexs , std::vector<int> );
BBTK_DECLARE_OUTPUT( lstSelectedIndexs, std::vector<int> );
+ BBTK_DECLARE_OUTPUT( lstSelectedIdCurrentPoints, std::vector<int> );
+
+
+
BBTK_DECLARE_OUTPUT( WidgetShowNPoints, WidgetShowNPoints* );
BBTK_PROCESS(Process);
void Process();
BBTK_INPUT(ShowNPoints,InitLstIndexs,"Initial lst of indexs sizes",std::vector<int>,"");
BBTK_INPUT(ShowNPoints,Type,"Type of the widget. 0(default): N-points, 1:Just one point, 2:Add/DeleteAll points, 3:As 0 with out save/load option, 4 Multiple NPoints",int,"");
- BBTK_OUTPUT(ShowNPoints , lstPointsX , " list of points X " , std::vector<double> ,"" );
- BBTK_OUTPUT(ShowNPoints , lstPointsY , " list of points Y " , std::vector<double> ,"" );
- BBTK_OUTPUT(ShowNPoints , lstPointsZ , " list of points Z " , std::vector<double> ,"" );
- BBTK_OUTPUT(ShowNPoints , lstLabels , " list of labels " , std::vector<std::string> ,"" );
- BBTK_OUTPUT(ShowNPoints , lstIndexs , " list of index sizes " , std::vector<int> ,"" );
- BBTK_OUTPUT(ShowNPoints , lstSelectedIndexs , " list of points Z " , std::vector<int> ,"" );
- BBTK_OUTPUT(ShowNPoints , WidgetShowNPoints , " WidgetShowNPoints " , WidgetShowNPoints* ,"" );
+ BBTK_OUTPUT(ShowNPoints , lstPointsX , " list of points X " , std::vector<double> ,"" );
+ BBTK_OUTPUT(ShowNPoints , lstPointsY , " list of points Y " , std::vector<double> ,"" );
+ BBTK_OUTPUT(ShowNPoints , lstPointsZ , " list of points Z " , std::vector<double> ,"" );
+ BBTK_OUTPUT(ShowNPoints , lstLabels , " list of labels " , std::vector<std::string> ,"" );
+ BBTK_OUTPUT(ShowNPoints , lstIndexs , " list of index sizes " , std::vector<int> ,"" );
+ BBTK_OUTPUT(ShowNPoints , lstSelectedIndexs , " list id Current Collection ", std::vector<int> ,"" );
+ BBTK_OUTPUT(ShowNPoints , lstSelectedIdCurrentPoints , " list of id Current Points" , std::vector<int> ,"" );
+ BBTK_OUTPUT(ShowNPoints , WidgetShowNPoints , " WidgetShowNPoints " , WidgetShowNPoints* ,"" );
BBTK_END_DESCRIBE_BLACK_BOX(ShowNPoints);
}
//------------------------------------------------------------------------
int ModelShowNPoints::RenamePoint(std::string label)
{
- int id=IdInsidePoint();
+ int id = GetIdCurrentPoint();
+// int id = IdInsidePoint();
if (id>=0)
{
std::string strLabel = CleanSpaces( label );
renderer->AddActor( sphereActor );
// Actor
vtkTextActor3D *textActor = vtkTextActor3D::New();
+ textActor->SetOrientation(0,180,180);
// textActor->SetInput( strLabel.c_str() );
renderer->AddActor( textActor );
lstActorsText.push_back(textActor);
//AddVtkPoint();
//RefreshPoint(lstActorsSphere.size()-1);
GetViewShowNPoints()->AddPoint();
+ GetViewShowNPoints()->RefreshPoints();
}
//------------------------------------------------------------------------
return lstSelectedIndexs;
}
+//------------------------------------------------------------------------
+std::vector<int> WidgetShowNPoints::GetLstCurrentPoints()
+{
+ std::vector<int> lstCurrentPoints;
+ lstCurrentPoints.push_back( GetModelShowNPoints()->GetIdCurrentPoint() );
+ return lstCurrentPoints;
+}
+
//------------------------------------------------------------------------
int WidgetShowNPoints::GetLstModelShowNPointsSize()
{
std::vector<double> GetLstPointsZ();
std::vector<std::string> GetLstLabels();
std::vector<int> GetLstIndexs();
- std::vector<int> GetLstSelectedIndexs();
+ std::vector<int> GetLstSelectedIndexs(); // Get id Current Collection
+ std::vector<int> GetLstCurrentPoints(); // Get id Current point
protected:
#include "vtkInteractorStyleBaseView.h"
#include <vtkImageReslice.h>
#include "vtkTexture.h"
+#include "vtkTextProperty.h"
if(imageData){
if(_pointWidget==NULL)
{
- _pointWidget = vtkPointWidget::New();
+ _pointWidget = vtkPointWidget::New();
+ _text_x1 = vtkTextActor3D::New();
+ _text_x2 = vtkTextActor3D::New();
+ _text_y1 = vtkTextActor3D::New();
+ _text_y2 = vtkTextActor3D::New();
+ _text_z1 = vtkTextActor3D::New();
+ _text_z2 = vtkTextActor3D::New();
+ _text_x1->SetInput( "S" );
+ _text_x2->SetInput( "S" );
+ _text_y1->SetInput( "C" );
+ _text_y2->SetInput( "C" );
+ _text_z1->SetInput( "A" );
+ _text_z2->SetInput( "A" );
+ _text_x1->SetOrientation(0,180,180);
+ _text_y1->SetOrientation(0,180,180);
+ _text_z1->SetOrientation(0,180,180);
+ _text_x2->SetOrientation(0,180,180);
+ _text_y2->SetOrientation(0,180,180);
+ _text_z2->SetOrientation(0,180,180);
+ _text_x1->GetTextProperty()->ShadowOff();
+ _text_x2->GetTextProperty()->ShadowOff();
+ _text_y1->GetTextProperty()->ShadowOff();
+ _text_y2->GetTextProperty()->ShadowOff();
+ _text_z1->GetTextProperty()->ShadowOff();
+ _text_z2->GetTextProperty()->ShadowOff();
+ _text_x1->GetTextProperty()->SetFontFamilyToArial();
+ _text_x2->GetTextProperty()->SetFontFamilyToArial();
+ _text_y1->GetTextProperty()->SetFontFamilyToArial();
+ _text_y2->GetTextProperty()->SetFontFamilyToArial();
+ _text_z1->GetTextProperty()->SetFontFamilyToArial();
+ _text_z2->GetTextProperty()->SetFontFamilyToArial();
+
+ _text_x1->GetTextProperty()->SetOpacity(0);
+ _text_x2->GetTextProperty()->SetOpacity(0);
+ _text_y1->GetTextProperty()->SetOpacity(0);
+ _text_y2->GetTextProperty()->SetOpacity(0);
+ _text_z1->GetTextProperty()->SetOpacity(0);
+ _text_z2->GetTextProperty()->SetOpacity(0);
+ _text_x1->GetTextProperty()->SetFontSize(10);
+ _text_x2->GetTextProperty()->SetFontSize(10);
+ _text_y1->GetTextProperty()->SetFontSize(10);
+ _text_y2->GetTextProperty()->SetFontSize(10);
+ _text_z1->GetTextProperty()->SetFontSize(10);
+ _text_z2->GetTextProperty()->SetFontSize(10);
+ _wxvtk3Dbaseview->GetRenderer()->AddActor( _text_x1 );
+ _wxvtk3Dbaseview->GetRenderer()->AddActor( _text_x2 );
+ _wxvtk3Dbaseview->GetRenderer()->AddActor( _text_y1 );
+ _wxvtk3Dbaseview->GetRenderer()->AddActor( _text_y2 );
+ _wxvtk3Dbaseview->GetRenderer()->AddActor( _text_z1 );
+ _wxvtk3Dbaseview->GetRenderer()->AddActor( _text_z2 );
}
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
_planeWidget->SetRepresentationToOutline();
int dim[3];
imageData->GetDimensions(dim);
- int px=(dim[0]/2);
- int py=(dim[1]/2);
- int pz=(dim[2]/2);
- int dd=20;
+ int px = (dim[0]/2);
+ int py = (dim[1]/2);
+ int pz = (dim[2]/2);
+ int dd = 20;
_planeWidget->PlaceWidget( px-dd , px+dd , py-dd , py+dd , pz-dd , pz+dd );
if(_vtkplane==NULL)
{
//-------------------------------------------------------------------
void wxVtkMPR3DView::RefreshView() // virtual
{
+ int dim[3];
double spc[3];
vtkImageData *image = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
if(image)
{
image->GetSpacing(spc);
+ image->GetDimensions(dim);
}else{
spc[0] = 0;
spc[1] = 0;
_pointWidget->PlaceWidget();
_pointWidget->SetPosition( x,y,z );
+
+ _text_x1->SetPosition( 0-4 , y+5 , z ); // sagital
+ _text_y1->SetPosition( x-4 , 0 , z ); // coronal
+ _text_z1->SetPosition( x-4 , y+5 , -1 ); // axial
+
+ _text_x2->SetPosition( dim[0]*spc[0] , y+5 , z ); // sagital
+ _text_y2->SetPosition( x-4 , dim[1]*spc[1]+10 , z ); // coronal
+ _text_z2->SetPosition( x-4 , y+5 , dim[2]*spc[2]+1 ); // axial
+
double in[3];
double normal[3];
vtkTransform *transform = GetVtkMPR3DDataViewer ()->GetVtkMPRBaseData()->GetTransformOrientation();
if (visible==true)
{
_pointWidget->On();
+ _text_x1->GetTextProperty()->SetOpacity(1);
+ _text_x2->GetTextProperty()->SetOpacity(1);
+ _text_y1->GetTextProperty()->SetOpacity(1);
+ _text_y2->GetTextProperty()->SetOpacity(1);
+ _text_z1->GetTextProperty()->SetOpacity(1);
+ _text_z2->GetTextProperty()->SetOpacity(1);
+
} else {
_pointWidget->Off();
+ _text_x1->GetTextProperty()->SetOpacity(0);
+ _text_x2->GetTextProperty()->SetOpacity(0);
+ _text_y1->GetTextProperty()->SetOpacity(0);
+ _text_y2->GetTextProperty()->SetOpacity(0);
+ _text_z1->GetTextProperty()->SetOpacity(0);
+ _text_z2->GetTextProperty()->SetOpacity(0);
} // visible
} // _pointWidget
}
#include "vtkPointWidget.h"
#include "vtkImagePlaneWidget.h"
#include "vtkImageChangeInformation.h"
-
+#include "vtkTextActor3D.h"
//class vtkmyPWCallback_3DPointWidget;
class wxVtkMPR3DViewCntrlPanel;
// Point Widget (3D)
vtkPointWidget *_pointWidget;
+ vtkTextActor3D *_text_x1;
+ vtkTextActor3D *_text_x2;
+ vtkTextActor3D *_text_y1;
+ vtkTextActor3D *_text_y2;
+ vtkTextActor3D *_text_z1;
+ vtkTextActor3D *_text_z2;
+
//vtkmyPWCallback_3DPointWidget *_myCallback;
vtkProbeFilter *_probe;
vtkPolyDataMapper *_contourMapper;
_positionY = new wxSlider(panelSlice,-1,0,0,1, wxDefaultPosition, wxSize(2000,35), wxSL_HORIZONTAL | wxSL_LABELS);
_positionZ = new wxSlider(panelSlice,-1,0,0,1, wxDefaultPosition, wxSize(2000,35), wxSL_HORIZONTAL | wxSL_LABELS);
+ _ckBoxXYZ = new wxCheckBox(panelSlice,-1,_T("3D Axis "));
+ _ckBoxFixAxis2D = new wxCheckBox(panelSlice,-1,_T("2D Fix Axis"));
+
_ckBoxX = new wxCheckBox(panelConfig,-1,_T("X CL ")); // X plano YZ
_ckBoxY = new wxCheckBox(panelConfig,-1,_T("Y CL ")); // Y plano XZ
_ckBoxZ = new wxCheckBox(panelConfig,-1,_T("Z CL ")); // Z plano XY
_ckBoxY->SetValue(false);
_ckBoxZ->SetValue(false);
- _ckBoxXYZ = new wxCheckBox(panelConfig,-1,_T("3D Axis "));
- _ckBoxFixAxis2D = new wxCheckBox(panelConfig,-1,_T("2D Fix Axis"));
_opacityAxis = new wxSlider(panelConfig,-1,99,0,100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
_ckBoxPlane = new wxCheckBox(panelConfig,-1,_T("Plane"));
////EED 05Nov2012 _ckBox_BW_Color_Plane = new wxCheckBox(panel,-1,_T("GL/Color"));
if(align)
{
sizerSlice = new wxFlexGridSizer(4);
- sizerH4 = new wxFlexGridSizer(2);
+ sizerH4 = new wxFlexGridSizer(2);
sizerH4->Add( _ckFreePlaneX ,1, wxALL|wxEXPAND , 0);
sizerH4->Add( _positionX ,1, wxGROW , 0);
sizerH4->Add( _ckFreePlaneY ,1, wxALL|wxEXPAND , 0);
sizerH4->Add( _positionY ,1, wxGROW , 0);
sizerH4->Add( _ckFreePlaneZ ,1, wxALL|wxEXPAND , 0);
sizerH4->Add( _positionZ ,1, wxGROW , 0);
+
+ sizerH5a = new wxFlexGridSizer(3);
+ sizerH5a->Add( new wxStaticText(panelSlice, -1,_T(" ")) ,1, wxALL|wxEXPAND , 0);
+ sizerH5a->Add( _ckBoxXYZ ,1, wxALL|wxEXPAND , 0);
+ sizerH5a->Add( _ckBoxFixAxis2D ,1, wxALL|wxEXPAND , 0);
+
+ sizerH4->Add( new wxStaticText(panelSlice, -1,_T(" ")) ,1, wxALL|wxEXPAND , 0);
+ sizerH4->Add( new wxStaticText(panelSlice, -1,_T(" ")) ,1, wxALL|wxEXPAND , 0);
+ sizerH4->Add( new wxStaticText(panelSlice, -1,_T(" ")) ,1, wxALL|wxEXPAND , 0);
+ sizerH4->Add( sizerH5a ,1, wxALL|wxEXPAND , 0);
+
sizerSlice->Add( sizerH4, 1, wxGROW, 2);
sizerH8->Add( _ckBoxX ,0, wxALIGN_CENTER_VERTICAL|wxSHAPED , 0);
sizerH8->Add( _ckBoxZ ,0, wxALIGN_CENTER_VERTICAL|wxSHAPED , 0);
sizerH8->Add( _ckBoxY ,0, wxALIGN_CENTER_VERTICAL|wxSHAPED , 0);
- sizerH5a = new wxFlexGridSizer(3);
- sizerH5a->Add( _ckBoxXYZ ,1, wxALL|wxEXPAND , 0);
- sizerH5a->Add( _ckBoxFixAxis2D ,1, wxALL|wxEXPAND , 0);
sizerH5 = new wxFlexGridSizer(1);
sizerH5->Add( _ckBoxPlane , 1, wxALL|wxEXPAND , 0);
sizerH6->Add( panelH7 , 1, wxALL|wxEXPAND , 0);
sizerH6->Add( new wxStaticText(panelConfig, -1,_T(" ")) , 1, wxALL|wxEXPAND , 0);
sizerH6->Add( _ckBoxInterpolate ,1, wxALL|wxEXPAND , 0);
- sizerH6->Add( sizerH5a ,1, wxALL|wxEXPAND , 0);
+// sizerH6->Add( sizerH5a ,1, wxALL|wxEXPAND , 0);
sizerConfig->Add( sizerH5, 1, wxALL|wxEXPAND,2);
sizerConfig->Add( sizerH6, 1, wxALL|wxEXPAND,2);