myExtractor->SetImplicitFunction(myFunction);
myPolyDataExtractor->SetImplicitFunction(myFunction);
- myExtractor->ExtractBoundaryCellsOn();
+ //myExtractor->ExtractBoundaryCellsOn();
+ //myPolyDataExtractor->ExtractBoundaryCellsOn();
myFunction->SetOperationTypeToIntersection();
#include "VISU_Event.h"
#include "SVTK_Actor.h"
+#include <SALOME_ExtractPolyDataGeometry.h>
#include <vtkCamera.h>
#include <vtkRenderer.h>
#include <vtkScalarBarWidget.h>
#include <vtkTextMapper.h>
#include <vtkTextProperty.h>
+#include <vtkImplicitBoolean.h>
+#include <vtkImplicitFunctionCollection.h>
+#include <vtkPlane.h>
#include <vtkPointData.h>
#include <vtkDataArray.h>
myBarVisibility(true),
myInsideCursorSettings(NULL),
myCurrentPL(NULL),
- myMapper(vtkPolyDataMapper::New())
+ myMapper(vtkPolyDataMapper::New()),
+ myPolyDataExtractor(SALOME_ExtractPolyDataGeometry::New()),
+ myFunction(vtkImplicitBoolean::New())
{
if(MYDEBUG) MESSAGE("VISU_GaussPtsAct::VISU_GaussPtsAct - this = "<<this);
myMapper->Delete();
+ myPolyDataExtractor->SetImplicitFunction(myFunction);
+ //myPolyDataExtractor->ExtractBoundaryCellsOn();
+
+ myFunction->SetOperationTypeToIntersection();
+ myPolyDataExtractor->Delete();
+ myFunction->Delete();
+
if( VISU_PickingSettings* aPickingSettings = VISU_PickingSettings::Get() )
aPickingSettings->AddObserver(VISU::UpdatePickingSettingsEvent,
myEventCallbackCommand.GetPointer(),
{
if(MYDEBUG) MESSAGE("VISU_GaussPtsAct::SetMapperInput - this = "<<this);
+ myDeviceActor->SetExtractor(myPolyDataExtractor);
myDeviceActor->SetPipeLine(GetGaussPointsPL());
myCurrentPL = myDeviceActor->GetPipeLine();
//SetMapper(myCurrentPL->GetPointSpriteMapper());
+ // myPolyDataExtractor->SetInput(myCurrentPL->GetPickableDataSet());
+ //myMapper->SetInput(myPolyDataExtractor->GetOutput());
myMapper->SetInput(myCurrentPL->GetPickableDataSet());
SetMapper(myMapper.GetPointer());
}
return aTime;
}
+void VISU_GaussPtsAct::RemoveAllClippingPlanes()
+{
+ myFunction->GetFunction()->RemoveAllItems();
+ myFunction->Modified();
+}
+
+vtkIdType VISU_GaussPtsAct::GetNumberOfClippingPlanes()
+{
+ return myFunction->GetFunction()->GetNumberOfItems();
+}
+
+bool VISU_GaussPtsAct::AddClippingPlane(vtkPlane* thePlane)
+{
+ vtkImplicitFunctionCollection* aFunctions = GetClippingPlanes();
+ aFunctions->InitTraversal();
+ vtkImplicitFunction* aItem;
+ while ((aItem = aFunctions->GetNextItem())) {
+ if (thePlane == aItem)
+ return false;
+ }
+ myFunction->AddFunction(thePlane);
+ return true;
+}
+
+vtkPlane* VISU_GaussPtsAct::GetClippingPlane(vtkIdType theID)
+{
+ vtkPlane* aPlane = NULL;
+ if ((theID >= 0) && (theID < GetNumberOfClippingPlanes())) {
+ vtkImplicitFunctionCollection* aFunction = myFunction->GetFunction();
+ vtkImplicitFunction* aFun = NULL;
+ aFunction->InitTraversal();
+ for (vtkIdType i = 0; i <= theID; i++)
+ aFun = aFunction->GetNextItem();
+ aPlane = dynamic_cast<vtkPlane*>(aFun);
+ }
+ return aPlane;
+}
+
+vtkImplicitFunctionCollection* VISU_GaussPtsAct::GetClippingPlanes()
+{
+ return myFunction->GetFunction();
+}
+
+
+
//==============================================================================
vtkStandardNewMacro(VISU_GaussPtsAct1);
class VISU_InsideCursorSettings;
class VISU_OutsideCursorSettings;
+class SALOME_ExtractPolyDataGeometry;
+class vtkImplicitBoolean;
//============================================================================
//! Base class for Gauss Points Actors.
unsigned long int
GetMTime();
+ //----------------------------------------------------------------------------
+ virtual void RemoveAllClippingPlanes();
+
+ virtual vtkIdType GetNumberOfClippingPlanes();
+
+ virtual bool AddClippingPlane(vtkPlane* thePlane);
+
+ virtual vtkPlane* GetClippingPlane(vtkIdType theID);
+
+ virtual vtkImplicitFunctionCollection* GetClippingPlanes();
+
protected:
//----------------------------------------------------------------------------
VISU_GaussPtsAct();
vtkSmartPointer<VISU_GaussPointsPL> myGaussPointsPL;
vtkSmartPointer<vtkPolyDataMapper> myMapper;
+ vtkSmartPointer<SALOME_ExtractPolyDataGeometry> myPolyDataExtractor;
+ vtkSmartPointer<vtkImplicitBoolean> myFunction;
vtkIdType myLastPreHighlightObjID;
#include "VTKViewer_Transform.h"
#include "VTKViewer_TransformFilter.h"
+#include <SALOME_ExtractPolyDataGeometry.h>
#include <vtkObjectFactory.h>
#include <vtkPolyData.h>
VISU_GaussDeviceActorBase
::VISU_GaussDeviceActorBase():
- myTransformFilter(VTKViewer_TransformFilter::New())
+ myTransformFilter(VTKViewer_TransformFilter::New()),
+ myPolyDataExtractor(0)
{
if(MYDEBUG) MESSAGE("VISU_GaussDeviceActorBase - "<<this);
myMapper = theMapper;
int anId = 0;
- myPassFilter[ anId ]->SetInput( aDataSet );
+ if (myPolyDataExtractor) {
+ myPolyDataExtractor->SetInput(aDataSet);
+ myPassFilter[ anId ]->SetInput( myPolyDataExtractor->GetOutput() );
+ } else {
+ myPassFilter[ anId ]->SetInput( aDataSet );
+ }
myPassFilter[ anId + 1 ]->SetInput( myPassFilter[ anId ]->GetOutput() );
-
+
anId++;
myTransformFilter->SetInput( myPassFilter[ anId ]->GetPolyDataOutput() );
class vtkPassThroughFilter;
class vtkImageData;
+class SALOME_ExtractPolyDataGeometry;
//============================================================================
virtual
unsigned long int
GetMemorySize();
+
+ //----------------------------------------------------------------------------
+ void SetExtractor(SALOME_ExtractPolyDataGeometry* theExtractor)
+ { myPolyDataExtractor = theExtractor; }
+
+ SALOME_ExtractPolyDataGeometry* GetExtractor() const
+ { return myPolyDataExtractor; }
protected:
//----------------------------------------------------------------------------
typedef vtkSmartPointer<vtkPassThroughFilter> PPassThroughFilter;
std::vector<PPassThroughFilter> myPassFilter;
+ SALOME_ExtractPolyDataGeometry* myPolyDataExtractor;
+
VISU_GaussDeviceActorBase();
~VISU_GaussDeviceActorBase();
myHelp( 0 )
{
// Create scroll view
- //myView = new QScrollArea( this );
+ myView = new QScrollArea( this );
// Create main frame
- myMainFrame = new MainFrame( this/*myView*/ );
- //myMainFrame->setFrameStyle( QFrame::Plain | QFrame::NoFrame );
- /*
+ myMainFrame = new MainFrame( myView );
+ myMainFrame->setFrameStyle( QFrame::Plain | QFrame::NoFrame );
+
myView->setWidget( myMainFrame );
myView->setAlignment( Qt::AlignCenter );
myView->setWidgetResizable( true );
- myView->setMinimumWidth( myMainFrame->sizeHint().width() + MARGIN_SIZE * 2 );
- */
+ myView->setMinimumWidth( myMainFrame->sizeHint().width() + 22 );
+
// Create buttons
QWidget* aBtnWg = new QWidget( this );
QHBoxLayout* aBtnWgLayout = new QHBoxLayout( aBtnWg );
- aBtnWgLayout->setSpacing( 5 );
+ //aBtnWgLayout->setSpacing( 5 );
aBtnWgLayout->addStretch();
// fill layout
QVBoxLayout* aLay = new QVBoxLayout( this );
aLay->setContentsMargins( 0, 0, 0, 0 );
- aLay->setSpacing( 5 );
- aLay->addWidget( myMainFrame/*myView*/, 1 );
+ //aLay->setSpacing( 5 );
+ aLay->addWidget( myView, 1 );
aLay->addWidget( aBtnWg );
}
vtkActorCollection* anActors = myWindow->getRenderer()->GetActors();
anActors->InitTraversal();
- vtkActor* aActor = 0;
+ vtkActor* aActor = anActors->GetNextActor();
VISU_Actor* aVisuActor = 0;
- while ( (aActor = anActors->GetNextActor()) ) {
+ while (aActor) {
aVisuActor = VISU_Actor::SafeDownCast(aActor);
if (aVisuActor) {
applyPlanes(aVisuActor);
}
+ aActor = anActors->GetNextActor();
}
+ myWindow->Repaint();
}
//****************************************************************
{
for (int i = 0; i < myListOfPlanes.size(); i++) {
PlaneDef aPlane = myListOfPlanes.at(i);
- if (aPlane.isAuto && (!isContainsPlane(theActor, aPlane.plane))) {
+ if (aPlane.isAuto && (!isContainsPlane(theActor, aPlane.plane))) {
theActor->AddClippingPlane(aPlane.plane);
}
}
- myWindow->Repaint();
}
using namespace std;
-#define MARGIN_SIZE 11
+#define MARGIN_SIZE 3
VisuGUI_SelectionPanel::VisuGUI_SelectionPanel( const SalomeApp_Module* theModule, QWidget* theParent ) :
VisuGUI_BasePanel( tr("WINDOW_TITLE" ), theParent, /*ApplyBtn | */CloseBtn | HelpBtn ),
mySelectionMgr( 0 )
{
QVBoxLayout* TopLayout = new QVBoxLayout ( mainFrame() );
- TopLayout->setSpacing(6);
- TopLayout->setMargin(MARGIN_SIZE);
+ //TopLayout->setSpacing(6);
+ //TopLayout->setMargin(MARGIN_SIZE);
QWidget* aNamePane = new QWidget (mainFrame());
QGridLayout* aNameLay = new QGridLayout (aNamePane);
QGroupBox* aDataGrp = new QGroupBox ( tr("POINT_DATA_TITLE"), myPointsPane);
QGridLayout* aGridLay = new QGridLayout (aDataGrp);
- aGridLay->setSpacing(6);
+ //aGridLay->setSpacing(6);
aGridLay->addWidget( new QLabel (tr("DATA_ID_LBL"), aDataGrp) , 0, 0 );
aGridLay->addWidget( new QLabel (tr("DATA_SCALAR_LBL"), aDataGrp), 1, 0 );
QGroupBox* aCoordGrp = new QGroupBox ( tr("POINT_COORD_TITLE"), myPointsPane);
aGridLay = new QGridLayout (aCoordGrp);
- aGridLay->setSpacing(6);
+ //aGridLay->setSpacing(6);
aGridLay->addWidget( new QLabel ("X:", aCoordGrp), 0, 0 );
myXValLbl = new QLabel ("", aCoordGrp);
// Create Cells pane
myCellsPane = new QWidget (mainFrame());
QGridLayout* aCellLayout = new QGridLayout (myCellsPane);
- aCellLayout->setSpacing(6);
+ //aCellLayout->setSpacing(6);
aCellLayout->setRowStretch(0, 0);
aCellLayout->setRowStretch(1, 1);
// Actor Pane
myActorsPane = new QWidget (mainFrame());
aVBoxLayout = new QVBoxLayout(myActorsPane);
- aVBoxLayout->setSpacing(6);
+ //aVBoxLayout->setSpacing(6);
QGroupBox* aPosGrp = new QGroupBox (tr("ACTOR_DATA_POSITION_TITLE"), myActorsPane);
aGridLay = new QGridLayout (aPosGrp);
- aGridLay->setSpacing(6);
+ //aGridLay->setSpacing(6);
aGridLay->addWidget( new QLabel ("X:", aPosGrp), 0, 0);
myXPosLbl = new QLabel ("0", aPosGrp);
aGridLay->addWidget( myXPosLbl, 0, 1);
QGroupBox* aSizeGrp = new QGroupBox ( tr("ACTOR_DATA_SIZE_TITLE"), myActorsPane);
aGridLay = new QGridLayout (aSizeGrp);
- aGridLay->setSpacing(6);
+ //aGridLay->setSpacing(6);
aGridLay->addWidget( new QLabel ("dX:", aSizeGrp ), 0, 0);
myDXLbl = new QLabel ("0", aSizeGrp);
aGridLay->addWidget( myDXLbl, 0, 1);
QGridLayout* InfoWindowGroupLayout = new QGridLayout (myInfoWindowGroup);
InfoWindowGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
- InfoWindowGroupLayout->setSpacing(6);
- InfoWindowGroupLayout->setMargin(11);
+ //InfoWindowGroupLayout->setSpacing(6);
+ //InfoWindowGroupLayout->setMargin(11);
QLabel* TransparencyLabel = new QLabel( tr( "TRANSPARENCY" ), myInfoWindowGroup );
myTransparencySpinBox = new QtxIntSpinBox( 0, 100, 10, myInfoWindowGroup );
- myTransparencySpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ //myTransparencySpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
InfoWindowGroupLayout->addWidget( TransparencyLabel, 0, 0 );
InfoWindowGroupLayout->addWidget( myTransparencySpinBox, 0, 1 );
QLabel* PositionLabel = new QLabel( tr( "POSITION" ), myInfoWindowGroup );
myPositionComboBox = new QComboBox( myInfoWindowGroup );
- myPositionComboBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ //myPositionComboBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myPositionComboBox->addItem( tr( "BELOW_POINT" ) );
myPositionComboBox->addItem( tr( "TOP_LEFT_CORNER" ) );
QGridLayout* CameraGroupLayout = new QGridLayout (myCameraGroup);
CameraGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
- CameraGroupLayout->setSpacing(6);
- CameraGroupLayout->setMargin(11);
+ //CameraGroupLayout->setSpacing(6);
+ //CameraGroupLayout->setMargin(11);
QLabel* ZoomFactorLabel = new QLabel( tr( "ZOOM_FACTOR" ), myCameraGroup );
myZoomFactorSpinBox = new QtxDoubleSpinBox( 0.1, 10.0, 0.1, myCameraGroup );
- myZoomFactorSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ //myZoomFactorSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
QLabel* StepNumberLabel = new QLabel( tr( "STEP_NUMBER" ), myCameraGroup );
StepNumberLabel->setToolTip( tr( "STEP_NUMBER_TIP" ) );
myStepNumberSpinBox = new QtxIntSpinBox( 1, 100, 1, myCameraGroup );
- myStepNumberSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ //myStepNumberSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
CameraGroupLayout->addWidget( ZoomFactorLabel, 0, 0 );
CameraGroupLayout->addWidget( myZoomFactorSpinBox, 0, 1 );