interface GMSHPlugin_GMSH_2D : SMESH::SMESH_2D_Algo
{
};
-
+
/*!
* GMSHPlugin_Hypothesis: interface of "GMSH parameters" hypothesis
*/
{
void Set2DAlgo(in long value);
long Get2DAlgo();
-
+
void Set3DAlgo(in long value);
long Get3DAlgo();
-
+
void SetRecomb2DAlgo(in long value);
long GetRecomb2DAlgo();
-
+
void SetRecombineAll(in boolean value);
boolean GetRecombineAll();
-
+
void SetSubdivAlgo(in long value);
long GetSubdivAlgo();
-
+
void SetRemeshAlgo(in long value);
long GetRemeshAlgo();
-
+
void SetRemeshPara(in long value);
long GetRemeshPara();
-
+
void SetSmouthSteps(in double value);
double GetSmouthSteps();
-
+
void SetSizeFactor(in double value);
double GetSizeFactor();
void SetMeshCurvatureSize(in double value);
double GetMeshCurvatureSize();
-
+
void SetMaxSize(in double value);
double GetMaxSize();
void SetSecondOrder(in boolean value);
boolean GetSecondOrder();
-
+
void SetUseIncomplElem(in boolean value);
boolean GetUseIncomplElem();
-
+
void SetIs2d(in boolean value);
-
+
+ void SetVerbosityLevel(in long value);
+ long GetVerbosityLevel();
+
void SetCompoundOnShape(in GEOM::GEOM_Object GeomObj);
void SetCompoundOnEntry(in string entry);
void UnsetCompoundOnShape(in GEOM::GEOM_Object GeomObj);
void UnsetCompoundOnEntry(in string entry);
string_array GetCompoundOnEntries();
-
+
};
/*!
_minSize (0),
_maxSize (1e22),
_secondOrder (false),
- _useIncomplElem (true)
+ _useIncomplElem (true),
+ _verbLvl(status)
{
_name = "GMSH_Parameters";
_param_algo_dim = 3;
_is2d = theIs2d;
}
+void GMSHPlugin_Hypothesis::SetVerbosityLevel(Verbosity theLevel)
+{
+ _verbLvl = theLevel;
+}
+
void GMSHPlugin_Hypothesis::SetCompoundOnEntry(const std::string& entry)
{
" " << _maxSize <<
" " << _minSize <<
" " << (int)_secondOrder <<
- " " << (int)_useIncomplElem ;
+ " " << (int)_useIncomplElem <<
+ " " << (int)_verbLvl ;
save << " " << "__COMPOUNDS_BEGIN__";
for (TCompound::const_iterator it = _compounds.begin(); it != _compounds.end(); ++it )
else
load.clear(ios::badbit | load.rdstate());
+ isOK = static_cast<bool>(load >> is);
+ if (isOK)
+ _verbLvl = (Verbosity)is;
+ else
+ load.clear(ios::badbit | load.rdstate());
+
std::string entry;
isOK = static_cast<bool>(load >> entry);
void SetRecomb2DAlgo(Recomb2DAlgo theRecomb2DAlgo);
Recomb2DAlgo GetRecomb2DAlgo() const { return _recomb2DAlgo; }
-
+
void SetRecombineAll(bool theRecombineAll);
bool GetRecombineAll() const { return _recombineAll; }
allquads,
allhexas
};
-
+
void SetSubdivAlgo(SubdivAlgo theSubdivAlgo);
SubdivAlgo GetSubdivAlgo() const { return _subdivAlgo; }
automaticR,
automaticmetis
};
-
+
void SetRemeshAlgo(RemeshAlgo theRemeshAlgo);
RemeshAlgo GetRemeshAlgo() const { return _remeshAlgo; }
conformal,
rbfharmonic
};
-
+
void SetRemeshPara(RemeshPara theRemeshPara);
RemeshPara GetRemeshPara() const { return _remeshPara; }
-
+
void SetSmouthSteps(double theSmouthSteps);
double GetSmouthSteps() const { return _smouthSteps; }
-
+
void SetSizeFactor(double theSizeFactor);
double GetSizeFactor() const { return _sizeFactor; }
-
+
void SetUseIncomplElem(bool theUseIncomplElem);
bool GetUseIncomplElem() const { return _useIncomplElem; }
void SetMeshCurvatureSize(double theMeshCurvatureSize);
double GetMeshCurvatureSize() const { return _meshCurvatureSize; }
#endif
-
+
void SetMaxSize(double theSize);
double GetMaxSize() const { return _maxSize; }
-
+
void SetMinSize(double theSize);
double GetMinSize() const { return _minSize; }
void SetIs2d(bool theIs2d);
bool GetIs2d() const { return _is2d; }
-
+
+ // Verbosity info:
+ // 0: silent except for fatal errors
+ // 1: +errors
+ // 2: +warnings
+ // 3: +direct
+ // 4: +information
+ // 5: +status
+ // 99: +debug
+ enum Verbosity
+ {
+ silent,
+ errors,
+ warnings,
+ direct,
+ information,
+ status,
+ debug
+ };
+ void SetVerbosityLevel(Verbosity theLevel);
+ Verbosity GetVerbosityLevel() const { return _verbLvl; }
+
typedef std::set<std::string> TCompound;
void SetCompoundOnEntry(const std::string& entry);
const TCompound& GetCompoundOnEntries() const { return _compounds; }
void UnsetCompoundOnEntry(const std::string& entry);
-
+
// Persistence
virtual std::ostream & SaveTo(std::ostream & save);
virtual std::istream & LoadFrom(std::istream & load);
double _minSize, _maxSize;
bool _secondOrder, _useIncomplElem;
bool _is2d;
+ Verbosity _verbLvl;
TCompound _compounds;
};
GMSHPlugin_Hypothesis_i::
GMSHPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
::SMESH_Gen* theGenImpl)
- : SALOME::GenericObj_i( thePOA ),
+ : SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
mySetMethodFlags(0)
{
if ( isToSetParameter( GetRemeshPara(), theValue, METH_SetRemeshPara ))
{
this->GetImpl()->SetRemeshPara((::GMSHPlugin_Hypothesis::RemeshPara)theValue);
- SMESH::TPythonDump() << _this() << ".SetRemeshAlgo( " << theValue << " )";
+ SMESH::TPythonDump() << _this() << ".SetRemeshPara( " << theValue << " )";
}
}
SMESH::TPythonDump() << _this() << ".SetIs2d( " << theValue << " )";
}
+void GMSHPlugin_Hypothesis_i::SetVerbosityLevel (CORBA::Long theValue)
+{
+ if ( isToSetParameter( GetVerbosityLevel(), theValue, METH_SetVerbosityLevel ))
+ {
+ this->GetImpl()->SetVerbosityLevel((::GMSHPlugin_Hypothesis::Verbosity)theValue);
+ SMESH::TPythonDump() << _this() << ".SetVerbosityLevel( " << theValue << " )";
+ }
+}
+
+CORBA::Long GMSHPlugin_Hypothesis_i::GetVerbosityLevel()
+{
+ return this->GetImpl()->GetVerbosityLevel();
+}
+
void GMSHPlugin_Hypothesis_i::SetCompoundOnShape(GEOM::GEOM_Object_ptr GeomObj)
{
string entry;
//================================================================================
/*!
- * \brief Verify whether hypothesis supports given entity type
+ * \brief Verify whether hypothesis supports given entity type
* \param type - dimension (see SMESH::Dimension enumeration)
* \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
- *
+ *
* Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
*/
-//================================================================================
+//================================================================================
CORBA::Boolean GMSHPlugin_Hypothesis_i::IsDimSupported( SMESH::Dimension type )
{
return type == SMESH::DIM_3D;
::SMESH_Gen* theGenImpl);
// Destructor
virtual ~GMSHPlugin_Hypothesis_i();
-
+
// Ajout d'un truc
void SetMeshCurvatureSize(CORBA::Double theMeshCurvatureSize);
CORBA::Double GetMeshCurvatureSize();
-
+
void SetMaxSize(CORBA::Double theSize);
CORBA::Double GetMaxSize();
-
+
void SetMinSize(CORBA::Double theSize);
CORBA::Double GetMinSize();
-
+
void SetSecondOrder(CORBA::Boolean theVal);
CORBA::Boolean GetSecondOrder();
-
+
void Set2DAlgo(CORBA::Long the2DAlgo);
CORBA::Long Get2DAlgo();
void Set3DAlgo(CORBA::Long the3DAlgo);
void SetUseIncomplElem(CORBA::Boolean theUseIncomplElem);
CORBA::Boolean GetUseIncomplElem();
void SetIs2d(CORBA::Boolean theIs2d);
-
+ void SetVerbosityLevel(CORBA::Long theVerbLvl);
+ CORBA::Long GetVerbosityLevel();
+
void SetCompoundOnShape(GEOM::GEOM_Object_ptr GeomObj);
void SetCompoundOnEntry(const char* entry);
void UnsetCompoundOnShape(GEOM::GEOM_Object_ptr GeomObj);
void UnsetCompoundOnEntry(const char* entry);
GMSHPlugin::string_array* GetCompoundOnEntries();
-
+
// fin d'ajout
void SetGrowthRate(CORBA::Double theRate);
// void SetLocalSizeOnEntry(const char* entry, CORBA::Double localSize);
// CORBA::Double GetLocalSizeOnEntry(const char* entry);
// GMSHPlugin::string_array* GetLocalSizeEntries();
-
+
void UnsetLocalSizeOnEntry(const char* entry);
// Get implementation
::GMSHPlugin_Hypothesis* GetImpl();
-
- // Verify whether hypothesis supports given entity type
+
+ // Verify whether hypothesis supports given entity type
CORBA::Boolean IsDimSupported( SMESH::Dimension type );
protected:
METH_SetSizeFactor = 308,
METH_SetUseIncomplElem = 309,
METH_SetIs2d = 310,
+ METH_SetVerbosityLevel = 311,
// fin d'ajout
METH_LAST = METH_SetLocalSizeOnEntry
};
_maxSize = hyp->GetMaxSize();
_secondOrder = hyp->GetSecondOrder();
_useIncomplElem = hyp->GetUseIncomplElem();
+ _verbLvl = hyp->GetVerbosityLevel();
_compounds = hyp->GetCompoundOnEntries();
+ // 6 in the enum corresponds to 99 in gmsh
+ if(_verbLvl == 6)
+ _verbLvl = 99;
}
else
{
for (auto const& ls : listElements)
{
// Add nodes of triangles and triangles them-selves to netgen mesh
- // add three nodes of
+ // add three nodes of
bool hasDegen = false;
for (int iN = 0; iN < 3; ++iN)
{
if (hasDegen && (aTrinagle[0] == aTrinagle[1] ||
aTrinagle[0] == aTrinagle[2] ||
aTrinagle[2] == aTrinagle[1]))
- continue;
+ continue;
std::vector<int> LinesID(3, 0);
ASSERT(ok);
}
+ ok = GmshSetOption("General", "Verbosity" , (double) _verbLvl ) ; // Verbosity level
+ ASSERT(ok);
+
#if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=8
/*ok = GmshSetOption("Mesh", "MaxNumThreads1D" , 0. ) ; // Coarse-grain algo threads
ASSERT(ok);
Standard_Real p1 = 1.0;
TopLoc_Location loc;
Handle(Geom_Curve) curve = BRep_Tool::Curve(topoEdge, loc, p0, p1);
-
+
if ( !curve.IsNull() )
{
- if ( !loc.IsIdentity() )
+ if ( !loc.IsIdentity() )
point3D.Transform( loc.Transformation().Inverted() );
GeomAPI_ProjectPointOnCurve proj(point3D, curve, p0, p1);
if ( proj.NbPoints() > 0 )
pa = (double)proj.LowerDistanceParameter();
- meshDS->SetNodeOnEdge( node, topoEdge, pa );
+ meshDS->SetNodeOnEdge( node, topoEdge, pa );
}
else
- {
+ {
meshDS->SetNodeOnEdge( node, topoEdge );
- }
+ }
//END on BLSURFPlugin_BLSURF
if ( verts[j]->onWhat()->getVisibility() == 0 )
{
SMDS_MeshNode *node = meshDS->AddNode(verts[j]->x(),verts[j]->y(),verts[j]->z() );
-
+
gp_Pnt point3D( verts[j]->x(),verts[j]->y(),verts[j]->z() );
Standard_Real p0 = 0.0;
Standard_Real p1 = 1.0;
TopLoc_Location loc;
Handle(Geom_Curve) curve = BRep_Tool::Curve(topoEdge, loc, p0, p1);
-
+
if ( !curve.IsNull() )
{
- if ( !loc.IsIdentity() )
+ if ( !loc.IsIdentity() )
point3D.Transform( loc.Transformation().Inverted() );
GeomAPI_ProjectPointOnCurve proj(point3D, curve, p0, p1);
if ( proj.NbPoints() > 0 )
pa = (double)proj.LowerDistanceParameter();
- meshDS->SetNodeOnEdge( node, topoEdge, pa );
+ meshDS->SetNodeOnEdge( node, topoEdge, pa );
}
else
- {
+ {
meshDS->SetNodeOnEdge( node, topoEdge );
- }
-
+ }
+
verts[j]->setEntity(gEdge);
_nodeMap.insert({ verts[j], node });
}
}
else
{
- //Msg::SetVerbosity(100);
//CTX::instance()->mesh.maxNumThreads1D=1;
_gModel->mesh( /*dim=*/ 1);
if ( gEdge->geomType() == GEntity::CompoundCurve )
#endif
continue;
-
+
TopoDS_Edge topoEdge = *((TopoDS_Edge*)gEdge->getNativePtr());
if ( !HasSubMesh( topoEdge ))
continue; // empty sub-mesh
bool _secondOrder, _useIncomplElem;
bool _is2d;
bool _is3d;
+ int _verbLvl;
GModel* _gModel;
#if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=3
double _maxThreads;
rbfharmonic
};
+enum VerbLvl
+ {
+ silent,
+ errors,
+ warnings,
+ direct,
+ information,
+ status,
+ debug
+ };
+
GMSHPluginGUI_HypothesisCreator::GMSHPluginGUI_HypothesisCreator( const QString& theHypType )
: SMESHGUI_GenericHypothesisCreator( theHypType )
row++;
mySubdivAlgo = 0;
-
+
aGroupLayout->addWidget(new QLabel(tr("GMSH_SUBDIV_ALGO"), GroupC1), row, 0);
mySubdivAlgo = new QComboBox(GroupC1);
QStringList typesSubdivAlgo;
connect( mySecondOrder, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
+ aGroupLayout->addWidget( new QLabel( tr( "GMSH_VERB_LVL" ), GroupC1 ), row, 0 );
+ myVerbLvl = new QComboBox(GroupC1);
+ QStringList typesVerbLvl;
+ typesVerbLvl << tr("GMSH_SILENT") << tr("GMSH_ERRORS") << tr("GMSH_WARNINGS") << tr("GMSH_DIRECT") << tr("GMSH_INFORMATION") << tr("GMSH_STATUS") << tr("GMSH_DEBUG");
+ myVerbLvl->addItems(typesVerbLvl);
+ aGroupLayout->addWidget(myVerbLvl, row, 1);
+ row++;
+
// Compounds
if (!myIs3D)
{
if ( myRecombineAll )
myRecombineAll->setChecked( data.myRecombineAll );
if ( mySubdivAlgo )
- mySubdivAlgo->setCurrentIndex( data.mySubdivAlgo );
+ mySubdivAlgo->setCurrentIndex( data.mySubdivAlgo );
if (!myIs3D)
{
myRemeshAlgo->setCurrentIndex(data.myRemeshAlgo);
mySecondOrder->setChecked( data.mySecondOrder );
if ( myUseIncomplElem )
myUseIncomplElem->setChecked( data.myUseIncomplElem );
+ if (myVerbLvl)
+ myVerbLvl->setCurrentIndex(data.myVerbLvl);
GMSHPluginGUI_HypothesisCreator* that = (GMSHPluginGUI_HypothesisCreator*)this;
that->updateWidgets();
h_data.myMaxSizeVar = getVariableName("SetMaxSize");
h_data.mySecondOrder = h->GetSecondOrder();
h_data.myUseIncomplElem = h->GetUseIncomplElem();
+ h_data.myVerbLvl = (int) h->GetVerbosityLevel();
GMSHPluginGUI_HypothesisCreator* that = (GMSHPluginGUI_HypothesisCreator*)this;
GMSHPlugin::string_array_var myEntries = h->GetCompoundOnEntries();
h->SetSecondOrder( h_data.mySecondOrder );
h->SetUseIncomplElem( h_data.myUseIncomplElem );
h->SetIs2d( myIs2D );
+ h->SetVerbosityLevel(h_data.myVerbLvl);
QString mainEntry = getMainShapeEntry();
for (QSet<QString>::const_iterator i = myCompoundSet.begin(); i != myCompoundSet.end(); ++i)
h_data.myMaxSizeVar = myMaxSize->text();
h_data.mySecondOrder = mySecondOrder->isChecked();
h_data.myUseIncomplElem = myUseIncomplElem->isChecked();
+ h_data.myVerbLvl = myVerbLvl->currentIndex();
// ne semble pas utile dans la mesure ou myCompoundSet n'a pas besoin d'etre modifier
/*
QString myMaxSizeVar, myMinSizeVar, mySmouthStepsVar, mySizeFactorVar;
#endif
mutable QString myErrorMsg;
+ int myVerbLvl;
} GmshHypothesisData;
/*!
virtual QFrame* buildFrame ();
virtual void retrieveParams() const;
virtual QString storeParams () const;
-
+
virtual QString caption() const;
virtual QPixmap icon() const;
virtual QString type() const;
void updateWidgets();
virtual void onAddCompound();
virtual void onRemoveCompound();
-
+
private:
bool readParamsFromHypo( GmshHypothesisData& ) const;
bool readParamsFromWidgets( GmshHypothesisData& ) const;
SMESHGUI_SpinBox* myMinSize;
QCheckBox* myUseIncomplElem;
QCheckBox* mySecondOrder;
+ QComboBox* myVerbLvl;
bool myIs2D;
bool myIs3D;
<source>GMSH_SECOND_ORDER</source>
<translation>Second Order</translation>
</message>
+ <message>
+ <source>GMSH_VERB_LVL</source>
+ <translation>Verbosity Level</translation>
+ </message>
+ <message>
+ <source>GMSH_SILENT</source>
+ <translation>Silent</translation>
+ </message>
+ <message>
+ <source>GMSH_ERRORS</source>
+ <translation>Errors</translation>
+ </message>
+ <message>
+ <source>GMSH_WARNINGS</source>
+ <translation>Warnings</translation>
+ </message>
+ <message>
+ <source>GMSH_DIRECT</source>
+ <translation>Direct</translation>
+ </message>
+ <message>
+ <source>GMSH_INFORMATION</source>
+ <translation>Information</translation>
+ </message>
+ <message>
+ <source>GMSH_STATUS</source>
+ <translation>Status</translation>
+ </message>
+ <message>
+ <source>GMSH_DEBUG</source>
+ <translation>Debug</translation>
+ </message>
<message>
<source>GMSH_COMPOUND</source>
<translation>Compounds</translation>
<source>GMSH_SECOND_ORDER</source>
<translation>Second ordre</translation>
</message>
+ <message>
+ <source>GMSH_VERB_LVL</source>
+ <translation>Niveau de verbosité</translation>
+ </message>
+ <message>
+ <source>GMSH_SILENT</source>
+ <translation>Silencieux</translation>
+ </message>
+ <message>
+ <source>GMSH_ERRORS</source>
+ <translation>Erreurs</translation>
+ </message>
+ <message>
+ <source>GMSH_WARNINGS</source>
+ <translation>Avertissement</translation>
+ </message>
+ <message>
+ <source>GMSH_DIRECT</source>
+ <translation>Direct</translation>
+ </message>
+ <message>
+ <source>GMSH_INFORMATION</source>
+ <translation>Information</translation>
+ </message>
+ <message>
+ <source>GMSH_STATUS</source>
+ <translation>Status</translation>
+ </message>
+ <message>
+ <source>GMSH_DEBUG</source>
+ <translation>Debug</translation>
+ </message>
<message>
<source>GMSH_COMPOUND</source>
<translation>Compounds</translation>