Fix compilation problems under windows.

This commit is contained in:
rnv 2021-04-29 18:04:20 +03:00
parent b79f3c0765
commit 9dae8fcc9e
12 changed files with 4060 additions and 4070 deletions

View File

@ -133,12 +133,12 @@ namespace SMESH{
virtual void SetMesh( const SMDS_Mesh* theMesh ); virtual void SetMesh( const SMDS_Mesh* theMesh );
virtual double GetValue( long theElementId ); virtual double GetValue( long theElementId );
virtual double GetValue(const TSequenceOfXYZ& /*thePoints*/) { return -1.0;}; virtual double GetValue(const TSequenceOfXYZ& /*thePoints*/) { return -1.0;};
void GetHistogram(int nbIntervals, void GetHistogram(int nbIntervals,
std::vector<int>& nbEvents, std::vector<int>& nbEvents,
std::vector<double>& funValues, std::vector<double>& funValues,
const std::vector<smIdType>& elements, const std::vector<::smIdType>& elements,
const double* minmax=0, const double* minmax=0,
const bool isLogarithmic = false); const bool isLogarithmic = false);
bool IsApplicable( long theElementId ) const; bool IsApplicable( long theElementId ) const;
virtual bool IsApplicable( const SMDS_MeshElement* element ) const; virtual bool IsApplicable( const SMDS_MeshElement* element ) const;
virtual SMDSAbs_ElementType GetType() const = 0; virtual SMDSAbs_ElementType GetType() const = 0;
@ -147,7 +147,7 @@ namespace SMESH{
void SetPrecision( const long thePrecision ); void SetPrecision( const long thePrecision );
double Round( const double & value ); double Round( const double & value );
bool GetPoints(const smIdType theId, TSequenceOfXYZ& theRes) const; bool GetPoints(const ::smIdType theId, TSequenceOfXYZ& theRes) const;
static bool GetPoints(const SMDS_MeshElement* theElem, TSequenceOfXYZ& theRes); static bool GetPoints(const SMDS_MeshElement* theElem, TSequenceOfXYZ& theRes);
protected: protected:
const SMDS_Mesh* myMesh; const SMDS_Mesh* myMesh;
@ -594,7 +594,7 @@ namespace SMESH{
virtual void SetMesh( const SMDS_Mesh* theMesh ); virtual void SetMesh( const SMDS_Mesh* theMesh );
virtual bool IsSatisfy( long theElementId ); virtual bool IsSatisfy( long theElementId );
virtual SMDSAbs_ElementType GetType() const; virtual SMDSAbs_ElementType GetType() const;
static bool IsFreeEdge( const SMDS_MeshNode** theNodes, const smIdType theFaceId ); static bool IsFreeEdge( const SMDS_MeshNode** theNodes, const ::smIdType theFaceId );
typedef long TElemId; typedef long TElemId;
struct Border{ struct Border{
TElemId myElemId; TElemId myElemId;
@ -653,8 +653,8 @@ namespace SMESH{
protected: protected:
const SMDS_Mesh* myMesh; const SMDS_Mesh* myMesh;
std::vector< smIdType > myMin; std::vector< ::smIdType > myMin;
std::vector< smIdType > myMax; std::vector< ::smIdType > myMax;
TIDsMap myIds; TIDsMap myIds;
SMDSAbs_ElementType myType; SMDSAbs_ElementType myType;
@ -1165,9 +1165,9 @@ namespace SMESH{
public: public:
ConnectedElements(); ConnectedElements();
//virtual Predicate* clone() const { return new ConnectedElements( *this ); } //virtual Predicate* clone() const { return new ConnectedElements( *this ); }
void SetNode( smIdType nodeID ); void SetNode( ::smIdType nodeID );
void SetPoint( double x, double y, double z ); void SetPoint( double x, double y, double z );
smIdType GetNode() const; ::smIdType GetNode() const;
std::vector<double> GetPoint() const; std::vector<double> GetPoint() const;
void SetType( SMDSAbs_ElementType theType ); void SetType( SMDSAbs_ElementType theType );
@ -1179,14 +1179,14 @@ namespace SMESH{
//const std::set<long>& GetDomainIDs() const { return myOkIDs; } //const std::set<long>& GetDomainIDs() const { return myOkIDs; }
private: private:
smIdType myNodeID; ::smIdType myNodeID;
std::vector<double> myXYZ; std::vector<double> myXYZ;
SMDSAbs_ElementType myType; SMDSAbs_ElementType myType;
TMeshModifTracer myMeshModifTracer; TMeshModifTracer myMeshModifTracer;
void clearOkIDs(); void clearOkIDs();
bool myOkIDsReady; bool myOkIDsReady;
std::set<smIdType> myOkIDs; // empty means that there is one domain std::set<::smIdType> myOkIDs; // empty means that there is one domain
}; };
typedef boost::shared_ptr<ConnectedElements> ConnectedElementsPtr; typedef boost::shared_ptr<ConnectedElements> ConnectedElementsPtr;

View File

@ -157,17 +157,17 @@ namespace SMESH
} }
} }
std::map<SMDSAbs_ElementType,smIdType> GetEntitiesFromObject(SMESH_VisualObj *theObject) { std::map<SMDSAbs_ElementType,::smIdType> GetEntitiesFromObject(SMESH_VisualObj *theObject) {
std::map<SMDSAbs_ElementType,smIdType> entities; std::map<SMDSAbs_ElementType,::smIdType> entities;
entities.insert(std::pair<SMDSAbs_ElementType,smIdType>(SMDSAbs_0DElement, entities.insert(std::pair<SMDSAbs_ElementType,::smIdType>(SMDSAbs_0DElement,
theObject ? theObject->GetNbEntities(SMDSAbs_0DElement) : 0)); theObject ? theObject->GetNbEntities(SMDSAbs_0DElement) : 0));
entities.insert(std::pair<SMDSAbs_ElementType,smIdType>(SMDSAbs_Ball, entities.insert(std::pair<SMDSAbs_ElementType,::smIdType>(SMDSAbs_Ball,
theObject ? theObject->GetNbEntities(SMDSAbs_Ball) : 0)); theObject ? theObject->GetNbEntities(SMDSAbs_Ball) : 0));
entities.insert(std::pair<SMDSAbs_ElementType,smIdType>(SMDSAbs_Edge, entities.insert(std::pair<SMDSAbs_ElementType,::smIdType>(SMDSAbs_Edge,
theObject ? theObject->GetNbEntities(SMDSAbs_Edge) : 0)); theObject ? theObject->GetNbEntities(SMDSAbs_Edge) : 0));
entities.insert(std::pair<SMDSAbs_ElementType,smIdType>(SMDSAbs_Face, entities.insert(std::pair<SMDSAbs_ElementType,::smIdType>(SMDSAbs_Face,
theObject ? theObject->GetNbEntities(SMDSAbs_Face) : 0)); theObject ? theObject->GetNbEntities(SMDSAbs_Face) : 0));
entities.insert(std::pair<SMDSAbs_ElementType,smIdType>(SMDSAbs_Volume, entities.insert(std::pair<SMDSAbs_ElementType,::smIdType>(SMDSAbs_Volume,
theObject ? theObject->GetNbEntities(SMDSAbs_Volume) : 0)); theObject ? theObject->GetNbEntities(SMDSAbs_Volume) : 0));
return entities; return entities;
} }

View File

@ -84,7 +84,7 @@ SMESHOBJECT_EXPORT
QString def); QString def);
SMESHOBJECT_EXPORT SMESHOBJECT_EXPORT
std::map<SMDSAbs_ElementType,smIdType> std::map<SMDSAbs_ElementType,::smIdType>
GetEntitiesFromObject(SMESH_VisualObj *theObject); GetEntitiesFromObject(SMESH_VisualObj *theObject);
SMESHOBJECT_EXPORT SMESHOBJECT_EXPORT

View File

@ -557,7 +557,7 @@ void SMESH_VisualObjDef::updateEntitiesFlags()
unsigned int tmp = myEntitiesState; unsigned int tmp = myEntitiesState;
ClearEntitiesFlags(); ClearEntitiesFlags();
map<SMDSAbs_ElementType,smIdType> entities = SMESH::GetEntitiesFromObject(this); map<SMDSAbs_ElementType,::smIdType> entities = SMESH::GetEntitiesFromObject(this);
if( myEntitiesCache[SMDSAbs_0DElement] != 0 || if( myEntitiesCache[SMDSAbs_0DElement] != 0 ||

View File

@ -1226,8 +1226,8 @@ namespace SMESH
int GetEdgeNodes(SVTK_Selector* theSelector, int GetEdgeNodes(SVTK_Selector* theSelector,
const TVisualObjPtr& theVisualObject, const TVisualObjPtr& theVisualObject,
smIdType& theId1, ::smIdType& theId1,
smIdType& theId2) ::smIdType& theId2)
{ {
const SALOME_ListIO& selected = theSelector->StoredIObjects(); const SALOME_ListIO& selected = theSelector->StoredIObjects();
@ -1243,9 +1243,9 @@ namespace SMESH
if ( aMapIndex.Extent() != 2 ) if ( aMapIndex.Extent() != 2 )
return -1; return -1;
smIdType anObjId = -1, anEdgeNum = -1; ::smIdType anObjId = -1, anEdgeNum = -1;
for ( smIdType i = 1; i <= aMapIndex.Extent(); i++ ) { for ( ::smIdType i = 1; i <= aMapIndex.Extent(); i++ ) {
smIdType aVal = aMapIndex( i ); ::smIdType aVal = aMapIndex( i );
if ( aVal > 0 ) if ( aVal > 0 )
anObjId = aVal; anObjId = aVal;
else else
@ -1343,7 +1343,7 @@ namespace SMESH
} }
int GetEdgeNodes( LightApp_SelectionMgr* theMgr, smIdType& theId1, smIdType& theId2 ) int GetEdgeNodes( LightApp_SelectionMgr* theMgr, ::smIdType& theId1, ::smIdType& theId2 )
{ {
SALOME_ListIO selected; theMgr->selectedObjects( selected ); SALOME_ListIO selected; theMgr->selectedObjects( selected );
@ -1363,9 +1363,9 @@ namespace SMESH
if ( aMapIndex.Extent() != 2 ) if ( aMapIndex.Extent() != 2 )
return -1; return -1;
smIdType anObjId = -1, anEdgeNum = -1; ::smIdType anObjId = -1, anEdgeNum = -1;
for ( smIdType i = 1; i <= aMapIndex.Extent(); i++ ) { for ( ::smIdType i = 1; i <= aMapIndex.Extent(); i++ ) {
smIdType aVal = aMapIndex( i ); ::smIdType aVal = aMapIndex( i );
if ( aVal > 0 ) if ( aVal > 0 )
anObjId = aVal; anObjId = aVal;
else else

View File

@ -169,7 +169,7 @@ SMESHGUI_EXPORT
const Handle(SALOME_InteractiveObject)&, const Handle(SALOME_InteractiveObject)&,
QString& ); QString& );
SMESHGUI_EXPORT SMESHGUI_EXPORT
int GetEdgeNodes( SVTK_Selector*, const TVisualObjPtr&, smIdType&, smIdType& ); int GetEdgeNodes( SVTK_Selector*, const TVisualObjPtr&, ::smIdType&, ::smIdType& );
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
SMESHGUI_EXPORT SMESHGUI_EXPORT
@ -189,7 +189,7 @@ SMESHGUI_EXPORT
const bool = true ); const bool = true );
SMESHGUI_EXPORT SMESHGUI_EXPORT
int GetEdgeNodes( LightApp_SelectionMgr*, smIdType&, smIdType& ); int GetEdgeNodes( LightApp_SelectionMgr*, ::smIdType&, ::smIdType& );
SMESHGUI_EXPORT SMESHGUI_EXPORT
void SetControlsPrecision( const long ); void SetControlsPrecision( const long );

File diff suppressed because it is too large Load Diff

View File

@ -43,8 +43,6 @@
#include "utilities.h" #include "utilities.h"
using namespace SMESH;
//============================================================================= //=============================================================================
/*! /*!
* *
@ -158,7 +156,7 @@ void SMESH_GroupBase_i::SetName( const char* theName )
aGen->SetName( anSO, theName ); aGen->SetName( anSO, theName );
// Update Python script // Update Python script
TPythonDump() << anSO << ".SetName( '" << theName << "' )"; SMESH::TPythonDump() << anSO << ".SetName( '" << theName << "' )";
} }
} }
@ -264,7 +262,7 @@ void SMESH_Group_i::Clear()
myPreMeshInfo->FullLoadFromFile(); myPreMeshInfo->FullLoadFromFile();
// Update Python script // Update Python script
TPythonDump() << SMESH::SMESH_Group_var(_this()) << ".Clear()"; SMESH::TPythonDump() << SMESH::SMESH_Group_var(_this()) << ".Clear()";
// Clear the group // Clear the group
SMESHDS_Group* aGroupDS = dynamic_cast<SMESHDS_Group*>( GetGroupDS() ); SMESHDS_Group* aGroupDS = dynamic_cast<SMESHDS_Group*>( GetGroupDS() );
@ -304,7 +302,7 @@ SMESH::smIdType SMESH_Group_i::Add( const SMESH::smIdType_array& theIDs )
myPreMeshInfo->FullLoadFromFile(); myPreMeshInfo->FullLoadFromFile();
// Update Python script // Update Python script
TPythonDump() << "nbAdd = " << SMESH::SMESH_Group_var(_this()) << ".Add( " << theIDs << " )"; SMESH::TPythonDump() << "nbAdd = " << SMESH::SMESH_Group_var(_this()) << ".Add( " << theIDs << " )";
// Add elements to the group // Add elements to the group
SMESHDS_Group* aGroupDS = dynamic_cast<SMESHDS_Group*>( GetGroupDS() ); SMESHDS_Group* aGroupDS = dynamic_cast<SMESHDS_Group*>( GetGroupDS() );
@ -335,7 +333,7 @@ SMESH::smIdType SMESH_Group_i::Remove( const SMESH::smIdType_array& theIDs )
myPreMeshInfo->FullLoadFromFile(); myPreMeshInfo->FullLoadFromFile();
// Update Python script // Update Python script
TPythonDump() << "nbDel = " << SMESH::SMESH_Group_var(_this()) SMESH::TPythonDump() << "nbDel = " << SMESH::SMESH_Group_var(_this())
<< ".Remove( " << theIDs << " )"; << ".Remove( " << theIDs << " )";
// Remove elements from the group // Remove elements from the group
@ -364,10 +362,10 @@ SMESH::smIdType SMESH_Group_i::Remove( const SMESH::smIdType_array& theIDs )
typedef bool (SMESHDS_Group::*TFunChangeGroup)(const smIdType); typedef bool (SMESHDS_Group::*TFunChangeGroup)(const smIdType);
CORBA::Long CORBA::Long
ChangeByPredicate( SMESH::Predicate_i* thePredicate, ChangeByPredicate( SMESH::Predicate_i* thePredicate,
SMESHDS_GroupBase* theGroupBase, SMESHDS_GroupBase* theGroupBase,
NotifyerAndWaiter* theGroupImpl, SMESH::NotifyerAndWaiter* theGroupImpl,
TFunChangeGroup theFun) TFunChangeGroup theFun)
{ {
CORBA::Long aNb = 0; CORBA::Long aNb = 0;
if(SMESHDS_Group* aGroupDS = dynamic_cast<SMESHDS_Group*>(theGroupBase)){ if(SMESHDS_Group* aGroupDS = dynamic_cast<SMESHDS_Group*>(theGroupBase)){
@ -394,8 +392,8 @@ AddByPredicate( SMESH::Predicate_ptr thePredicate )
myPreMeshInfo->FullLoadFromFile(); myPreMeshInfo->FullLoadFromFile();
if(SMESH::Predicate_i* aPredicate = SMESH::GetPredicate(thePredicate)){ if(SMESH::Predicate_i* aPredicate = SMESH::GetPredicate(thePredicate)){
TPythonDump() << SMESH::SMESH_Group_var(_this()) SMESH::TPythonDump() << SMESH::SMESH_Group_var(_this())
<< ".AddByPredicate( " << aPredicate << " )"; << ".AddByPredicate( " << aPredicate << " )";
return ChangeByPredicate( aPredicate, GetGroupDS(), this, &SMESHDS_Group::Add ); return ChangeByPredicate( aPredicate, GetGroupDS(), this, &SMESHDS_Group::Add );
} }
return 0; return 0;
@ -409,8 +407,8 @@ RemoveByPredicate( SMESH::Predicate_ptr thePredicate )
myPreMeshInfo->FullLoadFromFile(); myPreMeshInfo->FullLoadFromFile();
if(SMESH::Predicate_i* aPredicate = SMESH::GetPredicate(thePredicate)){ if(SMESH::Predicate_i* aPredicate = SMESH::GetPredicate(thePredicate)){
TPythonDump() << SMESH::SMESH_Group_var(_this()) SMESH::TPythonDump() << SMESH::SMESH_Group_var(_this())
<< ".RemoveByPredicate( " << aPredicate << " )"; << ".RemoveByPredicate( " << aPredicate << " )";
return ChangeByPredicate(aPredicate,GetGroupDS(),this, &SMESHDS_Group::Remove); return ChangeByPredicate(aPredicate,GetGroupDS(),this, &SMESHDS_Group::Remove);
} }
return 0; return 0;
@ -421,7 +419,7 @@ SMESH::smIdType SMESH_Group_i::AddFrom( SMESH::SMESH_IDSource_ptr theSource )
if ( myPreMeshInfo ) if ( myPreMeshInfo )
myPreMeshInfo->FullLoadFromFile(); myPreMeshInfo->FullLoadFromFile();
TPythonDump pd; SMESH::TPythonDump pd;
long prevNb = Size(); long prevNb = Size();
SMESHDS_Group* aGroupDS = dynamic_cast<SMESHDS_Group*>( GetGroupDS() ); SMESHDS_Group* aGroupDS = dynamic_cast<SMESHDS_Group*>( GetGroupDS() );
if (aGroupDS) { if (aGroupDS) {
@ -475,7 +473,7 @@ SMESH::smIdType_array* SMESH_GroupBase_i::GetListOfID()
smIdType aSize = aGroupDS->Extent(); smIdType aSize = aGroupDS->Extent();
aRes->length(aSize); aRes->length(aSize);
SMDS_ElemIteratorPtr it = aGroupDS->GetElements(); SMDS_ElemIteratorPtr it = aGroupDS->GetElements();
for (smIdType i = 0; it->more(); i++) for (::smIdType i = 0; it->more(); i++)
aRes[i] = it->next()->GetID(); aRes[i] = it->next()->GetID();
if ( 0 < aSize && aSize < 100 ) // for comfortable testing ;) if ( 0 < aSize && aSize < 100 ) // for comfortable testing ;)
@ -639,9 +637,9 @@ void SMESH_GroupBase_i::SetColor(const SALOMEDS::Color& color)
if ( oldColor != aQColor ) if ( oldColor != aQColor )
{ {
aGroupDS->SetColor(aQColor); aGroupDS->SetColor(aQColor);
TPythonDump()<< SMESH::SMESH_GroupBase_var(_this()) SMESH::TPythonDump()<< SMESH::SMESH_GroupBase_var(_this())
<< ".SetColor( SALOMEDS.Color( " << ".SetColor( SALOMEDS.Color( "
<<color.R<<", "<<color.G<<", "<<color.B<<" ))"; <<color.R<<", "<<color.G<<", "<<color.B<<" ))";
} }
} }
} }
@ -671,7 +669,7 @@ void SMESH_GroupBase_i::SetColorNumber(CORBA::Long color)
if (aGroupDS) if (aGroupDS)
{ {
aGroupDS->SetColorGroup(color); aGroupDS->SetColorGroup(color);
TPythonDump()<<SMESH::SMESH_GroupBase_var(_this())<<".SetColorNumber( "<<color<<" )"; SMESH::TPythonDump()<<SMESH::SMESH_GroupBase_var(_this())<<".SetColorNumber( "<<color<<" )";
} }
return ; return ;
} }
@ -844,7 +842,7 @@ void SMESH_GroupOnFilter_i::SetFilter(SMESH::Filter_ptr theFilter)
GetMeshServant()->GetGen()->HighLightInvalid( me, false ); GetMeshServant()->GetGen()->HighLightInvalid( me, false );
TPythonDump()<< me <<".SetFilter( "<< theFilter <<" )"; SMESH::TPythonDump()<< me <<".SetFilter( "<< theFilter <<" )";
} }
//================================================================================ //================================================================================
@ -856,7 +854,7 @@ void SMESH_GroupOnFilter_i::SetFilter(SMESH::Filter_ptr theFilter)
SMESH::Filter_ptr SMESH_GroupOnFilter_i::GetFilter() SMESH::Filter_ptr SMESH_GroupOnFilter_i::GetFilter()
{ {
SMESH::Filter_var f = myFilter; SMESH::Filter_var f = myFilter;
TPythonDump() << f << " = " << SMESH::SMESH_GroupOnFilter_var(_this()) << ".GetFilter()"; SMESH::TPythonDump() << f << " = " << SMESH::SMESH_GroupOnFilter_var(_this()) << ".GetFilter()";
return f._retn(); return f._retn();
} }
@ -938,7 +936,7 @@ SMESH::smIdType_array* SMESH_GroupOnFilter_i::GetMeshInfo()
if ( g->GetType() != SMDSAbs_Node ) if ( g->GetType() != SMDSAbs_Node )
{ {
std::vector< SMESH::smIdType > nbElems = static_cast< SMESHDS_GroupOnFilter* >( g )->GetMeshInfo(); std::vector< smIdType > nbElems = static_cast< SMESHDS_GroupOnFilter* >( g )->GetMeshInfo();
for ( size_t i = SMESH::Entity_Node; i < SMESH::Entity_Last; i++) for ( size_t i = SMESH::Entity_Node; i < SMESH::Entity_Last; i++)
if ( i < nbElems.size() ) if ( i < nbElems.size() )
aRes[i] = nbElems[ i ]; aRes[i] = nbElems[ i ];
@ -1039,7 +1037,7 @@ SMESH::Filter_ptr SMESH_GroupOnFilter_i::StringToFilter(const std::string& thePe
} }
// create a filter // create a filter
TPythonDump pd; SMESH::TPythonDump pd;
SMESH::FilterManager_i* aFilterMgr = new SMESH::FilterManager_i(); SMESH::FilterManager_i* aFilterMgr = new SMESH::FilterManager_i();
filter = aFilterMgr->CreateFilter(); filter = aFilterMgr->CreateFilter();
filter->SetCriteria( criteria.inout() ); filter->SetCriteria( criteria.inout() );

View File

@ -22,10 +22,6 @@
// File : SMESH_Measurements_i.cxx // File : SMESH_Measurements_i.cxx
// Author : Pavel TELKOV, Open CASCADE S.A.S. (pavel.telkov@opencascade.com) // Author : Pavel TELKOV, Open CASCADE S.A.S. (pavel.telkov@opencascade.com)
#ifdef WIN32
#define NOMINMAX
#endif
#include "SMESH_Measurements_i.hxx" #include "SMESH_Measurements_i.hxx"
#include "SMDS_ElemIterator.hxx" #include "SMDS_ElemIterator.hxx"
@ -40,7 +36,7 @@
#include <cmath> #include <cmath>
using namespace SMESH; //using namespace SMESH;
/** /**
* this local function to avoid uninitialized fields * this local function to avoid uninitialized fields
@ -80,7 +76,7 @@ SMESH::Measurements_ptr SMESH_Gen_i::CreateMeasurements()
// name : Measurements_i // name : Measurements_i
// Purpose : Constructor // Purpose : Constructor
//======================================================================= //=======================================================================
Measurements_i::Measurements_i() SMESH::Measurements_i::Measurements_i()
: SALOME::GenericObj_i( SMESH_Gen_i::GetPOA() ) : SALOME::GenericObj_i( SMESH_Gen_i::GetPOA() )
{ {
//Base class Salome_GenericObject do it inmplicitly by overriding PortableServer::POA_ptr _default_POA() method //Base class Salome_GenericObject do it inmplicitly by overriding PortableServer::POA_ptr _default_POA() method
@ -92,7 +88,7 @@ Measurements_i::Measurements_i()
// name : ~Measurements_i // name : ~Measurements_i
// Purpose : Destructor // Purpose : Destructor
//======================================================================= //=======================================================================
Measurements_i::~Measurements_i() SMESH::Measurements_i::~Measurements_i()
{ {
//TPythonDump()<<this<<".UnRegister()"; //TPythonDump()<<this<<".UnRegister()";
} }
@ -152,7 +148,7 @@ static SMESHDS_Mesh* getMesh(SMESH::SMESH_IDSource_ptr theSource)
if (!CORBA::is_nil( theSource )) if (!CORBA::is_nil( theSource ))
{ {
SMESH::SMESH_Mesh_var mesh = theSource->GetMesh(); SMESH::SMESH_Mesh_var mesh = theSource->GetMesh();
SMESH_Mesh_i* anImplPtr = DownCast<SMESH_Mesh_i*>( mesh ); SMESH_Mesh_i* anImplPtr = SMESH::DownCast<SMESH_Mesh_i*>( mesh );
if (anImplPtr) if (anImplPtr)
return anImplPtr->GetImpl().GetMeshDS(); return anImplPtr->GetImpl().GetMeshDS();
} }
@ -187,7 +183,7 @@ static double getNumericalValue(SMESH::SMESH_IDSource_ptr theSource,
// name : MinDistance // name : MinDistance
// Purpose : minimal distance between two given entities // Purpose : minimal distance between two given entities
//======================================================================= //=======================================================================
SMESH::Measure Measurements_i::MinDistance SMESH::Measure SMESH::Measurements_i::MinDistance
(SMESH::SMESH_IDSource_ptr theSource1, (SMESH::SMESH_IDSource_ptr theSource1,
SMESH::SMESH_IDSource_ptr theSource2) SMESH::SMESH_IDSource_ptr theSource2)
{ {
@ -289,7 +285,7 @@ static void enlargeBoundingBox(const SMESH::SMESH_IDSource_ptr theObject,
if ( !aMesh ) if ( !aMesh )
return; return;
if ( DownCast<SMESH_Mesh_i*>( theObject )) // theObject is mesh if (SMESH::DownCast<SMESH_Mesh_i*>( theObject )) // theObject is mesh
{ {
for (SMDS_NodeIteratorPtr aNodeIter = aMesh->nodesIterator(); aNodeIter->more(); ) for (SMDS_NodeIteratorPtr aNodeIter = aMesh->nodesIterator(); aNodeIter->more(); )
enlargeBoundingBox( aNodeIter->next(), theMeasure); enlargeBoundingBox( aNodeIter->next(), theMeasure);
@ -318,7 +314,7 @@ static void enlargeBoundingBox(const SMESH::SMESH_IDSource_ptr theObject,
// name : BoundingBox // name : BoundingBox
// Purpose : compute common bounding box of entities // Purpose : compute common bounding box of entities
//======================================================================= //=======================================================================
SMESH::Measure Measurements_i::BoundingBox (const SMESH::ListOfIDSources& theSources) SMESH::Measure SMESH::Measurements_i::BoundingBox (const SMESH::ListOfIDSources& theSources)
{ {
SMESH::Measure aMeasure; SMESH::Measure aMeasure;
initMeasure(aMeasure); initMeasure(aMeasure);
@ -334,7 +330,7 @@ SMESH::Measure Measurements_i::BoundingBox (const SMESH::ListOfIDSources& theSou
// name : Length // name : Length
// Purpose : sum of length of 1D elements of the source // Purpose : sum of length of 1D elements of the source
//======================================================================= //=======================================================================
double Measurements_i::Length(SMESH::SMESH_IDSource_ptr theSource) double SMESH::Measurements_i::Length(SMESH::SMESH_IDSource_ptr theSource)
{ {
return getNumericalValue( theSource, SMESH::Controls::NumericalFunctorPtr(new SMESH::Controls::Length()) ); return getNumericalValue( theSource, SMESH::Controls::NumericalFunctorPtr(new SMESH::Controls::Length()) );
} }
@ -343,7 +339,7 @@ double Measurements_i::Length(SMESH::SMESH_IDSource_ptr theSource)
// name : Area // name : Area
// Purpose : sum of area of 2D elements of the source // Purpose : sum of area of 2D elements of the source
//======================================================================= //=======================================================================
double Measurements_i::Area(SMESH::SMESH_IDSource_ptr theSource) double SMESH::Measurements_i::Area(SMESH::SMESH_IDSource_ptr theSource)
{ {
return getNumericalValue( theSource, SMESH::Controls::NumericalFunctorPtr(new SMESH::Controls::Area()) ); return getNumericalValue( theSource, SMESH::Controls::NumericalFunctorPtr(new SMESH::Controls::Area()) );
} }
@ -352,7 +348,7 @@ double Measurements_i::Area(SMESH::SMESH_IDSource_ptr theSource)
// name : Volume // name : Volume
// Purpose : sum of volume of 3D elements of the source // Purpose : sum of volume of 3D elements of the source
//======================================================================= //=======================================================================
double Measurements_i::Volume(SMESH::SMESH_IDSource_ptr theSource) double SMESH::Measurements_i::Volume(SMESH::SMESH_IDSource_ptr theSource)
{ {
return getNumericalValue( theSource, SMESH::Controls::NumericalFunctorPtr(new SMESH::Controls::Volume()) ); return getNumericalValue( theSource, SMESH::Controls::NumericalFunctorPtr(new SMESH::Controls::Volume()) );
} }
@ -362,7 +358,7 @@ double Measurements_i::Volume(SMESH::SMESH_IDSource_ptr theSource)
//purpose : return gravity center of the source: average coordinates of all nodes //purpose : return gravity center of the source: average coordinates of all nodes
//======================================================================= //=======================================================================
SMESH::PointStruct Measurements_i::GravityCenter(SMESH::SMESH_IDSource_ptr theSource) SMESH::PointStruct SMESH::Measurements_i::GravityCenter(SMESH::SMESH_IDSource_ptr theSource)
{ {
SMESH::PointStruct grCenter = { 0.,0.,0. }; SMESH::PointStruct grCenter = { 0.,0.,0. };
const SMESHDS_Mesh* mesh = getMesh( theSource ); const SMESHDS_Mesh* mesh = getMesh( theSource );
@ -404,9 +400,9 @@ SMESH::PointStruct Measurements_i::GravityCenter(SMESH::SMESH_IDSource_ptr theSo
//purpose : Return angle in radians defined by 3 points <(p1,p2,p3) //purpose : Return angle in radians defined by 3 points <(p1,p2,p3)
//======================================================================= //=======================================================================
CORBA::Double Measurements_i::Angle(const SMESH::PointStruct& p1, CORBA::Double SMESH::Measurements_i::Angle(const SMESH::PointStruct& p1,
const SMESH::PointStruct& p2, const SMESH::PointStruct& p2,
const SMESH::PointStruct& p3 ) const SMESH::PointStruct& p3 )
{ {
gp_Vec v1( p1.x - p2.x, p1.y - p2.y, p1.z - p2.z ); gp_Vec v1( p1.x - p2.x, p1.y - p2.y, p1.z - p2.z );
gp_Vec v2( p3.x - p2.x, p3.y - p2.y, p3.z - p2.z ); gp_Vec v2( p3.x - p2.x, p3.y - p2.y, p3.z - p2.z );

View File

@ -279,13 +279,13 @@ namespace MeshEditor_I {
SMDS_MeshElement::Filter & filter = *aFilter; SMDS_MeshElement::Filter & filter = *aFilter;
if ( aType == SMDSAbs_Node ) if ( aType == SMDSAbs_Node )
for ( SMESH::smIdType i = 0; i < IDs.length(); i++ ) { for ( CORBA::ULong i = 0; i < IDs.length(); i++ ) {
const SMDS_MeshElement * elem = aMesh->FindNode( IDs[i] ); const SMDS_MeshElement * elem = aMesh->FindNode( IDs[i] );
if ( filter( elem )) if ( filter( elem ))
aMap.insert( aMap.end(), elem ); aMap.insert( aMap.end(), elem );
} }
else else
for ( SMESH::smIdType i = 0; i<IDs.length(); i++) { for ( CORBA::ULong i = 0; i<IDs.length(); i++) {
const SMDS_MeshElement * elem = aMesh->FindElement( IDs[i] ); const SMDS_MeshElement * elem = aMesh->FindElement( IDs[i] );
if ( filter( elem )) if ( filter( elem ))
aMap.insert( aMap.end(), elem ); aMap.insert( aMap.end(), elem );
@ -789,7 +789,7 @@ SMESH_MeshEditor_i::RemoveElements(const SMESH::smIdType_array & IDsOfElements)
list< smIdType > IdList; list< smIdType > IdList;
for ( SMESH::smIdType i = 0; i < IDsOfElements.length(); i++ ) for ( CORBA::ULong i = 0; i < IDsOfElements.length(); i++ )
IdList.push_back( IDsOfElements[i] ); IdList.push_back( IDsOfElements[i] );
// Update Python script // Update Python script
@ -817,7 +817,7 @@ CORBA::Boolean SMESH_MeshEditor_i::RemoveNodes(const SMESH::smIdType_array & IDs
initData(); initData();
list< smIdType > IdList; list< smIdType > IdList;
for ( SMESH::smIdType i = 0; i < IDsOfNodes.length(); i++) for ( CORBA::ULong i = 0; i < IDsOfNodes.length(); i++)
IdList.push_back( IDsOfNodes[i] ); IdList.push_back( IDsOfNodes[i] );
// Update Python script // Update Python script
@ -1578,7 +1578,7 @@ CORBA::Boolean SMESH_MeshEditor_i::Reorient(const SMESH::smIdType_array & IDsOfE
SMESH_TRY; SMESH_TRY;
initData(); initData();
for ( SMESH::smIdType i = 0; i < IDsOfElements.length(); i++ ) for ( CORBA::ULong i = 0; i < IDsOfElements.length(); i++ )
{ {
SMESH::smIdType index = IDsOfElements[i]; SMESH::smIdType index = IDsOfElements[i];
const SMDS_MeshElement * elem = getMeshDS()->FindElement(index); const SMDS_MeshElement * elem = getMeshDS()->FindElement(index);
@ -2252,7 +2252,7 @@ SMESH_MeshEditor_i::smooth(const SMESH::smIdType_array & IDsOfElements,
arrayToSet(IDsOfElements, aMesh, elements, SMDSAbs_Face); arrayToSet(IDsOfElements, aMesh, elements, SMDSAbs_Face);
set<const SMDS_MeshNode*> fixedNodes; set<const SMDS_MeshNode*> fixedNodes;
for ( SMESH::smIdType i = 0; i < IDsOfFixedNodes.length(); i++) { for ( CORBA::ULong i = 0; i < IDsOfFixedNodes.length(); i++) {
SMESH::smIdType index = IDsOfFixedNodes[i]; SMESH::smIdType index = IDsOfFixedNodes[i];
const SMDS_MeshNode * node = aMesh->FindNode(index); const SMDS_MeshNode * node = aMesh->FindNode(index);
if ( node ) if ( node )
@ -4342,7 +4342,7 @@ void SMESH_MeshEditor_i::MergeElements(const SMESH::array_of_long_array& theGrou
if ( elemTypes->length() == 1 && elemTypes[0] == SMESH::NODE ) if ( elemTypes->length() == 1 && elemTypes[0] == SMESH::NODE )
continue; continue;
SMESH::smIdType_array_var elementsId = theElementsToKeep[i]->GetIDs(); SMESH::smIdType_array_var elementsId = theElementsToKeep[i]->GetIDs();
for ( SMESH::smIdType j = 0; j < elementsId->length(); ++j ) for ( CORBA::ULong j = 0; j < elementsId->length(); ++j )
idsToKeep.Add( elementsId[ j ]); idsToKeep.Add( elementsId[ j ]);
} }
@ -4353,7 +4353,7 @@ void SMESH_MeshEditor_i::MergeElements(const SMESH::array_of_long_array& theGrou
const SMESH::long_array& anElemsIDGroup = theGroupsOfElementsID[ i ]; const SMESH::long_array& anElemsIDGroup = theGroupsOfElementsID[ i ];
aListOfListOfElementsID.push_back( list< smIdType >() ); aListOfListOfElementsID.push_back( list< smIdType >() );
list< smIdType >& aListOfElemsID = aListOfListOfElementsID.back(); list< smIdType >& aListOfElemsID = aListOfListOfElementsID.back();
for ( SMESH::smIdType j = 0; j < anElemsIDGroup.length(); j++ ) for ( CORBA::ULong j = 0; j < anElemsIDGroup.length(); j++ )
{ {
SMESH::smIdType id = anElemsIDGroup[ j ]; SMESH::smIdType id = anElemsIDGroup[ j ];
if ( idsToKeep.Contains( id )) aListOfElemsID.push_front( id ); if ( idsToKeep.Contains( id )) aListOfElemsID.push_front( id );

View File

@ -93,7 +93,7 @@ public:
SMESH::SMESH_IDSource_ptr MakeIDSource(const SMESH::smIdType_array& IDsOfElements, SMESH::SMESH_IDSource_ptr MakeIDSource(const SMESH::smIdType_array& IDsOfElements,
SMESH::ElementType type); SMESH::ElementType type);
static bool IsTemporaryIDSource( SMESH::SMESH_IDSource_ptr& idSource ); static bool IsTemporaryIDSource( SMESH::SMESH_IDSource_ptr& idSource );
static SMESH::smIdType* GetTemporaryIDs( SMESH::SMESH_IDSource_ptr& idSource, smIdType& nbIds ); static SMESH::smIdType* GetTemporaryIDs( SMESH::SMESH_IDSource_ptr& idSource, SMESH::smIdType& nbIds );
/*! /*!
* \brief Generates the unique group name * \brief Generates the unique group name

View File

@ -320,13 +320,8 @@ void StdMeshersGUI_DistrPreview::update()
setAxisScale( myDensity->xAxis(), min_x, max_x ); setAxisScale( myDensity->xAxis(), min_x, max_x );
setAxisScale( myDensity->yAxis(), setAxisScale( myDensity->yAxis(),
#ifdef WIN32
min( 0.0, min_y ),
max( 0.0, max_y )
#else
std::min( 0.0, min_y ), std::min( 0.0, min_y ),
std::max( 0.0, max_y ) std::max( 0.0, max_y )
#endif
); );
myDensity->setSamples( x, y, size ); myDensity->setSamples( x, y, size );
if( x ) if( x )