@@ -38,51 +38,80 @@ PURPOSE. See the above copyright notices for more information.
3838#include < vtkPolyData.h>
3939#include < vtkRegularPolygonSource.h>
4040#include < QString>
41+ #include < QStringList>
4142
4243// The following header file is generated by CMake and thus it's located in
4344// the build directory. It provides an export macro for classes and functions
4445// that you want to be part of the public interface of your module.
4546#include < MitkCemrgAppModuleExports.h>
4647
47- class MITKCEMRGAPPMODULE_EXPORT CemrgMeshPointSelector {
48- public :
49- CemrgMeshPointSelector ();
48+ struct PointLabelData {
49+ int index; // Index of the point in the list
50+ QString pointName; // Name of the point
51+ int pointLabel; // Label assigned to the point
52+ bool labelSet; // Whether the label is set
53+ vtkIdType vtkId; // Associated VTK ID
54+ std::array<double , 3 > coordinates; // Point coordinates (x, y, z)
5055
51- void SetAvailableLabels (QStringList names, std::vector< int > labels);
52- bool AllLabelsSet ();
56+ PointLabelData ()
57+ : index(- 1 ), pointName( " " ), pointLabel(- 1 ), labelSet( false ), vtkId(- 1 ), coordinates{ 0.0 , 0.0 , 0.0 } {}
5358
54- void AddPointFromSurface (mitk::Surface::Pointer surface, int pickedSeedId);
59+ PointLabelData (QString name, int label)
60+ : index(-1 ), pointName(name), pointLabel(label), labelSet(false ), vtkId(-1 ), coordinates({0.0 , 0.0 , 0.0 }) {}
5561
56- void AddPoint (double *point, int pickedSeedId);
57- void PushBackLabel (int label);
58- void PushBackLabelFromAvailable (int index);
62+ PointLabelData operator =(const PointLabelData& other) {
63+ index = other.index ;
64+ pointName = other.pointName ;
65+ pointLabel = other.pointLabel ;
66+ labelSet = other.labelSet ;
67+ vtkId = other.vtkId ;
68+ coordinates = other.coordinates ;
5969
60- int CleanupLastPoint ();
61- void Clear ();
70+ return *this ;
71+ }
72+ };
6273
63- inline bool IsEmpty () { return seedIds-> GetNumberOfIds () == 0 ; };
64- inline int NumIds () { return seedIds-> GetNumberOfIds (); };
65- inline vtkSmartPointer<vtkPolyData> GetLineSeeds () { return lineSeeds; } ;
74+ class MITKCEMRGAPPMODULE_EXPORT CemrgMeshPointSelector {
75+ public:
76+ CemrgMeshPointSelector () ;
6677
67- std::string ToString ();
78+ bool IsEmpty ();
79+ void SetAvailableLabels (QStringList& names, std::vector<int >& labels);
80+ bool AllLabelsSet ();
6881
69- int FindLabel (QString name);
70- int FindIndex (int label);
71- std::vector<double > FindPoint (int index);
82+ int AddPickedIdToLabel (int pickedSeedId, int label);
83+ void AddPointFromSurface (mitk::Surface::Pointer surface, int pickedSeedId, int label);
7284
73- std::string PrintVtxFile (QString name);
74- std::string PrintCoordTxtFile (QString name);
85+ int CleanupLastPoint ();
86+ int UnsetLastPoint (); // returns las label
87+ void Clear ();
7588
76- void SaveToFile (QString path, Qstring name, QString type = " vtx " ) ;
89+ inline vtkSmartPointer<vtkPolyData> GetLineSeeds () { return lineSeeds; } ;
7790
78- private :
79- std::vector<int > seedLabels;
80- vtkSmartPointer<vtkIdList> seedIds;
81- vtkSmartPointer<vtkPolyData> lineSeeds;
91+ std::string ToString ();
8292
83- QStringList pointNames;
84- std::vector<int > availableLabels;
85- std::vector<int > labelSet;
93+ PointLabelData GetPointData (QString name);
94+ inline int FindLabel (QString name);
95+ int FindIndex (QString name);
96+ std::vector<double > FindPoint (QString name);
8697
87- // QStringList saveFiles;
88- };
98+ std::string PrintManyVtx (QStringList names);
99+ inline std::string PrintVtxFile (QString name) { return PrintManyVtx (QStringList (name)); };
100+
101+ std::string PrintManyCoordTxt (QStringList names);
102+ inline std::string PrintCoordTxtFile (QString name) { return PrintManyCoordTxt (QStringList (name)); };
103+
104+ void SaveToFile (QString path, QStringList names, QString type = " vtx" );
105+
106+ int GetLastLabelIndex ();
107+
108+ private:
109+
110+ // Data members
111+ vtkSmartPointer<vtkPolyData> lineSeeds;
112+ std::vector<PointLabelData> pointsData; // Consolidated data for points
113+
114+ // QStringList saveFiles;
115+ };
116+
117+ #endif // CemrgMeshPointSelector_h
0 commit comments