mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-13 02:00:34 +05:00
1) Allow defining a sub-mesh on a compound of sub-shape of the main shape in GUI to be coherent with TUI. 2) Eliminate clashing #define PLUGIN_NAME in SMESH and GEOM
This commit is contained in:
parent
82d27750a5
commit
2742029b90
@ -257,15 +257,14 @@ hypothesis operation.
|
||||
\anchor automatic_length_anchor
|
||||
<h2>Automatic Length</h2>
|
||||
|
||||
This hypothesis is automatically applied when you select <b>Assign a
|
||||
set of hypotheses</b> option in Create Mesh menu.
|
||||
|
||||
\image html automaticlength.png
|
||||
|
||||
The dialog box prompts you to define the quality of the future mesh by
|
||||
only one parameter, which is \b Fineness, ranging from 0 (coarse mesh,
|
||||
low number of elements) to 1 (extremely fine mesh, great number of
|
||||
elements). Compare one and the same object (sphere) meshed with
|
||||
elements).
|
||||
|
||||
\image html automaticlength.png
|
||||
|
||||
Compare one and the same object (sphere) meshed with
|
||||
minimum and maximum value of this parameter.
|
||||
|
||||
\image html image147.gif "Example of a very rough mesh. Automatic Length works for 0."
|
||||
|
@ -670,7 +670,7 @@ void SMESHGUI_HypothesisDlg::onHelp()
|
||||
if (app) {
|
||||
QString name = "SMESH";
|
||||
if(myCreator) {
|
||||
QVariant pluginName = myCreator->property( PLUGIN_NAME );
|
||||
QVariant pluginName = myCreator->property( SMESH::Plugin_Name() );
|
||||
if( pluginName.isValid() ) {
|
||||
QString rootDir = pluginName.toString() + "PLUGIN_ROOT_DIR";
|
||||
QString varValue = QString( getenv(rootDir.toLatin1().constData()));
|
||||
|
@ -469,7 +469,7 @@ namespace SMESH
|
||||
// It is used to obtain plugin root dir environment variable
|
||||
// in the SMESHGUI_HypothesisDlg class. Plugin root dir environment
|
||||
// variable is used to display documentation.
|
||||
aCreator->setProperty(PLUGIN_NAME,aHypData->PluginName);
|
||||
aCreator->setProperty(SMESH::Plugin_Name(),aHypData->PluginName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -58,8 +58,6 @@ class SALOMEDSClient_SObject;
|
||||
class algo_error_array;
|
||||
|
||||
|
||||
#define PLUGIN_NAME "PLUGIN_NAME"
|
||||
|
||||
namespace SMESH
|
||||
{
|
||||
SMESHGUI_EXPORT
|
||||
@ -119,6 +117,11 @@ namespace SMESH
|
||||
|
||||
SMESHGUI_EXPORT
|
||||
QString GetMessageOnAlgoStateErrors( const algo_error_array& );
|
||||
|
||||
SMESHGUI_EXPORT
|
||||
// name of proprty saving plug-in of a hypothesis
|
||||
static const char* Plugin_Name() { return "PLUGIN_NAME"; }
|
||||
|
||||
}
|
||||
|
||||
#endif // SMESHGUI_HYPOTHESESUTILS_H
|
||||
|
@ -363,15 +363,36 @@ bool SMESHGUI_MeshOp::isSubshapeOk() const
|
||||
// skl for NPAL14695 - implementation of searching of mainObj
|
||||
GEOM::GEOM_Object_var mainObj = op->GetMainShape(aSubGeomVar); /* _var not _wrap as
|
||||
mainObj already exists! */
|
||||
while(1) {
|
||||
if (mainObj->_is_nil())
|
||||
return false;
|
||||
while( !mainObj->_is_nil()) {
|
||||
CORBA::String_var entry1 = mainObj->GetEntry();
|
||||
CORBA::String_var entry2 = mainGeom->GetEntry();
|
||||
if (std::string( entry1.in() ) == entry2.in() )
|
||||
return true;
|
||||
mainObj = op->GetMainShape(mainObj);
|
||||
}
|
||||
if ( aSubGeomVar->GetShapeType() == GEOM::COMPOUND )
|
||||
{
|
||||
// is aSubGeomVar a compound of sub-shapes?
|
||||
GEOM::GEOM_IShapesOperations_wrap sop = geomGen->GetIShapesOperations(aStudy->StudyId());
|
||||
if (sop->_is_nil()) return false;
|
||||
GEOM::ListOfLong_var ids = sop->GetAllSubShapesIDs( aSubGeomVar,
|
||||
GEOM::SHAPE,/*sorted=*/false);
|
||||
if ( ids->length() > 0 )
|
||||
{
|
||||
ids->length( 1 );
|
||||
GEOM::GEOM_Object_var compSub = geomGen->AddSubShape( aSubGeomVar, ids );
|
||||
if ( !compSub->_is_nil() )
|
||||
{
|
||||
GEOM::ListOfGO_var shared = sop->GetSharedShapes( mainGeom,
|
||||
compSub,
|
||||
compSub->GetShapeType() );
|
||||
geomGen->RemoveObject( compSub );
|
||||
if ( shared->length() > 0 )
|
||||
geomGen->RemoveObject( shared[0] );
|
||||
return ( shared->length() > 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user