From: vsr Date: Mon, 27 Jan 2020 15:54:27 +0000 (+0300) Subject: bos #17888 VTK viewer: scaling is not applied to GEOM objects X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Focc%2F17888;p=modules%2Fgeom.git bos #17888 VTK viewer: scaling is not applied to GEOM objects --- diff --git a/src/OBJECT/GEOM_Actor.cxx b/src/OBJECT/GEOM_Actor.cxx index dcda7f7c7..6d2cef064 100644 --- a/src/OBJECT/GEOM_Actor.cxx +++ b/src/OBJECT/GEOM_Actor.cxx @@ -1166,3 +1166,20 @@ void GEOM_Actor::SetWidth(const int width) { int GEOM_Actor::GetWidth() const { return (int)myIsolatedEdgeActor->GetProperty()->GetLineWidth(); } + +void GEOM_Actor::SetTransform(VTKViewer_Transform* theTransform) +{ + SALOME_Actor::SetTransform(theTransform); + + myVertexActor->SetTransform(theTransform); + myStandaloneVertexActor->SetTransform(theTransform); + myIsolatedEdgeActor->SetTransform(theTransform); + myOneFaceEdgeActor->SetTransform(theTransform); + mySharedEdgeActor->SetTransform(theTransform); + myWireframeFaceActor->SetTransform(theTransform); + myShadingFaceActor->SetTransform(theTransform); + myHighlightActor->SetTransform(theTransform); + //myTextActor->SetTransform(theTransform); + + Modified(); +} diff --git a/src/OBJECT/GEOM_Actor.h b/src/OBJECT/GEOM_Actor.h index fe7fd4e91..c449ceb15 100644 --- a/src/OBJECT/GEOM_Actor.h +++ b/src/OBJECT/GEOM_Actor.h @@ -80,6 +80,8 @@ public: void SetSelected(bool theIsSelected); bool IsSelected() const { return myIsSelected;} + void SetTransform(VTKViewer_Transform* theTransform); + // OLD METHODS // Properties void SetHighlightProperty(vtkProperty* Prop); diff --git a/src/OBJECT/GEOM_DeviceActor.cxx b/src/OBJECT/GEOM_DeviceActor.cxx index fd48878f1..307cbb15e 100644 --- a/src/OBJECT/GEOM_DeviceActor.cxx +++ b/src/OBJECT/GEOM_DeviceActor.cxx @@ -28,6 +28,7 @@ #include #include #include +#include #include vtkStandardNewMacro(GEOM_DeviceActor); @@ -118,3 +119,10 @@ RemoveFromRender(vtkRenderer* theRenderer) { theRenderer->RemoveActor(myActor.GetPointer()); } + +void +GEOM_DeviceActor:: +SetTransform(VTKViewer_Transform* theTransform) +{ + myActor->SetTransform(theTransform); +} diff --git a/src/OBJECT/GEOM_DeviceActor.h b/src/OBJECT/GEOM_DeviceActor.h index 4432592a9..7cdaab652 100644 --- a/src/OBJECT/GEOM_DeviceActor.h +++ b/src/OBJECT/GEOM_DeviceActor.h @@ -44,6 +44,7 @@ class vtkRenderer; #include class vtkAlgorithmOutput; +class VTKViewer_Transform; class VTK_EXPORT GEOM_DeviceActor: public vtkObject { @@ -66,6 +67,8 @@ public: void RemoveFromRender(vtkRenderer* theRenderer); PActor GetDeviceActor() {return myActor;} + + void SetTransform(VTKViewer_Transform* theTransform); protected: PPolyDataNormals myPolyDataNormals;