VisuGUI_Timer.cxx \
VisuGUI_Slider.cxx \
VisuGUI_InputPane.cxx \
- VisuGUI_CacheDlg.cxx
+ VisuGUI_CacheDlg.cxx \
+ VisuGUI_FieldFilter.cxx
LIB_MOC = VisuGUI.h \
VisuGUI_Module.h \
myScalarPane = new VisuGUI_ScalarBarPane(this, false);
myScalarPane->setMargin( 5 );
- myInputPane = new VisuGUI_InputPane(theModule, this);
+ myInputPane = new VisuGUI_InputPane(VISU::TCUTLINES, theModule, this);
myTabBox->addTab(myScalarPane, "Scalar Bar");
myTabBox->addTab(myInputPane, "Input");
myTabBox->addTab(myCutPane, "Cut Planes");
myScalarPane = new VisuGUI_ScalarBarPane(this, false);
myScalarPane->setMargin(5);
- myInputPane = new VisuGUI_InputPane(theModule, this);
+ myInputPane = new VisuGUI_InputPane(VISU::TCUTPLANES, theModule, this);
myTabBox->addTab(myScalarPane, "Scalar Bar");
myTabBox->addTab(myInputPane, "Input");
// Scalar bar pane
myScalarPane = new VisuGUI_ScalarBarPane (this, false);
myScalarPane->setMargin(5);
- myInputPane = new VisuGUI_InputPane(theModule, this);
+ myInputPane = new VisuGUI_InputPane(VISU::TDEFORMEDSHAPE, theModule, this);
myTabBox->addTab(myScalarPane, tr("SCALAR_BAR_TAB"));
myTabBox->addTab(myInputPane, tr("INPUT_TAB"));
--- /dev/null
+// VISU VISUGUI : GUI of VISU component
+//
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+// File : VisuGUI_FieldFilter.cxx
+// Author : Oleg UVAROV
+// Module : VISU
+
+#include "VisuGUI_FieldFilter.h"
+
+#include "VisuGUI_Tools.h"
+
+#include "VISUConfig.hh"
+#include "VISU_ColoredPrs3dFactory.hh"
+
+#include <SUIT_Session.h>
+
+#include <SalomeApp_Study.h>
+#include <LightApp_DataOwner.h>
+
+using namespace VISU;
+
+VisuGUI_FieldFilter::VisuGUI_FieldFilter( VISU::VISUType theType ) :
+ myType( theType )
+{
+}
+
+VisuGUI_FieldFilter::~VisuGUI_FieldFilter()
+{
+}
+
+bool VisuGUI_FieldFilter::isOk( const SUIT_DataOwner* theDataOwner ) const
+{
+ const LightApp_DataOwner* anOwner =
+ dynamic_cast<const LightApp_DataOwner*>( theDataOwner );
+
+ SalomeApp_Study* anAppStudy = dynamic_cast<SalomeApp_Study*>
+ (SUIT_Session::session()->activeApplication()->activeStudy());
+
+ if( anOwner && anAppStudy )
+ {
+ _PTR(Study) aStudy = anAppStudy->studyDS();
+ _PTR(SObject) aSObject = aStudy->FindObjectID( anOwner->entry() );
+ if (!aSObject)
+ return false;
+
+ _PTR(SObject) aRefSO;
+ if( aSObject->ReferencedObject( aRefSO ) )
+ aSObject = aRefSO;
+
+ if( !aSObject )
+ return false;
+
+ _PTR(GenericAttribute) anAttr;
+ if( !aSObject->FindAttribute( anAttr, "AttributeComment" ) )
+ return false;
+
+ _PTR(AttributeComment) aComment( anAttr );
+ string aComm = aComment->Value();
+ QString strIn( aComm.c_str() );
+
+ bool isExist;
+ VISU::Storable::TRestoringMap aMap;
+ VISU::Storable::StrToMap( strIn, aMap );
+ VISU::VISUType aType = ( VISU::VISUType )VISU::Storable::FindValue( aMap, "myType", &isExist ).toInt();
+
+ if( aType == VISU::TFIELD )
+ {
+ VISU::Result_var aResult = FindResult( VISU::GetSObject( aSObject ).in() );
+ QString aMeshName = VISU::getValue( aSObject, "myMeshName" );
+ int anEntity = VISU::getValue( aSObject, "myEntityId" ).toInt();
+ QString aFieldName = VISU::getValue( aSObject, "myName" );
+
+ VISU::ColoredPrs3dHolder::BasicInput anInput;
+ anInput.myResult = aResult;
+ anInput.myMeshName = CORBA::string_dup( aMeshName.latin1() );
+ anInput.myEntity = (VISU::Entity)anEntity;
+ anInput.myFieldName = CORBA::string_dup( aFieldName.latin1() );
+ anInput.myTimeStampNumber = 1;
+
+ size_t isOk = VISU::CheckIsPossible( myType, anInput, true );
+ return isOk > 0;
+ }
+ }
+ return false;
+}
--- /dev/null
+// Copyright (C) 2005 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File : VisuGUI_FieldFilter.hxx
+// Author : Oleg UVAROV
+// Module : VISU
+
+#ifndef VISUGUI_FIELDFILTER_H
+#define VISUGUI_FIELDFILTER_H
+
+#include "VISUConfig.hh"
+
+#include "SUIT_SelectionFilter.h"
+
+class SUIT_DataOwner;
+
+class VisuGUI_FieldFilter : public SUIT_SelectionFilter
+{
+public:
+ VisuGUI_FieldFilter( VISU::VISUType theType );
+ ~VisuGUI_FieldFilter();
+
+ virtual bool isOk( const SUIT_DataOwner* ) const;
+
+private:
+ VISU::VISUType myType;
+};
+
+#endif
myScalarPane->setMargin(5);
// Input pane
- myInputPane = new VisuGUI_InputPane(theModule, this);
+ myInputPane = new VisuGUI_InputPane(VISU::TGAUSSPOINTS, theModule, this);
connect( myResultsButton, SIGNAL( clicked() ), mySizeBox, SLOT( onToggleResults() ) );
connect( myResultsButton, SIGNAL( toggled( bool ) ), myScalarPane, SLOT( setEnabled( bool ) ) );
#include "VisuGUI_InputPane.h"
+#include "VisuGUI_FieldFilter.h"
#include "VisuGUI_Tools.h"
#include "VISU_ColoredPrs3d_i.hh"
using namespace VISU;
-VisuGUI_InputPane::VisuGUI_InputPane( SalomeApp_Module* theModule, QWidget* parent ) :
+VisuGUI_InputPane::VisuGUI_InputPane( VISU::VISUType theType, SalomeApp_Module* theModule, QWidget* parent ) :
QGroupBox( 2, Qt::Horizontal, parent ),
myModule( theModule )
{
- //SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
-
setFrameStyle( QFrame::Box | QFrame::Sunken );
- LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr( myModule );
- connect( aSelectionMgr, SIGNAL( selectionChanged() ), SLOT( onSelectionChanged() ) );
+ connect( mySelectionMgr, SIGNAL( selectionChanged() ), SLOT( onSelectionChanged() ) );
new QLabel( "Med File : ", this );
myMedFile = new QLineEdit( this );
new QLabel( "Time Stamp : ", this );
myTimeStamps = new QComboBox( this );
+ myFieldFilter = new VisuGUI_FieldFilter( theType );
+ GetSelectionMgr( theModule )->installFilter( myFieldFilter );
+
onSelectionChanged();
hide();
VisuGUI_InputPane::~VisuGUI_InputPane()
{
+ GetSelectionMgr( myModule )->removeFilter( myFieldFilter );
+
+ if( myFieldFilter )
+ {
+ delete myFieldFilter;
+ myFieldFilter = 0;
+ }
}
bool VisuGUI_InputPane::check()
void VisuGUI_InputPane::onSelectionChanged()
{
- clear();
+ //clear();
SALOME_ListIO aListIO;
GetSelectionMgr( myModule )->selectedObjects(aListIO);
if( !aMedObject )
return;
+ myTimeStamps->clear();
+
QString anEntityName, aTimeStampName;
_PTR(StudyBuilder) aBuilder = aCStudy->NewBuilder();
class QLineEdit;
class SalomeApp_Module;
+class LightApp_SelectionMgr;
+
+class VisuGUI_FieldFilter;
namespace VISU
{
Q_OBJECT
public:
- VisuGUI_InputPane( SalomeApp_Module* theModule, QWidget* parent );
+ VisuGUI_InputPane( VISU::VISUType theType, SalomeApp_Module* theModule, QWidget* parent );
virtual ~VisuGUI_InputPane();
public:
VISU::Result_var myResult;
int myEntity;
+
+ LightApp_SelectionMgr* mySelectionMgr;
+ VisuGUI_FieldFilter* myFieldFilter;
};
#endif
myScalarPane = new VisuGUI_ScalarBarPane(this, false);
myIsoPane->setScalarBarPane(myScalarPane);
myScalarPane->setMargin( 5 );
- myInputPane = new VisuGUI_InputPane(theModule, this);
+ myInputPane = new VisuGUI_InputPane(VISU::TISOSURFACE, theModule, this);
myTabBox->addTab(myScalarPane, "Scalar Bar");
myTabBox->addTab(myInputPane, "Input");
myTabBox->addTab(myIsoPane, tr("PLOT3D_TAB_TITLE"));
myScalarPane = new VisuGUI_ScalarBarPane (this, false);
myScalarPane->setMargin(5);
- myInputPane = new VisuGUI_InputPane(theModule, this);
+ myInputPane = new VisuGUI_InputPane(VISU::TPLOT3D, theModule, this);
myTabBox->addTab(myScalarPane, tr("SCALAR_BAR_TAB_TITLE"));
myTabBox->addTab(myInputPane, tr("INPUT_TAB_TITLE"));
myTabBox = new QTabWidget(this);
myScalarPane = new VisuGUI_ScalarBarPane(this, SetPref);
myScalarPane->setMargin( 5 );
- myInputPane = new VisuGUI_InputPane(theModule, this);
+ myInputPane = new VisuGUI_InputPane(VISU::TSCALARMAP, theModule, this);
myTabBox->addTab(myScalarPane, "Scalar Bar");
myTabBox->addTab(myInputPane, "Input");
// Scalar bar pane
myScalarPane = new VisuGUI_ScalarBarPane (this, false);
myScalarPane->setMargin(5);
- myInputPane = new VisuGUI_InputPane(theModule, this);
+ myInputPane = new VisuGUI_InputPane(VISU::TSCALARMAPONDEFORMEDSHAPE, theModule, this);
myTabBox->addTab(myScalarPane, tr("SCALAR_BAR_TAB"));
myTabBox->addTab(myInputPane, tr("INPUT_TAB"));
myTabBox->addTab(aTopBox, "Stream Lines");
myScalarPane = new VisuGUI_ScalarBarPane(this, false);
myScalarPane->setMargin( 5 );
- myInputPane = new VisuGUI_InputPane(theModule, this);
+ myInputPane = new VisuGUI_InputPane(VISU::TSTREAMLINES, theModule, this);
myTabBox->addTab(myScalarPane, "Scalar Bar");
myTabBox->addTab(myInputPane, "Input");
myTabBox->addTab(aBox, "Vectors");
myScalarPane = new VisuGUI_ScalarBarPane(this, false);
myScalarPane->setMargin( 5 );
- myInputPane = new VisuGUI_InputPane(theModule, this);
+ myInputPane = new VisuGUI_InputPane(VISU::TVECTORS, theModule, this);
myTabBox->addTab(myScalarPane, "Scalar Bar");
myTabBox->addTab(myInputPane, "Input");