-// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#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: