Merge from V6_3_BR 19/07/2011

This commit is contained in:
vsr 2011-07-19 12:05:24 +00:00
parent 191bcced1c
commit 39f36db219
16 changed files with 53 additions and 25 deletions

View File

@ -76,7 +76,9 @@ libSMESHObject_la_LDFLAGS = \
../SMESHClient/libSMESHClient.la \
../SMDS/libSMDS.la \
../Controls/libSMESHControls.la \
$(GUI_LDFLAGS) -lSalomeApp -lSalomeObject -lSVTK -lVTKViewer -lqtx -lsuit \
$(GUI_LDFLAGS) -lSalomeApp -lSalomeObject -lSVTK -lVTKViewer -lqtx -lsuit -lstd \
-lPlot2d \
-lSPlot2d \
$(GEOM_LDFLAGS) -lGEOMObject \
$(CAS_KERNEL) \
$(VTK_LIBS) $(QT_MT_LIBS)

View File

@ -127,7 +127,7 @@ libSMDS_la_CPPFLAGS = \
libSMDS_la_LDFLAGS = \
$(VTK_LIBS) \
$(KERNEL_LDFLAGS) -lSALOMELocalTrace
$(KERNEL_LDFLAGS) -lSALOMELocalTrace -lOpUtil
# Executables targets
bin_PROGRAMS = SMDS_MemoryLimit

View File

@ -51,6 +51,7 @@
#include <list>
#include <vector>
#include <vtkSystemIncludes.h>
#include <cassert>
#include "Utils_SALOME_Exception.hxx"
#define MYASSERT(val) if (!(val)) throw SALOME_Exception(LOCALIZED("assertion not verified"));

View File

@ -24,6 +24,8 @@
#ifndef _SMDS_UNSTRUCTUREDGRID_HXX
#define _SMDS_UNSTRUCTUREDGRID_HXX
#include "SMESH_SMDS.hxx"
#include <vtkUnstructuredGrid.h>
#include <vtkCellLinks.h>
#include "chrono.hxx"
@ -48,7 +50,7 @@ class SMDS_Downward;
class SMDS_Mesh;
class SMDS_MeshVolume;
class SMDS_CellLinks: public vtkCellLinks
class SMDS_EXPORT SMDS_CellLinks: public vtkCellLinks
{
public:
vtkCellLinks::Link* ResizeL(vtkIdType sz);
@ -59,7 +61,7 @@ protected:
~SMDS_CellLinks();
};
class SMDS_UnstructuredGrid: public vtkUnstructuredGrid
class SMDS_EXPORT SMDS_UnstructuredGrid: public vtkUnstructuredGrid
{
public:
void setSMDS_mesh(SMDS_Mesh *mesh);

View File

@ -20,6 +20,8 @@
#ifndef _CHRONO_HXX_
#define _CHRONO_HXX_
#include "SMESH_SMDS.hxx"
#include <vector>
#include <string>
#include <iostream>
@ -33,7 +35,7 @@ typedef struct acnt
double _ctrCumul;
} cntStruct;
class counters
class SMDS_EXPORT counters
{
public:
static cntStruct *_ctrs;
@ -44,7 +46,7 @@ protected:
static int _nbChrono;
};
class chrono
class SMDS_EXPORT chrono
{
public:
chrono(int i);

View File

@ -214,7 +214,7 @@ bool SMESH_OctreeNode::NodesAround(const gp_XYZ &node,
{
double minDist = precision * precision;
gp_Pnt p1 ( node.X(), node.Y(), node.Z() );
set<const SMDS_MeshNode*>::iterator nIt = myNodes.begin();
TIDSortedNodeSet::iterator nIt = myNodes.begin();
for ( ; nIt != myNodes.end(); ++nIt )
{
gp_Pnt p2 ( (*nIt)->X(), (*nIt)->Y(), (*nIt)->Z() );

View File

@ -27,11 +27,15 @@ void memostat(const char* f, int l);
void memostat(const char* f, int l)
{
#ifdef WIN32
//rnv: TODO: find alternative of the malloc_stats() on windows platform
#else
/* struct mallinfo mem = mallinfo(); */
/* std::cerr << f << ":"<< l << " " << mem.arena << " " << mem.ordblks << " " << mem.hblks << " " << mem.hblkhd << " " << mem.uordblks << " " << mem.fordblks << " " << mem.keepcost << std::endl; */
std::cerr << f << ":" << l << " --------------------------" << std::endl;
malloc_stats();
std::cerr << f << ":" << l << " --------------------------" << std::endl;
#endif
}
#define MEMOSTAT //memostat( __FILE__, __LINE__ )

View File

@ -268,7 +268,8 @@ libSMESH_la_LDFLAGS = \
../OBJECT/libSMESHObject.la \
$(CAS_LDFLAGS) -lTKV3d \
$(GUI_LDFLAGS) -lSalomePrs -lsuit -lSUITApp -lCAM -lstd \
$(GEOM_LDFLAGS) -lGEOMBase -lGEOMFiltersSelection -lGEOMObject
$(GEOM_LDFLAGS) -lGEOMBase -lGEOMFiltersSelection -lGEOMObject \
$(PYTHON_LIBS)
# resources files
nodist_salomeres_DATA= \

View File

@ -604,7 +604,11 @@ SMESH::Histogram* NumericalFunctor_i::GetHistogram(CORBA::Short nbIntervals)
std::vector<int> elements;
myNumericalFunctorPtr->GetHistogram(nbIntervals,nbEvents,funValues,elements);
#ifdef WIN32
nbIntervals = CORBA::Short( min( nbEvents.size(), funValues.size() - 1));
#else
nbIntervals = CORBA::Short( std::min( nbEvents.size(), funValues.size() - 1));
#endif
SMESH::Histogram_var histogram = new SMESH::Histogram;
if ( nbIntervals > 0 )
{

View File

@ -486,7 +486,7 @@ namespace // INTERNAL STUFF
for ( ; d != dList.end(); ++d )
if ( d->_subM.count( subMesh ))
{
set<SMESH_subMesh*>::iterator smIt = d->_subM.begin();
set<SMESH_subMesh*,_SubLess>::iterator smIt = d->_subM.begin();
for( ; smIt != d->_subM.end(); ++smIt )
if ( (*smIt)->IsMeshComputed() )
d->_computedSubM.insert( *smIt);

View File

@ -214,7 +214,7 @@ bool StdMeshers_Import_1D2D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape &
SMDS_MeshElement::iterator node = face->begin_nodes();
for ( unsigned i = 0; i < newNodes.size(); ++i, ++node )
{
TNodeNodeMap::iterator n2nIt = n2n->insert( make_pair( *node, (SMDS_MeshNode*)0 )).first;
StdMeshers_Import_1D::TNodeNodeMap::iterator n2nIt = n2n->insert( make_pair( *node, (SMDS_MeshNode*)0 )).first;
if ( n2nIt->second )
{
if ( !subShapeIDs.count( n2nIt->second->getshapeId() ))

View File

@ -895,9 +895,9 @@ FaceQuadStruct* StdMeshers_Quadrangle_2D::CheckNbEdges(SMESH_Mesh & aMes
for ( int i = degenSides.size()-1; i > -1; --i )
{
StdMeshers_FaceSide * & degenSide = quad->side[ degenSides[ i ]];
StdMeshers_FaceSide* degenSide = quad->side[ degenSides[ i ]];
delete degenSide;
quad->side.erase( vector<StdMeshers_FaceSide*>::iterator( & degenSide ));
quad->side.erase( quad->side.begin() + degenSides[ i ] );
}
for ( unsigned i = TOP_SIDE; i < quad->side.size(); ++i )
quad->side[i]->Reverse();
@ -2219,7 +2219,7 @@ bool StdMeshers_Quadrangle_2D::ComputeReduced (SMESH_Mesh & aMesh,
int ncol_top = nt1 - 1;
int ncol_bot = nb1 - 1;
// number of rows needed to reduce ncol_bot to ncol_top using simple 3->1 "tree" (see below)
int nrows_tree31 = int( log( ncol_bot / ncol_top ) / log( 3 )); // = log x base 3
int nrows_tree31 = int( log( (double)(ncol_bot / ncol_top) ) / log((double) 3 )); // = log x base 3
if ( nrows < nrows_tree31 )
MultipleReduce = true;
}
@ -2545,7 +2545,13 @@ bool StdMeshers_Quadrangle_2D::ComputeReduced (SMESH_Mesh & aMesh,
// maximum number of bottom elements for "tree" simple reduce 4->2
int max_tree42 = 0;
// number of rows needed to reduce ncol_bot to ncol_top using simple 4->2 "tree"
#ifdef WIN32
//<cmath> of the MSVC doesn't contain log2
int nrows_tree42 = int( log( (double)(ncol_bot / ncol_top) )/log((double)2) ); // needed to avoid overflow at pow(2)
#else
int nrows_tree42 = int( log2( ncol_bot / ncol_top )); // needed to avoid overflow at pow(2)
#endif
if (ncol_top > npair_top * 2 && nrows_tree42 < nrows) {
max_tree42 = npair_top * pow(2.0, nrows + 1);
int delta = ncol_bot - int( max_tree42 );

View File

@ -2511,7 +2511,7 @@ bool _ViscousBuilder::updateNormals( _SolidData& data,
if ( S.ShapeType() != TopAbs_EDGE )
continue; // TODO: find EDGE by VERTEX
E1 = TopoDS::Edge( S );
set< _LayerEdge* >::iterator eIt = ee.begin();
set< _LayerEdge*, _LayerEdgeCmp >::iterator eIt = ee.begin();
while ( E2.IsNull() && eIt != ee.end())
{
_LayerEdge* e2 = *eIt++;

View File

@ -37,6 +37,7 @@
// CORBA includes
#include <CORBA.h>
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Mesh)
class SUIT_SelectionFilter;

View File

@ -1093,7 +1093,7 @@ void Maillage::outputMED(std::string fichierMED)
ngro = ETIQFAM[ifam].size();
// Noms des groupes de la famille: variable nomsGN
char gro[ngro * MED_LNAME_SIZE + 1];
char *gro = new char[ngro * MED_LNAME_SIZE + 1];
int cptGN = 0;
for (unsigned int ign = 0; ign < ETIQFAM[ifam].size(); ign++)
{
@ -1121,7 +1121,7 @@ void Maillage::outputMED(std::string fichierMED)
// Création de la famille
if (MEDfamilyCr(fid, maa, nomfam, numfam, 0, MED_NO_GROUP) < 0)
ERREUR("Error MEDfamilyCr");
delete gro;
}
}
@ -1136,7 +1136,7 @@ void Maillage::outputMED(std::string fichierMED)
med_float *coo; // Table des coordonnées
// Noms des coordonnées (variable nomcoo)
char nomcoo[mdim * MED_SNAME_SIZE + 1];
char* nomcoo = new char[mdim * MED_SNAME_SIZE + 1];
string strX = (string) "X";
while (strX.size() < MED_SNAME_SIZE)
strX += (string) " ";
@ -1155,7 +1155,7 @@ void Maillage::outputMED(std::string fichierMED)
nomcoo[mdim * MED_SNAME_SIZE] = '\0';
// Unités des coordonnées (variable unicoo)
char unicoo[mdim * MED_SNAME_SIZE + 1];
char* unicoo = new char[mdim * MED_SNAME_SIZE + 1];
string strmesure = (string) "SI";
while (strmesure.size() < MED_SNAME_SIZE)
strmesure += (string) " ";
@ -1408,7 +1408,7 @@ void Maillage::outputMED(std::string fichierMED)
ngro = ETIQFAM[ifam].size();
// Noms des groupes de la famille
char gro[ngro * MED_LNAME_SIZE + 1];
char* gro = new char[ngro * MED_LNAME_SIZE + 1];
int cptGM = 0;
for (unsigned int ign = 0; ign < ETIQFAM[ifam].size(); ign++)
{
@ -1436,8 +1436,9 @@ void Maillage::outputMED(std::string fichierMED)
// Création de la famille
if (MEDfamilyCr(fid, maa, nomfam, numfam, 1, gro) < 0)
ERREUR("Error MEDfamilyCr");
}
delete gro;
}
}
// ########################################################################
@ -1557,6 +1558,9 @@ void Maillage::outputMED(std::string fichierMED)
cout << "Error on close MED file" << endl;
}
delete unicoo;
delete nomcoo;
// cout << endl << endl << "Fin procédure outputMED" << endl;
} // outputMED

View File

@ -24,6 +24,7 @@
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <ctime>
using namespace std;
using namespace MESHCUT;
@ -92,9 +93,9 @@ bool MESHCUT::appartient(std::string e, std::string tableau[], int taille)
float MESHCUT::arrondi(float x)
{
if (x > 0 and x < 1.0e-5)
if (x > 0 && x < 1.0e-5)
return 0;
else if (x < 0 and x > -1.0e-5)
else if (x < 0 && x > -1.0e-5)
return 0;
else
return x;