23237: EDF 12367 - SIGSEGV with Remove group

(SMESH_Gen_i_1.cxx)

IPAL53059: Not all solids are highlighted by magenta
  (SMESHGUI_ComputeDlg.cxx)

+ remove "using namespace std" from headers
This commit is contained in:
eap 2016-02-15 15:08:20 +03:00 committed by vsr
parent 1a4fabb165
commit 920fe932b1
38 changed files with 282 additions and 235 deletions

View File

@ -175,7 +175,7 @@ namespace {
n += q2 ^ q3;
}
double len = n.Modulus();
bool zeroLen = ( len <= numeric_limits<double>::min());
bool zeroLen = ( len <= std::numeric_limits<double>::min());
if ( !zeroLen )
n /= len;
@ -312,12 +312,12 @@ double NumericalFunctor::Round( const double & aVal )
*/
//================================================================================
void NumericalFunctor::GetHistogram(int nbIntervals,
std::vector<int>& nbEvents,
std::vector<double>& funValues,
const vector<int>& elements,
const double* minmax,
const bool isLogarithmic)
void NumericalFunctor::GetHistogram(int nbIntervals,
std::vector<int>& nbEvents,
std::vector<double>& funValues,
const std::vector<int>& elements,
const double* minmax,
const bool isLogarithmic)
{
if ( nbIntervals < 1 ||
!myMesh ||
@ -336,7 +336,7 @@ void NumericalFunctor::GetHistogram(int nbIntervals,
}
else
{
vector<int>::const_iterator id = elements.begin();
std::vector<int>::const_iterator id = elements.begin();
for ( ; id != elements.end(); ++id )
values.insert( GetValue( *id ));
}
@ -2163,7 +2163,7 @@ bool BareBorderVolume::IsSatisfy(long theElementId )
if ( myTool.IsFreeFace( iF ))
{
const SMDS_MeshNode** n = myTool.GetFaceNodes(iF);
vector< const SMDS_MeshNode*> nodes( n, n+myTool.NbFaceNodes(iF));
std::vector< const SMDS_MeshNode*> nodes( n, n+myTool.NbFaceNodes(iF));
if ( !myMesh->FindElement( nodes, SMDSAbs_Face, /*Nomedium=*/false))
return true;
}
@ -2302,15 +2302,15 @@ void CoincidentNodes::SetMesh( const SMDS_Mesh* theMesh )
while ( nIt->more() )
nodesToCheck.insert( nodesToCheck.end(), nIt->next() );
list< list< const SMDS_MeshNode*> > nodeGroups;
std::list< std::list< const SMDS_MeshNode*> > nodeGroups;
SMESH_OctreeNode::FindCoincidentNodes ( nodesToCheck, &nodeGroups, myToler );
myCoincidentIDs.Clear();
list< list< const SMDS_MeshNode*> >::iterator groupIt = nodeGroups.begin();
std::list< std::list< const SMDS_MeshNode*> >::iterator groupIt = nodeGroups.begin();
for ( ; groupIt != nodeGroups.end(); ++groupIt )
{
list< const SMDS_MeshNode*>& coincNodes = *groupIt;
list< const SMDS_MeshNode*>::iterator n = coincNodes.begin();
std::list< const SMDS_MeshNode*>& coincNodes = *groupIt;
std::list< const SMDS_MeshNode*>::iterator n = coincNodes.begin();
for ( ; n != coincNodes.end(); ++n )
myCoincidentIDs.Add( (*n)->GetID() );
}
@ -2342,7 +2342,7 @@ bool CoincidentElements::IsSatisfy( long theElementId )
if ( const SMDS_MeshElement* e = myMesh->FindElement( theElementId ))
{
if ( e->GetType() != GetType() ) return false;
set< const SMDS_MeshNode* > elemNodes( e->begin_nodes(), e->end_nodes() );
std::set< const SMDS_MeshNode* > elemNodes( e->begin_nodes(), e->end_nodes() );
const int nbNodes = e->NbNodes();
SMDS_ElemIteratorPtr invIt = (*elemNodes.begin())->GetInverseElementIterator( GetType() );
while ( invIt->more() )
@ -2589,18 +2589,20 @@ bool FreeFaces::IsSatisfy( long theId )
int nbNode = aFace->NbNodes();
// collect volumes to check that number of volumes with count equal nbNode not less than 2
typedef map< SMDS_MeshElement*, int > TMapOfVolume; // map of volume counters
typedef map< SMDS_MeshElement*, int >::iterator TItrMapOfVolume; // iterator
typedef std::map< SMDS_MeshElement*, int > TMapOfVolume; // map of volume counters
typedef std::map< SMDS_MeshElement*, int >::iterator TItrMapOfVolume; // iterator
TMapOfVolume mapOfVol;
SMDS_ElemIteratorPtr nodeItr = aFace->nodesIterator();
while ( nodeItr->more() ) {
while ( nodeItr->more() )
{
const SMDS_MeshNode* aNode = static_cast<const SMDS_MeshNode*>(nodeItr->next());
if ( !aNode ) continue;
SMDS_ElemIteratorPtr volItr = aNode->GetInverseElementIterator(SMDSAbs_Volume);
while ( volItr->more() ) {
while ( volItr->more() )
{
SMDS_MeshElement* aVol = (SMDS_MeshElement*)volItr->next();
TItrMapOfVolume itr = mapOfVol.insert(make_pair(aVol, 0)).first;
TItrMapOfVolume itr = mapOfVol.insert( std::make_pair( aVol, 0 )).first;
(*itr).second++;
}
}
@ -2704,8 +2706,8 @@ void GroupColor::SetMesh( const SMDS_Mesh* theMesh )
return;
// iterates on groups and find necessary elements ids
const std::set<SMESHDS_GroupBase*>& aGroups = aMesh->GetGroups();
set<SMESHDS_GroupBase*>::const_iterator GrIt = aGroups.begin();
const std::set<SMESHDS_GroupBase*>& aGroups = aMesh->GetGroups();
std::set<SMESHDS_GroupBase*>::const_iterator GrIt = aGroups.begin();
for (; GrIt != aGroups.end(); GrIt++)
{
SMESHDS_GroupBase* aGrp = (*GrIt);
@ -2932,10 +2934,10 @@ void ConnectedElements::SetPoint( double x, double y, double z )
// find myNodeID by myXYZ if possible
if ( myMeshModifTracer.GetMesh() )
{
auto_ptr<SMESH_ElementSearcher> searcher
SMESHUtils::Deleter<SMESH_ElementSearcher> searcher
( SMESH_MeshAlgos::GetElementSearcher( (SMDS_Mesh&) *myMeshModifTracer.GetMesh() ));
vector< const SMDS_MeshElement* > foundElems;
std::vector< const SMDS_MeshElement* > foundElems;
searcher->FindElementsByPoint( gp_Pnt(x,y,z), SMDSAbs_All, foundElems );
if ( !foundElems.empty() )
@ -2961,7 +2963,7 @@ bool ConnectedElements::IsSatisfy( long theElementId )
if ( !node0 )
return false;
list< const SMDS_MeshNode* > nodeQueue( 1, node0 );
std::list< const SMDS_MeshNode* > nodeQueue( 1, node0 );
std::set< int > checkedNodeIDs;
// algo:
// foreach node in nodeQueue:
@ -3050,8 +3052,8 @@ void CoplanarFaces::SetMesh( const SMDS_Mesh* theMesh )
const double cosTol = Cos( myToler * M_PI / 180. );
NCollection_Map< SMESH_TLink, SMESH_TLink > checkedLinks;
std::list< pair< const SMDS_MeshElement*, gp_Vec > > faceQueue;
faceQueue.push_back( make_pair( face, myNorm ));
std::list< std::pair< const SMDS_MeshElement*, gp_Vec > > faceQueue;
faceQueue.push_back( std::make_pair( face, myNorm ));
while ( !faceQueue.empty() )
{
face = faceQueue.front().first;
@ -3074,7 +3076,7 @@ void CoplanarFaces::SetMesh( const SMDS_Mesh* theMesh )
if (!normOK || isLessAngle( myNorm, norm, cosTol))
{
myCoplanarIDs.Add( f->GetID() );
faceQueue.push_back( make_pair( f, norm ));
faceQueue.push_back( std::make_pair( f, norm ));
}
}
}

View File

@ -70,9 +70,9 @@ extern "C"
elem->getshapeId() ); \
}}
#define END_ELEM_WRITE_ADD_TO_MAP( elem, e2id ) \
elem->getshapeId() ); \
e2id.insert( e2id.end(), make_pair( elem, gmfID )); \
#define END_ELEM_WRITE_ADD_TO_MAP( elem, e2id ) \
elem->getshapeId() ); \
e2id.insert( e2id.end(), std::make_pair( elem, gmfID )); \
}}
#define END_EXTRA_VERTICES_WRITE() \
@ -145,7 +145,7 @@ Driver_Mesh::Status DriverGMF_Write::Perform()
const SMDS_MeshNode* n = nodeIt->next();
n->GetXYZ( xyz );
GmfSetLin( meshID, GmfVertices, xyz[0], xyz[1], xyz[2], n->getshapeId() );
node2IdMap.insert( node2IdMap.end(), make_pair( n, ++iN ));
node2IdMap.insert( node2IdMap.end(), std::make_pair( n, ++iN ));
}
if ( iN != nbNodes )
return addMessage("Wrong nb of nodes returned by nodesIterator", /*fatal=*/true);

View File

@ -95,7 +95,7 @@ bool DriverMED_W_Field::Set(SMESHDS_Mesh * mesh,
if ( _nbElemsByGeom.empty() || _elemType != type )
{
_elemType = type;
_nbElemsByGeom.resize( 1, make_pair( SMDSEntity_Last, 0 ));
_nbElemsByGeom.resize( 1, std::make_pair( SMDSEntity_Last, 0 ));
// count nb of elems of each geometry
for ( int iG = 0; iG < SMDSEntity_Last; ++iG )
@ -107,7 +107,7 @@ bool DriverMED_W_Field::Set(SMESHDS_Mesh * mesh,
nbElems = mesh->GetMeshInfo().NbElements( geom );
if ( nbElems < 1 ) continue;
_nbElemsByGeom.push_back( make_pair( geom, nbElems + _nbElemsByGeom.back().second ));
_nbElemsByGeom.push_back( std::make_pair( geom, nbElems + _nbElemsByGeom.back().second ));
}
// add nodes of missing 0D elements on VERTEXes
if ( _addODOnVertices && _elemType == SMDSAbs_0DElement )
@ -118,8 +118,8 @@ bool DriverMED_W_Field::Set(SMESHDS_Mesh * mesh,
if ( !nodes.empty() )
{
if ( _nbElemsByGeom.size() == 1 )
_nbElemsByGeom.push_back( make_pair( SMDSEntity_0D, 0));
_nbElemsByGeom.push_back( make_pair( SMDSEntity_Node,
_nbElemsByGeom.push_back( std::make_pair( SMDSEntity_0D, 0));
_nbElemsByGeom.push_back( std::make_pair( SMDSEntity_Node,
nodes.size() + _nbElemsByGeom.back().second ));
}
}
@ -314,7 +314,7 @@ Driver_Mesh::Status DriverMED_W_Field::Perform()
SMDSAbs_EntityType smdsType = _nbElemsByGeom[iG].first;
MED::EGeometrieElement medType = (MED::EGeometrieElement) DriverMED::GetMedGeoType( smdsType );
int nbElems = _nbElemsByGeom[iG].second - _nbElemsByGeom[iG-1].second;
type2nb.insert( make_pair( medType, nbElems ));
type2nb.insert( std::make_pair( medType, nbElems ));
}
MED::EEntiteMaillage entity = ( _elemType == SMDSAbs_Node ? MED::eNOEUD : MED::eMAILLE );

View File

@ -747,7 +747,7 @@ public:
void incrementNodesCapacity(int nbNodes);
void incrementCellsCapacity(int nbCells);
void adjustStructure();
void dumpGrid(string ficdump="dumpGrid");
void dumpGrid(std::string ficdump="dumpGrid");
static int chunkSize;
//! low level modification: add, change or remove node or element

View File

@ -25,7 +25,6 @@
#define SMDS_MeshInfo_HeaderFile
#include <vector>
using namespace std;
#include "SMESH_SMDS.hxx"

View File

@ -95,7 +95,7 @@ void SMDS_VtkVolume::initPoly(const std::vector<vtkIdType>& nodeIds,
SMDS_UnstructuredGrid* grid = mesh->getGrid();
//double center[3];
//this->gravityCenter(grid, &nodeIds[0], nodeIds.size(), &center[0]);
vector<vtkIdType> ptIds;
std::vector<vtkIdType> ptIds;
vtkIdType nbFaces = nbNodesPerFace.size();
int k = 0;
for (int i = 0; i < nbFaces; i++)
@ -365,7 +365,7 @@ const SMDS_MeshNode* SMDS_VtkVolume::GetFaceNode(const int face_ind, const int n
*/
std::vector<int> SMDS_VtkVolume::GetQuantities() const
{
vector<int> quantities;
std::vector<int> quantities;
SMDS_Mesh *mesh = SMDS_Mesh::_meshList[myMeshId];
vtkUnstructuredGrid* grid = mesh->getGrid();
vtkIdType aVtkType = grid->GetCellType(this->myVtkID);

View File

@ -215,7 +215,7 @@ class SMESH_EXPORT SMESH_Algo : public SMESH_Hypothesis
* have a name (type) listed in the algorithm. Hypothesis associated to
* father shape -are not- taken into account (see GetUsedHypothesis)
*/
const list <const SMESHDS_Hypothesis *> &
const std::list <const SMESHDS_Hypothesis *> &
GetAppliedHypothesis(SMESH_Mesh & aMesh,
const TopoDS_Shape & aShape,
const bool ignoreAuxiliary=true) const;

View File

@ -93,11 +93,11 @@ public:
SMESH_EXPORT ElemFeatures& Init( double diameter )
{ myType = SMDSAbs_Ball; myBallDiameter = diameter; return *this; }
SMESH_EXPORT ElemFeatures& Init( vector<int>& quanities, bool isQuad=false )
SMESH_EXPORT ElemFeatures& Init( std::vector<int>& quanities, bool isQuad=false )
{ myType = SMDSAbs_Volume; myIsPoly = 1; myIsQuad = isQuad;
myPolyhedQuantities.swap( quanities ); return *this; }
SMESH_EXPORT ElemFeatures& Init( const vector<int>& quanities, bool isQuad=false )
SMESH_EXPORT ElemFeatures& Init( const std::vector<int>& quanities, bool isQuad=false )
{ myType = SMDSAbs_Volume; myIsPoly = 1; myIsQuad = isQuad;
myPolyhedQuantities = quanities; return *this; }
@ -777,8 +777,8 @@ public:
const bool theHasRefPoint,
const gp_Pnt& theRefPoint,
const bool theMakeGroups);
void LinearAngleVariation(const int NbSteps,
list<double>& theAngles);
void LinearAngleVariation(const int NbSteps,
std::list<double>& theAngles);
bool doubleNodes( SMESHDS_Mesh* theMeshDS,
const TIDSortedElemSet& theElems,

View File

@ -45,7 +45,7 @@ SMESH_ProxyMesh::SMESH_ProxyMesh():_mesh(0)
*/
//================================================================================
SMESH_ProxyMesh::SMESH_ProxyMesh(vector<SMESH_ProxyMesh::Ptr>& components):
SMESH_ProxyMesh::SMESH_ProxyMesh(std::vector<SMESH_ProxyMesh::Ptr>& components):
_mesh(0)
{
if ( components.empty() ) return;
@ -68,8 +68,8 @@ SMESH_ProxyMesh::SMESH_ProxyMesh(vector<SMESH_ProxyMesh::Ptr>& components):
if ( _subMeshes[j] )
{
// unite 2 sub-meshes
set< const SMDS_MeshElement * > elems( _subMeshes[j]->_elements.begin(),
_subMeshes[j]->_elements.end());
std::set< const SMDS_MeshElement * > elems( _subMeshes[j]->_elements.begin(),
_subMeshes[j]->_elements.end());
elems.insert( m->_subMeshes[j]->_elements.begin(),
m->_subMeshes[j]->_elements.end());
_subMeshes[j]->_elements.assign( elems.begin(), elems.end() );
@ -103,7 +103,7 @@ SMESH_ProxyMesh::~SMESH_ProxyMesh()
delete _subMeshes[i];
_subMeshes.clear();
set< const SMDS_MeshElement* >::iterator i = _elemsInMesh.begin();
std::set< const SMDS_MeshElement* >::iterator i = _elemsInMesh.begin();
for ( ; i != _elemsInMesh.end(); ++i )
GetMeshDS()->RemoveFreeElement( *i, 0 );
_elemsInMesh.clear();
@ -203,12 +203,12 @@ namespace
class TFilteringIterator : public SMDS_ElemIterator
{
SMDS_ElemIteratorPtr _iter;
const SMDS_MeshElement * _curElem;
vector< SMDSAbs_EntityType> _okTypes;
SMDS_ElemIteratorPtr _iter;
const SMDS_MeshElement * _curElem;
std::vector< SMDSAbs_EntityType> _okTypes;
public:
TFilteringIterator( const vector< SMDSAbs_EntityType>& okTypes,
const SMDS_ElemIteratorPtr& elemIterator)
TFilteringIterator( const std::vector< SMDSAbs_EntityType>& okTypes,
const SMDS_ElemIteratorPtr& elemIterator)
:_iter(elemIterator), _curElem(0), _okTypes(okTypes)
{
next();
@ -282,11 +282,11 @@ SMDS_ElemIteratorPtr SMESH_ProxyMesh::GetFaces() const
// ... else elements filtered using allowedTypes are additionally returned
SMDS_ElemIteratorPtr facesIter = GetMeshDS()->elementsIterator(SMDSAbs_Face);
SMDS_ElemIteratorPtr filterIter( new TFilteringIterator( _allowedTypes, facesIter ));
vector< SMDS_ElemIteratorPtr > iters(2);
std::vector< SMDS_ElemIteratorPtr > iters(2);
iters[0] = proxyIter;
iters[1] = filterIter;
typedef vector< SMDS_ElemIteratorPtr > TElemIterVector;
typedef std::vector< SMDS_ElemIteratorPtr > TElemIterVector;
typedef SMDS_IteratorOnIterators<const SMDS_MeshElement *, TElemIterVector> TItersIter;
return SMDS_ElemIteratorPtr( new TItersIter( iters ));
}
@ -431,7 +431,7 @@ void SMESH_ProxyMesh::removeTmpElement( const SMDS_MeshElement* elem )
{
if ( elem && elem->GetID() > 0 )
{
set< const SMDS_MeshElement* >::iterator i = _elemsInMesh.find( elem );
std::set< const SMDS_MeshElement* >::iterator i = _elemsInMesh.find( elem );
if ( i != _elemsInMesh.end() )
{
GetMeshDS()->RemoveFreeElement( elem, 0 );
@ -468,7 +468,7 @@ void SMESH_ProxyMesh::setNode2Node(const SMDS_MeshNode* srcNode,
SubMesh* sm = const_cast<SubMesh*>( subMesh );
if ( !subMesh->_n2n )
sm->_n2n = new TN2NMap;
sm->_n2n->insert( make_pair( srcNode, proxyNode ));
sm->_n2n->insert( std::make_pair( srcNode, proxyNode ));
}
//================================================================================

View File

@ -61,6 +61,7 @@ static int MYDEBUG = 0;
namespace
{
using std::runtime_error;
//=======================================================================
//function : FindNode
@ -972,7 +973,7 @@ SMESH_Client::Update(bool theIsClear)
int nbNodes = anIndexes[i++];
// nodes
//ASSERT( nbNodes < 9 );
vector<const SMDS_MeshNode*> aNodes( nbNodes );
std::vector<const SMDS_MeshNode*> aNodes( nbNodes );
for ( int iNode = 0; iNode < nbNodes; iNode++ )
aNodes[ iNode ] = FindNode( mySMDSMesh, anIndexes[i++] );
// change

View File

@ -118,8 +118,8 @@ namespace
static int FirstHexahedronIds[] = {0,1,2,3,4,5,6,7,0,1,2,3};
static int LastHexahedronIds[] = {1,2,3,0,5,6,7,4,4,5,6,7};
static vector<int> FirstPolygonIds;
static vector<int> LastPolygonIds;
static std::vector<int> FirstPolygonIds;
static std::vector<int> LastPolygonIds;
void ReverseConnectivity( std::vector<vtkIdType> & ids, SMDSAbs_EntityType type,
bool toReverse, // inverse element

View File

@ -108,6 +108,7 @@
#define MARGIN 11
#define COLONIZE(str) (QString(str).contains(":") > 0 ? QString(str) : QString(str) + " :" )
#define __SHAPE_RGB__ 250, 0, 250
enum TCol {
COL_ALGO = 0, COL_SHAPE, COL_ERROR, COL_SHAPEID, COL_PUBLISHED, COL_BAD_MESH, NB_COLUMNS
@ -147,10 +148,10 @@ namespace SMESH
{
myProperty = vtkProperty::New();
myProperty->SetRepresentationToWireframe();
myProperty->SetColor( 250, 0, 250 );
myProperty->SetAmbientColor( 250, 0, 250 );
myProperty->SetDiffuseColor( 250, 0, 250 );
//myProperty->SetSpecularColor( 250, 0, 250 );
myProperty->SetColor( __SHAPE_RGB__ );
myProperty->SetAmbientColor( __SHAPE_RGB__ );
myProperty->SetDiffuseColor( __SHAPE_RGB__ );
//myProperty->SetSpecularColor( __SHAPE_RGB__ );
myProperty->SetLineWidth( 5 );
}
// -----------------------------------------------------------------------
@ -278,13 +279,18 @@ namespace SMESH
actor = GEOM_Actor::New();
if ( actor ) {
actor->SetShape(shape,0,0);
actor->SetProperty(myProperty);
actor->SetShadingProperty(myProperty);
actor->SetWireframeProperty(myProperty);
actor->SetPreviewProperty(myProperty);
// actor->SetProperty(myProperty);
// actor->SetShadingProperty(myProperty);
// actor->SetWireframeProperty(myProperty);
// actor->SetPreviewProperty(myProperty);
actor->PickableOff();
// if ( shape.ShapeType() == TopAbs_EDGE )
// actor->SubShapeOn();
//
actor->SetWidth( myProperty->GetLineWidth() );
actor->SetIsosWidth( myProperty->GetLineWidth() );
actor->SetIsosColor( __SHAPE_RGB__ );
actor->SetColor( __SHAPE_RGB__ );
// if ( shape.ShapeType() == TopAbs_EDGE )
// actor->SubShapeOn();
myViewWindow->AddActor( actor );
}
}
@ -736,10 +742,11 @@ void SMESHGUI_ComputeDlg_QThread::cancel()
//================================================================================
//================================================================================
SMESHGUI_ComputeDlg_QThreadQDialog::SMESHGUI_ComputeDlg_QThreadQDialog(QWidget * parent,
SMESH::SMESH_Gen_var gen,
SMESH::SMESH_Mesh_var mesh,
GEOM::GEOM_Object_var mainShape)
SMESHGUI_ComputeDlg_QThreadQDialog::
SMESHGUI_ComputeDlg_QThreadQDialog(QWidget * parent,
SMESH::SMESH_Gen_var gen,
SMESH::SMESH_Mesh_var mesh,
GEOM::GEOM_Object_var mainShape)
: QDialog(parent,
Qt::WindowSystemMenuHint |
Qt::WindowCloseButtonHint |
@ -920,23 +927,28 @@ void SMESHGUI_BaseComputeOp::computeMesh()
if ( !memoryLack )
{
// List of objects that will be updated automatically
QList< QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) > > aListToUpdate;
SMESH::SMESH_IDSource_var aMeshObj = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( aMeshSObj );
typedef QList< QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) > > TListOf_IDSrc_SObj;
TListOf_IDSrc_SObj aListToUpdate;
SMESH::SMESH_IDSource_var aMeshObj =
SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( aMeshSObj );
// put Mesh into list
aListToUpdate.append( QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) >(aMeshObj, aMeshSObj) );
aListToUpdate.append( TListOf_IDSrc_SObj::value_type( aMeshObj, aMeshSObj ));
SMESH::submesh_array_var aSubMeshes = myMesh->GetSubMeshes();
// put SubMeshes into list
for ( CORBA::ULong i = 0; i < aSubMeshes->length(); i++ ) {
for ( CORBA::ULong i = 0; i < aSubMeshes->length(); i++ )
{
SMESH::SMESH_subMesh_var sm = aSubMeshes[i];
if ( CORBA::is_nil( sm ) ) continue;
_PTR(SObject) smSObj = SMESH::ObjectToSObject( sm );
if ( !smSObj ) continue;
SMESH::SMESH_IDSource_var aSubMeshObj = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( smSObj );
aListToUpdate.append( QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) >(aSubMeshObj, smSObj) );
SMESH::SMESH_IDSource_var aSubMeshObj =
SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( smSObj );
aListToUpdate.append( TListOf_IDSrc_SObj::value_type( aSubMeshObj, smSObj ));
}
// put Groups into list
SMESH::ListOfGroups_var aGroups = myMesh->GetGroups();
for ( size_t i = 0; i < aGroups->length(); ++i ) {
SMESH::ListOfGroups_var aGroups = myMesh->GetGroups();
for ( size_t i = 0; i < aGroups->length(); ++i )
{
SMESH::SMESH_GroupBase_var aGrp = aGroups[i];
if ( CORBA::is_nil( aGrp ) ) continue;
SMESH::SMESH_Group_var aStdGroup = SMESH::SMESH_Group::_narrow( aGrp );
@ -945,26 +957,31 @@ void SMESHGUI_BaseComputeOp::computeMesh()
if ( !aStdGroup->_is_nil() ) continue; // don't update the standalone groups
_PTR(SObject) aGroupSO = SMESH::FindSObject( aGrp );
if ( !aGroupSO ) continue;
SMESH::SMESH_IDSource_var aGroupObj = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( aGroupSO );
aListToUpdate.append( QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) >(aGroupObj, aGroupSO) );
SMESH::SMESH_IDSource_var aGroupObj =
SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( aGroupSO );
aListToUpdate.append( TListOf_IDSrc_SObj::value_type( aGroupObj, aGroupSO ));
}
// update mesh, sub-mesh and groups, if it's possible
QList< QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) > >::iterator anIter;
for( anIter = aListToUpdate.begin(); anIter != aListToUpdate.end(); anIter++ ) {
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow( SMESH::SObjectToObject( (*anIter).second ));
if ( getSMESHGUI()->automaticUpdate( (*anIter).first, &entities, &limitExceeded, &hidden, &nbElements ) )
TListOf_IDSrc_SObj::iterator anIter;
for ( anIter = aListToUpdate.begin(); anIter != aListToUpdate.end(); anIter++ )
{
SMESH::SMESH_Mesh_var aMesh =
SMESH::SMESH_Mesh::_narrow( SMESH::SObjectToObject( (*anIter).second ));
if ( getSMESHGUI()->automaticUpdate( (*anIter).first, &entities, &limitExceeded,
&hidden, &nbElements ) )
{
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
bool toDisplay = false;
if ( !aMesh->_is_nil() ) { // display a mesh only
if ( !aMesh->_is_nil() ) // display only a mesh
{
toDisplay = true;
SMESH_Actor *anActor = SMESH::FindActorByObject( aMesh );
if ( !anActor ) anActor = SMESH::CreateActor( (*anIter).second->GetStudy(), (*anIter).second->GetID().c_str(), true );
if ( !anActor ) anActor = SMESH::CreateActor( (*anIter).second->GetStudy(),
(*anIter).second->GetID().c_str(),
/*clearLog =*/ true );
if ( anActor ) // actor is not created for an empty mesh
{
anActor->SetEntityMode( entities );
@ -985,7 +1002,10 @@ void SMESHGUI_BaseComputeOp::computeMesh()
if ( hidden & SMESH_Actor::eBallElem ) hiddenMsg << tr( "SMESH_BALLS" );
SUIT_MessageBox::warning( desktop(),
tr( "SMESH_WRN_WARNING" ),
tr( "SMESH_WRN_SIZE_INC_LIMIT_EXCEEDED" ).arg( nbElements ).arg( limitSize ).arg( hiddenMsg.join(", ") ) );
tr( "SMESH_WRN_SIZE_INC_LIMIT_EXCEEDED" ).
arg( nbElements ).
arg( limitSize ).
arg( hiddenMsg.join(", ")));
}
}
catch (...) {
@ -1004,12 +1024,12 @@ void SMESHGUI_BaseComputeOp::computeMesh()
{
SUIT_MessageBox::warning( desktop(),
tr( "SMESH_WRN_WARNING" ),
tr( "SMESH_WRN_SIZE_LIMIT_EXCEEDED" ).arg( nbElements ).arg( limitSize ) );
tr( "SMESH_WRN_SIZE_LIMIT_EXCEEDED" ).
arg( nbElements ).arg( limitSize ) );
}
}
}
LightApp_SelectionMgr *Sel = selectionMgr();
if ( Sel )
if ( LightApp_SelectionMgr *Sel = selectionMgr() )
{
SALOME_ListIO selected;
selected.Append( myIObject );
@ -1021,10 +1041,11 @@ void SMESHGUI_BaseComputeOp::computeMesh()
if ( memoryLack )
aMemoryReserve.release();
myCompDlg->setWindowTitle(tr( computeFailed ? "SMESH_WRN_COMPUTE_FAILED" : "SMESH_COMPUTE_SUCCEED"));
myCompDlg->setWindowTitle
( tr( computeFailed ? "SMESH_WRN_COMPUTE_FAILED" : "SMESH_COMPUTE_SUCCEED" ));
// SHOW ERRORS
bool noCompError = ( !aCompErrors.operator->() || aCompErrors->length() == 0 );
bool noHypoError = ( aHypErrors.isEmpty() );
@ -1238,8 +1259,9 @@ void SMESHGUI_BaseComputeOp::onPublishShape()
if ( !SMESH::getSubShapeSO( 1, myMainShape )) // the main shape not published
{
QString name = GEOMBase::GetDefaultName( SMESH::shapeTypeName( myMainShape, "MAIN_SHAPE" ));
SALOMEDS::SObject_wrap so =
geomGen->AddInStudy( study, myMainShape, name.toLatin1().data(), GEOM::GEOM_Object::_nil());
SALOMEDS::SObject_wrap so = geomGen->AddInStudy( study, myMainShape,
name.toLatin1().data(),
GEOM::GEOM_Object::_nil());
// look for myMainShape in the table
for ( int r = 0, nr = table()->rowCount(); r < nr; ++r ) {
if ( table()->item( r, COL_SHAPEID )->text() == "1" ) {
@ -1256,7 +1278,8 @@ void SMESHGUI_BaseComputeOp::onPublishShape()
if ( curSub == 1 ) continue;
}
QString name = GEOMBase::GetDefaultName( SMESH::shapeTypeName( shape, "ERROR_SHAPE" ));
SALOMEDS::SObject_wrap so = geomGen->AddInStudy( study, shape, name.toLatin1().data(), myMainShape);
SALOMEDS::SObject_wrap so = geomGen->AddInStudy( study, shape,
name.toLatin1().data(), myMainShape);
if ( !so->_is_nil() ) {
CORBA::String_var name = so->GetName();
CORBA::String_var entry = so->GetID();
@ -1999,7 +2022,8 @@ void SMESHGUI_PrecomputeOp::onPreview()
if ( isShowError )
{
myDlg->hide();
aCompDlg->setWindowTitle(tr( computeFailed ? "SMESH_WRN_COMPUTE_FAILED" : "SMESH_COMPUTE_SUCCEED"));
aCompDlg->setWindowTitle
( tr( computeFailed ? "SMESH_WRN_COMPUTE_FAILED" : "SMESH_COMPUTE_SUCCEED" ));
showComputeResult( memoryLack, noCompError, aCompErrors, noHypoError, aHypErrors );
}
}
@ -2202,10 +2226,11 @@ void SMESHGUI_BaseComputeOp::evaluateMesh()
aMemoryReserve.release();
evaluateFailed = ( aCompErrors->length() > 0 );
myCompDlg->setWindowTitle(tr( evaluateFailed ? "SMESH_WRN_EVALUATE_FAILED" : "SMESH_EVALUATE_SUCCEED"));
myCompDlg->setWindowTitle
( tr( evaluateFailed ? "SMESH_WRN_EVALUATE_FAILED" : "SMESH_EVALUATE_SUCCEED" ));
// SHOW ERRORS
bool noCompError = ( !aCompErrors.operator->() || aCompErrors->length() == 0 );
bool noHypoError = ( aHypErrors.isEmpty() );

View File

@ -1852,7 +1852,7 @@ void SMESHGUI_SplitVolumesDlg::showFacetByElement( int elemID )
gp_XYZ bc( 0,0,0 );
Bnd_B3d bbox;
SMDS_NodeIteratorPtr nIt = elem->nodeIterator();
vector< const SMDS_MeshNode* > nodes;
std::vector< const SMDS_MeshNode* > nodes;
nodes.reserve( elem->NbNodes() );
while ( nIt->more() )
{

View File

@ -30,40 +30,38 @@
# include <string>
# include <sstream>
using namespace std;
/*!
* \brief Class to generate string from any type
*/
class SMESH_Comment : public string
class SMESH_Comment : public std::string
{
ostringstream _s ;
std::ostringstream _s ;
public :
SMESH_Comment():string("") {}
SMESH_Comment():std::string("") {}
SMESH_Comment(const SMESH_Comment& c):string() {
SMESH_Comment(const SMESH_Comment& c):std::string() {
_s << c.c_str() ;
this->string::operator=( _s.str() );
this->std::string::operator=( _s.str() );
}
SMESH_Comment & operator=(const SMESH_Comment& c) {
_s << c.c_str() ;
this->string::operator=( _s.str() );
this->std::string::operator=( _s.str() );
return *this;
}
template <class T>
SMESH_Comment( const T &anything ) {
_s << anything ;
this->string::operator=( _s.str() );
this->std::string::operator=( _s.str() );
}
template <class T>
SMESH_Comment & operator<<( const T &anything ) {
_s << anything ;
this->string::operator=( _s.str() );
this->std::string::operator=( _s.str() );
return *this ;
}

View File

@ -290,7 +290,7 @@ namespace
void BNode::AddClose ( const BEdge* e, double u ) const
{
if ( ! e->Contains( this ))
myCloseEdges.push_back( make_pair( const_cast< BEdge* >( e ), u ));
myCloseEdges.push_back( std::make_pair( const_cast< BEdge* >( e ), u ));
}
BEdge* BNode::GetCloseEdgeOfBorder( int borderID, double * uPtr ) const
{
@ -569,9 +569,9 @@ void SMESH_MeshAlgos::FindCoincidentFreeBorders(SMDS_Mesh& mesh,
// form groups of coincident parts of free borders
TFreeBorderPart part;
TCoincidentGroup group;
vector< BEdge* > ranges; // couples of edges delimiting parts
TFreeBorderPart part;
TCoincidentGroup group;
std::vector< BEdge* > ranges; // couples of edges delimiting parts
BEdge* be = 0; // a current edge
int skipGroup = bEdges.size(); // a group ID used to avoid repeating treatment of edges

View File

@ -1297,7 +1297,7 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
TCollection_AsciiString aLongString, aFunctionType;
int where = 1;
set< string > functionNameSet;
std::set< std::string > functionNameSet;
while ( SMESH::TPythonDump::CutoutLongString( anUpdatedScript, where, aLongString, aFunctionType ))
{
// make a python string literal

View File

@ -1628,7 +1628,7 @@ void ConnectedElements_i::SetThreshold ( const char*
{
case SMESH::ConnectedElements::POINT: // read 3 node coordinates ///////////////////
{
vector< double > xyz;
std::vector< double > xyz;
char* endptr;
do
{

View File

@ -71,16 +71,16 @@ public:
mapIdToId.clear();
}
// register object in the internal map and return its id
int addObject( string theIOR )
int addObject( std::string theIOR )
{
int nextId = getNextId();
mapIdToIOR[ nextId ] = theIOR;
return nextId;
}
// find the object id in the internal map by the IOR
int findId( string theIOR )
int findId( std::string theIOR )
{
map<int, string>::iterator imap;
std::map<int, std::string>::iterator imap;
for ( imap = mapIdToIOR.begin(); imap != mapIdToIOR.end(); ++imap ) {
if ( imap->second == theIOR )
return imap->first;
@ -88,18 +88,18 @@ public:
return 0;
}
// get object's IOR by id
string getIORbyId( const int theId )
std::string getIORbyId( const int theId )
{
if ( mapIdToIOR.find( theId ) != mapIdToIOR.end() )
return mapIdToIOR[ theId ];
return string( "" );
return std::string( "" );
}
// get object's IOR by old id
string getIORbyOldId( const int theOldId )
std::string getIORbyOldId( const int theOldId )
{
if ( mapIdToId.find( theOldId ) != mapIdToId.end() )
return getIORbyId( mapIdToId[ theOldId ] );
return string( "" );
return std::string( "" );
}
// maps old object id to the new one (used when restoring data)
void mapOldToNew( const int oldId, const int newId ) {
@ -107,7 +107,7 @@ public:
}
// get old id by a new one
int getOldId( const int newId ) {
map<int, int>::iterator imap;
std::map<int, int>::iterator imap;
for ( imap = mapIdToId.begin(); imap != mapIdToId.end(); ++imap ) {
if ( imap->second == newId )
return imap->first;
@ -125,8 +125,8 @@ private:
return id;
}
map<int, string> mapIdToIOR; // persistent-to-transient map
map<int, int> mapIdToId; // used to translate object from persistent to transient form
std::map<int, std::string> mapIdToIOR; // persistent-to-transient map
std::map<int, int> mapIdToId; // to translate object from persistent to transient form
};
// ===========================================================
@ -568,7 +568,7 @@ public:
typename TInterface::_var_type GetObjectByOldId( const int oldID )
{
if ( StudyContext* myStudyContext = GetCurrentStudyContext() ) {
string ior = myStudyContext->getIORbyOldId( oldID );
std::string ior = myStudyContext->getIORbyOldId( oldID );
if ( !ior.empty() )
return TInterface::_narrow(GetORB()->string_to_object( ior.c_str() ));
}
@ -671,13 +671,13 @@ private:
::SMESH_Gen myGen; // SMESH_Gen local implementation
// hypotheses managing
map<string, GenericHypothesisCreator_i*> myHypCreatorMap;
std::map<std::string, GenericHypothesisCreator_i*> myHypCreatorMap;
map<int, StudyContext*> myStudyContextMap; // Map of study context objects
std::map<int, StudyContext*> myStudyContextMap; // Map of study context objects
GEOM_Client* myShapeReader; // Shape reader
SALOMEDS::Study_var myCurrentStudy; // Current study
CORBA::Boolean myIsEmbeddedMode; // Current mode
GEOM_Client* myShapeReader; // Shape reader
SALOMEDS::Study_var myCurrentStudy; // Current study
CORBA::Boolean myIsEmbeddedMode; // Current mode
// Default color of groups
std::string myDefaultGroupColor;

View File

@ -47,12 +47,12 @@
#ifdef _DEBUG_
static int MYDEBUG = 0;
//static int VARIABLE_DEBUG = 0;
#else
static int MYDEBUG = 0;
//static int VARIABLE_DEBUG = 0;
#endif
using namespace std;
//=============================================================================
/*!
* Get...Tag [ static ]
@ -281,7 +281,8 @@ static SALOMEDS::SObject_ptr publish(SALOMEDS::Study_ptr theStudy,
SALOMEDS::SObject_wrap curObj;
if ( theFatherObject->GetLastChildTag() > theTag )
{
SALOMEDS::UseCaseIterator_wrap anUseCaseIter = useCaseBuilder->GetUseCaseIterator(theFatherObject);
SALOMEDS::UseCaseIterator_wrap
anUseCaseIter = useCaseBuilder->GetUseCaseIterator(theFatherObject);
for ( ; anUseCaseIter->More(); anUseCaseIter->Next() ) {
curObj = anUseCaseIter->Value();
if ( curObj->Tag() > theTag ) {
@ -294,21 +295,29 @@ static SALOMEDS::SObject_ptr publish(SALOMEDS::Study_ptr theStudy,
}
SALOMEDS::GenericAttribute_wrap anAttr;
if ( !CORBA::is_nil( theIOR )) {
if ( !CORBA::is_nil( theIOR ))
{
anAttr = aStudyBuilder->FindOrCreateAttribute( SO, "AttributeIOR" );
CORBA::String_var objStr = SMESH_Gen_i::GetORB()->object_to_string( theIOR );
SALOMEDS::AttributeIOR_wrap iorAttr = anAttr;
iorAttr->SetValue( objStr.in() );
// UnRegister() !!!
SALOME::GenericObj_var genObj = SALOME::GenericObj::_narrow( theIOR );
if ( !genObj->_is_nil() )
genObj->UnRegister();
CORBA::String_var objStrCur = iorAttr->Value();
bool sameIOR = ( objStrCur.in() && strcmp( objStr.in(), objStrCur.in() ) == 0 );
if ( !sameIOR )
{
iorAttr->SetValue( objStr.in() );
// UnRegister() !!!
SALOME::GenericObj_var genObj = SALOME::GenericObj::_narrow( theIOR );
if ( !genObj->_is_nil() )
genObj->UnRegister();
}
}
if ( thePixMap ) {
anAttr = aStudyBuilder->FindOrCreateAttribute( SO, "AttributePixMap" );
SALOMEDS::AttributePixMap_wrap pm = anAttr;
pm->SetPixMap( thePixMap );
}
if ( !theSelectable ) {
anAttr = aStudyBuilder->FindOrCreateAttribute( SO, "AttributeSelectable" );
SALOMEDS::AttributeSelectable_wrap selAttr = anAttr;

View File

@ -502,8 +502,8 @@ namespace
*/
//================================================================================
void getNodesOfElements(SMDS_ElemIteratorPtr elemIt,
set<const SMDS_MeshNode* >& nodes)
void getNodesOfElements(SMDS_ElemIteratorPtr elemIt,
std::set<const SMDS_MeshNode* >& nodes)
{
while ( elemIt->more() )
{
@ -531,7 +531,7 @@ CORBA::Long SMESH_GroupBase_i::GetNumberOfNodes()
{
if ( myNbNodes < 0 || g->GetTic() != myGroupDSTic )
{
set<const SMDS_MeshNode* > nodes;
std::set<const SMDS_MeshNode* > nodes;
getNodesOfElements( g->GetElements(), nodes );
myNbNodes = nodes.size();
myGroupDSTic = g->GetTic();
@ -574,10 +574,10 @@ SMESH::long_array* SMESH_GroupBase_i::GetNodeIDs()
SMESH::long_array_var aRes = new SMESH::long_array();
if ( SMESHDS_GroupBase* g = GetGroupDS())
{
set<const SMDS_MeshNode* > nodes;
std::set<const SMDS_MeshNode* > nodes;
getNodesOfElements( g->GetElements(), nodes );
aRes->length( nodes.size() );
set<const SMDS_MeshNode*>::iterator nIt = nodes.begin(), nEnd = nodes.end();
std::set<const SMDS_MeshNode*>::iterator nIt = nodes.begin(), nEnd = nodes.end();
for ( int i = 0; nIt != nEnd; ++nIt, ++i )
aRes[i] = (*nIt)->GetID();
}
@ -918,7 +918,7 @@ SMESH::long_array* SMESH_GroupOnFilter_i::GetMeshInfo()
if ( g->GetType() != SMDSAbs_Node )
{
vector< int > nbElems = static_cast< SMESHDS_GroupOnFilter* >( g )->GetMeshInfo();
std::vector< int > nbElems = static_cast< SMESHDS_GroupOnFilter* >( g )->GetMeshInfo();
for ( size_t i = SMESH::Entity_Node; i < SMESH::Entity_Last; i++)
if ( i < nbElems.size() )
aRes[i] = nbElems[ i ];

View File

@ -221,12 +221,12 @@ static void enlargeBoundingBox(const SMDS_MeshNode* theNode,
theMeasure.node1 = theNode->GetID();
}
else {
theMeasure.minX = min( theMeasure.minX, theNode->X() );
theMeasure.maxX = max( theMeasure.maxX, theNode->X() );
theMeasure.minY = min( theMeasure.minY, theNode->Y() );
theMeasure.maxY = max( theMeasure.maxY, theNode->Y() );
theMeasure.minZ = min( theMeasure.minZ, theNode->Z() );
theMeasure.maxZ = max( theMeasure.maxZ, theNode->Z() );
theMeasure.minX = std::min( theMeasure.minX, theNode->X() );
theMeasure.maxX = std::max( theMeasure.maxX, theNode->X() );
theMeasure.minY = std::min( theMeasure.minY, theNode->Y() );
theMeasure.maxY = std::max( theMeasure.maxY, theNode->Y() );
theMeasure.minZ = std::min( theMeasure.minZ, theNode->Z() );
theMeasure.maxZ = std::max( theMeasure.maxZ, theNode->Z() );
}
}

View File

@ -5249,10 +5249,10 @@ void SMESH_MeshEditor_i::dumpGroupsList(TPythonDump & theDumpPytho
*/
//================================================================================
string SMESH_MeshEditor_i::generateGroupName(const string& thePrefix)
std::string SMESH_MeshEditor_i::generateGroupName(const std::string& thePrefix)
{
SMESH::ListOfGroups_var groups = myMesh_i->GetGroups();
set<string> groupNames;
set<std::string> groupNames;
// Get existing group names
for (int i = 0, nbGroups = groups->length(); i < nbGroups; i++ ) {
@ -5265,7 +5265,7 @@ string SMESH_MeshEditor_i::generateGroupName(const string& thePrefix)
}
// Find new name
string name = thePrefix;
std::string name = thePrefix;
int index = 0;
while (!groupNames.insert(name).second)
@ -5573,8 +5573,8 @@ SMESH_MeshEditor_i::DoubleNodeGroupNew( SMESH::SMESH_GroupBase_ptr theNodes,
// Create group with newly created nodes
SMESH::long_array_var anIds = GetLastCreatedNodes();
if (anIds->length() > 0) {
string anUnindexedName (theNodes->GetName());
string aNewName = generateGroupName(anUnindexedName + "_double");
std::string anUnindexedName (theNodes->GetName());
std::string aNewName = generateGroupName(anUnindexedName + "_double");
aNewGroup = myMesh_i->CreateGroup(SMESH::NODE, aNewName.c_str());
aNewGroup->Add(anIds);
pyDump << aNewGroup << " = ";
@ -5672,8 +5672,8 @@ SMESH_MeshEditor_i::DoubleNodeGroupsNew( const SMESH::ListOfGroups& theNodes,
// Create group with newly created nodes
SMESH::long_array_var anIds = GetLastCreatedNodes();
if (anIds->length() > 0) {
string anUnindexedName (theNodes[0]->GetName());
string aNewName = generateGroupName(anUnindexedName + "_double");
std::string anUnindexedName (theNodes[0]->GetName());
std::string aNewName = generateGroupName(anUnindexedName + "_double");
aNewGroup = myMesh_i->CreateGroup(SMESH::NODE, aNewName.c_str());
aNewGroup->Add(anIds);
pyDump << aNewGroup << " = ";
@ -5897,7 +5897,7 @@ SMESH_MeshEditor_i::DoubleNodeElemGroup2New(SMESH::SMESH_GroupBase_ptr theElems,
{
// Create group with newly created elements
CORBA::String_var elemGroupName = theElems->GetName();
string aNewName = generateGroupName( string(elemGroupName.in()) + "_double");
std::string aNewName = generateGroupName( std::string(elemGroupName.in()) + "_double");
if ( !getEditor().GetLastCreatedElems().IsEmpty() && theElemGroupNeeded )
{
SMESH::long_array_var anIds = GetLastCreatedElems();
@ -6129,7 +6129,7 @@ SMESH_MeshEditor_i::DoubleNodeElemGroups2New(const SMESH::ListOfGroups& theElems
{
// Create group with newly created elements
CORBA::String_var elemGroupName = theElems[0]->GetName();
string aNewName = generateGroupName( string(elemGroupName.in()) + "_double");
std::string aNewName = generateGroupName( std::string(elemGroupName.in()) + "_double");
if ( !getEditor().GetLastCreatedElems().IsEmpty() && theElemGroupNeeded )
{
SMESH::long_array_var anIds = GetLastCreatedElems();

View File

@ -37,6 +37,7 @@
#include "SMESH_PythonDump.hxx"
#include "SMESH_MeshEditor.hxx"
#include <list>
#include <string>
class SMESH_Mesh_i;
@ -897,7 +898,7 @@ private: //!< private methods
void dumpGroupsList(SMESH::TPythonDump & theDumpPython,
const SMESH::ListOfGroups * theGroupList);
string generateGroupName(const string& thePrefix);
std::string generateGroupName(const std::string& thePrefix);
void prepareIdSource(SMESH::SMESH_IDSource_ptr theObject);

View File

@ -45,6 +45,8 @@
#include <sstream>
#include <set>
using namespace std;
using SMESH::TPythonDump;
using SMESH::TVar;

View File

@ -54,6 +54,7 @@
#include CORBA_SERVER_HEADER(SALOME_Session)
using namespace std;
#define MYDEBUGOUT(msg) //std::cout << msg << std::endl;
@ -62,7 +63,7 @@ namespace
enum { GroupOnFilter_OutOfDate = -1 };
// a map to count not yet loaded meshes
static map< int, int > theStudyIDToMeshCounter;
static std::map< int, int > theStudyIDToMeshCounter;
//================================================================================
/*!
@ -72,8 +73,8 @@ namespace
void meshInfoLoaded( SMESH_Mesh_i* mesh )
{
map< int, int >::iterator id2counter =
theStudyIDToMeshCounter.insert( make_pair( (int) mesh->GetStudyId(), 0 )).first;
std::map< int, int >::iterator id2counter =
theStudyIDToMeshCounter.insert( std::make_pair( (int) mesh->GetStudyId(), 0 )).first;
id2counter->second++;
}
//================================================================================
@ -88,7 +89,7 @@ namespace
{
if ( --theStudyIDToMeshCounter[ (int) mesh->GetStudyId() ] == 0 )
{
string tmpDir = SALOMEDS_Tool::GetDirFromPath( hdfFile );
std::string tmpDir = SALOMEDS_Tool::GetDirFromPath( hdfFile );
SALOMEDS::ListOfFileNames_var aFiles = new SALOMEDS::ListOfFileNames;
aFiles->length(2);
@ -109,7 +110,7 @@ namespace
class SignalToGUI
{
string _messagePrefix;
std::string _messagePrefix;
SALOME::Session_var _session;
public:
SignalToGUI( SMESH_Mesh_i* mesh )
@ -127,7 +128,7 @@ namespace
_messagePrefix = "SMESH/mesh_loading/";
_messagePrefix += meshEntry.in();
string msgToGUI = _messagePrefix + "/";
std::string msgToGUI = _messagePrefix + "/";
msgToGUI += SMESH_Comment( mesh->NbNodes() );
msgToGUI += "/";
msgToGUI += SMESH_Comment( mesh->NbElements() );
@ -140,7 +141,7 @@ namespace
{
if ( !_messagePrefix.empty() )
{
string msgToGUI = _messagePrefix + "/stop";
std::string msgToGUI = _messagePrefix + "/stop";
_session->emitMessageOneWay( msgToGUI.c_str());
_messagePrefix.clear();
}
@ -173,7 +174,7 @@ namespace
SMDS_PositionPtr vertexPosition() const { return SMDS_PositionPtr( new SMDS_VertexPosition); }
SMDS_PositionPtr defaultPosition() const { return SMDS_SpacePosition::originSpacePosition(); }
typedef SMDS_PositionPtr (PositionCreator:: * FmakePos)() const;
vector<FmakePos> myFuncTable;
std::vector<FmakePos> myFuncTable;
};
//================================================================================
@ -182,12 +183,12 @@ namespace
*/
//================================================================================
vector<int> getSimpleSubMeshIds( SMESHDS_Mesh* meshDS, int shapeId )
std::vector<int> getSimpleSubMeshIds( SMESHDS_Mesh* meshDS, int shapeId )
{
vector<int> ids;
std::vector<int> ids;
list<TopoDS_Shape> shapeQueue( 1, meshDS->IndexToShape( shapeId ));
list<TopoDS_Shape>::iterator shape = shapeQueue.begin();
std::list<TopoDS_Shape> shapeQueue( 1, meshDS->IndexToShape( shapeId ));
std::list<TopoDS_Shape>::iterator shape = shapeQueue.begin();
for ( ; shape != shapeQueue.end(); ++shape )
{
if ( shape->IsNull() ) continue;
@ -222,10 +223,10 @@ namespace
*/
//================================================================================
typedef map< MED::EGeometrieElement, SMDSAbs_EntityType > Tmed2smeshElemTypeMap;
typedef std::map< MED::EGeometrieElement, SMDSAbs_EntityType > Tmed2smeshElemTypeMap;
const Tmed2smeshElemTypeMap& med2smeshElemTypeMap()
{
static map< MED::EGeometrieElement, SMDSAbs_EntityType> med2smeshTypes;
static Tmed2smeshElemTypeMap med2smeshTypes;
if ( med2smeshTypes.empty() )
{
for ( int iG = 0; iG < SMDSEntity_Last; ++iG )
@ -233,7 +234,7 @@ namespace
SMDSAbs_EntityType smdsType = (SMDSAbs_EntityType) iG;
MED::EGeometrieElement medType =
(MED::EGeometrieElement) DriverMED::GetMedGeoType( smdsType );
med2smeshTypes.insert( make_pair( medType, smdsType ));
med2smeshTypes.insert( std::make_pair( medType, smdsType ));
}
}
return med2smeshTypes;
@ -254,7 +255,7 @@ namespace
// change at insertion of new items in the middle.
//const vector<MED::EGeometrieElement>& medTypes = mesh2medElemType();
vector<int> data;
std::vector<int> data;
for ( size_t i = 0; i < meshInfo->length(); ++i )
if ( meshInfo[i] > 0 )
@ -298,7 +299,7 @@ void SMESH_PreMeshInfo::hdf2meshInfo( const std::string& name,
// // array->GetDim( datasetSize );
// int size = dataset->GetSize();
vector<int> info( SMDSEntity_Last * 2, 0 );
std::vector<int> info( SMDSEntity_Last * 2, 0 );
dataset->ReadFromDisk( &info[0] );
dataset->CloseOnDisk();
@ -429,7 +430,7 @@ bool SMESH_PreMeshInfo::readPreInfoFromHDF()
group_i->changePreMeshInfo() = newInstance();
if ( SMESHDS_GroupBase* group = group_i->GetGroupDS() )
{
const string name = group->GetStoreName();
const std::string name = group->GetStoreName();
group_i->changePreMeshInfo()->hdf2meshInfo( name, infoHdfGroup );
}
}
@ -499,7 +500,7 @@ void SMESH_PreMeshInfo::readGroupInfo()
if ( _mesh->_mapGroups.empty() ) return;
// make SMESH_PreMeshInfo of groups
map< string, SMESH_PreMeshInfo* > name2GroupInfo;
map< std::string, SMESH_PreMeshInfo* > name2GroupInfo;
map<int, SMESH::SMESH_GroupBase_ptr>::const_iterator i2group = _mesh->_mapGroups.begin();
for ( ; i2group != _mesh->_mapGroups.end(); ++i2group )
{
@ -510,8 +511,8 @@ void SMESH_PreMeshInfo::readGroupInfo()
group_i->changePreMeshInfo() = info;
if ( SMESHDS_Group* group = dynamic_cast< SMESHDS_Group* >( group_i->GetGroupDS() ))
{
string name = group->GetStoreName();
name2GroupInfo.insert( make_pair( name, info ));
std::string name = group->GetStoreName();
name2GroupInfo.insert( std::make_pair( name, info ));
info->_isInfoOk = true;
}
}
@ -534,8 +535,8 @@ void SMESH_PreMeshInfo::readGroupInfo()
vector< SMESH_PreMeshInfo* >& grInfoVec = famId2grInfo[ medFamInfo->GetId() ];
for ( int iG = 0; iG < nbGroups; ++iG )
{
const string grName = medFamInfo->GetGroupName( iG );
map< string, SMESH_PreMeshInfo* >::iterator n2i = name2GroupInfo.find( grName );
const std::string grName = medFamInfo->GetGroupName( iG );
map< std::string, SMESH_PreMeshInfo* >::iterator n2i = name2GroupInfo.find( grName );
if ( n2i != name2GroupInfo.end() )
grInfoVec.push_back( n2i->second );
}
@ -560,14 +561,14 @@ void SMESH_PreMeshInfo::readGroupInfo()
f2infos = famId2grInfo.find( famNums[i] );
if ( f2infos == famId2grInfo.end() )
f2infos = famId2grInfo.insert
( make_pair( famNums[i], vector< SMESH_PreMeshInfo*>())).first;
( std::make_pair( famNums[i], vector< SMESH_PreMeshInfo*>())).first;
}
vector< SMESH_PreMeshInfo* >& infoVec = f2infos->second ;
for ( size_t j = 0; j < infoVec.size(); ++j )
infoVec[j]->_elemCounter++;
}
// pass _elemCounter to a real elem type
map< string, SMESH_PreMeshInfo* >::iterator n2i = name2GroupInfo.begin();
map< std::string, SMESH_PreMeshInfo* >::iterator n2i = name2GroupInfo.begin();
for ( ; n2i != name2GroupInfo.end(); ++n2i )
{
SMESH_PreMeshInfo* info = n2i->second;
@ -618,7 +619,7 @@ void SMESH_PreMeshInfo::readSubMeshInfo()
for ( int isNode = 0; isNode < 2; ++isNode )
{
string aDSName( isNode ? "Node Submeshes" : "Element Submeshes");
std::string aDSName( isNode ? "Node Submeshes" : "Element Submeshes");
if ( aGroup->ExistInternalObject( (char*) aDSName.c_str() ))
{
// read sub-mesh id of all nodes or elems
@ -893,7 +894,7 @@ void SMESH_PreMeshInfo::readSubMeshes(DriverMED_R_SMESHDS_Mesh* reader) const
SMDS_ElemIteratorPtr eIt = meshDS->elementsIterator();
for ( int isNode = 0; isNode < 2; ++isNode )
{
string aDSName( isNode ? "Node Submeshes" : "Element Submeshes");
std::string aDSName( isNode ? "Node Submeshes" : "Element Submeshes");
if ( aGroup->ExistInternalObject( (char*) aDSName.c_str() ))
{
HDFdataset* aDataset = new HDFdataset( (char*) aDSName.c_str(), aGroup );

View File

@ -58,6 +58,7 @@
#include <set>
#include <vector>
using namespace std;
#ifdef _DEBUG_
// #define DEB_FACES

View File

@ -57,15 +57,15 @@ public:
private:
bool findBoxFaces( const TopoDS_Shape& shape,
list< _QuadFaceGrid >& boxFaceContainer,
SMESH_Mesh& mesh,
_QuadFaceGrid * & fBottom,
_QuadFaceGrid * & fTop,
_QuadFaceGrid * & fFront,
_QuadFaceGrid * & fBack,
_QuadFaceGrid * & fLeft,
_QuadFaceGrid * & fRight);
bool findBoxFaces( const TopoDS_Shape& shape,
std::list< _QuadFaceGrid >& boxFaceContainer,
SMESH_Mesh& mesh,
_QuadFaceGrid * & fBottom,
_QuadFaceGrid * & fTop,
_QuadFaceGrid * & fFront,
_QuadFaceGrid * & fBack,
_QuadFaceGrid * & fLeft,
_QuadFaceGrid * & fRight);
};
#endif

View File

@ -56,6 +56,8 @@
#include "utilities.h"
using namespace std;
//================================================================================
/*!
* \brief Constructor of a side of one edge
@ -71,7 +73,7 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face& theFace,
const bool theIgnoreMediumNodes,
SMESH_ProxyMesh::Ptr theProxyMesh)
{
list<TopoDS_Edge> edges(1,theEdge);
std::list<TopoDS_Edge> edges(1,theEdge);
*this = StdMeshers_FaceSide( theFace, edges, theMesh, theIsForward,
theIgnoreMediumNodes, theProxyMesh );
}
@ -82,12 +84,12 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face& theFace,
*/
//================================================================================
StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face& theFace,
list<TopoDS_Edge>& theEdges,
SMESH_Mesh* theMesh,
const bool theIsForward,
const bool theIgnoreMediumNodes,
SMESH_ProxyMesh::Ptr theProxyMesh)
StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face& theFace,
std::list<TopoDS_Edge>& theEdges,
SMESH_Mesh* theMesh,
const bool theIsForward,
const bool theIgnoreMediumNodes,
SMESH_ProxyMesh::Ptr theProxyMesh)
{
int nbEdges = theEdges.size();
myEdge.resize ( nbEdges );
@ -112,7 +114,7 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face& theFace,
SMESHDS_Mesh* meshDS = myProxyMesh->GetMeshDS();
int nbDegen = 0;
list<TopoDS_Edge>::iterator edge = theEdges.begin();
std::list<TopoDS_Edge>::iterator edge = theEdges.begin();
for ( int index = 0; edge != theEdges.end(); ++index, ++edge )
{
int i = theIsForward ? index : nbEdges-index-1;
@ -302,8 +304,8 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(UVPtStructVec& theSideNodes,
*/
//================================================================================
const vector<UVPtStruct>& StdMeshers_FaceSide::GetUVPtStruct(bool isXConst,
double constValue) const
const std::vector<UVPtStruct>& StdMeshers_FaceSide::GetUVPtStruct(bool isXConst,
double constValue) const
{
if ( myPoints.empty() )
{

View File

@ -166,7 +166,7 @@ bool StdMeshers_Geometric1D::SetParametersByMesh(const SMESH_Mesh* theMesh,
const TopoDS_Edge& edge = TopoDS::Edge( edgeMap( i ));
BRepAdaptor_Curve C( edge );
vector< double > params;
std::vector< double > params;
if ( SMESH_Algo::GetNodeParamOnEdge( theMesh->GetMeshDS(), edge, params ))
{
nbEdges++;

View File

@ -33,6 +33,8 @@
#include <limits>
using namespace std;
// Define error message and _MYDEBUG_ if needed
#ifdef _DEBUG_
#define BAD_MESH_ERR \

View File

@ -270,7 +270,7 @@ private:
TParam2ColumnMap* myParamToColumnMap;
PSurface mySurface;
TopoDS_Edge myBaseEdge;
map< int, PSurface > myShapeID2Surf;
std::map< int, PSurface > myShapeID2Surf;
// first and last normalized params and orientaion for each component or it-self
std::vector< std::pair< double, double> > myParams; // select my columns in myParamToColumnMap
bool myIsForward;

View File

@ -57,6 +57,7 @@
namespace TAssocTool = StdMeshers_ProjectionUtils;
using namespace std;
//=======================================================================
//function : StdMeshers_Projection_3D

View File

@ -61,6 +61,8 @@
#include <list>
#include <vector>
using namespace std;
//================================================================================
/*!
* \brief 1D algo

View File

@ -82,7 +82,7 @@ struct FaceQuadStruct
return GetUVPtStruct()[ to-nbNodeOut-(IsReversed() ? -1 : +1)];
}
// some sortcuts
const vector<UVPtStruct>& GetUVPtStruct(bool isXConst=0, double constValue=0) const
const std::vector<UVPtStruct>& GetUVPtStruct(bool isXConst=0, double constValue=0) const
{ return nbNodeOut ?
grid->SimulateUVPtStruct( NbPoints()-nbNodeOut-1, isXConst, constValue ) :
grid->GetUVPtStruct( isXConst, constValue );

View File

@ -38,7 +38,7 @@ StdMeshers_SegmentAroundVertex_0D::StdMeshers_SegmentAroundVertex_0D
:SMESH_0D_Algo(hypId, studyId, gen)
{
_name = "SegmentAroundVertex_0D";
// it is assigned to vertices but influence a state of EDGE submeshes
// it is assigned to vertices but influence a state of EDGE submeshes
_shapeType = (1 << TopAbs_VERTEX); // 1 bit per shape type
_compatibleHypothesis.push_back("SegmentLengthAroundVertex");
@ -55,16 +55,17 @@ StdMeshers_SegmentAroundVertex_0D::~StdMeshers_SegmentAroundVertex_0D()
//=======================================================================
//function : CheckHypothesis
//purpose :
//purpose :
//=======================================================================
bool StdMeshers_SegmentAroundVertex_0D::CheckHypothesis(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape,
SMESH_Hypothesis::Hypothesis_Status& aStatus)
bool StdMeshers_SegmentAroundVertex_0D::
CheckHypothesis(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape,
SMESH_Hypothesis::Hypothesis_Status& aStatus)
{
list <const SMESHDS_Hypothesis * >::const_iterator itl;
std::list <const SMESHDS_Hypothesis * >::const_iterator itl;
const list <const SMESHDS_Hypothesis * >&hyps = GetUsedHypothesis(aMesh, aShape);
const std::list <const SMESHDS_Hypothesis * >&hyps = GetUsedHypothesis(aMesh, aShape);
if ( hyps.size() == 0 )
{
aStatus = SMESH_Hypothesis::HYP_MISSING;
@ -84,7 +85,7 @@ bool StdMeshers_SegmentAroundVertex_0D::CheckHypothesis(SMESH_Mesh&
//=======================================================================
//function : Compute
//purpose :
//purpose :
//=======================================================================
bool StdMeshers_SegmentAroundVertex_0D::Compute(SMESH_Mesh&, const TopoDS_Shape&)

View File

@ -178,8 +178,8 @@ void StdMeshers_CartesianParameters3D_i::SetGridSpacing(const SMESH::string_arra
CORBA::Short axis)
throw (SALOME::SALOME_Exception)
{
vector<string> funVec;
vector<double> pointVec;
std::vector<std::string> funVec;
std::vector<double> pointVec;
_array2vec( spaceFunctions, funVec, (const char*) );
_array2vec( internalPoints, pointVec, );
@ -209,8 +209,8 @@ void StdMeshers_CartesianParameters3D_i::GetGridSpacing(SMESH::string_array_out
{
ASSERT( myBaseImpl );
try {
vector<string> funVec;
vector<double> pointVec;
std::vector<std::string> funVec;
std::vector<double> pointVec;
this->GetImpl()->GetGridSpacing( funVec, pointVec, axis );
xSpaceFunctions = new SMESH::string_array();
@ -394,8 +394,8 @@ StdMeshers_CartesianParameters3D_i::ComputeCoordinates(CORBA::Double
const char* axisName )
throw (SALOME::SALOME_Exception)
{
vector<string> xFuns;
vector<double> xPoints, coords;
std::vector<std::string> xFuns;
std::vector<double> xPoints, coords;
_array2vec( spaceFuns, xFuns, (const char*) );
_array2vec( points, xPoints, );

View File

@ -111,7 +111,7 @@ public:
std::string str;
if (stream >> str) {
if ( StudyContext* myStudyContext = gen->GetCurrentStudyContext() ) {
string ior = myStudyContext->getIORbyOldId( atoi( str.c_str() ));
std::string ior = myStudyContext->getIORbyOldId( atoi( str.c_str() ));
if ( !ior.empty() )
return TInterface::_narrow(gen->GetORB()->string_to_object( ior.c_str() ));
}

View File

@ -79,7 +79,7 @@ void StdMeshers_Reversible1D_i::SetReversedEdges( const SMESH::long_array& theId
void StdMeshers_Reversible1D_i::SetObjectEntry( const char* theEntry )
{
string entry(theEntry); // actually needed as theEntry is spoiled by moment of dumping
std::string entry(theEntry); // actually needed as theEntry is spoiled by moment of dumping
try {
this->GetImpl()->SetObjectEntry( entry.c_str() );
// Update Python script