SVTK_ViewWindow* vtkwnd = dynamic_cast<SVTK_ViewWindow*>( view );
//QAction* act = action( theCommandID );
+ bool logAction(false);
switch (theCommandID) {
case SMESHOp::OpDelete:
break;
case SMESHOp::OpCopyMesh:
{
+ logAction = true;
if (isStudyLocked()) break;
EmitSignalDeactivateDialog();
( new SMESHGUI_CopyMeshDlg( this ) )->show();
}
case SMESHOp::OpTranslation:
{
+ logAction = true;
if(isStudyLocked()) break;
if ( warnOnGeomModif() )
break; // action forbidden as geometry modified
}
case SMESHOp::OpRotation:
{
+ logAction = true;
if(isStudyLocked()) break;
if ( warnOnGeomModif() )
break; // action forbidden as geometry modified
}
case SMESHOp::OpSymmetry:
{
+ logAction = true;
if(isStudyLocked()) break;
if ( warnOnGeomModif() )
break; // action forbidden as geometry modified
}
case SMESHOp::OpScale:
{
+ logAction = true;
if(isStudyLocked()) break;
if ( warnOnGeomModif() )
break; // action forbidden as geometry modified
case SMESHOp::OpOffset:
{
+ logAction = true;
if(isStudyLocked()) break;
if ( warnOnGeomModif() )
break; // action forbidden as geometry modified
case SMESHOp::OpSewing:
{
+ logAction = true;
if(isStudyLocked()) break;
if ( warnOnGeomModif() )
break; // action forbidden as geometry modified
anApp->updateActions(); //SRN: To update a Save button in the toolbar
//updateObjBrowser();
+ if(logAction)
+ {
+ QAction* anAction = action( theCommandID );
+ CAM_Application::logStructuredUserEvent( "Mesh",
+ "Operation",
+ anAction->text(),
+ "activated" );
+ }
return true;
}
const bool = false);
void connectView( const SUIT_ViewWindow* );
+ void logSmeshGUIEvent(int theCommandID);
private :
event->accept();
}
+//================================================================================
+void SMESHGUI_BaseComputeOp::logMeshSize()
+{
+ if(myMesh->_is_nil())
+ {
+ return;
+ }
+
+ SMESH::smIdType_array_var aRes = myMesh->GetMeshInfo();
+ QString aMessage = QString("%1").arg( aRes[SMDSAbs_EntityType::SMDSEntity_Node]) + " nodes";
+ CAM_Application::logStructuredUserEvent("Mesh",
+ "Result size",
+ "",
+ "",
+ aMessage);
+
+ int nbEdges = aRes[SMDSAbs_EntityType::SMDSEntity_Edge] + aRes[SMDSAbs_EntityType::SMDSEntity_Quad_Edge];
+ aMessage = QString("%1").arg(nbEdges) + " edges";
+ CAM_Application::logStructuredUserEvent("Mesh",
+ "Result size",
+ "",
+ "",
+ aMessage);
+
+ int nbFaces = aRes[SMDSAbs_EntityType::SMDSEntity_Triangle] + aRes[SMDSAbs_EntityType::SMDSEntity_Quad_Triangle] +
+ aRes[SMDSAbs_EntityType::SMDSEntity_BiQuad_Triangle] + aRes[SMDSAbs_EntityType::SMDSEntity_Quadrangle] +
+ aRes[SMDSAbs_EntityType::SMDSEntity_Quad_Quadrangle] + aRes[SMDSAbs_EntityType::SMDSEntity_BiQuad_Quadrangle] +
+ aRes[SMDSAbs_EntityType::SMDSEntity_Polygon] + aRes[SMDSAbs_EntityType::SMDSEntity_Quad_Polygon];
+ aMessage = QString("%1").arg(nbFaces) + " faces";
+ CAM_Application::logStructuredUserEvent("Mesh",
+ "Result size",
+ "",
+ "",
+ aMessage);
+
+ int nbVolumes = aRes[SMDSAbs_EntityType::SMDSEntity_Tetra] + aRes[SMDSAbs_EntityType::SMDSEntity_Quad_Tetra] +
+ aRes[SMDSAbs_EntityType::SMDSEntity_Pyramid] + aRes[SMDSAbs_EntityType::SMDSEntity_Quad_Pyramid] +
+ aRes[SMDSAbs_EntityType::SMDSEntity_Hexa] + aRes[SMDSAbs_EntityType::SMDSEntity_Quad_Hexa] +
+ aRes[SMDSAbs_EntityType::SMDSEntity_TriQuad_Hexa] + aRes[SMDSAbs_EntityType::SMDSEntity_Penta] +
+ aRes[SMDSAbs_EntityType::SMDSEntity_Quad_Penta] + aRes[SMDSAbs_EntityType::SMDSEntity_BiQuad_Penta] +
+ aRes[SMDSAbs_EntityType::SMDSEntity_Hexagonal_Prism] + aRes[SMDSAbs_EntityType::SMDSEntity_Polyhedra];
+ aMessage = QString("%1").arg(nbVolumes) + " volumes";
+ CAM_Application::logStructuredUserEvent("Mesh",
+ "Result size",
+ "",
+ "",
+ aMessage);
+
+}
+
//================================================================================
/*!
* \brief computeMesh()
isShowResultDlg = true;
}
+ //log Mesh size info
+ logMeshSize();
+
// SHOW RESULTS
if ( isShowResultDlg )
showComputeResult( memoryLack, noCompError,aCompErrors, noHypoError, aHypErrors );
+
}
void SMESHGUI_BaseComputeOp::showComputeResult( const bool theMemoryLack,
const QString&);
virtual bool isValid( SUIT_Operation* theOp ) const;
+ void logMeshSize();
protected slots:
virtual bool onApply();
return myDlg;
}
+//================================================================================
+/*!
+ * \brief Log meshers info
+*/
+//================================================================================
+void SMESHGUI_MeshOp::logSmeshParams()
+{
+ QString mesherType;
+ int curMeshType = myDlg->currentMeshType();
+ switch ( curMeshType ) {
+ case MT_ANY:
+ mesherType = "Any";
+ break;
+ case MT_TRIANGULAR:
+ mesherType = "Triangular";
+ break;
+ case MT_QUADRILATERAL:
+ mesherType = "Quadrilateral";
+ break;
+ case MT_TETRAHEDRAL:
+ mesherType = "Tetrahedral";
+ break;
+ case MT_HEXAHEDRAL:
+ mesherType = "Hexahedral";
+ break;
+ default:
+ mesherType = "";
+ }
+
+ QString aMessage = QString("Mesh type is %1").arg(mesherType);
+ CAM_Application::logStructuredUserEvent( "Mesh",
+ "create mesh",
+ "",
+ "",
+ aMessage);
+
+ for ( int dim = 0; dim <= 3; ++dim )
+ {
+ HypothesisData * curAlgo = hypData( dim, Algo, currentHyp( dim, Algo ));
+ if(curAlgo)
+ {
+ aMessage = QString("%1D algorithm is %2").arg(dim).arg(curAlgo->Label);
+ CAM_Application::logStructuredUserEvent( "Mesh",
+ "create mesh",
+ "",
+ "",
+ aMessage);
+ }
+ }
+}
+
//================================================================================
/*!
* \brief Creates or edits mesh
{
if ( myToCreate )
setDefaultName();
+ //connect(aAction, SIGNAL(triggered(bool)), this, SLOT(logSmeshParams()));
}
else
{
SUIT_MessageBox::warning( myDlg, tr( "SMESH_ERROR" ), aMess );
}
+ logSmeshParams();
myHypoSet = 0;
return aResult;
void updateHypoSets();
void setFilteredAlgoData();
QStringList getHypoNames();
+ void logSmeshParams();
private: