mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-25 17:00:34 +05:00
0023614: EDF 16256 - Coordinates of a group
This commit is contained in:
parent
401b2a2e54
commit
9a3f7d877e
@ -61,6 +61,7 @@ module SMESH
|
||||
FT_MultiConnection2D,
|
||||
FT_Length,
|
||||
FT_Length2D,
|
||||
FT_Length3D,
|
||||
FT_Deflection2D,
|
||||
FT_NodeConnectivityNumber,
|
||||
FT_BelongToMeshGroup,
|
||||
@ -118,7 +119,8 @@ module SMESH
|
||||
*/
|
||||
interface NumericalFunctor: Functor
|
||||
{
|
||||
double GetValue( in long theElementId );
|
||||
double GetValue ( in long theElementId );
|
||||
boolean IsApplicable( in long theElementId );
|
||||
|
||||
Histogram GetHistogram ( in short nbIntervals, in boolean isLogarithmic );
|
||||
Histogram GetLocalHistogram( in short nbIntervals, in boolean isLogarithmic,
|
||||
@ -151,6 +153,7 @@ module SMESH
|
||||
typedef sequence<Value> Values;
|
||||
Values GetValues();
|
||||
};
|
||||
interface Length3D : NumericalFunctor{};
|
||||
interface Deflection2D : NumericalFunctor{};
|
||||
interface MultiConnection : NumericalFunctor{};
|
||||
interface MultiConnection2D : NumericalFunctor
|
||||
@ -588,6 +591,7 @@ module SMESH
|
||||
MaxElementLength3D CreateMaxElementLength3D();
|
||||
Length CreateLength();
|
||||
Length2D CreateLength2D();
|
||||
Length3D CreateLength3D();
|
||||
Deflection2D CreateDeflection2D();
|
||||
MultiConnection CreateMultiConnection();
|
||||
MultiConnection2D CreateMultiConnection2D();
|
||||
|
@ -233,7 +233,7 @@ bool NumericalFunctor::GetPoints(const int theId,
|
||||
return false;
|
||||
|
||||
const SMDS_MeshElement* anElem = myMesh->FindElement( theId );
|
||||
if ( !anElem || anElem->GetType() != this->GetType() )
|
||||
if ( !IsApplicable( anElem ))
|
||||
return false;
|
||||
|
||||
return GetPoints( anElem, theRes );
|
||||
@ -292,6 +292,24 @@ double NumericalFunctor::Round( const double & aVal )
|
||||
return ( myPrecision >= 0 ) ? floor( aVal * myPrecisionValue + 0.5 ) / myPrecisionValue : aVal;
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
/*!
|
||||
* \brief Return true if a value can be computed for a given element.
|
||||
* Some NumericalFunctor's are meaningful for elements of a certain
|
||||
* geometry only.
|
||||
*/
|
||||
//================================================================================
|
||||
|
||||
bool NumericalFunctor::IsApplicable( const SMDS_MeshElement* element ) const
|
||||
{
|
||||
return element && element->GetType() == this->GetType();
|
||||
}
|
||||
|
||||
bool NumericalFunctor::IsApplicable( long theElementId ) const
|
||||
{
|
||||
return IsApplicable( myMesh->FindElement( theElementId ));
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
/*!
|
||||
* \brief Return histogram of functor values
|
||||
@ -901,6 +919,11 @@ double AspectRatio::GetValue( const TSequenceOfXYZ& P )
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool AspectRatio::IsApplicable( const SMDS_MeshElement* element ) const
|
||||
{
|
||||
return ( NumericalFunctor::IsApplicable( element ) && !element->IsPoly() );
|
||||
}
|
||||
|
||||
double AspectRatio::GetBadRate( double Value, int /*nbNodes*/ ) const
|
||||
{
|
||||
// the aspect ratio is in the range [1.0,infinity]
|
||||
@ -1007,6 +1030,11 @@ double AspectRatio3D::GetValue( long theId )
|
||||
return aVal;
|
||||
}
|
||||
|
||||
bool AspectRatio3D::IsApplicable( const SMDS_MeshElement* element ) const
|
||||
{
|
||||
return ( NumericalFunctor::IsApplicable( element ) && !element->IsPoly() );
|
||||
}
|
||||
|
||||
double AspectRatio3D::GetValue( const TSequenceOfXYZ& P )
|
||||
{
|
||||
double aQuality = 0.0;
|
||||
@ -1015,11 +1043,11 @@ double AspectRatio3D::GetValue( const TSequenceOfXYZ& P )
|
||||
int nbNodes = P.size();
|
||||
|
||||
if( myCurrElement->IsQuadratic() ) {
|
||||
if(nbNodes==10) nbNodes=4; // quadratic tetrahedron
|
||||
if (nbNodes==10) nbNodes=4; // quadratic tetrahedron
|
||||
else if(nbNodes==13) nbNodes=5; // quadratic pyramid
|
||||
else if(nbNodes==15) nbNodes=6; // quadratic pentahedron
|
||||
else if(nbNodes==20) nbNodes=8; // quadratic hexahedron
|
||||
else if(nbNodes==27) nbNodes=8; // quadratic hexahedron
|
||||
else if(nbNodes==27) nbNodes=8; // tri-quadratic hexahedron
|
||||
else return aQuality;
|
||||
}
|
||||
|
||||
@ -1296,6 +1324,11 @@ SMDSAbs_ElementType AspectRatio3D::GetType() const
|
||||
*/
|
||||
//================================================================================
|
||||
|
||||
bool Warping::IsApplicable( const SMDS_MeshElement* element ) const
|
||||
{
|
||||
return NumericalFunctor::IsApplicable( element ) && element->NbNodes() == 4;
|
||||
}
|
||||
|
||||
double Warping::GetValue( const TSequenceOfXYZ& P )
|
||||
{
|
||||
if ( P.size() != 4 )
|
||||
@ -1360,6 +1393,11 @@ SMDSAbs_ElementType Warping::GetType() const
|
||||
*/
|
||||
//================================================================================
|
||||
|
||||
bool Taper::IsApplicable( const SMDS_MeshElement* element ) const
|
||||
{
|
||||
return ( NumericalFunctor::IsApplicable( element ) && element->NbNodes() == 4 );
|
||||
}
|
||||
|
||||
double Taper::GetValue( const TSequenceOfXYZ& P )
|
||||
{
|
||||
if ( P.size() != 4 )
|
||||
@ -1418,6 +1456,11 @@ static inline double skewAngle( const gp_XYZ& p1, const gp_XYZ& p2, const gp_XYZ
|
||||
return v1.Magnitude() < gp::Resolution() || v2.Magnitude() < gp::Resolution() ? 0. : v1.Angle( v2 );
|
||||
}
|
||||
|
||||
bool Skew::IsApplicable( const SMDS_MeshElement* element ) const
|
||||
{
|
||||
return ( NumericalFunctor::IsApplicable( element ) && element->NbNodes() <= 4 );
|
||||
}
|
||||
|
||||
double Skew::GetValue( const TSequenceOfXYZ& P )
|
||||
{
|
||||
if ( P.size() != 3 && P.size() != 4 )
|
||||
@ -1534,11 +1577,34 @@ SMDSAbs_ElementType Length::GetType() const
|
||||
|
||||
//================================================================================
|
||||
/*
|
||||
Class : Length2D
|
||||
Description : Functor for calculating minimal length of edge
|
||||
Class : Length3D
|
||||
Description : Functor for calculating minimal length of element edge
|
||||
*/
|
||||
//================================================================================
|
||||
|
||||
Length3D::Length3D():
|
||||
Length2D ( SMDSAbs_Volume )
|
||||
{
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
/*
|
||||
Class : Length2D
|
||||
Description : Functor for calculating minimal length of element edge
|
||||
*/
|
||||
//================================================================================
|
||||
|
||||
Length2D::Length2D( SMDSAbs_ElementType type ):
|
||||
myType ( type )
|
||||
{
|
||||
}
|
||||
|
||||
bool Length2D::IsApplicable( const SMDS_MeshElement* element ) const
|
||||
{
|
||||
return ( NumericalFunctor::IsApplicable( element ) &&
|
||||
element->GetEntityType() != SMDSEntity_Polyhedra );
|
||||
}
|
||||
|
||||
double Length2D::GetValue( const TSequenceOfXYZ& P )
|
||||
{
|
||||
double aVal = 0;
|
||||
@ -1783,7 +1849,7 @@ double Length2D::GetBadRate( double Value, int /*nbNodes*/ ) const
|
||||
|
||||
SMDSAbs_ElementType Length2D::GetType() const
|
||||
{
|
||||
return SMDSAbs_Face;
|
||||
return myType;
|
||||
}
|
||||
|
||||
Length2D::Value::Value(double theLength,long thePntId1, long thePntId2):
|
||||
@ -1805,84 +1871,90 @@ bool Length2D::Value::operator<(const Length2D::Value& x) const
|
||||
|
||||
void Length2D::GetValues(TValues& theValues)
|
||||
{
|
||||
TValues aValues;
|
||||
for ( SMDS_FaceIteratorPtr anIter = myMesh->facesIterator(); anIter->more(); )
|
||||
if ( myType == SMDSAbs_Face )
|
||||
{
|
||||
const SMDS_MeshFace* anElem = anIter->next();
|
||||
if ( anElem->IsQuadratic() )
|
||||
for ( SMDS_FaceIteratorPtr anIter = myMesh->facesIterator(); anIter->more(); )
|
||||
{
|
||||
// use special nodes iterator
|
||||
SMDS_NodeIteratorPtr anIter = anElem->interlacedNodesIterator();
|
||||
long aNodeId[4] = { 0,0,0,0 };
|
||||
gp_Pnt P[4];
|
||||
const SMDS_MeshFace* anElem = anIter->next();
|
||||
if ( anElem->IsQuadratic() )
|
||||
{
|
||||
// use special nodes iterator
|
||||
SMDS_NodeIteratorPtr anIter = anElem->interlacedNodesIterator();
|
||||
long aNodeId[4] = { 0,0,0,0 };
|
||||
gp_Pnt P[4];
|
||||
|
||||
double aLength = 0;
|
||||
if ( anIter->more() )
|
||||
{
|
||||
const SMDS_MeshNode* aNode = anIter->next();
|
||||
P[0] = P[1] = SMESH_NodeXYZ( aNode );
|
||||
aNodeId[0] = aNodeId[1] = aNode->GetID();
|
||||
aLength = 0;
|
||||
}
|
||||
for ( ; anIter->more(); )
|
||||
{
|
||||
const SMDS_MeshNode* N1 = anIter->next();
|
||||
P[2] = SMESH_NodeXYZ( N1 );
|
||||
aNodeId[2] = N1->GetID();
|
||||
aLength = P[1].Distance(P[2]);
|
||||
if(!anIter->more()) break;
|
||||
const SMDS_MeshNode* N2 = anIter->next();
|
||||
P[3] = SMESH_NodeXYZ( N2 );
|
||||
aNodeId[3] = N2->GetID();
|
||||
aLength += P[2].Distance(P[3]);
|
||||
double aLength = 0;
|
||||
if ( anIter->more() )
|
||||
{
|
||||
const SMDS_MeshNode* aNode = anIter->next();
|
||||
P[0] = P[1] = SMESH_NodeXYZ( aNode );
|
||||
aNodeId[0] = aNodeId[1] = aNode->GetID();
|
||||
aLength = 0;
|
||||
}
|
||||
for ( ; anIter->more(); )
|
||||
{
|
||||
const SMDS_MeshNode* N1 = anIter->next();
|
||||
P[2] = SMESH_NodeXYZ( N1 );
|
||||
aNodeId[2] = N1->GetID();
|
||||
aLength = P[1].Distance(P[2]);
|
||||
if(!anIter->more()) break;
|
||||
const SMDS_MeshNode* N2 = anIter->next();
|
||||
P[3] = SMESH_NodeXYZ( N2 );
|
||||
aNodeId[3] = N2->GetID();
|
||||
aLength += P[2].Distance(P[3]);
|
||||
Value aValue1(aLength,aNodeId[1],aNodeId[2]);
|
||||
Value aValue2(aLength,aNodeId[2],aNodeId[3]);
|
||||
P[1] = P[3];
|
||||
aNodeId[1] = aNodeId[3];
|
||||
theValues.insert(aValue1);
|
||||
theValues.insert(aValue2);
|
||||
}
|
||||
aLength += P[2].Distance(P[0]);
|
||||
Value aValue1(aLength,aNodeId[1],aNodeId[2]);
|
||||
Value aValue2(aLength,aNodeId[2],aNodeId[3]);
|
||||
P[1] = P[3];
|
||||
aNodeId[1] = aNodeId[3];
|
||||
Value aValue2(aLength,aNodeId[2],aNodeId[0]);
|
||||
theValues.insert(aValue1);
|
||||
theValues.insert(aValue2);
|
||||
}
|
||||
aLength += P[2].Distance(P[0]);
|
||||
Value aValue1(aLength,aNodeId[1],aNodeId[2]);
|
||||
Value aValue2(aLength,aNodeId[2],aNodeId[0]);
|
||||
theValues.insert(aValue1);
|
||||
theValues.insert(aValue2);
|
||||
}
|
||||
else {
|
||||
SMDS_NodeIteratorPtr aNodesIter = anElem->nodeIterator();
|
||||
long aNodeId[2] = {0,0};
|
||||
gp_Pnt P[3];
|
||||
else {
|
||||
SMDS_NodeIteratorPtr aNodesIter = anElem->nodeIterator();
|
||||
long aNodeId[2] = {0,0};
|
||||
gp_Pnt P[3];
|
||||
|
||||
double aLength;
|
||||
const SMDS_MeshElement* aNode;
|
||||
if ( aNodesIter->more())
|
||||
{
|
||||
aNode = aNodesIter->next();
|
||||
P[0] = P[1] = SMESH_NodeXYZ( aNode );
|
||||
aNodeId[0] = aNodeId[1] = aNode->GetID();
|
||||
aLength = 0;
|
||||
}
|
||||
for( ; aNodesIter->more(); )
|
||||
{
|
||||
aNode = aNodesIter->next();
|
||||
long anId = aNode->GetID();
|
||||
double aLength;
|
||||
const SMDS_MeshElement* aNode;
|
||||
if ( aNodesIter->more())
|
||||
{
|
||||
aNode = aNodesIter->next();
|
||||
P[0] = P[1] = SMESH_NodeXYZ( aNode );
|
||||
aNodeId[0] = aNodeId[1] = aNode->GetID();
|
||||
aLength = 0;
|
||||
}
|
||||
for( ; aNodesIter->more(); )
|
||||
{
|
||||
aNode = aNodesIter->next();
|
||||
long anId = aNode->GetID();
|
||||
|
||||
P[2] = SMESH_NodeXYZ( aNode );
|
||||
P[2] = SMESH_NodeXYZ( aNode );
|
||||
|
||||
aLength = P[1].Distance(P[2]);
|
||||
aLength = P[1].Distance(P[2]);
|
||||
|
||||
Value aValue(aLength,aNodeId[1],anId);
|
||||
aNodeId[1] = anId;
|
||||
P[1] = P[2];
|
||||
Value aValue(aLength,aNodeId[1],anId);
|
||||
aNodeId[1] = anId;
|
||||
P[1] = P[2];
|
||||
theValues.insert(aValue);
|
||||
}
|
||||
|
||||
aLength = P[0].Distance(P[1]);
|
||||
|
||||
Value aValue(aLength,aNodeId[0],aNodeId[1]);
|
||||
theValues.insert(aValue);
|
||||
}
|
||||
|
||||
aLength = P[0].Distance(P[1]);
|
||||
|
||||
Value aValue(aLength,aNodeId[0],aNodeId[1]);
|
||||
theValues.insert(aValue);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// not implemented
|
||||
}
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
|
@ -136,6 +136,8 @@ namespace SMESH{
|
||||
const std::vector<int>& elements,
|
||||
const double* minmax=0,
|
||||
const bool isLogarithmic = false);
|
||||
bool IsApplicable( long theElementId ) const;
|
||||
virtual bool IsApplicable( const SMDS_MeshElement* element ) const;
|
||||
virtual SMDSAbs_ElementType GetType() const = 0;
|
||||
virtual double GetBadRate( double Value, int nbNodes ) const = 0;
|
||||
long GetPrecision() const;
|
||||
@ -176,8 +178,8 @@ namespace SMESH{
|
||||
virtual double GetBadRate( double Value, int nbNodes ) const;
|
||||
virtual SMDSAbs_ElementType GetType() const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Class : MaxElementLength3D
|
||||
Description : Functor calculating maximum length of 3D element
|
||||
@ -212,6 +214,7 @@ namespace SMESH{
|
||||
virtual double GetValue( const TSequenceOfXYZ& thePoints );
|
||||
virtual double GetBadRate( double Value, int nbNodes ) const;
|
||||
virtual SMDSAbs_ElementType GetType() const;
|
||||
virtual bool IsApplicable( const SMDS_MeshElement* element ) const;
|
||||
};
|
||||
|
||||
|
||||
@ -225,6 +228,7 @@ namespace SMESH{
|
||||
virtual double GetValue( const TSequenceOfXYZ& thePoints );
|
||||
virtual double GetBadRate( double Value, int nbNodes ) const;
|
||||
virtual SMDSAbs_ElementType GetType() const;
|
||||
virtual bool IsApplicable( const SMDS_MeshElement* element ) const;
|
||||
};
|
||||
|
||||
|
||||
@ -237,7 +241,8 @@ namespace SMESH{
|
||||
virtual double GetValue( const TSequenceOfXYZ& thePoints );
|
||||
virtual double GetBadRate( double Value, int nbNodes ) const;
|
||||
virtual SMDSAbs_ElementType GetType() const;
|
||||
|
||||
virtual bool IsApplicable( const SMDS_MeshElement* element ) const;
|
||||
|
||||
private:
|
||||
double ComputeA( const gp_XYZ&, const gp_XYZ&, const gp_XYZ&, const gp_XYZ& ) const;
|
||||
};
|
||||
@ -252,6 +257,7 @@ namespace SMESH{
|
||||
virtual double GetValue( const TSequenceOfXYZ& thePoints );
|
||||
virtual double GetBadRate( double Value, int nbNodes ) const;
|
||||
virtual SMDSAbs_ElementType GetType() const;
|
||||
virtual bool IsApplicable( const SMDS_MeshElement* element ) const;
|
||||
};
|
||||
|
||||
/*
|
||||
@ -263,6 +269,7 @@ namespace SMESH{
|
||||
virtual double GetValue( const TSequenceOfXYZ& thePoints );
|
||||
virtual double GetBadRate( double Value, int nbNodes ) const;
|
||||
virtual SMDSAbs_ElementType GetType() const;
|
||||
virtual bool IsApplicable( const SMDS_MeshElement* element ) const;
|
||||
};
|
||||
|
||||
|
||||
@ -291,10 +298,12 @@ namespace SMESH{
|
||||
|
||||
/*
|
||||
Class : Length2D
|
||||
Description : Functor for calculating minimal length of edge
|
||||
Description : Functor for calculating minimal length of edges of element
|
||||
*/
|
||||
class SMESHCONTROLS_EXPORT Length2D: public virtual NumericalFunctor{
|
||||
public:
|
||||
Length2D( SMDSAbs_ElementType type = SMDSAbs_Face );
|
||||
virtual bool IsApplicable( const SMDS_MeshElement* element ) const;
|
||||
virtual double GetValue( const TSequenceOfXYZ& thePoints );
|
||||
virtual double GetBadRate( double Value, int nbNodes ) const;
|
||||
virtual SMDSAbs_ElementType GetType() const;
|
||||
@ -306,9 +315,22 @@ namespace SMESH{
|
||||
};
|
||||
typedef std::set<Value> TValues;
|
||||
void GetValues(TValues& theValues);
|
||||
|
||||
private:
|
||||
SMDSAbs_ElementType myType;
|
||||
};
|
||||
typedef boost::shared_ptr<Length2D> Length2DPtr;
|
||||
|
||||
/*
|
||||
Class : Length2D
|
||||
Description : Functor for calculating minimal length of edges of 3D element
|
||||
*/
|
||||
class SMESHCONTROLS_EXPORT Length3D: public virtual Length2D {
|
||||
public:
|
||||
Length3D();
|
||||
};
|
||||
typedef boost::shared_ptr<Length3D> Length3DPtr;
|
||||
|
||||
/*
|
||||
Class : Deflection2D
|
||||
Description : Functor for calculating distance between a face and geometry
|
||||
|
@ -165,6 +165,7 @@ SET(_other_HEADERS
|
||||
SMESHGUI_MeshEditPreview.h
|
||||
SMESHGUI_IdValidator.h
|
||||
SMESHGUI_FileValidator.h
|
||||
SMESHGUI_SelectionProxy.h
|
||||
SMESH_SMESHGUI.hxx
|
||||
)
|
||||
|
||||
@ -189,6 +190,7 @@ SET(_other_SOURCES
|
||||
SMESHGUI_GroupDlg.cxx
|
||||
SMESHGUI_RemoveNodesDlg.cxx
|
||||
SMESHGUI_RemoveElementsDlg.cxx
|
||||
SMESHGUI_SelectionProxy.cxx
|
||||
SMESHGUI_MeshInfo.cxx
|
||||
SMESHGUI_Measurements.cxx
|
||||
SMESHGUI_Preferences_ScalarBarDlg.cxx
|
||||
|
@ -1571,6 +1571,7 @@ void SMESHGUI_FilterTable::updateAdditionalWidget()
|
||||
aCriterion == SMESH::FT_MaxElementLength3D ||
|
||||
aCriterion == SMESH::FT_Length ||
|
||||
aCriterion == SMESH::FT_Length2D ||
|
||||
aCriterion == SMESH::FT_Length3D ||
|
||||
aCriterion == SMESH::FT_Deflection2D ||
|
||||
aCriterion == SMESH::FT_BallDiameter );
|
||||
|
||||
@ -1618,6 +1619,7 @@ const char* SMESHGUI_FilterTable::getPrecision( const int aType )
|
||||
retval = "len_tol_precision"; break;
|
||||
case SMESH::FT_Length:
|
||||
case SMESH::FT_Length2D:
|
||||
case SMESH::FT_Length3D:
|
||||
case SMESH::FT_Deflection2D:
|
||||
case SMESH::FT_MaxElementLength2D:
|
||||
case SMESH::FT_MaxElementLength3D:
|
||||
@ -1830,6 +1832,7 @@ void SMESHGUI_FilterTable::onCriterionChanged (const int row, const int col, con
|
||||
|
||||
case SMESH::FT_Length:
|
||||
case SMESH::FT_Length2D:
|
||||
case SMESH::FT_Length3D:
|
||||
case SMESH::FT_Deflection2D: anIsDoubleCriterion = true; break;
|
||||
|
||||
case SMESH::FT_BelongToMeshGroup: break;
|
||||
@ -2270,6 +2273,7 @@ const QMap<int, QString>& SMESHGUI_FilterTable::getCriteria (const int theType)
|
||||
aCriteria[ SMESH::FT_BadOrientedVolume ] = tr("BAD_ORIENTED_VOLUME");
|
||||
aCriteria[ SMESH::FT_BareBorderVolume ] = tr("BARE_BORDER_VOLUME");
|
||||
aCriteria[ SMESH::FT_OverConstrainedVolume] = tr("OVER_CONSTRAINED_VOLUME");
|
||||
aCriteria[ SMESH::FT_Length3D ] = tr("LENGTH3D");
|
||||
aCriteria[ SMESH::FT_Volume3D ] = tr("VOLUME_3D");
|
||||
aCriteria[ SMESH::FT_MaxElementLength3D ] = tr("MAX_ELEMENT_LENGTH_3D");
|
||||
aCriteria[ SMESH::FT_LinearOrQuadratic ] = tr("LINEAR");
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -19,14 +19,12 @@
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
// File : SMESHGUI_MeshInfo.h
|
||||
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
|
||||
|
||||
#ifndef SMESHGUI_MESHINFO_H
|
||||
#define SMESHGUI_MESHINFO_H
|
||||
|
||||
#include "SMESH_SMESHGUI.hxx"
|
||||
#include "SMESH_ControlsDef.hxx"
|
||||
#include "SMESHGUI_SelectionProxy.h"
|
||||
|
||||
#ifndef DISABLE_PLOT2DVIEWER
|
||||
#include <Plot2d_Histogram.h>
|
||||
@ -34,17 +32,12 @@
|
||||
#include <qwt_plot.h>
|
||||
#endif
|
||||
|
||||
#include <QFrame>
|
||||
#include <QDialog>
|
||||
#include <QList>
|
||||
#include <QMap>
|
||||
#include <QSet>
|
||||
#include <QTreeWidget>
|
||||
#include <QVector>
|
||||
|
||||
#include <SALOMEconfig.h>
|
||||
#include CORBA_SERVER_HEADER(SMESH_Mesh)
|
||||
#include CORBA_SERVER_HEADER(SMESH_Group)
|
||||
#include CORBA_SERVER_HEADER(SMESH_Filter)
|
||||
|
||||
#include <SALOME_InteractiveObject.hxx>
|
||||
@ -54,51 +47,65 @@ class QAbstractButton;
|
||||
class QButtonGroup;
|
||||
class QCheckBox;
|
||||
class QContextMenuEvent;
|
||||
class QGridLayout;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QPushButton;
|
||||
class QTabWidget;
|
||||
class QTextBrowser;
|
||||
class QTreeWidget;
|
||||
class QTreeWidgetItem;
|
||||
class SMDS_MeshElement;
|
||||
class SMDS_MeshNode;
|
||||
class SMESHGUI_IdPreview;
|
||||
class SMESHGUI_SpinBox;
|
||||
class SMESH_Actor;
|
||||
|
||||
class ExtraWidget;
|
||||
class GroupCombo;
|
||||
class InfoWriter;
|
||||
|
||||
class SMESHGUI_EXPORT SMESHGUI_MeshInfo : public QFrame
|
||||
class SMESHGUI_EXPORT SMESHGUI_Info : public QWidget
|
||||
{
|
||||
public:
|
||||
SMESHGUI_Info( QWidget* = 0 );
|
||||
virtual void saveInfo( QTextStream& ) = 0;
|
||||
};
|
||||
|
||||
class SMESHGUI_EXPORT SMESHGUI_BaseInfo : public SMESHGUI_Info
|
||||
{
|
||||
Q_OBJECT;
|
||||
|
||||
enum {
|
||||
iName,
|
||||
enum
|
||||
{
|
||||
iStart,
|
||||
iObjectStart = iStart,
|
||||
iName = iObjectStart,
|
||||
iObject,
|
||||
iNodesStart,
|
||||
iObjectEnd,
|
||||
iNodesStart = iObjectEnd,
|
||||
iNodes,
|
||||
iNodesEnd,
|
||||
iElementsStart = iNodesEnd,
|
||||
iElements,
|
||||
iNbStart,
|
||||
iNb,
|
||||
iNbEnd,
|
||||
i0DStart = iNbEnd,
|
||||
iElementsStart = iNodesEnd,
|
||||
iElementsTitleStart = iElementsStart,
|
||||
iElementsTitle,
|
||||
iElementsTitleEnd,
|
||||
iElementsTotalStart = iElementsTitleEnd,
|
||||
iElementsTotal,
|
||||
iElementsTotalEnd,
|
||||
i0DStart = iElementsTotalEnd,
|
||||
i0D,
|
||||
i0DEnd,
|
||||
iBallsStart = i0DEnd,
|
||||
iBalls,
|
||||
iBallsEnd,
|
||||
i1DStart = iBallsEnd,
|
||||
i1DStart = iBallsEnd,
|
||||
i1D,
|
||||
i1DEnd,
|
||||
i2DStart = i1DEnd,
|
||||
i2DStart = i1DEnd,
|
||||
i2D,
|
||||
i2DTriangles,
|
||||
i2DQuadrangles,
|
||||
i2DPolygons,
|
||||
i2DEnd,
|
||||
i3DStart = i2DEnd,
|
||||
i3DStart = i2DEnd,
|
||||
i3D,
|
||||
i3DTetrahedrons,
|
||||
i3DHexahedrons,
|
||||
@ -107,45 +114,49 @@ class SMESHGUI_EXPORT SMESHGUI_MeshInfo : public QFrame
|
||||
i3DHexaPrisms,
|
||||
i3DPolyhedrons,
|
||||
i3DEnd,
|
||||
iElementsEnd = i3DEnd
|
||||
iElementsEnd = i3DEnd,
|
||||
iEnd,
|
||||
iOther = iEnd
|
||||
};
|
||||
|
||||
enum {
|
||||
iSingle = 1,
|
||||
iTotal = iSingle,
|
||||
enum
|
||||
{
|
||||
iLabel,
|
||||
iSingle,
|
||||
iTotal = iSingle,
|
||||
iLinear,
|
||||
iQuadratic,
|
||||
iBiQuadratic
|
||||
iBiQuadratic,
|
||||
iNbColumns
|
||||
};
|
||||
|
||||
typedef QList<QWidget*> wlist;
|
||||
typedef QVector<wlist> iwlist;
|
||||
typedef QMap<int, QWidget*> wlist;
|
||||
typedef QMap<int, wlist> iwlist;
|
||||
|
||||
public:
|
||||
SMESHGUI_MeshInfo( QWidget* = 0 );
|
||||
~SMESHGUI_MeshInfo();
|
||||
SMESHGUI_BaseInfo( QWidget* = 0 );
|
||||
~SMESHGUI_BaseInfo();
|
||||
|
||||
void showInfo( SMESH::SMESH_IDSource_ptr );
|
||||
void clear();
|
||||
void saveInfo( QTextStream &out );
|
||||
void showInfo( const SMESH::SelectionProxy& );
|
||||
void clear();
|
||||
void saveInfo( QTextStream& );
|
||||
|
||||
private:
|
||||
enum { Bold = 0x01, Italic = 0x02 };
|
||||
|
||||
QLabel* createField();
|
||||
QWidget* createLine();
|
||||
void setFontAttributes( QWidget*, int, bool = true );
|
||||
void setFieldsVisible( int, int, bool );
|
||||
QWidget* addWidget( QWidget*, int, int, int = 1 );
|
||||
QWidget* widget( int, int ) const;
|
||||
QString value( int, int ) const;
|
||||
void setFieldsVisible( int, int, bool );
|
||||
|
||||
private slots:
|
||||
void updateInfo();
|
||||
void loadMesh();
|
||||
|
||||
private:
|
||||
iwlist myWidgets;
|
||||
QPushButton* myLoadBtn;
|
||||
iwlist myWidgets;
|
||||
SMESH::SelectionProxy myProxy;
|
||||
};
|
||||
|
||||
class SMESHGUI_EXPORT SMESHGUI_ElemInfo : public QWidget
|
||||
class SMESHGUI_EXPORT SMESHGUI_ElemInfo : public SMESHGUI_Info
|
||||
{
|
||||
Q_OBJECT;
|
||||
|
||||
@ -153,74 +164,60 @@ public:
|
||||
SMESHGUI_ElemInfo( QWidget* = 0 );
|
||||
~SMESHGUI_ElemInfo();
|
||||
|
||||
void setSource( SMESH_Actor*, SMESH::SMESH_IDSource_var );
|
||||
void showInfo( long, bool );
|
||||
void showInfo( QSet<long>, bool );
|
||||
void clear();
|
||||
virtual void saveInfo( QTextStream &out ) = 0;
|
||||
|
||||
gp_XYZ getGravityCenter( const SMDS_MeshElement* e ) { return gravityCenter(e); }
|
||||
void showInfo( const SMESH::SelectionProxy&, uint, bool );
|
||||
void showInfo( const SMESH::SelectionProxy&, QSet<uint>, bool );
|
||||
void showInfo( const SMESH::SelectionProxy& );
|
||||
void clear();
|
||||
void saveInfo( QTextStream& );
|
||||
|
||||
protected:
|
||||
struct XYZ
|
||||
{
|
||||
double myX, myY, myZ;
|
||||
XYZ() { myX = myY = myZ = 0.0; }
|
||||
XYZ(double x, double y, double z) { myX = x; myY = y; myZ = z; }
|
||||
void add( double x, double y, double z ) { myX += x; myY += y; myZ += z; }
|
||||
void divide( double a ) { if ( a != 0.) { myX /= a; myY /= a; myZ /= a; } }
|
||||
double x() const { return myX; }
|
||||
double y() const { return myY; }
|
||||
double z() const { return myZ; }
|
||||
operator gp_XYZ() const { return gp_XYZ( myX, myY, myZ ); }
|
||||
};
|
||||
typedef QMap< int, QList<int> > Connectivity;
|
||||
enum { ShowNone, ShowNodes, ShowElements };
|
||||
|
||||
QWidget* frame() const;
|
||||
SMESH_Actor* actor() const;
|
||||
bool isElements() const;
|
||||
bool hasShapeToMesh() const { return myMeshHasShape; }
|
||||
QWidget* centralWidget() const;
|
||||
|
||||
virtual void information( const QList<long>& ) = 0;
|
||||
SMESH::SelectionProxy proxy() const;
|
||||
int what() const;
|
||||
|
||||
QString type2str( int, bool = false );
|
||||
QString stype2str( int );
|
||||
QString etype2str( int );
|
||||
QString ctrl2str( int );
|
||||
void writeInfo( InfoWriter*, const QList<uint>& );
|
||||
virtual void information( const QList<uint>& ) = 0;
|
||||
virtual void clearInternal();
|
||||
|
||||
Connectivity nodeConnectivity( const SMDS_MeshNode* );
|
||||
QString formatConnectivity( Connectivity, int );
|
||||
XYZ gravityCenter( const SMDS_MeshElement* );
|
||||
XYZ normal( const SMDS_MeshElement* );
|
||||
|
||||
signals:
|
||||
void itemInfo( int );
|
||||
void itemInfo( const QString& );
|
||||
void itemInfo( int type, const QString& ids );
|
||||
|
||||
private slots:
|
||||
void showPrevious();
|
||||
void showNext();
|
||||
void updateControls();
|
||||
void showPrevious();
|
||||
void showNext();
|
||||
void updateControls();
|
||||
|
||||
private:
|
||||
SMESH_Actor* myActor;
|
||||
QList<long> myIDs;
|
||||
int myIsElement;
|
||||
QWidget* myFrame;
|
||||
ExtraWidget* myExtra;
|
||||
int myIndex;
|
||||
bool myMeshHasShape;
|
||||
QWidget* myFrame;
|
||||
ExtraWidget* myExtra;
|
||||
SMESH::SelectionProxy myProxy;
|
||||
int myWhat;
|
||||
QList<uint> myIDs;
|
||||
int myIndex;
|
||||
};
|
||||
|
||||
class SMESHGUI_EXPORT SMESHGUI_SimpleElemInfo : public SMESHGUI_ElemInfo
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
SMESHGUI_SimpleElemInfo( QWidget* = 0 );
|
||||
void saveInfo( QTextStream &out );
|
||||
|
||||
protected:
|
||||
void information( const QList<long>& );
|
||||
void clearInternal();
|
||||
void information( const QList<uint>& );
|
||||
void clearInternal();
|
||||
|
||||
private:
|
||||
private slots:
|
||||
void connectivityClicked(const QUrl &);
|
||||
|
||||
private:
|
||||
QTextBrowser* myInfo;
|
||||
};
|
||||
|
||||
@ -229,85 +226,86 @@ class SMESHGUI_EXPORT SMESHGUI_TreeElemInfo : public SMESHGUI_ElemInfo
|
||||
Q_OBJECT;
|
||||
|
||||
class ItemDelegate;
|
||||
|
||||
enum { Bold = 0x01, All = 0x80 };
|
||||
class ItemCreator;
|
||||
|
||||
public:
|
||||
SMESHGUI_TreeElemInfo( QWidget* = 0 );
|
||||
void saveInfo( QTextStream &out );
|
||||
|
||||
protected:
|
||||
void contextMenuEvent( QContextMenuEvent* e );
|
||||
void information( const QList<long>& );
|
||||
void nodeInfo( const SMDS_MeshNode*, int, int, QTreeWidgetItem* );
|
||||
void clearInternal();
|
||||
void contextMenuEvent( QContextMenuEvent* );
|
||||
void information( const QList<uint>& );
|
||||
void nodeInfo( const SMDS_MeshNode*, int, int, QTreeWidgetItem* );
|
||||
void clearInternal();
|
||||
|
||||
private slots:
|
||||
void itemDoubleClicked( QTreeWidgetItem*, int );
|
||||
void saveExpanded( QTreeWidgetItem* );
|
||||
|
||||
void itemDoubleClicked( QTreeWidgetItem*, int );
|
||||
void saveExpanded( QTreeWidgetItem* );
|
||||
|
||||
private:
|
||||
QTreeWidgetItem* createItem( QTreeWidgetItem* = 0, int = 0 );
|
||||
QString expandedResource( QTreeWidgetItem* );
|
||||
|
||||
private:
|
||||
QTreeWidget* myInfo;
|
||||
QTreeWidget* myInfo;
|
||||
};
|
||||
|
||||
class GrpComputor: public QObject
|
||||
class InfoComputor: public QObject
|
||||
{
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
GrpComputor( SMESH::SMESH_GroupBase_ptr, QTreeWidgetItem*, QObject*, bool = false);
|
||||
QTreeWidgetItem* getItem() { return myItem; }
|
||||
enum { GrpSize, GrpNbNodes };
|
||||
|
||||
InfoComputor( QObject*, const SMESH::SelectionProxy&, int );
|
||||
|
||||
signals:
|
||||
void computed();
|
||||
|
||||
public slots:
|
||||
void compute();
|
||||
|
||||
private:
|
||||
SMESH::SMESH_GroupBase_var myGroup;
|
||||
QTreeWidgetItem* myItem;
|
||||
bool myToComputeSize;
|
||||
SMESH::SelectionProxy myProxy;
|
||||
int myOperation;
|
||||
};
|
||||
|
||||
class SMESHGUI_EXPORT SMESHGUI_AddInfo : public QTreeWidget
|
||||
class SMESHGUI_EXPORT SMESHGUI_AddInfo : public SMESHGUI_Info
|
||||
{
|
||||
Q_OBJECT;
|
||||
|
||||
enum { Bold = 0x01, All = 0x80 };
|
||||
|
||||
public:
|
||||
SMESHGUI_AddInfo( QWidget* = 0 );
|
||||
~SMESHGUI_AddInfo();
|
||||
|
||||
void showInfo( SMESH::SMESH_IDSource_ptr );
|
||||
// void clear();
|
||||
void saveInfo( QTextStream &out );
|
||||
void showInfo( const SMESH::SelectionProxy& );
|
||||
void clear();
|
||||
void saveInfo( QTextStream& );
|
||||
|
||||
private slots:
|
||||
void changeLoadToCompute();
|
||||
void showPreviousGroups();
|
||||
void showNextGroups();
|
||||
void showPreviousSubMeshes();
|
||||
void showNextSubMeshes();
|
||||
void updateInfo();
|
||||
void showPreviousGroups();
|
||||
void showNextGroups();
|
||||
void showPreviousSubMeshes();
|
||||
void showNextSubMeshes();
|
||||
|
||||
private:
|
||||
QTreeWidgetItem* createItem( QTreeWidgetItem* = 0, int = 0 );
|
||||
void meshInfo( SMESH::SMESH_Mesh_ptr, QTreeWidgetItem* );
|
||||
void subMeshInfo( SMESH::SMESH_subMesh_ptr, QTreeWidgetItem* );
|
||||
void groupInfo( SMESH::SMESH_GroupBase_ptr, QTreeWidgetItem* );
|
||||
void meshInfo( const SMESH::SelectionProxy&, QTreeWidgetItem* );
|
||||
void subMeshInfo( const SMESH::SelectionProxy&, QTreeWidgetItem* );
|
||||
void groupInfo( const SMESH::SelectionProxy&, QTreeWidgetItem* );
|
||||
|
||||
void showGroups();
|
||||
void showSubMeshes();
|
||||
void showGroups();
|
||||
void showSubMeshes();
|
||||
|
||||
private:
|
||||
QList<GrpComputor*> myComputors;
|
||||
SMESH::ListOfGroups_var myGroups;
|
||||
SMESH::submesh_array_var mySubMeshes;
|
||||
SMESH::SelectionProxy myProxy;
|
||||
QTreeWidget* myTree;
|
||||
QList<InfoComputor*> myComputors;
|
||||
QList<SMESH::SelectionProxy> myGroups;
|
||||
QList<SMESH::SelectionProxy> mySubMeshes;
|
||||
};
|
||||
|
||||
class SMESHGUI_EXPORT SMESHGUI_CtrlInfo : public QFrame
|
||||
class SMESHGUI_EXPORT SMESHGUI_CtrlInfo : public SMESHGUI_Info
|
||||
{
|
||||
Q_OBJECT;
|
||||
|
||||
@ -315,62 +313,59 @@ public:
|
||||
SMESHGUI_CtrlInfo( QWidget* = 0 );
|
||||
~SMESHGUI_CtrlInfo();
|
||||
|
||||
void showInfo( SMESH::SMESH_IDSource_ptr );
|
||||
void saveInfo( QTextStream &out );
|
||||
void showInfo( const SMESH::SelectionProxy& );
|
||||
void saveInfo( QTextStream& );
|
||||
|
||||
private:
|
||||
enum ObjectType { Mesh, SubMesh, Group };
|
||||
QLabel* createField();
|
||||
QwtPlot* createPlot( QWidget* );
|
||||
void setFontAttributes( QWidget* );
|
||||
void clearInternal();
|
||||
QwtPlot* createPlot( QWidget* );
|
||||
void clearInternal();
|
||||
#ifndef DISABLE_PLOT2DVIEWER
|
||||
Plot2d_Histogram* getHistogram( SMESH::NumericalFunctor_ptr functor );
|
||||
Plot2d_Histogram* getHistogram( SMESH::NumericalFunctor_ptr );
|
||||
#endif
|
||||
void computeNb( int ft, int iBut, int iWdg );
|
||||
void computeNb( int, int, int );
|
||||
|
||||
private slots:
|
||||
void computeAspectRatio();
|
||||
void computeAspectRatio3D();
|
||||
void computeFreeNodesInfo();
|
||||
void computeNodesNbConnInfo();
|
||||
void computeDoubleNodesInfo();
|
||||
void computeDoubleEdgesInfo();
|
||||
void computeDoubleFacesInfo();
|
||||
void computeOverConstrainedFacesInfo();
|
||||
void computeDoubleVolumesInfo();
|
||||
void computeOverConstrainedVolumesInfo();
|
||||
void setTolerance( const double theTolerance );
|
||||
|
||||
void computeAspectRatio();
|
||||
void computeAspectRatio3D();
|
||||
void computeFreeNodesInfo();
|
||||
void computeNodesNbConnInfo();
|
||||
void computeDoubleNodesInfo();
|
||||
void computeDoubleEdgesInfo();
|
||||
void computeDoubleFacesInfo();
|
||||
void computeOverConstrainedFacesInfo();
|
||||
void computeDoubleVolumesInfo();
|
||||
void computeOverConstrainedVolumesInfo();
|
||||
void setTolerance( double );
|
||||
|
||||
private:
|
||||
typedef SALOME::GenericObj_wrap< SMESH::Predicate > TPredicate;
|
||||
typedef SALOME::GenericObj_wrap< SMESH::Predicate > TPredicate;
|
||||
typedef SALOME::GenericObj_wrap< SMESH::NumericalFunctor > TNumFunctor;
|
||||
SMESH::SMESH_IDSource_var myObject;
|
||||
ObjectType myObjectType;
|
||||
SMESHGUI_SpinBox* myToleranceWidget;
|
||||
QList<QLabel*> myWidgets;
|
||||
QGridLayout* myMainLayout;
|
||||
QwtPlot* myPlot;
|
||||
QwtPlot* myPlot3D;
|
||||
QList<QAbstractButton*> myButtons;
|
||||
QList<TPredicate> myPredicates;
|
||||
TNumFunctor myAspectRatio, myAspectRatio3D, myNodeConnFunctor;
|
||||
SMESH::SelectionProxy myProxy;
|
||||
ObjectType myObjectType;
|
||||
SMESHGUI_SpinBox* myToleranceWidget;
|
||||
QList<QLabel*> myWidgets;
|
||||
QwtPlot* myPlot;
|
||||
QwtPlot* myPlot3D;
|
||||
QList<QAbstractButton*> myButtons;
|
||||
QList<TPredicate> myPredicates;
|
||||
TNumFunctor myAspectRatio, myAspectRatio3D, myNodeConnFunctor;
|
||||
};
|
||||
|
||||
class SMESHGUI_EXPORT SMESHGUI_MeshInfoDlg : public QDialog
|
||||
{
|
||||
Q_OBJECT;
|
||||
|
||||
enum { NodeMode, ElemMode };
|
||||
enum { NodeMode, ElemMode, GroupMode };
|
||||
|
||||
public:
|
||||
//! Information type
|
||||
enum {
|
||||
enum
|
||||
{
|
||||
BaseInfo, //!< base mesh information
|
||||
ElemInfo, //!< mesh element information
|
||||
AddInfo, //!< additional information
|
||||
CtrlInfo //!< controls information
|
||||
CtrlInfo //!< controls information
|
||||
};
|
||||
|
||||
SMESHGUI_MeshInfoDlg( QWidget* = 0, int = BaseInfo );
|
||||
@ -381,33 +376,35 @@ public:
|
||||
|
||||
protected:
|
||||
void keyPressEvent( QKeyEvent* );
|
||||
void enterEvent( QEvent* );
|
||||
|
||||
signals:
|
||||
void switchMode( int );
|
||||
|
||||
private slots:
|
||||
void help();
|
||||
void updateSelection();
|
||||
void updateInfo();
|
||||
void activate();
|
||||
void deactivate();
|
||||
void modeChanged();
|
||||
void idChanged();
|
||||
void idPreviewChange(bool);
|
||||
void showItemInfo( int );
|
||||
void showItemInfo( const QString& );
|
||||
void idPreviewChange( bool );
|
||||
void showItemInfo( int type, const QString& ids );
|
||||
void dump();
|
||||
|
||||
private:
|
||||
QTabWidget* myTabWidget;
|
||||
SMESHGUI_MeshInfo* myBaseInfo;
|
||||
QButtonGroup* myMode;
|
||||
QLineEdit* myID;
|
||||
QCheckBox* myIDPreviewCheck;
|
||||
SMESHGUI_IdPreview* myIDPreview;
|
||||
SMESHGUI_ElemInfo* myElemInfo;
|
||||
SMESHGUI_AddInfo* myAddInfo;
|
||||
SMESHGUI_CtrlInfo* myCtrlInfo;
|
||||
SMESH_Actor* myActor;
|
||||
Handle(SALOME_InteractiveObject) myIO;
|
||||
void showInfo( const SMESH::SelectionProxy& );
|
||||
|
||||
SMESH::SelectionProxy myProxy;
|
||||
QTabWidget* myTabWidget;
|
||||
SMESHGUI_BaseInfo* myBaseInfo;
|
||||
SMESHGUI_ElemInfo* myElemInfo;
|
||||
SMESHGUI_AddInfo* myAddInfo;
|
||||
SMESHGUI_CtrlInfo* myCtrlInfo;
|
||||
QButtonGroup* myMode;
|
||||
QLineEdit* myID;
|
||||
QCheckBox* myIDPreviewCheck;
|
||||
GroupCombo* myGroups;
|
||||
SMESHGUI_IdPreview* myIDPreview;
|
||||
};
|
||||
|
||||
class SMESHGUI_EXPORT SMESHGUI_CtrlInfoDlg : public QDialog
|
||||
@ -423,14 +420,16 @@ public:
|
||||
|
||||
private slots:
|
||||
void updateInfo();
|
||||
void activate();
|
||||
void deactivate();
|
||||
void updateSelection();
|
||||
void help();
|
||||
void dump();
|
||||
|
||||
private:
|
||||
SMESHGUI_CtrlInfo* myCtrlInfo;
|
||||
void showInfo( const SMESH::SelectionProxy& );
|
||||
|
||||
SMESH::SelectionProxy myProxy;
|
||||
SMESHGUI_CtrlInfo* myCtrlInfo;
|
||||
};
|
||||
|
||||
#endif // SMESHGUI_MESHINFO_H
|
||||
|
@ -1622,7 +1622,7 @@ SMESHGUI_SplitVolumesDlg::SMESHGUI_SplitVolumesDlg(SMESHGUI* theModule)
|
||||
}
|
||||
if ( myEntityTypeGrp )
|
||||
{
|
||||
myEntityTypeGrp->button(0)->setText( tr("SMESH_TETRAS"));
|
||||
myEntityTypeGrp->button(0)->setText( tr("SMESH_TETRAHEDRON"));
|
||||
myEntityTypeGrp->button(1)->setText( tr("SMESH_PRISM"));
|
||||
if ( QGroupBox* gb = qobject_cast< QGroupBox* >( myEntityTypeGrp->button(0)->parent() ))
|
||||
gb->setTitle( tr("TARGET_ELEM_TYPE"));
|
||||
|
1585
src/SMESHGUI/SMESHGUI_SelectionProxy.cxx
Normal file
1585
src/SMESHGUI/SMESHGUI_SelectionProxy.cxx
Normal file
File diff suppressed because it is too large
Load Diff
204
src/SMESHGUI/SMESHGUI_SelectionProxy.h
Normal file
204
src/SMESHGUI/SMESHGUI_SelectionProxy.h
Normal file
@ -0,0 +1,204 @@
|
||||
// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
#ifndef SMESHGUI_SELECTIONPROXY_H
|
||||
#define SMESHGUI_SELECTIONPROXY_H
|
||||
|
||||
#include "SMESH_SMESHGUI.hxx"
|
||||
|
||||
#include <SALOME_InteractiveObject.hxx>
|
||||
#include <SALOMEconfig.h>
|
||||
#include CORBA_SERVER_HEADER(SMESH_Mesh)
|
||||
#include CORBA_SERVER_HEADER(GEOM_Gen)
|
||||
|
||||
#include <QColor>
|
||||
#include <QList>
|
||||
#include <QMap>
|
||||
#include <QSet>
|
||||
#include <QString>
|
||||
|
||||
#include <gp_XYZ.hxx>
|
||||
|
||||
class SMESH_Actor;
|
||||
|
||||
namespace SMESH
|
||||
{
|
||||
class SMESHGUI_EXPORT MeshInfo
|
||||
{
|
||||
QMap<int, long> myInfo;
|
||||
public:
|
||||
MeshInfo();
|
||||
uint info( int ) const;
|
||||
uint operator[] ( int );
|
||||
uint count( int, int ) const;
|
||||
private:
|
||||
void addInfo( int, long );
|
||||
friend class SelectionProxy;
|
||||
};
|
||||
|
||||
class SMESHGUI_EXPORT MedInfo
|
||||
{
|
||||
QString myFileName;
|
||||
uint mySize;
|
||||
uint myMajor, myMinor, myRelease;
|
||||
public:
|
||||
MedInfo();
|
||||
bool isValid() const;
|
||||
QString fileName() const;
|
||||
uint size() const;
|
||||
QString version() const;
|
||||
private:
|
||||
void setFileName( const QString& );
|
||||
void setSize( uint );
|
||||
void setVersion( uint, uint, uint );
|
||||
friend class SelectionProxy;
|
||||
};
|
||||
|
||||
class SMESHGUI_EXPORT Position
|
||||
{
|
||||
int myShapeId;
|
||||
int myShapeType;
|
||||
double myU, myV;
|
||||
bool myHasU, myHasV;
|
||||
public:
|
||||
Position();
|
||||
bool isValid() const;
|
||||
int shapeId() const;
|
||||
int shapeType() const;
|
||||
bool hasU() const;
|
||||
double u() const;
|
||||
bool hasV() const;
|
||||
double v() const;
|
||||
private:
|
||||
void setShapeId( int );
|
||||
void setShapeType( int );
|
||||
void setU( double );
|
||||
void setV( double );
|
||||
friend class SelectionProxy;
|
||||
};
|
||||
|
||||
class XYZ
|
||||
{
|
||||
double myX, myY, myZ;
|
||||
public:
|
||||
XYZ();
|
||||
XYZ( double, double, double );
|
||||
XYZ( const gp_XYZ& );
|
||||
void add( double, double, double );
|
||||
void divide( double );
|
||||
double x() const;
|
||||
double y() const;
|
||||
double z() const;
|
||||
operator gp_XYZ() const;
|
||||
};
|
||||
|
||||
typedef QMap< int, QList<int> > Connectivity;
|
||||
|
||||
class SMESHGUI_EXPORT SelectionProxy
|
||||
{
|
||||
Handle(SALOME_InteractiveObject) myIO;
|
||||
SMESH::SMESH_IDSource_var myObject;
|
||||
SMESH_Actor* myActor;
|
||||
bool myDirty;
|
||||
|
||||
public:
|
||||
enum Type
|
||||
{
|
||||
Unknown,
|
||||
Mesh,
|
||||
Submesh,
|
||||
Group,
|
||||
GroupStd,
|
||||
GroupGeom,
|
||||
GroupFilter
|
||||
};
|
||||
|
||||
// construction
|
||||
SelectionProxy();
|
||||
SelectionProxy( const Handle(SALOME_InteractiveObject)& );
|
||||
SelectionProxy( SMESH::SMESH_IDSource_ptr );
|
||||
SelectionProxy( const SelectionProxy& );
|
||||
|
||||
SelectionProxy& operator= ( const SelectionProxy& );
|
||||
|
||||
// comparison
|
||||
bool operator== ( const SelectionProxy& );
|
||||
|
||||
// general purpose methods
|
||||
void refresh();
|
||||
|
||||
bool isNull() const;
|
||||
operator bool() const;
|
||||
|
||||
SMESH::SMESH_IDSource_ptr object() const;
|
||||
const Handle(SALOME_InteractiveObject)& io() const;
|
||||
SMESH_Actor* actor() const;
|
||||
|
||||
bool isValid() const;
|
||||
void load();
|
||||
|
||||
// methods common to all types of proxy
|
||||
QString name() const;
|
||||
Type type() const;
|
||||
MeshInfo meshInfo() const;
|
||||
SelectionProxy mesh() const;
|
||||
bool hasShapeToMesh() const;
|
||||
GEOM::GEOM_Object_ptr shape() const;
|
||||
QString shapeName() const;
|
||||
int shapeType() const;
|
||||
bool isMeshLoaded() const;
|
||||
|
||||
bool hasNode( int );
|
||||
bool nodeCoordinates( int, XYZ& );
|
||||
bool nodeConnectivity( int, Connectivity& );
|
||||
bool nodePosition( int, Position& );
|
||||
QList<SelectionProxy> nodeGroups( int ) const;
|
||||
|
||||
bool hasElement( int );
|
||||
SMESH::ElementType elementType( int ) const;
|
||||
int elementEntityType( int ) const;
|
||||
bool elementConnectivity( int, Connectivity& );
|
||||
bool perFaceConnectivity( int, Connectivity&, int& );
|
||||
bool elementPosition( int, Position& );
|
||||
bool elementGravityCenter( int, XYZ& );
|
||||
bool elementNormal( int, XYZ& );
|
||||
bool elementControl( int, int, double, double& ) const;
|
||||
QList<SelectionProxy> elementGroups( int ) const;
|
||||
|
||||
// methods that work for mesh only
|
||||
MedInfo medFileInfo() const;
|
||||
QList<SelectionProxy> submeshes() const;
|
||||
QList<SelectionProxy> groups() const;
|
||||
|
||||
// methods that work for group only
|
||||
SMESH::ElementType groupElementType() const;
|
||||
QColor color() const;
|
||||
int size( bool = false ) const;
|
||||
int nbNodes( bool = false ) const;
|
||||
QSet<uint> ids() const;
|
||||
|
||||
private:
|
||||
void init();
|
||||
};
|
||||
}
|
||||
|
||||
#endif // SMESHGUI_SELECTIONPROXY_H
|
@ -1940,7 +1940,7 @@ add the exported data to its contents?</translation>
|
||||
<translation>Height:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SMESH_HEXAS</source>
|
||||
<source>SMESH_HEXAHEDRON</source>
|
||||
<translation>Hexahedron</translation>
|
||||
</message>
|
||||
<message>
|
||||
@ -2790,7 +2790,7 @@ Check algorithm documentation for supported geometry</translation>
|
||||
<translation>Symmetry</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SMESH_TETRAS</source>
|
||||
<source>SMESH_TETRAHEDRON</source>
|
||||
<translation>Tetrahedron</translation>
|
||||
</message>
|
||||
<message>
|
||||
@ -4551,6 +4551,10 @@ It can't be deleted </translation>
|
||||
<source>SMESH_3D_ALGO_GROUP_ADVANCED</source>
|
||||
<translation>Advanced</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SMESH_HEX_PRISM</source>
|
||||
<translation>Hexagonal Prism</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SMESHGUI_FieldSelectorWdg</name>
|
||||
@ -5997,6 +6001,10 @@ Please enter correct value and try again</translation>
|
||||
<source>LENGTH2D</source>
|
||||
<translation>Length 2D</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>LENGTH3D</source>
|
||||
<translation>Length 3D</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>DEFLECTION2D</source>
|
||||
<translation>Deflection 2D</translation>
|
||||
@ -7442,7 +7450,7 @@ as they are of improper type:
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SMESHGUI_MeshInfo</name>
|
||||
<name>SMESHGUI_BaseInfo</name>
|
||||
<message>
|
||||
<source>BASE_INFO</source>
|
||||
<translation>Base information</translation>
|
||||
@ -7571,6 +7579,18 @@ as they are of improper type:
|
||||
<source>OBJECT_GROUP_BALLS</source>
|
||||
<translation>Group of balls</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>OBJECT_GROUP_STANDALONE</source>
|
||||
<translation>(standalone)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>OBJECT_GROUP_GEOM</source>
|
||||
<translation>(on geometry)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>OBJECT_GROUP_FILTER</source>
|
||||
<translation>(on filter)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>BUT_LOAD_MESH</source>
|
||||
<translation>Load mesh from server</translation>
|
||||
@ -7606,6 +7626,10 @@ as they are of improper type:
|
||||
<source>ELEM_MODE</source>
|
||||
<translation>Element</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>GROUP_MODE</source>
|
||||
<translation>Group</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SHOW_IDS</source>
|
||||
<translation>Show IDs</translation>
|
||||
@ -7637,6 +7661,10 @@ as they are of improper type:
|
||||
<source>COORDINATES</source>
|
||||
<translation>Coordinates</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>NB_NODES</source>
|
||||
<translation>Nb nodes</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>CONNECTIVITY</source>
|
||||
<translation>Connectivity</translation>
|
||||
@ -7935,6 +7963,18 @@ as they are of improper type:
|
||||
<source>FILE_NAME</source>
|
||||
<translation>File name</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>FILE_SIZE</source>
|
||||
<translation>Size</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>FILE_VERSION</source>
|
||||
<translation>Version</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>VERSION_UNKNOWN</source>
|
||||
<translation>Unknown</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>STANDALONE_MESH</source>
|
||||
<translation>Standalone</translation>
|
||||
|
@ -1919,7 +1919,7 @@ les données exportées ?</translation>
|
||||
<translation>Hauteur :</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SMESH_HEXAS</source>
|
||||
<source>SMESH_HEXAHEDRON</source>
|
||||
<translation>Hexaèdre</translation>
|
||||
</message>
|
||||
<message>
|
||||
@ -2765,7 +2765,7 @@ Référez-vous à la documentation sur l'algorithme et la géométrie suppo
|
||||
<translation>Symétrie</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SMESH_TETRAS</source>
|
||||
<source>SMESH_TETRAHEDRON</source>
|
||||
<translation>Tétraèdre</translation>
|
||||
</message>
|
||||
<message>
|
||||
@ -4519,6 +4519,10 @@ Il ne peut pas être supprimé.</translation>
|
||||
<source>SMESH_3D_ALGO_GROUP_ADVANCED</source>
|
||||
<translation>Avancé</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SMESH_HEX_PRISM</source>
|
||||
<translation>Prisme hexagonal</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SMESHGUI_FieldSelectorWdg</name>
|
||||
@ -7377,7 +7381,7 @@ en raison de leurs types incompatibles:
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SMESHGUI_MeshInfo</name>
|
||||
<name>SMESHGUI_BaseInfo</name>
|
||||
<message>
|
||||
<source>BASE_INFO</source>
|
||||
<translation>Informations de base</translation>
|
||||
@ -7506,6 +7510,18 @@ en raison de leurs types incompatibles:
|
||||
<source>OBJECT_GROUP_BALLS</source>
|
||||
<translation>Groupe d'éléments particulaires</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>OBJECT_GROUP_STANDALONE</source>
|
||||
<translation>(autonome)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>OBJECT_GROUP_GEOM</source>
|
||||
<translation>(lié à une géométrie)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>OBJECT_GROUP_FILTER</source>
|
||||
<translation>(lié à un filtre)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>BUT_LOAD_MESH</source>
|
||||
<translation>Charger un maillage depuis un serveur</translation>
|
||||
@ -7541,6 +7557,10 @@ en raison de leurs types incompatibles:
|
||||
<source>ELEM_MODE</source>
|
||||
<translation>Elément</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>GROUP_MODE</source>
|
||||
<translation>Groupe</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SHOW_IDS</source>
|
||||
<translation>Montre les IDs</translation>
|
||||
@ -7870,6 +7890,14 @@ en raison de leurs types incompatibles:
|
||||
<source>FILE_NAME</source>
|
||||
<translation>Nom du fichier</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>FILE_SIZE</source>
|
||||
<translation>Taille du fichier</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>FILE_VERSION</source>
|
||||
<translation>Format du fichier</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>STANDALONE_MESH</source>
|
||||
<translation>Autonome</translation>
|
||||
|
@ -1868,7 +1868,7 @@
|
||||
<translation>高さ:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SMESH_HEXAS</source>
|
||||
<source>SMESH_HEXAHEDRON</source>
|
||||
<translation>六面体</translation>
|
||||
</message>
|
||||
<message>
|
||||
@ -2704,7 +2704,7 @@
|
||||
<translation>オブジェクトの反転</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SMESH_TETRAS</source>
|
||||
<source>SMESH_TETRAHEDRON</source>
|
||||
<translation>四面体</translation>
|
||||
</message>
|
||||
<message>
|
||||
@ -4427,6 +4427,10 @@
|
||||
<source>SMESH_3D_ALGO_GROUP_ADVANCED</source>
|
||||
<translation>アドバンス</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SMESH_HEX_PRISM</source>
|
||||
<translation>六角形プリズム</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SMESHGUI_FieldSelectorWdg</name>
|
||||
@ -7202,7 +7206,7 @@
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SMESHGUI_MeshInfo</name>
|
||||
<name>SMESHGUI_BaseInfo</name>
|
||||
<message>
|
||||
<source>BASE_INFO</source>
|
||||
<translation>基本情報</translation>
|
||||
@ -7331,6 +7335,18 @@
|
||||
<source>OBJECT_GROUP_BALLS</source>
|
||||
<translation>粒子状物質の要素のグループ</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>OBJECT_GROUP_STANDALONE</source>
|
||||
<translation type="unfinished">(standalone)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>OBJECT_GROUP_GEOM</source>
|
||||
<translation type="unfinished">(on geometry)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>OBJECT_GROUP_FILTER</source>
|
||||
<translation type="unfinished">(on filter)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>BUT_LOAD_MESH</source>
|
||||
<translation>サーバーからメッシュをロード</translation>
|
||||
@ -7366,6 +7382,10 @@
|
||||
<source>ELEM_MODE</source>
|
||||
<translation>要素</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>GROUP_MODE</source>
|
||||
<translation type="unfinished">Group</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SHOW_IDS</source>
|
||||
<translation>IDの表示</translation>
|
||||
@ -7695,6 +7715,14 @@
|
||||
<source>FILE_NAME</source>
|
||||
<translation>ファイルの名前</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>FILE_SIZE</source>
|
||||
<translation type="unfinished">Size</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>FILE_VERSION</source>
|
||||
<translation type="unfinished">Version</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>STANDALONE_MESH</source>
|
||||
<translation>自律</translation>
|
||||
|
@ -217,6 +217,11 @@ CORBA::Double NumericalFunctor_i::GetValue( CORBA::Long theId )
|
||||
return myNumericalFunctorPtr->GetValue( theId );
|
||||
}
|
||||
|
||||
CORBA::Boolean NumericalFunctor_i::IsApplicable( CORBA::Long theElementId )
|
||||
{
|
||||
return myNumericalFunctorPtr->IsApplicable( theElementId );
|
||||
}
|
||||
|
||||
SMESH::Histogram* NumericalFunctor_i::GetHistogram(CORBA::Short nbIntervals, CORBA::Boolean isLogarithmic)
|
||||
{
|
||||
std::vector<int> nbEvents;
|
||||
@ -521,6 +526,46 @@ SMESH::Length2D::Values* Length2D_i::GetValues()
|
||||
return aResult._retn();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Class : Length3D_i
|
||||
Description : Functor for calculating length of edge
|
||||
*/
|
||||
Length3D_i::Length3D_i()
|
||||
{
|
||||
myNumericalFunctorPtr.reset( new Controls::Length3D() );
|
||||
myFunctorPtr = myNumericalFunctorPtr;
|
||||
}
|
||||
|
||||
FunctorType Length3D_i::GetFunctorType()
|
||||
{
|
||||
return SMESH::FT_Length3D;
|
||||
}
|
||||
|
||||
// SMESH::Length3D::Values* Length3D_i::GetValues()
|
||||
// {
|
||||
// SMESH::Controls::Length3D::TValues aValues;
|
||||
// (dynamic_cast<SMESH::Controls::Length3D*>(myFunctorPtr.get()))->GetValues( aValues );
|
||||
|
||||
// long i = 0, iEnd = aValues.size();
|
||||
|
||||
// SMESH::Length3D::Values_var aResult = new SMESH::Length3D::Values(iEnd);
|
||||
// aResult->length(iEnd);
|
||||
|
||||
// SMESH::Controls::Length3D::TValues::const_iterator anIter;
|
||||
// for ( anIter = aValues.begin() ; anIter != aValues.end(); anIter++, i++ )
|
||||
// {
|
||||
// const SMESH::Controls::Length3D::Value& aVal = *anIter;
|
||||
// SMESH::Length3D::Value &aValue = aResult[ i ];
|
||||
|
||||
// aValue.myLength = aVal.myLength;
|
||||
// aValue.myPnt1 = aVal.myPntId[ 0 ];
|
||||
// aValue.myPnt2 = aVal.myPntId[ 1 ];
|
||||
// }
|
||||
|
||||
// return aResult._retn();
|
||||
// }
|
||||
|
||||
/*
|
||||
Class : Deflection2D_i
|
||||
Description : Functor for calculating distance between a face and geometry
|
||||
@ -2107,11 +2152,19 @@ Length2D_ptr FilterManager_i::CreateLength2D()
|
||||
return anObj._retn();
|
||||
}
|
||||
|
||||
Length3D_ptr FilterManager_i::CreateLength3D()
|
||||
{
|
||||
SMESH::Length3D_i* aServant = new SMESH::Length3D_i();
|
||||
SMESH::Length3D_var anObj = aServant->_this();
|
||||
TPythonDump()<<aServant<<" = "<<this<<".CreateLength3D()";
|
||||
return anObj._retn();
|
||||
}
|
||||
|
||||
Deflection2D_ptr FilterManager_i::CreateDeflection2D()
|
||||
{
|
||||
SMESH::Deflection2D_i* aServant = new SMESH::Deflection2D_i();
|
||||
SMESH::Deflection2D_var anObj = aServant->_this();
|
||||
TPythonDump()<<aServant<<" = "<<this<<".CreateLength2D()";
|
||||
TPythonDump()<<aServant<<" = "<<this<<".CreateDeflection2D()";
|
||||
return anObj._retn();
|
||||
}
|
||||
|
||||
@ -2988,6 +3041,9 @@ CORBA::Boolean Filter_i::SetCriteria( const SMESH::Filter::Criteria& theCriteria
|
||||
case SMESH::FT_Length2D:
|
||||
aFunctor = aFilterMgr->CreateLength2D();
|
||||
break;
|
||||
case SMESH::FT_Length3D:
|
||||
aFunctor = aFilterMgr->CreateLength3D();
|
||||
break;
|
||||
case SMESH::FT_Deflection2D:
|
||||
aFunctor = aFilterMgr->CreateDeflection2D();
|
||||
break;
|
||||
@ -3489,6 +3545,7 @@ static inline LDOMString toString( CORBA::Long theType )
|
||||
case FT_MultiConnection2D : return "Borders at multi-connections 2D";
|
||||
case FT_Length : return "Length";
|
||||
case FT_Length2D : return "Length 2D";
|
||||
case FT_Length3D : return "Length 3D";
|
||||
case FT_Deflection2D : return "Deflection 2D";
|
||||
case FT_LessThan : return "Less than";
|
||||
case FT_MoreThan : return "More than";
|
||||
@ -3538,6 +3595,7 @@ static inline SMESH::FunctorType toFunctorType( const LDOMString& theStr )
|
||||
// else if ( theStr.equals( "Borders at multi-connections 2D" ) ) return FT_MultiConnection2D;
|
||||
else if ( theStr.equals( "Length" ) ) return FT_Length;
|
||||
// else if ( theStr.equals( "Length2D" ) ) return FT_Length2D;
|
||||
// else if ( theStr.equals( "Length3D" ) ) return FT_Length3D;
|
||||
else if ( theStr.equals( "Deflection" ) ) return FT_Deflection2D;
|
||||
else if ( theStr.equals( "Range of IDs" ) ) return FT_RangeOfIds;
|
||||
else if ( theStr.equals( "Bad Oriented Volume" ) ) return FT_BadOrientedVolume;
|
||||
@ -4104,6 +4162,7 @@ static const char** getFunctNames()
|
||||
"FT_MultiConnection2D",
|
||||
"FT_Length",
|
||||
"FT_Length2D",
|
||||
"FT_Length3D",
|
||||
"FT_Deflection2D",
|
||||
"FT_NodeConnectivityNumber",
|
||||
"FT_BelongToMeshGroup",
|
||||
|
@ -99,6 +99,7 @@ namespace SMESH
|
||||
{
|
||||
public:
|
||||
CORBA::Double GetValue( CORBA::Long theElementId );
|
||||
CORBA::Boolean IsApplicable( CORBA::Long theElementId );
|
||||
SMESH::Histogram* GetHistogram(CORBA::Short nbIntervals,
|
||||
CORBA::Boolean isLogarithmic);
|
||||
SMESH::Histogram* GetLocalHistogram(CORBA::Short nbIntervals,
|
||||
@ -271,6 +272,22 @@ namespace SMESH
|
||||
Controls::Length2DPtr myLength2DPtr;
|
||||
};
|
||||
|
||||
/*
|
||||
Class : Length3D_i
|
||||
Description : Functor for calculating length of edge
|
||||
*/
|
||||
class SMESH_I_EXPORT Length3D_i: public virtual POA_SMESH::Length3D,
|
||||
public virtual NumericalFunctor_i
|
||||
{
|
||||
public:
|
||||
Length3D_i();
|
||||
//SMESH::Length2D::Values* GetValues();
|
||||
FunctorType GetFunctorType();
|
||||
|
||||
protected:
|
||||
Controls::Length3DPtr myLength3DPtr;
|
||||
};
|
||||
|
||||
/*
|
||||
Class : Deflection2D_i
|
||||
Description : Functor for calculating distance between a face and geometry
|
||||
@ -1103,6 +1120,7 @@ namespace SMESH
|
||||
MaxElementLength3D_ptr CreateMaxElementLength3D();
|
||||
Length_ptr CreateLength();
|
||||
Length2D_ptr CreateLength2D();
|
||||
Length3D_ptr CreateLength3D();
|
||||
Deflection2D_ptr CreateDeflection2D();
|
||||
NodeConnectivityNumber_ptr CreateNodeConnectivityNumber();
|
||||
MultiConnection_ptr CreateMultiConnection();
|
||||
|
@ -4720,8 +4720,9 @@ SMESH::long_array* SMESH_Mesh_i::GetElemNodes(const CORBA::Long id)
|
||||
if ( const SMDS_MeshElement* elem = aMeshDS->FindElement(id) )
|
||||
{
|
||||
aResult->length( elem->NbNodes() );
|
||||
for ( int i = 0; i < elem->NbNodes(); ++i )
|
||||
aResult[ i ] = elem->GetNode( i )->GetID();
|
||||
for ( CORBA::ULong i = 0; i < aResult->length(); ++i )
|
||||
if ( const SMDS_MeshNode* n = elem->GetNode( i ))
|
||||
aResult[ i ] = n->GetID();
|
||||
}
|
||||
}
|
||||
return aResult._retn();
|
||||
@ -4837,7 +4838,7 @@ SMESH::long_array* SMESH_Mesh_i::GetElemFaceNodes(CORBA::Long elemId,
|
||||
{
|
||||
if ( const SMDS_MeshElement* elem = aMeshDS->FindElement(elemId) )
|
||||
{
|
||||
SMDS_VolumeTool vtool( elem );
|
||||
SMDS_VolumeTool vtool( elem, /*skipCentralNodes = */false );
|
||||
if ( faceIndex < vtool.NbFaces() )
|
||||
{
|
||||
aResult->length( vtool.NbFaceNodes( faceIndex ));
|
||||
|
@ -426,6 +426,7 @@ namespace SMESH
|
||||
case FT_MultiConnection2D: myStream<< "aMultiConnection2D"; break;
|
||||
case FT_Length: myStream<< "aLength"; break;
|
||||
case FT_Length2D: myStream<< "aLength2D"; break;
|
||||
case FT_Length3D: myStream<< "aLength3D"; break;
|
||||
case FT_Deflection2D: myStream<< "aDeflection2D"; break;
|
||||
case FT_NodeConnectivityNumber:myStream<< "aNodeConnectivityNumber";break;
|
||||
case FT_BelongToMeshGroup: myStream<< "aBelongToMeshGroup"; break;
|
||||
|
Loading…
Reference in New Issue
Block a user