From 14bec0ca4f7d5f10082729855f73c09741086eb5 Mon Sep 17 00:00:00 2001 From: apo Date: Thu, 6 Dec 2007 10:39:19 +0000 Subject: [PATCH] Fix for Bug NPAL13178 EDF243 VISU : post_processing for fields at nodes --- src/OBJECT/Makefile.am | 1 + src/OBJECT/VISU_GaussPtsDeviceActor.cxx | 227 +++++++++++---- src/OBJECT/VISU_GaussPtsDeviceActor.h | 91 ++++-- src/OBJECT/VISU_ScalarMapAct.cxx | 253 ++++++++++++++-- src/OBJECT/VISU_ScalarMapAct.h | 7 + src/PIPELINE/VISUPipeLine.cxx | 54 +++- src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx | 275 ++++++++++++++---- src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx | 6 - src/PIPELINE/VISU_PipeLineUtils.cxx | 1 + src/VISU_I/VISU_GaussPoints_i.cc | 2 +- src/VVTK/VVTK_SegmentationCursorDlg.cxx | 77 ----- src/VVTK/VVTK_SegmentationCursorDlg.h | 10 +- 12 files changed, 747 insertions(+), 257 deletions(-) diff --git a/src/OBJECT/Makefile.am b/src/OBJECT/Makefile.am index 47056df0..555d1cd7 100644 --- a/src/OBJECT/Makefile.am +++ b/src/OBJECT/Makefile.am @@ -52,6 +52,7 @@ dist_libVisuObject_la_SOURCES = \ VISU_VectorsAct.cxx libVisuObject_la_CPPFLAGS= \ + $(QT_INCLUDES) \ @CAS_CPPFLAGS@ @CAS_CXXFLAGS@ \ $(VTK_INCLUDES) \ $(BOOST_CPPFLAGS) \ diff --git a/src/OBJECT/VISU_GaussPtsDeviceActor.cxx b/src/OBJECT/VISU_GaussPtsDeviceActor.cxx index 9fcd7c6c..3ee21300 100644 --- a/src/OBJECT/VISU_GaussPtsDeviceActor.cxx +++ b/src/OBJECT/VISU_GaussPtsDeviceActor.cxx @@ -42,8 +42,12 @@ #include #include #include +#include + +#include #include "utilities.h" +#include "VISU_PipeLineUtils.hxx" #ifdef _DEBUG_ static int MYDEBUG = 0; @@ -51,21 +55,91 @@ static int MYDEBUG = 0; static int MYDEBUG = 0; #endif -using namespace std; + +//---------------------------------------------------------------- +namespace VISU +{ + inline + std::string + Image2VTI(const std::string& theImageFileName) + { + QFileInfo aFileInfo(theImageFileName.c_str()); + QString aFormat = aFileInfo.extension(FALSE); +#ifdef WIN32 + QString aTmpDir = getenv( "TEMP" ); +#else + QString aTmpDir = QString( "/tmp/" ) + getenv("USER"); +#endif + QString aVTIName = aTmpDir + "-" + aFileInfo.baseName(TRUE) + ".vti"; + QString aCommand = QString( "VISU_img2vti " ) + aFormat + " " + theImageFileName + " " + aVTIName; + + if(system( aCommand.latin1() ) == 0) + return aVTIName.latin1(); + + return ""; + } + + inline + void + RemoveFile(const std::string& theFileName) + { + if( theFileName != "" ){ +#ifndef WNT + QString aCommand = QString( "rm -fr " ) + theFileName.c_str(); +#else + QString aCommand = QString( "del /F " ) + theFileName.c_str(); +#endif + system( aCommand.latin1() ); + } + } + + + TTextureValue + GetTexture(const std::string& theMainTexture, + const std::string& theAlphaTexture) + { + typedef std::pair TTextureKey; + typedef std::map TTextureMap; + + static TTextureMap aTextureMap; + + TTextureValue aTextureValue; + TTextureKey aTextureKey( theMainTexture.c_str(), theAlphaTexture.c_str() ); + TTextureMap::const_iterator anIter = aTextureMap.find( aTextureKey ); + if ( anIter != aTextureMap.end() ) { + aTextureValue = anIter->second; + } else { + QString aMainTextureVTI = Image2VTI(theMainTexture); + QString anAlphaTextureVTI = Image2VTI(theAlphaTexture); + + if( !aMainTextureVTI.isNull() && !anAlphaTextureVTI.isNull() ){ + aTextureValue = + VISU_GaussPointsPL::MakeTexture( aMainTextureVTI.latin1(), + anAlphaTextureVTI.latin1()); + + if( aTextureValue.GetPointer() ) + aTextureMap[aTextureKey] = aTextureValue; + } + + RemoveFile(aMainTextureVTI); + RemoveFile(anAlphaTextureVTI); + } + + return aTextureValue; + } +} //---------------------------------------------------------------- -vtkStandardNewMacro(VISU_GaussPtsDeviceActor); +vtkStandardNewMacro(VISU_GaussDeviceActorBase); -VISU_GaussPtsDeviceActor -::VISU_GaussPtsDeviceActor(): - myGeomFilter(VTKViewer_GeometryFilter::New()), +VISU_GaussDeviceActorBase +::VISU_GaussDeviceActorBase(): myTransformFilter(VTKViewer_TransformFilter::New()) { - if(MYDEBUG) MESSAGE("VISU_GaussPtsDeviceActor - "<Delete(); myTransformFilter->Delete(); for(int i = 0; i < 3; i++){ @@ -76,16 +150,16 @@ VISU_GaussPtsDeviceActor } -VISU_GaussPtsDeviceActor -::~VISU_GaussPtsDeviceActor() +VISU_GaussDeviceActorBase +::~VISU_GaussDeviceActorBase() { - if(MYDEBUG) MESSAGE("~VISU_GaussPtsDeviceActor - "<Mapper == NULL) @@ -125,28 +199,45 @@ VISU_GaussPtsDeviceActor //---------------------------------------------------------------- void -VISU_GaussPtsDeviceActor -::AddToRender(vtkRenderer* theRenderer) +VISU_GaussDeviceActorBase +::SetTransform(VTKViewer_Transform* theTransform) { - theRenderer->AddActor(this); + myTransformFilter->SetTransform(theTransform); } -void -VISU_GaussPtsDeviceActor -::RemoveFromRender(vtkRenderer* theRenderer) +//---------------------------------------------------------------- +void +VISU_GaussDeviceActorBase +::SetPointSpriteMapper(VISU_OpenGLPointSpriteMapper* theMapper) { - theRenderer->RemoveActor(this); + vtkPolyData* aDataSet = theMapper->GetInput(); + myMapper = theMapper; + + int anId = 0; + myPassFilter[ anId ]->SetInput( aDataSet ); + myPassFilter[ anId + 1 ]->SetInput( myPassFilter[ anId ]->GetOutput() ); + + anId++; + myTransformFilter->SetInput( myPassFilter[ anId ]->GetPolyDataOutput() ); + + anId++; + myPassFilter[ anId ]->SetInput( myTransformFilter->GetOutput() ); + + myMapper->SetInput( myPassFilter[ anId ]->GetPolyDataOutput() ); + + Superclass::SetMapper( theMapper ); } void -VISU_GaussPtsDeviceActor -::SetTransform(VTKViewer_Transform* theTransform) +VISU_GaussDeviceActorBase +::DoMapperShallowCopy( vtkMapper* theMapper, + bool theIsCopyInput ) { - myTransformFilter->SetTransform(theTransform); + VISU::CopyMapper( GetMapper(), theMapper, theIsCopyInput ); } VISU_OpenGLPointSpriteMapper* -VISU_GaussPtsDeviceActor +VISU_GaussDeviceActorBase ::GetPointSpriteMapper() { return myMapper.GetPointer(); @@ -154,32 +245,42 @@ VISU_GaussPtsDeviceActor //---------------------------------------------------------------------------- unsigned long int -VISU_GaussPtsDeviceActor +VISU_GaussDeviceActorBase ::GetMemorySize() { vtkDataSet* aDataSet = GetMapper()->GetInput(); - unsigned long int aSize = aDataSet->GetActualMemorySize() * 1024; + return aDataSet->GetActualMemorySize() * 1024; +} - aSize += GetPipeLine()->GetMemorySize(); - return aSize; -} + +//---------------------------------------------------------------- +vtkStandardNewMacro(VISU_GaussPtsDeviceActor); + + +VISU_GaussPtsDeviceActor +::VISU_GaussPtsDeviceActor() +{} + + +VISU_GaussPtsDeviceActor +::~VISU_GaussPtsDeviceActor() +{} + //---------------------------------------------------------------------------- -int +void VISU_GaussPtsDeviceActor -::GetPickable() +::AddToRender(vtkRenderer* theRenderer) { - if(Superclass::GetPickable()){ - if(vtkMapper* aMapper = GetMapper()){ - if(vtkDataSet* aDataSet= aMapper->GetInput()){ - aDataSet->Update(); - return aDataSet->GetNumberOfCells() > 0; - } - } - } + theRenderer->AddActor(this); +} - return false; +void +VISU_GaussPtsDeviceActor +::RemoveFromRender(vtkRenderer* theRenderer) +{ + theRenderer->RemoveActor(this); } @@ -188,23 +289,9 @@ void VISU_GaussPtsDeviceActor ::SetPipeLine(VISU_GaussPointsPL* thePipeLine) { - myPipeLine = thePipeLine; - myMapper = thePipeLine->GetPointSpriteMapper(); - vtkPolyData* aDataSet = myMapper->GetInput(); + SetPointSpriteMapper( thePipeLine->GetPointSpriteMapper() ); - int anId = 0; - myPassFilter[ anId ]->SetInput( aDataSet ); - myPassFilter[ anId + 1 ]->SetInput( myPassFilter[ anId ]->GetOutput() ); - - anId++; - myTransformFilter->SetInput( myPassFilter[ anId ]->GetPolyDataOutput() ); - - anId++; - myPassFilter[ anId ]->SetInput( myTransformFilter->GetOutput() ); - - myMapper->SetInput( myPassFilter[ anId ]->GetPolyDataOutput() ); - - Superclass::SetMapper( myMapper.GetPointer() ); + myPipeLine = thePipeLine; } VISU_GaussPointsPL* @@ -222,6 +309,38 @@ VISU_GaussPtsDeviceActor } +//---------------------------------------------------------------------------- +int +VISU_GaussPtsDeviceActor +::GetPickable() +{ + if(Superclass::GetPickable()){ + if(vtkMapper* aMapper = GetMapper()){ + if(vtkDataSet* aDataSet= aMapper->GetInput()){ + aDataSet->Update(); + return aDataSet->GetNumberOfCells() > 0; + } + } + } + + return false; +} + + +//---------------------------------------------------------------------------- +unsigned long int +VISU_GaussPtsDeviceActor +::GetMemorySize() +{ + unsigned long int aSize = Superclass::GetMemorySize(); + + aSize += GetPipeLine()->GetMemorySize(); + + return aSize; +} + + + //============================================================================ #include #include diff --git a/src/OBJECT/VISU_GaussPtsDeviceActor.h b/src/OBJECT/VISU_GaussPtsDeviceActor.h index 253822f6..7ff5c369 100644 --- a/src/OBJECT/VISU_GaussPtsDeviceActor.h +++ b/src/OBJECT/VISU_GaussPtsDeviceActor.h @@ -29,6 +29,7 @@ #ifndef VISU_GAUSS_PTS_DEVICE_ACTOR_H #define VISU_GAUSS_PTS_DEVICE_ACTOR_H +#include "VISU_Actor.h" #include "VTKViewer_GeometryFilter.h" #include @@ -41,15 +42,29 @@ class VISU_OpenGLPointSpriteMapper; class VISU_GaussPointsPL; class vtkPassThroughFilter; +class vtkImageData; + //============================================================================ -class VISU_GaussPtsDeviceActor: public vtkLODActor +namespace VISU { - public: - vtkTypeMacro(VISU_GaussPtsDeviceActor,vtkLODActor); + typedef vtkSmartPointer TTextureValue; + + VTKOCC_EXPORT + TTextureValue + GetTexture(const std::string& theMainTexture, + const std::string& theAlphaTexture); +} + +//============================================================================ +class VISU_GaussDeviceActorBase: public vtkLODActor +{ + public: + vtkTypeMacro(VISU_GaussDeviceActorBase, vtkLODActor); + static - VISU_GaussPtsDeviceActor* + VISU_GaussDeviceActorBase* New(); virtual @@ -58,13 +73,59 @@ class VISU_GaussPtsDeviceActor: public vtkLODActor //---------------------------------------------------------------------------- void - AddToRender(vtkRenderer* theRenderer); + SetTransform(VTKViewer_Transform* theTransform); + //---------------------------------------------------------------------------- void - RemoveFromRender(vtkRenderer* theRenderer); + SetPointSpriteMapper(VISU_OpenGLPointSpriteMapper* theMapper) ; + virtual void - SetTransform(VTKViewer_Transform* theTransform); + DoMapperShallowCopy( vtkMapper* theMapper, + bool theIsCopyInput ); + + VISU_OpenGLPointSpriteMapper* + GetPointSpriteMapper(); + + //---------------------------------------------------------------------------- + //! Gets memory size used by the instance (bytes). + virtual + unsigned long int + GetMemorySize(); + + protected: + //---------------------------------------------------------------------------- + vtkSmartPointer myMapper; + vtkSmartPointer myTransformFilter; + + typedef vtkSmartPointer PPassThroughFilter; + std::vector myPassFilter; + + VISU_GaussDeviceActorBase(); + ~VISU_GaussDeviceActorBase(); + + private: + VISU_GaussDeviceActorBase(const VISU_GaussDeviceActorBase&); // Not implemented + void operator=(const VISU_GaussDeviceActorBase&); // Not implemented +}; + + +//============================================================================ +class VISU_GaussPtsDeviceActor: public VISU_GaussDeviceActorBase +{ + public: + vtkTypeMacro(VISU_GaussPtsDeviceActor, VISU_GaussDeviceActorBase); + + static + VISU_GaussPtsDeviceActor* + New(); + + //---------------------------------------------------------------------------- + void + AddToRender(vtkRenderer* theRenderer); + + void + RemoveFromRender(vtkRenderer* theRenderer); //---------------------------------------------------------------------------- VISU_GaussPointsPL* @@ -76,27 +137,19 @@ class VISU_GaussPtsDeviceActor: public vtkLODActor void ShallowCopyPL(VISU_GaussPointsPL* thePipeLine); - VISU_OpenGLPointSpriteMapper* - GetPointSpriteMapper(); + virtual + int + GetPickable(); + //---------------------------------------------------------------------------- //! Gets memory size used by the instance (bytes). virtual unsigned long int GetMemorySize(); - virtual - int - GetPickable(); - protected: //---------------------------------------------------------------------------- vtkSmartPointer myPipeLine; - vtkSmartPointer myMapper; - vtkSmartPointer myGeomFilter; - vtkSmartPointer myTransformFilter; - - typedef vtkSmartPointer PPassThroughFilter; - std::vector myPassFilter; VISU_GaussPtsDeviceActor(); ~VISU_GaussPtsDeviceActor(); diff --git a/src/OBJECT/VISU_ScalarMapAct.cxx b/src/OBJECT/VISU_ScalarMapAct.cxx index bb904374..2db6f416 100644 --- a/src/OBJECT/VISU_ScalarMapAct.cxx +++ b/src/OBJECT/VISU_ScalarMapAct.cxx @@ -31,6 +31,11 @@ #include "VISU_ScalarBarActor.hxx" #include "VISU_PipeLine.hxx" +#include "VISU_OpenGLPointSpriteMapper.hxx" +#include "VISU_GaussPtsDeviceActor.h" +#include "VISU_DeformedShapePL.hxx" +#include "VISU_PipeLineUtils.hxx" + #include #include #include @@ -38,6 +43,166 @@ #include #include +#include +#include +#include +#include + + +//============================================================================ +class VISU_PointsDeviceActor: public VISU_GaussDeviceActorBase +{ + public: + vtkTypeMacro(VISU_PointsDeviceActor, VISU_GaussDeviceActorBase); + + static + VISU_PointsDeviceActor* + New(); + + + //---------------------------------------------------------------------------- + virtual + void + SetInput(vtkDataSet* theDataSet) + { + myGeomFilter->SetInput( theDataSet ); + } + + + //---------------------------------------------------------------------------- + void + SetInteractor(vtkRenderWindowInteractor* theInteractor) + { + if(theInteractor == myInteractor) + return; + + if(myInteractor) + myInteractor->RemoveObserver(myEventCallbackCommand); + + if(theInteractor) + theInteractor->AddObserver(vtkCommand::CharEvent, + myEventCallbackCommand, + 0.0); + + myInteractor = theInteractor; + } + + + //---------------------------------------------------------------------------- + void + DoMapperShallowCopy( vtkMapper* theMapper, + bool theIsCopyInput ) + { + Superclass::DoMapperShallowCopy( theMapper, theIsCopyInput ); + + vtkDataSet* aDataSet = theMapper->GetInput(); + vtkFloatingPointType aScaleFactor = VISU_DeformedShapePL::GetScaleFactor( aDataSet ); + + GetPointSpriteMapper()->SetAverageCellSize( aScaleFactor ); + } + + + //---------------------------------------------------------------------------- + void + DeepCopy( VISU_PointsDeviceActor *theActor ) + { + VISU::CopyPointSpriteDataMapper( GetPointSpriteMapper(), theActor->GetPointSpriteMapper(), false ); + } + + protected: + //---------------------------------------------------------------------------- + VISU_PointsDeviceActor(): + myGeomFilter( VTKViewer_GeometryFilter::New() ), + myEventCallbackCommand( vtkCallbackCommand::New() ), + myInteractor( NULL ) + { + myGeomFilter->SetInside(true); + + VISU_OpenGLPointSpriteMapper* aMapper = VISU_OpenGLPointSpriteMapper::New(); + aMapper->SetInput( myGeomFilter->GetOutput() ); + + std::string aRootDir( getenv( "VISU_ROOT_DIR") ); + std::string aMainTexture = aRootDir + "/share/salome/resources/visu/sprite_texture.bmp"; + std::string anAlphaTexture = aRootDir + "/share/salome/resources/visu/sprite_alpha.bmp"; + VISU::TTextureValue aTextureValue = VISU::GetTexture( aMainTexture, anAlphaTexture ); + aMapper->SetImageData( aTextureValue.GetPointer() ); + + aMapper->SetUseLookupTableScalarRange(true); + aMapper->SetColorModeToMapScalars(); + aMapper->SetScalarVisibility(true); + + SetPointSpriteMapper( aMapper ); + + aMapper->Delete(); + + myEventCallbackCommand->SetClientData( this ); + myEventCallbackCommand->SetCallback( VISU_PointsDeviceActor::ProcessEvents ); + } + + + //---------------------------------------------------------------------------- + ~VISU_PointsDeviceActor() + { + myGeomFilter->Delete(); + myEventCallbackCommand->Delete(); + } + + + //---------------------------------------------------------------------------- + static + void + ProcessEvents(vtkObject* theObject, + unsigned long theEvent, + void* theClientData, + void* theCallData) + { + if ( vtkObject* anObject = reinterpret_cast( theClientData ) ) + if ( VISU_PointsDeviceActor* self = dynamic_cast( anObject ) ) + self->OnInteractorEvent( theEvent ); + } + + + //---------------------------------------------------------------------------- + void + OnInteractorEvent(unsigned long theEvent) + { + switch ( theEvent ) { + case vtkCommand::CharEvent: { + switch( myInteractor->GetKeyCode() ) { + case 'M' : + case 'm' : { + static vtkFloatingPointType anIncrement = 2; + vtkFloatingPointType aMagnification = GetPointSpriteMapper()->GetPointSpriteMagnification(); + vtkFloatingPointType coefficient = myInteractor->GetShiftKey() ? anIncrement : 1 / anIncrement; + + GetPointSpriteMapper()->SetPointSpriteMagnification( aMagnification * coefficient ); + + myInteractor->CreateTimer(VTKI_TIMER_UPDATE); + break; + } + default: + return; + } + break; + } + default: + return; + } + } + + + //---------------------------------------------------------------------------- + vtkCallbackCommand* myEventCallbackCommand; + vtkRenderWindowInteractor* myInteractor; + VTKViewer_GeometryFilter* myGeomFilter; + + private: + VISU_PointsDeviceActor(const VISU_PointsDeviceActor&); // Not implemented + void operator=(const VISU_PointsDeviceActor&); // Not implemented +}; + +vtkStandardNewMacro(VISU_PointsDeviceActor); + //---------------------------------------------------------------------------- vtkStandardNewMacro(VISU_ScalarMapAct); static vtkFloatingPointType EPS = 1.0 / VTK_LARGE_FLOAT; @@ -71,6 +236,9 @@ VISU_ScalarMapAct myEdgeActor->SetUserMatrix(m); myEdgeActor->GetProperty()->SetColor(255.,255.,255.); + myPointsActor = VISU_PointsDeviceActor::New(); + myPointsActor->SetUserMatrix(m); + m->Delete(); } @@ -79,6 +247,9 @@ VISU_ScalarMapAct ::~VISU_ScalarMapAct() { myScalarBar->Delete(); + + myPointsActor->Delete(); + mySurfaceActor->Delete(); myEdgeActor->Delete(); } @@ -87,14 +258,11 @@ void VISU_ScalarMapAct ::ShallowCopyPL(VISU_PipeLine* thePipeLine) { - VISU_Actor::ShallowCopyPL(thePipeLine); + VISU_Actor::ShallowCopyPL( thePipeLine ); - myEdgeActor->GetMapper()->ScalarVisibilityOff(); + myPointsActor->DoMapperShallowCopy( thePipeLine->GetMapper(), false ); - vtkDataSet* aDatsSet = mySurfaceActor->GetDataSetMapper()->GetInput(); - mySurfaceActor->GetMapper()->ShallowCopy(thePipeLine->GetMapper()); - // To restore mapper input from pipeline - mySurfaceActor->GetDataSetMapper()->SetInput(aDatsSet); + VISU::CopyMapper( mySurfaceActor->GetMapper(), thePipeLine->GetMapper(), false ); } //---------------------------------------------------------------------------- @@ -102,10 +270,12 @@ void VISU_ScalarMapAct ::SetMapperInput(vtkDataSet* theDataSet) { - Superclass::SetMapperInput(theDataSet); + Superclass::SetMapperInput( theDataSet ); - mySurfaceActor->SetInput(theDataSet); - myEdgeActor->SetInput(theDataSet); + myPointsActor->SetInput( theDataSet ); + + mySurfaceActor->SetInput( theDataSet ); + myEdgeActor->SetInput( theDataSet ); } //---------------------------------------------------------------------------- @@ -115,6 +285,8 @@ VISU_ScalarMapAct { Superclass::SetTransform(theTransform); + myPointsActor->SetTransform(theTransform); + mySurfaceActor->SetTransform(theTransform); myEdgeActor->SetTransform(theTransform); } @@ -197,6 +369,7 @@ VISU_ScalarMapAct if(VISU_ScalarMapAct* anActor = dynamic_cast(theActor)){ Superclass::DeepCopy(theActor); SetBarVisibility(anActor->GetBarVisibility()); + myPointsActor->DeepCopy( anActor->myPointsActor ); SetShading(anActor->IsShading()); } } @@ -209,6 +382,8 @@ VISU_ScalarMapAct { Superclass::AddToRender(theRenderer); + myPointsActor->SetInteractor( myInteractor ); + if(myScalarBar) theRenderer->AddActor2D(myScalarBar); } @@ -221,6 +396,12 @@ VISU_ScalarMapAct if(myScalarBar) theRenderer->RemoveActor(myScalarBar); + if ( vtkWindow* aWindow = theRenderer->GetRenderWindow() ) { + myPointsActor->ReleaseGraphicsResources( aWindow ); + mySurfaceActor->ReleaseGraphicsResources( aWindow ); + myEdgeActor->ReleaseGraphicsResources( aWindow ); + } + Superclass::RemoveFromRender(theRenderer); } @@ -286,16 +467,13 @@ VISU_ScalarMapAct { vtkProperty* aProperty = mySurfaceActor->GetProperty(); - if (theOn) - { - aProperty->SetAmbient(0.0); - aProperty->SetDiffuse(1.0); - } - else - { - aProperty->SetAmbient(1.0); - aProperty->SetDiffuse(0.0); - } + if (theOn) { + aProperty->SetAmbient(0.0); + aProperty->SetDiffuse(1.0); + } else { + aProperty->SetAmbient(1.0); + aProperty->SetDiffuse(0.0); + } } //---------------------------------------------------------------------------- @@ -314,19 +492,29 @@ VISU_ScalarMapAct { GetMatrix(myEdgeActor->GetUserMatrix()); GetMatrix(mySurfaceActor->GetUserMatrix()); + GetMatrix(myPointsActor->GetUserMatrix()); using namespace SVTK::Representation; - if( GetRepresentation() == Surfaceframe ){ + switch ( GetRepresentation() ) { + + case Surfaceframe: mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime/2.0,ren); mySurfaceActor->RenderOpaqueGeometry(ren); myEdgeActor->SetAllocatedRenderTime(this->AllocatedRenderTime/2.0,ren); myEdgeActor->RenderOpaqueGeometry(ren); - } - else{ + break; + + case Points: + myPointsActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren); + myPointsActor->RenderOpaqueGeometry(ren); + break; + + default: mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren); mySurfaceActor->RenderOpaqueGeometry(ren); } + return 1; } @@ -338,17 +526,26 @@ VISU_ScalarMapAct GetMatrix(mySurfaceActor->GetUserMatrix()); using namespace SVTK::Representation; - if( GetRepresentation() == Surfaceframe ){ + switch ( GetRepresentation() ) { + + case Surfaceframe: mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren); mySurfaceActor->RenderTranslucentGeometry(ren); myEdgeActor->SetAllocatedRenderTime(this->AllocatedRenderTime/2.0,ren); myEdgeActor->RenderTranslucentGeometry(ren); - } - else{ + break; + + case Points: + myPointsActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren); + myPointsActor->RenderTranslucentGeometry(ren); + break; + + default: mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren); mySurfaceActor->RenderTranslucentGeometry(ren); } + return 1; } @@ -357,7 +554,11 @@ unsigned long int VISU_ScalarMapAct ::GetMemorySize() { - return Superclass::GetMemorySize(); + unsigned long int aSize = Superclass::GetMemorySize(); + + aSize += myPointsActor->GetMemorySize(); + + return aSize; } //---------------------------------------------------------------------------- diff --git a/src/OBJECT/VISU_ScalarMapAct.h b/src/OBJECT/VISU_ScalarMapAct.h index 8f898764..8589d05d 100644 --- a/src/OBJECT/VISU_ScalarMapAct.h +++ b/src/OBJECT/VISU_ScalarMapAct.h @@ -32,7 +32,10 @@ #include "VISU_DataSetActor.h" class VISU_ScalarBarActor; +class VISU_PointsDeviceActor; + +//---------------------------------------------------------------------------- class VTKOCC_EXPORT VISU_ScalarMapAct : public VISU_DataSetActor { public: @@ -148,8 +151,12 @@ class VTKOCC_EXPORT VISU_ScalarMapAct : public VISU_DataSetActor bool myBarVisibility; VISU_ScalarBarActor* myScalarBar; + + VISU_PointsDeviceActor* myPointsActor; SVTK_DeviceActor* mySurfaceActor; SVTK_DeviceActor* myEdgeActor; }; +//---------------------------------------------------------------------------- + #endif diff --git a/src/PIPELINE/VISUPipeLine.cxx b/src/PIPELINE/VISUPipeLine.cxx index 6cfa78f4..2e9f12c0 100644 --- a/src/PIPELINE/VISUPipeLine.cxx +++ b/src/PIPELINE/VISUPipeLine.cxx @@ -37,10 +37,14 @@ #include "VISU_Plot3DPL.hxx" #include "VISU_ScalarBarActor.hxx" +#include "VISU_OpenGLPointSpriteMapper.hxx" +#include "VTKViewer_GeometryFilter.h" +#include + #include "VISU_Convertor.hxx" #include "VISU_ConvertorUtils.hxx" -typedef VISU_ScalarMapPL TPresent; +typedef VISU_GaussPointsPL TPresent; #include #include @@ -89,11 +93,11 @@ CreateColoredPL(VISU_Convertor* theConvertor, char aMainTexture[80]; strcpy( aMainTexture, getenv( "VISU_ROOT_DIR" ) ); - strcat( aMainTexture, "/share/salome/resources/visu/sprite_texture.vti" ); + strcat( aMainTexture, "/share/salome/resources/visu/sprite_texture.bmp" ); char anAlphaTexture[80]; strcpy( anAlphaTexture, getenv( "VISU_ROOT_DIR" ) ); - strcat( anAlphaTexture, "/share/salome/resources/visu/sprite_alpha.vti" ); + strcat( anAlphaTexture, "/share/salome/resources/visu/sprite_alpha.bmp" ); vtkSmartPointer aTextureValue = VISU_GaussPointsPL::MakeTexture( aMainTexture, anAlphaTexture ); @@ -230,24 +234,60 @@ main(int argc, char** argv) if(aValFieldIter == aValField.end()) return 0; int aTimeStamp = aValFieldIter->first; + vtkActor* anActor = vtkActor::New(); VISU_ColoredPL* aPresent = NULL; if(anEntity != VISU::NODE_ENTITY){ - continue; aPresent = CreateColoredPL(aConvertor, aMeshName, anEntity, aFieldName, aTimeStamp); + + anActor->SetMapper(aPresent->GetMapper()); }else{ + continue; aPresent = CreateColoredPL(aConvertor, aMeshName, anEntity, aFieldName, aTimeStamp); - } - vtkActor* anActor = vtkActor::New(); - anActor->SetMapper(aPresent->GetMapper()); + VTKViewer_GeometryFilter* aGeometryFilter = VTKViewer_GeometryFilter::New(); + aGeometryFilter->SetInput(aPresent->GetOutput()); + aGeometryFilter->SetInside(true); + + vtkMaskPoints* aMaskPoints = vtkMaskPoints::New(); + aMaskPoints->SetInput(aGeometryFilter->GetOutput()); + aMaskPoints->SetGenerateVertices(true); + aMaskPoints->SetOnRatio(1); + + VISU_OpenGLPointSpriteMapper* aMapper = VISU_OpenGLPointSpriteMapper::New(); + aMapper->SetAverageCellSize( VISU_DeformedShapePL::GetScaleFactor( aPresent->GetOutput() ) ); + + char aMainTexture[80]; + strcpy( aMainTexture, getenv( "VISU_ROOT_DIR" ) ); + strcat( aMainTexture, "/share/salome/resources/visu/sprite_texture.vti" ); + + char anAlphaTexture[80]; + strcpy( anAlphaTexture, getenv( "VISU_ROOT_DIR" ) ); + strcat( anAlphaTexture, "/share/salome/resources/visu/sprite_alpha.vti" ); + + vtkSmartPointer aTextureValue = + VISU_GaussPointsPL::MakeTexture( aMainTexture, anAlphaTexture ); + aMapper->SetImageData( aTextureValue.GetPointer() ); + + //vtkPolyDataMapper* aMapper = vtkPolyDataMapper::New(); + aMapper->SetLookupTable(aPresent->GetMapperTable()); + aMapper->SetUseLookupTableScalarRange(true); + aMapper->SetColorModeToMapScalars(); + aMapper->SetScalarVisibility(true); + + aMapper->SetInput(aMaskPoints->GetOutput()); + aGeometryFilter->Delete(); + + anActor->SetMapper(aMapper); + aMapper->Delete(); + } VISU_ScalarBarActor * aScalarBar = VISU_ScalarBarActor::New(); aScalarBar->SetLookupTable(aPresent->GetBarTable()); diff --git a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx index e596e436..85184e78 100755 --- a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx +++ b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx @@ -744,6 +744,7 @@ void VISU_OpenGLPointSpriteMapper::InitTextures() glBindTexture( GL_TEXTURE_2D, this->PointSpriteTexture ); } + //----------------------------------------------------------------------------- int ComputeHue( int r, int g, int b ) { @@ -796,84 +797,168 @@ struct TVertex GLfloat vx, vy, vz; }; + //----------------------------------------------------------------------------- -void VISU_OpenGLPointSpriteMapper::DrawPoints(vtkPoints *thePoints, - vtkUnsignedCharArray *theColors, - vtkCellArray *theCells, - vtkActor* theActor) +struct TColorFunctorBase { - //cout << "VISU_OpenGLPointSpriteMapper::DrawPoints" << endl; + virtual + void + get( TVertex& theVertex, vtkIdType thePointId, vtkIdType theCellId ) = 0; +}; - //if( this->PrimitiveType == VISU_OpenGLPointSpriteMapper::OpenGLPoint ) - // glEnable( GL_POINT_SMOOTH ); - glPointSize( this->DefaultPointSize ); +//----------------------------------------------------------------------------- +struct TPropertyColor : TColorFunctorBase +{ + vtkFloatingPointType myColor[3]; + vtkFloatingPointType myHue; - TVertex* aVertexArr = new TVertex[ this->TotalCells ]; + TPropertyColor( vtkProperty *theProperty ) + { + theProperty->GetColor( myColor ); + int aRed = int( myColor[0] * 255 ); + int aGreen = int( myColor[1] * 255 ); + int aBlue = int( myColor[2] * 255 ); - vtkFloatingPointType* aPropertyColor = theActor->GetProperty()->GetColor(); - float aColor[3] = {aPropertyColor[0], aPropertyColor[1], aPropertyColor[2]}; + myHue = ComputeHue( aRed, aGreen, aBlue ); + } - unsigned long i = 0; - vtkIdType *pts = 0; - vtkIdType npts = 0; - for( theCells->InitTraversal(); theCells->GetNextCell( npts, pts ); i++ ) + virtual + void + get( TVertex& theVertex, vtkIdType thePointId, vtkIdType theCellId ) { - TVertex& aVertex = aVertexArr[i]; - vtkIdType aPointId = pts[0]; - vtkFloatingPointType* aCoords = thePoints->GetPoint( aPointId ); - aVertex.vx = aCoords[0]; - aVertex.vy = aCoords[1]; - aVertex.vz = aCoords[2]; - - int aRed = 0, aGreen = 0, aBlue = 0; - if( theColors && this->PointSpriteMode != 1 ) - { - unsigned char *col = theColors->GetPointer(pts[0] << 2); - aRed = int(col[0]); - aGreen = int(col[1]); - aBlue = int(col[2]); - - aColor[0] = aRed / 255.0; - aColor[1] = aGreen / 255.0; - aColor[2] = aBlue / 255.0; - } + theVertex.r = myColor[0]; + theVertex.g = myColor[1]; + theVertex.b = myColor[2]; - aVertex.r = aColor[0]; - aVertex.g = aColor[1]; - aVertex.b = aColor[2]; - aVertex.hue = ComputeHue( aRed, aGreen, aBlue ); + theVertex.hue = myHue; } +}; + + +//----------------------------------------------------------------------------- +struct TColors2Color : TColorFunctorBase +{ + vtkUnsignedCharArray *myColors; - GLuint aBufferObjectID = 0; - vglGenBuffersARB( 1, &aBufferObjectID ); - vglBindBufferARB( GL_ARRAY_BUFFER_ARB, aBufferObjectID ); + TColors2Color( vtkUnsignedCharArray *theColors ): + myColors( theColors ) + {} - int nArrayObjectSize = sizeof( TVertex ) * this->TotalCells; - vglBufferDataARB( GL_ARRAY_BUFFER_ARB, nArrayObjectSize, aVertexArr, GL_STATIC_DRAW_ARB ); + virtual + void + get( TVertex& theVertex, vtkIdType thePointId, vtkIdType theCellId ) + { + vtkIdType aTupleId = GetTupleId( thePointId, theCellId ); + unsigned char *aColor = myColors->GetPointer( aTupleId << 2 ); - delete [] aVertexArr; + theVertex.r = int( aColor[0] ) / 255.0; + theVertex.g = int( aColor[1] ) / 255.0; + theVertex.b = int( aColor[2] ) / 255.0; - vglBindBufferARB( GL_ARRAY_BUFFER_ARB, 0 ); - vglBindBufferARB( GL_ARRAY_BUFFER_ARB, aBufferObjectID ); + theVertex.hue = ComputeHue( aColor[0], aColor[1], aColor[2] ); + } - glColorPointer( 4, GL_FLOAT, sizeof(TVertex), (void*)0 ); - glVertexPointer( 3, GL_FLOAT, sizeof(TVertex), (void*)(4*sizeof(GLfloat)) ); + virtual + vtkIdType + GetTupleId( vtkIdType thePointId, vtkIdType theCellId ) = 0; +}; - glEnableClientState( GL_VERTEX_ARRAY ); - glEnableClientState( GL_COLOR_ARRAY ); - glDrawArrays( GL_POINTS, 0, this->TotalCells ); +//----------------------------------------------------------------------------- +struct TPointColors2Color : TColors2Color +{ + TPointColors2Color( vtkUnsignedCharArray *theColors ): + TColors2Color( theColors ) + {} + + virtual + vtkIdType + GetTupleId( vtkIdType thePointId, vtkIdType theCellId ) + { + return thePointId; + } +}; - glDisableClientState( GL_COLOR_ARRAY ); - glDisableClientState( GL_VERTEX_ARRAY ); - vglDeleteBuffersARB( 1, &aBufferObjectID ); +//----------------------------------------------------------------------------- +struct TCellColors2Color : TColors2Color +{ + TCellColors2Color( vtkUnsignedCharArray *theColors ): + TColors2Color( theColors ) + {} - //if( this->PrimitiveType == VISU_OpenGLPointSpriteMapper::OpenGLPoint ) - // glDisable( GL_POINT_SMOOTH ); + virtual + vtkIdType + GetTupleId( vtkIdType thePointId, vtkIdType theCellId ) + { + return theCellId; + } +}; + + +//----------------------------------------------------------------------------- +template < class TCoordinates > +void DrawPoints( TCoordinates *theStartPoints, + vtkCellArray *theCells, + TColorFunctorBase* theColorFunctor, + TVertex* theVertexArr, + vtkIdType &theCellId, + vtkIdType &theVertexId ) +{ + vtkIdType *ptIds = theCells->GetPointer(); + vtkIdType *endPtIds = ptIds + theCells->GetNumberOfConnectivityEntries(); + + while ( ptIds < endPtIds ) { + vtkIdType nPts = *ptIds; + ++ptIds; + + while ( nPts > 0 ) { + TVertex& aVertex = theVertexArr[ theVertexId ]; + vtkIdType aPointId = *ptIds; + + TCoordinates *anOffsetPoints = theStartPoints + 3 * aPointId; + aVertex.vx = anOffsetPoints[0]; + aVertex.vy = anOffsetPoints[1]; + aVertex.vz = anOffsetPoints[2]; + + theColorFunctor->get( aVertex, aPointId, theCellId ); + + ++theVertexId; + ++ptIds; + --nPts; + } + + ++theCellId; + } } + +//----------------------------------------------------------------------------- +template < class TCoordinates > +void DrawCellsPoints( vtkPolyData *theInput, + vtkPoints* thePoints, + TColorFunctorBase* theColorFunctor, + TVertex* theVertexArr ) +{ + vtkIdType aCellId = 0, aVertexId = 0; + + TCoordinates *aStartPoints = (TCoordinates *) thePoints->GetVoidPointer(0); + + if ( vtkCellArray* aCellArray = theInput->GetVerts() ) + DrawPoints( aStartPoints, aCellArray, theColorFunctor, theVertexArr, aCellId, aVertexId ); + + if ( vtkCellArray* aCellArray = theInput->GetLines() ) + DrawPoints( aStartPoints, aCellArray, theColorFunctor, theVertexArr, aCellId, aVertexId ); + + if ( vtkCellArray* aCellArray = theInput->GetPolys() ) + DrawPoints( aStartPoints, aCellArray, theColorFunctor, theVertexArr, aCellId, aVertexId ); + + if ( vtkCellArray* aCellArray = theInput->GetStrips() ) + DrawPoints( aStartPoints, aCellArray, theColorFunctor, theVertexArr, aCellId, aVertexId ); +} + + //----------------------------------------------------------------------------- int VISU_OpenGLPointSpriteMapper::Draw(vtkRenderer *theRenderer, vtkActor *theActor) { @@ -914,10 +999,82 @@ int VISU_OpenGLPointSpriteMapper::Draw(vtkRenderer *theRenderer, vtkActor *theAc } } - // we need to know the total number of cells so that we can report progress - this->TotalCells = input->GetVerts()->GetNumberOfCells(); + { + vtkIdType aTotalConnectivitySize = 0; + + if ( vtkCellArray* aCellArray = input->GetVerts() ) + aTotalConnectivitySize += aCellArray->GetNumberOfConnectivityEntries() - aCellArray->GetNumberOfCells(); + + if ( vtkCellArray* aCellArray = input->GetLines() ) + aTotalConnectivitySize += aCellArray->GetNumberOfConnectivityEntries() - aCellArray->GetNumberOfCells(); + + if ( vtkCellArray* aCellArray = input->GetPolys() ) + aTotalConnectivitySize += aCellArray->GetNumberOfConnectivityEntries() - aCellArray->GetNumberOfCells(); + + if ( vtkCellArray* aCellArray = input->GetStrips() ) + aTotalConnectivitySize += aCellArray->GetNumberOfConnectivityEntries() - aCellArray->GetNumberOfCells(); + + if ( aTotalConnectivitySize > 0 ) { + TVertex* aVertexArr = new TVertex[ aTotalConnectivitySize ]; + + vtkFloatingPointType aPropertyColor[3]; + theActor->GetProperty()->GetColor( aPropertyColor ); + + glPointSize( this->DefaultPointSize ); + + { + TColorFunctorBase* aColorFunctor = NULL; + if( colors && this->PointSpriteMode != 1 ) { + if ( cellScalars ) + aColorFunctor = new TCellColors2Color( colors ); + else + aColorFunctor = new TPointColors2Color( colors ); + } else { + aColorFunctor = new TPropertyColor( theActor->GetProperty() ); + } + if ( points->GetDataType() == VTK_FLOAT ) + ::DrawCellsPoints< float >( input, points, aColorFunctor, aVertexArr ); + else + ::DrawCellsPoints< double >( input, points, aColorFunctor, aVertexArr ); + + delete aColorFunctor; + } + + GLuint aBufferObjectID = 0; + vglGenBuffersARB( 1, &aBufferObjectID ); + vglBindBufferARB( GL_ARRAY_BUFFER_ARB, aBufferObjectID ); + + int anArrayObjectSize = sizeof( TVertex ) * aTotalConnectivitySize; + vglBufferDataARB( GL_ARRAY_BUFFER_ARB, anArrayObjectSize, aVertexArr, GL_STATIC_DRAW_ARB ); + + delete [] aVertexArr; + + vglBindBufferARB( GL_ARRAY_BUFFER_ARB, 0 ); + vglBindBufferARB( GL_ARRAY_BUFFER_ARB, aBufferObjectID ); + + glColorPointer( 4, GL_FLOAT, sizeof(TVertex), (void*)0 ); + glVertexPointer( 3, GL_FLOAT, sizeof(TVertex), (void*)(4*sizeof(GLfloat)) ); + + glEnableClientState( GL_VERTEX_ARRAY ); + glEnableClientState( GL_COLOR_ARRAY ); + + glDrawArrays( GL_POINTS, 0, aTotalConnectivitySize ); + + glDisableClientState( GL_COLOR_ARRAY ); + glDisableClientState( GL_VERTEX_ARRAY ); + + vglDeleteBuffersARB( 1, &aBufferObjectID ); + } + + input->GetVerts()->GetNumberOfCells() + + input->GetLines()->GetNumberOfCells() + + input->GetPolys()->GetNumberOfCells() + + input->GetStrips()->GetNumberOfCells(); + + + + } - this->DrawPoints(points, colors, input->GetVerts(), theActor); this->UpdateProgress(1.0); return noAbort; diff --git a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx index f7b29ea9..a36ff1c0 100755 --- a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx +++ b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx @@ -217,12 +217,6 @@ protected: VISU_OpenGLPointSpriteMapper(); ~VISU_OpenGLPointSpriteMapper(); - //! Internal method of the Point Sprites drawing. - void DrawPoints(vtkPoints *thePoints, - vtkUnsignedCharArray *theColors, - vtkCellArray *theCells, - vtkActor* theActor); - //! Initializing OpenGL extensions. bool InitExtensions(); diff --git a/src/PIPELINE/VISU_PipeLineUtils.cxx b/src/PIPELINE/VISU_PipeLineUtils.cxx index 33a97adc..6c31a356 100644 --- a/src/PIPELINE/VISU_PipeLineUtils.cxx +++ b/src/PIPELINE/VISU_PipeLineUtils.cxx @@ -84,6 +84,7 @@ namespace VISU bool theIsCopyInput) { // To customize vtkMapper::ShallowCopy ... + theTarget->SetLookupTable(theSource->GetLookupTable()); theTarget->SetScalarVisibility(theSource->GetScalarVisibility()); if(theIsCopyInput){ vtkFloatingPointType* aScalarRange = theSource->GetScalarRange(); diff --git a/src/VISU_I/VISU_GaussPoints_i.cc b/src/VISU_I/VISU_GaussPoints_i.cc index fdbd8b68..7d9a4152 100644 --- a/src/VISU_I/VISU_GaussPoints_i.cc +++ b/src/VISU_I/VISU_GaussPoints_i.cc @@ -31,7 +31,7 @@ #include "VISU_Result_i.hh" #include "VISU_GaussPtsAct.h" #include "VISU_GaussPointsPL.hxx" -#include "VVTK_SegmentationCursorDlg.h" +#include "VISU_GaussPtsDeviceActor.h" #include "VISU_OpenGLPointSpriteMapper.hxx" #include "VISU_ScalarBarCtrl.hxx" diff --git a/src/VVTK/VVTK_SegmentationCursorDlg.cxx b/src/VVTK/VVTK_SegmentationCursorDlg.cxx index 55b1fb7a..5730854a 100644 --- a/src/VVTK/VVTK_SegmentationCursorDlg.cxx +++ b/src/VVTK/VVTK_SegmentationCursorDlg.cxx @@ -68,83 +68,6 @@ #include "QtxDblSpinBox.h" #include "QtxIntSpinBox.h" -using namespace std; - - -//---------------------------------------------------------------- -namespace VISU -{ - inline - QString - Image2VTI(const QString& theImageFileName) - { - QFileInfo aFileInfo(theImageFileName); - QString aFormat = aFileInfo.extension(FALSE); -#ifdef WIN32 - QString aTmpDir = getenv( "TEMP" ); -#else - QString aTmpDir = QString( "/tmp/" ) + getenv("USER"); -#endif - QString aVTIName = aTmpDir + "-" + aFileInfo.baseName(TRUE) + ".vti"; - QString aCommand = QString( "VISU_img2vti " ) + aFormat + " " + theImageFileName + " " + aVTIName; - - if(system( aCommand.latin1() ) == 0) - return aVTIName; - - return QString::null; - } - - inline - void - RemoveFile(const QString& theFileName) - { - if( !theFileName.isNull() ){ -#ifndef WNT - QString aCommand = QString( "rm -fr " ) + theFileName; -#else: - QString aCommand = QString( "del /F " ) + theFileName; -#endif - system( aCommand.latin1() ); - } - } - - - TTextureValue - GetTexture(const QString& theMainTexture, - const QString& theAlphaTexture) - { - typedef std::pair TTextureKey; - typedef std::map TTextureMap; - - static TTextureMap aTextureMap; - - TTextureValue aTextureValue; - TTextureKey aTextureKey(theMainTexture.latin1(),theAlphaTexture.latin1()); - TTextureMap::const_iterator anIter = aTextureMap.find(aTextureKey); - if(anIter != aTextureMap.end()){ - aTextureValue = anIter->second; - }else{ - QString aMainTextureVTI = Image2VTI(theMainTexture); - QString anAlphaTextureVTI = Image2VTI(theAlphaTexture); - - if( !aMainTextureVTI.isNull() && !anAlphaTextureVTI.isNull() ){ - aTextureValue = - VISU_GaussPointsPL::MakeTexture( aMainTextureVTI.latin1(), - anAlphaTextureVTI.latin1()); - - if( aTextureValue.GetPointer() ) - aTextureMap[aTextureKey] = aTextureValue; - } - - RemoveFile(aMainTextureVTI); - RemoveFile(anAlphaTextureVTI); - } - - return aTextureValue; - } -} - - //---------------------------------------------------------------- VVTK_SegmentationCursorDlg::VVTK_SegmentationCursorDlg( QWidget* parent, const char* name ) :QDialog( parent, name, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ), diff --git a/src/VVTK/VVTK_SegmentationCursorDlg.h b/src/VVTK/VVTK_SegmentationCursorDlg.h index 50d17609..e6990ffe 100644 --- a/src/VVTK/VVTK_SegmentationCursorDlg.h +++ b/src/VVTK/VVTK_SegmentationCursorDlg.h @@ -26,6 +26,8 @@ #include "VVTK.h" +#include "VISU_GaussPtsDeviceActor.h" + #include #include @@ -57,14 +59,6 @@ class VVTK_SizeBox; class SVTK_RenderWindowInteractor; -namespace VISU -{ - typedef vtkSmartPointer TTextureValue; - - VVTK_EXPORT TTextureValue - GetTexture(const QString& theMainTexture, - const QString& theAlphaTexture); -} //! Segmentation Cursor Dialog. /*! -- 2.39.2