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;
*/
//================================================================================
-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 ||
}
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 ));
}
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;
}
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() );
}
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() )
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++;
}
}
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);
// 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() )
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:
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;
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 ));
}
}
}
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() \
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);
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 )
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 )
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 ));
}
}
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 );
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
#define SMDS_MeshInfo_HeaderFile
#include <vector>
-using namespace std;
#include "SMESH_SMDS.hxx"
SMDS_UnstructuredGrid* grid = mesh->getGrid();
//double center[3];
//this->gravityCenter(grid, &nodeIds[0], nodeIds.size(), ¢er[0]);
- vector<vtkIdType> ptIds;
+ std::vector<vtkIdType> ptIds;
vtkIdType nbFaces = nbNodesPerFace.size();
int k = 0;
for (int i = 0; i < nbFaces; i++)
*/
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);
* 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;
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; }
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,
*/
//================================================================================
-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;
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() );
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();
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();
// ... 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 ));
}
{
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 );
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 ));
}
//================================================================================
namespace
{
+ using std::runtime_error;
//=======================================================================
//function : FindNode
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
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
#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
{
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 );
}
// -----------------------------------------------------------------------
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 );
}
}
//================================================================================
//================================================================================
-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 |
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 );
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 );
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 (...) {
{
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 );
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() );
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" ) {
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();
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 );
}
}
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() );
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() )
{
# 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 ;
}
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
{
// 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
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
{
case SMESH::ConnectedElements::POINT: // read 3 node coordinates ///////////////////
{
- vector< double > xyz;
+ std::vector< double > xyz;
char* endptr;
do
{
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;
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 ) {
}
// 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;
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
};
// ===========================================================
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() ));
}
::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;
#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 ]
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 ) {
}
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;
*/
//================================================================================
- void getNodesOfElements(SMDS_ElemIteratorPtr elemIt,
- set<const SMDS_MeshNode* >& nodes)
+ void getNodesOfElements(SMDS_ElemIteratorPtr elemIt,
+ std::set<const SMDS_MeshNode* >& nodes)
{
while ( elemIt->more() )
{
{
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();
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();
}
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 ];
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() );
}
}
*/
//================================================================================
-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++ ) {
}
// Find new name
- string name = thePrefix;
+ std::string name = thePrefix;
int index = 0;
while (!groupNames.insert(name).second)
// 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 << " = ";
// 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 << " = ";
{
// 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();
{
// 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();
#include "SMESH_PythonDump.hxx"
#include "SMESH_MeshEditor.hxx"
#include <list>
+#include <string>
class SMESH_Mesh_i;
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);
#include <sstream>
#include <set>
+using namespace std;
+
using SMESH::TPythonDump;
using SMESH::TVar;
#include CORBA_SERVER_HEADER(SALOME_Session)
+using namespace std;
#define MYDEBUGOUT(msg) //std::cout << msg << std::endl;
enum { GroupOnFilter_OutOfDate = -1 };
// a map to count not yet loaded meshes
- static map< int, int > theStudyIDToMeshCounter;
+ static std::map< int, int > theStudyIDToMeshCounter;
//================================================================================
/*!
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++;
}
//================================================================================
{
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);
class SignalToGUI
{
- string _messagePrefix;
+ std::string _messagePrefix;
SALOME::Session_var _session;
public:
SignalToGUI( SMESH_Mesh_i* mesh )
_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() );
{
if ( !_messagePrefix.empty() )
{
- string msgToGUI = _messagePrefix + "/stop";
+ std::string msgToGUI = _messagePrefix + "/stop";
_session->emitMessageOneWay( msgToGUI.c_str());
_messagePrefix.clear();
}
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;
};
//================================================================================
*/
//================================================================================
- 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;
*/
//================================================================================
- 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 )
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;
// 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 )
// // 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();
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 );
}
}
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 )
{
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;
}
}
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 );
}
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;
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
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 );
#include <set>
#include <vector>
+using namespace std;
#ifdef _DEBUG_
// #define DEB_FACES
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
#include "utilities.h"
+using namespace std;
+
//================================================================================
/*!
* \brief Constructor of a side of one edge
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 );
}
*/
//================================================================================
-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 );
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;
*/
//================================================================================
-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() )
{
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++;
#include <limits>
+using namespace std;
+
// Define error message and _MYDEBUG_ if needed
#ifdef _DEBUG_
#define BAD_MESH_ERR \
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;
namespace TAssocTool = StdMeshers_ProjectionUtils;
+using namespace std;
//=======================================================================
//function : StdMeshers_Projection_3D
#include <list>
#include <vector>
+using namespace std;
+
//================================================================================
/*!
* \brief 1D algo
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 );
: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");
//=======================================================================
//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;
//=======================================================================
//function : Compute
-//purpose :
+//purpose :
//=======================================================================
bool StdMeshers_SegmentAroundVertex_0D::Compute(SMESH_Mesh&, const TopoDS_Shape&)
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, );
{
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();
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, );
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() ));
}
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