+ IMP 22264: EDF 2648 GEOM: Propagate edges automatic orientation (fix Number of Segments dlg)
+ bad STL files are written on Windows (reported by YFR)
+ 22874: [CEA 1425] Performance SMESH Module ( refix ~SMESH_Mesh() )
{
const SMDS_MeshElement* aFace = itFaces->next();
int nbTria = getTriangles( aFace, triaNodes );
-
+
for ( int iT = 0, iN = 0; iT < nbTria; ++iT )
{
gp_XYZ normale = getNormale( triaNodes[iN],
" facet normal % 12e % 12e % 12e\n"
" outer loop\n" ,
normale.X(), normale.Y(), normale.Z());
- aFile.writeRaw ( sval, 70 );
+ aFile.writeRaw ( sval, 70 + strlen( sval + 70 )); // at least 70 but can be more (WIN)
for ( int jN = 0; jN < 3; ++jN, ++iN )
{
sprintf (sval,
" vertex % 12e % 12e % 12e\n",
node.X(), node.Y(), node.Z() );
- aFile.writeRaw ( sval, 54 );
+ aFile.writeRaw ( sval, 54 + strlen( sval + 54 ));
}
aFile.writeRaw (" endloop\n"
" endfacet\n", 21 );
- }
+ }
}
aFile.writeRaw ("endsolid\n" , 9 );
{
MESSAGE("SMESH_Mesh::~SMESH_Mesh");
- // Unassign algorithms in order to have all SMESH_subMeshEventListenerData deleted (22874)
+ // avoid usual removal of elements while processing RemoveHypothesis( algo ) event
SMESHDS_SubMeshIteratorPtr smIt = _myMeshDS->SubMeshes();
- while ( smIt->more() ) {
- // avoid usual removal of elements while processing RemoveHypothesis( algo ) event
+ while ( smIt->more() )
const_cast<SMESHDS_SubMesh*>( smIt->next() )->Clear();
- }
- const ShapeToHypothesis & hyps = _myMeshDS->GetHypotheses();
- for ( ShapeToHypothesis::Iterator s2hyps( hyps ); s2hyps.More(); s2hyps.Next() )
- {
- const TopoDS_Shape& s = s2hyps.Key();
- THypList hyps = s2hyps.ChangeValue(); // copy
- THypList::const_iterator h = hyps.begin();
- for ( ; h != hyps.end(); ++h )
- if ( (*h)->GetType() != SMESHDS_Hypothesis::PARAM_ALGO )
- RemoveHypothesis( s, (*h)->GetID() );
- }
// issue 0020340: EDF 1022 SMESH : Crash with FindNodeClosestTo in a second new study
// Notify event listeners at least that something happens
TopTools_ListIteratorOfListOfShape ancIt (ancList);
while ( ancIt.More() && ancIt.Value().ShapeType() >= memberType )
ancIt.Next();
- if ( ancIt.More() )
- ancList.InsertBefore( theShape, ancIt );
+ if ( ancIt.More() ) ancList.InsertBefore( theShape, ancIt );
+ else ancList.Append( theShape );
}
}
else // else added for 52457: Addition of hypotheses is 8 time longer than meshing
{
if ( !_father->MeshExists( d->myMeshID ))
continue;
- if ( _father->GetId() == d->myMeshID && !_father->GetSubMeshContaining( d->mySubMeshID ))
+ if ( _father->GetId() == d->myMeshID &&
+ this->GetId() != d->mySubMeshID &&
+ !_father->GetSubMeshContaining( d->mySubMeshID ))
continue;
d->mySubMesh->DeleteEventListener( d->myListener );
}
_myMeshDS = new SMESHDS_Mesh( _id, true );
myPreviewType = previewElements;
}
- //!< Destructor
- virtual ~TPreviewMesh() { delete _myMeshDS; _myMeshDS = 0; }
//!< Copy a set of elements
void Copy(const TIDSortedElemSet & theElements,
TIDSortedElemSet& theCopyElements,
if ( !aGeomEntry.isEmpty() || !aMainEntry.isEmpty() )
{
- myReversedEdgesHelper = new StdMeshersGUI_PropagationHelperWdg( myDirectionWidget, fr );
+ myReversedEdgesHelper = new StdMeshersGUI_PropagationHelperWdg( myDirectionWidget, fr, false );
lay->addWidget( myReversedEdgesHelper );
lay->setStretchFactor( myReversedEdgesHelper, 1 );
}
connect( myExpr, SIGNAL( textChanged( const QString& ) ), this, SLOT( onValueChanged() ) );
connect( myConv, SIGNAL( buttonClicked( int ) ), this, SLOT( onValueChanged() ) );
+ onValueChanged();
+
return fr;
}
myScale->setShown( distr==1 );
myLScale->setShown( distr==1 );
- myReversedEdgesBox->setShown( !distr==0 );
- myDirectionWidget->ShowPreview( !distr==0 );
- if ( myReversedEdgesHelper )
- myReversedEdgesHelper->setShown( !distr==0 );
+ myReversedEdgesBox->setShown( distr!=0 );
+ if ( myReversedEdgesHelper ) {
+ myReversedEdgesHelper->Clear();
+ myReversedEdgesHelper->setShown( distr!=0 );
+ }
+ myDirectionWidget->ShowPreview( distr!=0 );
bool isFunc = distr==2 || distr==3;
myPreview->setShown( isFunc );
class QGridLayout;
class QRadioButton;
class StdMeshersGUI_SubShapeSelectorWdg;
+class StdMeshersGUI_PropagationHelperWdg;
typedef struct
{
QGroupBox* myReversedEdgesBox;
StdMeshersGUI_SubShapeSelectorWdg* myDirectionWidget;
- QWidget* myReversedEdgesHelper;
+ StdMeshersGUI_PropagationHelperWdg* myReversedEdgesHelper;
};
#endif // STDMESHERSGUI_NBSEGMENTSCREATOR_H
StdMeshersGUI_PropagationHelperWdg::
StdMeshersGUI_PropagationHelperWdg( StdMeshersGUI_SubShapeSelectorWdg* subSelectWdg,
- QWidget* parent ):
+ QWidget* parent,
+ bool show ):
QWidget( parent ), mySubSelectWdg( subSelectWdg ), myActor( 0 ), myModelActor( 0 )
{
- QGroupBox* helperBox = new QGroupBox( tr("HELPER"), this );
- QCheckBox* showGeomChkBox = new QCheckBox( tr("SHOW_GEOMETRY"), helperBox );
- QGroupBox* chainBox = new QGroupBox( tr("PROPAGATION_CHAINS"), helperBox );
- chainBox->setCheckable( true );
- chainBox->setChecked( false );
- myListWidget = new QListWidget( helperBox );
+ QGroupBox* helperBox = new QGroupBox( tr("HELPER"), this );
+ myShowGeomChkBox = new QCheckBox( tr("SHOW_GEOMETRY"), helperBox );
+ myChainBox = new QGroupBox( tr("PROPAGATION_CHAINS"), helperBox );
+ myChainBox->setCheckable( true );
+ myChainBox->setChecked( false );
+ myListWidget = new QListWidget( helperBox );
myListWidget->setSelectionMode( QAbstractItemView::SingleSelection );
- myAddButton = new QPushButton( tr("ADD"), helperBox );
- myReverseButton = new QPushButton( tr("REVERSE"), helperBox );
+ myAddButton = new QPushButton( tr("ADD"), helperBox );
+ myReverseButton = new QPushButton( tr("REVERSE"), helperBox );
- QGridLayout* chainsLayout = new QGridLayout( chainBox );
+ QGridLayout* chainsLayout = new QGridLayout( myChainBox );
chainsLayout->setMargin( MARGIN );
chainsLayout->setSpacing( SPACING );
chainsLayout->addWidget(myListWidget, 0, 0, 3, 3);
QVBoxLayout* helperLayout = new QVBoxLayout( helperBox );
helperLayout->setMargin( MARGIN );
helperLayout->setSpacing( SPACING );
- helperLayout->addWidget( showGeomChkBox );
- helperLayout->addWidget( chainBox );
+ helperLayout->addWidget( myShowGeomChkBox );
+ helperLayout->addWidget( myChainBox );
QVBoxLayout* lay = new QVBoxLayout( this );
lay->setMargin( 0 );
lay->setSpacing( SPACING );
lay->addWidget( helperBox );
- connect( showGeomChkBox, SIGNAL( toggled(bool)), SLOT( onShowGeometry(bool)));
- connect( chainBox, SIGNAL( toggled(bool)), SLOT( updateList(bool)));
+ connect( myShowGeomChkBox,SIGNAL( toggled(bool)), SLOT( onShowGeometry(bool)));
+ connect( myChainBox, SIGNAL( toggled(bool)), SLOT( updateList(bool)));
connect( myListWidget, SIGNAL( itemSelectionChanged()), SLOT( onListSelectionChanged() ));
connect( myAddButton, SIGNAL( clicked(bool)), SLOT( onAdd() ));
connect( myReverseButton, SIGNAL( clicked(bool)), SLOT( onReverse() ));
- onListSelectionChanged();
+ if ( show )
+ onListSelectionChanged();
}
//================================================================================
}
}
+//================================================================================
+/*!
+ * \brief Switch off all buttons and previews
+ */
+//================================================================================
+
+void StdMeshersGUI_PropagationHelperWdg::Clear()
+{
+ myShowGeomChkBox->setChecked( false );
+
+ myListWidget->blockSignals( true );
+ myListWidget->clear();
+ myListWidget->blockSignals( false );
+
+ myChainBox->blockSignals( true );
+ myChainBox->setChecked( false );
+ myChainBox->blockSignals( false );
+
+ if ( myActor )
+ myActor->SetVisibility( false );
+
+ if ( myModelActor )
+ myModelActor->SetVisibility( false );
+}
+
//================================================================================
/*!
* \brief SLOT called when 'Show Geometry' is checked
class StdMeshersGUI_SubShapeSelectorWdg;
class vtkRenderer;
class GEOM_Actor;
+class QCheckBox;
+class QGroupBox;
/*!
* \brief A widget showing a list of propagation chains of EDGEs.
public:
StdMeshersGUI_PropagationHelperWdg( StdMeshersGUI_SubShapeSelectorWdg* subSelectWdg,
- QWidget* parent = 0 );
+ QWidget* parent = 0,
+ bool show = true);
~StdMeshersGUI_PropagationHelperWdg();
+ void Clear();
+
private slots:
void onShowGeometry(bool toShow);
GEOM_Actor* myActor;
GEOM_Actor* myModelActor;
- QListWidget* myListWidget;
- QPushButton* myAddButton;
- QPushButton* myReverseButton;
+ QListWidget* myListWidget;
+ QPushButton* myAddButton;
+ QPushButton* myReverseButton;
+ QCheckBox* myShowGeomChkBox;
+ QGroupBox* myChainBox;
std::vector< std::vector<int> > myChains;
};