myIsColored = theColored;
}
+bool
+VISU::GaussPoints_i
+::SetMainTexture( const QString& theMainTexture )
+{
+ bool update = myMainTexture != theMainTexture;
+ myMainTexture = theMainTexture;
+ return update;
+}
+
+const QString&
+VISU::GaussPoints_i
+::GetMainTexture()
+{
+ return myMainTexture;
+}
+
+bool
+VISU::GaussPoints_i
+::SetAlphaTexture( const QString& theAlphaTexture )
+{
+ bool update = myAlphaTexture != theAlphaTexture;
+ myAlphaTexture = theAlphaTexture;
+ return update;
+}
+
+const QString&
+VISU::GaussPoints_i
+::GetAlphaTexture()
+{
+ return myAlphaTexture;
+}
+
//----------------------------------------------------------------------------
void
VISU::GaussPoints_i
::GetPipeLine()
{
- // We create a new PipeLine instamce in order to provide
- // different representation for different actors (basic and segmented)
+ // We create a new PipeLine instance in order to provide
+ // different representations for different actors (basic and segmented)
VISU_GaussPointsPL* aPipeLine = VISU_GaussPointsPL::New();
aPipeLine->ShallowCopy(myPipeLine);
aPipeLine->Update();
//----------------------------------------------------------------------------
-VISU_Actor*
+VISU_GaussPtsAct*
VISU::GaussPoints_i
-::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
+::OnCreateActor(bool theIsSegmented,
+ const Handle(SALOME_InteractiveObject)& theIO)
{
- VISU_GaussPtsAct* anActor = VISU_GaussPtsAct::New();
+ VISU_GaussPtsAct* anActor = VISU_GaussPtsAct::New(theIsSegmented);
try{
VISU::Prs3d_i::CreateActor(anActor,theIO);
+ anActor->GetPipeLine()->Delete();
anActor->SetRepresentation(VTK_POINTS);
UpdateActor(anActor);
}catch(...){
return anActor;
}
+VISU_Actor*
+VISU::GaussPoints_i
+::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
+{
+ return OnCreateActor(false,theIO);
+}
+
//----------------------------------------------------------------------------
VISU_GaussPtsAct*
VISU::GaussPoints_i
::CloneActor(VISU_GaussPtsAct* theActor)
{
- if(VISU_GaussPtsAct* anActor = dynamic_cast<VISU_GaussPtsAct*>(CreateActor())){
+ if(MYDEBUG) MESSAGE("GaussPoints_i::CloneActor - this = "<<this);
+ if(VISU_GaussPtsAct* anActor = OnCreateActor(true)){
theActor->Connect(anActor);
return anActor;
}
myColor.blue() / 255.0);
}
VISU::ScalarMap_i::UpdateActor(theActor);
- anActor->GetPSMapper()->ShallowCopy(myGaussPointsPL->GetPSMapper());
}
}
VISU::GaussPoints_i
::UpdateFromActor(VISU_GaussPtsAct* theActor)
{
- bool aChangeMagnification = theActor->ChangeMagnification();
if(MYDEBUG) MESSAGE("GaussPoints_i::UpdateFromActor - this = "<<this);
- myGaussPointsPL->ChangeMagnification(aChangeMagnification);
+ myGaussPointsPL->ChangeMagnification(theActor->ChangeMagnification());
UpdateActors();
}
//cout << command2.latin1() << endl;
bool convertAlphaTexture = system( command2.latin1() ) == 0;
- if( convertMainTexture && convertAlphaTexture )
- myGaussPointsPL->SetImageData( VISU_GaussPointsPL::MakeTexture( mainTextureVTI.latin1(),
- alphaTextureVTI.latin1() ) );
+ if( convertMainTexture && convertAlphaTexture ){
+ vtkImageData* anImageData =
+ VISU_GaussPointsPL::MakeTexture( mainTextureVTI.latin1(),
+ alphaTextureVTI.latin1());
+ myGaussPointsPL->SetImageData( anImageData );
+ anImageData->Delete();
+ }
}
explicit
GaussPoints_i(Result_i* theResult,
SALOMEDS::SObject_ptr theSObject);
- virtual ~GaussPoints_i();
- virtual VISU::VISUType GetType() { return VISU::TGAUSSPOINTS;};
+ virtual
+ ~GaussPoints_i();
+
+ virtual
+ VISU::VISUType
+ GetType()
+ {
+ return VISU::TGAUSSPOINTS;
+ }
typedef VISU::GaussPoints TInterface;
ShowColored( bool theColored );
bool
- SetMainTexture( const QString& theMainTexture ) {
- bool update = myMainTexture != theMainTexture;
- myMainTexture = theMainTexture;
- return update;
- }
+ SetMainTexture( const QString& theMainTexture );
- QString GetMainTexture() { return myMainTexture; }
+ const QString&
+ GetMainTexture();
bool
- SetAlphaTexture( const QString& theAlphaTexture ) {
- bool update = myAlphaTexture != theAlphaTexture;
- myAlphaTexture = theAlphaTexture;
- return update;
- }
+ SetAlphaTexture( const QString& theAlphaTexture );
- QString
- GetAlphaTexture() { return myAlphaTexture; }
+ const QString&
+ GetAlphaTexture();
void
SetTextures( const QString& theMainTexture,
VISU_PipeLine*
GetPipeLine();
+ VISU_GaussPtsAct*
+ OnCreateActor(bool theIsSegmented,
+ const Handle(SALOME_InteractiveObject)& theIO = NULL);
+
VISU_GaussPointsPL *myGaussPointsPL;
bool myIsColored;
using namespace std;
#ifdef _DEBUG_
-static int MYDEBUG = 0;
+static int MYDEBUG = 1;
#else
static int MYDEBUG = 0;
#endif
::UpdateActor(VISU_Actor* theActor)
{
if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActor - this = "<<this<<"; theActor = "<<theActor);
- theActor->GetMapper()->ShallowCopy(myPipeLine->GetMapper());
+ theActor->ShallowCopyPL(myPipeLine);
theActor->SetPosition(myOffset);
theActor->Modified();
}
myImplicitFunctionWidget->SetInteractor(NULL);
}
+//----------------------------------------------------------------------------
+void
+VVTK_Renderer1
+::AddActor(VTKViewer_Actor* theActor)
+{
+ if(VISU_GaussPtsAct* anActor = dynamic_cast<VISU_GaussPtsAct*>(theActor)){
+ anActor->SetImplicitFunctionWidget(GetImplicitFunctionWidget());
+ SVTK_Renderer::AddActor(anActor);
+ }
+}
+
+//----------------------------------------------------------------------------
+void
+VVTK_Renderer1
+::RemoveActor(VTKViewer_Actor* theActor)
+{
+ using namespace VISU;
+ if(VISU_GaussPtsAct* anActor = dynamic_cast<VISU_GaussPtsAct*>(theActor)){
+ SVTK_Renderer::RemoveActor(theActor);
+ }
+}
//----------------------------------------------------------------------------
void
VVTK_Renderer1
::SetRenderer1(VVTK_Renderer1* theRenderer)
{
myRenderer1 = theRenderer;
- VISU_ImplicitFunctionWidget* aWidget = myRenderer1->GetImplicitFunctionWidget();
- aWidget->AddObserver(vtkCommand::EndInteractionEvent,
+ myWidget = myRenderer1->GetImplicitFunctionWidget();
+ myWidget->AddObserver(vtkCommand::EndInteractionEvent,
myEventCallbackCommand.GetPointer(),
myPriority);
- aWidget->AddObserver(vtkCommand::EnableEvent,
+ myWidget->AddObserver(vtkCommand::EnableEvent,
myEventCallbackCommand.GetPointer(),
myPriority);
- aWidget->AddObserver(vtkCommand::DisableEvent,
+ myWidget->AddObserver(vtkCommand::DisableEvent,
myEventCallbackCommand.GetPointer(),
myPriority);
- myImplicitFunction = aWidget->ImplicitFunction();
}
void
VVTK_Renderer2
::AddActor(VTKViewer_Actor* theActor)
{
- using namespace VISU;
if(VISU_GaussPtsAct* anActor = dynamic_cast<VISU_GaussPtsAct*>(theActor)){
- if(TGaussPtsActorFactory* aFactory = anActor->GetGaussPtsFactory()){
+ if(VISU::TGaussPtsActorFactory* aFactory = anActor->GetGaussPtsFactory()){
if(VISU_GaussPtsAct* anActor2 = aFactory->CloneActor(anActor)){
- anActor2->GetGaussPointsPL()->SetImplicitFunction(myImplicitFunction.GetPointer());
+ anActor2->SetImplicitFunctionWidget(myWidget);
SVTK_Renderer::AddActor(anActor2);
}
}
{
using namespace VISU;
if(VISU_GaussPtsAct* anActor = dynamic_cast<VISU_GaussPtsAct*>(theActor)){
- anActor->GetGaussPointsPL()->SetImplicitFunction(NULL);
SVTK_Renderer::RemoveActor(theActor);
}
}
vtkTypeMacro(VVTK_Renderer1,SVTK_Renderer);
static VVTK_Renderer1* New();
+ virtual
+ void
+ AddActor(VTKViewer_Actor* theActor);
+
+ virtual
+ void
+ RemoveActor(VTKViewer_Actor* theActor);
+
virtual
void
SetInteractor(vtkRenderWindowInteractor* theInteractor);
// Priority at which events are processed
float myPriority;
- vtkSmartPointer<vtkImplicitFunction> myImplicitFunction;
+ VISU_ImplicitFunctionWidget* myWidget;
VVTK_Renderer1* myRenderer1;
};
#include "VVTK_SegmentationCursorDlg.h"
#include "SUIT_ResourceMgr.h"
+#include "SUIT_Accel.h"
#include "QtxAction.h"
#include <qtoolbar.h>
{
myInteractorStyle->Delete();
- this->moveDockWindow(myToolBar,Qt::DockLeft);
+ moveDockWindow(myToolBar,Qt::DockLeft);
+ myActionsMap[NonIsometric]->removeFrom(myToolBar);
myPtsToolBar = new QToolBar(this);
myPtsToolBar->setCloseMode(QDockWindow::Undocked);
myPtsToolBar->setLabel(tr("LBL_TOOLBAR_LABEL"));
- this->moveDockWindow(myPtsToolBar,Qt::DockLeft);
+ moveDockWindow(myPtsToolBar,Qt::DockLeft);
QPixmap aPixmap;
QtxAction* anAction;
SetSelectionMode(theIsSelectionOn? NodeSelection: ActorSelection);
}
+//----------------------------------------------------------------------------
+int
+convertAction( const int accelAction );
+
+void
+VVTK_MainWindowBase
+::action( const int accelAction )
+{
+ if ( accelAction == SUIT_Accel::ZoomFit )
+ onFitAll();
+ else {
+ int anEvent = convertAction( accelAction );
+ InvokeEvent( anEvent, 0 );
+ }
+}
+
//----------------------------------------------------------------------------
VVTK_MainWindow1
#endif
#include "VVTK.h"
-#include "SVTK_View.h"
+#include "SVTK_MainWindow.h"
class VVTK_Renderer1;
class VVTK_Renderer2;
void OnInteractorStyleSwitch(bool theIsGaussStyleOn);
void OnSelectionModeSwitch(bool theIsSelectionOn);
+ virtual
+ void
+ action( const int );
+
protected:
QToolBar* myPtsToolBar;
vtkSmartPointer<vtkInteractorStyle> myInteractorStyle;
#include "VVTK_ViewModel.h"
#include "VVTK_ViewWindow.h"
-#include "SVTK_RenderWindowInteractor.h"
#include "SVTK_View.h"
+#include "SVTK_MainWindow.h"
+#include "SVTK_RenderWindowInteractor.h"
#include "VTKViewer_ViewModel.h"
#include "VVTK_ViewWindow.h"
#include "VVTK_ViewModel.h"
#include "VVTK_View.h"
+#include "SVTK_View.h"
#include "SUIT_Session.h"
myMainWindow1->onFitAll();
myMainWindow2->onFitAll();
}
+
+//----------------------------------------------------------------------------
+void
+VVTK_ViewWindow
+::action( const int accelAction )
+{
+ if(myMainWindow1->hasFocus())
+ myMainWindow1->action(accelAction);
+ if(myMainWindow2->hasFocus())
+ myMainWindow2->action(accelAction);
+}
onFitAll();
protected:
+ virtual
+ void
+ action( const int );
+
VVTK_MainWindow1* myMainWindow1;
SVTK_View* myView1;