# ----------------------------------
# - BBTKGEditor v 1.5 BBG BlackBox Diagram file
-# - /Users/davila/Creatis/C23/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbg
+# - /home/garzon/Creatis/C23/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbg
# ----------------------------------
APP_START
-265.790737:67.872984:-900.000000
-237.750737:65.372984:-900.000000
PORT
-In0:"0 1 2 3 4 5 6 7 8 9 10 11"
+In0:"0 1 2 3 4 5 6 7 8 9 10 11 12"
PORT
-In1:"1 5 10 20 30 40 50 0 100 110 205 210"
+In1:"1 5 10 20 30 40 50 0 100 110 205 210 240"
PORT
Type:"2"
FIN_BOX
-278.644612:87.294401:-900.000000
PORT
In0:"Tool - Inverse Normals"
+PORT
+In1:"Tool - Join start and end points to current spline"
FIN_BOX
BOX
creaMaracasVisu:ShowNPoints_Tools:Box116
# ----------------------------------
# - BBTKGEditor v 1.5 BBS BlackBox Script (Complex Box)
-# - /Users/davila/Creatis/C23/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbs
+# - /home/garzon/Creatis/C23/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbs
# ----------------------------------
include std
set Box99.In0 "Auto Add Points (Start/Stop)"
new std:VectorFilterString Box100
- set Box100.In0 "0 1 2 3 4 5 6 7 8 9 10 11"
- set Box100.In1 "1 5 10 20 30 40 50 0 100 110 205 210"
+ set Box100.In0 "0 1 2 3 4 5 6 7 8 9 10 11 12"
+ set Box100.In1 "1 5 10 20 30 40 50 0 100 110 205 210 240"
set Box100.Type "2"
new std:ConcatStrings Box101
new std:AddStringToVector Box115
set Box115.In0 "Tool - Inverse Normals"
+ set Box115.In1 "Tool - Join start and end points to current spline"
new creaMaracasVisu:ShowNPoints_Tools Box116
set Box116.BoxProcessMode "Manual"
}
}
+
+void ShowNPoints_Tools::JoinPoints()
+{
+ WidgetShowNPoints* wsp = bbGetInputWidgetShowNPoints();
+ wsp->StopAutoAddPoints();
+ wsp->StopTrackPoint();
+ if((wsp->GetLstModelShowNPointsSize()>=2)
+ && (wsp->GetModelShowNPoints()->GetLstPointsSize()>0))
+ {
+ int numberOfSplines = wsp->GetLstModelShowNPointsSize();
+ double x, y, z;
+ int sizeCurrentSpline, i;
+ wsp->GetModelShowNPoints()->GetIdPoint(0, &x, &y, &z);
+ std::vector<double> pointStart = {x, y, z};
+ sizeCurrentSpline = wsp->GetModelShowNPoints()->GetLstPointsX().size();
+ wsp->GetModelShowNPoints()->GetIdPoint(sizeCurrentSpline-1, &x, &y, &z);
+ std::vector<double> pointEnd = {x, y, z};
+ for(i = 0; i < numberOfSplines; i++){
+ sizeCurrentSpline = wsp->GetModelShowNPoints(i)->GetLstPointsX().size();
+ wsp->SetCollectionPoint(i, 0, pointStart);
+ wsp->SetCollectionPoint(i, sizeCurrentSpline-1, pointEnd);
+ }
+ wsp->SetOutputBox();
+ wsp->UndoRedo_SaveCollection();
+ }
+}
//=====
// 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)
//=====
{
MovePointInNormal();
} // if Type
+ if(bbGetInputType()==240)
+ {
+ JoinPoints();
+ } // if Type
if(bbGetInputType()==300)
{
CreateExpandedSurface();
void WidenSurface();
void ExpandPatch();
void MovePointInNormal();
+ void JoinPoints();
//=====
// 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_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 poits 5:Add Point 10:Insert Point 20:TrackPoint 30:Set nearest point 40:Erase point 50:Deleta all points 100:Insert group after 110:Delete group 120:Reset colletion 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 300: Create expanded surface 310: Create wide expanded surface 320: Expand Surface, 330: Widen surface, 340: Expand patch",int,"");
+ 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 40:Erase point 50:Deleta all points 100:Insert group after 110:Delete group 120:Reset colletion 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 230: Move point in normal of surface 240: Join all start-end points to the start-end points on selected spline 300: Create expanded surface 310: Create wide expanded surface 320: Expand Surface, 330: Widen surface, 340: Expand patch",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", std::vector<double>,"");
BBTK_OUTPUT(ShowNPoints_Tools, Out, "Output", std::vector<double>, "");
return lstModelShowNPoints[ mActualCollection ];
}
+//------------------------------------------------------------------------
+ModelShowNPoints* WidgetShowNPoints::GetModelShowNPoints(int id)
+{
+ if(id >= 0 && id < lstModelShowNPoints.size())
+ {
+ return lstModelShowNPoints[ id ];
+ }
+}
+
// EED 2022-05-19
//------------------------------------------------------------------------
ViewShowNPoints* WidgetShowNPoints::GetViewShowNPoints()
int GetLstModelShowNPointsSize();
ModelShowNPoints* GetModelShowNPoints();
+ ModelShowNPoints* GetModelShowNPoints(int id);
ViewShowNPoints* GetViewShowNPoints();
void SetInitLstPoints( std::vector<double> initLstPointsX, std::vector<double> initLstPointsY, std::vector<double> initLstPointsZ, std::vector<std::string> initLstLabels, std::vector<int> initLstIndexs );