// - FT_ConnectedElements = 39
// v 7.6.0: FT_Undefined == 47, new items:
// - FT_BelongToMeshGroup = 22
+ // v 8.1.0: FT_Undefined == 48, new items:
+ // - FT_NodeConnectivityNumber= 22
//
// It's necessary to continue recording this history and to fill
// undef2newItems (see below) accordingly.
undef2newItems[ 45 ].push_back( 36 );
undef2newItems[ 46 ].push_back( 39 );
undef2newItems[ 47 ].push_back( 22 );
+ undef2newItems[ 48 ].push_back( 22 );
ASSERT( undef2newItems.rbegin()->first == SMESH::FT_Undefined );
}
* \param theRemovedObjIDs - entries of objects whose created commands were removed
* \param theHistoricalDump - true means to keep all commands, false means
* to exclude commands relating to objects removed from study
- * \retval TCollection_AsciiString - Convertion result
+ * \retval TCollection_AsciiString - Conversion result
*/
//================================================================================
_AString indent = aCommand->GetIndentation();
_AString tryStr = indent + "try:";
_AString newCmd = indent + tab + ( aCommand->GetString().ToCString() + indent.Length() );
+ _AString pasCmd = indent + tab + "pass"; // to keep valid if newCmd is erased
_AString excStr = indent + "except:";
_AString msgStr = indent + "\tprint '"; msgStr += method + "() failed. Invalid file name?'";
aCommand->Clear();
aCommand->GetString() = newCmd;
aCommand->SetOrderNb( ++myNbCommands );
+ myCommands.push_back( new _pyCommand( pasCmd, ++myNbCommands ));
myCommands.push_back( new _pyCommand( excStr, ++myNbCommands ));
myCommands.push_back( new _pyCommand( msgStr, ++myNbCommands ));
}
Threshold = SMESH + types[ iGeom ];
#ifdef _DEBUG_
// is types complete? (compilation failure mains that enum GeometryType changed)
- int _assert[( sizeof(types) / sizeof(const char*) == nbTypes ) ? 1 : -1 ]; _assert[0]=1;
+ int _asrt[( sizeof(types) / sizeof(const char*) == nbTypes ) ? 2 : -1 ]; _asrt[0]=_asrt[1];
#endif
}
if (Type == "SMESH.FT_EntityType")
"Entity_Polygon", "Entity_Quad_Polygon", "Entity_Tetra", "Entity_Quad_Tetra",
"Entity_Pyramid", "Entity_Quad_Pyramid",
"Entity_Hexa", "Entity_Quad_Hexa", "Entity_TriQuad_Hexa",
- "Entity_Penta", "Entity_Quad_Penta", "Entity_Hexagonal_Prism",
+ "Entity_Penta", "Entity_Quad_Penta", "Entity_BiQuad_Penta", "Entity_Hexagonal_Prism",
"Entity_Polyhedra", "Entity_Quad_Polyhedra", "Entity_Ball" };
if ( -1 < iGeom && iGeom < nbTypes )
Threshold = SMESH + types[ iGeom ];
#ifdef _DEBUG_
- // is types complete? (compilation failure mains that enum EntityType changed)
- int _assert[( sizeof(types) / sizeof(const char*) == nbTypes ) ? 1 : -1 ]; _assert[0]=1;
+ // is 'types' complete? (compilation failure mains that enum EntityType changed)
+ int _asrt[( sizeof(types) / sizeof(const char*) == nbTypes ) ? 2 : -1 ]; _asrt[0]=_asrt[1];
#endif
}
}
* \brief Find algorithm able to create a hypothesis
* \param theGeom - The shape ID the algorithm was created on
* \param theMesh - The mesh ID that created the algorithm
- * \param theHypothesis - The hypothesis the algorithm sould be able to create
+ * \param theHypothesis - The hypothesis the algorithm should be able to create
* \retval Handle(_pyHypothesis) - The found algo
*/
//================================================================================
const bool isHyp = theObj->IsKind( STANDARD_TYPE( _pyHypothesis ));
Handle(_pyObject) existing;
if( isHyp )
- existing = Handle(_pyObject)::DownCast( FindHyp( theObj->GetID() ) );
+ existing = FindHyp( theObj->GetID() );
else
existing = FindObject( theObj->GetID() );
if ( !existing.IsNull() && existing != theObj )
return id_obj->second;
}
{
- map< _pyID, Handle(_pyMesh) >::const_iterator id_obj = myMeshes.find( theObjID );
+ _pyGen* me = const_cast< _pyGen* >( this );
+ map< _pyID, Handle(_pyMesh) >::iterator id_obj = me->myMeshes.find( theObjID );
if ( id_obj != myMeshes.end() )
- return Handle(_pyObject)::DownCast( id_obj->second );
+ return id_obj->second;
}
// {
// map< _pyID, Handle(_pyMeshEditor) >::const_iterator id_obj = myMeshEditors.find( theObjID );
{
addCmd = *cmd;
cmd = addHypCmds.erase( cmd );
- if ( !theGen->IsToKeepAllCommands() && CanClear() ) {
+ if ( !theGen->IsToKeepAllCommands() /*&& CanClear()*/ ) {
addCmd->Clear();
theCommand->Clear();
}
for ( ; m != fatherMeshes.end(); ++m )
addFatherMesh( *m );
// if ( removedGeom )
- // SetRemovedFromStudy(); // as reffered geometry not in study
+ // SetRemovedFromStudy(); // as referred geometry not in study
}
if ( myGeomNotInStudy )
return;
* \brief Convert the command adding a hypothesis to mesh into a smesh command
* \param theCmd - The command like mesh.AddHypothesis( geom, hypo )
* \param theAlgo - The algo that can create this hypo
- * \retval bool - false if the command cant be converted
+ * \retval bool - false if the command can't be converted
*/
//================================================================================
//================================================================================
/*!
- * \brief clear creation, arg and unkown commands
+ * \brief clear creation, arg and unknown commands
*/
//================================================================================
* \brief additionally to Addition2Creation, clears SetDistrType() command
* \param theCmd - AddHypothesis() command
* \param theMesh - mesh to which a hypothesis is added
- * \retval bool - convertion result
+ * \retval bool - conversion result
*/
//================================================================================
* into regular1D.LengthNearVertex( length, vertex )
* \param theCmd - The command like mesh.AddHypothesis( vertex, SegmentLengthAroundVertex )
* \param theMesh - The mesh needing this hypo
- * \retval bool - false if the command cant be converted
+ * \retval bool - false if the command can't be converted
*/
//================================================================================
_pyID vertex = theCmd->GetArg( 1 );
- // the problem here is that segment algo will not be found
+ // the problem here is that segment algo can be not found
// by pyHypothesis::Addition2Creation() for <vertex>, so we try to find
// geometry where segment algorithm is assigned
- Handle(_pyHypothesis) algo;
_pyID geom = vertex;
+ Handle(_pyHypothesis) algo = theGen->FindAlgo( geom, theMeshID, this );
while ( algo.IsNull() && !geom.IsEmpty()) {
// try to find geom as a father of <vertex>
geom = FatherID( geom );
algo = theGen->FindAlgo( geom, theMeshID, this );
}
- if ( algo.IsNull() )
+ if ( algo.IsNull() || geom.IsEmpty() )
return false; // also possible to find geom as brother of veretex...
+
// set geom instead of vertex
theCmd->SetArg( 1, geom );
- // set vertex as a second arg
- if ( myCurCrMethod->myArgs.size() < 1) setCreationArg( 1, "1" ); // :(
- setCreationArg( 2, vertex );
-
// mesh.AddHypothesis(vertex, SegmentLengthAroundVertex) -->
- // theMeshID.LengthNearVertex( length, vertex )
- return _pyHypothesis::Addition2Creation( theCmd, theMeshID );
+ // SegmentLengthAroundVertex = Regular_1D.LengthNearVertex( length )
+ if ( _pyHypothesis::Addition2Creation( theCmd, theMeshID ))
+ {
+ // set vertex as a second arg
+ theCmd->SetArg( 2, vertex );
+
+ return true;
+ }
}
return false;
}
* \brief Convert the command adding an algorithm to mesh
* \param theCmd - The command like mesh.AddHypothesis( geom, algo )
* \param theMesh - The mesh needing this algo
- * \retval bool - false if the command cant be converted
+ * \retval bool - false if the command can't be converted
*/
//================================================================================