Salome HOME
projects
/
modules
/
smesh.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[bos #40650][CEA 33012] Beta Law distribution: added a new type of distribution for...
[modules/smesh.git]
/
src
/
SMESH_I
/
SMESH_Measurements_i.cxx
diff --git
a/src/SMESH_I/SMESH_Measurements_i.cxx
b/src/SMESH_I/SMESH_Measurements_i.cxx
index 9aa98e1a1739e9ba36362a394bf42ef57dddb8d0..3ff5343d6e12790a942956de82753405b6e433f1 100644
(file)
--- a/
src/SMESH_I/SMESH_Measurements_i.cxx
+++ b/
src/SMESH_I/SMESH_Measurements_i.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-202
1 CEA/DEN, EDF R&D
, OPEN CASCADE
+// Copyright (C) 2007-202
4 CEA, EDF
, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@
-22,10
+22,6
@@
// File : SMESH_Measurements_i.cxx
// Author : Pavel TELKOV, Open CASCADE S.A.S. (pavel.telkov@opencascade.com)
// File : SMESH_Measurements_i.cxx
// Author : Pavel TELKOV, Open CASCADE S.A.S. (pavel.telkov@opencascade.com)
-#ifdef WIN32
-#define NOMINMAX
-#endif
-
#include "SMESH_Measurements_i.hxx"
#include "SMDS_ElemIterator.hxx"
#include "SMESH_Measurements_i.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
// Purpose : Constructor
//=======================================================================
// name : Measurements_i
// Purpose : Constructor
//=======================================================================
-Measurements_i::Measurements_i()
+
SMESH::
Measurements_i::Measurements_i()
: SALOME::GenericObj_i( SMESH_Gen_i::GetPOA() )
{
//Base class Salome_GenericObject do it inmplicitly by overriding PortableServer::POA_ptr _default_POA() method
: SALOME::GenericObj_i( SMESH_Gen_i::GetPOA() )
{
//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
// Purpose : Destructor
//=======================================================================
// name : ~Measurements_i
// 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 ))
{
SMESH::SMESH_Mesh_var mesh = theSource->GetMesh();
if (!CORBA::is_nil( theSource ))
{
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)
return anImplPtr->GetImpl().GetMeshDS();
}
if (anImplPtr)
return anImplPtr->GetImpl().GetMeshDS();
}
@@
-174,7
+170,7
@@
static double getNumericalValue(SMESH::SMESH_IDSource_ptr theSource,
if ( aMesh ) {
theFunctor->SetMesh( aMesh );
if ( aMesh ) {
theFunctor->SetMesh( aMesh );
- SMESH::
long
_array_var anElementsId = theSource->GetIDs();
+ SMESH::
smIdType
_array_var anElementsId = theSource->GetIDs();
for ( CORBA::ULong i = 0; i < anElementsId->length(); i++) {
value += theFunctor->GetValue( anElementsId[i] );
}
for ( CORBA::ULong i = 0; i < anElementsId->length(); i++) {
value += theFunctor->GetValue( anElementsId[i] );
}
@@
-187,7
+183,7
@@
static double getNumericalValue(SMESH::SMESH_IDSource_ptr theSource,
// name : MinDistance
// Purpose : minimal distance between two given entities
//=======================================================================
// name : MinDistance
// 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 theSource2)
{
(SMESH::SMESH_IDSource_ptr theSource1,
SMESH::SMESH_IDSource_ptr theSource2)
{
@@
-209,8
+205,8
@@
SMESH::Measure Measurements_i::MinDistance
bool isNode1 = isNodeType(types1);
bool isNode2 = isOrigin || isNodeType(types2);
bool isNode1 = isNodeType(types1);
bool isNode2 = isOrigin || isNodeType(types2);
- SMESH::
long
_array_var aElementsId1 = theSource1->GetIDs();
- SMESH::
long
_array_var aElementsId2;
+ SMESH::
smIdType
_array_var aElementsId1 = theSource1->GetIDs();
+ SMESH::
smIdType
_array_var aElementsId2;
// compute distance between two entities
/* NOTE: currently only node-to-node case is implemented
// compute distance between two entities
/* NOTE: currently only node-to-node case is implemented
@@
-289,7
+285,7
@@
static void enlargeBoundingBox(const SMESH::SMESH_IDSource_ptr theObject,
if ( !aMesh )
return;
if ( !aMesh )
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(); )
enlargeBoundingBox( aNodeIter->next(), theMeasure);
{
for (SMDS_NodeIteratorPtr aNodeIter = aMesh->nodesIterator(); aNodeIter->more(); )
enlargeBoundingBox( aNodeIter->next(), theMeasure);
@@
-297,7
+293,7
@@
static void enlargeBoundingBox(const SMESH::SMESH_IDSource_ptr theObject,
else
{
SMESH::array_of_ElementType_var types = theObject->GetTypes();
else
{
SMESH::array_of_ElementType_var types = theObject->GetTypes();
- SMESH::
long_array_var
aElementsId = theObject->GetIDs();
+ SMESH::
smIdType_array_var
aElementsId = theObject->GetIDs();
// here we assume that type of all IDs defined by first type in array
const bool isNode = isNodeType( types );
for(int i = 0, n = aElementsId->length(); i < n; i++)
// here we assume that type of all IDs defined by first type in array
const bool isNode = isNodeType( types );
for(int i = 0, n = aElementsId->length(); i < n; i++)
@@
-318,7
+314,7
@@
static void enlargeBoundingBox(const SMESH::SMESH_IDSource_ptr theObject,
// name : BoundingBox
// Purpose : compute common bounding box of entities
//=======================================================================
// name : BoundingBox
// 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;
initMeasure(aMeasure);
{
SMESH::Measure aMeasure;
initMeasure(aMeasure);
@@
-334,7
+330,7
@@
SMESH::Measure Measurements_i::BoundingBox (const SMESH::ListOfIDSources& theSou
// name : Length
// Purpose : sum of length of 1D elements of the source
//=======================================================================
// name : Length
// 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
// Purpose : sum of area of 2D elements of the source
//=======================================================================
// name : Area
// 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
// Purpose : sum of volume of 3D elements of the source
//=======================================================================
// name : Volume
// 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. };
const SMESHDS_Mesh* mesh = getMesh( theSource );
{
SMESH::PointStruct grCenter = { 0.,0.,0. };
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,
- const SMESH::PointStruct& p2,
- const SMESH::PointStruct& p3 )
+CORBA::Double
SMESH::
Measurements_i::Angle(const SMESH::PointStruct& p1,
+
const SMESH::PointStruct& p2,
+
const SMESH::PointStruct& p3 )
{
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 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 );