\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."
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()));
// 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);
}
}
}
class algo_error_array;
-#define PLUGIN_NAME "PLUGIN_NAME"
-
namespace SMESH
{
SMESHGUI_EXPORT
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
// 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 );
+ }
+ }
+ }
}
}