From d62798277c1af1a852e7f036614bbeaeff25e171 Mon Sep 17 00:00:00 2001 From: ana Date: Mon, 16 Apr 2012 12:36:08 +0000 Subject: [PATCH] Fix previous wrong-tag commit --- src/SVTK/SVTK_View.cxx | 32 ++++++++++++++++++++++++++----- src/SVTK/SVTK_View.h | 11 ++++++++--- src/VTKViewer/VTKViewer_Actor.cxx | 15 +++++++++++++-- src/VTKViewer/VTKViewer_Actor.h | 9 +++++++-- 4 files changed, 55 insertions(+), 12 deletions(-) diff --git a/src/SVTK/SVTK_View.cxx b/src/SVTK/SVTK_View.cxx index 9702c2ebc..5db2c2349 100644 --- a/src/SVTK/SVTK_View.cxx +++ b/src/SVTK/SVTK_View.cxx @@ -746,17 +746,20 @@ SVTK_View /*! Change material \param theIObject - object - \param thePropF - property contained new properties of material + \param thePropF - property contained new properties of front material + \param thePropB - property contained new properties of back material */ void SVTK_View ::SetMaterial(const Handle(SALOME_InteractiveObject)& theIObject, - vtkProperty* thePropF) + vtkProperty* thePropF, + vtkProperty* thePropB) { using namespace SVTK; VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors()); std::vector aProps; aProps.push_back( thePropF ); + aProps.push_back( thePropB ); ForEachIf(aCopy.GetActors(), TIsSameIObject(theIObject), TSetFunction > @@ -766,11 +769,11 @@ SVTK_View /*! Get current front material \param theIObject - object - \return property contained material properties of the given object + \return property contained front material properties of the given object */ vtkProperty* SVTK_View -::GetMaterial(const Handle(SALOME_InteractiveObject)& theIObject) +::GetFrontMaterial(const Handle(SALOME_InteractiveObject)& theIObject) { using namespace SVTK; VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors()); @@ -778,7 +781,26 @@ SVTK_View Find(aCopy.GetActors(), TIsSameIObject(theIObject)); if(anActor) - return anActor->GetMaterial(); + return anActor->GetFrontMaterial(); + return NULL; +} + +/*! + Get current back material + \param theIObject - object + \return property contained back material properties of the given object +*/ +vtkProperty* +SVTK_View +::GetBackMaterial(const Handle(SALOME_InteractiveObject)& theIObject) +{ + using namespace SVTK; + VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors()); + SALOME_Actor* anActor = + Find(aCopy.GetActors(), + TIsSameIObject(theIObject)); + if(anActor) + return anActor->GetBackMaterial(); return NULL; } diff --git a/src/SVTK/SVTK_View.h b/src/SVTK/SVTK_View.h index fcceb6467..cff14c922 100644 --- a/src/SVTK/SVTK_View.h +++ b/src/SVTK/SVTK_View.h @@ -212,11 +212,16 @@ public: //! Change material void SetMaterial(const Handle(SALOME_InteractiveObject)& theIObject, - vtkProperty* thePropF); + vtkProperty* thePropF, + vtkProperty* thePropB); - //! Get current material + //! Get current front material vtkProperty* - GetMaterial(const Handle(SALOME_InteractiveObject)& theIObject); + GetFrontMaterial(const Handle(SALOME_InteractiveObject)& theIObject); + + //! Get current back material + vtkProperty* + GetBackMaterial(const Handle(SALOME_InteractiveObject)& theIObject); //---------------------------------------------------------------------------- // Erase Display functions diff --git a/src/VTKViewer/VTKViewer_Actor.cxx b/src/VTKViewer/VTKViewer_Actor.cxx index 7f51412c0..fd54a793a 100755 --- a/src/VTKViewer/VTKViewer_Actor.cxx +++ b/src/VTKViewer/VTKViewer_Actor.cxx @@ -621,15 +621,26 @@ VTKViewer_Actor } /*! - Get current material + Get current front material */ vtkProperty* VTKViewer_Actor -::GetMaterial() +::GetFrontMaterial() { return NULL; } +/*! + Get current back material +*/ +vtkProperty* +VTKViewer_Actor +::GetBackMaterial() +{ + return NULL; +} + + /*! \return display mode */ diff --git a/src/VTKViewer/VTKViewer_Actor.h b/src/VTKViewer/VTKViewer_Actor.h index 7e8b0a0ef..8ab7dc82a 100755 --- a/src/VTKViewer/VTKViewer_Actor.h +++ b/src/VTKViewer/VTKViewer_Actor.h @@ -124,10 +124,15 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor void SetMaterial(std::vector theProps); - //! Get current material + //! Get current front material virtual vtkProperty* - GetMaterial(); + GetFrontMaterial(); + + //! Get current back material + virtual + vtkProperty* + GetBackMaterial(); //---------------------------------------------------------------------------- // For selection mapping purpose -- 2.39.2