transparenceBeforeAboveRange
-386.966824:85.119355:-900.000000
FIN_COMPLEX_PORT
-BOXES:47
+BOXES:48
BOX
creaMaracasVisu:SliceImage:Box00
ISEXEC:FALSE
-375.478516:-89.335399:-900.000000
-342.158516:-91.835399:-900.000000
FIN_BOX
-CONNECTIONS:74
+BOX
+std:MagicBox:Box89
+ISEXEC:FALSE
+-105.296409:65.122911:-900.000000
+-83.696409:62.622911:-900.000000
+FIN_BOX
+CONNECTIONS:76
CONNECTION
Box22:LookupTable:Box04:LookupTable
NumberOfControlPoints:0
SliceDeep:SliceDeep:Box60:In1
NumberOfControlPoints:0
CONNECTION
-SliceOpacity:SliceOpacity:Box04:Opacity
-NumberOfControlPoints:0
-CONNECTION
Render:Render:Box61:In
NumberOfControlPoints:0
CONNECTION
CONNECTION
Box32:Out:Box26:Transform
NumberOfControlPoints:0
+CONNECTION
+SliceOpacity:SliceOpacity:Box89:In
+NumberOfControlPoints:0
+CONNECTION
+Box89:Out:Box04:Opacity
+NumberOfControlPoints:0
+CONNECTION
+Box89:Out:Box26:Opacity
+NumberOfControlPoints:0
APP_END
new wx:LayoutLine Box88
+new std:MagicBox Box89
+
connect Box22.LookupTable Box04.LookupTable
connect Box32.Out Box04.Transform
connect Box86.Widget Box88.Widget1
connect Box87.Widget Box88.Widget2
connect Box32.Out Box26.Transform
+connect Box89.Out Box04.Opacity
+connect Box89.Out Box26.Opacity
# Complex input ports
input Direction Box40.In1 " "
input ColorBorder Box62.In1 " "
input Image Box38.In " "
input SliceDeep Box60.In1 " "
-input SliceOpacity Box04.Opacity " "
input Render Box61.In " "
input WindowColorLevel Box65.In1 " "
input BorderActive Box83.In " "
input Interpolation_mode Box78.In " "
input TypeTransparence Box84.In " "
input transparenceBeforeAboveRange Box85.In " "
+input SliceOpacity Box89.In " "
# Complex output ports
output BoxChangeImageSlice Box04.BoxChange " "
} // for i
// Step 1. All contours the same clockwise direction (Control Points)
- if (bbGetInputDoubleContour()==1)
+ if ((bbGetInputDoubleContour()==1) && (bbGetInputOpenClose()==true))
{
- ClockwisePoints( &lstInX , &lstInY , &lstInZ , &lstIndexsIn );
+ ClockwisePoints( &lstInX , &lstInY , &lstInZ , &lstIndexsIn ); // wich is the plane base XY? XZ ZY ??????
// ShiftValues( &lstInX , &lstInY , &lstInZ , &lstIndexsIn );
} // DoubleContour
size = lstIndexsIn.size();
{
if (mwxwidget!=NULL)
{
- printf("EED ShowNPoints::Process point: %d %d %d\n", bbGetInputIn()[0], bbGetInputIn()[1], bbGetInputIn()[2] );
mwxwidget->SetRenderer( bbGetInputRenderer() );
mwxwidget->SetReferencePoint( bbGetInputIn() );
mwxwidget->SetImage( bbGetInputImage() );
mwxwidget->SetColour( bbGetInputColour() );
mwxwidget->SetOpacity( bbGetInputOpacity() );
mwxwidget->SetRadio( bbGetInputRadio() );
+
+ if ( mwxwidget->GetModelShowNPoints()->GetFirstTime()==false )
+ {
+ mwxwidget->DetectCollectionActive();
+ }
+
if ( mwxwidget->GetModelShowNPoints()->GetFirstTime()==true )
{
mwxwidget->GetModelShowNPoints()->SetFirstTime(false);
mwxwidget->SetInitLstPoints( bbGetInputInitLstPointsX() , bbGetInputInitLstPointsY() , bbGetInputInitLstPointsZ() , bbGetInputInitLstLabels() );
}
+ mwxwidget->TrackPoint();
bbSetOutputlstPointsX( mwxwidget->GetLstPointsX() );
bbSetOutputlstPointsY( mwxwidget->GetLstPointsY() );
bbSetOutputlstPointsZ( mwxwidget->GetLstPointsZ() );
int id=-1;
int i, size=(int)( lstPointsX.size() );
double spc[3];
+ double radio2=(mradio+1)*(mradio+1);
if(mimage ==NULL)
{
printf("WidgetShowNPoints::IdInsidePoint image not set\n");
double rx = spc[0]*(mReferencePoint[0] - lstPointsX [i]);
double ry = spc[1]*(mReferencePoint[1] - lstPointsY [i]);
double rz = spc[2]*(mReferencePoint[2] - lstPointsZ [i]);
- if ( rx*rx + ry*ry + rz*rz <= mradio*mradio)
+ if ( rx*rx + ry*ry + rz*rz <= radio2)
{
id=i;
} // if
#include <wx/button.h>
-#include <wx/checkbox.h>
#include <wx/sizer.h>
#include <wx/filedlg.h>
#include <wx/msgdlg.h>
wxButton *btnAddPoint = new wxButton( panel, -1, _T("Add Point"));
wxButton *btnInsertPoint = new wxButton( panel, -1, _T("Insert Point"));//CFT
wxButton *btnSetPositionPoint= new wxButton( panel, -1, _T("Set nearest point"));
- wxCheckBox *chkBox = new wxCheckBox(panel, -1, _T("Track Point") );
+ cbTrackPoint = new wxCheckBox(panel,-1, _T("Track Point") );
wxButton *btnRenamePoint = new wxButton( panel, -1, _T("Rename point"));
wxButton *btnEraseLastPoint = new wxButton( panel, -1, _T("Erase Last point"));
wxButton *btnErasePoint = new wxButton( panel, -1, _T("Erase point"));
Connect(btnEraseLastPoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnEraseLastPoint);
Connect(btnErasePoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnErasePoint);
Connect(btnDeleteAllPoints->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnDeleteAllPoints);
+ Connect(cbTrackPoint->GetId() , wxEVT_CHECKBOX , (wxObjectEventFunction) &WidgetShowNPoints::OnTrackPoint);
wxFlexGridSizer *sizer1 = new wxFlexGridSizer(1);
sizer1->Add(textCtrl);
sizer1->Add(btnAddPoint);
sizer1->Add(btnInsertPoint);//CFT
- sizer1->Add(chkBox);
+ sizer1->Add(cbTrackPoint);
sizer1->Add(btnSetPositionPoint);
sizer1->Add(btnRenamePoint);
sizer1->Add(btnErasePoint);
} // dialog box
}
+
//------------------------------------------------------------------------
void WidgetShowNPoints::OnSetPoint(wxCommandEvent& event)
{
} // if id
SetOutputBox();
}
-
+
+//------------------------------------------------------------------------
+void WidgetShowNPoints::OnTrackPoint(wxCommandEvent& event)
+{
+ idTrack = -1;
+// trackPointFlag = cbTrackPoint->GetValue();
+ if ( cbTrackPoint->GetValue() == true )
+ {
+ idTrack = GetModelShowNPoints()->IdInsidePoint();
+ } // if trackPointFlag
+}
+
+//------------------------------------------------------------------------
+void WidgetShowNPoints::TrackPoint( )
+{
+ if ( cbTrackPoint->GetValue() == true )
+ {
+ int id = GetModelShowNPoints()->IdInsidePoint();
+ if (id>=0)
+ {
+ idTrack=id;
+ }
+
+ if (idTrack>=0)
+ {
+ GetModelShowNPoints()->SetPointId_mReferencePoint(idTrack);
+ GetViewShowNPoints()->RefreshPoint(idTrack);
+ GetViewShowNPoints()->Render();
+ } // if id
+ } // if trackPointFlag
+}
+
+//------------------------------------------------------------------------
+void WidgetShowNPoints::StopTrackPoint( )
+{
+ cbTrackPoint->SetValue(false);
+ idTrack=-1;
+}
+
+
//------------------------------------------------------------------------
void WidgetShowNPoints::OnRenamePoint(wxCommandEvent& event)
{
// EED 2022-05-19
//renderer->GetRenderWindow()->Render();
GetViewShowNPoints()->Render();
+ StopTrackPoint();
}
//------------------------------------------------------------------------
ErasePoint( id );
GetViewShowNPoints()->Render();
SetOutputBox();
+ StopTrackPoint();
}
//------------------------------------------------------------------------
{
InsertCollection();
RefreshColourCollection();
+ StopTrackPoint();
}
//------------------------------------------------------------------------
mActualCollection++;
InsertCollection();
RefreshColourCollection();
+ StopTrackPoint();
}
//------------------------------------------------------------------------
DeleteCollection_();
RefreshCollectionText();
RefreshColourCollection();
+ StopTrackPoint();
}
//------------------------------------------------------------------------
} //if <=0
RefreshCollectionText();
RefreshColourCollection();
+ StopTrackPoint();
}
//------------------------------------------------------------------------
} //if <=0
RefreshCollectionText();
RefreshColourCollection();
+ StopTrackPoint();
+}
+
+//------------------------------------------------------------------------
+void WidgetShowNPoints::DetectCollectionActive()
+{
+ int id;
+ int i,size=lstModelShowNPoints.size();
+ for (i=0;i<size;i++)
+ {
+ id = lstModelShowNPoints[i]->IdInsidePoint();
+ if (id>=0)
+ {
+ mActualCollection=i;
+ } // if id>=0
+ } // for i
+ RefreshCollectionText();
+ RefreshColourCollection();
}
//------------------------------------------------------------------------
} // dialog box
+ StopTrackPoint();
}
RefreshCollectionText();
RefreshColourCollection();
} // dialog box
+ StopTrackPoint();
}
#include <wx/textctrl.h>
#include <wx/slider.h>
#include <wx/stattext.h>
+#include <wx/checkbox.h>
+
class WidgetShowNPoints : public wxPanel
{
void OnAddPoint(wxCommandEvent &event);
void OnInsertPoint(wxCommandEvent& event);//CFT
void OnSetPoint(wxCommandEvent& event);
+ void OnTrackPoint(wxCommandEvent& event);
+ void TrackPoint();
+ void StopTrackPoint();
+ void DetectCollectionActive();
+
void OnRenamePoint(wxCommandEvent& event);
void OnErasePoint(wxCommandEvent& event);
void OnEraseLastPoint(wxCommandEvent &event);
- void OnDeleteAllPoints(wxCommandEvent &event);
+ void OnDeleteAllPoints(wxCommandEvent &event);
+
void OnSavePoints(wxCommandEvent &event);
void OnLoadPoints(wxCommandEvent &event);
//double mopacity;
std::vector<ViewShowNPoints*> lstViewShowNPoints;
+
//NTU: For updating points
wxStaticText * askPointLabel;
wxTextCtrl * textCtrl;
wxStaticText * txtNrPoints;
wxSlider * sdrOpacity;
wxSlider * sdrRadio;
+ wxCheckBox * cbTrackPoint;
std::vector<ModelShowNPoints*> lstModelShowNPoints;
int mtype;
int mActualCollection;
+// bool trackPointFlag;
+ int idTrack;
};