mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-24 13:50:34 +05:00
Fix for '#17888 [CEA 17919] VTK Viewer - Scaling'.
This commit is contained in:
parent
11cbc17d51
commit
090649639c
@ -1166,3 +1166,19 @@ void GEOM_Actor::SetWidth(const int width) {
|
|||||||
int GEOM_Actor::GetWidth() const {
|
int GEOM_Actor::GetWidth() const {
|
||||||
return (int)myIsolatedEdgeActor->GetProperty()->GetLineWidth();
|
return (int)myIsolatedEdgeActor->GetProperty()->GetLineWidth();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GEOM_Actor::SetTransform(VTKViewer_Transform* theTransform)
|
||||||
|
{
|
||||||
|
Superclass::SetTransform(theTransform);
|
||||||
|
|
||||||
|
myStandaloneVertexActor->SetTransform(theTransform);
|
||||||
|
myStandaloneVertexActor->SetTransform(theTransform);
|
||||||
|
myIsolatedEdgeActor->SetTransform(theTransform);
|
||||||
|
myOneFaceEdgeActor->SetTransform(theTransform);
|
||||||
|
mySharedEdgeActor->SetTransform(theTransform);
|
||||||
|
myWireframeFaceActor->SetTransform(theTransform);
|
||||||
|
myShadingFaceActor->SetTransform(theTransform);
|
||||||
|
myHighlightActor->SetTransform(theTransform);
|
||||||
|
|
||||||
|
Modified();
|
||||||
|
}
|
||||||
|
@ -222,6 +222,11 @@ public:
|
|||||||
bool
|
bool
|
||||||
GetNameMode();
|
GetNameMode();
|
||||||
|
|
||||||
|
virtual
|
||||||
|
void
|
||||||
|
SetTransform(VTKViewer_Transform* theTransform);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void SetModified();
|
void SetModified();
|
||||||
|
|
||||||
|
@ -26,20 +26,26 @@
|
|||||||
#include <vtkStripper.h>
|
#include <vtkStripper.h>
|
||||||
#include <vtkPolyDataMapper.h>
|
#include <vtkPolyDataMapper.h>
|
||||||
#include <vtkPolyDataNormals.h>
|
#include <vtkPolyDataNormals.h>
|
||||||
#include <vtkActor.h>
|
#include <vtkActor.h>
|
||||||
#include <VTKViewer_Actor.h>
|
|
||||||
#include <vtkRenderer.h>
|
#include <vtkRenderer.h>
|
||||||
|
|
||||||
|
#include <VTKViewer_Actor.h>
|
||||||
|
#include <VTKViewer_Transform.h>
|
||||||
|
#include <VTKViewer_TransformFilter.h>
|
||||||
|
|
||||||
|
|
||||||
vtkStandardNewMacro(GEOM_DeviceActor);
|
vtkStandardNewMacro(GEOM_DeviceActor);
|
||||||
|
|
||||||
GEOM_DeviceActor::GEOM_DeviceActor():
|
GEOM_DeviceActor::GEOM_DeviceActor() :
|
||||||
myStripper(vtkStripper::New(),true),
|
myStripper(vtkStripper::New(), true),
|
||||||
myPolyDataMapper(vtkPolyDataMapper::New(),true),
|
myPolyDataMapper(vtkPolyDataMapper::New(), true),
|
||||||
myPolyDataNormals(vtkPolyDataNormals::New(),true),
|
myPolyDataNormals(vtkPolyDataNormals::New(), true),
|
||||||
myActor(VTKViewer_Actor::New(),true)
|
myActor(VTKViewer_Actor::New(), true),
|
||||||
|
myTransformFilter(VTKViewer_TransformFilter::New())
|
||||||
{
|
{
|
||||||
myStripper->SetInputConnection(myPolyDataNormals->GetOutputPort());
|
myStripper->SetInputConnection(myPolyDataNormals->GetOutputPort());
|
||||||
myPolyDataMapper->SetInputConnection(myStripper->GetOutputPort());
|
myTransformFilter->SetInputConnection(myStripper->GetOutputPort());
|
||||||
|
myPolyDataMapper->SetInputConnection(myTransformFilter->GetOutputPort());
|
||||||
|
|
||||||
myActor->SetMapper(myPolyDataMapper.Get());
|
myActor->SetMapper(myPolyDataMapper.Get());
|
||||||
myActor->PickableOff();
|
myActor->PickableOff();
|
||||||
@ -56,11 +62,13 @@ SetInput(vtkAlgorithmOutput* thePolyData, bool theUseStripper)
|
|||||||
if(theUseStripper)
|
if(theUseStripper)
|
||||||
{
|
{
|
||||||
myPolyDataNormals->SetInputConnection(thePolyData);
|
myPolyDataNormals->SetInputConnection(thePolyData);
|
||||||
myStripper->SetInputConnection(myPolyDataNormals->GetOutputPort());
|
myStripper->SetInputConnection(myPolyDataNormals->GetOutputPort());
|
||||||
myPolyDataMapper->SetInputConnection(myStripper->GetOutputPort());
|
myTransformFilter->SetInputConnection(myStripper->GetOutputPort());
|
||||||
|
myPolyDataMapper->SetInputConnection(myTransformFilter->GetOutputPort());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
myPolyDataMapper->SetInputConnection(thePolyData);
|
myTransformFilter->SetInputConnection(thePolyData);
|
||||||
|
myPolyDataMapper->SetInputConnection(myTransformFilter->GetOutputPort());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -118,3 +126,10 @@ RemoveFromRender(vtkRenderer* theRenderer)
|
|||||||
{
|
{
|
||||||
theRenderer->RemoveActor(myActor.GetPointer());
|
theRenderer->RemoveActor(myActor.GetPointer());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
GEOM_DeviceActor
|
||||||
|
::SetTransform(VTKViewer_Transform* theTransform)
|
||||||
|
{
|
||||||
|
myTransformFilter->SetTransform(theTransform);
|
||||||
|
}
|
||||||
|
@ -36,7 +36,10 @@ typedef GEOM_SmartPtr<vtkPolyDataNormals> PPolyDataNormals;
|
|||||||
|
|
||||||
//class vtkActor;
|
//class vtkActor;
|
||||||
class VTKViewer_Actor;
|
class VTKViewer_Actor;
|
||||||
|
class VTKViewer_Transform;
|
||||||
|
class VTKViewer_TransformFilter;
|
||||||
typedef GEOM_SmartPtr<VTKViewer_Actor> PActor;
|
typedef GEOM_SmartPtr<VTKViewer_Actor> PActor;
|
||||||
|
typedef GEOM_SmartPtr<VTKViewer_TransformFilter> PTransformFilter;
|
||||||
|
|
||||||
class vtkProperty;
|
class vtkProperty;
|
||||||
class vtkRenderer;
|
class vtkRenderer;
|
||||||
@ -66,12 +69,15 @@ public:
|
|||||||
void RemoveFromRender(vtkRenderer* theRenderer);
|
void RemoveFromRender(vtkRenderer* theRenderer);
|
||||||
|
|
||||||
PActor GetDeviceActor() {return myActor;}
|
PActor GetDeviceActor() {return myActor;}
|
||||||
|
|
||||||
|
virtual void SetTransform(VTKViewer_Transform* theTransform);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
PPolyDataNormals myPolyDataNormals;
|
PPolyDataNormals myPolyDataNormals;
|
||||||
PPolyDataMapper myPolyDataMapper;
|
PPolyDataMapper myPolyDataMapper;
|
||||||
PStripper myStripper;
|
PStripper myStripper;
|
||||||
PActor myActor;
|
PActor myActor;
|
||||||
|
PTransformFilter myTransformFilter;
|
||||||
|
|
||||||
GEOM_DeviceActor();
|
GEOM_DeviceActor();
|
||||||
~GEOM_DeviceActor();
|
~GEOM_DeviceActor();
|
||||||
|
Loading…
Reference in New Issue
Block a user