]> Creatis software - creaMaracasVisu.git/blob - bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.h
#3532 Split and order contours (Rotating Plane)
[creaMaracasVisu.git] / bbtk / src / bbcreaMaracasVisuShowNPoints_Tools.h
1 //===== 
2 // 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)
3 //===== 
4 #ifndef __bbcreaMaracasVisuShowNPoints_Tools_h_INCLUDED__
5 #define __bbcreaMaracasVisuShowNPoints_Tools_h_INCLUDED__
6
7 #include "bbcreaMaracasVisu_EXPORT.h"
8 #include "bbtkAtomicBlackBox.h"
9 #include "iostream"
10 #include <numeric>
11
12 #include "WidgetShowNPoints.h"
13
14
15 #include "vtkPolyData.h"
16 #include <vtkStaticPointLocator.h>
17
18 namespace bbcreaMaracasVisu
19 {
20
21 class bbcreaMaracasVisu_EXPORT ShowNPoints_Tools
22  : 
23    public bbtk::AtomicBlackBox
24 {
25   BBTK_BLACK_BOX_INTERFACE(ShowNPoints_Tools,bbtk::AtomicBlackBox);
26 //===== 
27 // 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)
28 //===== 
29     BBTK_DECLARE_INPUT(WidgetShowNPoints,WidgetShowNPoints*);
30     BBTK_DECLARE_INPUT(Spacing,std::vector<double>);
31     BBTK_DECLARE_INPUT(Mesh,vtkPolyData*);
32     BBTK_DECLARE_INPUT(Type,int);
33     BBTK_DECLARE_INPUT(Params, std::vector<double>);
34     BBTK_DECLARE_OUTPUT(Out, std::vector<double>);
35 //  BBTK_DECLARE_OUTPUT(Out,double);
36   BBTK_PROCESS(Process);
37   void Process();
38     
39     void CreatePatch_3points();
40     void CreatePatch_4points();
41     void InitCreatePatch_Points();
42     void InitCreateVolumeSurface_Points();
43     void CreatePatch_Points(std::vector<double> lstX, std::vector<double> lstY, std::vector<double> lstZ);
44     void NearestPointToMesh( vtkPoints *points, vtkStaticPointLocator   *pointLocator, double *spc , double *p , double *pM   );
45     void MovePatchCenter();
46     void ChangeCurrentPoint();
47     void CreateExpandedSurface();
48     void CreateWideExpandedSurface();
49     void ExpandSurfaceArea();
50     void WidenSurface();
51     void ExpandPatch();
52     void MovePointInNormal();
53     void JoinPoints();
54     void SetMesh();
55     void SeparateSplines();
56     std::vector<double> GetProjectionPointOnAxis(double pointToProject[3], double originAxis[3], double axisDir[3]);
57     std::vector<std::vector<std::vector<double>>> GetOrderedPointsAroundPlane(std::vector<double> planeOrigin, std::vector<double> planeNormal,  std::vector<double> rotAxis, std::vector<double> pX, std::vector<double> pY, std::vector<double> pZ);
58     std::vector<double> GetPlaneNormalFromPointsRefPoint(std::vector<double> pointsX, std::vector<double> pointsY, std::vector<double> pointsZ, std::vector<double> refPoint);
59
60 //===== 
61 // 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)
62 //===== 
63 };
64
65 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ShowNPoints_Tools,bbtk::AtomicBlackBox);
66 BBTK_NAME("ShowNPoints_Tools");
67 BBTK_AUTHOR("Info-Dev");
68 BBTK_DESCRIPTION("No Description.");
69 BBTK_CATEGORY("empty");
70   BBTK_INPUT(ShowNPoints_Tools,WidgetShowNPoints,"WidgetShowNPoints",WidgetShowNPoints*,"");
71   BBTK_INPUT(ShowNPoints_Tools,Spacing,"(default [1,1,1] )Spacing",std::vector<double>,"");
72   BBTK_INPUT(ShowNPoints_Tools,Mesh,"Mesh en format vtkPolyData ",vtkPolyData*,"");
73   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 (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",int,"");
74   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>,"");
75   
76   BBTK_OUTPUT(ShowNPoints_Tools, Out, "Output", std::vector<double>, "");
77 //  BBTK_OUTPUT(ShowNPoints_Tools,Out,"First output",double,"");
78 BBTK_END_DESCRIBE_BLACK_BOX(ShowNPoints_Tools);
79 //===== 
80 // 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)
81 //===== 
82 }
83 // EO namespace bbcreaMaracasVisu
84
85 #endif // __bbcreaMaracasVisuShowNPoints_Tools_h_INCLUDED__
86