-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016 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
#include <GeometryGUI.h>
#include <GEOM_Displayer.h>
#include <GEOMUtils.hxx>
+#ifndef DISABLE_PLOT2DVIEWER
#include <MeasureGUI_ShapeStatisticsDlg.h>
+#endif
#include <SalomeApp_Application.h>
#include <SalomeApp_Study.h>
myBusy(false),
myIsShapeType(false),
myIsHiddenMain(false),
- myWasHiddenMain(true)
+ myWasHiddenMain(true),
+ myIsAccept(false)
{
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
myLessFilterSpin = new SalomeApp_DoubleSpinBox(myFilterGrp);
myGreaterFilterSpin = new SalomeApp_DoubleSpinBox(myFilterGrp);
myApplyFilterButton = new QPushButton(tr("GEOM_BUT_APPLY"), myFilterGrp);
+#ifndef DISABLE_PLOT2DVIEWER
myPlotDistributionButton = new QPushButton(tr("GEOM_PLOT_DISTRIBUTION"), myFilterGrp);
+#endif
QGridLayout* filterLayout = new QGridLayout(myFilterGrp);
filterLayout->addWidget(myLessFilterCheck, 0, 0);
filterLayout->addWidget(myGreaterFilterCombo, 1, 1);
filterLayout->addWidget(myGreaterFilterSpin, 1, 2);
filterLayout->addWidget(myApplyFilterButton, 0, 3);
+#ifndef DISABLE_PLOT2DVIEWER
filterLayout->addWidget(myPlotDistributionButton, 1, 3);
+#endif
QVBoxLayout* layout = new QVBoxLayout(centralWidget());
layout->setMargin(0); layout->setSpacing(6);
GEOM_Displayer* aDisplayer = getDisplayer();
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
bool isHideObjects = resMgr->booleanValue( "Geometry", "hide_input_object", true);
- if (myWasHiddenMain) {
+ if (myWasHiddenMain || ( isHideObjects && myIsAccept ) ) {
myIsHiddenMain = true;
}
- else if (!isHideObjects) {
+ else {
aDisplayer->Display(myMainObj);
myIsHiddenMain = false;
}
connect(myIdList, SIGNAL(itemSelectionChanged()), this, SLOT(selectionChanged()));
connect(myApplyFilterButton, SIGNAL(clicked()), this, SLOT(ClickOnOkFilter()));
+#ifndef DISABLE_PLOT2DVIEWER
connect(myPlotDistributionButton, SIGNAL(clicked()), this, SLOT(ClickOnPlot()));
+#endif
connect(myLessFilterCheck, SIGNAL(stateChanged(int)), this, SLOT(MeasureToggled()));
connect(myGreaterFilterCheck, SIGNAL(stateChanged(int)), this, SLOT(MeasureToggled()));
setIsDisplayResult( false );
}
- if (!onAccept(myMode == CreateGroup, true, isApplyAndClose()))
+ myIsAccept = onAccept(myMode == CreateGroup, true, isApplyAndClose());
+ if (!myIsAccept)
return false;
if(!isApplyAndClose()) {
//=================================================================================
void GroupGUI_GroupDlg::SetEditCurrentArgument()
{
- QPushButton* send = (QPushButton*)sender();
+ QPushButton* send = qobject_cast<QPushButton*>( sender() );
if (send == mySelBtn) {
myEditCurrentArgument = myMainName;
// activateSelection();
if(myEditCurrentArgument) {
myEditCurrentArgument->setFocus();
- send->setDown(true);
+ if ( send )
+ send->setDown(true);
}
updateState();
TopoDS_Shape aShape;
if (GEOMBase::GetShape(aGeomObj, aShape)) {
if (aGeomObj->GetType() == GEOM_GROUP || aShape.ShapeType() == getShapeType()) {
+ if (subSelectionWay() != ALL_SUBSHAPES &&
+ GEOMBase::GetName(aGeomObj) == myShape2Name->text()) {
+ // Skip selected in place object.
+ continue;
+ }
+
TopTools_IndexedMapOfShape aMainMap;
TopoDS_Shape aMainShape = GEOM_Client::get_client().GetShape(GeometryGUI::GetGeomGen(), myMainObj);
TopExp::MapShapes(aMainShape, aMainMap);
int index = aSubShapesMap.FindIndex(aSubShape);
QString anEntry = QString( "TEMP_" ) + anEntryBase + QString("_%1").arg(index);
Handle(SALOME_InteractiveObject) io =
- new SALOME_InteractiveObject(anEntry.toAscii(), "GEOM", "TEMP_IO");
+ new SALOME_InteractiveObject(anEntry.toLatin1(), "GEOM", "TEMP_IO");
if ( myGroupIdList.contains( index ) ) {
aDisplayer->SetColor( aCol );
}
GEOM::GEOM_IShapesOperations_var aShOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
GEOM::ListOfLong_var aSubShapes = aShOp->SubShapeAllIDs( myMainObj, getShapeType(), false );
bool hasCurrentEntities = aSubShapes->length() > 0;
+#ifndef DISABLE_PLOT2DVIEWER
myPlotDistributionButton->setEnabled( myFilterGrp->isEnabled() &&
myIsShapeType &&
( getShapeType() == TopAbs_EDGE ||
getShapeType() == TopAbs_FACE ||
getShapeType() == TopAbs_SOLID ) &&
hasCurrentEntities );
+#endif
if (subSelectionWay() == ALL_SUBSHAPES)
setInPlaceObj(GEOM::GEOM_Object::_nil());
}
updateState(true);
}
+#ifndef DISABLE_PLOT2DVIEWER
//=================================================================================
// function : ClickOnPlot()
// purpose : opens "Shape Statistics" dialog box in order to plot sub-shapes distribution.
dlg->show();
}
}
+#endif
void GroupGUI_GroupDlg::MeasureToggled()
{