From e43741d4c329781aae3a071261bb92a8d5dc966c Mon Sep 17 00:00:00 2001 From: DUC ANH HOANG Date: Thu, 6 Jun 2024 16:02:11 +0200 Subject: [PATCH] export preselected_id to client --- .../CADRepresentations/CADRepresentation.xml | 8 ++++++++ .../CADRepresentations/vtkCADMapper.cxx | 7 +++++++ .../CADRepresentations/vtkCADMapper.h | 10 ++++++++++ .../CADRepresentations/vtkCADRepresentation.cxx | 6 ++++++ .../CADRepresentations/vtkCADRepresentation.h | 7 +++++++ 5 files changed, 38 insertions(+) diff --git a/src/Plugins/CADRepresentation/cadRepresentations/CADRepresentations/CADRepresentation.xml b/src/Plugins/CADRepresentation/cadRepresentations/CADRepresentations/CADRepresentation.xml index b79338f2..a56389f0 100644 --- a/src/Plugins/CADRepresentation/cadRepresentations/CADRepresentations/CADRepresentation.xml +++ b/src/Plugins/CADRepresentation/cadRepresentations/CADRepresentations/CADRepresentation.xml @@ -57,6 +57,14 @@ Enable or disable the Group Mode. + + + PreSelected solid ID + + diff --git a/src/Plugins/CADRepresentation/cadRepresentations/CADRepresentations/vtkCADMapper.cxx b/src/Plugins/CADRepresentation/cadRepresentations/CADRepresentations/vtkCADMapper.cxx index 636eded9..2c56d8fe 100644 --- a/src/Plugins/CADRepresentation/cadRepresentations/CADRepresentations/vtkCADMapper.cxx +++ b/src/Plugins/CADRepresentation/cadRepresentations/CADRepresentations/vtkCADMapper.cxx @@ -450,3 +450,10 @@ void vtkCADMapper::AddCellIdsToSelectionPrimitives(vtkPolyData* poly, const char this->ForceUpdate(); } } + +//---------------------------------------------------------------------------- + +vtkIdType vtkCADMapper::GetPreselectedId() +{ + return this->PreselectedCellId; +} diff --git a/src/Plugins/CADRepresentation/cadRepresentations/CADRepresentations/vtkCADMapper.h b/src/Plugins/CADRepresentation/cadRepresentations/CADRepresentations/vtkCADMapper.h index b819c48f..6459a909 100644 --- a/src/Plugins/CADRepresentation/cadRepresentations/CADRepresentations/vtkCADMapper.h +++ b/src/Plugins/CADRepresentation/cadRepresentations/CADRepresentations/vtkCADMapper.h @@ -103,6 +103,11 @@ public: */ void ResetSelection(); + /** + * Get PreSelected Id + */ + vtkIdType GetPreselectedId(); + protected: vtkCADMapper() = default; ~vtkCADMapper() = default; @@ -131,6 +136,11 @@ private: void AddCellIdsToSelectionPrimitives(vtkPolyData* poly, const char* arrayName, unsigned int processId, unsigned int compositeIndex, vtkIdType selectedId) override; + /** + * Get Selected Id list + */ + //vtkIdType GetSelectedId(); + /** * Initialise the primitive colors using color array stored in the input polydata. * Also initialize the opacity values (depending on current mode). diff --git a/src/Plugins/CADRepresentation/cadRepresentations/CADRepresentations/vtkCADRepresentation.cxx b/src/Plugins/CADRepresentation/cadRepresentations/CADRepresentations/vtkCADRepresentation.cxx index 656535b2..a39ae6a3 100644 --- a/src/Plugins/CADRepresentation/cadRepresentations/CADRepresentations/vtkCADRepresentation.cxx +++ b/src/Plugins/CADRepresentation/cadRepresentations/CADRepresentations/vtkCADRepresentation.cxx @@ -281,3 +281,9 @@ void vtkCADRepresentation::SetArrayIdNames(const char* pointArray, const char* c mapper->SetPointIdArrayName(pointArray ? pointArray : "vtkOriginalPointIds"); mapper->SetCellIdArrayName(cellArray ? cellArray : "vtkOriginalCellIds"); } + +//---------------------------------------------------------------------------- +vtkIdType vtkCADRepresentation::GetPreselectedId() +{ + return this->Mapper->GetPreselectedId(); +} \ No newline at end of file diff --git a/src/Plugins/CADRepresentation/cadRepresentations/CADRepresentations/vtkCADRepresentation.h b/src/Plugins/CADRepresentation/cadRepresentations/CADRepresentations/vtkCADRepresentation.h index 6f721113..928b9bb2 100644 --- a/src/Plugins/CADRepresentation/cadRepresentations/CADRepresentations/vtkCADRepresentation.h +++ b/src/Plugins/CADRepresentation/cadRepresentations/CADRepresentations/vtkCADRepresentation.h @@ -100,6 +100,13 @@ public: //void AddShape(vtkIdType groupId, vtkIdType cellId); void SetArrayIdNames(const char* pointArray, const char* cellArray) override; + + /** + * Get PreSelected Id + */ + + vtkIdType GetPreselectedId(); + protected: vtkCADRepresentation(); ~vtkCADRepresentation() = default; -- 2.39.2