0021347: [CEA 497] Visualisation into SMESH and VISU of hexagonal prism cells (MED_OCTA12)

0021380: EDF 1937 SMESH: Take into account QUAD9 and HEXA27
This commit is contained in:
eap 2011-12-16 09:34:33 +00:00
parent 5b191ae5dd
commit faf45035fc
22 changed files with 992 additions and 717 deletions

View File

@ -71,7 +71,10 @@ module SMESH
ADD_QUADPYRAMID,
ADD_QUADPENTAHEDRON,
ADD_QUADHEXAHEDRON,
ADD_ELEM0D
ADD_ELEM0D,
ADD_BIQUAD_QUADRANGLE,
ADD_TRIQUAD_HEXA,
ADD_HEXAGONAL_PRISM
};
struct log_block
@ -134,6 +137,7 @@ module SMESH
Geom_PYRAMID,
Geom_HEXA,
Geom_PENTA,
Geom_HEXAGONAL_PRISM,
Geom_POLYHEDRA
};
@ -161,6 +165,7 @@ module SMESH
Entity_Quad_Triangle,
Entity_Quadrangle,
Entity_Quad_Quadrangle,
Entity_BiQuad_Quadrangle,
Entity_Polygon,
Entity_Quad_Polygon,
Entity_Tetra,
@ -169,8 +174,10 @@ module SMESH
Entity_Quad_Pyramid,
Entity_Hexa,
Entity_Quad_Hexa,
Entity_TriQuad_Hexa,
Entity_Penta,
Entity_Quad_Penta,
Entity_Hexagonal_Prism,
Entity_Polyhedra,
Entity_Quad_Polyhedra,
Entity_Last
@ -683,6 +690,9 @@ module SMESH
long NbQuadranglesOfOrder(in ElementOrder order)
raises (SALOME::SALOME_Exception);
long NbBiQuadQuadrangles()
raises (SALOME::SALOME_Exception);
long NbPolygons()
raises (SALOME::SALOME_Exception);
@ -704,6 +714,9 @@ module SMESH
long NbHexasOfOrder(in ElementOrder order)
raises (SALOME::SALOME_Exception);
long NbTriQuadraticHexas()
raises (SALOME::SALOME_Exception);
long NbPyramids()
raises (SALOME::SALOME_Exception);
@ -716,6 +729,9 @@ module SMESH
long NbPrismsOfOrder(in ElementOrder order)
raises (SALOME::SALOME_Exception);
long NbHexagonalPrisms()
raises (SALOME::SALOME_Exception);
long NbPolyhedrons()
raises (SALOME::SALOME_Exception);

View File

@ -466,7 +466,7 @@ double MaxElementLength2D::GetValue( long theElementId )
aVal = Max(L1,Max(L2,L3));
break;
}
else if( len == 8 ) { // quadratic quadrangles
else if( len == 8 || len == 9 ) { // quadratic quadrangles
double L1 = getDistance(P( 1 ),P( 2 )) + getDistance(P( 2 ),P( 3 ));
double L2 = getDistance(P( 3 ),P( 4 )) + getDistance(P( 4 ),P( 5 ));
double L3 = getDistance(P( 5 ),P( 6 )) + getDistance(P( 6 ),P( 7 ));
@ -573,6 +573,12 @@ double MaxElementLength3D::GetValue( long theElementId )
aVal = Max(aVal,Max(Max(D1,D2),Max(D3,D4)));
break;
}
else if( len == 12 ) { // hexagonal prism
for ( int i1 = 1; i1 < 12; ++i1 )
for ( int i2 = i1+1; i1 <= 12; ++i1 )
aVal = Max( aVal, getDistance(P( i1 ),P( i2 )));
break;
}
else if( len == 10 ) { // quadratic tetras
double L1 = getDistance(P( 1 ),P( 5 )) + getDistance(P( 5 ),P( 2 ));
double L2 = getDistance(P( 2 ),P( 6 )) + getDistance(P( 6 ),P( 3 ));
@ -610,7 +616,7 @@ double MaxElementLength3D::GetValue( long theElementId )
aVal = Max(aVal,Max(Max(L7,L8),L9));
break;
}
else if( len == 20 ) { // quadratic hexas
else if( len == 20 || len == 27 ) { // quadratic hexas
double L1 = getDistance(P( 1 ),P( 9 )) + getDistance(P( 9 ),P( 2 ));
double L2 = getDistance(P( 2 ),P( 10 )) + getDistance(P( 10 ),P( 3 ));
double L3 = getDistance(P( 3 ),P( 11 )) + getDistance(P( 11 ),P( 4 ));
@ -805,7 +811,7 @@ double AspectRatio::GetValue( const TSequenceOfXYZ& P )
return 0.;
return alpha * L * C1 / C2;
}
else if( nbNodes == 8 ){ // nbNodes==8 - quadratic quadrangle
else if( nbNodes == 8 || nbNodes == 9 ) { // nbNodes==8 - quadratic quadrangle
// Compute lengths of the sides
std::vector< double > aLen (4);
aLen[0] = getDistance( P(1), P(3) );
@ -855,9 +861,10 @@ double AspectRatio::GetValue( const TSequenceOfXYZ& P )
double AspectRatio::GetBadRate( double Value, int /*nbNodes*/ ) const
{
// the aspect ratio is in the range [1.0,infinity]
// < 1.0 = very bad, zero area
// 1.0 = good
// infinity = bad
return Value / 1000.;
return ( Value < 0.9 ) ? 1000 : Value / 1000.;
}
SMDSAbs_ElementType AspectRatio::GetType() const
@ -966,10 +973,11 @@ double AspectRatio3D::GetValue( const TSequenceOfXYZ& P )
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 return aQuality;
}
switch(nbNodes){
switch(nbNodes) {
case 4:{
double aLen[6] = {
getDistance(P( 1 ),P( 2 )), // a
@ -1187,7 +1195,22 @@ double AspectRatio3D::GetValue( const TSequenceOfXYZ& P )
}
break;
}
}
case 12:
{
gp_XYZ aXYZ[8] = {P( 1 ),P( 2 ),P( 4 ),P( 5 ),P( 7 ),P( 8 ),P( 10 ),P( 11 )};
aQuality = std::max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[8])),aQuality);
}
{
gp_XYZ aXYZ[8] = {P( 2 ),P( 3 ),P( 5 ),P( 6 ),P( 8 ),P( 9 ),P( 11 ),P( 12 )};
aQuality = std::max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[8])),aQuality);
}
{
gp_XYZ aXYZ[8] = {P( 3 ),P( 4 ),P( 6 ),P( 1 ),P( 9 ),P( 10 ),P( 12 ),P( 7 )};
aQuality = std::max(GetValue(TSequenceOfXYZ(&aXYZ[0],&aXYZ[8])),aQuality);
}
break;
} // switch(nbNodes)
if ( nbNodes > 4 ) {
// avaluate aspect ratio of quadranle faces
AspectRatio aspect2D;
@ -1417,7 +1440,7 @@ SMDSAbs_ElementType Area::GetType() const
/*
Class : Length
Description : Functor for calculating length off edge
Description : Functor for calculating length of edge
*/
double Length::GetValue( const TSequenceOfXYZ& P )
{
@ -2112,17 +2135,13 @@ bool FreeEdges::IsFreeEdge( const SMDS_MeshNode** theNodes, const int theFaceId
TColStd_MapOfInteger aMap;
for ( int i = 0; i < 2; i++ )
{
SMDS_ElemIteratorPtr anElemIter = theNodes[ i ]->GetInverseElementIterator();
SMDS_ElemIteratorPtr anElemIter = theNodes[ i ]->GetInverseElementIterator(SMDSAbs_Face);
while( anElemIter->more() )
{
const SMDS_MeshElement* anElem = anElemIter->next();
if ( anElem != 0 && anElem->GetType() == SMDSAbs_Face )
if ( const SMDS_MeshElement* anElem = anElemIter->next())
{
int anId = anElem->GetID();
if ( i == 0 )
aMap.Add( anId );
else if ( aMap.Contains( anId ) && anId != theFaceId )
const int anId = anElem->GetID();
if ( anId != theFaceId && !aMap.Add( anId ))
return false;
}
}
@ -2147,7 +2166,7 @@ bool FreeEdges::IsSatisfy( long theId )
else {
anIter = aFace->nodesIterator();
}
if ( anIter == 0 )
if ( !anIter )
return false;
int i = 0, nbNodes = aFace->NbNodes();
@ -2225,14 +2244,11 @@ void FreeEdges::GetBoreders(TBorders& theBorders)
long anId = aNode->GetID();
Border aBorder(anElemId,aNodeId[1],anId);
aNodeId[1] = anId;
//std::cout<<aBorder.myPntId[0]<<"; "<<aBorder.myPntId[1]<<"; "<<aBorder.myElemId<<endl;
UpdateBorders(aBorder,aRegistry,theBorders);
}
Border aBorder(anElemId,aNodeId[0],aNodeId[1]);
//std::cout<<aBorder.myPntId[0]<<"; "<<aBorder.myPntId[1]<<"; "<<aBorder.myElemId<<endl;
UpdateBorders(aBorder,aRegistry,theBorders);
}
//std::cout<<"theBorders.size() = "<<theBorders.size()<<endl;
}
@ -2498,7 +2514,7 @@ bool ElemGeomType::IsSatisfy( long theId )
if ( myGeomType == SMDSGeom_TRIANGLE )
isOk = (!anElem->IsPoly() && (anElem->IsQuadratic() ? aNbNode == 6 : aNbNode == 3));
else if ( myGeomType == SMDSGeom_QUADRANGLE )
isOk = (!anElem->IsPoly() && (anElem->IsQuadratic() ? aNbNode == 8 : aNbNode == 4));
isOk = (!anElem->IsPoly() && (anElem->IsQuadratic() ? ( aNbNode == 8 || aNbNode == 9 ) : aNbNode == 4));
else if ( myGeomType == SMDSGeom_POLYGON )
isOk = anElem->IsPoly();
break;
@ -2511,7 +2527,9 @@ bool ElemGeomType::IsSatisfy( long theId )
else if ( myGeomType == SMDSGeom_PENTA )
isOk = (!anElem->IsPoly() && (anElem->IsQuadratic() ? aNbNode == 15 : aNbNode == 6));
else if ( myGeomType == SMDSGeom_HEXA )
isOk = (!anElem->IsPoly() && (anElem->IsQuadratic() ? aNbNode == 20 : aNbNode == 8));
isOk = (!anElem->IsPoly() && (anElem->IsQuadratic() ? ( aNbNode == 20 || aNbNode == 27 ): aNbNode == 8));
else if ( myGeomType == SMDSGeom_HEXAGONAL_PRISM )
isOk = (anElem->GetEntityType() == SMDSEntity_Hexagonal_Prism );
else if ( myGeomType == SMDSGeom_POLYHEDRA )
isOk = anElem->IsPoly();
break;

View File

@ -438,6 +438,10 @@ namespace
{
return mesh->AddFaceWithID( ids[0],ids[3],ids[2],ids[1],ids[7],ids[6],ids[5],ids[4], ID );
}
SMDS_MeshElement* add_QUAD_9(cgsize_t* ids, SMESHDS_Mesh* mesh, int ID)
{
return mesh->AddFaceWithID( ids[0],ids[3],ids[2],ids[1],ids[7],ids[6],ids[5],ids[4],ids[8], ID);
}
SMDS_MeshElement* add_TETRA_4(cgsize_t* ids, SMESHDS_Mesh* mesh, int ID)
{
return mesh->AddVolumeWithID( ids[0], ids[2], ids[1], ids[3], ID );
@ -475,6 +479,13 @@ namespace
ids[5],ids[11],ids[10],ids[9],ids[8],ids[12],ids[15],
ids[14],ids[13],ids[19],ids[18],ids[17],ids[16], ID );
}
SMDS_MeshElement* add_HEXA_27(cgsize_t* ids, SMESHDS_Mesh* mesh, int ID)
{
return mesh->AddVolumeWithID( ids[0],ids[3],ids[2],ids[1],ids[4],ids[7],ids[6],
ids[5],ids[11],ids[10],ids[9],ids[8],ids[12],ids[15],
ids[14],ids[13],ids[19],ids[18],ids[17],ids[16],
ids[20],ids[24],ids[23],ids[22],ids[21],ids[25],ids[26], ID );
}
SMDS_MeshElement* add_NGON(cgsize_t* ids, SMESHDS_Mesh* mesh, int ID)
{
vector<int> idVec( ids[0] );
@ -504,7 +515,7 @@ namespace
funVec[ CGNS_ENUMV( TRI_6 )] = add_TRI_6 ;
funVec[ CGNS_ENUMV( QUAD_4 )] = add_QUAD_4 ;
funVec[ CGNS_ENUMV( QUAD_8 )] = add_QUAD_8 ;
funVec[ CGNS_ENUMV( QUAD_9 )] = add_QUAD_8 ;
funVec[ CGNS_ENUMV( QUAD_9 )] = add_QUAD_9 ;
funVec[ CGNS_ENUMV( TETRA_4 )] = add_TETRA_4 ;
funVec[ CGNS_ENUMV( TETRA_10 )] = add_TETRA_10;
funVec[ CGNS_ENUMV( PYRA_5 )] = add_PYRA_5 ;
@ -515,7 +526,7 @@ namespace
funVec[ CGNS_ENUMV( PENTA_18 )] = add_PENTA_15;
funVec[ CGNS_ENUMV( HEXA_8 )] = add_HEXA_8 ;
funVec[ CGNS_ENUMV( HEXA_20 )] = add_HEXA_20 ;
funVec[ CGNS_ENUMV( HEXA_27 )] = add_HEXA_20 ;
funVec[ CGNS_ENUMV( HEXA_27 )] = add_HEXA_27 ;
funVec[ CGNS_ENUMV( NGON_n )] = add_NGON ;
}
return &funVec[0];

View File

@ -92,6 +92,11 @@ namespace
interlaces[SMDSEntity_Quad_Quadrangle] = ids;
cgTypes [SMDSEntity_Quad_Quadrangle] = CGNS_ENUMV( QUAD_8 );
}
{
static int ids[] = { 0,3,2,1,7,6,5,4,8 };
interlaces[SMDSEntity_BiQuad_Quadrangle] = ids;
cgTypes [SMDSEntity_BiQuad_Quadrangle] = CGNS_ENUMV( QUAD_9 );
}
{
static int ids[] = { 0, 2, 1, 3 };
interlaces[SMDSEntity_Tetra] = ids;
@ -133,8 +138,15 @@ namespace
cgTypes [SMDSEntity_Quad_Hexa] = CGNS_ENUMV( HEXA_20 );
}
{
cgTypes[SMDSEntity_Polygon] = CGNS_ENUMV( NGON_n );
cgTypes[SMDSEntity_Polyhedra] = CGNS_ENUMV( NFACE_n );
static int ids[] = { 0,3,2,1,4,7,6,5,11,10,9,8,12,15,14,13,19,18,17,16,
20, 24,23,22,21, 25};
interlaces[SMDSEntity_TriQuad_Hexa] = ids;
cgTypes [SMDSEntity_TriQuad_Hexa] = CGNS_ENUMV( HEXA_27 );
}
{
cgTypes[SMDSEntity_Polygon] = CGNS_ENUMV( NGON_n );
cgTypes[SMDSEntity_Polyhedra] = CGNS_ENUMV( NFACE_n );
cgTypes[SMDSEntity_Hexagonal_Prism] = CGNS_ENUMV( NFACE_n );
}
}
cgType = cgTypes[ smType ];
@ -353,7 +365,8 @@ Driver_Mesh::Status DriverCGNS_Write::Perform()
}
while ( elem && elem->GetEntityType() == elemType );
else if ( elemType == SMDSEntity_Polyhedra ) // POLYHEDRA
else if ( elemType == SMDSEntity_Polyhedra ||
elemType == SMDSEntity_Hexagonal_Prism) // POLYHEDRA
{
// to save polyhedrons after all
const SMDS_MeshInfo& meshInfo = myMesh->GetMeshInfo();
@ -374,7 +387,7 @@ Driver_Mesh::Status DriverCGNS_Write::Perform()
// Write polyhedral volumes
// -------------------------
if ( myMesh->GetMeshInfo().NbPolyhedrons() > 0 )
if ( myMesh->GetMeshInfo().NbElements() != cgID ) // polyhedra or hexagonal prisms remain
{
// the polyhedron (NFACE_n) is described as a set of signed face IDs,
// so first we are to write all polygones (NGON_n) bounding polyhedrons
@ -398,7 +411,9 @@ Driver_Mesh::Status DriverCGNS_Write::Perform()
while ( elemIt->more() )
{
elem = elemIt->next();
if ( elem->GetEntityType() == SMDSEntity_Polyhedra )
SMDSAbs_EntityType type = elem->GetEntityType();
if ( type == SMDSEntity_Polyhedra ||
type == SMDSEntity_Hexagonal_Prism )
{
++nbPolyhTreated;
vol.Set( elem );

View File

@ -58,7 +58,8 @@ DriverMED_R_SMESHDS_Mesh
}
static const SMDS_MeshNode*
FindNode(const SMDS_Mesh* theMesh, TInt theId){
FindNode(const SMDS_Mesh* theMesh, TInt theId)
{
const SMDS_MeshNode* aNode = theMesh->FindNode(theId);
if(aNode) return aNode;
EXCEPTION(runtime_error,"SMDS_Mesh::FindNode - cannot find a SMDS_MeshNode for ID = "<<theId);
@ -96,8 +97,6 @@ DriverMED_R_SMESHDS_Mesh
if(aMeshName != aMeshInfo->GetName()) continue;
aResult = DRS_OK;
//TInt aMeshDim = aMeshInfo->GetDim();
// Reading MED families to the temporary structure
//------------------------------------------------
TErr anErr;
@ -144,7 +143,7 @@ DriverMED_R_SMESHDS_Mesh
aResult = DRS_FAIL;
continue;
}
aMeshInfo->myDim=aMeshInfo->mySpaceDim;//Bug correction to ignore meshdim in MEDFile because can be false.
aMeshInfo->myDim=aMeshInfo->mySpaceDim;// ignore meshdim in MEDFile because it can be false
PCoordHelper aCoordHelper = GetCoordHelper(aNodeInfo);
EBooleen anIsNodeNum = aNodeInfo->IsElemNum();
@ -160,13 +159,10 @@ DriverMED_R_SMESHDS_Mesh
if(anIsNodeNum) {
aNode = myMesh->AddNodeWithID
(aCoords[0],aCoords[1],aCoords[2],aNodeInfo->GetElemNum(iElem));
//MESSAGE("AddNodeWithID " << aNodeInfo->GetElemNum(iElem));
} else {
aNode = myMesh->AddNodeWithID
(aCoords[0],aCoords[1],aCoords[2], iElem+1);
//MESSAGE("AddNode " << aNode->GetID());
}
//cout<<aNode->GetID()<<": "<<aNode->X()<<", "<<aNode->Y()<<", "<<aNode->Z()<<endl;
// Save reference to this node from its family
TInt aFamNum = aNodeInfo->GetFamNum(iElem);
@ -226,14 +222,12 @@ DriverMED_R_SMESHDS_Mesh
if(anIsElemNum){
TInt anElemId = aPolygoneInfo->GetElemNum(iElem);
anElement = myMesh->AddPolygonalFaceWithID(aNodeIds,anElemId);
//MESSAGE("AddPolygonalFaceWithID " << anElemId);
}
if(!anElement){
vector<const SMDS_MeshNode*> aNodes(aNbConn);
for(TInt iConn = 0; iConn < aNbConn; iConn++)
aNodes[iConn] = FindNode(myMesh,aNodeIds[iConn]);
anElement = myMesh->AddPolygonalFace(aNodes);
//MESSAGE("AddPolygonalFace " << anElement->GetID());
isRenum = anIsElemNum;
}
#ifndef _DEXCEPT_
@ -273,33 +267,26 @@ DriverMED_R_SMESHDS_Mesh
typedef MED::TVector<int> TQuantities;
TQuantities aQuantities(aNbFaces);
TInt aNbNodes = aPolyedreInfo->GetNbNodes(iElem);
//MESSAGE("--- aNbNodes " << aNbNodes);
TNodeIds aNodeIds(aNbNodes);
for(TInt iFace = 0, iNode = 0; iFace < aNbFaces; iFace++){
//MESSAGE("--- iface " << aNbFaces << " " << iFace);
MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
TInt aNbConn = aConnSlice.size();
aQuantities[iFace] = aNbConn;
#ifdef _EDF_NODE_IDS_
//MESSAGE(anIsNodeNum);
if(anIsNodeNum)
for(TInt iConn = 0; iConn < aNbConn; iConn++)
{
//MESSAGE("iConn " << iConn << " aConnSlice[iConn] " << aConnSlice[iConn]);
aNodeIds[iNode] = aNodeInfo->GetElemNum(aConnSlice[iConn] - 1);
//MESSAGE("aNodeIds[" << iNode << "]=" << aNodeIds[iNode]);
iNode++;
}
else
for(TInt iConn = 0; iConn < aNbConn; iConn++)
{
//MESSAGE("iConn " << iConn);
aNodeIds[iNode++] = aConnSlice[iConn];
}
#else
for(TInt iConn = 0; iConn < aNbConn; iConn++)
{
//MESSAGE("iConn " << iConn);
aNodeIds[iNode++] = aConnSlice[iConn];
}
#endif
@ -315,14 +302,12 @@ DriverMED_R_SMESHDS_Mesh
if(anIsElemNum){
TInt anElemId = aPolyedreInfo->GetElemNum(iElem);
anElement = myMesh->AddPolyhedralVolumeWithID(aNodeIds,aQuantities,anElemId);
//MESSAGE("AddPolyhedralVolumeWithID " << anElemId);
}
if(!anElement){
vector<const SMDS_MeshNode*> aNodes(aNbNodes);
for(TInt iConn = 0; iConn < aNbNodes; iConn++)
aNodes[iConn] = FindNode(myMesh,aNodeIds[iConn]);
anElement = myMesh->AddPolyhedralVolume(aNodes,aQuantities);
//MESSAGE("AddPolyhedralVolume " << anElement->GetID());
isRenum = anIsElemNum;
}
#ifndef _DEXCEPT_
@ -365,6 +350,7 @@ DriverMED_R_SMESHDS_Mesh
case eTRIA6: aNbNodes = 6; break;
case eQUAD4: aNbNodes = 4; break;
case eQUAD8: aNbNodes = 8; break;
case eQUAD9: aNbNodes = 9; break;
case eTETRA4: aNbNodes = 4; break;
case eTETRA10: aNbNodes = 10; break;
case ePYRA5: aNbNodes = 5; break;
@ -373,6 +359,8 @@ DriverMED_R_SMESHDS_Mesh
case ePENTA15: aNbNodes = 15; break;
case eHEXA8: aNbNodes = 8; break;
case eHEXA20: aNbNodes = 20; break;
case eHEXA27: aNbNodes = 27; break;
case eOCTA12: aNbNodes = 12; break;
case ePOINT1: aNbNodes = 1; break;
default:;
}
@ -515,6 +503,27 @@ DriverMED_R_SMESHDS_Mesh
isRenum = anIsElemNum;
}
break;
case eQUAD9:
aNbNodes = 9;
if(anIsElemNum)
anElement = myMesh->AddFaceWithID(aNodeIds[0], aNodeIds[1],
aNodeIds[2], aNodeIds[3],
aNodeIds[4], aNodeIds[5],
aNodeIds[6], aNodeIds[7], aNodeIds[8],
aCellInfo->GetElemNum(iElem));
if (!anElement) {
anElement = myMesh->AddFace(FindNode(myMesh,aNodeIds[0]),
FindNode(myMesh,aNodeIds[1]),
FindNode(myMesh,aNodeIds[2]),
FindNode(myMesh,aNodeIds[3]),
FindNode(myMesh,aNodeIds[4]),
FindNode(myMesh,aNodeIds[5]),
FindNode(myMesh,aNodeIds[6]),
FindNode(myMesh,aNodeIds[7]),
FindNode(myMesh,aNodeIds[8]));
isRenum = anIsElemNum;
}
break;
case eTETRA4:
aNbNodes = 4;
if(anIsElemNum)
@ -554,7 +563,6 @@ DriverMED_R_SMESHDS_Mesh
break;
case ePYRA5:
aNbNodes = 5;
// There is some differnce between SMDS and MED
if(anIsElemNum)
anElement = myMesh->AddVolumeWithID(aNodeIds[0], aNodeIds[1],
aNodeIds[2], aNodeIds[3],
@ -571,7 +579,6 @@ DriverMED_R_SMESHDS_Mesh
break;
case ePYRA13:
aNbNodes = 13;
// There is some difference between SMDS and MED
if(anIsElemNum)
anElement = myMesh->AddVolumeWithID(aNodeIds[0], aNodeIds[1],
aNodeIds[2], aNodeIds[3],
@ -673,6 +680,7 @@ DriverMED_R_SMESHDS_Mesh
isRenum = anIsElemNum;
}
break;
case eHEXA20:
aNbNodes = 20;
if(anIsElemNum)
@ -711,13 +719,86 @@ DriverMED_R_SMESHDS_Mesh
isRenum = anIsElemNum;
}
break;
}
// if (anIsElemNum) {
// MESSAGE("add element with id " << aCellInfo->GetElemNum(iElem));
// }
// else {
// MESSAGE("add element "<< anElement->GetID());
// }
case eHEXA27:
aNbNodes = 27;
if(anIsElemNum)
anElement = myMesh->AddVolumeWithID(aNodeIds[0], aNodeIds[1],
aNodeIds[2], aNodeIds[3],
aNodeIds[4], aNodeIds[5],
aNodeIds[6], aNodeIds[7],
aNodeIds[8], aNodeIds[9],
aNodeIds[10], aNodeIds[11],
aNodeIds[12], aNodeIds[13],
aNodeIds[14], aNodeIds[15],
aNodeIds[16], aNodeIds[17],
aNodeIds[18], aNodeIds[19],
aNodeIds[20], aNodeIds[21],
aNodeIds[22], aNodeIds[23],
aNodeIds[24], aNodeIds[25],
aNodeIds[26],
aCellInfo->GetElemNum(iElem));
if (!anElement) {
anElement = myMesh->AddVolume(FindNode(myMesh,aNodeIds[0]),
FindNode(myMesh,aNodeIds[1]),
FindNode(myMesh,aNodeIds[2]),
FindNode(myMesh,aNodeIds[3]),
FindNode(myMesh,aNodeIds[4]),
FindNode(myMesh,aNodeIds[5]),
FindNode(myMesh,aNodeIds[6]),
FindNode(myMesh,aNodeIds[7]),
FindNode(myMesh,aNodeIds[8]),
FindNode(myMesh,aNodeIds[9]),
FindNode(myMesh,aNodeIds[10]),
FindNode(myMesh,aNodeIds[11]),
FindNode(myMesh,aNodeIds[12]),
FindNode(myMesh,aNodeIds[13]),
FindNode(myMesh,aNodeIds[14]),
FindNode(myMesh,aNodeIds[15]),
FindNode(myMesh,aNodeIds[16]),
FindNode(myMesh,aNodeIds[17]),
FindNode(myMesh,aNodeIds[18]),
FindNode(myMesh,aNodeIds[19]),
FindNode(myMesh,aNodeIds[20]),
FindNode(myMesh,aNodeIds[21]),
FindNode(myMesh,aNodeIds[22]),
FindNode(myMesh,aNodeIds[23]),
FindNode(myMesh,aNodeIds[24]),
FindNode(myMesh,aNodeIds[25]),
FindNode(myMesh,aNodeIds[26]));
isRenum = anIsElemNum;
}
break;
case eOCTA12:
aNbNodes = 12;
if(anIsElemNum)
anElement = myMesh->AddVolumeWithID(aNodeIds[0], aNodeIds[1],
aNodeIds[2], aNodeIds[3],
aNodeIds[4], aNodeIds[5],
aNodeIds[6], aNodeIds[7],
aNodeIds[8], aNodeIds[9],
aNodeIds[10], aNodeIds[11],
aCellInfo->GetElemNum(iElem));
if (!anElement) {
anElement = myMesh->AddVolume(FindNode(myMesh,aNodeIds[0]),
FindNode(myMesh,aNodeIds[1]),
FindNode(myMesh,aNodeIds[2]),
FindNode(myMesh,aNodeIds[3]),
FindNode(myMesh,aNodeIds[4]),
FindNode(myMesh,aNodeIds[5]),
FindNode(myMesh,aNodeIds[6]),
FindNode(myMesh,aNodeIds[7]),
FindNode(myMesh,aNodeIds[8]),
FindNode(myMesh,aNodeIds[9]),
FindNode(myMesh,aNodeIds[10]),
FindNode(myMesh,aNodeIds[11]));
isRenum = anIsElemNum;
}
break;
} // switch(aGeom)
#ifndef _DEXCEPT_
}catch(const std::exception& exc){
INFOS("The following exception was caught:\n\t"<<exc.what());

View File

@ -215,36 +215,6 @@ namespace{
};
typedef boost::shared_ptr<TCoordHelper> TCoordHelperPtr;
//-------------------------------------------------------
/*!
* \brief Class helping to use either SMDS_0DElementIterator,
* SMDS_EdgeIterator, SMDS_FaceIterator or SMDS_VolumeIterator
* in the same code
*/
//-------------------------------------------------------
struct TElemIterator
{
virtual const SMDS_MeshElement* next() = 0;
virtual ~TElemIterator() {}
};
typedef boost::shared_ptr<TElemIterator> PElemIterator;
template< class SMDSIteratorPtr > class TypedElemIterator: public TElemIterator
{
SMDSIteratorPtr myItPtr;
public:
TypedElemIterator(SMDSIteratorPtr it): myItPtr(it) {}
virtual const SMDS_MeshElement* next() {
if ( myItPtr->more() ) return myItPtr->next();
else return 0;
}
};
typedef TypedElemIterator< SMDS_0DElementIteratorPtr > T0DElementIterator;
typedef TypedElemIterator< SMDS_EdgeIteratorPtr > TEdgeIterator;
typedef TypedElemIterator< SMDS_FaceIteratorPtr > TFaceIterator;
typedef TypedElemIterator< SMDS_VolumeIteratorPtr > TVolumeIterator;
//-------------------------------------------------------
/*!
* \brief Structure describing element type
@ -263,7 +233,6 @@ namespace{
typedef NCollection_DataMap< Standard_Address, int > TElemFamilyMap;
//typedef map<const SMDS_MeshElement *, int> TElemFamilyMap;
//================================================================================
/*!
@ -573,9 +542,14 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
nbElemInfo.NbQuadrangles( ORDER_LINEAR ),
SMDSAbs_Face));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eQUAD8,
nbElemInfo.NbQuadrangles( ORDER_QUADRATIC ),
SMDSAbs_Face));
eQUAD8,
nbElemInfo.NbQuadrangles( ORDER_QUADRATIC ) -
nbElemInfo.NbBiQuadQuadrangles(),
SMDSAbs_Face));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eQUAD9,
nbElemInfo.NbBiQuadQuadrangles(),
SMDSAbs_Face));
if ( polyTypesSupported ) {
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePOLYGONE,
@ -620,10 +594,18 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eHEXA20,
nbElemInfo.NbHexas( ORDER_QUADRATIC ),
nbElemInfo.NbHexas( ORDER_QUADRATIC )-
nbElemInfo.NbTriQuadHexas(),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eHEXA27,
nbElemInfo.NbTriQuadHexas(),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eOCTA12,
nbElemInfo.NbHexPrisms(),
SMDSAbs_Volume));
if ( polyTypesSupported ) {
//MESSAGE("polyTypesSupported");
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePOLYEDRE,
nbElemInfo.NbPolyhedrons(),
@ -645,32 +627,29 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
if ( aElemTypeData->_nbElems == 0 )
continue;
// iterator on elements of a current type
PElemIterator elemIterator;
int defaultFamilyId = 0;
switch ( aElemTypeData->_smdsType ) {
case SMDSAbs_0DElement:
elemIterator = PElemIterator( new T0DElementIterator( myMesh->elements0dIterator() ));
defaultFamilyId = my0DElementsDefaultFamilyId;
break;
case SMDSAbs_Edge:
elemIterator = PElemIterator( new TEdgeIterator( myMesh->edgesIterator() ));
defaultFamilyId = myEdgesDefaultFamilyId;
break;
case SMDSAbs_Face:
elemIterator = PElemIterator( new TFaceIterator( myMesh->facesIterator() ));
defaultFamilyId = myFacesDefaultFamilyId;
break;
case SMDSAbs_Volume:
elemIterator = PElemIterator( new TVolumeIterator( myMesh->volumesIterator() ));
defaultFamilyId = myVolumesDefaultFamilyId;
break;
default:
continue;
}
// iterator on elements of a current type
SMDS_ElemIteratorPtr elemIterator = myMesh->elementsIterator( aElemTypeData->_smdsType );
if ( !elemIterator->more()) continue;
int iElem = 0;
//cout << " Treat type " << aElemTypeData->_geomType << " nb = " <<aElemTypeData->_nbElems<< endl;
// Treat POLYGONs
// ---------------
if ( aElemTypeData->_geomType == ePOLYGONE )
@ -726,11 +705,6 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
if ( ++iElem == aPolygoneInfo->GetNbElem() )
break;
}
// if(TInt aNbElems = aPolygoneElemNums.size())
// // add one element in connectivities,
// // referenced by the last element in indices
// aPolygoneConn.push_back(0);
//cout << " SetPolygoneInfo(aPolygoneInfo)" << endl;
myMed->SetPolygoneInfo(aPolygoneInfo);
}
@ -740,7 +714,6 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
// ----------------
else if (aElemTypeData->_geomType == ePOLYEDRE )
{
//MESSAGE("_geomType == ePOLYEDRE");
if ( nbPolyhedronNodes == 0 ) {
// Count nb of nodes
while ( const SMDS_MeshElement* anElem = elemIterator->next() ) {
@ -752,9 +725,6 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
break;
}
}
//MESSAGE("nbPolyhedronNodes=" << nbPolyhedronNodes);
//MESSAGE("nbPolyhedronFaces=" << nbPolyhedronFaces);
//MESSAGE("_nbElems="<< aElemTypeData->_nbElems);
}
else {
// Store in med file
@ -781,17 +751,14 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
continue;
if ( !aPolyedre->IsPoly() )
continue;
//MESSAGE("index[" << iElem << "]=" << index[iElem] << " iElem=" << iElem);
// index
TInt aNbFaces = aPolyedre->NbFaces();
index[ iElem+1 ] = index[ iElem ] + aNbFaces;
//MESSAGE("index[" << iElem+1 << "]=" << index[iElem+1] << " iElem=" << iElem);
// face index
for (TInt f = 1; f <= aNbFaces; ++f, ++iFace ) {
int aNbFaceNodes = aPolyedre->NbFaceNodes( f );
faces[ iFace+1 ] = faces[ iFace ] + aNbFaceNodes;
//MESSAGE("faces[" << iFace+1 << "]=" << faces[iFace+1] << " iFace=" << iFace);
}
// connectivity
SMDS_ElemIteratorPtr nodeIt = anElem->nodesIterator();
@ -799,10 +766,8 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
const SMDS_MeshElement* aNode = nodeIt->next();
#ifdef _EDF_NODE_IDS_
conn[ iNode ] = aNodeIdMap[aNode->GetID()];
//MESSAGE("conn["<< iNode << "]=" << conn[iNode] << " aNode->GetID()=" << aNode->GetID());
#else
conn[ iNode ] = aNode->GetID();
//MESSAGE("conn["<< iNode << "]=" << conn[iNode]);
#endif
++iNode;
}
@ -816,7 +781,6 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
if ( ++iElem == aPolyhInfo->GetNbElem() )
break;
}
//cout << " SetPolyedreInfo(aPolyhInfo )" << endl;
myMed->SetPolyedreInfo(aPolyhInfo);
}
} // if (aElemTypeData->_geomType == ePOLYEDRE )
@ -869,7 +833,6 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
break;
}
// store data in a file
//cout << " SetCellInfo(aCellInfo)" << endl;
myMed->SetCellInfo(aCellInfo);
}

View File

@ -172,6 +172,7 @@ SMESH_ActorDef::SMESH_ActorDef()
aFilter->RegisterCellsWithType(VTK_QUAD);
aFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE);
aFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD);
aFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUAD);
my2DExtProp = vtkProperty::New();
my2DExtProp->DeepCopy(mySurfaceProp);
@ -193,6 +194,7 @@ SMESH_ActorDef::SMESH_ActorDef()
aFilter->RegisterCellsWithType(VTK_QUAD);
aFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE);
aFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD);
aFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUAD);
my3DActor = SMESH_CellLabelActor::New();
my3DActor->SetStoreGemetryMapping(true);
@ -208,8 +210,10 @@ SMESH_ActorDef::SMESH_ActorDef()
aFilter->RegisterCellsWithType(VTK_HEXAHEDRON);
aFilter->RegisterCellsWithType(VTK_WEDGE);
aFilter->RegisterCellsWithType(VTK_PYRAMID);
aFilter->RegisterCellsWithType(VTK_HEXAGONAL_PRISM);
aFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA);
aFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
aFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON);
aFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
aFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID);
aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
@ -231,8 +235,10 @@ SMESH_ActorDef::SMESH_ActorDef()
aFilter->RegisterCellsWithType(VTK_HEXAHEDRON);
aFilter->RegisterCellsWithType(VTK_WEDGE);
aFilter->RegisterCellsWithType(VTK_PYRAMID);
aFilter->RegisterCellsWithType(VTK_HEXAGONAL_PRISM);
aFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA);
aFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
aFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON);
aFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
aFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID);
aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
@ -1336,12 +1342,14 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode)
aFilter->RegisterCellsWithType(VTK_QUAD);
aFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE);
aFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD);
aFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUAD);
aHightFilter->RegisterCellsWithType(VTK_TRIANGLE);
aHightFilter->RegisterCellsWithType(VTK_POLYGON);
aHightFilter->RegisterCellsWithType(VTK_QUAD);
aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE);
aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD);
aHightFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUAD);
}
if (myEntityMode & eVolumes) {
@ -1351,8 +1359,10 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode)
aFilter->RegisterCellsWithType(VTK_HEXAHEDRON);
aFilter->RegisterCellsWithType(VTK_WEDGE);
aFilter->RegisterCellsWithType(VTK_PYRAMID);
aFilter->RegisterCellsWithType(VTK_HEXAGONAL_PRISM);
aFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA);
aFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
aFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON);
aFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
//#ifdef VTK_HAVE_POLYHEDRON
@ -1364,8 +1374,10 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode)
aHightFilter->RegisterCellsWithType(VTK_HEXAHEDRON);
aHightFilter->RegisterCellsWithType(VTK_WEDGE);
aHightFilter->RegisterCellsWithType(VTK_PYRAMID);
aHightFilter->RegisterCellsWithType(VTK_HEXAGONAL_PRISM);
aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA);
aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
aHightFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON);
aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID);
aHightFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);

View File

@ -101,6 +101,7 @@ static inline vtkIdType getCellType( const SMDSAbs_ElementType theType,
else if ( theNbNodes == 4 ) return VTK_QUAD;
else if ( theNbNodes == 6 ) return VTK_QUADRATIC_TRIANGLE;
else if ( theNbNodes == 8 ) return VTK_QUADRATIC_QUAD;
else if ( theNbNodes == 9 ) return VTK_BIQUADRATIC_QUAD;
else return VTK_EMPTY_CELL;
case SMDSAbs_Volume:
@ -109,18 +110,12 @@ static inline vtkIdType getCellType( const SMDSAbs_ElementType theType,
else if ( theNbNodes == 5 ) return VTK_PYRAMID;
else if ( theNbNodes == 6 ) return VTK_WEDGE;
else if ( theNbNodes == 8 ) return VTK_HEXAHEDRON;
else if ( theNbNodes == 10 ) {
return VTK_QUADRATIC_TETRA;
}
else if ( theNbNodes == 20 ) {
return VTK_QUADRATIC_HEXAHEDRON;
}
else if ( theNbNodes == 15 ) {
return VTK_QUADRATIC_WEDGE;
}
else if ( theNbNodes==13 ) {
return VTK_QUADRATIC_PYRAMID; //VTK_CONVEX_POINT_SET;
}
else if ( theNbNodes == 12 ) return VTK_HEXAGONAL_PRISM;
else if ( theNbNodes == 10 ) return VTK_QUADRATIC_TETRA;
else if ( theNbNodes == 20 ) return VTK_QUADRATIC_HEXAHEDRON;
else if ( theNbNodes == 27 ) return VTK_TRIQUADRATIC_HEXAHEDRON;
else if ( theNbNodes == 15 ) return VTK_QUADRATIC_WEDGE;
else if ( theNbNodes == 13 ) return VTK_QUADRATIC_PYRAMID; //VTK_CONVEX_POINT_SET;
else return VTK_EMPTY_CELL;
default: return VTK_EMPTY_CELL;
@ -277,7 +272,7 @@ void SMESH_VisualObjDef::buildPrs(bool buildGrid)
GetMesh()->compactMesh();
}
vtkUnstructuredGrid *theGrid = GetMesh()->getGrid();
updateEntitiesFlags();
updateEntitiesFlags();
myGrid->ShallowCopy(theGrid);
//MESSAGE(myGrid->GetReferenceCount());
//MESSAGE( "Update - myGrid->GetNumberOfCells() = "<<myGrid->GetNumberOfCells() );
@ -372,22 +367,22 @@ void SMESH_VisualObjDef::buildElemPrs()
const TEntityList& aList = anEnts[ aTypes[ i ] ];
TEntityList::const_iterator anIter;
for ( anIter = aList.begin(); anIter != aList.end(); ++anIter ) {
if((*anIter)->GetEntityType() != SMDSEntity_Polyhedra &&
(*anIter)->GetEntityType() != SMDSEntity_Quad_Polyhedra) {
aCellsSize += (*anIter)->NbNodes() + 1;
}
// Special case for the VTK_POLYHEDRON:
// itsinput cellArray is of special format.
// [nCellFaces, nFace0Pts, i, j, k, nFace1Pts, i, j, k, ...]
else {
if( const SMDS_VtkVolume* ph = dynamic_cast<const SMDS_VtkVolume*>(*anIter) ) {
int nbFaces = ph->NbFaces();
aCellsSize += (1 + ph->NbFaces());
for( int i = 1; i <= nbFaces; i++ ) {
aCellsSize += ph->NbFaceNodes(i);
}
}
}
if((*anIter)->GetEntityType() != SMDSEntity_Polyhedra &&
(*anIter)->GetEntityType() != SMDSEntity_Quad_Polyhedra) {
aCellsSize += (*anIter)->NbNodes() + 1;
}
// Special case for the VTK_POLYHEDRON:
// itsinput cellArray is of special format.
// [nCellFaces, nFace0Pts, i, j, k, nFace1Pts, i, j, k, ...]
else {
if( const SMDS_VtkVolume* ph = dynamic_cast<const SMDS_VtkVolume*>(*anIter) ) {
int nbFaces = ph->NbFaces();
aCellsSize += (1 + ph->NbFaces());
for( int i = 1; i <= nbFaces; i++ ) {
aCellsSize += ph->NbFaceNodes(i);
}
}
}
}
}
}
@ -429,102 +424,55 @@ void SMESH_VisualObjDef::buildElemPrs()
for ( anIter = aList.begin(); anIter != aList.end(); ++anIter )
{
const SMDS_MeshElement* anElem = *anIter;
vtkIdType aNbNodes = anElem->NbNodes();
anIdList->SetNumberOfIds( aNbNodes );
const vtkIdType vtkElemType = getCellType( aType, anElem->IsPoly(), aNbNodes );
int anId = anElem->GetID();
mySMDS2VTKElems.insert( TMapOfIds::value_type( anId, iElem ) );
myVTK2SMDSElems.insert( TMapOfIds::value_type( iElem, anId ) );
SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator();
switch (aType) {
case SMDSAbs_Volume: {
aConnect.clear();
std::vector<int> aConnectivities;
{
// Convertions connectivities from SMDS to VTK
if (anElem->IsPoly() && aNbNodes > 3) { // POLYEDRE
anIdList->Reset();
if (aType == SMDSAbs_Volume && anElem->IsPoly() && aNbNodes > 3) { // POLYEDRE
anIdList->Reset();
if ( const SMDS_VtkVolume* ph = dynamic_cast<const SMDS_VtkVolume*>(anElem) ) {
int nbFaces = ph->NbFaces();
anIdList->InsertNextId(nbFaces);
for( int i = 1; i <= nbFaces; i++ ) {
anIdList->InsertNextId(ph->NbFaceNodes(i));
for(int j = 1; j <= ph->NbFaceNodes(i); j++) {
const SMDS_MeshNode* n = ph->GetFaceNode(i,j);
if(n) {
anIdList->InsertNextId(mySMDS2VTKNodes[n->GetID()]);
}
}
}
int nbFaces = ph->NbFaces();
anIdList->InsertNextId(nbFaces);
for( int i = 1; i <= nbFaces; i++ ) {
anIdList->InsertNextId(ph->NbFaceNodes(i));
for(int j = 1; j <= ph->NbFaceNodes(i); j++) {
const SMDS_MeshNode* n = ph->GetFaceNode(i,j);
if(n) {
anIdList->InsertNextId(mySMDS2VTKNodes[n->GetID()]);
}
}
}
}
} else if (aNbNodes == 4) {
static int anIds[] = {0,2,1,3};
for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
} else if (aNbNodes == 5) {
static int anIds[] = {0,3,2,1,4};
for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
} else if (aNbNodes == 6) {
static int anIds[] = {0,1,2,3,4,5};
for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
}
else if (aNbNodes == 8) {
static int anIds[] = {0,3,2,1,4,7,6,5};
for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
}
else if (aNbNodes == 10) {
static int anIds[] = {0,2,1,3,6,5,4,7,9,8};
for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
}
else if (aNbNodes == 13) {
static int anIds[] = {0,3,2,1,4,8,7,6,5,9,12,11,10};
for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
}
else if (aNbNodes == 15) {
//static int anIds[] = {0,2,1,3,5,4,8,7,6,11,10,9,12,14,13};
static int anIds[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14};
for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
//for (int k = 0; k < aNbNodes; k++) {
// int nn = aConnectivities[k];
// const SMDS_MeshNode* N = static_cast<const SMDS_MeshNode*> (aConnect[nn]);
// cout<<"k="<<k<<" N("<<N->X()<<","<<N->Y()<<","<<N->Z()<<")"<<endl;
//}
}
else if (aNbNodes == 20) {
static int anIds[] = {0,3,2,1,4,7,6,5,11,10,9,8,15,14,13,12,16,19,18,17};
for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
}
else {
}
if (!(anElem->IsPoly() && aNbNodes > 3)) {
if ( aConnect.empty() )
GetConnect(aNodesIter,aConnect);
if (aConnectivities.size() > 0) {
for (vtkIdType aNodeId = 0; aNodeId < aNbNodes; aNodeId++)
SetId(anIdList,mySMDS2VTKNodes,aConnect,aNodeId,aConnectivities[aNodeId]);
}
}
break;
}
default:
for( vtkIdType aNodeId = 0; aNodesIter->more(); aNodeId++ ){
const SMDS_MeshElement* aNode = aNodesIter->next();
anIdList->SetId( aNodeId, mySMDS2VTKNodes[aNode->GetID()] );
const std::vector<int>& aConnectivities =
SMDS_MeshCell::toVtkOrder( VTKCellType( vtkElemType ));
if (aConnectivities.size() > 0) {
aConnect.clear();
GetConnect(aNodesIter,aConnect);
for (vtkIdType aNodeId = 0; aNodeId < aNbNodes; aNodeId++)
SetId(anIdList,mySMDS2VTKNodes,aConnect,aNodeId,aConnectivities[aNodeId]);
}
else {
for( vtkIdType aNodeId = 0; aNodesIter->more(); aNodeId++ ){
const SMDS_MeshElement* aNode = aNodesIter->next();
anIdList->SetId( aNodeId, mySMDS2VTKNodes[aNode->GetID()] );
}
}
}
}
aConnectivity->InsertNextCell( anIdList );
aCellTypesArray->InsertNextValue( getCellType( aType, anElem->IsPoly(), aNbNodes ) );
aCellTypesArray->InsertNextValue( vtkElemType );
iElem++;
}
@ -601,7 +549,7 @@ vtkUnstructuredGrid* SMESH_VisualObjDef::GetUnstructuredGrid()
if ( !myLocalGrid && !GetMesh()->isCompacted() )
{
GetMesh()->compactMesh();
updateEntitiesFlags();
updateEntitiesFlags();
vtkUnstructuredGrid *theGrid = GetMesh()->getGrid();
myGrid->ShallowCopy(theGrid);
}
@ -629,29 +577,29 @@ bool SMESH_VisualObjDef::IsValid() const
//=================================================================================
void SMESH_VisualObjDef::updateEntitiesFlags() {
unsigned int tmp = myEntitiesState;
ClearEntitiesFlags();
unsigned int tmp = myEntitiesState;
ClearEntitiesFlags();
map<SMDSAbs_ElementType,int> entities = SMESH::GetEntitiesFromObject(this);
map<SMDSAbs_ElementType,int> entities = SMESH::GetEntitiesFromObject(this);
if( myEntitiesCache[SMDSAbs_0DElement] != 0 || myEntitiesCache[SMDSAbs_0DElement] >= entities[SMDSAbs_0DElement] )
myEntitiesState &= ~SMESH_Actor::e0DElements;
if( myEntitiesCache[SMDSAbs_0DElement] != 0 || myEntitiesCache[SMDSAbs_0DElement] >= entities[SMDSAbs_0DElement] )
myEntitiesState &= ~SMESH_Actor::e0DElements;
if( myEntitiesCache[SMDSAbs_Edge] != 0 || myEntitiesCache[SMDSAbs_Edge] >= entities[SMDSAbs_Edge] )
myEntitiesState &= ~SMESH_Actor::eEdges;
if( myEntitiesCache[SMDSAbs_Edge] != 0 || myEntitiesCache[SMDSAbs_Edge] >= entities[SMDSAbs_Edge] )
myEntitiesState &= ~SMESH_Actor::eEdges;
if( myEntitiesCache[SMDSAbs_Face] != 0 || myEntitiesCache[SMDSAbs_Face] >= entities[SMDSAbs_Face] )
myEntitiesState &= ~SMESH_Actor::eFaces;
if( myEntitiesCache[SMDSAbs_Face] != 0 || myEntitiesCache[SMDSAbs_Face] >= entities[SMDSAbs_Face] )
myEntitiesState &= ~SMESH_Actor::eFaces;
if( myEntitiesCache[SMDSAbs_Volume] != 0 || myEntitiesCache[SMDSAbs_Volume] >= entities[SMDSAbs_Volume] )
myEntitiesState &= ~SMESH_Actor::eVolumes;
if( myEntitiesCache[SMDSAbs_Volume] != 0 || myEntitiesCache[SMDSAbs_Volume] >= entities[SMDSAbs_Volume] )
myEntitiesState &= ~SMESH_Actor::eVolumes;
if( tmp != myEntitiesState ) {
myEntitiesFlag = true;
}
myEntitiesCache = entities;
if( tmp != myEntitiesState ) {
myEntitiesFlag = true;
}
myEntitiesCache = entities;
}
//=================================================================================
@ -659,8 +607,8 @@ void SMESH_VisualObjDef::updateEntitiesFlags() {
// purpose : Clear the entities flags
//=================================================================================
void SMESH_VisualObjDef::ClearEntitiesFlags() {
myEntitiesState = SMESH_Actor::eAllEntity;
myEntitiesFlag = false;
myEntitiesState = SMESH_Actor::eAllEntity;
myEntitiesFlag = false;
}
//=================================================================================
@ -668,7 +616,7 @@ void SMESH_VisualObjDef::ClearEntitiesFlags() {
// purpose : Return the entities flag
//=================================================================================
bool SMESH_VisualObjDef::GetEntitiesFlag() {
return myEntitiesFlag;
return myEntitiesFlag;
}
//=================================================================================
@ -676,7 +624,7 @@ bool SMESH_VisualObjDef::GetEntitiesFlag() {
// purpose : Return the entities state
//=================================================================================
unsigned int SMESH_VisualObjDef::GetEntitiesState() {
return myEntitiesState;
return myEntitiesState;
}
/*

View File

@ -272,7 +272,7 @@ libSMESH_la_LDFLAGS = \
$(GUI_LDFLAGS) -lSalomePrs -lsuit -lSUITApp -lCAM -lstd \
$(GEOM_LDFLAGS) -lGEOMBase -lGEOMFiltersSelection -lGEOMObject \
$(PYTHON_LIBS)
# resources files
nodist_salomeres_DATA= \
SMESH_images.qm \

View File

@ -437,8 +437,12 @@
{
// warn the user about presence of not supported elements
SMESH::long_array_var nbElems = aMeshOrGroup->GetMeshInfo();
int nbPyramids = nbElems[ SMESH::Entity_Pyramid ] + nbElems[ SMESH::Entity_Quad_Pyramid ];
if ( nbPyramids > 0 ) {
int nbNotSupported = ( nbElems[ SMESH::Entity_Pyramid ] +
nbElems[ SMESH::Entity_Quad_Pyramid ] +
nbElems[ SMESH::Entity_Hexagonal_Prism ] +
nbElems[ SMESH::Entity_Polygon ] +
nbElems[ SMESH::Entity_Polyhedra ] );
if ( nbNotSupported > 0 ) {
int aRet = SUIT_MessageBox::warning
(SMESHGUI::desktop(),
QObject::tr("SMESH_WRN_WARNING"),
@ -2799,36 +2803,42 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
}
case 4009: // ELEM0D
case 4010: // GEOM::EDGE
case 4010: // EDGE
case 4021: // TRIANGLE
case 4022: // QUAD
case 4023: // POLYGON
case 4031: // TETRA
case 4032: // HEXA
case 4133: // PENTA
case 4134: // PYRAMID
case 4135: // OCTA12
{
if(checkLock(aStudy)) break;
if ( vtkwnd ) {
EmitSignalDeactivateDialog();
SMDSAbs_ElementType type = SMDSAbs_Edge;
int nbNodes = 2;
SMDSAbs_EntityType type = SMDSEntity_Edge;
switch (theCommandID) {
case 4009: // ELEM0D
type = SMDSAbs_0DElement; nbNodes = 1; break;
case 4021: // TRIANGLE
type = SMDSAbs_Face; nbNodes = 3; break;
case 4022: // QUAD
type = SMDSAbs_Face; nbNodes = 4; break;
case 4031: // TETRA
type = SMDSAbs_Volume; nbNodes = 4; break;
case 4023: // POLYGON
type = SMDSAbs_Face; nbNodes = 5; break; // 5 - identificator for POLYGON
case 4032: // HEXA
type = SMDSAbs_Volume; nbNodes = 8; break;
case 4033: // POLYHEDRE
type = SMDSAbs_Volume; nbNodes = 9; break; // 9 - identificator for POLYHEDRE
case 4009:
type = SMDSEntity_0D; break;
case 4021:
type = SMDSEntity_Triangle; break;
case 4022:
type = SMDSEntity_Quadrangle; break;
case 4031:
type = SMDSEntity_Tetra; break;
case 4023:
type = SMDSEntity_Polygon; break;
case 4032:
type = SMDSEntity_Hexa; break;
case 4133:
type = SMDSEntity_Penta; break;
case 4134:
type = SMDSEntity_Pyramid; break;
case 4135:
type = SMDSEntity_Hexagonal_Prism; break;
default:;
}
( new SMESHGUI_AddMeshElementDlg( this, type, nbNodes ) )->show();
( new SMESHGUI_AddMeshElementDlg( this, type ) )->show();
}
else {
SUIT_MessageBox::warning(desktop(),
@ -2852,31 +2862,37 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
case 4034: // QUADRATIC EDGE
case 4035: // QUADRATIC TRIANGLE
case 4036: // QUADRATIC QUADRANGLE
case 4136: // BIQUADRATIC QUADRANGLE
case 4037: // QUADRATIC TETRAHEDRON
case 4038: // QUADRATIC PYRAMID
case 4039: // QUADRATIC PENTAHEDRON
case 4040: // QUADRATIC HEXAHEDRON
case 4140: // TRIQUADRATIC HEXAHEDRON
{
if(checkLock(aStudy)) break;
if ( vtkwnd ) {
EmitSignalDeactivateDialog();
int type;
SMDSAbs_EntityType type;
switch (theCommandID) {
case 4034:
type = QUAD_EDGE; break;
type = SMDSEntity_Quad_Edge; break;
case 4035:
type = QUAD_TRIANGLE; break;
type = SMDSEntity_Quad_Triangle; break;
case 4036:
type = QUAD_QUADRANGLE; break;
type = SMDSEntity_Quad_Quadrangle; break;
case 4136:
type = SMDSEntity_BiQuad_Quadrangle; break;
case 4037:
type = QUAD_TETRAHEDRON; break;
type = SMDSEntity_Quad_Tetra; break;
case 4038:
type = QUAD_PYRAMID; break;
type = SMDSEntity_Quad_Pyramid; break;
case 4039:
type = QUAD_PENTAHEDRON; break;
type = SMDSEntity_Quad_Penta; break;
case 4040:
type = QUAD_HEXAHEDRON;
type = SMDSEntity_Quad_Hexa;
case 4140:
type = SMDSEntity_TriQuad_Hexa;
break;
default:;
}
@ -2985,7 +3001,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
}
catch (const SALOME::SALOME_Exception& S_ex) {
SalomeApp_Tools::QtCatchCorbaException(S_ex);
}
}
catch (...) {
}
}
@ -3295,7 +3311,7 @@ void SMESHGUI::BuildPresentation( const Handle(SALOME_InteractiveObject) & theIO
// function : createSMESHAction
// purpose :
//=======================================================================
void SMESHGUI::createSMESHAction( const int id, const QString& po_id, const QString& icon_id,
void SMESHGUI::createSMESHAction( const int id, const QString& po_id, const QString& icon_id,
const int key, const bool toggle, const QString& shortcutAction )
{
QIcon icon;
@ -3313,7 +3329,7 @@ void SMESHGUI::createSMESHAction( const int id, const QString& po_id, const QStr
menu = tr( QString( "MEN_%1" ).arg( po_id ).toLatin1().data() ),
status_bar = tr( QString( "STB_%1" ).arg( po_id ).toLatin1().data() );
createAction( id, tooltip, icon, menu, status_bar, key, parent,
createAction( id, tooltip, icon, menu, status_bar, key, parent,
toggle, this, SLOT( OnGUIEvent() ), shortcutAction );
}
@ -3445,9 +3461,22 @@ void SMESHGUI::initialize( CAM_Application* app )
createSMESHAction( 4023, "POLYGON", "ICON_DLG_POLYGON" );
createSMESHAction( 4031, "TETRA", "ICON_DLG_TETRAS" );
createSMESHAction( 4032, "HEXA", "ICON_DLG_HEXAS" );
createSMESHAction( 4041, "REMOVE_NODES", "ICON_DLG_REM_NODE" );
createSMESHAction( 4042, "REMOVE_ELEMENTS", "ICON_DLG_REM_ELEMENT" );
createSMESHAction( 4044, "REMOVE_ORPHAN_NODES", "ICON_DLG_REM_ORPHAN_NODES" );
createSMESHAction( 4133, "PENTA", "ICON_DLG_PENTA" );
createSMESHAction( 4134, "PYRAMID", "ICON_DLG_PYRAMID" );
createSMESHAction( 4135, "OCTA", "ICON_DLG_OCTA" );
createSMESHAction( 4033, "POLYHEDRON", "ICON_DLG_POLYHEDRON" );
createSMESHAction( 4034, "QUADRATIC_EDGE", "ICON_DLG_QUADRATIC_EDGE" );
createSMESHAction( 4035, "QUADRATIC_TRIANGLE", "ICON_DLG_QUADRATIC_TRIANGLE" );
createSMESHAction( 4036, "QUADRATIC_QUADRANGLE", "ICON_DLG_QUADRATIC_QUADRANGLE" );
createSMESHAction( 4136, "BIQUADRATIC_QUADRANGLE", "ICON_DLG_BIQUADRATIC_QUADRANGLE" );
createSMESHAction( 4037, "QUADRATIC_TETRAHEDRON", "ICON_DLG_QUADRATIC_TETRAHEDRON" );
createSMESHAction( 4038, "QUADRATIC_PYRAMID", "ICON_DLG_QUADRATIC_PYRAMID" );
createSMESHAction( 4039, "QUADRATIC_PENTAHEDRON", "ICON_DLG_QUADRATIC_PENTAHEDRON" );
createSMESHAction( 4040, "QUADRATIC_HEXAHEDRON", "ICON_DLG_QUADRATIC_HEXAHEDRON" );
createSMESHAction( 4140, "TRIQUADRATIC_HEXAHEDRON", "ICON_DLG_TRIQUADRATIC_HEXAHEDRON" );
createSMESHAction( 4041, "REMOVE_NODES", "ICON_DLG_REM_NODE" );
createSMESHAction( 4042, "REMOVE_ELEMENTS", "ICON_DLG_REM_ELEMENT" );
createSMESHAction( 4044, "REMOVE_ORPHAN_NODES", "ICON_DLG_REM_ORPHAN_NODES" );
createSMESHAction( 4043, "CLEAR_MESH" , "ICON_CLEAR_MESH" );
createSMESHAction( 4051, "RENUM_NODES", "ICON_DLG_RENUMBERING_NODES" );
createSMESHAction( 4052, "RENUM_ELEMENTS", "ICON_DLG_RENUMBERING_ELEMENTS" );
@ -3514,14 +3543,6 @@ void SMESHGUI::initialize( CAM_Application* app )
createSMESHAction( 300, "ERASE" );
createSMESHAction( 301, "DISPLAY" );
createSMESHAction( 302, "DISPLAY_ONLY" );
createSMESHAction( 4033, "POLYHEDRON", "ICON_DLG_POLYHEDRON" );
createSMESHAction( 4034, "QUADRATIC_EDGE", "ICON_DLG_QUADRATIC_EDGE" );
createSMESHAction( 4035, "QUADRATIC_TRIANGLE", "ICON_DLG_QUADRATIC_TRIANGLE" );
createSMESHAction( 4036, "QUADRATIC_QUADRANGLE", "ICON_DLG_QUADRATIC_QUADRANGLE" );
createSMESHAction( 4037, "QUADRATIC_TETRAHEDRON", "ICON_DLG_QUADRATIC_TETRAHEDRON" );
createSMESHAction( 4038, "QUADRATIC_PYRAMID", "ICON_DLG_QUADRATIC_PYRAMID" );
createSMESHAction( 4039, "QUADRATIC_PENTAHEDRON", "ICON_DLG_QUADRATIC_PENTAHEDRON" );
createSMESHAction( 4040, "QUADRATIC_HEXAHEDRON", "ICON_DLG_QUADRATIC_HEXAHEDRON" );
// ----- create menu --------------
int fileId = createMenu( tr( "MEN_FILE" ), -1, 1 ),
@ -3628,15 +3649,20 @@ void SMESHGUI::initialize( CAM_Application* app )
createMenu( 4023, addId, -1 );
createMenu( 4031, addId, -1 );
createMenu( 4032, addId, -1 );
createMenu( 4133, addId, -1 );
createMenu( 4134, addId, -1 );
createMenu( 4135, addId, -1 );
createMenu( 4033, addId, -1 );
createMenu( separator(), addId, -1 );
createMenu( 4034, addId, -1 );
createMenu( 4035, addId, -1 );
createMenu( 4036, addId, -1 );
createMenu( 4136, addId, -1 );
createMenu( 4037, addId, -1 );
createMenu( 4038, addId, -1 );
createMenu( 4039, addId, -1 );
createMenu( 4040, addId, -1 );
createMenu( 4140, addId, -1 );
createMenu( 4041, removeId, -1 );
createMenu( 4042, removeId, -1 );
@ -3742,15 +3768,20 @@ void SMESHGUI::initialize( CAM_Application* app )
createTool( 4023, addRemTb );
createTool( 4031, addRemTb );
createTool( 4032, addRemTb );
createTool( 4133, addRemTb );
createTool( 4134, addRemTb );
createTool( 4135, addRemTb );
createTool( 4033, addRemTb );
createTool( separator(), addRemTb );
createTool( 4034, addRemTb );
createTool( 4035, addRemTb );
createTool( 4036, addRemTb );
createTool( 4136, addRemTb );
createTool( 4037, addRemTb );
createTool( 4038, addRemTb );
createTool( 4039, addRemTb );
createTool( 4040, addRemTb );
createTool( 4140, addRemTb );
createTool( separator(), addRemTb );
createTool( 4041, addRemTb );
createTool( 4042, addRemTb );
@ -3852,7 +3883,7 @@ void SMESHGUI::initialize( CAM_Application* app )
popupMgr()->insert( separator(), -1, 0 );
createPopupItem( 417, OB, mesh + " " + subMesh ); // convert to quadratic
createPopupItem( 418, OB, mesh + " " + group, // create 2D mesh from 3D
"&& dim>=2");
"&& dim>=2");
popupMgr()->insert( separator(), -1, 0 );
QString only_one_non_empty = QString( " && %1=1 && numberOfNodes>0" ).arg( dc );
@ -4225,7 +4256,7 @@ bool SMESHGUI::activateModule( SUIT_Study* study )
GetSMESHGen()->SetCurrentStudy( _CAST(Study,aStudy)->GetStudy() );
updateObjBrowser(); // objects can be removed
}
// get all view currently opened in the study and connect their signals to
// the corresponding slots of the class.
SUIT_Desktop* aDesk = study->application()->desktop();
@ -4333,7 +4364,7 @@ void SMESHGUI::onViewManagerActivated( SUIT_ViewManager* mgr )
{
if ( dynamic_cast<SVTK_ViewManager*>( mgr ) ) {
SMESH::UpdateSelectionProp( this );
QVector<SUIT_ViewWindow*> aViews = mgr->getViews();
for(int i = 0; i < aViews.count() ; i++){
SUIT_ViewWindow *sf = aViews[i];
@ -4519,7 +4550,7 @@ void SMESHGUI::createPreferences()
setPreferenceProperty( chunkSize, "min", 0 );
setPreferenceProperty( chunkSize, "max", 1000 );
setPreferenceProperty( chunkSize, "step", 50 );
// Mesh tab ------------------------------------------------------------------------
int meshTab = addPreference( tr( "PREF_TAB_MESH" ) );
int nodeGroup = addPreference( tr( "PREF_GROUP_NODES" ), meshTab );
@ -4557,10 +4588,10 @@ void SMESHGUI::createPreferences()
int ColorId = addPreference( tr( "PREF_FILL" ), elemGroup, LightApp_Preferences::BiColor, "SMESH", "fill_color" );
addPreference( tr( "PREF_COLOR_0D" ), elemGroup, LightApp_Preferences::Color, "SMESH", "elem0d_color" );
addPreference( tr( "PREF_OUTLINE" ), elemGroup, LightApp_Preferences::Color, "SMESH", "outline_color" );
addPreference( tr( "PREF_WIREFRAME" ), elemGroup, LightApp_Preferences::Color, "SMESH", "wireframe_color" );
setPreferenceProperty( ColorId, "text", tr("PREF_BACKFACE") );
int grpGroup = addPreference( tr( "PREF_GROUP_GROUPS" ), meshTab );
@ -4697,12 +4728,12 @@ void SMESHGUI::createPreferences()
setPreferenceProperty( hh, "min", 0.0 );
setPreferenceProperty( hh, "max", 1.0 );
setPreferenceProperty( hh, "step", 0.1 );
int distributionGr = addPreference( tr( "SMESH_DISTRIBUTION_SCALARBAR" ), sbarTab, LightApp_Preferences::Auto, "SMESH", "distribution_visibility" );
int coloringType = addPreference( tr( "SMESH_DISTRIBUTION_COLORING_TYPE" ), distributionGr, LightApp_Preferences::Selector, "SMESH", "distribution_coloring_type" );
setPreferenceProperty( distributionGr, "columns", 3 );
QStringList types;
types.append( tr( "SMESH_MONOCOLOR" ) );
types.append( tr( "SMESH_MONOCOLOR" ) );
types.append( tr( "SMESH_MULTICOLOR" ) );
indices.clear(); indices.append( 0 ); indices.append( 1 );
setPreferenceProperty( coloringType, "strings", types );
@ -5132,7 +5163,7 @@ void SMESHGUI::storeVisualParameters (int savePoint)
// Colors (surface:edge:)
vtkFloatingPointType r, g, b;
int delta;
aSmeshActor->GetSufaceColor(r, g, b, delta);
QString colorStr ("surface");
colorStr += gDigitsSep; colorStr += QString::number(r);
@ -5141,7 +5172,7 @@ void SMESHGUI::storeVisualParameters (int savePoint)
colorStr += gDigitsSep; colorStr += "backsurface";
colorStr += gDigitsSep; colorStr += QString::number(delta);
aSmeshActor->GetEdgeColor(r, g, b);
colorStr += gDigitsSep; colorStr += "edge";
@ -5211,7 +5242,7 @@ void SMESHGUI::storeVisualParameters (int savePoint)
for ( ; anIter2 != anActorList.end(); anIter2++ ) {
if( aSmeshActor == *anIter2 ) {
ip->setParameter( entry, param + QString::number( ++aPlaneId ).toLatin1().constData(),
QString::number( anId ).toLatin1().constData() );
QString::number( anId ).toLatin1().constData() );
break;
}
}
@ -5376,7 +5407,7 @@ void SMESHGUI::restoreVisualParameters (int savePoint)
continue;
TPlaneDataList& aPlaneDataList = aPlaneDataMap[ aViewId ];
aPlaneDataList.push_back( aPlaneData );
aPlaneDataList.push_back( aPlaneData );
}
}
@ -5520,18 +5551,18 @@ void SMESHGUI::restoreVisualParameters (int savePoint)
"surface:r:g:b:backsurface:r:g:b:edge:r:g:b:node:r:g:b or surface:r:g:b:backsurface:delta:edge:r:g:b:node:r:g:b:outline:r:g:b");
}
else {
int delta = 0;
int delta = 0;
float er,eg,eb;
float nr,ng,nb;
vtkFloatingPointType otr,otg,otb;
//Old case backsurface color is independent
if( colors.count() == 16 ) {
QColor ffc;
SMESH::GetColor( "SMESH", "fill_color", ffc, delta, "0,170,255|-100" ) ;
SMESH::GetColor( "SMESH", "fill_color", ffc, delta, "0,170,255|-100" ) ;
er = colors[9].toFloat();
eg = colors[10].toFloat();
eb = colors[11].toFloat();
nr = colors[13].toFloat();
ng = colors[14].toFloat();
nb = colors[15].toFloat();
@ -5543,7 +5574,7 @@ void SMESHGUI::restoreVisualParameters (int savePoint)
er = colors[7].toFloat();
eg = colors[8].toFloat();
eb = colors[9].toFloat();
nr = colors[11].toFloat();
ng = colors[12].toFloat();
nb = colors[13].toFloat();
@ -5842,7 +5873,7 @@ void SMESHGUI::onViewClosed( SUIT_ViewWindow* pview ) {
#ifndef DISABLE_PLOT2DVIEWER
//Crear all Plot2d Viewers if need.
SMESH::ClearPlot2Viewers(pview);
#endif
#endif
}
/*!
@ -5852,17 +5883,17 @@ void SMESHGUI::onViewClosed( SUIT_ViewWindow* pview ) {
void SMESHGUI::connectView( const SUIT_ViewWindow* pview ) {
if(!pview)
return;
SUIT_ViewManager* viewMgr = pview->getViewManager();
if ( viewMgr ) {
disconnect( viewMgr, SIGNAL( deleteView( SUIT_ViewWindow* ) ),
this, SLOT( onViewClosed( SUIT_ViewWindow* ) ) );
connect( viewMgr, SIGNAL( deleteView( SUIT_ViewWindow* ) ),
this, SLOT( onViewClosed( SUIT_ViewWindow* ) ) );
}
}
/*!
\brief Return \c true if object can be renamed
*/
@ -5878,7 +5909,7 @@ bool SMESHGUI::renameAllowed( const QString& entry) const {
bool appRes = SalomeApp_Module::renameAllowed(entry);
if( !appRes )
return false;
// check type to prevent renaming of inappropriate objects
int aType = SMESHGUI_Selection::type(qPrintable(entry), aStudy);
if (aType == MESH || aType == GROUP ||
@ -5898,11 +5929,11 @@ bool SMESHGUI::renameAllowed( const QString& entry) const {
\brief Return \c true if rename operation finished successfully, \c false otherwise.
*/
bool SMESHGUI::renameObject( const QString& entry, const QString& name) {
SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( application() );
if( !anApp )
return false;
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); //Document OCAF de l'etude active
if( !aStudy )
return false;
@ -5910,7 +5941,7 @@ bool SMESHGUI::renameObject( const QString& entry, const QString& name) {
bool appRes = SalomeApp_Module::renameObject(entry,name);
if( !appRes )
return false;
_PTR(SObject) obj = aStudy->FindObjectID( qPrintable(entry) );
_PTR(GenericAttribute) anAttr;
_PTR(AttributeName) aName;
@ -5926,11 +5957,11 @@ bool SMESHGUI::renameObject( const QString& entry, const QString& name) {
aType == HYPOTHESIS || aType == ALGORITHM) {
if ( !name.isEmpty() ) {
SMESHGUI::GetSMESHGen()->SetName(obj->GetIOR().c_str(), qPrintable(name) );
// update name of group object and its actor
Handle(SALOME_InteractiveObject) IObject =
Handle(SALOME_InteractiveObject) IObject =
new SALOME_InteractiveObject ( qPrintable(entry), "SMESH", qPrintable(name) );
SMESH::SMESH_GroupBase_var aGroupObject = SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IObject);
if( !aGroupObject->_is_nil() ) {
aGroupObject->SetName( qPrintable(name) );
@ -5939,7 +5970,7 @@ bool SMESHGUI::renameObject( const QString& entry, const QString& name) {
}
return true;
}
}
}
}
}
return false;

View File

@ -157,43 +157,19 @@ namespace SMESH
typedef std::vector<vtkIdType> TVTKIds;
void SetPosition (SMESH_Actor* theActor,
vtkIdType theType,
const TVTKIds& theIds)
vtkIdType theType,
TVTKIds& theIds)
{
vtkUnstructuredGrid *aGrid = theActor->GetUnstructuredGrid();
myGrid->SetPoints(aGrid->GetPoints());
const int* aConn = NULL;
switch (theType) {
case VTK_TETRA:
{
static int anIds[] = {0,2,1,3};
aConn = anIds;
break;
}
case VTK_PYRAMID:
{
static int anIds[] = {0,3,2,1,4};
aConn = anIds;
break;
}
case VTK_HEXAHEDRON:
{
static int anIds[] = {0,3,2,1,4,7,6,5};
aConn = anIds;
break;
}
}
myGrid->Reset();
vtkIdList *anIds = vtkIdList::New();
if(aConn)
for (int i = 0, iEnd = theIds.size(); i < iEnd; i++)
anIds->InsertId(i,theIds[aConn[i]]);
else
for (int i = 0, iEnd = theIds.size(); i < iEnd; i++)
anIds->InsertId(i,theIds[i]);
const std::vector<int>& interlace = SMDS_MeshCell::toVtkOrder( VTKCellType( theType ));
SMDS_MeshCell::applyInterlace( interlace, theIds );
vtkIdList *anIds = vtkIdList::New();
for (int i = 0, iEnd = theIds.size(); i < iEnd; i++)
anIds->InsertId(i,theIds[i]);
myGrid->InsertNextCell(theType,anIds);
anIds->Delete();
@ -238,9 +214,8 @@ namespace SMESH
// function : SMESHGUI_AddMeshElementDlg()
// purpose : constructor
//=================================================================================
SMESHGUI_AddMeshElementDlg::SMESHGUI_AddMeshElementDlg( SMESHGUI* theModule,
SMDSAbs_ElementType ElementType,
int nbNodes )
SMESHGUI_AddMeshElementDlg::SMESHGUI_AddMeshElementDlg( SMESHGUI* theModule,
SMDSAbs_EntityType ElementType)
: QDialog( SMESH::GetDesktop( theModule ) ),
mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
@ -254,62 +229,72 @@ SMESHGUI_AddMeshElementDlg::SMESHGUI_AddMeshElementDlg( SMESHGUI* theModule,
myIsPoly = false;
mySimulation = new SMESH::TElementSimulation (anApp);
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
myGeomType = ElementType;
myElementType = SMDSAbs_Volume;
// verify nb nodes and type
myNbNodes = nbNodes;
myElementType = ElementType;
switch (ElementType) {
case SMDSAbs_0DElement:
if (myNbNodes != 1)
myNbNodes = 1;
break;
case SMDSAbs_Face:
// if (myNbNodes != 3 && myNbNodes != 4)
// myNbNodes = 3;
// break;
case SMDSAbs_Volume:
// if (myNbNodes != 4 && myNbNodes != 8) //(nbNodes < 4 || nbNodes > 8 || nbNodes == 7)
// myNbNodes = 4;
break;
default:
myElementType = SMDSAbs_Edge;
myNbNodes = 2;
}
QString elemName;
if (myNbNodes == 1) {
switch ( myGeomType ) {
case SMDSEntity_0D:
myNbNodes = 1;
myElementType = SMDSAbs_0DElement;
elemName = "ELEM0D";
myHelpFileName = "adding_nodes_and_elements_page.html#adding_0delems_anchor";
}
else if (myNbNodes == 2) {
break;
case SMDSEntity_Edge:
myNbNodes = 2;
myElementType = SMDSAbs_Edge;
elemName = "EDGE";
myHelpFileName = "adding_nodes_and_elements_page.html#adding_edges_anchor";
}
else if (myNbNodes == 3) {
break;
case SMDSEntity_Triangle:
myNbNodes = 3;
elemName = "TRIANGLE";
myElementType = SMDSAbs_Face;
myHelpFileName = "adding_nodes_and_elements_page.html#adding_triangles_anchor";
}
else if (myNbNodes == 4) {
if (myElementType == SMDSAbs_Face) {
elemName = "QUADRANGLE";
myHelpFileName = "adding_nodes_and_elements_page.html#adding_quadrangles_anchor";
}
else {
elemName = "TETRAS";
myHelpFileName = "adding_nodes_and_elements_page.html#adding_tetrahedrons_anchor";
}
}
else if (myNbNodes == 8) {
elemName = "HEXAS";
myHelpFileName = "adding_nodes_and_elements_page.html#adding_hexahedrons_anchor";
}
else if (myElementType == SMDSAbs_Face) {
break;
case SMDSEntity_Quadrangle:
myNbNodes = 4;
myElementType = SMDSAbs_Face;
elemName = "QUADRANGLE";
myHelpFileName = "adding_nodes_and_elements_page.html#adding_quadrangles_anchor";
break;
case SMDSEntity_Polygon:
myNbNodes = 0;
myElementType = SMDSAbs_Face;
elemName = "POLYGON";
myIsPoly = true;
myHelpFileName = "adding_nodes_and_elements_page.html#adding_polygons_anchor";
}
else if (myElementType == SMDSAbs_Volume) {
myHelpFileName = "adding_nodes_and_elements_page.html#adding_polyhedrons_anchor";
break;
case SMDSEntity_Tetra:
myNbNodes = 4;
elemName = "TETRAS";
myHelpFileName = "adding_nodes_and_elements_page.html#adding_tetrahedrons_anchor";
break;
case SMDSEntity_Pyramid:
myNbNodes = 5;
elemName = "PYRAMID";
myHelpFileName = "adding_nodes_and_elements_page.html#adding_pyramids_anchor";
break;
case SMDSEntity_Hexa:
myNbNodes = 8;
elemName = "HEXAS";
myHelpFileName = "adding_nodes_and_elements_page.html#adding_hexahedrons_anchor";
break;
case SMDSEntity_Penta:
myNbNodes = 6;
elemName = "PENTA";
myHelpFileName = "adding_nodes_and_elements_page.html#adding_pentahedrons_anchor";
break;
case SMDSEntity_Hexagonal_Prism:
myNbNodes = 12;
elemName = "OCTA";
myHelpFileName = "adding_nodes_and_elements_page.html#adding_octahedrons_anchor";
break;
default:
myNbNodes = 2;
elemName = "EDGE";
myHelpFileName = "adding_nodes_and_elements_page.html#adding_edges_anchor";
}
QString iconName = tr(QString("ICON_DLG_%1").arg(elemName).toLatin1().data());
@ -351,11 +336,9 @@ SMESHGUI_AddMeshElementDlg::SMESHGUI_AddMeshElementDlg( SMESHGUI* theModule,
SelectButtonC1A1 = new QPushButton(GroupC1);
SelectButtonC1A1->setIcon(image1);
LineEditC1A1 = new QLineEdit(GroupC1);
// LineEditC1A1->setReadOnly(true);
if (!myIsPoly)
LineEditC1A1->setValidator(new SMESHGUI_IdValidator(this, myNbNodes));
LineEditC1A1->setValidator(new SMESHGUI_IdValidator(this, myIsPoly ? 1000 : myNbNodes));
Reverse = myElementType == SMDSAbs_Face ? new QCheckBox(tr("SMESH_REVERSE"), GroupC1) : 0;
Reverse = (myElementType == SMDSAbs_Face || myElementType == SMDSAbs_Volume ) ? new QCheckBox(tr("SMESH_REVERSE"), GroupC1) : 0;
GroupC1Layout->addWidget(TextLabelC1A1, 0, 0);
GroupC1Layout->addWidget(SelectButtonC1A1, 0, 1);
@ -478,12 +461,16 @@ void SMESHGUI_AddMeshElementDlg::ClickOnApply()
myBusy = true;
SMESH::long_array_var anArrayOfIndices = new SMESH::long_array;
anArrayOfIndices->length(myNbNodes);
bool reverse = (Reverse && Reverse->isChecked());
QStringList aListId = myEditCurrentArgument->text().split(" ", QString::SkipEmptyParts);
for (int i = 0; i < aListId.count(); i++)
if (reverse)
anArrayOfIndices[i] = aListId[ myNbNodes - i - 1 ].toInt();
else
const std::vector<int>& revIndex = SMDS_MeshCell::reverseSmdsOrder( myGeomType );
if ( Reverse && Reverse->isChecked() && !revIndex.empty() )
for (int i = 0; i < aListId.count(); i++)
anArrayOfIndices[i] = aListId[ revIndex[i] ].toInt();
else if ( Reverse && Reverse->isChecked() && revIndex.empty() ) // polygon
for (int i = 0; i < aListId.count(); i++)
anArrayOfIndices[i] = aListId[ aListId.count()-1 - i ].toInt();
else
for (int i = 0; i < aListId.count(); i++)
anArrayOfIndices[i] = aListId[ i ].toInt();
bool addToGroup = GroupGroups->isChecked();
@ -517,16 +504,14 @@ void SMESHGUI_AddMeshElementDlg::ClickOnApply()
anElemId = aMeshEditor->Add0DElement(anArrayOfIndices[0]); break;
case SMDSAbs_Edge:
anElemId = aMeshEditor->AddEdge(anArrayOfIndices.inout()); break;
case SMDSAbs_Face: {
if(myIsPoly)
case SMDSAbs_Face:
if ( myIsPoly )
anElemId = aMeshEditor->AddPolygonalFace(anArrayOfIndices.inout());
else
anElemId = aMeshEditor->AddFace(anArrayOfIndices.inout());
break;
}
case SMDSAbs_Volume:
default:
anElemId = aMeshEditor->AddVolume(anArrayOfIndices.inout()); break;
default: break;
}
if ( anElemId != -1 && addToGroup && !aGroupName.isEmpty() ) {
@ -785,24 +770,15 @@ void SMESHGUI_AddMeshElementDlg::displaySimulation()
anIds.push_back(myActor->GetObject()->GetNodeVTKId(aListId[ i ].toInt()));
if (Reverse && Reverse->isChecked())
reverse(anIds.begin(),anIds.end());
vtkIdType aType = 0;
if (myIsPoly)
switch ( myElementType ) {
case SMDSAbs_Face : aType = VTK_POLYGON; break;
default: return;
}
else {
switch (myNbNodes) {
case 2: aType = VTK_LINE; break;
case 3: aType = VTK_TRIANGLE; break;
case 4: aType = myElementType == SMDSAbs_Face ? VTK_QUAD : VTK_TETRA; break;
case 8: aType = VTK_HEXAHEDRON; break;
default: return;
}
{
const std::vector<int>& i = SMDS_MeshCell::reverseSmdsOrder( myGeomType );
if ( i.empty() ) // polygon
std::reverse( anIds.begin(), anIds.end() );
else
SMDS_MeshCell::applyInterlace( i, anIds );
}
vtkIdType aType = SMDS_MeshCell::toVtkType( myGeomType );
mySimulation->SetPosition(myActor,aType,anIds);
SMESH::UpdateView();
}

View File

@ -65,7 +65,7 @@ class SMESHGUI_EXPORT SMESHGUI_AddMeshElementDlg : public QDialog
Q_OBJECT
public:
SMESHGUI_AddMeshElementDlg( SMESHGUI*, SMDSAbs_ElementType = SMDSAbs_Edge, int = 2 );
SMESHGUI_AddMeshElementDlg( SMESHGUI*, SMDSAbs_EntityType = SMDSEntity_Edge );
~SMESHGUI_AddMeshElementDlg();
private:
@ -88,6 +88,7 @@ private:
QLineEdit* myEditCurrentArgument; /* Current LineEdit */
SMDSAbs_EntityType myGeomType;
int myElementType;
int myNbNodes;
bool myIsPoly;

View File

@ -91,63 +91,26 @@
#define SPACING 6
#define MARGIN 11
namespace SMESH
namespace
{
void ReverseConnectivity( std::vector<vtkIdType> & ids, int type )
void ReverseConnectivity( std::vector<vtkIdType> & ids, SMDSAbs_EntityType type,
bool toReverse, // inverse element
bool toVtkOrder ) // smds connectivity to vtk one
{
// for reverse connectivity of other types keeping the first id, see
// void SMESH_VisualObjDef::buildElemPrs() in SMESH_Object.cxx:900
const int* conn = 0;
switch ( type ) {
case QUAD_TETRAHEDRON: {
static int aConn[] = {0,2,1,3,6,5,4,7,9,8};
conn = aConn;
break;
if ( toReverse ) // first reverse smds order
{
const std::vector<int>& index = SMDS_MeshCell::reverseSmdsOrder(type);
SMDS_MeshCell::applyInterlace( index, ids );
}
case QUAD_PYRAMID: {
static int aConn[] = {0,3,2,1,4,8,7,6,5,9,12,11,10};
conn = aConn;
break;
}
case QUAD_PENTAHEDRON: {
static int aConn[] = {0,2,1,3,5,4,8,7,6,11,10,9,12,14,13};
conn = aConn;
break;
}
case QUAD_HEXAHEDRON: {
static int aConn[] = {0,3,2,1,4,7,6,5,11,10,9,8,15,14,13,12,16,19,18,17};
conn = aConn;
break;
}
case QUAD_EDGE: {
static int aConn[] = {1,0,2};
conn = aConn;
break;
}
case QUAD_TRIANGLE: {
static int aConn[] = {0,2,1,5,4,3};
conn = aConn;
break;
}
case QUAD_QUADRANGLE: {
static int aConn[] = {0,3,2,1,7,6,5,4};
conn = aConn;
break;
}
default:;
}
if ( !conn ) {
reverse( ids.begin(), ids.end() );
}
else {
std::vector<vtkIdType> aRevIds( ids.size() );
for ( int i = 0; i < ids.size(); i++)
aRevIds[ i ] = ids[ conn[ i ]];
ids = aRevIds;
if ( toVtkOrder ) // from smds to vtk connectivity
{
const std::vector<int>& index = SMDS_MeshCell::toVtkOrder(type);
SMDS_MeshCell::applyInterlace( index, ids );
}
}
}
namespace SMESH
{
class TElementSimulation {
SalomeApp_Application* myApplication;
SUIT_ViewWindow* myViewWindow;
@ -221,85 +184,36 @@ namespace SMESH
}
typedef std::vector<vtkIdType> TVTKIds;
void SetPosition (SMESH_Actor* theActor,
const int theType,
TVTKIds& theIds,
const int theMode,
const bool theReverse)
void SetPosition (SMESH_Actor* theActor,
SMDSAbs_EntityType theType,
TVTKIds& theIds,
const int theMode,
const bool theReverse)
{
vtkUnstructuredGrid *aGrid = theActor->GetUnstructuredGrid();
myGrid->SetPoints(aGrid->GetPoints());
//add points
vtkIdType aType = 0;
ReverseConnectivity( theIds, theType, theReverse, /*toVtkOrder=*/true);
switch (theType) {
case QUAD_EDGE:
aType = VTK_QUADRATIC_EDGE;
break;
case QUAD_TRIANGLE:
aType = VTK_QUADRATIC_TRIANGLE;
break;
case QUAD_QUADRANGLE:
aType = VTK_QUADRATIC_QUAD;
break;
case QUAD_TETRAHEDRON:
aType = VTK_QUADRATIC_TETRA;
break;
case QUAD_PYRAMID:
//aType = VTK_QUADRATIC_PYRAMID; // NOT SUPPORTED IN VTK4.2
aType = VTK_CONVEX_POINT_SET;
break;
case QUAD_PENTAHEDRON:
aType = VTK_QUADRATIC_WEDGE;
//aType = VTK_CONVEX_POINT_SET;
break;
case QUAD_HEXAHEDRON:
aType = VTK_QUADRATIC_HEXAHEDRON;
break;
}
// take care of orientation
if ( aType == VTK_CONVEX_POINT_SET ) {
if ( theReverse && theMode == VTK_SURFACE ) {
//myPreviewActor->GetProperty()->SetColor( myBackRGB[0], myBackRGB[1], myBackRGB[2] );
}
}
else {
// VTK cell connectivity opposites the MED one for volumic elements
if( aType != VTK_QUADRATIC_WEDGE) {
if ( theIds.size() > 8 ? !theReverse : theReverse ) {
ReverseConnectivity( theIds, theType );
}
}
else if(theReverse)
ReverseConnectivity( theIds, theType );
}
myGrid->Reset();
vtkIdList *anIds = vtkIdList::New();
for (int i = 0, iEnd = theIds.size(); i < iEnd; i++) {
anIds->InsertId(i,theIds[i]);
//std::cout << i<< ": " << theIds[i] << std::endl;
}
vtkIdType aType = SMDS_MeshCell::toVtkType(theType);
myGrid->InsertNextCell(aType,anIds);
anIds->Delete();
myGrid->Modified();
myPreviewActor->GetMapper()->Update();
myPreviewActor->SetRepresentation( theMode );
SetVisibility(true, theActor->GetFacesOriented());
// restore normal orientation
if ( aType == VTK_CONVEX_POINT_SET ) {
if ( theReverse && theMode == VTK_SURFACE ) {
//myPreviewActor->GetProperty()->SetColor( myRGB[0], myRGB[1], myRGB[2] );
}
}
}
@ -412,49 +326,55 @@ QWidget* IdEditItem::createEditor() const
// purpose : constructor
//=================================================================================
SMESHGUI_AddQuadraticElementDlg::SMESHGUI_AddQuadraticElementDlg( SMESHGUI* theModule,
const int theType )
const SMDSAbs_EntityType theType )
: QDialog( SMESH::GetDesktop( theModule ) ),
mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
myType( theType ),
myBusy( false ),
myIsEditCorners( false )
myGeomType( theType ),
//myType( theType ),
myBusy( false )
{
setModal( false );
setAttribute( Qt::WA_DeleteOnClose, true );
SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
(SUIT_Session::session()->activeApplication());
mySimulation = new SMESH::TElementSimulation (anApp);
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
QString anElementName;
switch ( myType ) {
case QUAD_EDGE:
switch ( myGeomType ) {
case SMDSEntity_Quad_Edge:
anElementName = QString("QUADRATIC_EDGE");
break;
case QUAD_TRIANGLE:
case SMDSEntity_Quad_Triangle:
anElementName = QString("QUADRATIC_TRIANGLE");
break;
case QUAD_QUADRANGLE:
break;
case SMDSEntity_Quad_Quadrangle:
anElementName = QString("QUADRATIC_QUADRANGLE");
break;
case QUAD_TETRAHEDRON:
case SMDSEntity_BiQuad_Quadrangle:
anElementName = QString("BIQUADRATIC_QUADRANGLE");
break;
case SMDSEntity_Quad_Tetra:
anElementName = QString("QUADRATIC_TETRAHEDRON");
break;
case QUAD_PYRAMID:
case SMDSEntity_Quad_Pyramid:
anElementName = QString("QUADRATIC_PYRAMID");
break;
case QUAD_PENTAHEDRON:
case SMDSEntity_Quad_Penta:
anElementName = QString("QUADRATIC_PENTAHEDRON");
break;
case QUAD_HEXAHEDRON:
case SMDSEntity_Quad_Hexa:
anElementName = QString("QUADRATIC_HEXAHEDRON");
break;
case SMDSEntity_TriQuad_Hexa:
anElementName = QString("TRIQUADRATIC_HEXAHEDRON");
break;
default:
myType = QUAD_EDGE;
myGeomType = SMDSEntity_Quad_Edge;
anElementName = QString("QUADRATIC_EDGE");
}
@ -462,12 +382,12 @@ SMESHGUI_AddQuadraticElementDlg::SMESHGUI_AddQuadraticElementDlg( SMESHGUI* theM
QString caption = tr(QString("SMESH_ADD_%1_TITLE").arg(anElementName).toLatin1().data());
QString argumentsGrTitle = tr(QString("SMESH_ADD_%1").arg(anElementName).toLatin1().data());
QString constructorGrTitle = tr(QString("SMESH_%1").arg(anElementName).toLatin1().data());
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", iconName));
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
setWindowTitle(caption);
setSizeGripEnabled(true);
QVBoxLayout* aDialogLayout = new QVBoxLayout(this);
@ -492,22 +412,44 @@ SMESHGUI_AddQuadraticElementDlg::SMESHGUI_AddQuadraticElementDlg( SMESHGUI* theM
aGroupArgumentsLayout->setSpacing(SPACING);
aGroupArgumentsLayout->setMargin(MARGIN);
// Corner nodes
QLabel* aCornerNodesLabel = new QLabel(tr("SMESH_CORNER_NODES"), GroupArguments);
mySelectButton = new QPushButton(GroupArguments);
mySelectButton->setIcon(image1);
myCornerSelectButton = new QPushButton(GroupArguments);
myCornerSelectButton->setIcon(image1);
myCornerNodes = new QLineEdit(GroupArguments);
// Mid-edge nodes
myTable = new QTableWidget(GroupArguments);
// Mid-face nodes
myMidFaceLabel = new QLabel(tr("SMESH_MIDFACE_NODES"), GroupArguments);
myMidFaceSelectButton = new QPushButton(GroupArguments);
myMidFaceSelectButton->setIcon(image1);
myMidFaceNodes = new QLineEdit(GroupArguments);
myMidFaceNodes->setValidator(new SMESHGUI_IdValidator(this, 6));
// Central node
myCenterLabel = new QLabel(tr("SMESH_CENTER_NODE"), GroupArguments);
myCenterSelectButton = new QPushButton(GroupArguments);
myCenterSelectButton->setIcon(image1);
myCenterNode = new QLineEdit(GroupArguments);
myCenterNode->setValidator(new SMESHGUI_IdValidator(this, 1));
myReverseCB = new QCheckBox(tr("SMESH_REVERSE"), GroupArguments);
aGroupArgumentsLayout->addWidget(aCornerNodesLabel, 0, 0);
aGroupArgumentsLayout->addWidget(mySelectButton, 0, 1);
aGroupArgumentsLayout->addWidget(myCornerNodes, 0, 2);
aGroupArgumentsLayout->addWidget(myTable, 1, 0, 1, 3);
aGroupArgumentsLayout->addWidget(myReverseCB, 2, 0, 1, 3);
/***************************************************************/
aGroupArgumentsLayout->addWidget(aCornerNodesLabel, 0, 0);
aGroupArgumentsLayout->addWidget(myCornerSelectButton, 0, 1);
aGroupArgumentsLayout->addWidget(myCornerNodes, 0, 2);
aGroupArgumentsLayout->addWidget(myTable, 1, 0, 1, 3);
aGroupArgumentsLayout->addWidget(myMidFaceLabel, 2, 0);
aGroupArgumentsLayout->addWidget(myMidFaceSelectButton, 2, 1);
aGroupArgumentsLayout->addWidget(myMidFaceNodes, 2, 2);
aGroupArgumentsLayout->addWidget(myCenterLabel, 3, 0);
aGroupArgumentsLayout->addWidget(myCenterSelectButton, 3, 1);
aGroupArgumentsLayout->addWidget(myCenterNode, 3, 2);
aGroupArgumentsLayout->addWidget(myReverseCB, 4, 0, 1, 3);
/***************************************************************/
GroupGroups = new QGroupBox( tr( "SMESH_ADD_TO_GROUP" ), this );
GroupGroups->setCheckable( true );
QHBoxLayout* GroupGroupsLayout = new QHBoxLayout(GroupGroups);
@ -572,52 +514,74 @@ void SMESHGUI_AddQuadraticElementDlg::Init()
{
myRadioButton1->setChecked(true);
mySMESHGUI->SetActiveDialogBox((QDialog*)this);
/* reset "Add to group" control */
GroupGroups->setChecked( false );
myActor = 0;
myNbMidFaceNodes = 0;
myNbCenterNodes = 0;
int aNumRows;
switch (myType) {
case QUAD_EDGE:
switch (myGeomType) {
case SMDSEntity_Quad_Edge:
aNumRows = 1;
myNbCorners = 2;
myHelpFileName = "adding_quadratic_elements_page.html#?"; //Adding_edges
break;
case QUAD_TRIANGLE:
case SMDSEntity_Quad_Triangle:
aNumRows = 3;
myNbCorners = 3;
myHelpFileName = "adding_quadratic_elements_page.html#?"; //Adding_triangles
break;
case QUAD_QUADRANGLE:
case SMDSEntity_Quad_Quadrangle:
aNumRows = 4;
myNbCorners = 4;
myHelpFileName = "adding_quadratic_elements_page.html#?"; //Adding_quadrangles
break;
case QUAD_TETRAHEDRON:
case SMDSEntity_BiQuad_Quadrangle:
aNumRows = 4;
myNbCorners = 4;
myNbCenterNodes = 1;
myHelpFileName = "adding_quadratic_elements_page.html#?"; //Adding_quadrangles
break;
case SMDSEntity_Quad_Tetra:
aNumRows = 6;
myNbCorners = 4;
myHelpFileName = "adding_quadratic_elements_page.html#?"; //Adding_tetrahedrons
break;
case QUAD_PYRAMID:
case SMDSEntity_Quad_Pyramid:
aNumRows = 8;
myNbCorners = 5;
myHelpFileName = "adding_quadratic_elements_page.html#?"; //Adding_pyramids
break;
case QUAD_PENTAHEDRON:
case SMDSEntity_Quad_Penta:
aNumRows = 9;
myNbCorners = 6;
myHelpFileName = "adding_quadratic_elements_page.html#?"; //Adding_pentahedrons
break;
case QUAD_HEXAHEDRON:
break;
case SMDSEntity_Quad_Hexa:
aNumRows = 12;
myNbCorners = 8;
myHelpFileName = "adding_quadratic_elements_page.html#?"; //Adding_hexahedrons
break;
case SMDSEntity_TriQuad_Hexa:
aNumRows = 12;
myNbCorners = 8;
myNbMidFaceNodes = 6;
myNbCenterNodes = 1;
myHelpFileName = "adding_quadratic_elements_page.html#?"; //Adding_hexahedrons
break;
}
myMidFaceLabel ->setVisible( myNbMidFaceNodes );
myMidFaceSelectButton->setVisible( myNbMidFaceNodes );
myMidFaceNodes ->setVisible( myNbMidFaceNodes );
myCenterLabel ->setVisible( myNbCenterNodes );
myCenterSelectButton ->setVisible( myNbCenterNodes );
myCenterNode ->setVisible( myNbCenterNodes );
myCornerNodes->setValidator(new SMESHGUI_IdValidator(this, myNbCorners));
/* initialize table */
@ -629,7 +593,7 @@ void SMESHGUI_AddQuadraticElementDlg::Init()
aColLabels.append(tr("SMESH_MIDDLE"));
aColLabels.append(tr("SMESH_LAST"));
myTable->setHorizontalHeaderLabels(aColLabels);
for ( int col = 0; col < myTable->columnCount(); col++ )
myTable->setColumnWidth(col, 80);
@ -637,7 +601,7 @@ void SMESHGUI_AddQuadraticElementDlg::Init()
//myTable->setColumnReadOnly(2, true); // VSR: TODO
myTable->setEnabled( false );
for ( int row = 0; row < myTable->rowCount(); row++ )
{
myTable->setItem( row, 0, new QTableWidgetItem( "" ) );
@ -650,13 +614,17 @@ void SMESHGUI_AddQuadraticElementDlg::Init()
myTable->setItem( row, 2, new QTableWidgetItem( "" ) );
myTable->item( row, 2 )->setFlags(0);
}
/* signals and slots connections */
connect(mySelectButton, SIGNAL(clicked()), SLOT(SetEditCorners()));
connect(myCornerSelectButton, SIGNAL(clicked()), SLOT(SetCurrentSelection()));
connect(myMidFaceSelectButton, SIGNAL(clicked()), SLOT(SetCurrentSelection()));
connect(myCenterSelectButton, SIGNAL(clicked()), SLOT(SetCurrentSelection()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(SelectionIntoArgument()));
connect(myTable, SIGNAL(cellDoubleClicked(int, int)), SLOT(onCellDoubleClicked(int, int)));
connect(myTable, SIGNAL(cellChanged (int, int)), SLOT(onCellTextChange(int, int)));
connect(myCornerNodes, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
connect(myMidFaceNodes, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
connect(myCenterNode, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
connect(myReverseCB, SIGNAL(stateChanged(int)), SLOT(onReverse(int)));
connect(buttonOk, SIGNAL(clicked()), SLOT(ClickOnOk()));
@ -668,13 +636,15 @@ void SMESHGUI_AddQuadraticElementDlg::Init()
connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), SLOT(ClickOnCancel()));
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), SLOT(ClickOnCancel()));
myCurrentLineEdit = myCornerNodes;
// set selection mode
SMESH::SetPointRepresentation(true);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode( NodeSelection );
SetEditCorners();
SelectionIntoArgument();
}
//=================================================================================
@ -693,37 +663,50 @@ void SMESHGUI_AddQuadraticElementDlg::ClickOnApply()
std::vector<vtkIdType> anIds;
switch (myType) {
case QUAD_EDGE:
switch (myGeomType) {
case SMDSEntity_Quad_Edge:
anIds.push_back(myTable->item(0, 0)->text().toInt());
anIds.push_back(myTable->item(0, 2)->text().toInt());
anIds.push_back(myTable->item(0, 1)->text().toInt());
break;
case QUAD_TRIANGLE:
case QUAD_QUADRANGLE:
case QUAD_TETRAHEDRON:
case QUAD_PYRAMID:
case QUAD_PENTAHEDRON:
case QUAD_HEXAHEDRON:
case SMDSEntity_Quad_Triangle:
case SMDSEntity_Quad_Quadrangle:
case SMDSEntity_BiQuad_Quadrangle:
case SMDSEntity_Quad_Tetra:
case SMDSEntity_Quad_Pyramid:
case SMDSEntity_Quad_Penta:
case SMDSEntity_Quad_Hexa:
case SMDSEntity_TriQuad_Hexa:
for ( int row = 0; row < myNbCorners; row++ )
anIds.push_back(myTable->item(row, 0)->text().toInt());
for ( int row = 0; row < myTable->rowCount(); row++ )
anIds.push_back(myTable->item(row, 1)->text().toInt());
if ( myNbMidFaceNodes )
{
QStringList aListId = myMidFaceNodes->text().split(" ", QString::SkipEmptyParts);
for (int i = 0; i < aListId.count(); i++)
anIds.push_back( aListId[ i ].toInt() );
}
if ( myNbCenterNodes )
{
QStringList aListId = myCenterNode->text().split(" ", QString::SkipEmptyParts);
anIds.push_back( aListId[ 0 ].toInt() );
}
break;
}
if ( myReverseCB->isChecked())
SMESH::ReverseConnectivity( anIds, myType );
ReverseConnectivity( anIds, myGeomType, /*toReverse=*/true, /*toVtkOrder=*/false );
int aNumberOfIds = anIds.size();
SMESH::long_array_var anArrayOfIdeces = new SMESH::long_array;
anArrayOfIdeces->length( aNumberOfIds );
for (int i = 0; i < aNumberOfIds; i++)
anArrayOfIdeces[i] = anIds[ i ];
bool addToGroup = GroupGroups->isChecked();
QString aGroupName;
SMESH::SMESH_GroupBase_var aGroup;
int idx = 0;
if( addToGroup ) {
@ -748,27 +731,29 @@ void SMESHGUI_AddQuadraticElementDlg::ClickOnApply()
SMESH::ElementType anElementType;
long anElemId = -1;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
switch (myType) {
case QUAD_EDGE:
switch (myGeomType) {
case SMDSEntity_Quad_Edge:
anElementType = SMESH::EDGE;
anElemId = aMeshEditor->AddEdge(anArrayOfIdeces.inout()); break;
case QUAD_TRIANGLE:
case QUAD_QUADRANGLE:
case SMDSEntity_Quad_Triangle:
case SMDSEntity_Quad_Quadrangle:
case SMDSEntity_BiQuad_Quadrangle:
anElementType = SMESH::FACE;
anElemId = aMeshEditor->AddFace(anArrayOfIdeces.inout()); break;
case QUAD_TETRAHEDRON:
case QUAD_PYRAMID:
case QUAD_PENTAHEDRON:
case QUAD_HEXAHEDRON:
case SMDSEntity_Quad_Tetra:
case SMDSEntity_Quad_Pyramid:
case SMDSEntity_Quad_Penta:
case SMDSEntity_Quad_Hexa:
case SMDSEntity_TriQuad_Hexa:
anElementType = SMESH::VOLUME;
anElemId = aMeshEditor->AddVolume(anArrayOfIdeces.inout()); break;
default: break;
}
if ( anElemId != -1 && addToGroup && !aGroupName.isEmpty() ) {
SMESH::SMESH_Group_var aGroupUsed;
if ( aGroup->_is_nil() ) {
// create new group
// create new group
aGroupUsed = SMESH::AddGroup( myMesh, anElementType, aGroupName );
if ( !aGroupUsed->_is_nil() ) {
myGroups.append(SMESH::SMESH_GroupBase::_duplicate(aGroupUsed));
@ -787,7 +772,7 @@ void SMESHGUI_AddQuadraticElementDlg::ClickOnApply()
else
aGroupUsed = SMESH::SMESH_Group::_narrow( aGroup );
}
if ( !aGroupUsed->_is_nil() ) {
SMESH::long_array_var anIdList = new SMESH::long_array;
anIdList->length( 1 );
@ -802,9 +787,9 @@ void SMESHGUI_AddQuadraticElementDlg::ClickOnApply()
mySimulation->SetVisibility(false);
SMESH::UpdateView();
UpdateTable();
SetEditCorners();
SetCurrentSelection();
updateButtons();
@ -844,7 +829,7 @@ void SMESHGUI_AddQuadraticElementDlg::ClickOnCancel()
void SMESHGUI_AddQuadraticElementDlg::ClickOnHelp()
{
LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
if (app)
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
QString platform;
@ -855,7 +840,7 @@ void SMESHGUI_AddQuadraticElementDlg::ClickOnHelp()
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg(app->resourceMgr()->stringValue("ExternalBrowser",
arg(app->resourceMgr()->stringValue("ExternalBrowser",
platform)).
arg(myHelpFileName));
}
@ -869,7 +854,7 @@ void SMESHGUI_AddQuadraticElementDlg::onTextChange (const QString& theNewText)
{
if (myBusy) return;
BusyLocker lock( myBusy );
mySimulation->SetVisibility(false);
// hilight entered nodes
@ -877,9 +862,15 @@ void SMESHGUI_AddQuadraticElementDlg::onTextChange (const QString& theNewText)
if (myActor)
aMesh = myActor->GetObject()->GetMesh();
QLineEdit* send = (QLineEdit*)sender();
if (send == myCornerNodes ||
send == myMidFaceNodes ||
send == myCenterNode)
myCurrentLineEdit = send;
if (aMesh) {
TColStd_MapOfInteger newIndices;
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
bool allOk = true;
for (int i = 0; i < aListId.count(); i++) {
@ -893,15 +884,15 @@ void SMESHGUI_AddQuadraticElementDlg::onTextChange (const QString& theNewText)
break;
}
}
mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( myActor->getIO(), true, true );
if ( sender() == myCornerNodes )
if ( myCurrentLineEdit == myCornerNodes )
UpdateTable( allOk );
}
updateButtons();
displaySimulation();
}
@ -914,32 +905,32 @@ void SMESHGUI_AddQuadraticElementDlg::SelectionIntoArgument()
{
if (myBusy) return;
BusyLocker lock( myBusy );
QString aCurrentEntry = myEntry;
if ( myIsEditCorners )
if ( myCurrentLineEdit )
{
// clear
myActor = 0;
myCornerNodes->setText("");
myCurrentLineEdit->setText("");
if (!GroupButtons->isEnabled()) // inactive
return;
mySimulation->SetVisibility(false);
// get selected mesh
SALOME_ListIO aList;
mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
if (aList.Extent() != 1)
{
UpdateTable();
updateButtons();
return;
}
Handle(SALOME_InteractiveObject) anIO = aList.First();
myEntry = anIO->getEntry();
myMesh = SMESH::GetMeshByIO(anIO);
@ -947,24 +938,26 @@ void SMESHGUI_AddQuadraticElementDlg::SelectionIntoArgument()
updateButtons();
return;
}
myActor = SMESH::FindActorByEntry(anIO->getEntry());
}
// process groups
if ( !myMesh->_is_nil() && myEntry != aCurrentEntry ) {
SMESH::ElementType anElementType;
switch ( myType ) {
case QUAD_EDGE:
switch ( myGeomType ) {
case SMDSEntity_Quad_Edge:
anElementType = SMESH::EDGE; break;
case QUAD_TRIANGLE:
case QUAD_QUADRANGLE:
case SMDSEntity_Quad_Triangle:
case SMDSEntity_Quad_Quadrangle:
case SMDSEntity_BiQuad_Quadrangle:
anElementType = SMESH::FACE; break;
case QUAD_TETRAHEDRON:
case QUAD_PYRAMID:
case QUAD_PENTAHEDRON:
case QUAD_HEXAHEDRON:
case SMDSEntity_Quad_Tetra:
case SMDSEntity_Quad_Pyramid:
case SMDSEntity_Quad_Penta:
case SMDSEntity_Quad_Hexa:
case SMDSEntity_TriQuad_Hexa:
anElementType = SMESH::VOLUME; break;
}
myGroups.clear();
@ -982,21 +975,23 @@ void SMESHGUI_AddQuadraticElementDlg::SelectionIntoArgument()
}
}
}
if (!myActor) {
updateButtons();
return;
}
// get selected nodes
QString aString = "";
int nbNodes = SMESH::GetNameOfSelectedNodes(mySelector,myActor->getIO(),aString);
if ( myIsEditCorners )
if ( myCurrentLineEdit )
{
myCornerNodes->setText(aString);
UpdateTable();
if ( myCurrentLineEdit != myCenterNode || nbNodes == 1 )
myCurrentLineEdit->setText(aString);
if ( myCurrentLineEdit == myCornerNodes )
UpdateTable();
}
else if ( myTable->isEnabled() && nbNodes == 1 )
{
@ -1004,7 +999,7 @@ void SMESHGUI_AddQuadraticElementDlg::SelectionIntoArgument()
if ( theCol == 1 )
myTable->item(theRow, 1)->setText(aString);
}
updateButtons();
displaySimulation();
}
@ -1018,13 +1013,13 @@ void SMESHGUI_AddQuadraticElementDlg::displaySimulation()
if ( IsValid() )
{
SMESH::TElementSimulation::TVTKIds anIds;
// Collect ids from the dialog
int anID;
bool ok;
int aDisplayMode = VTK_SURFACE;
if ( myType == QUAD_EDGE )
if ( myGeomType == SMDSEntity_Quad_Edge )
{
anIds.push_back( myActor->GetObject()->GetNodeVTKId( myTable->item(0, 0)->text().toInt() ) );
anIds.push_back( myActor->GetObject()->GetNodeVTKId( myTable->item(0, 2)->text().toInt() ) );
@ -1037,7 +1032,7 @@ void SMESHGUI_AddQuadraticElementDlg::displaySimulation()
{
for ( int row = 0; row < myNbCorners; row++ )
anIds.push_back( myActor->GetObject()->GetNodeVTKId( myTable->item(row, 0)->text().toInt() ) );
for ( int row = 0; row < myTable->rowCount(); row++ )
{
anID = myTable->item(row, 1)->text().toInt(&ok);
@ -1047,9 +1042,20 @@ void SMESHGUI_AddQuadraticElementDlg::displaySimulation()
}
anIds.push_back( myActor->GetObject()->GetNodeVTKId(anID) );
}
if ( myNbMidFaceNodes )
{
QStringList aListId = myMidFaceNodes->text().split(" ", QString::SkipEmptyParts);
for (int i = 0; i < aListId.count(); i++)
anIds.push_back( myActor->GetObject()->GetNodeVTKId( aListId[ i ].toInt() ));
}
if ( myNbCenterNodes )
{
QStringList aListId = myCenterNode->text().split(" ", QString::SkipEmptyParts);
anIds.push_back( myActor->GetObject()->GetNodeVTKId( aListId[ 0 ].toInt() ));
}
}
mySimulation->SetPosition(myActor,myType,anIds,aDisplayMode,myReverseCB->isChecked());
mySimulation->SetPosition(myActor,myGeomType,anIds,aDisplayMode,myReverseCB->isChecked());
}
else
{
@ -1059,15 +1065,26 @@ void SMESHGUI_AddQuadraticElementDlg::displaySimulation()
}
//=================================================================================
// function : SetEditCorners()
// function : SetCurrentSelection()
// purpose :
//=================================================================================
void SMESHGUI_AddQuadraticElementDlg::SetEditCorners()
void SMESHGUI_AddQuadraticElementDlg::SetCurrentSelection()
{
myCornerNodes->setFocus();
myIsEditCorners = true;
SelectionIntoArgument();
updateButtons();
QPushButton* send = (QPushButton*)sender();
myCurrentLineEdit = 0;
if (send == myCornerSelectButton)
myCurrentLineEdit = myCornerNodes;
else if ( send == myMidFaceSelectButton )
myCurrentLineEdit = myMidFaceNodes;
else if ( send == myCenterSelectButton )
myCurrentLineEdit = myCenterNode;
if ( myCurrentLineEdit )
{
myCurrentLineEdit->setFocus();
SelectionIntoArgument();
}
}
//=================================================================================
@ -1162,19 +1179,37 @@ bool SMESHGUI_AddQuadraticElementDlg::IsValid()
return false;
bool ok;
std::set< int > okIDs;
for ( int row = 0; row < myTable->rowCount(); row++ )
{
int anID = myTable->item(row, 1)->text().toInt(&ok);
if ( !ok )
return false;
const SMDS_MeshNode * aNode = aMesh->FindNode(anID);
if ( !aNode )
return false;
okIDs.insert( anID );
}
return true;
QStringList aListId;
if ( myNbMidFaceNodes )
aListId += myMidFaceNodes->text().split(" ", QString::SkipEmptyParts);
if ( myNbCenterNodes )
aListId += myCenterNode->text().split(" ", QString::SkipEmptyParts);
for (int i = 0; i < aListId.count(); i++)
{
int anID = aListId[ i ].toInt(&ok);
if ( !ok )
return false;
if ( !aMesh->FindNode(anID) )
return false;
okIDs.insert( anID );
}
return okIDs.size() == myTable->rowCount() + myNbMidFaceNodes + myNbCenterNodes;
}
//=================================================================================
@ -1184,53 +1219,55 @@ bool SMESHGUI_AddQuadraticElementDlg::IsValid()
void SMESHGUI_AddQuadraticElementDlg::UpdateTable( bool theConersValidity )
{
QStringList aListCorners = myCornerNodes->text().split(" ", QString::SkipEmptyParts);
if ( aListCorners.count() == myNbCorners && theConersValidity )
{
myTable->setEnabled( true );
// clear the Middle column
// clear the Middle column
for ( int row = 0; row < myTable->rowCount(); row++ )
myTable->item( row, 1 )->setText("");
int* aFirstColIds;
int* aLastColIds;
switch (myType) {
case QUAD_EDGE:
switch (myGeomType) {
case SMDSEntity_Quad_Edge:
aFirstColIds = FirstEdgeIds;
aLastColIds = LastEdgeIds;
break;
case QUAD_TRIANGLE:
case SMDSEntity_Quad_Triangle:
aFirstColIds = FirstTriangleIds;
aLastColIds = LastTriangleIds;
break;
case QUAD_QUADRANGLE:
case SMDSEntity_Quad_Quadrangle:
case SMDSEntity_BiQuad_Quadrangle:
aFirstColIds = FirstQuadrangleIds;
aLastColIds = LastQuadrangleIds;
break;
case QUAD_TETRAHEDRON:
case SMDSEntity_Quad_Tetra:
aFirstColIds = FirstTetrahedronIds;
aLastColIds = LastTetrahedronIds;
break;
case QUAD_PYRAMID:
case SMDSEntity_Quad_Pyramid:
aFirstColIds = FirstPyramidIds;
aLastColIds = LastPyramidIds;
break;
case QUAD_PENTAHEDRON:
case SMDSEntity_Quad_Penta:
aFirstColIds = FirstPentahedronIds;
aLastColIds = LastPentahedronIds;
break;
case QUAD_HEXAHEDRON:
break;
case SMDSEntity_Quad_Hexa:
case SMDSEntity_TriQuad_Hexa:
aFirstColIds = FirstHexahedronIds;
aLastColIds = LastHexahedronIds;
break;
}
// fill the First and the Last columns
for (int i = 0, iEnd = myTable->rowCount(); i < iEnd; i++)
myTable->item( i, 0 )->setText( aListCorners[ aFirstColIds[i] ] );
for (int i = 0, iEnd = myTable->rowCount(); i < iEnd; i++)
myTable->item( i, 2 )->setText( aListCorners[ aLastColIds[i] ] );
}
@ -1240,7 +1277,7 @@ void SMESHGUI_AddQuadraticElementDlg::UpdateTable( bool theConersValidity )
for ( int row = 0; row < myTable->rowCount(); row++ )
for ( int col = 0; col < myTable->columnCount(); col++ )
if ( QTableWidgetItem* aTWI = myTable->item(row, col) ) aTWI->setText("");
myTable->setEnabled( false );
}
}
@ -1252,7 +1289,7 @@ void SMESHGUI_AddQuadraticElementDlg::UpdateTable( bool theConersValidity )
//=================================================================================
void SMESHGUI_AddQuadraticElementDlg::onCellDoubleClicked( int theRow, int theCol )
{
myIsEditCorners = false;
myCurrentLineEdit = 0;
displaySimulation();
updateButtons();
}
@ -1264,7 +1301,7 @@ void SMESHGUI_AddQuadraticElementDlg::onCellDoubleClicked( int theRow, int theCo
//=================================================================================
void SMESHGUI_AddQuadraticElementDlg::onCellTextChange(int theRow, int theCol)
{
myIsEditCorners = false;
myCurrentLineEdit = 0;
displaySimulation();
updateButtons();
}

View File

@ -29,6 +29,7 @@
// SMESH includes
#include "SMESH_SMESHGUI.hxx"
#include "SMDSAbs_ElementType.hxx"
// Qt includes
#include <QDialog>
@ -38,6 +39,7 @@
#include CORBA_SERVER_HEADER(SMESH_Mesh)
class QComboBox;
class QFrame;
class QGroupBox;
class QLabel;
class QLineEdit;
@ -55,9 +57,6 @@ namespace SMESH
struct TElementSimulation;
}
enum { QUAD_EDGE, QUAD_TRIANGLE, QUAD_QUADRANGLE, QUAD_TETRAHEDRON,
QUAD_PYRAMID, QUAD_PENTAHEDRON, QUAD_HEXAHEDRON };
//=================================================================================
// class : SMESHGUI_AddQuadraticElementDlg
// purpose :
@ -67,7 +66,7 @@ class SMESHGUI_EXPORT SMESHGUI_AddQuadraticElementDlg : public QDialog
Q_OBJECT
public:
SMESHGUI_AddQuadraticElementDlg( SMESHGUI*, const int );
SMESHGUI_AddQuadraticElementDlg( SMESHGUI*, const SMDSAbs_EntityType );
~SMESHGUI_AddQuadraticElementDlg();
private:
@ -88,6 +87,8 @@ private:
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
int myNbCorners; /* The required number of corners */
int myNbMidFaceNodes;
int myNbCenterNodes;
bool myBusy;
SVTK_Selector* mySelector;
@ -97,15 +98,21 @@ private:
QString myEntry;
GrpList myGroups;
int myType;
bool myIsEditCorners;
SMDSAbs_EntityType myGeomType;
QLineEdit* myCurrentLineEdit;
QGroupBox* GroupConstructors;
QRadioButton* myRadioButton1;
QGroupBox* GroupArguments;
QPushButton* myCornerSelectButton;
QLineEdit* myCornerNodes;
QPushButton* mySelectButton;
QLabel* myMidFaceLabel;
QPushButton* myMidFaceSelectButton;
QLineEdit* myMidFaceNodes;
QLabel* myCenterLabel;
QPushButton* myCenterSelectButton;
QLineEdit* myCenterNode;
QTableWidget* myTable;
QCheckBox* myReverseCB;
@ -131,7 +138,7 @@ private slots:
void ClickOnCancel();
void ClickOnApply();
void ClickOnHelp();
void SetEditCorners();
void SetCurrentSelection();
void SelectionIntoArgument();
void DeactivateActiveDialog();
void ActivateThisDialog();

View File

@ -1620,6 +1620,7 @@ static QList<int> geomTypes( const int theType )
typeIds.append( SMESH::Geom_PYRAMID );
typeIds.append( SMESH::Geom_HEXA );
typeIds.append( SMESH::Geom_PENTA );
typeIds.append( SMESH::Geom_HEXAGONAL_PRISM );
typeIds.append( SMESH::Geom_POLYHEDRA );
}
return typeIds;

View File

@ -1122,12 +1122,12 @@ bool SMESHGUI_GroupDlg::onApply()
case 1: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break;
case 2:
case 3:
{
QColor c;
int delta;
SMESH::GetColor("SMESH", "fill_color", c , delta, "0,170,255|-100");
anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B, delta ); break;
}
{
QColor c;
int delta;
SMESH::GetColor("SMESH", "fill_color", c , delta, "0,170,255|-100");
anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B, delta ); break;
}
}
}
}

View File

@ -123,6 +123,7 @@ vtkIdType getCellType( const SMDSAbs_ElementType theType,
else if ( theNbNodes == 4 ) return VTK_QUAD;
else if ( theNbNodes == 6 ) return VTK_QUADRATIC_TRIANGLE;
else if ( theNbNodes == 8 ) return VTK_QUADRATIC_QUAD;
else if ( theNbNodes == 9 ) return VTK_BIQUADRATIC_QUAD;
else return VTK_EMPTY_CELL;
case SMDSAbs_Volume:
@ -131,18 +132,11 @@ vtkIdType getCellType( const SMDSAbs_ElementType theType,
else if ( theNbNodes == 5 ) return VTK_PYRAMID;
else if ( theNbNodes == 6 ) return VTK_WEDGE;
else if ( theNbNodes == 8 ) return VTK_HEXAHEDRON;
else if ( theNbNodes == 10 ) {
return VTK_QUADRATIC_TETRA;
}
else if ( theNbNodes == 20 ) {
return VTK_QUADRATIC_HEXAHEDRON;
}
else if ( theNbNodes==15 ) {
return VTK_QUADRATIC_WEDGE;
}
else if ( theNbNodes==13 ) {
return VTK_CONVEX_POINT_SET;
}
else if ( theNbNodes == 10 ) return VTK_QUADRATIC_TETRA;
else if ( theNbNodes == 20 ) return VTK_QUADRATIC_HEXAHEDRON;
else if ( theNbNodes == 27 ) return VTK_TRIQUADRATIC_HEXAHEDRON;
else if ( theNbNodes == 15 ) return VTK_QUADRATIC_WEDGE;
else if ( theNbNodes == 13 ) return VTK_QUADRATIC_PYRAMID;//VTK_CONVEX_POINT_SET;
else return VTK_EMPTY_CELL;
default: return VTK_EMPTY_CELL;

View File

@ -169,6 +169,8 @@ SMESHGUI_MeshInfo::SMESHGUI_MeshInfo( QWidget* parent )
QLabel* a3DPriTotal = createField();
QLabel* a3DPriLin = createField();
QLabel* a3DPriQuad = createField();
QLabel* a3DHexPriLab = new QLabel( tr( "HEX_PRISMS_LAB" ), this );
QLabel* a3DHexPriTotal = createField();
QLabel* a3DPolLab = new QLabel( tr( "POLYHEDRONS_LAB" ), this );
QLabel* a3DPolTotal = createField();
myWidgets[15] << a3DLine;
@ -177,7 +179,8 @@ SMESHGUI_MeshInfo::SMESHGUI_MeshInfo( QWidget* parent )
myWidgets[18] << a3DHexLab << a3DHexTotal << a3DHexLin << a3DHexQuad;
myWidgets[19] << a3DPyrLab << a3DPyrTotal << a3DPyrLin << a3DPyrQuad;
myWidgets[20] << a3DPriLab << a3DPriTotal << a3DPriLin << a3DPriQuad;
myWidgets[21] << a3DPolLab << a3DPolTotal;
myWidgets[21] << a3DHexPriLab << a3DHexPriTotal;
myWidgets[22] << a3DPolLab << a3DPolTotal;
setFontAttributes( aNameLab, Bold );
setFontAttributes( aObjLab, Bold );
@ -247,8 +250,10 @@ SMESHGUI_MeshInfo::SMESHGUI_MeshInfo( QWidget* parent )
l->addWidget( a3DPriTotal, 20, 1 );
l->addWidget( a3DPriLin, 20, 2 );
l->addWidget( a3DPriQuad, 20, 3 );
l->addWidget( a3DPolLab, 21, 0 );
l->addWidget( a3DPolTotal, 21, 1 );
l->addWidget( a3DHexPriLab, 21, 0 );
l->addWidget( a3DHexPriTotal, 21, 1 );
l->addWidget( a3DPolLab, 22, 0 );
l->addWidget( a3DPolTotal, 22, 1 );
l->setColumnStretch( 0, 0 );
l->setColumnStretch( 1, 5 );
l->setColumnStretch( 2, 5 );
@ -317,9 +322,9 @@ void SMESHGUI_MeshInfo::showInfo( SMESH::SMESH_IDSource_ptr obj )
myWidgets[i1D][iLinear]->setProperty( "text", QString::number( info[SMDSEntity_Edge] ) );
myWidgets[i1D][iQuadratic]->setProperty( "text", QString::number( info[SMDSEntity_Quad_Edge] ) );
long nbTriangles = info[SMDSEntity_Triangle] + info[SMDSEntity_Quad_Triangle];
long nbQuadrangles = info[SMDSEntity_Quadrangle] + info[SMDSEntity_Quad_Quadrangle];
long nbQuadrangles = info[SMDSEntity_Quadrangle] + info[SMDSEntity_Quad_Quadrangle] + info[SMDSEntity_BiQuad_Quadrangle];
long nb2DLinear = info[SMDSEntity_Triangle] + info[SMDSEntity_Quadrangle] + info[SMDSEntity_Polygon];
long nb2DQuadratic = info[SMDSEntity_Quad_Triangle] + info[SMDSEntity_Quad_Quadrangle];
long nb2DQuadratic = info[SMDSEntity_Quad_Triangle] + info[SMDSEntity_Quad_Quadrangle] + info[SMDSEntity_BiQuad_Quadrangle];
myWidgets[i2D][iTotal]->setProperty( "text", QString::number( nb2DLinear + nb2DQuadratic ) );
myWidgets[i2D][iLinear]->setProperty( "text", QString::number( nb2DLinear ) );
myWidgets[i2D][iQuadratic]->setProperty( "text", QString::number( nb2DQuadratic ) );
@ -328,14 +333,14 @@ void SMESHGUI_MeshInfo::showInfo( SMESH::SMESH_IDSource_ptr obj )
myWidgets[i2DTriangles][iQuadratic]->setProperty( "text", QString::number( info[SMDSEntity_Quad_Triangle] ) );
myWidgets[i2DQuadrangles][iTotal]->setProperty( "text", QString::number( nbQuadrangles ) );
myWidgets[i2DQuadrangles][iLinear]->setProperty( "text", QString::number( info[SMDSEntity_Quadrangle] ) );
myWidgets[i2DQuadrangles][iQuadratic]->setProperty( "text", QString::number( info[SMDSEntity_Quad_Quadrangle] ) );
myWidgets[i2DQuadrangles][iQuadratic]->setProperty( "text", QString::number( info[SMDSEntity_Quad_Quadrangle] + info[SMDSEntity_BiQuad_Quadrangle] ));
myWidgets[i2DPolygons][iTotal]->setProperty( "text", QString::number( info[SMDSEntity_Polygon] ) );
long nbTetrahedrons = info[SMDSEntity_Tetra] + info[SMDSEntity_Quad_Tetra];
long nbHexahedrons = info[SMDSEntity_Hexa] + info[SMDSEntity_Quad_Hexa];
long nbHexahedrons = info[SMDSEntity_Hexa] + info[SMDSEntity_Quad_Hexa] + info[SMDSEntity_TriQuad_Hexa];
long nbPyramids = info[SMDSEntity_Pyramid] + info[SMDSEntity_Quad_Pyramid];
long nbPrisms = info[SMDSEntity_Penta] + info[SMDSEntity_Quad_Penta];
long nb3DLinear = info[SMDSEntity_Tetra] + info[SMDSEntity_Hexa] + info[SMDSEntity_Pyramid] + info[SMDSEntity_Penta] + info[SMDSEntity_Polyhedra];
long nb3DQuadratic = info[SMDSEntity_Quad_Tetra] + info[SMDSEntity_Quad_Hexa] + info[SMDSEntity_Quad_Pyramid] + info[SMDSEntity_Quad_Penta];
long nb3DLinear = info[SMDSEntity_Tetra] + info[SMDSEntity_Hexa] + info[SMDSEntity_Pyramid] + info[SMDSEntity_Penta] + info[SMDSEntity_Polyhedra] + info[SMDSEntity_Hexagonal_Prism];
long nb3DQuadratic = info[SMDSEntity_Quad_Tetra] + info[SMDSEntity_Quad_Hexa] + info[SMDSEntity_TriQuad_Hexa] + info[SMDSEntity_Quad_Pyramid] + info[SMDSEntity_Quad_Penta];
myWidgets[i3D][iTotal]->setProperty( "text", QString::number( nb3DLinear + nb3DQuadratic ) );
myWidgets[i3D][iLinear]->setProperty( "text", QString::number( nb3DLinear ) );
myWidgets[i3D][iQuadratic]->setProperty( "text", QString::number( nb3DQuadratic ) );
@ -344,13 +349,14 @@ void SMESHGUI_MeshInfo::showInfo( SMESH::SMESH_IDSource_ptr obj )
myWidgets[i3DTetrahedrons][iQuadratic]->setProperty( "text", QString::number( info[SMDSEntity_Quad_Tetra] ) );
myWidgets[i3DHexahedrons][iTotal]->setProperty( "text", QString::number( nbHexahedrons ) );
myWidgets[i3DHexahedrons][iLinear]->setProperty( "text", QString::number( info[SMDSEntity_Hexa] ) );
myWidgets[i3DHexahedrons][iQuadratic]->setProperty( "text", QString::number( info[SMDSEntity_Quad_Hexa] ) );
myWidgets[i3DHexahedrons][iQuadratic]->setProperty( "text", QString::number( info[SMDSEntity_Quad_Hexa] + info[SMDSEntity_TriQuad_Hexa] ) );
myWidgets[i3DPyramids][iTotal]->setProperty( "text", QString::number( nbPyramids ) );
myWidgets[i3DPyramids][iLinear]->setProperty( "text", QString::number( info[SMDSEntity_Pyramid] ) );
myWidgets[i3DPyramids][iQuadratic]->setProperty( "text", QString::number( info[SMDSEntity_Quad_Pyramid] ) );
myWidgets[i3DPrisms][iTotal]->setProperty( "text", QString::number( nbPrisms ) );
myWidgets[i3DPrisms][iLinear]->setProperty( "text", QString::number( info[SMDSEntity_Penta] ) );
myWidgets[i3DPrisms][iQuadratic]->setProperty( "text", QString::number( info[SMDSEntity_Quad_Penta] ) );
myWidgets[i3DHexaPrisms][iTotal]->setProperty( "text", QString::number( info[SMDSEntity_Hexagonal_Prism] ) );
myWidgets[i3DPolyhedrons][iTotal]->setProperty( "text", QString::number( info[SMDSEntity_Polyhedra] ) );
}
}
@ -392,6 +398,7 @@ void SMESHGUI_MeshInfo::clear()
myWidgets[i3DPrisms][iTotal]->setProperty( "text", QString::number( 0 ) );
myWidgets[i3DPrisms][iLinear]->setProperty( "text", QString::number( 0 ) );
myWidgets[i3DPrisms][iQuadratic]->setProperty( "text", QString::number( 0 ) );
myWidgets[i3DHexaPrisms][iTotal]->setProperty( "text", QString::number( 0 ) );
myWidgets[i3DPolyhedrons][iTotal]->setProperty( "text", QString::number( 0 ) );
}
@ -783,6 +790,7 @@ void SMESHGUI_SimpleElemInfo::information( const QList<long>& ids )
gtype = tr( "TRIANGLE" ); break;
case SMDSEntity_Quadrangle:
case SMDSEntity_Quad_Quadrangle:
case SMDSEntity_BiQuad_Quadrangle:
gtype = tr( "QUADRANGLE" ); break;
case SMDSEntity_Polygon:
case SMDSEntity_Quad_Polygon:
@ -795,10 +803,13 @@ void SMESHGUI_SimpleElemInfo::information( const QList<long>& ids )
gtype = tr( "PYRAMID" ); break;
case SMDSEntity_Hexa:
case SMDSEntity_Quad_Hexa:
case SMDSEntity_TriQuad_Hexa:
gtype = tr( "HEXAHEDRON" ); break;
case SMDSEntity_Penta:
case SMDSEntity_Quad_Penta:
gtype = tr( "PRISM" ); break;
case SMDSEntity_Hexagonal_Prism:
gtype = tr( "HEX_PRISM" ); break;
case SMDSEntity_Polyhedra:
case SMDSEntity_Quad_Polyhedra:
gtype = tr( "POLYHEDRON" ); break;
@ -1026,6 +1037,7 @@ void SMESHGUI_TreeElemInfo::information( const QList<long>& ids )
gtype = tr( "TRIANGLE" ); break;
case SMDSEntity_Quadrangle:
case SMDSEntity_Quad_Quadrangle:
case SMDSEntity_BiQuad_Quadrangle:
gtype = tr( "QUADRANGLE" ); break;
case SMDSEntity_Polygon:
case SMDSEntity_Quad_Polygon:
@ -1038,10 +1050,13 @@ void SMESHGUI_TreeElemInfo::information( const QList<long>& ids )
gtype = tr( "PYRAMID" ); break;
case SMDSEntity_Hexa:
case SMDSEntity_Quad_Hexa:
case SMDSEntity_TriQuad_Hexa:
gtype = tr( "HEXAHEDRON" ); break;
case SMDSEntity_Penta:
case SMDSEntity_Quad_Penta:
gtype = tr( "PRISM" ); break;
case SMDSEntity_Hexagonal_Prism:
gtype = tr( "HEX_PRISM" ); break;
case SMDSEntity_Polyhedra:
case SMDSEntity_Quad_Polyhedra:
gtype = tr( "POLYHEDRON" ); break;
@ -1365,7 +1380,7 @@ void SMESHGUI_AddInfo::meshInfo( SMESH::SMESH_Mesh_ptr mesh, QTreeWidgetItem* pa
itemSubMeshes = createItem( parent, Bold | All );
itemSubMeshes->setText( 0, tr( "SUBMESHES" ) );
}
if ( smItems.find( smType ) == smItems.end() ) {
smItems[ smType ] = createItem( itemSubMeshes, Bold | All );
smItems[ smType ]->setText( 0, tr( QString( "SUBMESHES_%1" ).arg( smType ).toLatin1().constData() ) );

View File

@ -80,6 +80,7 @@ class SMESHGUI_EXPORT SMESHGUI_MeshInfo : public QFrame
i3DHexahedrons,
i3DPyramids,
i3DPrisms,
i3DHexaPrisms,
i3DPolyhedrons,
i3DEnd,
iElementsEnd = i3DEnd

View File

@ -143,6 +143,14 @@
<source>ICON_DLG_NODE</source>
<translation>mesh_vertex.png</translation>
</message>
<message>
<source>ICON_DLG_OCTA</source>
<translation>mesh_octahedron.png</translation>
</message>
<message>
<source>ICON_DLG_PENTA</source>
<translation>mesh_pentahedron.png</translation>
</message>
<message>
<source>ICON_DLG_POLYGON</source>
<translation>mesh_polygon.png</translation>
@ -151,6 +159,10 @@
<source>ICON_DLG_POLYHEDRON</source>
<translation>mesh_polyhedron.png</translation>
</message>
<message>
<source>ICON_DLG_PYRAMID</source>
<translation>mesh_pyramid.png</translation>
</message>
<message>
<source>ICON_DLG_QUADRANGLE</source>
<translation>mesh_quad.png</translation>
@ -163,6 +175,10 @@
<source>ICON_DLG_QUADRATIC_HEXAHEDRON</source>
<translation>mesh_quad_hexahedron.png</translation>
</message>
<message>
<source>ICON_DLG_TRIQUADRATIC_HEXAHEDRON</source>
<translation>mesh_triquad_hexahedron.png</translation>
</message>
<message>
<source>ICON_DLG_QUADRATIC_PENTAHEDRON</source>
<translation>mesh_quad_pentahedron.png</translation>
@ -175,6 +191,10 @@
<source>ICON_DLG_QUADRATIC_QUADRANGLE</source>
<translation>mesh_quad_quadrangle.png</translation>
</message>
<message>
<source>ICON_DLG_BIQUADRATIC_QUADRANGLE</source>
<translation>mesh_biquad_quadrangle.png</translation>
</message>
<message>
<source>ICON_DLG_QUADRATIC_TETRAHEDRON</source>
<translation>mesh_quad_tetrahedron.png</translation>

View File

@ -976,13 +976,37 @@ Please enter correct values and try again</translation>
<translation>&quot;%1&quot; assigned but:
</translation>
</message>
<message>
<source>SMESH_ADD_OCTA</source>
<translation>Add hexagonal prism</translation>
</message>
<message>
<source>SMESH_ADD_OCTA_TITLE</source>
<translation>Add Hexagonal Prism</translation>
</message>
<message>
<source>SMESH_ADD_POLYGON</source>
<translation>Add polygon</translation>
</message>
<message>
<source>SMESH_ADD_POLYGON_TITLE</source>
<translation>Add polygon</translation>
<translation>Add Polygon</translation>
</message>
<message>
<source>SMESH_ADD_PENTA</source>
<translation>Add pentahedron</translation>
</message>
<message>
<source>SMESH_ADD_PENTA_TITLE</source>
<translation>Add Pentahedron</translation>
</message>
<message>
<source>SMESH_ADD_PYRAMID</source>
<translation>Add pyramid</translation>
</message>
<message>
<source>SMESH_ADD_PYRAMID_TITLE</source>
<translation>Add Pyramid</translation>
</message>
<message>
<source>SMESH_ADD_QUADRANGLE</source>
@ -1000,6 +1024,10 @@ Please enter correct values and try again</translation>
<source>SMESH_ADD_QUADRATIC_HEXAHEDRON_TITLE</source>
<translation>Add Quadratic Hexahedron</translation>
</message>
<message>
<source>SMESH_ADD_TRIQUADRATIC_HEXAHEDRON_TITLE</source>
<translation>Add TriQuadratic Hexahedron</translation>
</message>
<message>
<source>SMESH_ADD_QUADRATIC_PENTAHEDRON_TITLE</source>
<translation>Add Quadratic Pentahedron</translation>
@ -1008,6 +1036,10 @@ Please enter correct values and try again</translation>
<source>SMESH_ADD_QUADRATIC_PYRAMID_TITLE</source>
<translation>Add Quadratic Pyramid</translation>
</message>
<message>
<source>SMESH_ADD_BIQUADRATIC_QUADRANGLE_TITLE</source>
<translation>Add BiQuadratic Quadrangle</translation>
</message>
<message>
<source>SMESH_ADD_QUADRATIC_QUADRANGLE_TITLE</source>
<translation>Add Quadratic Quadrangle</translation>
@ -1388,8 +1420,8 @@ Overwrite the file?</translation>
</message>
<message>
<source>SMESH_EXPORT_UNV</source>
<translation>During export mesh with name - &quot;%1&quot; to UNV
pyramid&apos;s elements will be missed</translation>
<translation>During export mesh with name &quot;%1&quot; to UNV
pyramids, hexagonal prisms, polygons and polyhedra elements will be missed</translation>
</message>
<message>
<source>SMESH_EXTRUSION</source>
@ -1858,6 +1890,18 @@ Check algorithm documentation for supported geometry</translation>
<source>SMESH_OPERATION_FAILED</source>
<translation>Operation failed</translation>
</message>
<message>
<source>SMESH_OCTA</source>
<translation>Hexagonal prism</translation>
</message>
<message>
<source>TOP_OCTA</source>
<translation>Hexagonal prism</translation>
</message>
<message>
<source>MEN_OCTA</source>
<translation>Hexagonal prism</translation>
</message>
<message>
<source>SMESH_ORIENTATION</source>
<translation>Orientation</translation>
@ -1874,6 +1918,18 @@ Check algorithm documentation for supported geometry</translation>
<source>SMESH_PARAMETERS</source>
<translation>Parameters</translation>
</message>
<message>
<source>SMESH_PENTA</source>
<translation>Pentahedron</translation>
</message>
<message>
<source>TOP_PENTA</source>
<translation>Pentahedron</translation>
</message>
<message>
<source>MEN_PENTA</source>
<translation>Pentahedron</translation>
</message>
<message>
<source>SMESH_PLANE</source>
<translation>Plane</translation>
@ -1946,6 +2002,14 @@ Check algorithm documentation for supported geometry</translation>
<source>SMESH_PYRAMID</source>
<translation>Pyramid</translation>
</message>
<message>
<source>MEN_PYRAMID</source>
<translation>Pyramid</translation>
</message>
<message>
<source>TOP_PYRAMID</source>
<translation>Pyramid</translation>
</message>
<message>
<source>SMESH_QUADRANGLE</source>
<translation>Quadrangle</translation>
@ -1958,6 +2022,18 @@ Check algorithm documentation for supported geometry</translation>
<source>SMESH_QUADRATIC_HEXAHEDRON</source>
<translation>Quadratic Hexahedron</translation>
</message>
<message>
<source>SMESH_TRIQUADRATIC_HEXAHEDRON</source>
<translation>TriQuadratic Hexahedron</translation>
</message>
<message>
<source>TOP_TRIQUADRATIC_HEXAHEDRON</source>
<translation>TriQuadratic Hexahedron</translation>
</message>
<message>
<source>MEN_TRIQUADRATIC_HEXAHEDRON</source>
<translation>TriQuadratic Hexahedron</translation>
</message>
<message>
<source>SMESH_QUADRATIC_PENTAHEDRON</source>
<translation>Quadratic Pentahedron</translation>
@ -1970,6 +2046,18 @@ Check algorithm documentation for supported geometry</translation>
<source>SMESH_QUADRATIC_QUADRANGLE</source>
<translation>Quadratic Quadrangle</translation>
</message>
<message>
<source>SMESH_BIQUADRATIC_QUADRANGLE</source>
<translation>BiQuadratic Quadrangle</translation>
</message>
<message>
<source>MEN_BIQUADRATIC_QUADRANGLE</source>
<translation>BiQuadratic Quadrangle</translation>
</message>
<message>
<source>TOP_BIQUADRATIC_QUADRANGLE</source>
<translation>BiQuadratic Quadrangle</translation>
</message>
<message>
<source>SMESH_QUADRATIC_TETRAHEDRON</source>
<translation>Quadratic Tetrahedron</translation>
@ -3787,6 +3875,10 @@ Please, create VTK viewer and try again</translation>
<source>SMESH_ADD_QUADRATIC_HEXAHEDRON</source>
<translation>Add Quadratic Hexahedron</translation>
</message>
<message>
<source>SMESH_ADD_TRIQUADRATIC_HEXAHEDRON</source>
<translation>Add TriQuadratic Hexahedron</translation>
</message>
<message>
<source>SMESH_ADD_QUADRATIC_PENTAHEDRON</source>
<translation>Add Quadratic Pentahedron</translation>
@ -3799,6 +3891,10 @@ Please, create VTK viewer and try again</translation>
<source>SMESH_ADD_QUADRATIC_QUADRANGLE</source>
<translation>Add Quadratic Quadrangle</translation>
</message>
<message>
<source>SMESH_ADD_BIQUADRATIC_QUADRANGLE</source>
<translation>Add BiQuadratic Quadrangle</translation>
</message>
<message>
<source>SMESH_ADD_QUADRATIC_TETRAHEDRON</source>
<translation>Add Quadratic Tetrahedron</translation>
@ -3811,6 +3907,14 @@ Please, create VTK viewer and try again</translation>
<source>SMESH_CORNER_NODES</source>
<translation>Corner Nodes:</translation>
</message>
<message>
<source>SMESH_MIDFACE_NODES</source>
<translation>Mid-face Nodes:</translation>
</message>
<message>
<source>SMESH_CENTER_NODE</source>
<translation>Center Node:</translation>
</message>
<message>
<source>SMESH_FIRST</source>
<translation>First</translation>
@ -4717,6 +4821,10 @@ Please enter correct value and try again</translation>
</message>
<message>
<source>GEOM_TYPE_9</source>
<translation>Hexagonal prism</translation>
</message>
<message>
<source>GEOM_TYPE_10</source>
<translation>Polyhedra</translation>
</message>
</context>
@ -5800,6 +5908,10 @@ as they are of improper type:
<source>PRISMS_LAB</source>
<translation>Prisms:</translation>
</message>
<message>
<source>HEX_PRISMS_LAB</source>
<translation>Hexagonal Prisms:</translation>
</message>
<message>
<source>POLYHEDRONS_LAB</source>
<translation>Polyhedrons:</translation>
@ -5950,6 +6062,10 @@ as they are of improper type:
<source>PRISM</source>
<translation>Prism</translation>
</message>
<message>
<source>HEX_PRISM</source>
<translation>Hexagonal Prism</translation>
</message>
<message>
<source>POLYHEDRON</source>
<translation>Polyhedron</translation>

View File

@ -660,6 +660,10 @@ CORBA::Long SMESH_MeshEditor_i::AddFace(const SMESH::long_array & IDsOfNodes)
elem = GetMeshDS()->AddFace(nodes[0], nodes[1], nodes[2], nodes[3],
nodes[4], nodes[5], nodes[6], nodes[7]);
}
else if (NbNodes == 9) {
elem = GetMeshDS()->AddFace(nodes[0], nodes[1], nodes[2], nodes[3],
nodes[4], nodes[5], nodes[6], nodes[7], nodes[8] );
}
else if (NbNodes > 2) {
elem = GetMeshDS()->AddPolygonalFace(nodes);
}
@ -722,6 +726,9 @@ CORBA::Long SMESH_MeshEditor_i::AddVolume(const SMESH::long_array & IDsOfNodes)
case 10:elem = GetMeshDS()->AddVolume(n[0],n[1],n[2],n[3],n[4],n[5],
n[6],n[7],n[8],n[9]);
break;
case 12:elem = GetMeshDS()->AddVolume(n[0],n[1],n[2],n[3],n[4],n[5],
n[6],n[7],n[8],n[9],n[10],n[11]);
break;
case 13:elem = GetMeshDS()->AddVolume(n[0],n[1],n[2],n[3],n[4],n[5],n[6],
n[7],n[8],n[9],n[10],n[11],n[12]);
break;
@ -732,6 +739,11 @@ CORBA::Long SMESH_MeshEditor_i::AddVolume(const SMESH::long_array & IDsOfNodes)
n[8],n[9],n[10],n[11],n[12],n[13],n[14],
n[15],n[16],n[17],n[18],n[19]);
break;
case 27:elem = GetMeshDS()->AddVolume(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],
n[8],n[9],n[10],n[11],n[12],n[13],n[14],
n[15],n[16],n[17],n[18],n[19],
n[20],n[21],n[22],n[23],n[24],n[25],n[26]);
break;
}
// Update Python script