}
}
}
+
+ // Warn the user about presence of not supported elements
+ QString format;
+ std::vector< SMESH::EntityType > notSupportedElemTypes, presentNotSupported;
+ if ( isDAT )
+ {
+ format = "DAT";
+ notSupportedElemTypes.push_back( SMESH::Entity_Quad_Quadrangle );
+ notSupportedElemTypes.push_back( SMESH::Entity_BiQuad_Quadrangle );
+ notSupportedElemTypes.push_back( SMESH::Entity_Polygon );
+ notSupportedElemTypes.push_back( SMESH::Entity_Quad_Polygon );
+ notSupportedElemTypes.push_back( SMESH::Entity_Tetra );
+ notSupportedElemTypes.push_back( SMESH::Entity_Quad_Tetra );
+ notSupportedElemTypes.push_back( SMESH::Entity_Pyramid );
+ notSupportedElemTypes.push_back( SMESH::Entity_Quad_Pyramid );
+ notSupportedElemTypes.push_back( SMESH::Entity_Quad_Hexa );
+ notSupportedElemTypes.push_back( SMESH::Entity_TriQuad_Hexa );
+ notSupportedElemTypes.push_back( SMESH::Entity_Penta );
+ notSupportedElemTypes.push_back( SMESH::Entity_Quad_Penta );
+ notSupportedElemTypes.push_back( SMESH::Entity_Hexagonal_Prism );
+ notSupportedElemTypes.push_back( SMESH::Entity_Polyhedra );
+ notSupportedElemTypes.push_back( SMESH::Entity_0D );
+ notSupportedElemTypes.push_back( SMESH::Entity_Ball );
+ }
else if ( isUNV )
{
- // warn the user about presence of not supported elements
+ format = "UNV";
+ notSupportedElemTypes.push_back( SMESH::Entity_Polygon );
+ notSupportedElemTypes.push_back( SMESH::Entity_Quad_Polygon );
+ notSupportedElemTypes.push_back( SMESH::Entity_Polyhedra );
+ notSupportedElemTypes.push_back( SMESH::Entity_Quad_Polyhedra );
+ notSupportedElemTypes.push_back( SMESH::Entity_Pyramid );
+ notSupportedElemTypes.push_back( SMESH::Entity_Hexagonal_Prism );
+ notSupportedElemTypes.push_back( SMESH::Entity_0D );
+ notSupportedElemTypes.push_back( SMESH::Entity_Ball );
+ }
+ else if ( isSTL )
+ {
+ format = "STL";
+ notSupportedElemTypes.push_back( SMESH::Entity_Edge );
+ notSupportedElemTypes.push_back( SMESH::Entity_Quad_Edge );
+ notSupportedElemTypes.push_back( SMESH::Entity_0D );
+ notSupportedElemTypes.push_back( SMESH::Entity_Ball );
+ }
+ else if ( isCGNS )
+ {
+ format = "CGNS";
+ notSupportedElemTypes.push_back( SMESH::Entity_Ball );
+ }
+ else if ( isSAUV )
+ {
+ format = "SAUV";
+ notSupportedElemTypes.push_back( SMESH::Entity_Ball );
+ notSupportedElemTypes.push_back( SMESH::Entity_BiQuad_Quadrangle );
+ notSupportedElemTypes.push_back( SMESH::Entity_TriQuad_Hexa );
+ notSupportedElemTypes.push_back( SMESH::Entity_Hexagonal_Prism );
+ notSupportedElemTypes.push_back( SMESH::Entity_Polygon );
+ notSupportedElemTypes.push_back( SMESH::Entity_Polyhedra );
+ }
+ if ( ! notSupportedElemTypes.empty() )
+ {
SMESH::long_array_var nbElems = aMeshOrGroup->GetMeshInfo();
- 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"),
- QObject::tr("SMESH_EXPORT_UNV").arg(aMeshName),
- QObject::tr("SMESH_BUT_YES"),
- QObject::tr("SMESH_BUT_NO"), 0, 1);
- if (aRet != 0)
- return;
+ for ( size_t iType = 0; iType < notSupportedElemTypes.size(); ++iType )
+ if ( nbElems[ notSupportedElemTypes[ iType ]] > 0 )
+ presentNotSupported.push_back( notSupportedElemTypes[ iType ]);
+ }
+ if ( !presentNotSupported.empty() )
+ {
+ QString typeNames;
+ const char* typeMsg[SMESH::Entity_Last] = { "SMESH_NODES",
+ "SMESH_ELEMS0D","SMESH_EDGES","SMESH_QUADRATIC_EDGES","SMESH_TRIANGLES",
+ "SMESH_QUADRATIC_TRIANGLES","SMESH_QUADRANGLES","SMESH_QUADRATIC_QUADRANGLES",
+ "SMESH_BIQUADRATIC_QUADRANGLES","SMESH_POLYGONS","SMESH_QUADRATIC_POLYGONS",
+ "SMESH_TETRAHEDRA","SMESH_QUADRATIC_TETRAHEDRONS","SMESH_PYRAMIDS",
+ "SMESH_QUADRATIC_PYRAMIDS","SMESH_HEXAHEDRA","SMESH_QUADRATIC_HEXAHEDRONS",
+ "SMESH_TRIQUADRATIC_HEXAHEDRONS","SMESH_PENTAHEDRA","SMESH_QUADRATIC_PENTAHEDRONS",
+ "SMESH_OCTAHEDRA","SMESH_POLYEDRONS","SMESH_QUADRATIC_POLYEDRONS","SMESH_BALLS"
+ };
+ QString andStr = " " + QObject::tr("SMESH_AND") + " ", comma(", ");
+ for ( size_t iType = 0; iType < presentNotSupported.size(); ++iType ) {
+ typeNames += QObject::tr( typeMsg[ presentNotSupported[ iType ]]);
+ if ( iType != presentNotSupported.size() - 1 )
+ typeNames += ( iType == presentNotSupported.size() - 2 ) ? andStr : comma;
}
+ int aRet = SUIT_MessageBox::warning
+ (SMESHGUI::desktop(),
+ QObject::tr("SMESH_WRN_WARNING"),
+ QObject::tr("EXPORT_NOT_SUPPORTED").arg(aMeshName).arg(format).arg(typeNames),
+ QObject::tr("SMESH_BUT_YES"),
+ QObject::tr("SMESH_BUT_NO"), 0, 1);
+ if (aRet != 0)
+ return;
}
// Get parameters of export operation
// bool Renumber = false;
// // PAL 14172 : Check of we have to renumber or not from the preferences before export
// if (resMgr)
-// Renumber= resMgr->booleanValue("SMESH","renumbering");
+// Renumber= resMgr->booleanValue("renumbering");
// if (Renumber){
// SMESH::SMESH_MeshEditor_var aMeshEditor = aMesh->GetMeshEditor();
// aMeshEditor->RenumberNodes();
if(SMESH_Actor *anActor = SMESH::FindActorByEntry(IObject->getEntry())){
unsigned int aMode = anActor->GetEntityMode();
switch(theCommandID){
+ case 222:
+ InverseEntityMode(aMode,SMESH_Actor::eBallElem);
+ break;
case 216:
InverseEntityMode(aMode,SMESH_Actor::e0DElements);
break;
_PTR(SObject) aGroupSObject = SMESH::FindSObject(aGroupObject);
if (aGroupSObject) {
if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aGroupSObject->GetID().c_str())) {
- if( aGroupObject->GetType() == SMESH::NODE )
- anActor->SetNodeColor( aColor.R, aColor.G, aColor.B );
- else if( aGroupObject->GetType() == SMESH::EDGE )
- anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B );
- else if( aGroupObject->GetType() == SMESH::ELEM0D )
- anActor->Set0DColor( aColor.R, aColor.G, aColor.B );
- else {
+ switch ( aGroupObject->GetType ()) {
+ case SMESH::NODE:
+ anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break;
+ case SMESH::EDGE:
+ anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break;
+ case SMESH::ELEM0D:
+ anActor->Set0DColor( aColor.R, aColor.G, aColor.B ); break;
+ case SMESH::BALL:
+ anActor->SetBallColor( aColor.R, aColor.G, aColor.B ); break;
+ default:
QColor c;
int delta;
SMESH::GetColor("SMESH", "fill_color", c, delta, "0,170,255|-100");
}
}
- void SetDisplayMode(int theCommandID, SMESHGUI_StudyId2MarkerMap& theMarkerMap){
+ void SetDisplayMode(int theCommandID, SMESHGUI_StudyId2MarkerMap& theMarkerMap)
+ {
SALOME_ListIO selected;
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
if( !app )
return;
}
case 1132:{
- QColor c, e, b, n, c0D, o, outl, selection, preselection;
+ QColor c, e, b, n, c0D, cBall, o, outl, selection, preselection;
int delta;
- int size0D = 0;
+ int size0D = 0, ballSize = 0;
int Edgewidth = 0;
vtkFloatingPointType Shrink = 0.0;
vtkFloatingPointType faces_orientation_scale = 0.0;
c2 = int (color0D[2] * 255);
c0D.setRgb(c0, c1, c2);
+ vtkFloatingPointType ballcolor[3];
+ anActor->GetBallColor(ballcolor[0], ballcolor[1], ballcolor[2]);
+ c0 = int (ballcolor[0] * 255);
+ c1 = int (ballcolor[1] * 255);
+ c2 = int (ballcolor[2] * 255);
+ cBall.setRgb(c0, c1, c2);
+
vtkFloatingPointType outlineColor[3];
anActor->GetOutlineColor(outlineColor[0], outlineColor[1], outlineColor[2]);
c0 = int (outlineColor[0] * 255);
size0D = (int)anActor->Get0DSize();
if(size0D == 0)
size0D = 1;
+ ballSize = (int)anActor->GetBallSize();
+ if(ballSize == 0)
+ ballSize = 1;
Edgewidth = (int)anActor->GetLineWidth();
if(Edgewidth == 0)
Edgewidth = 1;
SMESHGUI_Preferences_ColorDlg *aDlg =
new SMESHGUI_Preferences_ColorDlg( SMESHGUI::GetSMESHGUI() );
+ aDlg->SetBooleanValue(1, faces_orientation_3dvectors);
aDlg->SetColor(1, c);
aDlg->SetColor(2, e);
aDlg->SetColor(3, n);
aDlg->SetColor(4, outl);
- aDlg->SetDeltaBrightness(delta);
aDlg->SetColor(5, c0D);
- aDlg->SetColor(6, o);
+ aDlg->SetColor(6, cBall);
+ aDlg->SetColor(7, o);
+ aDlg->SetColor(8, selection);
+ aDlg->SetColor(9, preselection);
+ aDlg->SetDeltaBrightness(delta);
+ aDlg->SetDoubleValue(1, faces_orientation_scale);
aDlg->SetIntValue(1, Edgewidth);
aDlg->SetIntValue(2, int(Shrink*100.));
aDlg->SetIntValue(3, size0D);
- aDlg->SetDoubleValue(1, faces_orientation_scale);
- aDlg->SetBooleanValue(1, faces_orientation_3dvectors);
- aDlg->SetColor(7, selection);
- aDlg->SetColor(8, preselection);
+ aDlg->SetIntValue(4, ballSize);
aDlg->setCustomMarkerMap( theMarkerMap[ aStudy->StudyId() ] );
aDlg->setCustomMarker( aMarkerTextureCurrent );
if(aDlg->exec()){
- QColor color = aDlg->GetColor(1);
- QColor edgecolor = aDlg->GetColor(2);
- QColor nodecolor = aDlg->GetColor(3);
- QColor outlinecolor = aDlg->GetColor(4);
- QColor color0D = aDlg->GetColor(5);
- QColor faces_orientation_color = aDlg->GetColor(6);
- QColor selectioncolor = aDlg->GetColor(7);
- QColor preSelectioncolor = aDlg->GetColor(8);
+ QColor color = aDlg->GetColor(1);
+ QColor edgecolor = aDlg->GetColor(2);
+ QColor nodecolor = aDlg->GetColor(3);
+ QColor outlinecolor = aDlg->GetColor(4);
+ QColor color0D = aDlg->GetColor(5);
+ QColor ballcolor = aDlg->GetColor(6);
+ QColor faces_orientation_color = aDlg->GetColor(7);
+ QColor selectioncolor = aDlg->GetColor(8);
+ QColor preSelectioncolor = aDlg->GetColor(9);
int delta = aDlg->GetDeltaBrightness();
/* Point marker */
vtkFloatingPointType (color0D.blue()) / 255.);
anActor->Set0DSize(aDlg->GetIntValue(3));
+ /* Ball elements */
+ anActor->SetBallColor(vtkFloatingPointType (ballcolor.red()) / 255.,
+ vtkFloatingPointType (ballcolor.green()) / 255.,
+ vtkFloatingPointType (ballcolor.blue()) / 255.);
+ anActor->SetBallSize(aDlg->GetIntValue(4));
+
/* Faces orientation */
vtkFloatingPointType c[3] = {vtkFloatingPointType(faces_orientation_color.redF()),
vtkFloatingPointType(faces_orientation_color.greenF()),
case 218: // Faces
case 219: // Volumes
case 220: // All Entity
+ case 222: // Balls
::SetDisplayEntity(theCommandID);
break;
break;
}
+ case 4008: // BALL
case 4009: // ELEM0D
case 4010: // EDGE
case 4021: // TRIANGLE
EmitSignalDeactivateDialog();
SMDSAbs_EntityType type = SMDSEntity_Edge;
switch (theCommandID) {
- 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;
+ case 4008: type = SMDSEntity_Ball; break;
+ 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 ) )->show();
createSMESHAction( 6009, "VOLUME_3D", "ICON_VOLUME_3D", 0, true );
createSMESHAction( 4000, "NODE", "ICON_DLG_NODE" );
createSMESHAction( 4009, "ELEM0D", "ICON_DLG_ELEM0D" );
+ createSMESHAction( 4008, "BALL", "ICON_DLG_BALL" );
createSMESHAction( 4010, "EDGE", "ICON_DLG_EDGE" );
createSMESHAction( 4021, "TRIANGLE", "ICON_DLG_TRIANGLE" );
createSMESHAction( 4022, "QUAD", "ICON_DLG_QUADRANGLE" );
createSMESHAction( 213, "SHRINK", "ICON_SHRINK", 0, true );
createSMESHAction( 214, "UPDATE", "ICON_UPDATE" );
createSMESHAction( 215, "NODES", "ICON_POINTS", 0, true );
+ createSMESHAction( 222, "BALLS", "ICON_DLG_BALL", 0, true );
createSMESHAction( 216, "ELEMS0D", "ICON_DLG_ELEM0D", 0, true );
createSMESHAction( 217, "EDGES", "ICON_DLG_EDGE", 0, true );
createSMESHAction( 218, "FACES", "ICON_DLG_TRIANGLE", 0, true );
createMenu( 4000, addId, -1 );
createMenu( 4009, addId, -1 );
+ createMenu( 4008, addId, -1 );
createMenu( 4010, addId, -1 );
createMenu( 4021, addId, -1 );
createMenu( 4022, addId, -1 );
createTool( 4000, addRemTb );
createTool( 4009, addRemTb );
+ createTool( 4008, addRemTb );
createTool( 4010, addRemTb );
createTool( 4021, addRemTb );
createTool( 4022, addRemTb );
hasNodes("(numberOfNodes > 0 )"),//&& isVisible)"),
hasElems("(count( elemTypes ) > 0)"),
hasDifferentElems("(count( elemTypes ) > 1)"),
+ hasBalls("({'BallElem'} in elemTypes)"),
hasElems0d("({'Elem0d'} in elemTypes)"),
hasEdges("({'Edge'} in elemTypes)"),
hasFaces("({'Face'} in elemTypes)"),
popupMgr()->setRule( action( 219 ), aDiffElemsInVTK + "&& isVisible &&" + hasVolumes, QtxPopupMgr::VisibleRule );
popupMgr()->setRule( action( 219 ), "{'Volume'} in entityMode", QtxPopupMgr::ToggleRule );
+ popupMgr()->insert( action( 222 ), anId, -1 ); // BALLS
+ popupMgr()->setRule( action( 222 ), aDiffElemsInVTK + "&& isVisible &&" + hasBalls, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 222 ), "{'BallElem'} in entityMode", QtxPopupMgr::ToggleRule );
+
popupMgr()->insert( separator(), anId, -1 );
popupMgr()->insert( action( 220 ), anId, -1 ); // ALL
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_BALL_COLOR" ), elemGroup, LightApp_Preferences::Color, "SMESH", "ball_elem_color" );
addPreference( tr( "PREF_OUTLINE" ), elemGroup, LightApp_Preferences::Color, "SMESH", "outline_color" );
addPreference( tr( "PREF_WIREFRAME" ), elemGroup, LightApp_Preferences::Color, "SMESH", "wireframe_color" );
int size0d = addPreference(tr("PREF_SIZE_0D"), elemGroup,
LightApp_Preferences::IntSpin, "SMESH", "elem0d_size");
+ int ballSize = addPreference(tr("PREF_BALL_SIZE"), elemGroup,
+ LightApp_Preferences::IntSpin, "SMESH", "ball_elem_size");
int elemW = addPreference(tr("PREF_WIDTH"), elemGroup,
LightApp_Preferences::IntSpin, "SMESH", "element_width");
int shrink = addPreference(tr("PREF_SHRINK_COEFF"), elemGroup,
setPreferenceProperty( size0d, "min", 1 );
setPreferenceProperty( size0d, "max", 10 );
+ setPreferenceProperty( ballSize, "min", 1 );
+ setPreferenceProperty( ballSize, "max", 10 );
+
setPreferenceProperty( elemW, "min", 1 );
setPreferenceProperty( elemW, "max", 5 );
#include "SMESHGUI_AddMeshElementDlg.h"
#include "SMESHGUI.h"
-#include "SMESHGUI_Utils.h"
-#include "SMESHGUI_VTKUtils.h"
-#include "SMESHGUI_MeshUtils.h"
#include "SMESHGUI_GroupUtils.h"
#include "SMESHGUI_IdValidator.h"
+#include "SMESHGUI_MeshUtils.h"
+#include "SMESHGUI_SpinBox.h"
+#include "SMESHGUI_Utils.h"
+#include "SMESHGUI_VTKUtils.h"
#include <SMESH_Actor.h>
#include <SMESH_ActorUtils.h>
elemName = "ELEM0D";
myHelpFileName = "adding_nodes_and_elements_page.html#adding_0delems_anchor";
break;
+ case SMDSEntity_Ball:
+ myNbNodes = 1;
+ myElementType = SMDSAbs_Ball;
+ elemName = "BALL";
+ myHelpFileName = "adding_nodes_and_elements_page.html#adding_ball_anchor";
+ break;
case SMDSEntity_Edge:
myNbNodes = 2;
myElementType = SMDSAbs_Edge;
aTopLayout->setSpacing(SPACING);
aTopLayout->setMargin(MARGIN);
- /***************************************************************/
+ /* Constructor *************************************************/
GroupConstructors = new QGroupBox(buttonGrTitle, this);
QButtonGroup* ButtonGroup = new QButtonGroup(this);
QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout(GroupConstructors);
GroupConstructorsLayout->addWidget(Constructor1);
ButtonGroup->addButton( Constructor1, 0 );
- /***************************************************************/
+ /* Nodes & Reverse *********************************************/
GroupC1 = new QGroupBox(grBoxTitle, this);
QGridLayout* GroupC1Layout = new QGridLayout(GroupC1);
GroupC1Layout->setSpacing(SPACING);
Reverse = (myElementType == SMDSAbs_Face || myElementType == SMDSAbs_Volume ) ? new QCheckBox(tr("SMESH_REVERSE"), GroupC1) : 0;
+ DiameterSpinBox = ( myGeomType == SMDSEntity_Ball ) ? new SMESHGUI_SpinBox(GroupC1) : 0;
+ QLabel* diameterLabel = DiameterSpinBox ? new QLabel( tr("BALL_DIAMETER"),GroupC1) : 0;
+
GroupC1Layout->addWidget(TextLabelC1A1, 0, 0);
GroupC1Layout->addWidget(SelectButtonC1A1, 0, 1);
GroupC1Layout->addWidget(LineEditC1A1, 0, 2);
- if ( Reverse ) GroupC1Layout->addWidget(Reverse, 1, 0, 1, 3);
+ if ( Reverse ) {
+ GroupC1Layout->addWidget(Reverse, 1, 0, 1, 3);
+ }
+ if ( DiameterSpinBox ) {
+ GroupC1Layout->addWidget(diameterLabel, 1, 0);
+ GroupC1Layout->addWidget(DiameterSpinBox, 1, 1, 1, 2);
- /***************************************************************/
+ DiameterSpinBox->RangeStepAndValidator( 1e-7, 1e+9, 0.1 );
+ DiameterSpinBox->SetValue( 1. );
+ }
+ /* Add to group ************************************************/
GroupGroups = new QGroupBox( tr( "SMESH_ADD_TO_GROUP" ), this );
GroupGroups->setCheckable( true );
QHBoxLayout* GroupGroupsLayout = new QHBoxLayout(GroupGroups);
GroupGroupsLayout->addWidget( TextLabel_GroupName );
GroupGroupsLayout->addWidget( ComboBox_GroupName, 1 );
- /***************************************************************/
+ /* Apply etc ***************************************************/
GroupButtons = new QGroupBox(this);
QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
GroupButtonsLayout->setSpacing(SPACING);
/* reset "Add to group" control */
GroupGroups->setChecked( false );
- GroupGroups->setVisible( myElementType != SMDSAbs_0DElement );
+ //GroupGroups->setVisible( myElementType != SMDSAbs_0DElement );
myNbOkNodes = 0;
myActor = 0;
switch (myElementType) {
case SMDSAbs_0DElement:
anElemId = aMeshEditor->Add0DElement(anArrayOfIndices[0]); break;
+ case SMDSAbs_Ball:
+ if ( myGeomType == SMDSEntity_Ball )
+ anElemId = aMeshEditor->AddBall(anArrayOfIndices[0],
+ DiameterSpinBox->GetValue()); break;
case SMDSAbs_Edge:
anElemId = aMeshEditor->AddEdge(anArrayOfIndices.inout()); break;
case SMDSAbs_Face:
class SMESH_Actor;
class SVTK_Selector;
class LightApp_SelectionMgr;
+class SMESHGUI_SpinBox;
namespace SMESH
{
QPushButton* SelectButtonC1A1;
QLineEdit* LineEditC1A1;
QCheckBox* Reverse;
+ SMESHGUI_SpinBox* DiameterSpinBox;
QString myHelpFileName;
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_FilterDlg.cxx
// Author : Sergey LITONIN, Open CASCADE S.A.S.
-// SMESH includes
//
+
+// SMESH includes
#include "SMESHGUI_FilterDlg.h"
#include "SMESHGUI.h"
typeIds.append( SMESH::Geom_HEXAGONAL_PRISM );
typeIds.append( SMESH::Geom_POLYHEDRA );
}
+ if ( theType == SMESH::ALL || theType == SMESH::ELEM0D )
+ {
+ typeIds.append( SMESH::Geom_POINT );
+ }
+ if ( theType == SMESH::ALL || theType == SMESH::BALL )
+ {
+ typeIds.append( SMESH::Geom_BALL );
+ }
return typeIds;
}
if (aTypes.isEmpty())
{
aTypes[ SMESH::NODE ] = tr("NODES");
+ aTypes[ SMESH::BALL ] = tr("BALLS");
aTypes[ SMESH::EDGE ] = tr("EDGES");
aTypes[ SMESH::FACE ] = tr("FACES");
aTypes[ SMESH::VOLUME ] = tr("VOLUMES");
}
return aCriteria;
}
+ else if (theType == SMESH::ELEM0D)
+ {
+ static QMap<int, QString> aCriteria;
+ if (aCriteria.isEmpty())
+ {
+ aCriteria[ SMESH::FT_RangeOfIds ] = tr("RANGE_OF_IDS");
+ aCriteria[ SMESH::FT_BelongToGeom ] = tr("BELONG_TO_GEOM");
+ aCriteria[ SMESH::FT_BelongToPlane ] = tr("BELONG_TO_PLANE");
+ aCriteria[ SMESH::FT_BelongToCylinder ] = tr("BELONG_TO_CYLINDER");
+ aCriteria[ SMESH::FT_BelongToGenSurface ] = tr("BELONG_TO_GENSURFACE");
+ aCriteria[ SMESH::FT_GroupColor ] = tr("GROUP_COLOR");
+ }
+ return aCriteria;
+ }
+ else if (theType == SMESH::BALL)
+ {
+ static QMap<int, QString> aCriteria;
+ if (aCriteria.isEmpty())
+ {
+ aCriteria[ SMESH::FT_BallDiameter ] = tr("BALL_DIAMETER");
+ aCriteria[ SMESH::FT_RangeOfIds ] = tr("RANGE_OF_IDS");
+ aCriteria[ SMESH::FT_BelongToGeom ] = tr("BELONG_TO_GEOM");
+ aCriteria[ SMESH::FT_BelongToPlane ] = tr("BELONG_TO_PLANE");
+ aCriteria[ SMESH::FT_BelongToCylinder ] = tr("BELONG_TO_CYLINDER");
+ aCriteria[ SMESH::FT_BelongToGenSurface ] = tr("BELONG_TO_GENSURFACE");
+ aCriteria[ SMESH::FT_GroupColor ] = tr("GROUP_COLOR");
+ }
+ return aCriteria;
+ }
else // SMESH::ALL
{
static QMap<int, QString> aCriteria;
// File : SMESHGUI_FindElemByPointDlg.cxx
// Author : Edward AGAPOV, Open CASCADE S.A.S.
-// SMESH includes
//
+
+// SMESH includes
#include "SMESHGUI_FindElemByPointDlg.h"
#include "SMESHGUI.h"
myElemTypeCombo->addItem( tr( "MEN_ELEM0D" ));
myElemTypeCombo->setId( nbTypes++, int( SMESH::ELEM0D ));
break;
+ case SMESH::BALL:
+ myElemTypeCombo->addItem( tr( "MEN_BALL" ));
+ myElemTypeCombo->setId( nbTypes++, int( SMESH::BALL ));
+ break;
default:;
}
}
enum grpSelectionMode {
grpNoSelection = -1,
grpNodeSelection = 0,
- grpEdgeSelection = 1,
- grpFaceSelection = 2,
- grpVolumeSelection = 3,
- grpSubMeshSelection = 4,
- grpGroupSelection = 5,
- grpMeshSelection = 6,
- grpGeomSelection = 7,
- grpAllSelection = 8,
+ grpBallSelection = 1,
+ grpEdgeSelection = 2,
+ grpFaceSelection = 3,
+ grpVolumeSelection = 4,
+ grpSubMeshSelection = 5,
+ grpGroupSelection = 6,
+ grpMeshSelection = 7,
+ grpGeomSelection = 8,
+ grpAllSelection = 9,
};
//=================================================================================
QStringList types;
types.append( tr( "MESH_NODE" ) );
+ types.append( tr( "SMESH_BALL_ELEM" ) );
types.append( tr( "SMESH_EDGE" ) );
types.append( tr( "SMESH_FACE" ) );
types.append( tr( "SMESH_VOLUME" ) );
QWidget* wg3 = new QWidget( myWGStack );
/***************************************************************/
- QGroupBox* aContentBox = new QGroupBox( tr( "SMESH_CONTENT" ), wg1 );
+ QGroupBox* aContentBox = new QGroupBox( tr( "SMESH_CONTENT" ), wg1 );
QGridLayout* aContentBoxLayout = new QGridLayout( aContentBox );
aContentBoxLayout->setMargin( MARGIN );
aContentBoxLayout->setSpacing( SPACING );
- mySelectAll = new QCheckBox( tr( "SELECT_ALL" ), aContentBox );
+ mySelectAll = new QCheckBox( tr( "SELECT_ALL" ), aContentBox );
myAllowElemsModif = new QCheckBox( tr( "ALLOW_ELEM_LIST_MODIF" ), aContentBox );
myElementsLab = new QLabel( tr( "SMESH_ID_ELEMENTS" ), aContentBox );
- myElements = new QListWidget( aContentBox );
+ myElements = new QListWidget( aContentBox );
myElements->setSelectionMode( QListWidget::ExtendedSelection );
myFilterBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), aContentBox );
- myAddBtn = new QPushButton( tr( "SMESH_BUT_ADD" ), aContentBox );
+ myAddBtn = new QPushButton( tr( "SMESH_BUT_ADD" ), aContentBox );
myRemoveBtn = new QPushButton( tr( "SMESH_BUT_REMOVE" ), aContentBox );
- mySortBtn = new QPushButton( tr( "SMESH_BUT_SORT" ), aContentBox );
+ mySortBtn = new QPushButton( tr( "SMESH_BUT_SORT" ), aContentBox );
aContentBoxLayout->addWidget( mySelectAll, 0, 0 );
aContentBoxLayout->addWidget( myAllowElemsModif, 1, 0 );
connect(myName, SIGNAL(textChanged(const QString&)), this, SLOT(onNameChanged(const QString&)));
connect(myElements, SIGNAL(itemSelectionChanged()), this, SLOT(onListSelectionChanged()));
- connect(myFilterBtn, SIGNAL(clicked()), this, SLOT(setFilters()));
+ connect(myFilterBtn, SIGNAL(clicked()), this, SLOT(setFilters()));
connect(aFilter2, SIGNAL(clicked()), this, SLOT(setFilters()));
connect(mySelectAll, SIGNAL(toggled(bool)), this, SLOT(onSelectAll()));
connect(myAllowElemsModif,SIGNAL(toggled(bool)), this, SLOT(onSelectAll()));
// purpose :
//=================================================================================
void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup,
- const bool theIsConvert)
+ const bool theIsConvert)
{
restoreShowEntityMode();
myMesh = theGroup->GetMesh();
int aType = 0;
switch(theGroup->GetType()) {
- case SMESH::NODE: aType= 0; break;
- case SMESH::EDGE: aType = 1; break;
- case SMESH::FACE: aType = 2; break;
- case SMESH::VOLUME: aType = 3; break;
+ case SMESH::NODE: aType = 0; break;
+ case SMESH::BALL: aType = 1; break;
+ case SMESH::EDGE: aType = 2; break;
+ case SMESH::FACE: aType = 3; break;
+ case SMESH::VOLUME: aType = 4; break;
}
myTypeGroup->button(aType)->setChecked(true);
- myGroup = SMESH::SMESH_Group::_narrow( theGroup );
- myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_narrow( theGroup );
+ myGroup = SMESH::SMESH_Group::_narrow( theGroup );
+ myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_narrow( theGroup );
myGroupOnFilter = SMESH::SMESH_GroupOnFilter::_narrow( theGroup );
- myFilter = SMESH::Filter::_nil();
+ myFilter = SMESH::Filter::_nil();
if (myGroup->_is_nil() && myGroupOnGeom->_is_nil() && myGroupOnFilter->_is_nil() )
return;
case grpEdgeSelection:
if ( aViewWindow ) aViewWindow->SetSelectionMode(isSelectAll ? ActorSelection : EdgeSelection);
break;
+ case grpBallSelection:
+ //if ( aViewWindow ) aViewWindow->SetSelectionMode(isSelectAll ? ActorSelection : BallSelection);
+ break;
case grpFaceSelection:
if ( aViewWindow ) aViewWindow->SetSelectionMode(isSelectAll ? ActorSelection : FaceSelection);
break;
SMESH_TypeFilter* f = 0;
switch (myTypeId) {
- case 0: f = new SMESH_TypeFilter(SUBMESH); break;
- case 1: f = new SMESH_TypeFilter(SUBMESH_EDGE); break;
- case 2: f = new SMESH_TypeFilter(SUBMESH_FACE); break;
- case 3: f = new SMESH_TypeFilter(SUBMESH_SOLID); break;
- default:f = new SMESH_TypeFilter(SUBMESH);
+ case grpNodeSelection: f = new SMESH_TypeFilter(SUBMESH); break;
+ case grpEdgeSelection: f = new SMESH_TypeFilter(SUBMESH_EDGE); break;
+ case grpFaceSelection: f = new SMESH_TypeFilter(SUBMESH_FACE); break;
+ case grpVolumeSelection: f = new SMESH_TypeFilter(SUBMESH_SOLID); break;
+ default: f = new SMESH_TypeFilter(SUBMESH);
}
QList<SUIT_SelectionFilter*> filtList;
filtList.append( f );
SMESH_TypeFilter* f = 0;
switch (myTypeId) {
- case 0: f = new SMESH_TypeFilter(GROUP_NODE); break;
- case 1: f = new SMESH_TypeFilter(GROUP_EDGE); break;
- case 2: f = new SMESH_TypeFilter(GROUP_FACE); break;
- case 3: f = new SMESH_TypeFilter(GROUP_VOLUME); break;
- default:f = new SMESH_TypeFilter(GROUP);
+ case grpNodeSelection: f = new SMESH_TypeFilter(GROUP_NODE); break;
+ case grpBallSelection: f = new SMESH_TypeFilter(GROUP_BALL); break;
+ case grpEdgeSelection: f = new SMESH_TypeFilter(GROUP_EDGE); break;
+ case grpFaceSelection: f = new SMESH_TypeFilter(GROUP_FACE); break;
+ case grpVolumeSelection: f = new SMESH_TypeFilter(GROUP_VOLUME); break;
+ default: f = new SMESH_TypeFilter(GROUP);
}
QList<SUIT_SelectionFilter*> filtList;
filtList.append( f );
SMESH::ElementType aType = SMESH::ALL;
switch (myTypeId) {
- case 0: aType = SMESH::NODE; break;
- case 1: aType = SMESH::EDGE; break;
- case 2: aType = SMESH::FACE; break;
- case 3: aType = SMESH::VOLUME; break;
+ case grpNodeSelection: aType = SMESH::NODE; break;
+ case grpBallSelection: aType = SMESH::BALL; break;
+ case grpEdgeSelection: aType = SMESH::EDGE; break;
+ case grpFaceSelection: aType = SMESH::FACE; break;
+ case grpVolumeSelection: aType = SMESH::VOLUME; break;
}
bool anIsOk = false;
if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str())) {
anActor->setName(myName->text().toLatin1().data());
switch ( myTypeId ) {
- case 0: anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break;
- case 1: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break;
- case 2:
- case 3:
- {
+ case grpNodeSelection: anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break;
+ case grpBallSelection: anActor->SetBallColor( aColor.R, aColor.G, aColor.B ); break;
+ case grpEdgeSelection: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break;
+ case grpFaceSelection:
+ case grpVolumeSelection:
+ default:
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;
- }
}
}
}
else
aGroupMainShape = GEOM::GEOM_Object::_duplicate(aGeomGroup);
_PTR(SObject) aGroupMainShapeSO =
- //aStudy->FindObjectIOR(aStudy->ConvertObjectToIOR(aGroupMainShape));
aStudy->FindObjectID(aGroupMainShape->GetStudyEntry());
_PTR(SObject) anObj, aRef;
bool isRefOrSubShape = false;
if (aMeshSO->FindSubObject(1, anObj) && anObj->ReferencedObject(aRef)) {
- //if (strcmp(aRef->GetID(), aGroupMainShapeSO->GetID()) == 0) {
if (aRef->GetID() == aGroupMainShapeSO->GetID()) {
isRefOrSubShape = true;
} else {
_PTR(SObject) aFather = aGroupMainShapeSO->GetFather();
_PTR(SComponent) aComponent = aGroupMainShapeSO->GetFatherComponent();
- //while (!isRefOrSubShape && strcmp(aFather->GetID(), aComponent->GetID()) != 0) {
while (!isRefOrSubShape && aFather->GetID() != aComponent->GetID()) {
- //if (strcmp(aRef->GetID(), aFather->GetID()) == 0)
if (aRef->GetID() == aFather->GetID())
isRefOrSubShape = true;
else
SMESH::ElementType aType = SMESH::ALL;
switch ( myTypeId )
{
- case 0 : aType = SMESH::NODE; break;
- case 1 : aType = SMESH::EDGE; break;
- case 2 : aType = SMESH::FACE; break;
- case 3 : aType = SMESH::VOLUME; break;
- default: return;
+ case grpNodeSelection: aType = SMESH::NODE; break;
+ case grpBallSelection: aType = SMESH::BALL; break;
+ case grpEdgeSelection: aType = SMESH::EDGE; break;
+ case grpFaceSelection: aType = SMESH::FACE; break;
+ case grpVolumeSelection: aType = SMESH::VOLUME; break;
+ default: return;
}
if ( myFilterDlg == 0 )
SMESH::ElementType aType = SMESH::ALL;
switch(myTypeId) {
- case 0:
+ case grpNodeSelection:
aType = SMESH::NODE;
mySelector->SetSelectionMode(NodeSelection);
break;
- case 1:
+ case grpBallSelection:
+ aType = SMESH::BALL;
+ //mySelector->SetSelectionMode(BallSelection);
+ break;
+ case grpEdgeSelection:
aType = SMESH::EDGE;
mySelector->SetSelectionMode(EdgeSelection);
break;
- case 2:
+ case grpFaceSelection:
aType = SMESH::FACE;
mySelector->SetSelectionMode(FaceSelection);
break;
- case 3:
+ case grpVolumeSelection:
aType = SMESH::VOLUME;
mySelector->SetSelectionMode(VolumeSelection);
break;
SMESH::ElementType aGroupType = SMESH::ALL;
switch(aGroupOp->GetType(myGeomObjects[0])) {
- case 7: aGroupType = SMESH::NODE; break;
- case 6: aGroupType = SMESH::EDGE; break;
- case 4: aGroupType = SMESH::FACE; break;
- case 2: aGroupType = SMESH::VOLUME; break;
+ case TopAbs_VERTEX: aGroupType = SMESH::NODE; break;
+ case TopAbs_EDGE: aGroupType = SMESH::EDGE; break;
+ case TopAbs_FACE: aGroupType = SMESH::FACE; break;
+ case TopAbs_SOLID: aGroupType = SMESH::VOLUME; break;
default: myIsBusy = false; return;
}
SMESH::ElementType aType = SMESH::ALL;
switch(myTypeId) {
- case 0: aType = SMESH::NODE; break;
- case 1: aType = SMESH::EDGE; break;
- case 2: aType = SMESH::FACE; break;
- case 3: aType = SMESH::VOLUME; break;
+ case grpNodeSelection: aType = SMESH::NODE; break;
+ case grpBallSelection: aType = SMESH::BALL; break;
+ case grpEdgeSelection: aType = SMESH::EDGE; break;
+ case grpFaceSelection: aType = SMESH::FACE; break;
+ case grpVolumeSelection: aType = SMESH::VOLUME; break;
}
if (myCurrentLineEdit == mySubMeshLine) {
if (!myStoredShownEntity)
myStoredShownEntity = actor->GetEntityMode();
switch ( myTypeId ) {
- case 0: restoreShowEntityMode(); break;
- case 1: actor->SetEntityMode( SMESH_Actor::eEdges ); break;
- case 2: actor->SetEntityMode( SMESH_Actor::eFaces ); break;
- case 3: actor->SetEntityMode( SMESH_Actor::eVolumes ); break;
+ case grpNodeSelection: restoreShowEntityMode(); break;
+ case grpBallSelection: actor->SetEntityMode( SMESH_Actor::eBallElem ); break;
+ case grpEdgeSelection: actor->SetEntityMode( SMESH_Actor::eEdges ); break;
+ case grpFaceSelection: actor->SetEntityMode( SMESH_Actor::eFaces ); break;
+ case grpVolumeSelection: actor->SetEntityMode( SMESH_Actor::eVolumes ); break;
}
}
}
#include "SMESHGUI_VTKUtils.h"
#include "SMDSAbs_ElementType.hxx"
#include "SMDS_Mesh.hxx"
+#include "SMDS_BallElement.hxx"
+#include "SMDS_EdgePosition.hxx"
+#include "SMDS_FacePosition.hxx"
#include <LightApp_SelectionMgr.h>
#include <SUIT_OverrideCursor.h>
l->setMargin( MARGIN );
l->setSpacing( SPACING );
+ int index = 0;
+
// object
QLabel* aNameLab = new QLabel( tr( "NAME_LAB" ), this );
QLabel* aName = createField();
QLabel* aObjLab = new QLabel( tr( "OBJECT_LAB" ), this );
QLabel* aObj = createField();
aObj->setMinimumWidth( 150 );
- myWidgets[0] << aNameLab << aName;
- myWidgets[1] << aObjLab << aObj;
+ myWidgets[ index++ ] << aNameLab << aName;
+ myWidgets[ index++ ] << aObjLab << aObj;
// nodes
QWidget* aNodesLine = createLine();
QLabel* aNodesLab = new QLabel( tr( "NODES_LAB" ), this );
QLabel* aNodes = createField();
- myWidgets[2] << aNodesLine;
- myWidgets[3] << aNodesLab << aNodes;
+ myWidgets[ index++ ] << aNodesLine;
+ myWidgets[ index++ ] << aNodesLab << aNodes;
// elements
QWidget* aElemLine = createLine();
QLabel* aElemTotal = new QLabel( tr( "TOTAL_LAB" ), this );
QLabel* aElemLin = new QLabel( tr( "LINEAR_LAB" ), this );
QLabel* aElemQuad = new QLabel( tr( "QUADRATIC_LAB" ), this );
- myWidgets[4] << aElemLine;
- myWidgets[5] << aElemLab << aElemTotal << aElemLin << aElemQuad;
+ myWidgets[ index++ ] << aElemLine;
+ myWidgets[ index++ ] << aElemLab << aElemTotal << aElemLin << aElemQuad;
// ... 0D elements
QWidget* a0DLine = createLine();
QLabel* a0DLab = new QLabel( tr( "0D_LAB" ), this );
QLabel* a0DTotal = createField();
- myWidgets[6] << a0DLine;
- myWidgets[7] << a0DLab << a0DTotal;
+ myWidgets[ index++ ] << a0DLine;
+ myWidgets[ index++ ] << a0DLab << a0DTotal;
+
+ // ... Ball elements
+ QWidget* aBallLine = createLine();
+ QLabel* aBallLab = new QLabel( tr( "BALL_LAB" ), this );
+ QLabel* aBallTotal = createField();
+ myWidgets[ index++ ] << aBallLine;
+ myWidgets[ index++ ] << aBallLab << aBallTotal;
// ... 1D elements
QWidget* a1DLine = createLine();
QLabel* a1DTotal = createField();
QLabel* a1DLin = createField();
QLabel* a1DQuad = createField();
- myWidgets[8] << a1DLine;
- myWidgets[9] << a1DLab << a1DTotal << a1DLin << a1DQuad;
+ myWidgets[ index++ ] << a1DLine;
+ myWidgets[ index++ ] << a1DLab << a1DTotal << a1DLin << a1DQuad;
// ... 2D elements
QWidget* a2DLine = createLine();
QLabel* a2DQuaQuad = createField();
QLabel* a2DPolLab = new QLabel( tr( "POLYGONS_LAB" ), this );
QLabel* a2DPolTotal = createField();
- myWidgets[10] << a2DLine;
- myWidgets[11] << a2DLab << a2DTotal << a2DLin << a2DQuad;
- myWidgets[12] << a2DTriLab << a2DTriTotal << a2DTriLin << a2DTriQuad;
- myWidgets[13] << a2DQuaLab << a2DQuaTotal << a2DQuaLin << a2DQuaQuad;
- myWidgets[14] << a2DPolLab << a2DPolTotal;
+ myWidgets[ index++ ] << a2DLine;
+ myWidgets[ index++ ] << a2DLab << a2DTotal << a2DLin << a2DQuad;
+ myWidgets[ index++ ] << a2DTriLab << a2DTriTotal << a2DTriLin << a2DTriQuad;
+ myWidgets[ index++ ] << a2DQuaLab << a2DQuaTotal << a2DQuaLin << a2DQuaQuad;
+ myWidgets[ index++ ] << a2DPolLab << a2DPolTotal;
// ... 3D elements
QWidget* a3DLine = createLine();
QLabel* a3DHexPriTotal = createField();
QLabel* a3DPolLab = new QLabel( tr( "POLYHEDRONS_LAB" ), this );
QLabel* a3DPolTotal = createField();
- myWidgets[15] << a3DLine;
- myWidgets[16] << a3DLab << a3DTotal << a3DLin << a3DQuad;
- myWidgets[17] << a3DTetLab << a3DTetTotal << a3DTetLin << a3DTetQuad;
- myWidgets[18] << a3DHexLab << a3DHexTotal << a3DHexLin << a3DHexQuad;
- myWidgets[19] << a3DPyrLab << a3DPyrTotal << a3DPyrLin << a3DPyrQuad;
- myWidgets[20] << a3DPriLab << a3DPriTotal << a3DPriLin << a3DPriQuad;
- myWidgets[21] << a3DHexPriLab << a3DHexPriTotal;
- myWidgets[22] << a3DPolLab << a3DPolTotal;
+ myWidgets[ index++ ] << a3DLine;
+ myWidgets[ index++ ] << a3DLab << a3DTotal << a3DLin << a3DQuad;
+ myWidgets[ index++ ] << a3DTetLab << a3DTetTotal << a3DTetLin << a3DTetQuad;
+ myWidgets[ index++ ] << a3DHexLab << a3DHexTotal << a3DHexLin << a3DHexQuad;
+ myWidgets[ index++ ] << a3DPyrLab << a3DPyrTotal << a3DPyrLin << a3DPyrQuad;
+ myWidgets[ index++ ] << a3DPriLab << a3DPriTotal << a3DPriLin << a3DPriQuad;
+ myWidgets[ index++ ] << a3DHexPriLab << a3DHexPriTotal;
+ myWidgets[ index++ ] << a3DPolLab << a3DPolTotal;
myLoadBtn = new QPushButton( tr( "BUT_LOAD_MESH" ), this );
myLoadBtn->setAutoDefault( true );
setFontAttributes( aElemLin, Italic );
setFontAttributes( aElemQuad, Italic );
setFontAttributes( a0DLab, Bold );
+ setFontAttributes( aBallLab, Bold );
setFontAttributes( a1DLab, Bold );
setFontAttributes( a2DLab, Bold );
setFontAttributes( a3DLab, Bold );
l->addWidget( a0DLine, 6, 1, 1, 3 );
l->addWidget( a0DLab, 7, 0 );
l->addWidget( a0DTotal, 7, 1 );
- l->addWidget( a1DLine, 8, 1, 1, 3 );
- l->addWidget( a1DLab, 9, 0 );
- l->addWidget( a1DTotal, 9, 1 );
- l->addWidget( a1DLin, 9, 2 );
- l->addWidget( a1DQuad, 9, 3 );
- l->addWidget( a2DLine, 10, 1, 1, 3 );
- l->addWidget( a2DLab, 11, 0 );
- l->addWidget( a2DTotal, 11, 1 );
- l->addWidget( a2DLin, 11, 2 );
- l->addWidget( a2DQuad, 11, 3 );
- l->addWidget( a2DTriLab, 12, 0 );
- l->addWidget( a2DTriTotal, 12, 1 );
- l->addWidget( a2DTriLin, 12, 2 );
- l->addWidget( a2DTriQuad, 12, 3 );
- l->addWidget( a2DQuaLab, 13, 0 );
- l->addWidget( a2DQuaTotal, 13, 1 );
- l->addWidget( a2DQuaLin, 13, 2 );
- l->addWidget( a2DQuaQuad, 13, 3 );
- l->addWidget( a2DPolLab, 14, 0 );
- l->addWidget( a2DPolTotal, 14, 1 );
- l->addWidget( a3DLine, 15, 1, 1, 3 );
- l->addWidget( a3DLab, 16, 0 );
- l->addWidget( a3DTotal, 16, 1 );
- l->addWidget( a3DLin, 16, 2 );
- l->addWidget( a3DQuad, 16, 3 );
- l->addWidget( a3DTetLab, 17, 0 );
- l->addWidget( a3DTetTotal, 17, 1 );
- l->addWidget( a3DTetLin, 17, 2 );
- l->addWidget( a3DTetQuad, 17, 3 );
- l->addWidget( a3DHexLab, 18, 0 );
- l->addWidget( a3DHexTotal, 18, 1 );
- l->addWidget( a3DHexLin, 18, 2 );
- l->addWidget( a3DHexQuad, 18, 3 );
- l->addWidget( a3DPyrLab, 19, 0 );
- l->addWidget( a3DPyrTotal, 19, 1 );
- l->addWidget( a3DPyrLin, 19, 2 );
- l->addWidget( a3DPyrQuad, 19, 3 );
- l->addWidget( a3DPriLab, 20, 0 );
- l->addWidget( a3DPriTotal, 20, 1 );
- l->addWidget( a3DPriLin, 20, 2 );
- l->addWidget( a3DPriQuad, 20, 3 );
- l->addWidget( a3DHexPriLab, 21, 0 );
- l->addWidget( a3DHexPriTotal, 21, 1 );
- l->addWidget( a3DPolLab, 22, 0 );
- l->addWidget( a3DPolTotal, 22, 1 );
- l->addWidget( myLoadBtn, 23, 1, 1, 3 );
+ l->addWidget( aBallLine, 8, 1, 1, 3 );
+ l->addWidget( aBallLab, 9, 0 );
+ l->addWidget( aBallTotal, 9, 1 );
+ l->addWidget( a1DLine, 10, 1, 1, 3 );
+ l->addWidget( a1DLab, 11, 0 );
+ l->addWidget( a1DTotal, 11, 1 );
+ l->addWidget( a1DLin, 11, 2 );
+ l->addWidget( a1DQuad, 11, 3 );
+ l->addWidget( a2DLine, 12, 1, 1, 3 );
+ l->addWidget( a2DLab, 13, 0 );
+ l->addWidget( a2DTotal, 13, 1 );
+ l->addWidget( a2DLin, 13, 2 );
+ l->addWidget( a2DQuad, 13, 3 );
+ l->addWidget( a2DTriLab, 14, 0 );
+ l->addWidget( a2DTriTotal, 14, 1 );
+ l->addWidget( a2DTriLin, 14, 2 );
+ l->addWidget( a2DTriQuad, 14, 3 );
+ l->addWidget( a2DQuaLab, 15, 0 );
+ l->addWidget( a2DQuaTotal, 15, 1 );
+ l->addWidget( a2DQuaLin, 15, 2 );
+ l->addWidget( a2DQuaQuad, 15, 3 );
+ l->addWidget( a2DPolLab, 16, 0 );
+ l->addWidget( a2DPolTotal, 16, 1 );
+ l->addWidget( a3DLine, 17, 1, 1, 3 );
+ l->addWidget( a3DLab, 18, 0 );
+ l->addWidget( a3DTotal, 18, 1 );
+ l->addWidget( a3DLin, 18, 2 );
+ l->addWidget( a3DQuad, 18, 3 );
+ l->addWidget( a3DTetLab, 19, 0 );
+ l->addWidget( a3DTetTotal, 19, 1 );
+ l->addWidget( a3DTetLin, 19, 2 );
+ l->addWidget( a3DTetQuad, 19, 3 );
+ l->addWidget( a3DHexLab, 20, 0 );
+ l->addWidget( a3DHexTotal, 20, 1 );
+ l->addWidget( a3DHexLin, 20, 2 );
+ l->addWidget( a3DHexQuad, 20, 3 );
+ l->addWidget( a3DPyrLab, 21, 0 );
+ l->addWidget( a3DPyrTotal, 21, 1 );
+ l->addWidget( a3DPyrLin, 21, 2 );
+ l->addWidget( a3DPyrQuad, 21, 3 );
+ l->addWidget( a3DPriLab, 22, 0 );
+ l->addWidget( a3DPriTotal, 22, 1 );
+ l->addWidget( a3DPriLin, 22, 2 );
+ l->addWidget( a3DPriQuad, 22, 3 );
+ l->addWidget( a3DHexPriLab, 23, 0 );
+ l->addWidget( a3DHexPriTotal, 23, 1 );
+ l->addWidget( a3DPolLab, 24, 0 );
+ l->addWidget( a3DPolTotal, 24, 1 );
+ l->addWidget( myLoadBtn, 25, 1, 1, 3 );
l->setColumnStretch( 0, 0 );
l->setColumnStretch( 1, 5 );
l->setColumnStretch( 2, 5 );
case SMESH::ELEM0D:
objType = tr( "OBJECT_GROUP_0DELEMS" );
break;
+ case SMESH::BALL:
+ objType = tr( "OBJECT_GROUP_BALLS" );
+ break;
default:
objType = tr( "OBJECT_GROUP" );
break;
SMESH::long_array_var info = obj->GetMeshInfo();
myWidgets[iNodes][iTotal] ->setProperty( "text", QString::number( info[SMDSEntity_Node] ) );
myWidgets[i0D][iTotal] ->setProperty( "text", QString::number( info[SMDSEntity_0D] ) );
+ myWidgets[iBalls][iTotal] ->setProperty( "text", QString::number( info[SMDSEntity_Ball] ) );
long nbEdges = info[SMDSEntity_Edge] + info[SMDSEntity_Quad_Edge];
myWidgets[i1D][iTotal] ->setProperty( "text", QString::number( nbEdges ) );
myWidgets[i1D][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Edge] ) );
{
myWidgets[iNodes][iTotal] ->setProperty( "text", "?" );
myWidgets[i0D][iTotal] ->setProperty( "text", "?" );
+ myWidgets[iBalls][iTotal] ->setProperty( "text", "?" );
myWidgets[i1D][iTotal] ->setProperty( "text", "?" );
myWidgets[i1D][iLinear] ->setProperty( "text", "?" );
myWidgets[i1D][iQuadratic] ->setProperty( "text", "?" );
*/
void SMESHGUI_MeshInfo::clear()
{
- myWidgets[iName][iSingle]->setProperty( "text", QString() );
- myWidgets[iObject][iSingle]->setProperty( "text", QString() );
- myWidgets[iNodes][iTotal]->setProperty( "text", QString::number( 0 ) );
- myWidgets[i0D][iTotal]->setProperty( "text", QString::number( 0 ) );
- myWidgets[i1D][iTotal]->setProperty( "text", QString::number( 0 ) );
- myWidgets[i1D][iLinear]->setProperty( "text", QString::number( 0 ) );
- myWidgets[i1D][iQuadratic]->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2D][iTotal]->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2D][iLinear]->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2D][iQuadratic]->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2DTriangles][iTotal]->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2DTriangles][iLinear]->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2DTriangles][iQuadratic]->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2DQuadrangles][iTotal]->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2DQuadrangles][iLinear]->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2DQuadrangles][iQuadratic]->setProperty( "text", QString::number( 0 ) );
- myWidgets[i2DPolygons][iTotal]->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3D][iTotal]->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3D][iLinear]->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3D][iQuadratic]->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DTetrahedrons][iTotal]->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DTetrahedrons][iLinear]->setProperty( "text", QString::number( 0 ) );
+ myWidgets[iName][iSingle] ->setProperty( "text", QString() );
+ myWidgets[iObject][iSingle] ->setProperty( "text", QString() );
+ myWidgets[iNodes][iTotal] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i0D][iTotal] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[iBalls][iTotal] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i1D][iTotal] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i1D][iLinear] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i1D][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i2D][iTotal] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i2D][iLinear] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i2D][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i2DTriangles][iTotal] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i2DTriangles][iLinear] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i2DTriangles][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i2DQuadrangles][iTotal] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i2DQuadrangles][iLinear] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i2DQuadrangles][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i2DPolygons][iTotal] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i3D][iTotal] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i3D][iLinear] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i3D][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i3DTetrahedrons][iTotal] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i3DTetrahedrons][iLinear] ->setProperty( "text", QString::number( 0 ) );
myWidgets[i3DTetrahedrons][iQuadratic]->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DHexahedrons][iTotal]->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DHexahedrons][iLinear]->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DHexahedrons][iQuadratic]->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DPyramids][iTotal]->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DPyramids][iLinear]->setProperty( "text", QString::number( 0 ) );
- myWidgets[i3DPyramids][iQuadratic]->setProperty( "text", QString::number( 0 ) );
- 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 ) );
+ myWidgets[i3DHexahedrons][iTotal] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i3DHexahedrons][iLinear] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i3DHexahedrons][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i3DPyramids][iTotal] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i3DPyramids][iLinear] ->setProperty( "text", QString::number( 0 ) );
+ myWidgets[i3DPyramids][iQuadratic] ->setProperty( "text", QString::number( 0 ) );
+ 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 ) );
}
/*!
//
// show node info
//
- const SMDS_MeshElement* e = actor()->GetObject()->GetMesh()->FindNode( id );
- if ( !e ) return;
- const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( e );
-
+ const SMDS_MeshNode* node = actor()->GetObject()->GetMesh()->FindNode( id );
+ if ( !node ) return;
+
// node ID
myInfo->append( QString( "<b>%1 #%2</b>" ).arg( tr( "NODE" ) ).arg( id ) );
// separator
con = formatConnectivity( connectivity, SMDSAbs_Edge );
if ( !con.isEmpty() )
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "EDGES" ) ).arg( con ) );
+ con = formatConnectivity( connectivity, SMDSAbs_Ball );
+ if ( !con.isEmpty() )
+ myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "BALL_ELEMENTS" ) ).arg( con ) );
con = formatConnectivity( connectivity, SMDSAbs_Face );
if ( !con.isEmpty() )
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "FACES" ) ).arg( con ) );
switch( e->GetType() ) {
case SMDSAbs_0DElement:
stype = tr( "0D ELEMENT" ); break;
+ case SMDSAbs_Ball:
+ stype = tr( "BALL" ); break;
case SMDSAbs_Edge:
stype = tr( "EDGE" ); break;
case SMDSAbs_Face:
if ( !gtype.isEmpty() )
myInfo->append( QString( "<b>%1:</b> %2" ).arg( tr( "TYPE" ) ).arg( gtype ) );
// quadratic flag and gravity center (any element except 0D)
- if ( e->GetEntityType() > SMDSEntity_0D && e->GetEntityType() < SMDSEntity_Last ) {
+ if ( e->GetEntityType() > SMDSEntity_0D && e->GetEntityType() < SMDSEntity_Ball ) {
// quadratic flag
myInfo->append( QString( "<b>%1?</b> %2" ).arg( tr( "QUADRATIC" ) ).arg( e->IsQuadratic() ? tr( "YES" ) : tr( "NO" ) ) );
// separator
XYZ gc = gravityCenter( e );
myInfo->append( QString( "<b>%1:</b> (%2, %3, %4)" ).arg( tr( "GRAVITY_CENTER" ) ).arg( gc.x() ).arg( gc.y() ).arg( gc.z() ) );
}
+ if ( const SMDS_BallElement* ball = dynamic_cast<const SMDS_BallElement*>( e )) {
+ // ball diameter
+ myInfo->append( QString( "<b>%1:</b> %2" ).arg( tr( "BALL_DIAMETER" ) ).arg( ball->GetDiameter() ));
+ }
// separator
myInfo->append( "" );
// connectivity
i->setText( 0, tr( "0D_ELEMENTS" ) );
i->setText( 1, con );
}
+ con = formatConnectivity( connectivity, SMDSAbs_Ball );
+ if ( !con.isEmpty() ) {
+ QTreeWidgetItem* i = createItem( conItem );
+ i->setText( 0, tr( "BALL_ELEMENTS" ) );
+ i->setText( 1, con );
+ }
con = formatConnectivity( connectivity, SMDSAbs_Edge );
if ( !con.isEmpty() ) {
QTreeWidgetItem* i = createItem( conItem );
else {
conItem->setText( 1, tr( "FREE_NODE" ) );
}
+ // node position
+ int shapeID = node->getshapeId();
+ if ( shapeID > 0 )
+ {
+ SMDS_PositionPtr pos = node->GetPosition();
+ SMDS_TypeOfPosition posType = pos->GetTypeOfPosition();
+ QString shapeType;
+ double u,v;
+ switch ( posType ) {
+ case SMDS_TOP_EDGE: shapeType = tr( "EDGE" );
+ u = static_cast<SMDS_EdgePosition*>( pos )->GetUParameter();
+ break;
+ case SMDS_TOP_FACE: shapeType = tr( "FACE" );
+ u = static_cast<SMDS_FacePosition*>( pos )->GetUParameter();
+ v = static_cast<SMDS_FacePosition*>( pos )->GetVParameter();
+ break;
+ case SMDS_TOP_VERTEX: shapeType = tr( "VERTEX" ); break;
+ default: shapeType = tr( "SOLID" );
+ }
+ QTreeWidgetItem* posItem = createItem( nodeItem, Bold );
+ posItem->setText( 0, tr("NODE_POSITION") );
+ posItem->setText( 1, (shapeType + " #%1").arg( shapeID ));
+ if ( posType == SMDS_TOP_EDGE || posType == SMDS_TOP_FACE ) {
+ QTreeWidgetItem* uItem = createItem( posItem );
+ uItem->setText( 0, tr("U_POSITION") );
+ uItem->setText( 1, QString::number( u, precision > 0 ? 'f' : 'g', qAbs( precision )));
+ if ( posType == SMDS_TOP_FACE ) {
+ QTreeWidgetItem* vItem = createItem( posItem );
+ vItem->setText( 0, tr("V_POSITION") );
+ vItem->setText( 1, QString::number( v, precision > 0 ? 'f' : 'g', qAbs( precision )));
+ }
+ }
+ }
}
else {
//
switch( e->GetType() ) {
case SMDSAbs_0DElement:
stype = tr( "0D ELEMENT" ); break;
+ case SMDSAbs_Ball:
+ stype = tr( "BALL" ); break;
case SMDSAbs_Edge:
stype = tr( "EDGE" ); break;
case SMDSAbs_Face:
typeItem->setText( 1, gtype );
}
// quadratic flag and gravity center (any element except 0D)
- if ( e->GetEntityType() > SMDSEntity_0D && e->GetEntityType() < SMDSEntity_Last ) {
+ if ( e->GetEntityType() > SMDSEntity_0D && e->GetEntityType() < SMDSEntity_Ball ) {
// quadratic flag
QTreeWidgetItem* quadItem = createItem( elemItem, Bold );
quadItem->setText( 0, tr( "QUADRATIC" ) );
zItem->setText( 0, "Z" );
zItem->setText( 1, QString::number( gc.z(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
}
+ if ( const SMDS_BallElement* ball = dynamic_cast<const SMDS_BallElement*>( e )) {
+ // ball diameter
+ QTreeWidgetItem* diamItem = createItem( elemItem, Bold );
+ diamItem->setText( 0, tr( "BALL_DIAMETER" ) );
+ diamItem->setText( 1, QString( "%1" ).arg( ball->GetDiameter() ));
+ }
// connectivity
QTreeWidgetItem* conItem = createItem( elemItem, Bold );
conItem->setText( 0, tr( "CONNECTIVITY" ) );
i->setText( 0, tr( "EDGES" ) );
i->setText( 1, con );
}
+ con = formatConnectivity( connectivity, SMDSAbs_Ball );
+ if ( !con.isEmpty() ) {
+ QTreeWidgetItem* i = createItem( nconItem );
+ i->setText( 0, tr( "BALL_ELEMENTS" ) );
+ i->setText( 1, con );
+ }
con = formatConnectivity( connectivity, SMDSAbs_Face );
if ( !con.isEmpty() ) {
QTreeWidgetItem* i = createItem( nconItem );
case SMESH::ELEM0D:
etype = tr( "0DELEM" );
break;
+ case SMESH::BALL:
+ etype = tr( "BALL" );
+ break;
default:
break;
}
itemGroups = parent->child( i );
ExtraWidget* extra = dynamic_cast<ExtraWidget*>( itemWidget( itemGroups, 1 ) );
if ( extra )
- extra->updateControls( myGroups->length(), idx );
+ extra->updateControls( myGroups->length(), idx );
while ( itemGroups->childCount() ) delete itemGroups->child( 0 ); // clear child items
}
}
// total number of groups > 10, show extra widgets for info browsing
if ( myGroups->length() > MAXITEMS ) {
- ExtraWidget* extra = new ExtraWidget( this, true );
- connect( extra->prev, SIGNAL( clicked() ), this, SLOT( showPreviousGroups() ) );
- connect( extra->next, SIGNAL( clicked() ), this, SLOT( showNextGroups() ) );
- setItemWidget( itemGroups, 1, extra );
- extra->updateControls( myGroups->length(), idx );
+ ExtraWidget* extra = new ExtraWidget( this, true );
+ connect( extra->prev, SIGNAL( clicked() ), this, SLOT( showPreviousGroups() ) );
+ connect( extra->next, SIGNAL( clicked() ), this, SLOT( showNextGroups() ) );
+ setItemWidget( itemGroups, 1, extra );
+ extra->updateControls( myGroups->length(), idx );
}
}
itemSubMeshes = parent->child( i );
ExtraWidget* extra = dynamic_cast<ExtraWidget*>( itemWidget( itemSubMeshes, 1 ) );
if ( extra )
- extra->updateControls( mySubMeshes->length(), idx );
+ extra->updateControls( mySubMeshes->length(), idx );
while ( itemSubMeshes->childCount() ) delete itemSubMeshes->child( 0 ); // clear child items
}
}
// total number of sub-meshes > 10, show extra widgets for info browsing
if ( mySubMeshes->length() > MAXITEMS ) {
- ExtraWidget* extra = new ExtraWidget( this, true );
- connect( extra->prev, SIGNAL( clicked() ), this, SLOT( showPreviousSubMeshes() ) );
- connect( extra->next, SIGNAL( clicked() ), this, SLOT( showNextSubMeshes() ) );
- setItemWidget( itemSubMeshes, 1, extra );
- extra->updateControls( mySubMeshes->length(), idx );
+ ExtraWidget* extra = new ExtraWidget( this, true );
+ connect( extra->prev, SIGNAL( clicked() ), this, SLOT( showPreviousSubMeshes() ) );
+ connect( extra->next, SIGNAL( clicked() ), this, SLOT( showNextSubMeshes() ) );
+ setItemWidget( itemSubMeshes, 1, extra );
+ extra->updateControls( mySubMeshes->length(), idx );
}
}
i0DStart,
i0D,
i0DEnd,
- i1DStart = i0DEnd,
+ iBallsStart = i0DEnd,
+ iBalls,
+ iBallsEnd,
+ i1DStart = iBallsEnd,
i1D,
i1DEnd,
i2DStart = i1DEnd,
SpinBox_0DElements_Size->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
SpinBox_0DElements_Size->setButtonSymbols( QSpinBox::PlusMinus );
+ QLabel* TextLabel_BallElem_Color = new QLabel( tr( "0D_ELEMENTS_COLOR_LBL" ), ButtonGroup1 );
+ btnBallElemColor = new QtxColorButton( ButtonGroup1 );
+
+ QLabel* TextLabel_BallElem_Size = new QLabel( tr( "BALLELEM_SIZE_LBL" ), ButtonGroup1 );
+ SpinBox_BallElem_Size = new SalomeApp_IntSpinBox( ButtonGroup1 );
+ SpinBox_BallElem_Size->setAcceptNames( false ); // No Notebook variables allowed
+ SpinBox_BallElem_Size->setRange( 1, 10 );
+ SpinBox_BallElem_Size->setSingleStep( 1 );
+ SpinBox_BallElem_Size->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ SpinBox_BallElem_Size->setButtonSymbols( QSpinBox::PlusMinus );
+
QLabel* TextLabel_Width = new QLabel( tr( "LINE_WIDTH_LBL" ), ButtonGroup1 );
SpinBox_Width = new SalomeApp_IntSpinBox( ButtonGroup1 );
SpinBox_Width->setAcceptNames( false ); // No Notebook variables allowed
ButtonGroup1Layout->addWidget( TextLabel_0DElements_Size, 2, 2 );
ButtonGroup1Layout->addWidget( SpinBox_0DElements_Size, 2, 3 );
+ ButtonGroup1Layout->addWidget( TextLabel_BallElem_Color, 2, 0 );
+ ButtonGroup1Layout->addWidget( btnBallElemColor, 2, 1 );
+
+ ButtonGroup1Layout->addWidget( TextLabel_BallElem_Size, 2, 2 );
+ ButtonGroup1Layout->addWidget( SpinBox_BallElem_Size, 2, 3 );
+
ButtonGroup1Layout->addWidget( TextLabel_Width, 3, 0 );
ButtonGroup1Layout->addWidget( SpinBox_Width, 3, 1 );
ButtonGroup1Layout->addWidget( TextLabel_ShrinkCoeff, 3, 2 );
case 3 : btnNodeColor->setColor( color ); break; // node
case 4 : btnOutlineColor->setColor( color ); break; // outline
case 5 : btn0DElementsColor->setColor( color ); break; // 0d elements
- case 6 : btnOrientationColor->setColor( color ); break; // orientation of faces
- case 7 : btnSelectionColor->setColor( color ); break; // selection color
- case 8 : btnPreselectionColor->setColor( color ); break; // pre-selection color
+ case 6 : btnBallElemColor->setColor( color ); break; // ball elements
+ case 7 : btnOrientationColor->setColor( color ); break; // orientation of faces
+ case 8 : btnSelectionColor->setColor( color ); break; // selection color
+ case 9 : btnPreselectionColor->setColor( color ); break; // pre-selection color
default: break;
}
}
case 3 : color = btnNodeColor->color(); break; // node
case 4 : color = btnOutlineColor->color(); break; // node
case 5 : color = btn0DElementsColor->color(); break; // 0d elements
- case 6 : color = btnOrientationColor->color(); break; // orientation of faces
- case 7 : color = btnSelectionColor->color(); break; // selection color
- case 8 : color = btnPreselectionColor->color(); break; // pre-selection color
+ case 6 : color = btnBallElemColor->color(); break; // 0d elements
+ case 7 : color = btnOrientationColor->color(); break; // orientation of faces
+ case 8 : color = btnSelectionColor->color(); break; // selection color
+ case 9 : color = btnPreselectionColor->color(); break; // pre-selection color
default: break;
}
case 1 : SpinBox_Width->setValue( value ); break; // width
case 2 : SpinBox_Shrink->setValue( value ); break; // shrink coeff
case 3 : SpinBox_0DElements_Size->setValue( value ); break; // 0d elements
+ case 4 : SpinBox_BallElem_Size->setValue( value ); break; // 0d elements
default: break;
}
}
case 1 : res = SpinBox_Width->value(); break; // width
case 2 : res = SpinBox_Shrink->value(); break; // shrink coeff
case 3 : res = SpinBox_0DElements_Size->value(); break; // 0d elements
+ case 4 : res = SpinBox_BallElem_Size->value(); break; // 0d elements
default: break;
}
return res;
QtxColorButton* btnWireframeColor;
QtxColorButton* btnOutlineColor;
QtxColorButton* btn0DElementsColor;
+ QtxColorButton* btnBallElemColor;
SalomeApp_IntSpinBox* SpinBox_0DElements_Size;
+ SalomeApp_IntSpinBox* SpinBox_BallElem_Size;
SalomeApp_IntSpinBox* SpinBox_Width;
SalomeApp_IntSpinBox* SpinBox_Shrink;
QtxColorButton* btnNodeColor;
// SMESH SMESHGUI_Selection
// File : SMESHGUI_Selection.cxx
// Author : Alexander SOLOVYOV, Open CASCADE S.A.S.
-// SMESH includes
//
+
+// SMESH includes
#include "SMESHGUI_Selection.h"
#include "SMESHGUI_Utils.h"
//=======================================================================
//function : elemTypes
-//purpose : may return {'Elem0d' 'Edge' 'Face' 'Volume'} at most
+//purpose : may return {'Elem0d' 'Edge' 'Face' 'Volume' 'BallElem'} at most
//=======================================================================
QList<QVariant> SMESHGUI_Selection::elemTypes( int ind ) const
TVisualObjPtr object = actor->GetObject();
if ( object ) {
if ( object->GetNbEntities( SMDSAbs_0DElement )) types.append( "Elem0d" );
+ if ( object->GetNbEntities( SMDSAbs_Ball )) types.append( "BallElem" );
if ( object->GetNbEntities( SMDSAbs_Edge )) types.append( "Edge" );
if ( object->GetNbEntities( SMDSAbs_Face )) types.append( "Face" );
if ( object->GetNbEntities( SMDSAbs_Volume )) types.append( "Volume" );
//=======================================================================
//function : entityMode
-//purpose : may return {'Elem0d' 'Edge' 'Face' 'Volume'} at most
+//purpose : may return {'Elem0d' 'Edge' 'Face' 'Volume' 'BallElem' } at most
//=======================================================================
QList<QVariant> SMESHGUI_Selection::entityMode( int ind ) const
if ( aMode & SMESH_Actor::eFaces ) types.append( "Face" );
if ( aMode & SMESH_Actor::eEdges ) types.append( "Edge" );
if ( aMode & SMESH_Actor::e0DElements ) types.append( "Elem0d" );
+ if ( aMode & SMESH_Actor::eBallElem ) types.append( "BallElem" );
}
return types;
}
case SMESH::FACE : dim = std::max( dim, 2 ); break;
case SMESH::VOLUME: dim = std::max( dim, 3 ); break;
case SMESH::ELEM0D: dim = std::max( dim, 0 ); break;
+ case SMESH::BALL : dim = std::max( dim, 0 ); break;
default:;
}
}
anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B );
else if( aGroup->GetType() == SMESH::ELEM0D )
anActor->Set0DColor( aColor.R, aColor.G, aColor.B );
+ else if( aGroup->GetType() == SMESH::BALL )
+ anActor->SetBallColor( aColor.R, aColor.G, aColor.B );
else
anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B, delta );
}
aPreColor = mgr->colorValue( "SMESH", "highlight_color", Qt::cyan );
int aElem0DSize = mgr->integerValue("SMESH", "elem0d_size", 5);
+ int aBallSize = mgr->integerValue("SMESH", "ball_elem_size", 5);
int aLineWidth = mgr->integerValue("SMESH", "element_width", 1);
int maxSize = aElem0DSize;
if (aElem0DSize > maxSize) maxSize = aElem0DSize;
if (aLineWidth > maxSize) maxSize = aLineWidth;
+ if (aBallSize > maxSize) maxSize = aBallSize;
double SP1 = mgr->doubleValue( "SMESH", "selection_precision_node", 0.025 ),
SP2 = mgr->doubleValue( "SMESH", "selection_precision_element", 0.001 ),
<source>ICON_DLG_COPY_MESH</source>
<translation>copy_mesh.png</translation>
</message>
+ <message>
+ <source>ICON_DLG_BALL</source>
+ <translation>mesh_ball.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_BALL_ELEMENT</source>
+ <translation>mesh_ball.png</translation>
+ </message>
<message>
<source>ICON_DLG_ELEM0D</source>
<translation>mesh_vertex.png</translation>
<source>ALL_FILES_FILTER</source>
<translation>All files</translation>
</message>
+ <message>
+ <source>SMESH_AND</source>
+ <translation>and</translation>
+ </message>
<message>
<source>AREA_ELEMENTS</source>
<translation>Area</translation>
<source>ASPECTRATIO_ELEMENTS</source>
<translation>Aspect Ratio</translation>
</message>
+ <message>
+ <source>NODE_POSITION</source>
+ <translation>Position</translation>
+ </message>
+ <message>
+ <source>U_POSITION</source>
+ <translation>U</translation>
+ </message>
+ <message>
+ <source>V_POSITION</source>
+ <translation>V</translation>
+ </message>
<message>
<source>COL_ALGO_HEADER</source>
<translation>Algorithm</translation>
<source>MEN_ELEMS0D</source>
<translation>0D Elements</translation>
</message>
+ <message>
+ <source>MEN_BALL</source>
+ <translation>Ball</translation>
+ </message>
+ <message>
+ <source>MEN_BALLS</source>
+ <translation>Balls</translation>
+ </message>
<message>
<source>MEN_EDGE</source>
<translation>Edge</translation>
<source>SMESH_ADD_ELEM0D_TITLE</source>
<translation>Add 0D Element</translation>
</message>
+ <message>
+ <source>SMESH_ADD_BALL</source>
+ <translation>Add Ball Element</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_BALL_TITLE</source>
+ <translation>Add Ball Element</translation>
+ </message>
<message>
<source>SMESH_ADD_EDGE</source>
<translation>Add Edge</translation>
<source>SMESH_ELEM0D</source>
<translation>0D Element</translation>
</message>
+ <message>
+ <source>SMESH_ELEMS0D</source>
+ <translation>0D Elements</translation>
+ </message>
+ <message>
+ <source>SMESH_BALL_ELEM</source>
+ <translation>Ball</translation>
+ </message>
+ <message>
+ <source>SMESH_BALL</source>
+ <translation>Ball</translation>
+ </message>
+ <message>
+ <source>SMESH_BALLS</source>
+ <translation>Balls</translation>
+ </message>
<message>
<source>SMESH_EDGE</source>
<translation>Edge</translation>
</message>
+ <message>
+ <source>SMESH_EDGES</source>
+ <translation>Edges</translation>
+ </message>
<message>
<source>SMESH_EDGES_CONNECTIVITY_TITLE</source>
<translation>Edges Connectivity</translation>
Overwrite the file?</translation>
</message>
<message>
- <source>SMESH_EXPORT_STL1</source>
- <translation>Mesh - "%1" does not contain triangles</translation>
- </message>
- <message>
- <source>SMESH_EXPORT_STL2</source>
- <translation>Mesh - "%1" contains another than triangles elements, they are ignored during writing to STL</translation>
- </message>
- <message>
- <source>SMESH_EXPORT_UNV</source>
- <translation>During export mesh with name "%1" to UNV
- pyramids, hexagonal prisms, polygons and polyhedra elements will be missed</translation>
+ <source>EXPORT_NOT_SUPPORTED</source>
+ <translation>During export mesh with name "%1" to %2
+%3 will be missed.
+Do you want to continue ?</translation>
</message>
<message>
<source>SMESH_EXTRUSION</source>
<source>SMESH_HEXAS</source>
<translation>Hexahedron</translation>
</message>
+ <message>
+ <source>SMESH_HEXAHEDRA</source>
+ <translation>Hexahedrons</translation>
+ </message>
<message>
<source>SMESH_HILIGHT_COLOR</source>
<translation>Highlight Color</translation>
<source>SMESH_OCTA</source>
<translation>Hexagonal prism</translation>
</message>
+ <message>
+ <source>SMESH_OCTAHEDRA</source>
+ <translation>Hexagonal prisms</translation>
+ </message>
<message>
<source>TOP_OCTA</source>
<translation>Hexagonal prism</translation>
<source>SMESH_PENTA</source>
<translation>Pentahedron</translation>
</message>
+ <message>
+ <source>SMESH_PENTAHEDRA</source>
+ <translation>Pentahedrons</translation>
+ </message>
<message>
<source>TOP_PENTA</source>
<translation>Pentahedron</translation>
<source>SMESH_POLYEDRON</source>
<translation>Polyhedron</translation>
</message>
+ <message>
+ <source>SMESH_POLYEDRONS</source>
+ <translation>Polyhedrons</translation>
+ </message>
+ <message>
+ <source>SMESH_QUADRATIC_POLYEDRON</source>
+ <translation>Quadratic Polyhedron</translation>
+ </message>
+ <message>
+ <source>SMESH_QUADRATIC_POLYEDRONS</source>
+ <translation>Quadratic Polyhedrons</translation>
+ </message>
<message>
<source>SMESH_POLYGON</source>
<translation>Polygon</translation>
</message>
+ <message>
+ <source>SMESH_POLYGONS</source>
+ <translation>Polygons</translation>
+ </message>
+ <message>
+ <source>SMESH_QUADRATIC_POLYGON</source>
+ <translation>Quadratic Polygon</translation>
+ </message>
+ <message>
+ <source>SMESH_QUADRATIC_POLYGONS</source>
+ <translation>Quadratic Polygons</translation>
+ </message>
<message>
<source>SMESH_POSITION_SIZE_SCALARBAR</source>
<translation>Origin && Size</translation>
<source>SMESH_PYRAMID</source>
<translation>Pyramid</translation>
</message>
+ <message>
+ <source>SMESH_PYRAMIDS</source>
+ <translation>Pyramids</translation>
+ </message>
<message>
<source>MEN_PYRAMID</source>
<translation>Pyramid</translation>
<source>SMESH_QUADRANGLE</source>
<translation>Quadrangle</translation>
</message>
+ <message>
+ <source>SMESH_QUADRANGLES</source>
+ <translation>Quadrangles</translation>
+ </message>
<message>
<source>SMESH_QUADRATIC_EDGE</source>
<translation>Quadratic Edge</translation>
</message>
+ <message>
+ <source>SMESH_QUADRATIC_EDGES</source>
+ <translation>Quadratic Edges</translation>
+ </message>
<message>
<source>SMESH_QUADRATIC_HEXAHEDRON</source>
<translation>Quadratic Hexahedron</translation>
</message>
+ <message>
+ <source>SMESH_QUADRATIC_HEXAHEDRONS</source>
+ <translation>Quadratic Hexahedrons</translation>
+ </message>
<message>
<source>SMESH_TRIQUADRATIC_HEXAHEDRON</source>
<translation>TriQuadratic Hexahedron</translation>
</message>
+ <message>
+ <source>SMESH_TRIQUADRATIC_HEXAHEDRONS</source>
+ <translation>TriQuadratic Hexahedrons</translation>
+ </message>
<message>
<source>TOP_TRIQUADRATIC_HEXAHEDRON</source>
<translation>TriQuadratic Hexahedron</translation>
<source>SMESH_QUADRATIC_PENTAHEDRON</source>
<translation>Quadratic Pentahedron</translation>
</message>
+ <message>
+ <source>SMESH_QUADRATIC_PENTAHEDRONS</source>
+ <translation>Quadratic Pentahedrons</translation>
+ </message>
<message>
<source>SMESH_QUADRATIC_PYRAMID</source>
<translation>Quadratic Pyramid</translation>
</message>
+ <message>
+ <source>SMESH_QUADRATIC_PYRAMIDS</source>
+ <translation>Quadratic Pyramids</translation>
+ </message>
<message>
<source>SMESH_QUADRATIC_QUADRANGLE</source>
<translation>Quadratic Quadrangle</translation>
</message>
+ <message>
+ <source>SMESH_QUADRATIC_QUADRANGLES</source>
+ <translation>Quadratic Quadrangles</translation>
+ </message>
<message>
<source>SMESH_BIQUADRATIC_QUADRANGLE</source>
<translation>BiQuadratic Quadrangle</translation>
</message>
+ <message>
+ <source>SMESH_BIQUADRATIC_QUADRANGLES</source>
+ <translation>BiQuadratic Quadrangles</translation>
+ </message>
<message>
<source>MEN_BIQUADRATIC_QUADRANGLE</source>
<translation>BiQuadratic Quadrangle</translation>
<source>SMESH_QUADRATIC_TETRAHEDRON</source>
<translation>Quadratic Tetrahedron</translation>
</message>
+ <message>
+ <source>SMESH_QUADRATIC_TETRAHEDRONS</source>
+ <translation>Quadratic Tetrahedrons</translation>
+ </message>
<message>
<source>SMESH_QUADRATIC_TRIANGLE</source>
<translation>Quadratic Triangle</translation>
</message>
+ <message>
+ <source>SMESH_QUADRATIC_TRIANGLES</source>
+ <translation>Quadratic Triangles</translation>
+ </message>
<message>
<source>SMESH_RANGE_MAX</source>
<translation>Max value:</translation>
<source>SMESH_TETRAS</source>
<translation>Tetrahedron</translation>
</message>
+ <message>
+ <source>SMESH_TETRAHEDRA</source>
+ <translation>Tetrahedrons</translation>
+ </message>
<message>
<source>SMESH_TITLE</source>
<translation>Title:</translation>
<source>SMESH_TRIANGLE</source>
<translation>Triangle</translation>
</message>
+ <message>
+ <source>SMESH_TRIANGLES</source>
+ <translation>Triangles</translation>
+ </message>
<message>
<source>SMESH_UPDATEVIEW</source>
<translation>Update View</translation>
<source>STB_ELEMS0D</source>
<translation>0D Elements</translation>
</message>
+ <message>
+ <source>STB_BALLS</source>
+ <translation>Ball Elements</translation>
+ </message>
+ <message>
+ <source>STB_BALL</source>
+ <translation>Ball Element</translation>
+ </message>
<message>
<source>STB_EDGE</source>
<translation>Edge</translation>
<source>TOP_ELEMS0D</source>
<translation>0D Elements</translation>
</message>
+ <message>
+ <source>TOP_BALL</source>
+ <translation>Ball</translation>
+ </message>
+ <message>
+ <source>TOP_BALLS</source>
+ <translation>Balls</translation>
+ </message>
<message>
<source>TOP_EDGE</source>
<translation>Edge</translation>
<source>MESH_LOADING_MSG_FINISHED</source>
<translation>Mesh %0 loading done</translation>
</message>
+ <message>
+ <source>BALL_DIAMETER</source>
+ <translation>Diameter</translation>
+ </message>
+ <message>
+ <source>BALL_ELEMENT</source>
+ <translation>Ball</translation>
+ </message>
<message>
<source>DEP_OBJECT</source>
<translation>Selected object has been used to create another one.
<source>PREF_SIZE_0D</source>
<translation>Size of 0D elements</translation>
</message>
+ <message>
+ <source>PREF_BALL_COLOR</source>
+ <translation>Balls</translation>
+ </message>
+ <message>
+ <source>PREF_BALL_SIZE</source>
+ <translation>Size of ball elements</translation>
+ </message>
<message>
<source>PREF_WIDTH</source>
<translation>Width</translation>
<source>CRITERION</source>
<translation>Criterion</translation>
</message>
+ <message>
+ <source>BALLS</source>
+ <translation>Balls</translation>
+ </message>
<message>
<source>EDGES</source>
<translation>Edges</translation>
<source>GEOM_TYPE_10</source>
<translation>Polyhedra</translation>
</message>
+ <message>
+ <source>GEOM_TYPE_11</source>
+ <translation>Ball</translation>
+ </message>
</context>
<context>
<name>SMESHGUI_GroupOpDlg</name>
<source>0D_LAB</source>
<translation>0D:</translation>
</message>
+ <message>
+ <source>BALL_LAB</source>
+ <translation>Balls:</translation>
+ </message>
<message>
<source>1D_LAB</source>
<translation>1D (edges):</translation>
<source>OBJECT_GROUP_0DELEMS</source>
<translation>Group of 0D elements</translation>
</message>
+ <message>
+ <source>OBJECT_GROUP_BALLS</source>
+ <translation>Group of balls</translation>
+ </message>
<message>
<source>BUT_LOAD_MESH</source>
<translation>Load mesh from server</translation>
<source>0D_ELEMENTS</source>
<translation>0D ELEMENTS</translation>
</message>
+ <message>
+ <source>BALL_ELEMENT</source>
+ <translation>BALL ELEMENT</translation>
+ </message>
+ <message>
+ <source>BALL_ELEMENTS</source>
+ <translation>BALL ELEMENTS</translation>
+ </message>
<message>
<source>EDGE</source>
<translation>EDGE</translation>
<source>GROUPS_5</source>
<translation>0D elements</translation>
</message>
+ <message>
+ <source>GROUPS_6</source>
+ <translation>Ball elements</translation>
+ </message>
<message>
<source>PARENT_MESH</source>
<translation>Parent mesh</translation>
<source>0DELEM</source>
<translation>0D element</translation>
</message>
+ <message>
+ <source>BALL_ELEMENT</source>
+ <translation>ball</translation>
+ </message>
<message>
<source>UNKNOWN</source>
<translation>Unknown</translation>
<source>0D_ELEMENTS_SIZE_LBL</source>
<translation>Size of 0D elements</translation>
</message>
+ <message>
+ <source>BALL_ELEMENTS_COLOR_LBL</source>
+ <translation>Ball elements</translation>
+ </message>
+ <message>
+ <source>BALL_ELEMENTS_SIZE_LBL</source>
+ <translation>Size of balls</translation>
+ </message>
<message>
<source>LINE_WIDTH_LBL</source>
<translation>Line width</translation>
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : SMESH_2smeshpy.cxx
// Created : Fri Nov 18 13:20:10 2005
// Author : Edward AGAPOV (eap)
// - FT_EqualEdges = 15
// - FT_EqualFaces = 16
// - FT_EqualVolumes = 17
+ // v 6.6.0: FT_Undefined == 44, new items:
+ // - FT_BallDiameter = 37
+ //
+ // It's necessary to continue recording this history and to fill
+ // undef2newItems (see below) accordingly.
typedef map< int, vector< int > > TUndef2newItems;
static TUndef2newItems undef2newItems;
undef2newItems[ 39 ].assign( items, items+6 ); }
{ int items[] = { 14, 15, 16, 17 };
undef2newItems[ 43 ].assign( items, items+4 ); }
+ { int items[] = { 37 };
+ undef2newItems[ 44 ].assign( items, items+1 ); }
}
int iType = Type.IntegerValue();
if ( Type == "SMESH.FT_ElemGeomType" && Threshold.IsIntegerValue() )
{
// set SMESH.GeometryType instead of a numerical Threshold
- const char* types[SMESH::Geom_POLYHEDRA+1] = {
+ const char* types[SMESH::Geom_BALL+1] = {
"Geom_POINT", "Geom_EDGE", "Geom_TRIANGLE", "Geom_QUADRANGLE", "Geom_POLYGON",
"Geom_TETRA", "Geom_PYRAMID", "Geom_HEXA", "Geom_PENTA", "Geom_HEXAGONAL_PRISM",
- "Geom_POLYHEDRA"
+ "Geom_POLYHEDRA", "Geom_BALL"
};
int iGeom = Threshold.IntegerValue();
if ( -1 < iGeom && iGeom < SMESH::Geom_POLYHEDRA+1 )
static TStringSet sameMethods;
if ( sameMethods.empty() ) {
const char * names[] = {
- "RemoveElements","RemoveNodes","RemoveOrphanNodes","AddNode","Add0DElement","AddEdge","AddFace","AddPolygonalFace",
+ "RemoveElements","RemoveNodes","RemoveOrphanNodes","AddNode","Add0DElement","AddEdge","AddFace","AddPolygonalFace","AddBall",
"AddVolume","AddPolyhedralVolume","AddPolyhedralVolumeByFaces","MoveNode", "MoveClosestNodeToPoint",
"InverseDiag","DeleteDiag","Reorient","ReorientObject","TriToQuad","SplitQuad","SplitQuadObject",
"BestSplit","Smooth","SmoothObject","SmoothParametric","SmoothParametricObject",
{
myStream<<"SMESH.";
switch(theArg){
- case ALL: myStream<<"ALL";break;
- case NODE: myStream<<"NODE";break;
- case EDGE: myStream<<"EDGE";break;
- case FACE: myStream<<"FACE";break;
- case VOLUME:myStream<<"VOLUME";break;
- case ELEM0D:myStream<<"ELEM0D";break;
- default: myStream<<"__UNKNOWN__ElementType: " << theArg;
+ case ALL: myStream<<"ALL"; break;
+ case NODE: myStream<<"NODE"; break;
+ case EDGE: myStream<<"EDGE"; break;
+ case FACE: myStream<<"FACE"; break;
+ case VOLUME: myStream<<"VOLUME"; break;
+ case ELEM0D: myStream<<"ELEM0D"; break;
+ case BALL: myStream<<"BALL"; break;
+ default: myStream<<"__UNKNOWN__ElementType: " << theArg;
}
return *this;
}
case Geom_HEXA: myStream<<"Geom_HEXA"; break;
case Geom_PENTA: myStream<<"Geom_PENTA"; break;
case Geom_POLYHEDRA: myStream<<"Geom_POLYHEDRA"; break;
+ case Geom_BALL: myStream<<"Geom_BALL"; break;
default: myStream<<"__UNKNOWN__GeometryType: " << theArg;
}
return *this;
return SMESH::FT_MultiConnection;
}
+/*
+ Class : BallDiameter_i
+ Description : Functor returning diameter of a ball element
+*/
+BallDiameter_i::BallDiameter_i()
+{
+ myNumericalFunctorPtr.reset( new Controls::BallDiameter() );
+ myFunctorPtr = myNumericalFunctorPtr;
+}
+
+FunctorType BallDiameter_i::GetFunctorType()
+{
+ return SMESH::FT_BallDiameter;
+}
+
/*
Class : MultiConnection2D_i
Description : Functor for calculating number of faces conneted to the edge
return anObj._retn();
}
+BallDiameter_ptr FilterManager_i::CreateBallDiameter()
+{
+ SMESH::BallDiameter_i* aServant = new SMESH::BallDiameter_i();
+ SMESH::BallDiameter_var anObj = aServant->_this();
+ TPythonDump()<<aServant<<" = "<<this<<".CreateBallDiameter()";
+ return anObj._retn();
+}
+
BelongToGeom_ptr FilterManager_i::CreateBelongToGeom()
{
SMESH::BelongToGeom_i* aServant = new SMESH::BelongToGeom_i();
case SMESH::FT_MaxElementLength3D:
aFunctor = aFilterMgr->CreateMaxElementLength3D();
break;
+ case SMESH::FT_BallDiameter:
+ aFunctor = aFilterMgr->CreateBallDiameter();
+ break;
// Predicates
static const char* functName[ SMESH::FT_Undefined + 1 ] = {
// IT's necessary to update this array according to enum FunctorType (SMESH_Filter.idl)
// The order is IMPORTANT !!!
- "FT_AspectRatio", "FT_AspectRatio3D", "FT_Warping", "FT_MinimumAngle",
- "FT_Taper", "FT_Skew", "FT_Area", "FT_Volume3D", "FT_MaxElementLength2D",
- "FT_MaxElementLength3D", "FT_FreeBorders", "FT_FreeEdges", "FT_FreeNodes",
- "FT_FreeFaces","FT_EqualNodes","FT_EqualEdges","FT_EqualFaces","FT_EqualVolumes",
- "FT_MultiConnection", "FT_MultiConnection2D", "FT_Length",
- "FT_Length2D", "FT_BelongToGeom", "FT_BelongToPlane", "FT_BelongToCylinder",
- "FT_BelongToGenSurface", "FT_LyingOnGeom", "FT_RangeOfIds", "FT_BadOrientedVolume",
- "FT_BareBorderVolume", "FT_BareBorderFace", "FT_OverConstrainedVolume",
- "FT_OverConstrainedFace", "FT_LinearOrQuadratic", "FT_GroupColor", "FT_ElemGeomType",
- "FT_CoplanarFaces", "FT_LessThan", "FT_MoreThan", "FT_EqualTo", "FT_LogicalNOT",
- "FT_LogicalAND", "FT_LogicalOR", "FT_Undefined" };
+ "FT_AspectRatio",
+ "FT_AspectRatio3D",
+ "FT_Warping",
+ "FT_MinimumAngle",
+ "FT_Taper",
+ "FT_Skew",
+ "FT_Area",
+ "FT_Volume3D",
+ "FT_MaxElementLength2D",
+ "FT_MaxElementLength3D",
+ "FT_FreeBorders",
+ "FT_FreeEdges",
+ "FT_FreeNodes",
+ "FT_FreeFaces",
+ "FT_EqualNodes",
+ "FT_EqualEdges",
+ "FT_EqualFaces",
+ "FT_EqualVolumes",
+ "FT_MultiConnection",
+ "FT_MultiConnection2D",
+ "FT_Length",
+ "FT_Length2D",
+ "FT_BelongToGeom",
+ "FT_BelongToPlane",
+ "FT_BelongToCylinder",
+ "FT_BelongToGenSurface",
+ "FT_LyingOnGeom",
+ "FT_RangeOfIds",
+ "FT_BadOrientedVolume",
+ "FT_BareBorderVolume",
+ "FT_BareBorderFace",
+ "FT_OverConstrainedVolume",
+ "FT_OverConstrainedFace",
+ "FT_LinearOrQuadratic",
+ "FT_GroupColor",
+ "FT_ElemGeomType",
+ "FT_CoplanarFaces",
+ "FT_BallDiameter",
+ "FT_LessThan",
+ "FT_MoreThan",
+ "FT_EqualTo",
+ "FT_LogicalNOT",
+ "FT_LogicalAND",
+ "FT_LogicalOR",
+ "FT_Undefined" };
return functName;
}
Description : An abstact class for all functors
*/
class SMESH_I_EXPORT Functor_i: public virtual POA_SMESH::Functor,
- public virtual SALOME::GenericObj_i
+ public virtual SALOME::GenericObj_i
{
public:
void SetMesh( SMESH_Mesh_ptr theMesh );
Description : Base class for numerical functors
*/
class SMESH_I_EXPORT NumericalFunctor_i: public virtual POA_SMESH::NumericalFunctor,
- public virtual Functor_i
+ public virtual Functor_i
{
public:
CORBA::Double GetValue( CORBA::Long theElementId );
Description : Functor for calculation of minimum angle
*/
class SMESH_I_EXPORT MinimumAngle_i: public virtual POA_SMESH::MinimumAngle,
- public virtual NumericalFunctor_i
+ public virtual NumericalFunctor_i
{
public:
MinimumAngle_i();
Description : Functor for calculating aspect ratio
*/
class SMESH_I_EXPORT AspectRatio_i: public virtual POA_SMESH::AspectRatio,
- public virtual NumericalFunctor_i
+ public virtual NumericalFunctor_i
{
public:
AspectRatio_i();
Description : Functor for calculating aspect ratio for 3D
*/
class SMESH_I_EXPORT AspectRatio3D_i: public virtual POA_SMESH::AspectRatio3D,
- public virtual NumericalFunctor_i
+ public virtual NumericalFunctor_i
{
public:
AspectRatio3D_i();
Description : Functor for calculating warping
*/
class SMESH_I_EXPORT Warping_i: public virtual POA_SMESH::Warping,
- public virtual NumericalFunctor_i
+ public virtual NumericalFunctor_i
{
public:
Warping_i();
Description : Functor for calculating taper
*/
class SMESH_I_EXPORT Taper_i: public virtual POA_SMESH::Taper,
- public virtual NumericalFunctor_i
+ public virtual NumericalFunctor_i
{
public:
Taper_i();
Description : Functor for calculating skew in degrees
*/
class SMESH_I_EXPORT Skew_i: public virtual POA_SMESH::Skew,
- public virtual NumericalFunctor_i
+ public virtual NumericalFunctor_i
{
public:
Skew_i();
Description : Functor for calculating area
*/
class SMESH_I_EXPORT Area_i: public virtual POA_SMESH::Area,
- public virtual NumericalFunctor_i
+ public virtual NumericalFunctor_i
{
public:
Area_i();
Description : Functor for calculating volume of 3D element
*/
class SMESH_I_EXPORT Volume3D_i: public virtual POA_SMESH::Volume3D,
- public virtual NumericalFunctor_i
+ public virtual NumericalFunctor_i
{
public:
Volume3D_i();
Description : Functor for calculating length of edge
*/
class SMESH_I_EXPORT Length_i: public virtual POA_SMESH::Length,
- public virtual NumericalFunctor_i
+ public virtual NumericalFunctor_i
{
public:
Length_i();
Description : Functor for calculating length of edge
*/
class SMESH_I_EXPORT Length2D_i: public virtual POA_SMESH::Length2D,
- public virtual NumericalFunctor_i
+ public virtual NumericalFunctor_i
{
public:
Length2D_i();
Description : Functor for calculating number of faces conneted to the edge
*/
class SMESH_I_EXPORT MultiConnection_i: public virtual POA_SMESH::MultiConnection,
- public virtual NumericalFunctor_i
+ public virtual NumericalFunctor_i
{
public:
MultiConnection_i();
Description : Functor for calculating number of faces conneted to the edge
*/
class SMESH_I_EXPORT MultiConnection2D_i: public virtual POA_SMESH::MultiConnection2D,
- public virtual NumericalFunctor_i
+ public virtual NumericalFunctor_i
{
public:
MultiConnection2D_i();
Controls::MultiConnection2DPtr myMulticonnection2DPtr;
};
+ /*
+ Class : BallDiameter_i
+ Description : Functor returning diameter of a ball element
+ */
+ class SMESH_I_EXPORT BallDiameter_i: public virtual POA_SMESH::BallDiameter,
+ public virtual NumericalFunctor_i
+ {
+ public:
+ BallDiameter_i();
+ FunctorType GetFunctorType();
+ };
+
/*
PREDICATES
Description : Base class for all predicates
*/
class SMESH_I_EXPORT Predicate_i: public virtual POA_SMESH::Predicate,
- public virtual Functor_i
+ public virtual Functor_i
{
public:
CORBA::Boolean IsSatisfy( CORBA::Long theElementId );
the point of view of MED convention
*/
class SMESH_I_EXPORT BadOrientedVolume_i: public virtual POA_SMESH::BadOrientedVolume,
- public virtual Predicate_i
+ public virtual Predicate_i
{
public:
BadOrientedVolume_i();
Description : Verify whether a mesh face has a free border without an edge on it
*/
class SMESH_I_EXPORT BareBorderFace_i: public virtual POA_SMESH::BareBorderFace,
- public virtual Predicate_i
+ public virtual Predicate_i
{
public:
BareBorderFace_i();
Description : Verify whether a mesh volume has only one facet shared with other volumes
*/
class SMESH_I_EXPORT OverConstrainedVolume_i: public virtual POA_SMESH::OverConstrainedVolume,
- public virtual Predicate_i
+ public virtual Predicate_i
{
public:
OverConstrainedVolume_i();
Description : Verify whether a mesh face has only one border shared with other faces
*/
class SMESH_I_EXPORT OverConstrainedFace_i: public virtual POA_SMESH::OverConstrainedFace,
- public virtual Predicate_i
+ public virtual Predicate_i
{
public:
OverConstrainedFace_i();
Description : Predicate for selection on geometrical support
*/
class SMESH_I_EXPORT BelongToGeom_i: public virtual POA_SMESH::BelongToGeom,
- public virtual Predicate_i
+ public virtual Predicate_i
{
public:
BelongToGeom_i();
Description : Verify whether mesh element lie in pointed Geom planar object
*/
class SMESH_I_EXPORT BelongToSurface_i: public virtual POA_SMESH::BelongToSurface,
- public virtual Predicate_i
+ public virtual Predicate_i
{
public:
BelongToSurface_i( const Handle(Standard_Type)& );
Description : Verify whether mesh element lie in pointed Geom planar object
*/
class SMESH_I_EXPORT BelongToPlane_i: public virtual POA_SMESH::BelongToPlane,
- public virtual BelongToSurface_i
+ public virtual BelongToSurface_i
{
public:
BelongToPlane_i();
Description : Verify whether mesh element lie in pointed Geom cylindrical object
*/
class SMESH_I_EXPORT BelongToCylinder_i: public virtual POA_SMESH::BelongToCylinder,
- public virtual BelongToSurface_i
+ public virtual BelongToSurface_i
{
public:
BelongToCylinder_i();
Description : Predicate for selection on geometrical support(lying or partially lying)
*/
class SMESH_I_EXPORT LyingOnGeom_i: public virtual POA_SMESH::LyingOnGeom,
- public virtual Predicate_i
+ public virtual Predicate_i
{
public:
LyingOnGeom_i();
Description : Predicate for free borders
*/
class SMESH_I_EXPORT FreeBorders_i: public virtual POA_SMESH::FreeBorders,
- public virtual Predicate_i
+ public virtual Predicate_i
{
public:
FreeBorders_i();
Description : Predicate for free edges
*/
class SMESH_I_EXPORT FreeEdges_i: public virtual POA_SMESH::FreeEdges,
- public virtual Predicate_i
+ public virtual Predicate_i
{
public:
FreeEdges_i();
Description : Predicate for free faces
*/
class SMESH_I_EXPORT FreeFaces_i: public virtual POA_SMESH::FreeFaces,
- public virtual Predicate_i
+ public virtual Predicate_i
{
public:
FreeFaces_i();
Description : Predicate for free nodes
*/
class SMESH_I_EXPORT FreeNodes_i: public virtual POA_SMESH::FreeNodes,
- public virtual Predicate_i
+ public virtual Predicate_i
{
public:
FreeNodes_i();
Description : Predicate for Range of Ids
*/
class SMESH_I_EXPORT RangeOfIds_i: public virtual POA_SMESH::RangeOfIds,
- public virtual Predicate_i
+ public virtual Predicate_i
{
public:
RangeOfIds_i();
Description : Verify whether a mesh element is linear
*/
class SMESH_I_EXPORT LinearOrQuadratic_i: public virtual POA_SMESH::LinearOrQuadratic,
- public virtual Predicate_i
+ public virtual Predicate_i
{
public:
LinearOrQuadratic_i();
Description : Functor for check color of group to whic mesh element belongs to
*/
class SMESH_I_EXPORT GroupColor_i: public virtual POA_SMESH::GroupColor,
- public virtual Predicate_i
+ public virtual Predicate_i
{
public:
GroupColor_i();
Description : Functor for check element geometry type
*/
class SMESH_I_EXPORT ElemGeomType_i: public virtual POA_SMESH::ElemGeomType,
- public virtual Predicate_i
+ public virtual Predicate_i
{
public:
ElemGeomType_i();
Description : Returns true if a mesh face is a coplanar neighbour to a given one
*/
class SMESH_I_EXPORT CoplanarFaces_i: public virtual POA_SMESH::CoplanarFaces,
- public virtual Predicate_i
+ public virtual Predicate_i
{
public:
CoplanarFaces_i();
Description : Base class for comparators
*/
class SMESH_I_EXPORT Comparator_i: public virtual POA_SMESH::Comparator,
- public virtual Predicate_i
+ public virtual Predicate_i
{
public:
virtual ~Comparator_i();
Description : Comparator "<"
*/
class SMESH_I_EXPORT LessThan_i: public virtual POA_SMESH::LessThan,
- public virtual Comparator_i
+ public virtual Comparator_i
{
public:
LessThan_i();
Description : Comparator ">"
*/
class SMESH_I_EXPORT MoreThan_i: public virtual POA_SMESH::MoreThan,
- public virtual Comparator_i
+ public virtual Comparator_i
{
public:
MoreThan_i();
Description : Comparator "="
*/
class SMESH_I_EXPORT EqualTo_i: public virtual POA_SMESH::EqualTo,
- public virtual Comparator_i
+ public virtual Comparator_i
{
public:
EqualTo_i();
Description : Logical NOT predicate
*/
class SMESH_I_EXPORT LogicalNOT_i: public virtual POA_SMESH::LogicalNOT,
- public virtual Predicate_i
+ public virtual Predicate_i
{
public:
LogicalNOT_i();
Description : Base class for binary logical predicate
*/
class SMESH_I_EXPORT LogicalBinary_i: public virtual POA_SMESH::LogicalBinary,
- public virtual Predicate_i
+ public virtual Predicate_i
{
public:
virtual ~LogicalBinary_i();
Description : Logical AND
*/
class SMESH_I_EXPORT LogicalAND_i: public virtual POA_SMESH::LogicalAND,
- public virtual LogicalBinary_i
+ public virtual LogicalBinary_i
{
public:
LogicalAND_i();
Description : Logical OR
*/
class SMESH_I_EXPORT LogicalOR_i: public virtual POA_SMESH::LogicalOR,
- public virtual LogicalBinary_i
+ public virtual LogicalBinary_i
{
public:
LogicalOR_i();
*/
class SMESH_I_EXPORT FilterManager_i: public virtual POA_SMESH::FilterManager,
- public virtual SALOME::GenericObj_i
+ public virtual SALOME::GenericObj_i
{
public:
FilterManager_i();
Length2D_ptr CreateLength2D();
MultiConnection_ptr CreateMultiConnection();
MultiConnection2D_ptr CreateMultiConnection2D();
+ BallDiameter_ptr CreateBallDiameter();
BelongToGeom_ptr CreateBelongToGeom();
BelongToPlane_ptr CreateBelongToPlane();
int anNbEdges = 0;
int anNbFaces = 0;
int anNbVolumes = 0;
+ int aNbBalls = 0;
SMESH::long_array_var anIDsNodes = new SMESH::long_array();
SMESH::long_array_var anIDsEdges = new SMESH::long_array();
SMESH::long_array_var anIDsFaces = new SMESH::long_array();
SMESH::long_array_var anIDsVolumes = new SMESH::long_array();
+ SMESH::long_array_var anIDsBalls = new SMESH::long_array();
if( theCommonGroups ) {
anIDsNodes->length( anInitMeshDS->NbNodes() );
anIDsEdges->length( anInitMeshDS->NbEdges() );
anIDsFaces->length( anInitMeshDS->NbFaces() );
anIDsVolumes->length( anInitMeshDS->NbVolumes() );
+ anIDsBalls->length( anInitMeshDS->NbBalls() );
}
for ( int j = 0; itElems->more(); j++) {
}//nodes loop
// creates a corresponding element on existent nodes in new mesh
- if ( anElem->IsPoly() && anElemType == SMDSAbs_Volume )
+ switch ( anElem->GetEntityType() ) {
+ case SMDSEntity_Polyhedra:
+ if ( const SMDS_VtkVolume* aVolume =
+ dynamic_cast<const SMDS_VtkVolume*> (anElem))
{
- const SMDS_VtkVolume* aVolume =
- dynamic_cast<const SMDS_VtkVolume*> (anElem);
- if ( aVolume ) {
- aNewElem = aNewMeshDS->AddPolyhedralVolume(aNodesArray,
- aVolume->GetQuantities());
- elemsMap.insert(make_pair(anElem->GetID(), aNewElem->GetID()));
- if( theCommonGroups )
+ aNewElem = aNewMeshDS->AddPolyhedralVolume(aNodesArray,
+ aVolume->GetQuantities());
+ elemsMap.insert(make_pair(anElem->GetID(), aNewElem->GetID()));
+ if( theCommonGroups )
+ anIDsVolumes[anNbVolumes++] = aNewElem->GetID();
+ }
+ break;
+ case SMDSEntity_Ball:
+ if ( const SMDS_BallElement* aBall =
+ dynamic_cast<const SMDS_BallElement*> (anElem))
+ {
+ aNewElem = aNewEditor.AddElement(aNodesArray, SMDSAbs_Ball,
+ /*isPoly=*/false, /*id=*/0,
+ aBall->GetDiameter() );
+ elemsMap.insert(make_pair(anElem->GetID(), aNewElem->GetID()));
+ if( theCommonGroups )
+ anIDsBalls[aNbBalls++] = aNewElem->GetID();
+ }
+ break;
+ default:
+ {
+ aNewElem = aNewEditor.AddElement(aNodesArray,
+ anElemType,
+ anElem->IsPoly());
+ elemsMap.insert(make_pair(anElem->GetID(), aNewElem->GetID()));
+ if( theCommonGroups ) {
+ if( anElemType == SMDSAbs_Edge )
+ anIDsEdges[anNbEdges++] = aNewElem->GetID();
+ else if( anElemType == SMDSAbs_Face )
+ anIDsFaces[anNbFaces++] = aNewElem->GetID();
+ else if( anElemType == SMDSAbs_Volume )
anIDsVolumes[anNbVolumes++] = aNewElem->GetID();
}
}
- else {
-
- aNewElem = aNewEditor.AddElement(aNodesArray,
- anElemType,
- anElem->IsPoly());
- elemsMap.insert(make_pair(anElem->GetID(), aNewElem->GetID()));
- if( theCommonGroups ) {
- if( anElemType == SMDSAbs_Edge )
- anIDsEdges[anNbEdges++] = aNewElem->GetID();
- else if( anElemType == SMDSAbs_Face )
- anIDsFaces[anNbFaces++] = aNewElem->GetID();
- else if( anElemType == SMDSAbs_Volume )
- anIDsVolumes[anNbVolumes++] = aNewElem->GetID();
- }
}
}//elems loop
SMESH::ElementType aGroupType;
CORBA::String_var aGroupName;
if ( theCommonGroups ) {
- for(aGroupType=SMESH::NODE;aGroupType<=SMESH::VOLUME;aGroupType=(SMESH::ElementType)(aGroupType+1)) {
+ for(aGroupType=SMESH::NODE;aGroupType<=SMESH::BALL;aGroupType=(SMESH::ElementType)(aGroupType+1)) {
string str = "Gr";
SALOMEDS::SObject_var aMeshSObj = ObjectToSObject( myCurrentStudy, anInitMesh );
if(aMeshSObj)
anIDsVolumes->length(anNbVolumes);
anLen = anNbVolumes;
break;
+ case SMESH::BALL:
+ str += "Balls";
+ anIDsBalls->length(aNbBalls);
+ anLen = aNbBalls;
+ break;
default:
break;
}
case SMESH::VOLUME:
aNewGroup->Add( anIDsVolumes );
break;
+ case SMESH::BALL:
+ aNewGroup->Add( anIDsBalls );
+ break;
default:
break;
}
// IPAL21468 Change icon of compound because it need not be computed.
SALOMEDS::SObject_var aMeshSObj = ObjectToSObject( myCurrentStudy, aNewMesh );
- if( !aMeshSObj->_is_nil() ) {
- SALOMEDS::GenericAttribute_var anAttr;
- SALOMEDS::StudyBuilder_var aBuilder = myCurrentStudy->NewBuilder();
- anAttr = aBuilder->FindOrCreateAttribute( aMeshSObj,"AttributePixMap" );
- SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
- aPixmap->SetPixMap("ICON_SMESH_TREE_MESH");
- }
+ SetPixMap( aMeshSObj, "ICON_SMESH_TREE_MESH" );
+
if (aNewMeshDS)
aNewMeshDS->Modified();
return aNewMesh._retn();
while ( srcElemIt->more() )
{
const SMDS_MeshElement * elem = srcElemIt->next();
+ // find / add nodes
nodes.resize( elem->NbNodes());
SMDS_ElemIteratorPtr nIt = elem->nodesIterator();
if ( toKeepIDs ) {
nodes[ iN ] = (const SMDS_MeshNode*) n2n->second;
}
}
+ // add elements
if ( elem->GetType() != SMDSAbs_Node )
{
int ID = toKeepIDs ? elem->GetID() : 0;
const SMDS_MeshElement * newElem;
- if ( elem->GetEntityType() == SMDSEntity_Polyhedra )
+ switch ( elem->GetEntityType() ) {
+ case SMDSEntity_Polyhedra:
newElem = editor.GetMeshDS()->
AddPolyhedralVolumeWithID( nodes,
static_cast<const SMDS_VtkVolume*>(elem)->GetQuantities(),
- elem->GetID());
- else
+ ID);
+ break;
+ case SMDSEntity_Ball:
+ newElem = editor.AddElement( nodes, SMDSAbs_Ball, false, ID,
+ static_cast<const SMDS_BallElement*>(elem)->GetDiameter());
+ break;
+ default:
newElem = editor.AddElement( nodes,elem->GetType(),elem->IsPoly(),ID);
if ( toCopyGroups && !toKeepIDs )
e2eMapByType[ elem->GetType() ].insert( make_pair( elem, newElem ));
+ }
}
- }
+ } // while ( srcElemIt->more() )
// 4(b). Copy free nodes
// groups root sub-branch
SALOMEDS::SObject_var myGroupsBranch;
- for ( int i = GetNodeGroupsTag(); i <= Get0DElementsGroupsTag(); i++ ) {
+ for ( int i = GetNodeGroupsTag(); i <= GetBallElementsGroupsTag(); i++ ) {
found = gotBranch->FindSubObject( i, myGroupsBranch );
if ( found ) {
char name_group[ 30 ];
strcpy( name_group, "Groups of Volumes" );
else if ( i == Get0DElementsGroupsTag() )
strcpy( name_group, "Groups of 0D Elements" );
+ else if ( i == GetBallElementsGroupsTag() )
+ strcpy( name_group, "Groups of Balls" );
aGroup = new HDFgroup( name_group, aTopGroup );
aGroup->CreateOnDisk();
}
// try to get GROUPS
- for ( int ii = GetNodeGroupsTag(); ii <= Get0DElementsGroupsTag(); ii++ ) {
+ for ( int ii = GetNodeGroupsTag(); ii <= GetBallElementsGroupsTag(); ii++ ) {
char name_group[ 30 ];
if ( ii == GetNodeGroupsTag() )
strcpy( name_group, "Groups of Nodes" );
strcpy( name_group, "Groups of Volumes" );
else if ( ii == Get0DElementsGroupsTag() )
strcpy( name_group, "Groups of 0D Elements" );
+ else if ( ii == GetBallElementsGroupsTag() )
+ strcpy( name_group, "Groups of Balls" );
if ( aTopGroup->ExistInternalObject( name_group ) ) {
aGroup = new HDFgroup( name_group, aTopGroup );
static long GetFaceGroupsTag();
static long GetVolumeGroupsTag();
static long Get0DElementsGroupsTag();
+ static long GetBallElementsGroupsTag();
// publishing methods
SALOMEDS::SComponent_ptr PublishComponent(SALOMEDS::Study_ptr theStudy);
#include "Utils_ExceptHandlers.hxx"
#include <TCollection_AsciiString.hxx>
+#include <TopoDS_Solid.hxx>
#ifdef _DEBUG_
static int MYDEBUG = 0;
return SMESH::Tag_0DElementsGroups;
}
+long SMESH_Gen_i::GetBallElementsGroupsTag()
+{
+ return SMESH::Tag_BallElementsGroups;
+}
+
//=============================================================================
/*!
* SMESH_Gen_i::CanPublishInStudy
int aType = (int)theGroup->GetType();
const char* aRootNames[] = {
"Compound Groups", "Groups of Nodes", "Groups of Edges",
- "Groups of Faces", "Groups of Volumes", "Groups of 0D Elements" };
+ "Groups of Faces", "Groups of Volumes", "Groups of 0D Elements",
+ "Groups of Balls" };
// Currently, groups with heterogenous content are not supported
- if ( aType != SMESH::ALL ) {
+ if ( aType != SMESH::ALL )
+ {
long aRootTag = GetNodeGroupsTag() + aType - 1;
// Find or create groups root
SALOMEDS::SObject_var aRootSO = publish (theStudy, CORBA::Object::_nil(),
aMeshSO, aRootTag, 0, false );
- if ( aType < 6 )
+ if ( aType < sizeof(aRootNames)/sizeof(char*) )
SetName( aRootSO, aRootNames[aType] );
// Add new group to corresponding sub-tree
case SMDSAbs_Face: aType = SMESH::FACE; break;
case SMDSAbs_Volume: aType = SMESH::VOLUME; break;
case SMDSAbs_0DElement: aType = SMESH::ELEM0D; break;
+ case SMDSAbs_Ball: aType = SMESH::BALL; break;
default: aType = SMESH::ALL; break;
}
return aType;
SMESH::long_array_var aRes = new SMESH::long_array();
SMESHDS_GroupBase* aGroupDS = GetGroupDS();
- if (aGroupDS) {
+ if (aGroupDS)
+ {
int aSize = aGroupDS->Extent();
aRes->length(aSize);
for (int i = 0; i < aSize; i++)
aRes[i] = aGroupDS->GetID(i+1);
- return aRes._retn();
+
+ if ( 0 < aSize && aSize < 100 ) // for comfortable testing ;)
+ std::sort( &aRes[0], &aRes[0]+aSize );
}
MESSAGE("get list of IDs of a vague group");
return aRes._retn();
public:
SMESH_MeshPartDS(SMESH::SMESH_IDSource_ptr meshPart);
- virtual SMDS_NodeIteratorPtr nodesIterator (bool idInceasingOrder=false) const;
- virtual SMDS_0DElementIteratorPtr elements0dIterator(bool idInceasingOrder=false) const;
- virtual SMDS_EdgeIteratorPtr edgesIterator (bool idInceasingOrder=false) const;
- virtual SMDS_FaceIteratorPtr facesIterator (bool idInceasingOrder=false) const;
- virtual SMDS_VolumeIteratorPtr volumesIterator (bool idInceasingOrder=false) const;
+ virtual SMDS_NodeIteratorPtr nodesIterator (bool idInceasingOrder=false) const;
+ virtual SMDS_EdgeIteratorPtr edgesIterator (bool idInceasingOrder=false) const;
+ virtual SMDS_FaceIteratorPtr facesIterator (bool idInceasingOrder=false) const;
+ virtual SMDS_VolumeIteratorPtr volumesIterator (bool idInceasingOrder=false) const;
virtual SMDS_ElemIteratorPtr elementsIterator(SMDSAbs_ElementType type=SMDSAbs_All) const;
+ virtual SMDS_ElemIteratorPtr elementGeomIterator(SMDSAbs_GeometryType type) const;
+ virtual SMDS_ElemIteratorPtr elementEntityIterator(SMDSAbs_EntityType type) const;
private:
TIDSortedElemSet _elements[ SMDSAbs_NbElementTypes ];
if ( _preMeshInfo )
return _preMeshInfo->NbElements();
- return Nb0DElements() + NbEdges() + NbFaces() + NbVolumes();
+ return Nb0DElements() + NbEdges() + NbFaces() + NbVolumes() + NbBalls();
}
CORBA::Long SMESH_Mesh_i::Nb0DElements()throw (SALOME::SALOME_Exception)
return _impl->Nb0DElements();
}
+CORBA::Long SMESH_Mesh_i::NbBalls() throw (SALOME::SALOME_Exception)
+{
+ Unexpect aCatch(SALOME_SalomeException);
+ if ( _preMeshInfo )
+ return _preMeshInfo->NbBalls();
+
+ return _impl->NbBalls();
+}
+
CORBA::Long SMESH_Mesh_i::NbEdges()throw(SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
return elem->IsQuadratic();
}
+//=============================================================================
+/*!
+ * Returns diameter of ball discrete element or zero in case of an invalid \a id
+ */
+//=============================================================================
+
+CORBA::Double SMESH_Mesh_i::GetBallDiameter(CORBA::Long id)
+{
+ if ( _preMeshInfo )
+ _preMeshInfo->FullLoadFromFile();
+
+ if ( const SMDS_BallElement* ball =
+ dynamic_cast<const SMDS_BallElement*>( _impl->GetMeshDS()->FindElement( id )))
+ return ball->GetDiameter();
+
+ return 0;
+}
//=============================================================================
/*!
SMESH::array_of_ElementType_var types = new SMESH::array_of_ElementType;
- types->length( 4 );
+ types->length( 5 );
int nbTypes = 0;
- if (_impl->NbEdges())
- types[nbTypes++] = SMESH::EDGE;
- if (_impl->NbFaces())
- types[nbTypes++] = SMESH::FACE;
- if (_impl->NbVolumes())
- types[nbTypes++] = SMESH::VOLUME;
- if (_impl->Nb0DElements())
- types[nbTypes++] = SMESH::ELEM0D;
+ if (_impl->NbEdges()) types[nbTypes++] = SMESH::EDGE;
+ if (_impl->NbFaces()) types[nbTypes++] = SMESH::FACE;
+ if (_impl->NbVolumes()) types[nbTypes++] = SMESH::VOLUME;
+ if (_impl->Nb0DElements()) types[nbTypes++] = SMESH::ELEM0D;
+ if (_impl->NbBalls()) types[nbTypes++] = SMESH::BALL;
types->length( nbTypes );
return types._retn();
}
}
// -------------------------------------------------------------------------------------
+SMDS_ElemIteratorPtr SMESH_MeshPartDS::elementGeomIterator(SMDSAbs_GeometryType geomType) const
+{
+ if ( _meshDS ) return _meshDS->elementGeomIterator( geomType );
+
+ typedef SMDS_SetIterator
+ <const SMDS_MeshElement*,
+ TIDSortedElemSet::const_iterator,
+ SMDS::SimpleAccessor<const SMDS_MeshElement*, TIDSortedElemSet::const_iterator>,
+ SMDS_MeshElement::GeomFilter
+ > TIter;
+
+ SMDSAbs_ElementType type = SMDS_MeshCell::toSmdsType( geomType );
+
+ return SMDS_ElemIteratorPtr( new TIter( _elements[type].begin(),
+ _elements[type].end(),
+ SMDS_MeshElement::GeomFilter( geomType )));
+}
+// -------------------------------------------------------------------------------------
+SMDS_ElemIteratorPtr SMESH_MeshPartDS::elementEntityIterator(SMDSAbs_EntityType entity) const
+{
+ if ( _meshDS ) return _meshDS->elementEntityIterator( entity );
+
+ typedef SMDS_SetIterator
+ <const SMDS_MeshElement*,
+ TIDSortedElemSet::const_iterator,
+ SMDS::SimpleAccessor<const SMDS_MeshElement*, TIDSortedElemSet::const_iterator>,
+ SMDS_MeshElement::EntityFilter
+ > TIter;
+
+ SMDSAbs_ElementType type = SMDS_MeshCell::toSmdsType( entity );
+
+ return SMDS_ElemIteratorPtr( new TIter( _elements[type].begin(),
+ _elements[type].end(),
+ SMDS_MeshElement::EntityFilter( entity )));
+}
+// -------------------------------------------------------------------------------------
SMDS_ElemIteratorPtr SMESH_MeshPartDS::elementsIterator(SMDSAbs_ElementType type) const
{
typedef SMDS_SetIterator<const SMDS_MeshElement*, TIDSortedElemSet::const_iterator > TIter;
}
// -------------------------------------------------------------------------------------
_GET_ITER_DEFINE( SMDS_NodeIteratorPtr, nodesIterator, SMDS_MeshNode, SMDSAbs_Node )
-_GET_ITER_DEFINE( SMDS_0DElementIteratorPtr, elements0dIterator, SMDS_Mesh0DElement, SMDSAbs_0DElement)
_GET_ITER_DEFINE( SMDS_EdgeIteratorPtr, edgesIterator, SMDS_MeshEdge, SMDSAbs_Edge )
_GET_ITER_DEFINE( SMDS_FaceIteratorPtr, facesIterator, SMDS_MeshFace, SMDSAbs_Face )
_GET_ITER_DEFINE( SMDS_VolumeIteratorPtr, volumesIterator, SMDS_MeshVolume, SMDSAbs_Volume)
CORBA::Long Nb0DElements()
throw (SALOME::SALOME_Exception);
+ CORBA::Long NbBalls()
+ throw (SALOME::SALOME_Exception);
+
CORBA::Long NbEdges()
throw (SALOME::SALOME_Exception);
*/
CORBA::Boolean IsQuadratic(CORBA::Long id);
+ /*!
+ * Returns diameter of ball discrete element or zero in case of an invalid \a id
+ */
+ CORBA::Double GetBallDiameter(CORBA::Long id);
+
/*!
* Returns bary center for given element
*/
return ids;
}
+ //================================================================================
+ /*!
+ * \brief Return EEntiteMaillage by EGeometrieElement
+ */
+ //================================================================================
+
+ MED::EEntiteMaillage entityByGeom(const MED::EGeometrieElement geom )
+ {
+ return geom == MED::eBALL ? MED::eSTRUCT_ELEMENT : MED::eMAILLE;
+ }
+
//================================================================================
/*!
* \brief Return a map< EGeometrieElement, SMDSAbs_EntityType >
med2smeshTypes[ MED::ePOLYGONE ] = SMDSEntity_Polygon ;
med2smeshTypes[ MED::ePOLYEDRE ] = SMDSEntity_Polyhedra ;
med2smeshTypes[ MED::eNONE ] = SMDSEntity_Node ;
+ med2smeshTypes[ MED::eBALL ] = SMDSEntity_Ball ;
}
return med2smeshTypes;
}
const bool infoAvailable = aFile->ExistInternalObject( hdfGroupName );
if ( infoAvailable )
{
-
HDFgroup* infoHdfGroup = new HDFgroup( hdfGroupName, aFile );
infoHdfGroup->OpenOnDisk();
Tmed2smeshElemTypeMap::const_iterator me2smeEnd = med2smeshElemTypeMap().end();
for ( ; me2sme != me2smeEnd; ++me2sme )
{
- int nbElems = aMed->GetNbCells( medMeshInfo, MED::eMAILLE, me2sme->first );
+ int nbElems = aMed->GetNbCells( medMeshInfo, entityByGeom(me2sme->first), me2sme->first );
if ( nbElems > 0 )
setNb( me2sme->second, nbElems );
}
{
famNums.resize( NbEntities( me2sme->second ));
if ( famNums.empty() ) continue;
- aMed->GetFamilies( medElemInfo, famNums.size(), MED::eMAILLE, me2sme->first );
+ aMed->GetFamilies( medElemInfo, famNums.size(), entityByGeom(me2sme->first), me2sme->first );
// distribute elements of a type among groups
map< int, vector< SMESH_PreMeshInfo* > >::iterator f2infos = famId2grInfo.begin();
for ( size_t i = 0; i < famNums.size(); ++i )
types->length( 4 );
int nbTypes = 0;
- if (NbEdges())
- types[nbTypes++] = SMESH::EDGE;
- if (NbFaces())
- types[nbTypes++] = SMESH::FACE;
- if (NbVolumes())
- types[nbTypes++] = SMESH::VOLUME;
- if (Nb0DElements())
- types[nbTypes++] = SMESH::ELEM0D;
+ if (NbEdges()) types[nbTypes++] = SMESH::EDGE;
+ if (NbFaces()) types[nbTypes++] = SMESH::FACE;
+ if (NbVolumes()) types[nbTypes++] = SMESH::VOLUME;
+ if (Nb0DElements()) types[nbTypes++] = SMESH::ELEM0D;
+ if (NbBalls()) types[nbTypes++] = SMESH::BALL;
types->length( nbTypes );
return types._retn();
if CritType in [FT_BelongToGeom, FT_BelongToPlane, FT_BelongToGenSurface,
FT_BelongToCylinder, FT_LyingOnGeom]:
- # Checks the Threshold
+ # Checks that Threshold is GEOM object
if isinstance(aThreshold, geompyDC.GEOM._objref_GEOM_Object):
aCriterion.ThresholdStr = GetName(aThreshold)
- aCriterion.ThresholdID = salome.ObjectToID(aThreshold)
+ aCriterion.ThresholdID = aThreshold.GetStudyEntry()
+ if not aCriterion.ThresholdID:
+ raise RuntimeError, "Threshold shape must be published"
else:
print "Error: The Threshold should be a shape."
return None
UnaryOp = FT_Undefined
pass
elif CritType == FT_RangeOfIds:
- # Checks the Threshold
+ # Checks that Threshold is string
if isinstance(aThreshold, str):
aCriterion.ThresholdStr = aThreshold
else:
elif CritType == FT_CoplanarFaces:
# Checks the Threshold
if isinstance(aThreshold, int):
- aCriterion.ThresholdID = "%s"%aThreshold
+ aCriterion.ThresholdID = str(aThreshold)
elif isinstance(aThreshold, str):
ID = int(aThreshold)
if ID < 1:
pass
pass
- ## Deprecated, used only for compatibility! Please, use ExportToMEDX() method instead.
- # Exports the mesh in a file in MED format and chooses the \a version of MED format
- ## allowing to overwrite the file if it exists or add the exported data to its contents
- # @param f the file name
- # @param version values are SMESH.MED_V2_1, SMESH.MED_V2_2
- # @param opt boolean parameter for creating/not creating
- # the groups Group_On_All_Nodes, Group_On_All_Faces, ...
- # @param overwrite boolean parameter for overwriting/not overwriting the file
- # @ingroup l2_impexp
- def ExportToMED(self, f, version, opt=0, overwrite=1):
- self.mesh.ExportToMEDX(f, opt, version, overwrite)
-
- ## Exports the mesh in a file in MED format and chooses the \a version of MED format
+ ## Exports the mesh in a file in MED format and chooses the \a version of MED format
## allowing to overwrite the file if it exists or add the exported data to its contents
# @param f is the file name
# @param auto_groups boolean parameter for creating/not creating
meshPart = self.mesh
self.mesh.ExportCGNS(meshPart, f, overwrite)
+ ## Deprecated, used only for compatibility! Please, use ExportToMEDX() method instead.
+ # Exports the mesh in a file in MED format and chooses the \a version of MED format
+ ## allowing to overwrite the file if it exists or add the exported data to its contents
+ # @param f the file name
+ # @param version values are SMESH.MED_V2_1, SMESH.MED_V2_2
+ # @param opt boolean parameter for creating/not creating
+ # the groups Group_On_All_Nodes, Group_On_All_Faces, ...
+ # @param overwrite boolean parameter for overwriting/not overwriting the file
+ # @ingroup l2_impexp
+ def ExportToMED(self, f, version, opt=0, overwrite=1):
+ self.mesh.ExportToMEDX(f, opt, version, overwrite)
+
# Operations with groups:
# ----------------------
group.AddFrom( theFilter )
return group
- ## Passes mesh elements through the given filter and return IDs of fitting elements
- # @param theFilter SMESH_Filter
- # @return a list of ids
- # @ingroup l1_controls
- def GetIdsFromFilter(self, theFilter):
- theFilter.SetMesh( self.mesh )
- return theFilter.GetIDs()
-
- ## Verifies whether a 2D mesh element has free edges (edges connected to one face only)\n
- # Returns a list of special structures (borders).
- # @return a list of SMESH.FreeEdges.Border structure: edge id and ids of two its nodes.
- # @ingroup l1_controls
- def GetFreeBorders(self):
- aFilterMgr = self.smeshpyD.CreateFilterManager()
- aPredicate = aFilterMgr.CreateFreeEdges()
- aPredicate.SetMesh(self.mesh)
- aBorders = aPredicate.GetBorders()
- aFilterMgr.UnRegister()
- return aBorders
-
## Removes a group
# @ingroup l2_grps_delete
def RemoveGroup(self, group):
def Nb0DElements(self):
return self.mesh.Nb0DElements()
+ ## Returns the number of ball discrete elements in the mesh
+ # @return an integer value
+ # @ingroup l1_meshinfo
+ def NbBalls(self):
+ return self.mesh.NbBalls()
+
## Returns the number of edges in the mesh
# @return an integer value
# @ingroup l1_meshinfo
def IsQuadratic(self, id):
return self.mesh.IsQuadratic(id)
+ ## Returns diameter of a ball discrete element or zero in case of an invalid \a id
+ # @ingroup l1_meshinfo
+ def GetBallDiameter(self, id):
+ return self.mesh.GetBallDiameter(id)
+
## Returns XYZ coordinates of the barycenter of the given element
# \n If there is no element for the given ID - returns an empty list
# @return a list of three double values
def BaryCenter(self, id):
return self.mesh.BaryCenter(id)
+ ## Passes mesh elements through the given filter and return IDs of fitting elements
+ # @param theFilter SMESH_Filter
+ # @return a list of ids
+ # @ingroup l1_controls
+ def GetIdsFromFilter(self, theFilter):
+ theFilter.SetMesh( self.mesh )
+ return theFilter.GetIDs()
+
+ ## Verifies whether a 2D mesh element has free edges (edges connected to one face only)\n
+ # Returns a list of special structures (borders).
+ # @return a list of SMESH.FreeEdges.Border structure: edge id and ids of two its nodes.
+ # @ingroup l1_controls
+ def GetFreeBorders(self):
+ aFilterMgr = self.smeshpyD.CreateFilterManager()
+ aPredicate = aFilterMgr.CreateFreeEdges()
+ aPredicate.SetMesh(self.mesh)
+ aBorders = aPredicate.GetBorders()
+ aFilterMgr.UnRegister()
+ return aBorders
+
# Get mesh measurements information:
# ------------------------------------
def Add0DElement(self, IDOfNode):
return self.editor.Add0DElement(IDOfNode)
+ ## Creates a ball element on a node with given ID.
+ # @param IDOfNode the ID of node for creation of the element.
+ # @param diameter the bal diameter.
+ # @return the Id of the new ball element
+ # @ingroup l2_modif_add
+ def AddBall(self, IDOfNode, diameter):
+ return self.editor.AddBall( IDOfNode, diameter )
+
## Creates a linear or quadratic edge (this is determined
# by the number of given nodes).
# @param IDsOfNodes the list of node IDs for creation of the element.
# @param y the Y coordinate of a point
# @param z the Z coordinate of a point
# @param elementType type of elements to find (SMESH.ALL type
- # means elements of any type excluding nodes and 0D elements)
+ # means elements of any type excluding nodes, discrete and 0D elements)
# @param meshPart a part of mesh (group, sub-mesh) to search within
# @return list of IDs of found elements
# @ingroup l2_modif_throughp
virtual SMDSAbs_ElementType GetType() const { return SMDSAbs_Face; }
virtual vtkIdType GetVtkType() const { return -1; }
virtual SMDSAbs_EntityType GetEntityType() const { return SMDSEntity_Last; }
- virtual SMDS_ElemIteratorPtr elementsIterator(SMDSAbs_ElementType type) const
+ virtual SMDSAbs_GeometryType GetGeomType() const { return SMDSGeom_TRIANGLE; }
+virtual SMDS_ElemIteratorPtr elementsIterator(SMDSAbs_ElementType type) const
{ return SMDS_ElemIteratorPtr( new SMDS_NodeVectorElemIterator( _nn.begin(), _nn.end()));}
};
//--------------------------------------------------------------------------------