This commit is contained in:
eap 2012-12-28 16:30:38 +00:00
parent e9bec6bddf
commit 752ad5bd14
20 changed files with 1504 additions and 1504 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,21 +1,21 @@
/*----------------------------------------------------------*/
/* */
/* LIBMESH V 5.46 */
/* */
/* */
/* LIBMESH V 5.46 */
/* */
/*----------------------------------------------------------*/
/* */
/* Description: handle .meshb file format I/O */
/* Author: Loic MARECHAL */
/* Creation date: feb 16 2007 */
/* Last modification: dec 09 2011 */
/* */
/* */
/* Description: handle .meshb file format I/O */
/* Author: Loic MARECHAL */
/* Creation date: feb 16 2007 */
/* Last modification: dec 09 2011 */
/* */
/*----------------------------------------------------------*/
/*----------------------------------------------------------*/
/* Defines */
/* Defines */
/*----------------------------------------------------------*/
#include "SMESH_DriverGMF.hxx"
@ -35,92 +35,92 @@
enum GmfKwdCod
{
GmfReserved1, \
GmfVersionFormatted, \
GmfReserved2, \
GmfDimension, \
GmfVertices, \
GmfEdges, \
GmfTriangles, \
GmfQuadrilaterals, \
GmfTetrahedra, \
GmfPrisms, \
GmfHexahedra, \
GmfIterationsAll, \
GmfTimesAll, \
GmfCorners, \
GmfRidges, \
GmfRequiredVertices, \
GmfRequiredEdges, \
GmfRequiredTriangles, \
GmfRequiredQuadrilaterals, \
GmfTangentAtEdgeVertices, \
GmfNormalAtVertices, \
GmfNormalAtTriangleVertices, \
GmfNormalAtQuadrilateralVertices, \
GmfAngleOfCornerBound, \
GmfTrianglesP2, \
GmfEdgesP2, \
GmfSolAtPyramids, \
GmfQuadrilateralsQ2, \
GmfISolAtPyramids, \
GmfSubDomainFromGeom, \
GmfTetrahedraP2, \
GmfFault_NearTri, \
GmfFault_Inter, \
GmfHexahedraQ2, \
GmfExtraVerticesAtEdges, \
GmfExtraVerticesAtTriangles, \
GmfExtraVerticesAtQuadrilaterals, \
GmfExtraVerticesAtTetrahedra, \
GmfExtraVerticesAtPrisms, \
GmfExtraVerticesAtHexahedra, \
GmfVerticesOnGeometricVertices, \
GmfVerticesOnGeometricEdges, \
GmfVerticesOnGeometricTriangles, \
GmfVerticesOnGeometricQuadrilaterals, \
GmfEdgesOnGeometricEdges, \
GmfFault_FreeEdge, \
GmfPolyhedra, \
GmfPolygons, \
GmfFault_Overlap, \
GmfPyramids, \
GmfBoundingBox, \
GmfBody, \
GmfPrivateTable, \
GmfFault_BadShape, \
GmfEnd, \
GmfTrianglesOnGeometricTriangles, \
GmfTrianglesOnGeometricQuadrilaterals, \
GmfQuadrilateralsOnGeometricTriangles, \
GmfQuadrilateralsOnGeometricQuadrilaterals, \
GmfTangents, \
GmfNormals, \
GmfTangentAtVertices, \
GmfSolAtVertices, \
GmfSolAtEdges, \
GmfSolAtTriangles, \
GmfSolAtQuadrilaterals, \
GmfSolAtTetrahedra, \
GmfSolAtPrisms, \
GmfSolAtHexahedra, \
GmfDSolAtVertices, \
GmfISolAtVertices, \
GmfISolAtEdges, \
GmfISolAtTriangles, \
GmfISolAtQuadrilaterals, \
GmfISolAtTetrahedra, \
GmfISolAtPrisms, \
GmfISolAtHexahedra, \
GmfIterations, \
GmfTime, \
GmfFault_SmallTri, \
GmfCoarseHexahedra
GmfReserved1, \
GmfVersionFormatted, \
GmfReserved2, \
GmfDimension, \
GmfVertices, \
GmfEdges, \
GmfTriangles, \
GmfQuadrilaterals, \
GmfTetrahedra, \
GmfPrisms, \
GmfHexahedra, \
GmfIterationsAll, \
GmfTimesAll, \
GmfCorners, \
GmfRidges, \
GmfRequiredVertices, \
GmfRequiredEdges, \
GmfRequiredTriangles, \
GmfRequiredQuadrilaterals, \
GmfTangentAtEdgeVertices, \
GmfNormalAtVertices, \
GmfNormalAtTriangleVertices, \
GmfNormalAtQuadrilateralVertices, \
GmfAngleOfCornerBound, \
GmfTrianglesP2, \
GmfEdgesP2, \
GmfSolAtPyramids, \
GmfQuadrilateralsQ2, \
GmfISolAtPyramids, \
GmfSubDomainFromGeom, \
GmfTetrahedraP2, \
GmfFault_NearTri, \
GmfFault_Inter, \
GmfHexahedraQ2, \
GmfExtraVerticesAtEdges, \
GmfExtraVerticesAtTriangles, \
GmfExtraVerticesAtQuadrilaterals, \
GmfExtraVerticesAtTetrahedra, \
GmfExtraVerticesAtPrisms, \
GmfExtraVerticesAtHexahedra, \
GmfVerticesOnGeometricVertices, \
GmfVerticesOnGeometricEdges, \
GmfVerticesOnGeometricTriangles, \
GmfVerticesOnGeometricQuadrilaterals, \
GmfEdgesOnGeometricEdges, \
GmfFault_FreeEdge, \
GmfPolyhedra, \
GmfPolygons, \
GmfFault_Overlap, \
GmfPyramids, \
GmfBoundingBox, \
GmfBody, \
GmfPrivateTable, \
GmfFault_BadShape, \
GmfEnd, \
GmfTrianglesOnGeometricTriangles, \
GmfTrianglesOnGeometricQuadrilaterals, \
GmfQuadrilateralsOnGeometricTriangles, \
GmfQuadrilateralsOnGeometricQuadrilaterals, \
GmfTangents, \
GmfNormals, \
GmfTangentAtVertices, \
GmfSolAtVertices, \
GmfSolAtEdges, \
GmfSolAtTriangles, \
GmfSolAtQuadrilaterals, \
GmfSolAtTetrahedra, \
GmfSolAtPrisms, \
GmfSolAtHexahedra, \
GmfDSolAtVertices, \
GmfISolAtVertices, \
GmfISolAtEdges, \
GmfISolAtTriangles, \
GmfISolAtQuadrilaterals, \
GmfISolAtTetrahedra, \
GmfISolAtPrisms, \
GmfISolAtHexahedra, \
GmfIterations, \
GmfTime, \
GmfFault_SmallTri, \
GmfCoarseHexahedra
};
/*----------------------------------------------------------*/
/* External procedures */
/* External procedures */
/*----------------------------------------------------------*/
MESHDriverGMF_EXPORT extern int GmfOpenMesh(const char *, int, ...);
@ -133,7 +133,7 @@ MESHDriverGMF_EXPORT extern void GmfSetLin(int, int, ...);
/*----------------------------------------------------------*/
/* Fortran 77 API */
/* Fortran 77 API */
/*----------------------------------------------------------*/
#if defined(F77_NO_UNDER_SCORE)
@ -144,7 +144,7 @@ MESHDriverGMF_EXPORT extern void GmfSetLin(int, int, ...);
/*----------------------------------------------------------*/
/* Transmesh private API */
/* Transmesh private API */
/*----------------------------------------------------------*/
#ifdef TRANSMESH

View File

@ -645,8 +645,8 @@ void SMESH_ActorDef::SetPointsLabeled( bool theIsPointsLabeled )
}
void SMESH_ActorDef::SetPointsFontProperties( SMESH::LabelFont theFamily, int theSize,
bool theBold, bool theItalic, bool theShadow,
vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b )
bool theBold, bool theItalic, bool theShadow,
vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b )
{
if(myNodeActor) {
myNodeActor->SetFontProperties( theFamily, theSize, theBold, theItalic, theShadow, r, g, b );
@ -656,8 +656,8 @@ void SMESH_ActorDef::SetPointsFontProperties( SMESH::LabelFont theFamily, int th
}
void SMESH_ActorDef::SetCellsFontProperties( SMESH::LabelFont theFamily, int theSize,
bool theBold, bool theItalic, bool theShadow,
vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b )
bool theBold, bool theItalic, bool theShadow,
vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b )
{
if(my3DActor) {
my3DActor->SetFontProperties( theFamily, theSize, theBold, theItalic, theShadow, r, g, b );

View File

@ -164,11 +164,11 @@ class SMESHOBJECT_EXPORT SMESH_Actor: public SALOME_Actor
virtual void UpdateDistribution() = 0;
virtual void SetPointsFontProperties( SMESH::LabelFont family, int size,
bool bold, bool italic, bool shadow,
vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b ) = 0;
bool bold, bool italic, bool shadow,
vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b ) = 0;
virtual void SetCellsFontProperties( SMESH::LabelFont family, int size,
bool bold, bool italic, bool shadow,
vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b ) = 0;
bool bold, bool italic, bool shadow,
vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b ) = 0;
#ifndef DISABLE_PLOT2DVIEWER
virtual SPlot2d_Histogram* GetPlot2Histogram() = 0;

View File

@ -181,11 +181,11 @@ class SMESH_ActorDef : public SMESH_Actor
virtual bool GetPointsLabeled();
virtual void SetPointsFontProperties( SMESH::LabelFont family, int size,
bool bold, bool italic, bool shadow,
vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b );
bool bold, bool italic, bool shadow,
vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b );
virtual void SetCellsFontProperties( SMESH::LabelFont family, int size,
bool bold, bool italic, bool shadow,
vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b );
bool bold, bool italic, bool shadow,
vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b );
virtual void SetCellsLabeled(bool theIsCellsLabeled);
virtual bool GetCellsLabeled();

View File

@ -144,10 +144,10 @@ namespace SMESH
void
GetColor( const QString& theSect,
const QString& theName,
QColor& color,
int& delta,
QString def)
const QString& theName,
QColor& color,
int& delta,
QString def)
{
SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
@ -160,15 +160,15 @@ namespace SMESH
std::map<SMDSAbs_ElementType,int> GetEntitiesFromObject(SMESH_VisualObj *theObject) {
std::map<SMDSAbs_ElementType,int> entities;
entities.insert(std::pair<SMDSAbs_ElementType,int>(SMDSAbs_0DElement,
theObject ? theObject->GetNbEntities(SMDSAbs_0DElement) : 0));
theObject ? theObject->GetNbEntities(SMDSAbs_0DElement) : 0));
entities.insert(std::pair<SMDSAbs_ElementType,int>(SMDSAbs_Ball,
theObject ? theObject->GetNbEntities(SMDSAbs_Ball) : 0));
theObject ? theObject->GetNbEntities(SMDSAbs_Ball) : 0));
entities.insert(std::pair<SMDSAbs_ElementType,int>(SMDSAbs_Edge,
theObject ? theObject->GetNbEntities(SMDSAbs_Edge) : 0));
theObject ? theObject->GetNbEntities(SMDSAbs_Edge) : 0));
entities.insert(std::pair<SMDSAbs_ElementType,int>(SMDSAbs_Face,
theObject ? theObject->GetNbEntities(SMDSAbs_Face) : 0));
theObject ? theObject->GetNbEntities(SMDSAbs_Face) : 0));
entities.insert(std::pair<SMDSAbs_ElementType,int>(SMDSAbs_Volume,
theObject ? theObject->GetNbEntities(SMDSAbs_Volume) : 0));
theObject ? theObject->GetNbEntities(SMDSAbs_Volume) : 0));
return entities;
}

View File

@ -78,10 +78,10 @@ SMESHOBJECT_EXPORT
SMESHOBJECT_EXPORT
void
GetColor( const QString& theSect,
const QString& theName,
QColor& color,
int& delta,
QString def);
const QString& theName,
QColor& color,
int& delta,
QString def);
SMESHOBJECT_EXPORT
std::map<SMDSAbs_ElementType,int>

View File

@ -119,8 +119,8 @@ SMESH_CellLabelActor::~SMESH_CellLabelActor() {
void SMESH_CellLabelActor::SetFontProperties( SMESH::LabelFont family, int size,
bool bold, bool italic, bool shadow,
vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b )
bool bold, bool italic, bool shadow,
vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b )
{
switch ( family ) {
case SMESH::FntArial:

View File

@ -61,8 +61,8 @@ public:
virtual void RemoveFromRender(vtkRenderer* theRenderer);
virtual void SetFontProperties( SMESH::LabelFont family, int size,
bool bold, bool italic, bool shadow,
vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b );
bool bold, bool italic, bool shadow,
vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b );
void UpdateLabels();

View File

@ -111,8 +111,8 @@ SMESH_NodeLabelActor::~SMESH_NodeLabelActor() {
}
void SMESH_NodeLabelActor::SetFontProperties( SMESH::LabelFont family, int size,
bool bold, bool italic, bool shadow,
vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b )
bool bold, bool italic, bool shadow,
vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b )
{
switch ( family ) {
case SMESH::FntArial:

View File

@ -58,8 +58,8 @@ public:
virtual void RemoveFromRender(vtkRenderer* theRenderer);
virtual void SetFontProperties( SMESH::LabelFont family, int size,
bool bold, bool italic, bool shadow,
vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b );
bool bold, bool italic, bool shadow,
vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b );
void UpdateLabels();

View File

@ -65,8 +65,8 @@ SMESH_PreviewActorsCollection::~SMESH_PreviewActorsCollection()
}
bool SMESH_PreviewActorsCollection::Init( const TopoDS_Shape& theShape,
TopAbs_ShapeEnum theType,
const QString& theEntry )
TopAbs_ShapeEnum theType,
const QString& theEntry )
{
SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();

View File

@ -129,9 +129,9 @@ SMESH_SVTKActor
if (aCell->GetCellType() != VTK_POLYHEDRON)
#endif
if(aCell->GetCellType() == VTK_VERTEX ) {
my0DGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
my0DGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
} else if(aCell->GetCellType() == VTK_POLY_VERTEX ) {
myBallGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
myBallGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
} else {
myUnstructuredGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
}

View File

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

View File

@ -559,9 +559,9 @@ void SMESHGUI_MeshInfo::showInfo( SMESH::SMESH_IDSource_ptr obj )
myWidgets[i2DQuadrangles][iLinear] ->setProperty( "text", "?" );
myWidgets[i2DQuadrangles][iQuadratic]->setProperty( "text", "?" );
myWidgets[i2DPolygons][iTotal] ->setProperty( "text", "?" );
myWidgets[iNb][iTotal] ->setProperty( "text", "?" );
myWidgets[iNb][iLinear] ->setProperty( "text", "?" );
myWidgets[iNb][iQuadratic] ->setProperty( "text", "?" );
myWidgets[iNb][iTotal] ->setProperty( "text", "?" );
myWidgets[iNb][iLinear] ->setProperty( "text", "?" );
myWidgets[iNb][iQuadratic] ->setProperty( "text", "?" );
}
else if ( nb3DLinear + nb3DQuadratic > 0 )
{
@ -581,9 +581,9 @@ void SMESHGUI_MeshInfo::showInfo( SMESH::SMESH_IDSource_ptr obj )
myWidgets[i3DPrisms][iQuadratic] ->setProperty( "text", "?" );
myWidgets[i3DHexaPrisms][iTotal] ->setProperty( "text", "?" );
myWidgets[i3DPolyhedrons][iTotal] ->setProperty( "text", "?" );
myWidgets[iNb][iTotal] ->setProperty( "text", "?" );
myWidgets[iNb][iLinear] ->setProperty( "text", "?" );
myWidgets[iNb][iQuadratic] ->setProperty( "text", "?" );
myWidgets[iNb][iTotal] ->setProperty( "text", "?" );
myWidgets[iNb][iLinear] ->setProperty( "text", "?" );
myWidgets[iNb][iQuadratic] ->setProperty( "text", "?" );
}
}
else
@ -621,9 +621,9 @@ void SMESHGUI_MeshInfo::showInfo( SMESH::SMESH_IDSource_ptr obj )
myWidgets[i3DPrisms][iQuadratic] ->setProperty( "text", "?" );
myWidgets[i3DHexaPrisms][iTotal] ->setProperty( "text", "?" );
myWidgets[i3DPolyhedrons][iTotal] ->setProperty( "text", "?" );
myWidgets[iNb][iTotal] ->setProperty( "text", "?" );
myWidgets[iNb][iLinear] ->setProperty( "text", "?" );
myWidgets[iNb][iQuadratic] ->setProperty( "text", "?" );
myWidgets[iNb][iTotal] ->setProperty( "text", "?" );
myWidgets[iNb][iLinear] ->setProperty( "text", "?" );
myWidgets[iNb][iQuadratic] ->setProperty( "text", "?" );
}
}
}
@ -1105,100 +1105,100 @@ void SMESHGUI_SimpleElemInfo::information( const QList<long>& ids )
myInfo->append( QString( "<b>%1</b>" ).arg( SMESHGUI_ElemInfo::tr( "FREE_NODE" ) ).arg( id ) );
}
// node position
SMESH::SMESH_Mesh_ptr aMeshPtr = actor()->GetObject()->GetMeshServer();
if ( !CORBA::is_nil( aMeshPtr ) ) {
SMESH::NodePosition_var pos = aMeshPtr->GetNodePosition( id );
int shapeID = pos->shapeID;
if ( shapeID > 0 ) {
QString shapeType;
double u, v;
switch ( pos->shapeType ) {
case GEOM::EDGE:
shapeType = SMESHGUI_ElemInfo::tr( "GEOM_EDGE" );
if ( pos->params.length() == 1 )
u = pos->params[0];
break;
case GEOM::FACE:
shapeType = SMESHGUI_ElemInfo::tr( "GEOM_FACE" );
if ( pos->params.length() == 2 ) {
u = pos->params[0];
v = pos->params[1];
}
break;
case GEOM::VERTEX:
shapeType = SMESHGUI_ElemInfo::tr( "GEOM_VERTEX" );
break;
default:
shapeType = SMESHGUI_ElemInfo::tr( "GEOM_SOLID" );
break;
}
// separator
myInfo->append( "" );
myInfo->append( QString( "<b>%1:" ).arg( SMESHGUI_ElemInfo::tr( "POSITION" ) ) );
myInfo->append( QString( "- <b>%1: #%2</b>" ).arg( shapeType ).arg( shapeID ) );
if ( pos->shapeType == GEOM::EDGE || pos->shapeType == GEOM::FACE ) {
myInfo->append( QString( "- <b>%1: #%2</b>" ).arg( SMESHGUI_ElemInfo::tr( "U_POSITION" ) ).
arg( QString::number( u, precision > 0 ? 'f' : 'g', qAbs( precision )) ) );
if ( pos->shapeType == GEOM::FACE ) {
myInfo->append( QString( "- <b>%1: #%2</b>" ).arg( SMESHGUI_ElemInfo::tr( "V_POSITION" ) ).
arg( QString::number( v, precision > 0 ? 'f' : 'g', qAbs( precision )) ) );
}
}
}
}
// groups node belongs to
SMESH::SMESH_Mesh_ptr aMesh = actor()->GetObject()->GetMeshServer();
if ( !CORBA::is_nil( aMesh ) ) {
SMESH::ListOfGroups_var groups = aMesh->GetGroups();
myInfo->append( "" ); // separator
bool top_created = false;
for ( int i = 0; i < groups->length(); i++ ) {
SMESH::SMESH_GroupBase_var aGrp = groups[i];
if ( CORBA::is_nil( aGrp ) ) continue;
QString aName = aGrp->GetName();
if ( aGrp->GetType() == SMESH::NODE && !aName.isEmpty() && aGrp->Contains( id ) ) {
if ( !top_created ) {
myInfo->append( QString( "<b>%1:</b>" ).arg( SMESHGUI_AddInfo::tr( "GROUPS" ) ) );
top_created = true;
}
myInfo->append( QString( "+ <b>%1:</b>" ).arg( aName.trimmed() ) );
if ( grp_details ) {
SMESH::SMESH_Group_var aStdGroup = SMESH::SMESH_Group::_narrow( aGrp );
SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGrp );
SMESH::SMESH_GroupOnFilter_var aFltGroup = SMESH::SMESH_GroupOnFilter::_narrow( aGrp );
// type : group on geometry, standalone group, group on filter
if ( !CORBA::is_nil( aStdGroup ) ) {
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" ) ).
arg( SMESHGUI_AddInfo::tr( "STANDALONE_GROUP" ) ) );
}
else if ( !CORBA::is_nil( aGeomGroup ) ) {
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" ) ).
arg( SMESHGUI_AddInfo::tr( "GROUP_ON_GEOMETRY" ) ) );
GEOM::GEOM_Object_var gobj = aGeomGroup->GetShape();
_PTR(SObject) sobj = SMESH::ObjectToSObject( gobj );
if ( sobj ) {
myInfo->append( QString( " - <b>%1:</b> %2: %3" ).arg( SMESHGUI_AddInfo::tr( "TYPE" ) ).
arg( SMESHGUI_AddInfo::tr( "GEOM_OBJECT" ) ).arg( sobj->GetName().c_str() ) );
}
}
else if ( !CORBA::is_nil( aFltGroup ) ) {
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" ) ).
arg( SMESHGUI_AddInfo::tr( "GROUP_ON_FILTER" ) ) );
}
// size
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "SIZE" ) ).
arg( QString::number( aGrp->Size() ) ) );
// color
SALOMEDS::Color color = aGrp->GetColor();
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "COLOR" ) ).
arg( QColor( color.R*255., color.G*255., color.B*255. ).name() ) );
}
}
}
}
SMESH::SMESH_Mesh_ptr aMeshPtr = actor()->GetObject()->GetMeshServer();
if ( !CORBA::is_nil( aMeshPtr ) ) {
SMESH::NodePosition_var pos = aMeshPtr->GetNodePosition( id );
int shapeID = pos->shapeID;
if ( shapeID > 0 ) {
QString shapeType;
double u, v;
switch ( pos->shapeType ) {
case GEOM::EDGE:
shapeType = SMESHGUI_ElemInfo::tr( "GEOM_EDGE" );
if ( pos->params.length() == 1 )
u = pos->params[0];
break;
case GEOM::FACE:
shapeType = SMESHGUI_ElemInfo::tr( "GEOM_FACE" );
if ( pos->params.length() == 2 ) {
u = pos->params[0];
v = pos->params[1];
}
break;
case GEOM::VERTEX:
shapeType = SMESHGUI_ElemInfo::tr( "GEOM_VERTEX" );
break;
default:
shapeType = SMESHGUI_ElemInfo::tr( "GEOM_SOLID" );
break;
}
// separator
myInfo->append( "" );
myInfo->append( QString( "<b>%1:" ).arg( SMESHGUI_ElemInfo::tr( "POSITION" ) ) );
myInfo->append( QString( "- <b>%1: #%2</b>" ).arg( shapeType ).arg( shapeID ) );
if ( pos->shapeType == GEOM::EDGE || pos->shapeType == GEOM::FACE ) {
myInfo->append( QString( "- <b>%1: #%2</b>" ).arg( SMESHGUI_ElemInfo::tr( "U_POSITION" ) ).
arg( QString::number( u, precision > 0 ? 'f' : 'g', qAbs( precision )) ) );
if ( pos->shapeType == GEOM::FACE ) {
myInfo->append( QString( "- <b>%1: #%2</b>" ).arg( SMESHGUI_ElemInfo::tr( "V_POSITION" ) ).
arg( QString::number( v, precision > 0 ? 'f' : 'g', qAbs( precision )) ) );
}
}
}
}
// groups node belongs to
SMESH::SMESH_Mesh_ptr aMesh = actor()->GetObject()->GetMeshServer();
if ( !CORBA::is_nil( aMesh ) ) {
SMESH::ListOfGroups_var groups = aMesh->GetGroups();
myInfo->append( "" ); // separator
bool top_created = false;
for ( int i = 0; i < groups->length(); i++ ) {
SMESH::SMESH_GroupBase_var aGrp = groups[i];
if ( CORBA::is_nil( aGrp ) ) continue;
QString aName = aGrp->GetName();
if ( aGrp->GetType() == SMESH::NODE && !aName.isEmpty() && aGrp->Contains( id ) ) {
if ( !top_created ) {
myInfo->append( QString( "<b>%1:</b>" ).arg( SMESHGUI_AddInfo::tr( "GROUPS" ) ) );
top_created = true;
}
myInfo->append( QString( "+ <b>%1:</b>" ).arg( aName.trimmed() ) );
if ( grp_details ) {
SMESH::SMESH_Group_var aStdGroup = SMESH::SMESH_Group::_narrow( aGrp );
SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGrp );
SMESH::SMESH_GroupOnFilter_var aFltGroup = SMESH::SMESH_GroupOnFilter::_narrow( aGrp );
// type : group on geometry, standalone group, group on filter
if ( !CORBA::is_nil( aStdGroup ) ) {
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" ) ).
arg( SMESHGUI_AddInfo::tr( "STANDALONE_GROUP" ) ) );
}
else if ( !CORBA::is_nil( aGeomGroup ) ) {
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" ) ).
arg( SMESHGUI_AddInfo::tr( "GROUP_ON_GEOMETRY" ) ) );
GEOM::GEOM_Object_var gobj = aGeomGroup->GetShape();
_PTR(SObject) sobj = SMESH::ObjectToSObject( gobj );
if ( sobj ) {
myInfo->append( QString( " - <b>%1:</b> %2: %3" ).arg( SMESHGUI_AddInfo::tr( "TYPE" ) ).
arg( SMESHGUI_AddInfo::tr( "GEOM_OBJECT" ) ).arg( sobj->GetName().c_str() ) );
}
}
else if ( !CORBA::is_nil( aFltGroup ) ) {
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" ) ).
arg( SMESHGUI_AddInfo::tr( "GROUP_ON_FILTER" ) ) );
}
// size
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "SIZE" ) ).
arg( QString::number( aGrp->Size() ) ) );
// color
SALOMEDS::Color color = aGrp->GetColor();
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "COLOR" ) ).
arg( QColor( color.R*255., color.G*255., color.B*255. ).name() ) );
}
}
}
}
}
else {
//
@ -1372,79 +1372,79 @@ void SMESHGUI_SimpleElemInfo::information( const QList<long>& ids )
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "MAX_ELEMENT_LENGTH_3D" ) ).arg( afunctor->GetValue( id ) ) );
}
// element position
if ( e->GetType() >= SMDSAbs_Edge && e->GetType() <= SMDSAbs_Volume ) {
SMESH::SMESH_Mesh_ptr aMesh = actor()->GetObject()->GetMeshServer();
if ( !CORBA::is_nil( aMesh ) ) {
SMESH::ElementPosition pos = aMesh->GetElementPosition( id );
int shapeID = pos.shapeID;
if ( shapeID > 0 ) {
myInfo->append( "" ); // separator
QString shapeType;
switch ( pos.shapeType ) {
case GEOM::EDGE: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_EDGE" ); break;
case GEOM::FACE: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_FACE" ); break;
case GEOM::VERTEX: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_VERTEX" ); break;
case GEOM::SOLID: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_SOLID" ); break;
case GEOM::SHELL: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_SHELL" ); break;
default: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_SHAPE" ); break;
}
myInfo->append( QString( "<b>%1:</b> %2 #%3" ).arg( SMESHGUI_ElemInfo::tr( "POSITION" ) ).arg( shapeType ).arg( shapeID ) );
}
}
}
// groups element belongs to
SMESH::SMESH_Mesh_ptr aMesh = actor()->GetObject()->GetMeshServer();
if ( !CORBA::is_nil( aMesh ) ) {
SMESH::ListOfGroups_var groups = aMesh->GetGroups();
myInfo->append( "" ); // separator
bool top_created = false;
for ( int i = 0; i < groups->length(); i++ ) {
SMESH::SMESH_GroupBase_var aGrp = groups[i];
if ( CORBA::is_nil( aGrp ) ) continue;
QString aName = aGrp->GetName();
if ( aGrp->GetType() != SMESH::NODE && !aName.isEmpty() && aGrp->Contains( id ) ) {
if ( !top_created ) {
myInfo->append( QString( "<b>%1:</b>" ).arg( SMESHGUI_AddInfo::tr( "GROUPS" ) ) );
top_created = true;
}
myInfo->append( QString( "+ <b>%1:</b>" ).arg( aName.trimmed() ) );
if ( grp_details ) {
SMESH::SMESH_Group_var aStdGroup = SMESH::SMESH_Group::_narrow( aGrp );
SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGrp );
SMESH::SMESH_GroupOnFilter_var aFltGroup = SMESH::SMESH_GroupOnFilter::_narrow( aGrp );
// type : group on geometry, standalone group, group on filter
if ( !CORBA::is_nil( aStdGroup ) ) {
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" ) ).
arg( SMESHGUI_AddInfo::tr( "STANDALONE_GROUP" ) ) );
}
else if ( !CORBA::is_nil( aGeomGroup ) ) {
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" ) ).
arg( SMESHGUI_AddInfo::tr( "GROUP_ON_GEOMETRY" ) ) );
GEOM::GEOM_Object_var gobj = aGeomGroup->GetShape();
_PTR(SObject) sobj = SMESH::ObjectToSObject( gobj );
if ( sobj ) {
myInfo->append( QString( " - <b>%1:</b> %2: %3" ).arg( SMESHGUI_AddInfo::tr( "TYPE" ) ).
arg( SMESHGUI_AddInfo::tr( "GEOM_OBJECT" ) ).arg( sobj->GetName().c_str() ) );
}
}
else if ( !CORBA::is_nil( aFltGroup ) ) {
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" ) ).
arg( SMESHGUI_AddInfo::tr( "GROUP_ON_FILTER" ) ) );
}
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "SIZE" ) ).
arg( QString::number( aGrp->Size() ) ) );
// color
SALOMEDS::Color color = aGrp->GetColor();
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "COLOR" ) ).
arg( QColor( color.R*255., color.G*255., color.B*255. ).name() ) );
}
}
}
}
// element position
if ( e->GetType() >= SMDSAbs_Edge && e->GetType() <= SMDSAbs_Volume ) {
SMESH::SMESH_Mesh_ptr aMesh = actor()->GetObject()->GetMeshServer();
if ( !CORBA::is_nil( aMesh ) ) {
SMESH::ElementPosition pos = aMesh->GetElementPosition( id );
int shapeID = pos.shapeID;
if ( shapeID > 0 ) {
myInfo->append( "" ); // separator
QString shapeType;
switch ( pos.shapeType ) {
case GEOM::EDGE: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_EDGE" ); break;
case GEOM::FACE: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_FACE" ); break;
case GEOM::VERTEX: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_VERTEX" ); break;
case GEOM::SOLID: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_SOLID" ); break;
case GEOM::SHELL: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_SHELL" ); break;
default: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_SHAPE" ); break;
}
myInfo->append( QString( "<b>%1:</b> %2 #%3" ).arg( SMESHGUI_ElemInfo::tr( "POSITION" ) ).arg( shapeType ).arg( shapeID ) );
}
}
}
// groups element belongs to
SMESH::SMESH_Mesh_ptr aMesh = actor()->GetObject()->GetMeshServer();
if ( !CORBA::is_nil( aMesh ) ) {
SMESH::ListOfGroups_var groups = aMesh->GetGroups();
myInfo->append( "" ); // separator
bool top_created = false;
for ( int i = 0; i < groups->length(); i++ ) {
SMESH::SMESH_GroupBase_var aGrp = groups[i];
if ( CORBA::is_nil( aGrp ) ) continue;
QString aName = aGrp->GetName();
if ( aGrp->GetType() != SMESH::NODE && !aName.isEmpty() && aGrp->Contains( id ) ) {
if ( !top_created ) {
myInfo->append( QString( "<b>%1:</b>" ).arg( SMESHGUI_AddInfo::tr( "GROUPS" ) ) );
top_created = true;
}
myInfo->append( QString( "+ <b>%1:</b>" ).arg( aName.trimmed() ) );
if ( grp_details ) {
SMESH::SMESH_Group_var aStdGroup = SMESH::SMESH_Group::_narrow( aGrp );
SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGrp );
SMESH::SMESH_GroupOnFilter_var aFltGroup = SMESH::SMESH_GroupOnFilter::_narrow( aGrp );
// type : group on geometry, standalone group, group on filter
if ( !CORBA::is_nil( aStdGroup ) ) {
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" ) ).
arg( SMESHGUI_AddInfo::tr( "STANDALONE_GROUP" ) ) );
}
else if ( !CORBA::is_nil( aGeomGroup ) ) {
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" ) ).
arg( SMESHGUI_AddInfo::tr( "GROUP_ON_GEOMETRY" ) ) );
GEOM::GEOM_Object_var gobj = aGeomGroup->GetShape();
_PTR(SObject) sobj = SMESH::ObjectToSObject( gobj );
if ( sobj ) {
myInfo->append( QString( " - <b>%1:</b> %2: %3" ).arg( SMESHGUI_AddInfo::tr( "TYPE" ) ).
arg( SMESHGUI_AddInfo::tr( "GEOM_OBJECT" ) ).arg( sobj->GetName().c_str() ) );
}
}
else if ( !CORBA::is_nil( aFltGroup ) ) {
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" ) ).
arg( SMESHGUI_AddInfo::tr( "GROUP_ON_FILTER" ) ) );
}
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "SIZE" ) ).
arg( QString::number( aGrp->Size() ) ) );
// color
SALOMEDS::Color color = aGrp->GetColor();
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "COLOR" ) ).
arg( QColor( color.R*255., color.G*255., color.B*255. ).name() ) );
}
}
}
}
}
// separator
if ( ids.count() > 1 ) {
@ -1584,131 +1584,131 @@ void SMESHGUI_TreeElemInfo::information( const QList<long>& ids )
QTreeWidgetItem* i = createItem( conItem );
i->setText( 0, SMESHGUI_ElemInfo::tr( "BALL_ELEMENTS" ) );
i->setText( 1, con );
i->setData( 1, TypeRole, NodeConnectivity );
i->setData( 1, TypeRole, NodeConnectivity );
}
con = formatConnectivity( connectivity, SMDSAbs_Edge );
if ( !con.isEmpty() ) {
QTreeWidgetItem* i = createItem( conItem );
i->setText( 0, SMESHGUI_ElemInfo::tr( "EDGES" ) );
i->setText( 1, con );
i->setData( 1, TypeRole, NodeConnectivity );
i->setData( 1, TypeRole, NodeConnectivity );
}
con = formatConnectivity( connectivity, SMDSAbs_Face );
if ( !con.isEmpty() ) {
QTreeWidgetItem* i = createItem( conItem );
i->setText( 0, SMESHGUI_ElemInfo::tr( "FACES" ) );
i->setText( 1, con );
i->setData( 1, TypeRole, NodeConnectivity );
i->setData( 1, TypeRole, NodeConnectivity );
}
con = formatConnectivity( connectivity, SMDSAbs_Volume );
if ( !con.isEmpty() ) {
QTreeWidgetItem* i = createItem( conItem );
i->setText( 0, SMESHGUI_ElemInfo::tr( "VOLUMES" ) );
i->setText( 1, con );
i->setData( 1, TypeRole, NodeConnectivity );
i->setData( 1, TypeRole, NodeConnectivity );
}
}
else {
conItem->setText( 1, SMESHGUI_ElemInfo::tr( "FREE_NODE" ) );
}
// node position
SMESH::SMESH_Mesh_ptr aMeshPtr = actor()->GetObject()->GetMeshServer();
if ( !CORBA::is_nil( aMeshPtr ) ) {
SMESH::NodePosition_var pos = aMeshPtr->GetNodePosition( id );
int shapeID = pos->shapeID;
if ( shapeID > 0 ) {
QString shapeType;
double u, v;
switch ( pos->shapeType ) {
case GEOM::EDGE:
shapeType = SMESHGUI_ElemInfo::tr( "GEOM_EDGE" );
if ( pos->params.length() == 1 )
u = pos->params[0];
break;
case GEOM::FACE:
shapeType = SMESHGUI_ElemInfo::tr( "GEOM_FACE" );
if ( pos->params.length() == 2 ) {
u = pos->params[0];
v = pos->params[1];
}
break;
case GEOM::VERTEX:
shapeType = SMESHGUI_ElemInfo::tr( "GEOM_VERTEX" );
break;
default:
shapeType = SMESHGUI_ElemInfo::tr( "GEOM_SOLID" );
break;
}
QTreeWidgetItem* posItem = createItem( nodeItem, Bold );
posItem->setText( 0, SMESHGUI_ElemInfo::tr("POSITION") );
posItem->setText( 1, (shapeType + " #%1").arg( shapeID ));
if ( pos->shapeType == GEOM::EDGE || pos->shapeType == GEOM::FACE ) {
QTreeWidgetItem* uItem = createItem( posItem );
uItem->setText( 0, SMESHGUI_ElemInfo::tr("U_POSITION") );
uItem->setText( 1, QString::number( u, precision > 0 ? 'f' : 'g', qAbs( precision )));
if ( pos->shapeType == GEOM::FACE ) {
QTreeWidgetItem* vItem = createItem( posItem );
vItem->setText( 0, SMESHGUI_ElemInfo::tr("V_POSITION") );
vItem->setText( 1, QString::number( v, precision > 0 ? 'f' : 'g', qAbs( precision )));
}
}
}
}
// groups node belongs to
SMESH::SMESH_Mesh_ptr aMesh = actor()->GetObject()->GetMeshServer();
if ( !CORBA::is_nil( aMesh ) ) {
SMESH::ListOfGroups_var groups = aMesh->GetGroups();
QTreeWidgetItem* groupsItem = 0;
for ( int i = 0; i < groups->length(); i++ ) {
SMESH::SMESH_GroupBase_var aGrp = groups[i];
if ( CORBA::is_nil( aGrp ) ) continue;
QString aName = aGrp->GetName();
if ( aGrp->GetType() == SMESH::NODE && !aName.isEmpty() && aGrp->Contains( id ) ) {
if ( !groupsItem ) {
groupsItem = createItem( nodeItem, Bold );
groupsItem->setText( 0, SMESHGUI_AddInfo::tr( "GROUPS" ) );
}
QTreeWidgetItem* it = createItem( groupsItem, Bold );
it->setText( 0, aName.trimmed() );
if ( grp_details ) {
SMESH::SMESH_Group_var aStdGroup = SMESH::SMESH_Group::_narrow( aGrp );
SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGrp );
SMESH::SMESH_GroupOnFilter_var aFltGroup = SMESH::SMESH_GroupOnFilter::_narrow( aGrp );
// type : group on geometry, standalone group, group on filter
QTreeWidgetItem* typeItem = createItem( it );
typeItem->setText( 0, SMESHGUI_AddInfo::tr( "TYPE" ) );
if ( !CORBA::is_nil( aStdGroup ) ) {
typeItem->setText( 1, SMESHGUI_AddInfo::tr( "STANDALONE_GROUP" ) );
}
else if ( !CORBA::is_nil( aGeomGroup ) ) {
typeItem->setText( 1, SMESHGUI_AddInfo::tr( "GROUP_ON_GEOMETRY" ) );
GEOM::GEOM_Object_var gobj = aGeomGroup->GetShape();
_PTR(SObject) sobj = SMESH::ObjectToSObject( gobj );
if ( sobj ) {
QTreeWidgetItem* gobjItem = createItem( typeItem );
gobjItem->setText( 0, SMESHGUI_AddInfo::tr( "GEOM_OBJECT" ) );
gobjItem->setText( 1, sobj->GetName().c_str() );
}
}
else if ( !CORBA::is_nil( aFltGroup ) ) {
typeItem->setText( 1, SMESHGUI_AddInfo::tr( "GROUP_ON_FILTER" ) );
}
// size
QTreeWidgetItem* sizeItem = createItem( it );
sizeItem->setText( 0, SMESHGUI_AddInfo::tr( "SIZE" ) );
sizeItem->setText( 1, QString::number( aGrp->Size() ) );
// color
SALOMEDS::Color color = aGrp->GetColor();
QTreeWidgetItem* colorItem = createItem( it );
colorItem->setText( 0, SMESHGUI_AddInfo::tr( "COLOR" ) );
colorItem->setBackground( 1, QBrush( QColor( color.R*255., color.G*255., color.B*255.) ) );
}
}
}
}
SMESH::SMESH_Mesh_ptr aMeshPtr = actor()->GetObject()->GetMeshServer();
if ( !CORBA::is_nil( aMeshPtr ) ) {
SMESH::NodePosition_var pos = aMeshPtr->GetNodePosition( id );
int shapeID = pos->shapeID;
if ( shapeID > 0 ) {
QString shapeType;
double u, v;
switch ( pos->shapeType ) {
case GEOM::EDGE:
shapeType = SMESHGUI_ElemInfo::tr( "GEOM_EDGE" );
if ( pos->params.length() == 1 )
u = pos->params[0];
break;
case GEOM::FACE:
shapeType = SMESHGUI_ElemInfo::tr( "GEOM_FACE" );
if ( pos->params.length() == 2 ) {
u = pos->params[0];
v = pos->params[1];
}
break;
case GEOM::VERTEX:
shapeType = SMESHGUI_ElemInfo::tr( "GEOM_VERTEX" );
break;
default:
shapeType = SMESHGUI_ElemInfo::tr( "GEOM_SOLID" );
break;
}
QTreeWidgetItem* posItem = createItem( nodeItem, Bold );
posItem->setText( 0, SMESHGUI_ElemInfo::tr("POSITION") );
posItem->setText( 1, (shapeType + " #%1").arg( shapeID ));
if ( pos->shapeType == GEOM::EDGE || pos->shapeType == GEOM::FACE ) {
QTreeWidgetItem* uItem = createItem( posItem );
uItem->setText( 0, SMESHGUI_ElemInfo::tr("U_POSITION") );
uItem->setText( 1, QString::number( u, precision > 0 ? 'f' : 'g', qAbs( precision )));
if ( pos->shapeType == GEOM::FACE ) {
QTreeWidgetItem* vItem = createItem( posItem );
vItem->setText( 0, SMESHGUI_ElemInfo::tr("V_POSITION") );
vItem->setText( 1, QString::number( v, precision > 0 ? 'f' : 'g', qAbs( precision )));
}
}
}
}
// groups node belongs to
SMESH::SMESH_Mesh_ptr aMesh = actor()->GetObject()->GetMeshServer();
if ( !CORBA::is_nil( aMesh ) ) {
SMESH::ListOfGroups_var groups = aMesh->GetGroups();
QTreeWidgetItem* groupsItem = 0;
for ( int i = 0; i < groups->length(); i++ ) {
SMESH::SMESH_GroupBase_var aGrp = groups[i];
if ( CORBA::is_nil( aGrp ) ) continue;
QString aName = aGrp->GetName();
if ( aGrp->GetType() == SMESH::NODE && !aName.isEmpty() && aGrp->Contains( id ) ) {
if ( !groupsItem ) {
groupsItem = createItem( nodeItem, Bold );
groupsItem->setText( 0, SMESHGUI_AddInfo::tr( "GROUPS" ) );
}
QTreeWidgetItem* it = createItem( groupsItem, Bold );
it->setText( 0, aName.trimmed() );
if ( grp_details ) {
SMESH::SMESH_Group_var aStdGroup = SMESH::SMESH_Group::_narrow( aGrp );
SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGrp );
SMESH::SMESH_GroupOnFilter_var aFltGroup = SMESH::SMESH_GroupOnFilter::_narrow( aGrp );
// type : group on geometry, standalone group, group on filter
QTreeWidgetItem* typeItem = createItem( it );
typeItem->setText( 0, SMESHGUI_AddInfo::tr( "TYPE" ) );
if ( !CORBA::is_nil( aStdGroup ) ) {
typeItem->setText( 1, SMESHGUI_AddInfo::tr( "STANDALONE_GROUP" ) );
}
else if ( !CORBA::is_nil( aGeomGroup ) ) {
typeItem->setText( 1, SMESHGUI_AddInfo::tr( "GROUP_ON_GEOMETRY" ) );
GEOM::GEOM_Object_var gobj = aGeomGroup->GetShape();
_PTR(SObject) sobj = SMESH::ObjectToSObject( gobj );
if ( sobj ) {
QTreeWidgetItem* gobjItem = createItem( typeItem );
gobjItem->setText( 0, SMESHGUI_AddInfo::tr( "GEOM_OBJECT" ) );
gobjItem->setText( 1, sobj->GetName().c_str() );
}
}
else if ( !CORBA::is_nil( aFltGroup ) ) {
typeItem->setText( 1, SMESHGUI_AddInfo::tr( "GROUP_ON_FILTER" ) );
}
// size
QTreeWidgetItem* sizeItem = createItem( it );
sizeItem->setText( 0, SMESHGUI_AddInfo::tr( "SIZE" ) );
sizeItem->setText( 1, QString::number( aGrp->Size() ) );
// color
SALOMEDS::Color color = aGrp->GetColor();
QTreeWidgetItem* colorItem = createItem( it );
colorItem->setText( 0, SMESHGUI_AddInfo::tr( "COLOR" ) );
colorItem->setBackground( 1, QBrush( QColor( color.R*255., color.G*255., color.B*255.) ) );
}
}
}
}
}
else {
//
@ -1813,8 +1813,8 @@ void SMESHGUI_TreeElemInfo::information( const QList<long>& ids )
QTreeWidgetItem* nodeItem = createItem( conItem, Bold );
nodeItem->setText( 0, QString( "%1 %2 / %3" ).arg( SMESHGUI_ElemInfo::tr( "NODE" ) ).arg( idx ).arg( e->NbNodes() ) );
nodeItem->setText( 1, QString( "#%1" ).arg( node->GetID() ) );
nodeItem->setData( 1, TypeRole, ElemConnectivity );
nodeItem->setData( 1, IdRole, node->GetID() );
nodeItem->setData( 1, TypeRole, ElemConnectivity );
nodeItem->setData( 1, IdRole, node->GetID() );
nodeItem->setExpanded( false );
// node coordinates
QTreeWidgetItem* coordItem = createItem( nodeItem );
@ -1844,28 +1844,28 @@ void SMESHGUI_TreeElemInfo::information( const QList<long>& ids )
QTreeWidgetItem* i = createItem( nconItem );
i->setText( 0, SMESHGUI_ElemInfo::tr( "EDGES" ) );
i->setText( 1, con );
i->setData( 1, TypeRole, NodeConnectivity );
i->setData( 1, TypeRole, NodeConnectivity );
}
con = formatConnectivity( connectivity, SMDSAbs_Ball );
if ( !con.isEmpty() ) {
QTreeWidgetItem* i = createItem( nconItem );
i->setText( 0, SMESHGUI_ElemInfo::tr( "BALL_ELEMENTS" ) );
i->setText( 1, con );
i->setData( 1, TypeRole, NodeConnectivity );
i->setData( 1, TypeRole, NodeConnectivity );
}
con = formatConnectivity( connectivity, SMDSAbs_Face );
if ( !con.isEmpty() ) {
QTreeWidgetItem* i = createItem( nconItem );
i->setText( 0, SMESHGUI_ElemInfo::tr( "FACES" ) );
i->setText( 1, con );
i->setData( 1, TypeRole, NodeConnectivity );
i->setData( 1, TypeRole, NodeConnectivity );
}
con = formatConnectivity( connectivity, SMDSAbs_Volume );
if ( !con.isEmpty() ) {
QTreeWidgetItem* i = createItem( nconItem );
i->setText( 0, SMESHGUI_ElemInfo::tr( "VOLUMES" ) );
i->setText( 1, con );
i->setData( 1, TypeRole, NodeConnectivity );
i->setData( 1, TypeRole, NodeConnectivity );
}
}
}
@ -1950,83 +1950,83 @@ void SMESHGUI_TreeElemInfo::information( const QList<long>& ids )
diam3Item->setText( 0, tr( "MAX_ELEMENT_LENGTH_3D" ) );
diam3Item->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id ) ) );
}
// element position
if ( e->GetType() >= SMDSAbs_Edge && e->GetType() <= SMDSAbs_Volume ) {
SMESH::SMESH_Mesh_ptr aMesh = actor()->GetObject()->GetMeshServer();
if ( !CORBA::is_nil( aMesh ) ) {
SMESH::ElementPosition pos = aMesh->GetElementPosition( id );
int shapeID = pos.shapeID;
if ( shapeID > 0 ) {
QTreeWidgetItem* shItem = createItem( elemItem, Bold );
QString shapeType;
switch ( pos.shapeType ) {
case GEOM::EDGE: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_EDGE" ); break;
case GEOM::FACE: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_FACE" ); break;
case GEOM::VERTEX: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_VERTEX" ); break;
case GEOM::SOLID: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_SOLID" ); break;
case GEOM::SHELL: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_SHELL" ); break;
default: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_SHAPE" ); break;
}
shItem->setText( 0, SMESHGUI_ElemInfo::tr( "POSITION" ) );
shItem->setText( 1, QString( "%1 #%2" ).arg( shapeType ).arg( shapeID ) );
}
}
}
// groups element belongs to
SMESH::SMESH_Mesh_ptr aMesh = actor()->GetObject()->GetMeshServer();
if ( !CORBA::is_nil( aMesh ) ) {
SMESH::ListOfGroups_var groups = aMesh->GetGroups();
QTreeWidgetItem* groupsItem = 0;
for ( int i = 0; i < groups->length(); i++ ) {
SMESH::SMESH_GroupBase_var aGrp = groups[i];
if ( CORBA::is_nil( aGrp ) ) continue;
QString aName = aGrp->GetName();
if ( aGrp->GetType() != SMESH::NODE && !aName.isEmpty() && aGrp->Contains( id ) ) {
if ( !groupsItem ) {
groupsItem = createItem( elemItem, Bold );
groupsItem->setText( 0, SMESHGUI_AddInfo::tr( "GROUPS" ) );
}
QTreeWidgetItem* it = createItem( groupsItem, Bold );
it->setText( 0, aName.trimmed() );
if ( grp_details ) {
SMESH::SMESH_Group_var aStdGroup = SMESH::SMESH_Group::_narrow( aGrp );
SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGrp );
SMESH::SMESH_GroupOnFilter_var aFltGroup = SMESH::SMESH_GroupOnFilter::_narrow( aGrp );
// type : group on geometry, standalone group, group on filter
QTreeWidgetItem* typeItem = createItem( it );
typeItem->setText( 0, SMESHGUI_AddInfo::tr( "TYPE" ) );
if ( !CORBA::is_nil( aStdGroup ) ) {
typeItem->setText( 1, SMESHGUI_AddInfo::tr( "STANDALONE_GROUP" ) );
}
else if ( !CORBA::is_nil( aGeomGroup ) ) {
typeItem->setText( 1, SMESHGUI_AddInfo::tr( "GROUP_ON_GEOMETRY" ) );
GEOM::GEOM_Object_var gobj = aGeomGroup->GetShape();
_PTR(SObject) sobj = SMESH::ObjectToSObject( gobj );
if ( sobj ) {
QTreeWidgetItem* gobjItem = createItem( typeItem );
gobjItem->setText( 0, SMESHGUI_AddInfo::tr( "GEOM_OBJECT" ) );
gobjItem->setText( 1, sobj->GetName().c_str() );
}
}
else if ( !CORBA::is_nil( aFltGroup ) ) {
typeItem->setText( 1, SMESHGUI_AddInfo::tr( "GROUP_ON_FILTER" ) );
}
// size
QTreeWidgetItem* sizeItem = createItem( it );
sizeItem->setText( 0, SMESHGUI_AddInfo::tr( "SIZE" ) );
sizeItem->setText( 1, QString::number( aGrp->Size() ) );
// color
SALOMEDS::Color color = aGrp->GetColor();
QTreeWidgetItem* colorItem = createItem( it );
colorItem->setText( 0, SMESHGUI_AddInfo::tr( "COLOR" ) );
colorItem->setBackground( 1, QBrush( QColor( color.R*255., color.G*255., color.B*255.) ) );
}
}
}
}
// element position
if ( e->GetType() >= SMDSAbs_Edge && e->GetType() <= SMDSAbs_Volume ) {
SMESH::SMESH_Mesh_ptr aMesh = actor()->GetObject()->GetMeshServer();
if ( !CORBA::is_nil( aMesh ) ) {
SMESH::ElementPosition pos = aMesh->GetElementPosition( id );
int shapeID = pos.shapeID;
if ( shapeID > 0 ) {
QTreeWidgetItem* shItem = createItem( elemItem, Bold );
QString shapeType;
switch ( pos.shapeType ) {
case GEOM::EDGE: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_EDGE" ); break;
case GEOM::FACE: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_FACE" ); break;
case GEOM::VERTEX: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_VERTEX" ); break;
case GEOM::SOLID: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_SOLID" ); break;
case GEOM::SHELL: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_SHELL" ); break;
default: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_SHAPE" ); break;
}
shItem->setText( 0, SMESHGUI_ElemInfo::tr( "POSITION" ) );
shItem->setText( 1, QString( "%1 #%2" ).arg( shapeType ).arg( shapeID ) );
}
}
}
// groups element belongs to
SMESH::SMESH_Mesh_ptr aMesh = actor()->GetObject()->GetMeshServer();
if ( !CORBA::is_nil( aMesh ) ) {
SMESH::ListOfGroups_var groups = aMesh->GetGroups();
QTreeWidgetItem* groupsItem = 0;
for ( int i = 0; i < groups->length(); i++ ) {
SMESH::SMESH_GroupBase_var aGrp = groups[i];
if ( CORBA::is_nil( aGrp ) ) continue;
QString aName = aGrp->GetName();
if ( aGrp->GetType() != SMESH::NODE && !aName.isEmpty() && aGrp->Contains( id ) ) {
if ( !groupsItem ) {
groupsItem = createItem( elemItem, Bold );
groupsItem->setText( 0, SMESHGUI_AddInfo::tr( "GROUPS" ) );
}
QTreeWidgetItem* it = createItem( groupsItem, Bold );
it->setText( 0, aName.trimmed() );
if ( grp_details ) {
SMESH::SMESH_Group_var aStdGroup = SMESH::SMESH_Group::_narrow( aGrp );
SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGrp );
SMESH::SMESH_GroupOnFilter_var aFltGroup = SMESH::SMESH_GroupOnFilter::_narrow( aGrp );
// type : group on geometry, standalone group, group on filter
QTreeWidgetItem* typeItem = createItem( it );
typeItem->setText( 0, SMESHGUI_AddInfo::tr( "TYPE" ) );
if ( !CORBA::is_nil( aStdGroup ) ) {
typeItem->setText( 1, SMESHGUI_AddInfo::tr( "STANDALONE_GROUP" ) );
}
else if ( !CORBA::is_nil( aGeomGroup ) ) {
typeItem->setText( 1, SMESHGUI_AddInfo::tr( "GROUP_ON_GEOMETRY" ) );
GEOM::GEOM_Object_var gobj = aGeomGroup->GetShape();
_PTR(SObject) sobj = SMESH::ObjectToSObject( gobj );
if ( sobj ) {
QTreeWidgetItem* gobjItem = createItem( typeItem );
gobjItem->setText( 0, SMESHGUI_AddInfo::tr( "GEOM_OBJECT" ) );
gobjItem->setText( 1, sobj->GetName().c_str() );
}
}
else if ( !CORBA::is_nil( aFltGroup ) ) {
typeItem->setText( 1, SMESHGUI_AddInfo::tr( "GROUP_ON_FILTER" ) );
}
// size
QTreeWidgetItem* sizeItem = createItem( it );
sizeItem->setText( 0, SMESHGUI_AddInfo::tr( "SIZE" ) );
sizeItem->setText( 1, QString::number( aGrp->Size() ) );
// color
SALOMEDS::Color color = aGrp->GetColor();
QTreeWidgetItem* colorItem = createItem( it );
colorItem->setText( 0, SMESHGUI_AddInfo::tr( "COLOR" ) );
colorItem->setBackground( 1, QBrush( QColor( color.R*255., color.G*255., color.B*255.) ) );
}
}
}
}
}
}
}
@ -2582,7 +2582,7 @@ void SMESHGUI_AddInfo::saveInfo( QTextStream &out )
if ( !( ( *it )->text(0) ).isEmpty() ) {
out << QString( SPACING_INFO * itemDepth( *it ), ' ' ) << ( *it )->text(0);
if ( ( *it )->text(0) == tr( "COLOR" ) ) {
out << ": " << ( ( ( *it )->background(1) ).color() ).name();
out << ": " << ( ( ( *it )->background(1) ).color() ).name();
}
else if ( !( ( *it )->text(1) ).isEmpty() ) out << ": " << ( *it )->text(1);
out << "\n";
@ -2959,7 +2959,7 @@ void SMESHGUI_MeshInfoDlg::dump()
QFile aFile( aFileName );
if ( !aFile.open( QIODevice::WriteOnly | QIODevice::Text ) )
return;
return;
QTextStream out( &aFile );

View File

@ -982,23 +982,23 @@ namespace SMESH
foreach ( SUIT_ViewManager* vm, vmList ) {
QVector<SUIT_ViewWindow*> views = vm->getViews();
foreach ( SUIT_ViewWindow* vw, views ) {
// update VTK viewer properties
if ( SVTK_ViewWindow* aVtkView = GetVtkViewWindow( vw ) ) {
// update actors
vtkRenderer* aRenderer = aVtkView->getRenderer();
VTK::ActorCollectionCopy aCopy( aRenderer->GetActors() );
vtkActorCollection* aCollection = aCopy.GetActors();
aCollection->InitTraversal();
while ( vtkActor* anAct = aCollection->GetNextActor() ) {
if ( SMESH_NodeLabelActor* anActor = dynamic_cast< SMESH_NodeLabelActor* >( anAct ) ) {
anActor->SetFontProperties( aFamilyNd, aSizeNd, aBoldNd, anItalicNd, aShadowNd, anRGBNd[0], anRGBNd[1], anRGBNd[2] );
}
else if ( SMESH_CellLabelActor* anActor = dynamic_cast< SMESH_CellLabelActor* >( anAct ) ) {
anActor->SetFontProperties( aFamilyEl, aSizeEl, aBoldEl, anItalicEl, aShadowEl, anRGBEl[0], anRGBEl[1], anRGBEl[2] );
}
}
aVtkView->Repaint( false );
}
// update VTK viewer properties
if ( SVTK_ViewWindow* aVtkView = GetVtkViewWindow( vw ) ) {
// update actors
vtkRenderer* aRenderer = aVtkView->getRenderer();
VTK::ActorCollectionCopy aCopy( aRenderer->GetActors() );
vtkActorCollection* aCollection = aCopy.GetActors();
aCollection->InitTraversal();
while ( vtkActor* anAct = aCollection->GetNextActor() ) {
if ( SMESH_NodeLabelActor* anActor = dynamic_cast< SMESH_NodeLabelActor* >( anAct ) ) {
anActor->SetFontProperties( aFamilyNd, aSizeNd, aBoldNd, anItalicNd, aShadowNd, anRGBNd[0], anRGBNd[1], anRGBNd[2] );
}
else if ( SMESH_CellLabelActor* anActor = dynamic_cast< SMESH_CellLabelActor* >( anAct ) ) {
anActor->SetFontProperties( aFamilyEl, aSizeEl, aBoldEl, anItalicEl, aShadowEl, anRGBEl[0], anRGBEl[1], anRGBEl[2] );
}
}
aVtkView->Repaint( false );
}
}
}
}

View File

@ -1121,8 +1121,8 @@ void Maillage::outputMED(std::string fichierMED)
// Création de la famille
if (MEDfamilyCr(fid, maa, nomfam, numfam, 0, MED_NO_GROUP) < 0)
ERREUR("Error MEDfamilyCr");
delete gro;
}
delete gro;
}
}
@ -1437,7 +1437,7 @@ void Maillage::outputMED(std::string fichierMED)
if (MEDfamilyCr(fid, maa, nomfam, numfam, 1, gro) < 0)
ERREUR("Error MEDfamilyCr");
delete gro;
delete gro;
}
}

View File

@ -294,9 +294,9 @@ CORBA::Long MeshJobManager_i::initialize(const MESHJOB::MeshJobParameterList & m
break;
default:
_lastErrorMessage =
std::string("The type of the file ")+
std::string(currentMesh.file_name)+
std::string(" is not recognized");
std::string("The type of the file ")+
std::string(currentMesh.file_name)+
std::string(" is not recognized");
LOG(_lastErrorMessage);
return JOBID_UNDEFINED;
}

View File

@ -42,9 +42,9 @@ public:
~MeshJobManager_i();
bool configure (const char *configId,
const MESHJOB::ConfigParameter & configParameter);
const MESHJOB::ConfigParameter & configParameter);
CORBA::Long initialize (const MESHJOB::MeshJobParameterList & meshJobParameterList,
const char *configId);
const char *configId);
bool start (CORBA::Long jobId);
char* getState (CORBA::Long jobId);
MESHJOB::MeshJobResults * finalize(CORBA::Long jobId);

View File

@ -33,8 +33,8 @@ class SPADDERPluginTester_i:
{
public:
SPADDERPluginTester_i(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa,
PortableServer::ObjectId * contId,
const char *instanceName, const char *interfaceName);
PortableServer::ObjectId * contId,
const char *instanceName, const char *interfaceName);
virtual ~SPADDERPluginTester_i();
void demo(CORBA::Double a,CORBA::Double b,CORBA::Double& c);