-// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#include <SALOMEDS_wrap.hxx>
#include <utilities.h>
+#include <Basics_OCCTVersion.hxx>
#include <Resource_DataMapOfAsciiStringAsciiString.hxx>
+#if OCC_VERSION_LARGE < 0x07050000
#include <Resource_DataMapIteratorOfDataMapOfAsciiStringAsciiString.hxx>
+#endif
#include "SMESH_Gen_i.hxx"
/* SALOME headers that include CORBA headers that include windows.h
initialized = true;
filteredArgs.push_back( "SMESH.MED_V2_1" );
filteredArgs.push_back( "SMESH.MED_V2_2" );
- }
+ }
return std::find( filteredArgs.begin(), filteredArgs.end(), theArg ) != filteredArgs.end();
}
}
// find a GEOM (aPass == 0) and SHAPERSTUDY (aPass == 1) entries
for(int aPass = 0; aPass < 2; aPass++) {
_pyID geomID;
- SALOMEDS::SComponent_wrap geomComp = SMESH_Gen_i::getStudyServant()->
+ SALOMEDS::SComponent_wrap geomComp = SMESH_Gen_i::GetSMESHGen()->getStudyServant()->
FindComponent(aPass == 0 ? "GEOM" : "SHAPERSTUDY");
if (geomComp->_is_nil()) continue;
CORBA::String_var entry = geomComp->GetID();
Threshold = SMESH + types[ iGeom ];
#ifdef _DEBUG_
// is types complete? (compilation failure means that enum GeometryType changed)
- int _asrt[( sizeof(types) / sizeof(const char*) == nbTypes ) ? 2 : -1 ]; _asrt[0]=_asrt[1]; // _asrt[1] may be used uninitialized => replace this with static_assert?
+ static_assert( sizeof(types) / sizeof(const char*) == nbTypes,
+ "Update names of GeometryType's!!!" );
#endif
}
if (Type == "SMESH.FT_EntityType")
Threshold = SMESH + types[ iGeom ];
#ifdef _DEBUG_
// is 'types' complete? (compilation failure means that enum EntityType changed)
- int _asrt[( sizeof(types) / sizeof(const char*) == nbTypes ) ? 2 : -1 ]; _asrt[0]=_asrt[1]; // _asrt[1] may be used uninitialized => replace this with static_assert?
+ static_assert( sizeof(types) / sizeof(const char*) == nbTypes,
+ "Update names of EntityType's!!!" );
#endif
}
}
{
Handle(_pyMesh) mesh = new _pyMesh( theCommand );
AddObject( mesh );
+ // set mesh name
+ _pyID id = mesh->GetID(), comma("'");
+ if ( myObjectNames.IsBound( id ))
+ theCommand->SetArg( theCommand->GetNbArgs() + 1,
+ comma + myObjectNames( id ) + comma);
return;
}
if ( method == "CreateMeshesFromUNV" ||
method == "CreateMeshesFromSTL" ||
+ method == "CreateDualMesh" ||
method == "CopyMesh" ) // command result is a mesh
{
Handle(_pyMesh) mesh = new _pyMesh( theCommand, theCommand->GetResultValue() );
return;
}
if ( method == "CreateMeshesFromMED" ||
- method == "CreateMeshesFromSAUV"||
method == "CreateMeshesFromCGNS" ||
method == "CreateMeshesFromGMF" ) // command result is ( [mesh1,mesh2], status )
{
// either the SMESH object is not in study or it is a GEOM object
if ( IsGeomObject( theObjID ))
{
- SALOMEDS::SObject_wrap so = SMESH_Gen_i::getStudyServant()->FindObjectID( theObjID.ToCString() );
+ SALOMEDS::SObject_wrap so = SMESH_Gen_i::GetSMESHGen()->getStudyServant()->FindObjectID( theObjID.ToCString() );
if ( so->_is_nil() ) return true;
CORBA::Object_var obj = so->GetObject();
return CORBA::is_nil( obj );
const _pyID& meshID = theCreationCmd->GetObject();
addFatherMesh( meshID );
}
-
+
// convert my creation command
Handle(_pyCommand) creationCmd = GetCreationCmd();
creationCmd->SetObject( SMESH_2smeshpy::SmeshpyName() );
static TStringSet sameMethods;
if ( sameMethods.empty() ) {
const char * names[] =
- { "ExportDAT","ExportUNV","ExportSTL","ExportSAUV", "RemoveGroup","RemoveGroupWithContents",
+ { "ExportDAT","ExportUNV","ExportSTL", "RemoveGroup","RemoveGroupWithContents",
"GetGroups","UnionGroups","IntersectGroups","CutGroups","CreateDimGroup","GetLog","GetId",
"ClearLog","HasDuplicatedGroupNamesMED","GetMEDMesh","NbNodes","NbElements",
"NbEdges","NbEdgesOfOrder","NbFaces","NbFacesOfOrder","NbTriangles",
list< Handle(_pySubMesh) >::iterator sm = mySubmeshes.begin();
for ( ; sm != mySubmeshes.end(); ++sm )
(*sm)->ClearCommands();
-
+
list< Handle(_pyGroup) >::iterator gr = myGroups.begin();
for ( ; gr != myGroups.end(); ++gr )
(*gr)->ClearCommands();
static TStringSet sameMethods;
if ( sameMethods.empty() ) {
const char * names[] = {
- "RemoveElements","RemoveNodes","RemoveOrphanNodes",
+ "RemoveElements","RemoveNodes","RemoveOrphanNodes","RemoveNodeWithReconnection",
"AddNode","Add0DElement","AddEdge","AddFace","AddPolygonalFace","AddBall",
- "AddVolume","AddPolyhedralVolume","AddPolyhedralVolumeByFaces",
- "MoveNode", "MoveClosestNodeToPoint",
- "InverseDiag","DeleteDiag","Reorient","ReorientObject","Reorient2DBy3D",
+ "AddVolume","AddPolyhedralVolume","AddPolyhedralVolumeByFaces","AddNodeOnSegment",
+ "MoveNode", "MoveClosestNodeToPoint","InverseDiag","DeleteDiag","AddNodeOnFace",
+ "Reorient","ReorientObject","Reorient2DBy3D","Reorient2DByNeighbours",
"TriToQuad","TriToQuadObject", "QuadTo4Tri", "SplitQuad","SplitQuadObject",
"BestSplit","Smooth","SmoothObject","SmoothParametric","SmoothParametricObject",
"ConvertToQuadratic","ConvertFromQuadratic","RenumberNodes","RenumberElements",
// 1. Remove "MakeGroups" from the Command
TCollection_AsciiString aMethod = theCommand->GetMethod();
int nbArgsToAdd = diffLastTwoArgsMethods.Contains(aMethod) ? 2 : 1;
-
+
if(is0DmethObj)
pos = pos-2; //Remove "0D" from the Command too
aMethod.Trunc(pos-1);
list< Handle(_pyCommand) >::iterator cmd = myArgCommands.begin();
_pyID prevNewName;
for ( cmd = myArgCommands.begin(); cmd != myArgCommands.end(); ++cmd )
- {
+ {
const _pyID& hyp1dID = (*cmd)->GetArg( 1 );
if ( hyp1dID.IsEmpty() ) continue;
}
newName += "_Distribution";
prevNewName = newName;
-
+
hyp1d->GetCreationCmd()->SetResultValue( newName );
}
list< Handle(_pyCommand) >& cmds = theGen->GetCommands();
//================================================================================
/*!
- * \brief Check if "[ group1, group2 ] = mesh.GetGroups()" creation command
+ * \brief Check if "[ group1, group2 ] = mesh.GetGroups()" creation command
* can be cleared
*/
//================================================================================
if ( !myNewID.IsEmpty() )
theCommand->SetObject( myNewID );
-
+
// Convert the following set of commands into smesh.GetFilterFromCriteria(criteria)
// aFilter0x2aaab0487080 = aFilterManager.CreateFilter()
// aFilter0x2aaab0487080.SetCriteria(aCriteria)
void _pyFilter::Flush()
{
if ( myNewID.IsEmpty() ) return;
-
+
list< Handle(_pyCommand) >::iterator cmd = myArgCmds.begin();
for ( ; cmd != myArgCmds.end(); ++cmd )
if ( !(*cmd)->IsEmpty() )
// ...
// dim="2">
// <python-wrap>
- // <accumulative-methods>
+ // <accumulative-methods>
// SetEnforcedVertex,
// SetEnforcedVertexNamed
// </accumulative-methods>