}
//----------------------------------------------------------------
-struct THighlightAction
+namespace SVTK
{
- bool myIsHighlight;
- THighlightAction( bool theIsHighlight ):
- myIsHighlight( theIsHighlight )
- {}
-
- void
- operator()( SALOME_Actor* theActor)
+ struct THighlightAction
{
- if(theActor->GetMapper() && theActor->hasIO()){
- theActor->Highlight( myIsHighlight );
+ bool myIsHighlight;
+ THighlightAction( bool theIsHighlight ):
+ myIsHighlight( theIsHighlight )
+ {}
+
+ void
+ operator()( SALOME_Actor* theActor)
+ {
+ if(theActor->GetMapper() && theActor->hasIO()){
+ theActor->Highlight( myIsHighlight );
+ }
}
- }
-};
+ };
+}
void
SVTK_SignalHandler
{
vtkActorCollection* anActors = myMainWindow->getRenderer()->GetActors();
- using namespace VTK;
+ using namespace SVTK;
ForEach<SALOME_Actor>(anActors,
THighlightAction( false ));
SVTK_Selector* aSelector = myMainWindow->GetSelector();
SVTK_View
::unHighlightAll()
{
- using namespace VTK;
+ using namespace SVTK;
ForEach<SALOME_Actor>(getRenderer()->GetActors(),
THighlightAction( false ));
Repaint();
bool theIsHighlight,
bool theIsUpdate )
{
- using namespace VTK;
+ using namespace SVTK;
ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
TIsSameIObject<SALOME_Actor>( theIO ),
THighlightAction(theIsHighlight));
SVTK_View
::isInViewer(const Handle(SALOME_InteractiveObject)& theIObject)
{
- using namespace VTK;
+ using namespace SVTK;
SALOME_Actor* anActor =
Find<SALOME_Actor>(getRenderer()->GetActors(),
TIsSameIObject<SALOME_Actor>(theIObject));
SVTK_View
::isVisible(const Handle(SALOME_InteractiveObject)& theIObject)
{
- using namespace VTK;
+ using namespace SVTK;
SALOME_Actor* anActor =
Find<SALOME_Actor>(getRenderer()->GetActors(),
TIsSameIObject<SALOME_Actor>(theIObject));
::rename(const Handle(SALOME_InteractiveObject)& theIObject,
const QString& theName)
{
- using namespace VTK;
+ using namespace SVTK;
ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
TIsSameIObject<SALOME_Actor>(theIObject),
TSetFunction<SALOME_Actor,const char*,QString>
::SetDisplayMode(const Handle(SALOME_InteractiveObject)& theIObject,
int theMode)
{
- using namespace VTK;
+ using namespace SVTK;
ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
TIsSameIObject<SALOME_Actor>(theIObject),
TSetFunction<SALOME_Actor,int>
SVTK_View
::ChangeRepresentationToWireframe(vtkActorCollection* theCollection)
{
- using namespace VTK;
+ using namespace SVTK;
ForEach<SALOME_Actor>(theCollection,
TSetFunction<SALOME_Actor,int>
(&SALOME_Actor::setDisplayMode,0));
SVTK_View
::ChangeRepresentationToSurface(vtkActorCollection* theCollection)
{
- using namespace VTK;
+ using namespace SVTK;
ForEach<SALOME_Actor>(theCollection,
TSetFunction<SALOME_Actor,int>
(&SALOME_Actor::setDisplayMode,1));
}
//----------------------------------------------------------------------------
-struct TErase
-{
- VTK::TSetFunction<vtkActor,int> mySetFunction;
- TErase():
- mySetFunction(&vtkActor::SetVisibility,false)
- {}
- void operator()(SALOME_Actor* theActor){
- theActor->SetVisibility(false);
- // Erase dependent actors
- vtkActorCollection* aCollection = vtkActorCollection::New();
- theActor->GetChildActors(aCollection);
- VTK::ForEach<vtkActor>(aCollection,mySetFunction);
- aCollection->Delete();
- }
-};
+namespace SVTK
+{
+ struct TErase
+ {
+ VTK::TSetFunction<vtkActor,int> mySetFunction;
+ TErase():
+ mySetFunction(&vtkActor::SetVisibility,false)
+ {}
+ void
+ operator()(SALOME_Actor* theActor)
+ {
+ theActor->SetVisibility(false);
+ // Erase dependent actors
+ vtkActorCollection* aCollection = vtkActorCollection::New();
+ theActor->GetChildActors(aCollection);
+ VTK::ForEach<vtkActor>(aCollection,mySetFunction);
+ aCollection->Delete();
+ }
+ };
+}
void
SVTK_View
::EraseAll()
{
- using namespace VTK;
+ using namespace SVTK;
ForEach<SALOME_Actor>(getRenderer()->GetActors(),
TErase());
Repaint();
SVTK_View
::DisplayAll()
{
- using namespace VTK;
+ using namespace SVTK;
ForEach<SALOME_Actor>(getRenderer()->GetActors(),
TSetVisibility<SALOME_Actor>(true));
Repaint();
::Erase(const Handle(SALOME_InteractiveObject)& theIObject,
bool theIsUpdate)
{
- using namespace VTK;
+ using namespace SVTK;
ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
TIsSameIObject<SALOME_Actor>(theIObject),
TErase());
::Display(const Handle(SALOME_InteractiveObject)& theIObject,
bool theIsUpdate)
{
- using namespace VTK;
+ using namespace SVTK;
ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
TIsSameIObject<SALOME_Actor>(theIObject),
TSetVisibility<SALOME_Actor>(true));
//----------------------------------------------------------------------------
-struct TRemoveAction
-{
- SVTK_Renderer* myRenderer;
- TRemoveAction(SVTK_Renderer* theRenderer):
- myRenderer(theRenderer)
- {}
- void
- operator()(SALOME_Actor* theActor)
+namespace SVTK
+{
+ struct TRemoveAction
{
- myRenderer->RemoveActor(theActor);
- }
-};
+ SVTK_Renderer* myRenderer;
+ TRemoveAction(SVTK_Renderer* theRenderer):
+ myRenderer(theRenderer)
+ {}
+ void
+ operator()(SALOME_Actor* theActor)
+ {
+ myRenderer->RemoveActor(theActor);
+ }
+ };
+}
void
SVTK_View
::Remove(const Handle(SALOME_InteractiveObject)& theIObject,
bool theIsUpdate)
{
- using namespace VTK;
+ using namespace SVTK;
ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
TIsSameIObject<SALOME_Actor>(theIObject),
TRemoveAction(GetRenderer()));
SVTK_View
::GetTransparency(const Handle(SALOME_InteractiveObject)& theIObject)
{
- using namespace VTK;
+ using namespace SVTK;
SALOME_Actor* anActor =
Find<SALOME_Actor>(getRenderer()->GetActors(),
TIsSameIObject<SALOME_Actor>(theIObject));
float theTrans)
{
float anOpacity = 1.0 - theTrans;
- using namespace VTK;
+ using namespace SVTK;
ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
TIsSameIObject<SALOME_Actor>(theIObject),
TSetFunction<SALOME_Actor,float>
{
float aColor[3] = {theColor.red()/255., theColor.green()/255., theColor.blue()/255.};
- using namespace VTK;
+ using namespace SVTK;
ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
TIsSameIObject<SALOME_Actor>(theIObject),
TSetFunction<SALOME_Actor,const float*>
SVTK_View
::GetColor(const Handle(SALOME_InteractiveObject)& theIObject)
{
- using namespace VTK;
+ using namespace SVTK;
SALOME_Actor* anActor =
Find<SALOME_Actor>(getRenderer()->GetActors(),
TIsSameIObject<SALOME_Actor>(theIObject));