-// VISU OBJECT : interactive object for VISU entities implementation
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// VISU OBJECT : interactive object for VISU entities implementation
// File : VISU_MeshAct.cxx
-// Author : Laurent CORNABE with the help of Nicolas REJNERI
+// Author :
// Module : VISU
// $Header$
-
+//
#include "VISU_MeshAct.h"
-#include "SALOME_PassThroughFilter.h"
+
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+
+#include <vtkObjectFactory.h>
+#include <vtkRenderer.h>
+#include <vtkTexture.h>
#include <vtkFeatureEdges.h>
#include <vtkDataSetMapper.h>
#include <vtkDataSet.h>
#include <vtkMatrix4x4.h>
-#include <vtkMapperCollection.h>
+#include <vtkMapperCollection.h>
+
+//----------------------------------------------------------------------------
vtkStandardNewMacro(VISU_MeshAct);
-VISU_MeshAct::VISU_MeshAct(){
-
+
+//----------------------------------------------------------------------------
+VISU_MeshAct
+::VISU_MeshAct()
+{
vtkMatrix4x4 *m;
m = vtkMatrix4x4::New();
- mySurfaceActor = VISU_Actor::New();
- mySurfaceActor->SetParent(this);
- mySurfaceActor->GetProperty()->FrontfaceCullingOff();
- mySurfaceActor->GetProperty()->BackfaceCullingOff();
+ mySurfaceActor = SVTK_DeviceActor::New();
+ mySurfaceActor->SetRepresentation(VTKViewer::Representation::Surface);
mySurfaceActor->SetUserMatrix(m);
- mySurfaceActor->SetRepresentation(2); //SURFACE
-
- myEdgeActor = VISU_Actor::New();
- myEdgeActor->SetParent(this);
- myEdgeActor->PickableOff();
- myEdgeActor->GetProperty()->FrontfaceCullingOff();
- myEdgeActor->GetProperty()->BackfaceCullingOff();
+ mySurfaceActor->SetCoincident3DAllowed(true);
+
+ myEdgeActor = SVTK_DeviceActor::New();
+ myEdgeActor->SetRepresentation(VTKViewer::Representation::Wireframe);
myEdgeActor->SetUserMatrix(m);
- myEdgeActor->SetRepresentation(1); //WIREFRAME
-
- myNodeActor = VISU_Actor::New();
- myNodeActor->SetParent(this);
- myNodeActor->PickableOff();
- myNodeActor->GetProperty()->SetPointSize(SALOME_POINT_SIZE);
- myNodeActor->GetProperty()->FrontfaceCullingOff();
- myNodeActor->GetProperty()->BackfaceCullingOff();
+ myEdgeActor->SetCoincident3DAllowed(true);
+
+ myNodeActor = SVTK_DeviceActor::New();
+ myNodeActor->SetRepresentation(VTKViewer::Representation::Points);
myNodeActor->SetUserMatrix(m);
- myNodeActor->SetRepresentation(0); //POINT
m->Delete();
- SetRepresentation(2); //SURFACE
+ SetRepresentation(VTKViewer::Representation::Surface);
+
+ SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
+ //Quadratic 2D elements representation
+ if(aResourceMgr) {
+ //----------------------------------------------------------------------------
+ int aQuadraticAngle = aResourceMgr->integerValue( "VISU", "max_angle", 2);
+ mySurfaceActor->SetQuadraticArcAngle(aQuadraticAngle);
+ myEdgeActor->SetQuadraticArcAngle(aQuadraticAngle);
+
+ int anElem0DSize = aResourceMgr->integerValue( "VISU", "elem0d_size", 5);
+ GetSurfaceProperty()->SetPointSize(anElem0DSize);
+ }
}
-VISU_MeshAct::~VISU_MeshAct(){
+VISU_MeshAct
+::~VISU_MeshAct()
+{
mySurfaceActor->Delete();
myEdgeActor->Delete();
myNodeActor->Delete();
}
-void VISU_MeshAct::setIO(const Handle(SALOME_InteractiveObject)& theIO){
- VISU_Actor::setIO(theIO);
- mySurfaceActor->setIO(theIO);
- myEdgeActor->setIO(theIO);
- myNodeActor->setIO(theIO);
-}
-void VISU_MeshAct::SetPrs3d(VISU::Prs3d_i* thePrs3d){
- if(thePrs3d){
- VISU_Actor::SetPrs3d(thePrs3d);
- mySurfaceActor->SetPrs3d(thePrs3d);
- myEdgeActor->SetPrs3d(thePrs3d);
- myNodeActor->SetPrs3d(thePrs3d);
+//----------------------------------------------------------------------------
+void
+VISU_MeshAct
+::DeepCopy(VISU_Actor *theActor)
+{
+ if(VISU_MeshAct* anActor = dynamic_cast<VISU_MeshAct*>(theActor)){
+ Superclass::DeepCopy(theActor);
+ GetSurfaceProperty()->DeepCopy(anActor->GetSurfaceProperty());
+ GetEdgeProperty()->DeepCopy(anActor->GetEdgeProperty());
+ GetNodeProperty()->DeepCopy(anActor->GetNodeProperty());
}
}
-void VISU_MeshAct::AddToRender(vtkRenderer* theRenderer){
- theRenderer->AddActor(this);
- theRenderer->AddActor(myEdgeActor);
-}
-void VISU_MeshAct::RemoveFromRender(vtkRenderer* theRenderer){
- theRenderer->RemoveActor(this);
- theRenderer->RemoveActor(myEdgeActor);
-}
+//----------------------------------------------------------------------------
+void
+VISU_MeshAct
+::SetMapperInput(vtkDataSet* theDataSet)
+{
+ Superclass::SetMapperInput(theDataSet);
-void VISU_MeshAct::SetPipeLine(VISU_PipeLine* thePipeLine) {
- VISU_Actor::SetPipeLine(thePipeLine);
- mySurfaceActor->SetPipeLine(thePipeLine);
- myEdgeActor->SetPipeLine(thePipeLine);
- myNodeActor->SetPipeLine(thePipeLine);
+ mySurfaceActor->SetInput(theDataSet);
+ myEdgeActor->SetInput(theDataSet);
+ myNodeActor->SetInput(theDataSet);
}
-void VISU_MeshAct::SetTransform(SALOME_Transform* theTransform){
- VISU_Actor::SetTransform(theTransform);
+
+//----------------------------------------------------------------------------
+void
+VISU_MeshAct
+::SetTransform(VTKViewer_Transform* theTransform)
+{
+ Superclass::SetTransform(theTransform);
+
mySurfaceActor->SetTransform(theTransform);
myEdgeActor->SetTransform(theTransform);
myNodeActor->SetTransform(theTransform);
}
-void VISU_MeshAct::SetShrinkable(bool theIsShrinkable){
- VISU_Actor::SetShrinkable(theIsShrinkable);
+
+//----------------------------------------------------------------------------
+void
+VISU_MeshAct
+::SetShrinkable(bool theIsShrinkable)
+{
+ Superclass::SetShrinkable(theIsShrinkable);
+
mySurfaceActor->SetShrinkable(theIsShrinkable);
myEdgeActor->SetShrinkable(theIsShrinkable);
- myNodeActor->SetShrinkable(theIsShrinkable);
}
-vtkProperty* VISU_MeshAct::GetSurfaceProperty(){
- mySurfaceActor->GetProperty();
-}
+void
+VISU_MeshAct
+::SetShrinkFactor(vtkFloatingPointType theValue)
+{
+ Superclass::SetShrinkFactor(theValue);
-void VISU_MeshAct::SetSurfaceProperty(vtkProperty* theProperty){
- mySurfaceActor->SetProperty(theProperty);
+ mySurfaceActor->SetShrinkFactor(theValue);
+ myEdgeActor->SetShrinkFactor(theValue);
}
-vtkProperty* VISU_MeshAct::GetEdgeProperty(){
- myEdgeActor->GetProperty();
-}
-void VISU_MeshAct::SetEdgeProperty(vtkProperty* theProperty){
- myEdgeActor->SetProperty(theProperty);
+//----------------------------------------------------------------------------
+vtkProperty*
+VISU_MeshAct
+::GetSurfaceProperty()
+{
+ return mySurfaceActor->GetProperty();
}
-vtkProperty* VISU_MeshAct::GetNodeProperty(){
- myNodeActor->GetProperty();
-}
-
-void VISU_MeshAct::SetNodeProperty(vtkProperty* theProperty){
- myNodeActor->SetProperty(theProperty);
+vtkProperty*
+VISU_MeshAct
+::GetEdgeProperty()
+{
+ return myEdgeActor->GetProperty();
}
-void VISU_MeshAct::highlight(Standard_Boolean highlight){
- VISU_Actor::highlight(highlight);
- mySurfaceActor->highlight(highlight);
- myEdgeActor->highlight(highlight);
- myNodeActor->highlight(highlight);
+vtkProperty*
+VISU_MeshAct
+::GetNodeProperty()
+{
+ return myNodeActor->GetProperty();
}
-void VISU_MeshAct::SetOpacity(float theValue){
+//----------------------------------------------------------------------------
+void
+VISU_MeshAct
+::SetOpacity(vtkFloatingPointType theValue)
+{
GetSurfaceProperty()->SetOpacity(theValue);
}
-float VISU_MeshAct::GetOpacity(){
+vtkFloatingPointType
+VISU_MeshAct
+::GetOpacity()
+{
return GetSurfaceProperty()->GetOpacity();
}
-void VISU_MeshAct::SetLineWidth(float theLineWidth){
+//----------------------------------------------------------------------------
+void
+VISU_MeshAct
+::SetLineWidth(vtkFloatingPointType theLineWidth)
+{
GetEdgeProperty()->SetLineWidth(theLineWidth);
}
-float VISU_MeshAct::GetLineWidth(){
+vtkFloatingPointType
+VISU_MeshAct::GetLineWidth()
+{
return GetEdgeProperty()->GetLineWidth();
}
-void VISU_MeshAct::SetShrink(float theFactor){
- VISU_Actor::SetShrink(theFactor);
- mySurfaceActor->SetShrink(theFactor);
- myEdgeActor->SetShrink(theFactor);
- SetRepresentation(GetRepresentation());
+//----------------------------------------------------------------------------
+void
+VISU_MeshAct
+::SetShrink()
+{
+ if(myRepresentation == VTK_POINTS)
+ return;
+
+ Superclass::SetShrink();
+
+ mySurfaceActor->SetShrink();
+ myEdgeActor->SetShrink();
}
-void VISU_MeshAct::UnShrink(){
- VISU_Actor::UnShrink();
+void
+VISU_MeshAct
+::UnShrink()
+{
+ Superclass::UnShrink();
+
mySurfaceActor->UnShrink();
myEdgeActor->UnShrink();
- SetRepresentation(GetRepresentation());
}
-void VISU_MeshAct::SetRepresentation(int theMode){
- SALOME_Actor::SetRepresentation(theMode);
- mySurfaceActor->VisibilityOff();
- myEdgeActor->VisibilityOff();
- myNodeActor->VisibilityOff();
- myEdgeActor->PickableOff();
- myNodeActor->PickableOff();
- switch(theMode){
- case 0: //POINTS
- myNodeActor->VisibilityOn();
- myNodeActor->PickableOn();
- break;
- case 1: //WIREFRAME
- myEdgeActor->VisibilityOn();
- myEdgeActor->SetRepresentation(1);
- myEdgeActor->PickableOn();
- break;
- case 2: //SURFACE
- mySurfaceActor->VisibilityOn();
- break;
- case 3: //INSIDEFRAME
- myEdgeActor->VisibilityOn();
- myEdgeActor->SetRepresentation(3);
- myEdgeActor->PickableOn();
- break;
- case 4: //SURFACEFRAME
- myEdgeActor->VisibilityOn();
- myEdgeActor->SetRepresentation(1);
- mySurfaceActor->VisibilityOn();
- break;
- }
+//----------------------------------------------------------------------------
+void
+VISU_MeshAct
+::SetFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed)
+{
+ Superclass::SetFeatureEdgesAllowed(theIsFeatureEdgesAllowed);
+
+ mySurfaceActor->SetFeatureEdgesAllowed(theIsFeatureEdgesAllowed);
}
-void VISU_MeshAct::SetVisibility(int theMode){
- VISU_Actor::SetVisibility(theMode);
- if(GetVisibility())
- SetRepresentation(GetRepresentation());
- else{
- myNodeActor->VisibilityOff();
- myEdgeActor->VisibilityOff();
- mySurfaceActor->VisibilityOff();
- }
+void
+VISU_MeshAct
+::SetFeatureEdgesAngle(vtkFloatingPointType theValue)
+{
+ Superclass::SetFeatureEdgesAngle(theValue);
+
+ mySurfaceActor->SetFeatureEdgesAngle(theValue);
}
-// From vtkLODActor
-void VISU_MeshAct::Render(vtkRenderer *ren, vtkMapper *vtkNotUsed(m))
+void
+VISU_MeshAct
+::SetFeatureEdgesFlags(bool theIsFeatureEdges,
+ bool theIsBoundaryEdges,
+ bool theIsManifoldEdges,
+ bool theIsNonManifoldEdges)
{
- float myTime, bestTime, tempTime;
- vtkMatrix4x4 *matrix;
- vtkMapper *mapper, *bestMapper;
-
- if (this->Mapper == NULL)
- {
- vtkErrorMacro("No mapper for actor.");
+ Superclass::SetFeatureEdgesFlags(theIsFeatureEdges,
+ theIsBoundaryEdges,
+ theIsManifoldEdges,
+ theIsNonManifoldEdges);
+
+ mySurfaceActor->SetFeatureEdgesFlags(theIsFeatureEdges,
+ theIsBoundaryEdges,
+ theIsManifoldEdges,
+ theIsNonManifoldEdges);
+}
+
+void
+VISU_MeshAct
+::SetFeatureEdgesColoring(bool theIsColoring)
+{
+ Superclass::SetFeatureEdgesColoring(theIsColoring);
+
+ mySurfaceActor->SetFeatureEdgesColoring(theIsColoring);
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_MeshAct
+::SetFeatureEdgesEnabled(bool theIsFeatureEdgesEnabled)
+{
+ if(theIsFeatureEdgesEnabled && myRepresentation == VTK_POINTS)
return;
- }
-
- // first time through create lods if non have been added
- if (this->LODMappers->GetNumberOfItems() == 0)
- {
- this->CreateOwnLODs();
- }
-
- // If the actor has changed or the primary mapper has changed ...
- // Is this the correct test?
- if (this->MediumMapper)
- {
- if (this->GetMTime() > this->BuildTime ||
- this->Mapper->GetMTime() > this->BuildTime)
- {
- this->UpdateOwnLODs();
- }
- }
-
- // figure out how much time we have to render
- myTime = this->AllocatedRenderTime;
-
- // Figure out which resolution to use
- // none is a valid resolution. Do we want to have a lowest:
- // bbox, single point, ...
- // There is no order to the list, so it is assumed that mappers that take
- // longer to render are better quality.
- // Timings might become out of date, but we rely on
-
- bestMapper = this->Mapper;
- bestTime = bestMapper->GetTimeToDraw();
- if (bestTime > myTime)
- {
- this->LODMappers->InitTraversal();
- while ((mapper = this->LODMappers->GetNextItem()) != NULL &&
- bestTime != 0.0)
- {
- tempTime = mapper->GetTimeToDraw();
-
- // If the LOD has never been rendered, select it!
- if (tempTime == 0.0)
- {
- bestMapper = mapper;
- bestTime = 0.0;
- }
- else
- {
- if (bestTime > myTime && tempTime < bestTime)
- {
- bestMapper = mapper;
- bestTime = tempTime;
- }
- if (tempTime > bestTime && tempTime < myTime)
- {
- bestMapper = mapper;
- bestTime = tempTime;
- }
- }
- }
- }
-
+
+ Superclass::SetFeatureEdgesEnabled(theIsFeatureEdgesEnabled);
+
+ mySurfaceActor->SetFeatureEdgesEnabled(theIsFeatureEdgesEnabled);
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_MeshAct
+::SetRepresentation(int theMode)
+{
+ Superclass::SetRepresentation(theMode);
+
+ if(theMode == VTKViewer::Representation::Insideframe)
+ myEdgeActor->SetRepresentation(VTKViewer::Representation::Insideframe);
+ else
+ myEdgeActor->SetRepresentation(VTKViewer::Representation::Wireframe);
+}
+
+//----------------------------------------------------------------------------
+unsigned long int
+VISU_MeshAct
+::GetMemorySize()
+{
+ vtkDataSet* aDataSet;
+ unsigned long int aSize = Superclass::GetMemorySize();
+ {
+ aDataSet = mySurfaceActor->GetInput();
+ aSize += aDataSet->GetActualMemorySize() * 1024;
+
+ aDataSet = mySurfaceActor->GetMapper()->GetInput();
+ aSize += aDataSet->GetActualMemorySize() * 1024 * 2;
+ }
+ {
+ aDataSet = myEdgeActor->GetInput();
+ aSize += aDataSet->GetActualMemorySize() * 1024;
+
+ aDataSet = myEdgeActor->GetMapper()->GetInput();
+ aSize += aDataSet->GetActualMemorySize() * 1024 * 2;
+ }
+ {
+ aDataSet = myNodeActor->GetInput();
+ aSize += aDataSet->GetActualMemorySize() * 1024;
+
+ aDataSet = myNodeActor->GetMapper()->GetInput();
+ aSize += aDataSet->GetActualMemorySize() * 1024 * 2;
+ }
+ return aSize;
+}
+
+//----------------------------------------------------------------------------
+int
+VISU_MeshAct
+::RenderOpaqueGeometry(vtkViewport *ren)
+{
+ GetMatrix(myNodeActor->GetUserMatrix());
+ GetMatrix(myEdgeActor->GetUserMatrix());
+ GetMatrix(mySurfaceActor->GetUserMatrix());
+
+ using namespace VTKViewer::Representation;
switch(GetRepresentation()){
- case 0: //POINTS
- myNodeActor->GetProperty()->Render(this, ren);
- break;
- case 1: //WIREFRAME
- //PAL5268: myEdgeActor->GetProperty()->Render(this, ren);
+ case Points :
+ myNodeActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
+ myNodeActor->RenderOpaqueGeometry(ren);
break;
- case 2: //SURFACE
- mySurfaceActor->GetProperty()->Render(this, ren);
+ case Wireframe :
+ case Insideframe :
+ myEdgeActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
+ myEdgeActor->RenderOpaqueGeometry(ren);
break;
- case 3: //INSIDEFRAME
- //PAL5268: myEdgeActor->GetProperty()->Render(this, ren);
+ case Surface :
+ case FeatureEdges :
+ mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
+ mySurfaceActor->RenderOpaqueGeometry(ren);
break;
- case 4: //SURFACEFRAME
- //PAL5268: myEdgeActor->GetProperty()->Render(this, ren);
- mySurfaceActor->GetProperty()->Render(this, ren);
+ case Surfaceframe :
+ mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime/2.0,ren);
+ mySurfaceActor->RenderOpaqueGeometry(ren);
+
+ myEdgeActor->SetAllocatedRenderTime(this->AllocatedRenderTime/2.0,ren);
+ myEdgeActor->RenderOpaqueGeometry(ren);
break;
}
-
- // render the texture
- if (this->Texture)
- {
- this->Texture->Render(ren);
- }
-
+ return 1;
+}
+
+int
+VISU_MeshAct
+#if (VTK_XVERSION < 0x050100)
+::RenderTranslucentGeometry(vtkViewport *ren)
+#else
+::RenderTranslucentPolygonalGeometry(vtkViewport *ren)
+#endif
+{
+ GetMatrix(myNodeActor->GetUserMatrix());
+ GetMatrix(myEdgeActor->GetUserMatrix());
+ GetMatrix(mySurfaceActor->GetUserMatrix());
+
+ using namespace VTKViewer::Representation;
switch(GetRepresentation()){
- case 0: //POINTS
- matrix = myNodeActor->GetUserMatrix();
- break;
- case 1: //WIREFRAME
- matrix = myEdgeActor->GetUserMatrix();
+ case Points :
+ myNodeActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
+#if (VTK_XVERSION < 0x050100)
+ myNodeActor->RenderTranslucentGeometry(ren);
+#else
+ myNodeActor->RenderTranslucentPolygonalGeometry(ren);
+#endif
break;
- case 2: //SURFACE
- matrix = mySurfaceActor->GetUserMatrix();
+ case Wireframe :
+ case Insideframe :
+ myEdgeActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
+#if (VTK_XVERSION < 0x050100)
+ myEdgeActor->RenderTranslucentGeometry(ren);
+#else
+ myEdgeActor->RenderTranslucentPolygonalGeometry(ren);
+#endif
break;
- case 3: //INSIDEFRAME
- matrix = myEdgeActor->GetUserMatrix();
+ case Surface :
+ case FeatureEdges :
+ mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
+#if (VTK_XVERSION < 0x050100)
+ mySurfaceActor->RenderTranslucentGeometry(ren);
+#else
+ mySurfaceActor->RenderTranslucentPolygonalGeometry(ren);
+#endif
break;
- case 4: //SURFACEFRAME
- matrix = myEdgeActor->GetUserMatrix();
- this->GetMatrix(matrix);
- matrix = mySurfaceActor->GetUserMatrix();
+ case Surfaceframe :
+ mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
+#if (VTK_XVERSION < 0x050100)
+ mySurfaceActor->RenderTranslucentGeometry(ren);
+#else
+ mySurfaceActor->RenderTranslucentPolygonalGeometry(ren);
+#endif
+
+ myEdgeActor->SetAllocatedRenderTime(this->AllocatedRenderTime/2.0,ren);
+#if (VTK_XVERSION < 0x050100)
+ myEdgeActor->RenderTranslucentGeometry(ren);
+#else
+ myEdgeActor->RenderTranslucentPolygonalGeometry(ren);
+#endif
break;
}
- this->GetMatrix(matrix);
-
- switch(GetRepresentation()){
- case 0: //POINTS
- myNodeActor->Render(ren,bestMapper);
+ return 1;
+}
+
+#if (VTK_XVERSION >= 0x050100)
+int
+VISU_MeshAct
+::HasTranslucentPolygonalGeometry()
+{
+ int result = 0;
+
+ using namespace VTKViewer::Representation;
+ switch ( GetRepresentation() ) {
+ case Points:
+ result |= myNodeActor->HasTranslucentPolygonalGeometry();
break;
- case 1: //WIREFRAME
- //PAL5268: myEdgeActor->Render(ren,bestMapper);
+ case Wireframe:
+ case Insideframe:
+ result |= myEdgeActor->HasTranslucentPolygonalGeometry();
break;
- case 2: //SURFACE
- mySurfaceActor->Render(ren,bestMapper);
+ case Surface:
+ case FeatureEdges:
+ result |= mySurfaceActor->HasTranslucentPolygonalGeometry();
break;
- case 3: //INSIDEFRAME
- //PAL5268: myEdgeActor->Render(ren,bestMapper);
+ case Surfaceframe:
+ result |= mySurfaceActor->HasTranslucentPolygonalGeometry();
+ result |= myEdgeActor->HasTranslucentPolygonalGeometry();
break;
- case 4: //SURFACEFRAME
- //PAL5268: myEdgeActor->Render(ren,bestMapper);
- mySurfaceActor->Render(ren,bestMapper);
+ default:
break;
}
-
- this->EstimatedRenderTime = bestMapper->GetTimeToDraw();
+
+ return result;
+}
+#endif
+
+VISU_Actor::EQuadratic2DRepresentation
+VISU_MeshAct::GetQuadratic2DRepresentation() const
+{
+ bool mode = (mySurfaceActor->GetQuadraticArcMode() && myEdgeActor->GetQuadraticArcMode());
+ if(mode){
+ return VISU_Actor::eArcs;
+ }
+ else
+ return VISU_Actor::eLines;
+}
+
+void VISU_MeshAct::SetQuadratic2DRepresentation( EQuadratic2DRepresentation theMode )
+{
+ Superclass::SetQuadratic2DRepresentation( theMode );
+ switch(theMode) {
+ case VISU_Actor::eArcs:
+ mySurfaceActor->SetQuadraticArcMode(true);
+ myEdgeActor->SetQuadraticArcMode(true);
+ break;
+ case VISU_Actor::eLines:
+ mySurfaceActor->SetQuadraticArcMode(false);
+ myEdgeActor->SetQuadraticArcMode(false);
+ break;
+ default:
+ break;
+ }
+}
+
+void VISU_MeshAct::SetMarkerStd( VTK::MarkerType theMarkerType, VTK::MarkerScale theMarkerScale )
+{
+ Superclass::SetMarkerStd( theMarkerType, theMarkerScale );
+ myNodeActor->SetMarkerStd( theMarkerType, theMarkerScale );
}
-// From vtkLODActor
-void VISU_MeshAct::Modified()
+void VISU_MeshAct::SetMarkerTexture( int theMarkerId, VTK::MarkerTexture theMarkerTexture )
{
- myNodeActor->Modified();
- //PAL5268: myEdgeActor->Modified();
- mySurfaceActor->Modified();
- this->vtkActor::Modified();
+ Superclass::SetMarkerTexture( theMarkerId, theMarkerTexture );
+ myNodeActor->SetMarkerTexture( theMarkerId, theMarkerTexture );
}