//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// GEOM GEOMGUI : GUI for Geometry component
-// File : BasicGUI_PointDlg.cxx
-// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
-//
+// GEOM GEOMGUI : GUI for Geometry component
+// File : BasicGUI_PointDlg.cxx
+// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
+
#include "BasicGUI_PointDlg.h"
#include <SUIT_ResourceMgr.h>
//=================================================================================
// class : BasicGUI_PointDlg()
-// purpose : Constructs a BasicGUI_PointDlg which is a child of 'parent', with the
+// purpose : Constructs a BasicGUI_PointDlg which is a child of 'parent', with the
// name 'name' and widget flags set to 'f'.
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
myZ->setEnabled( false );
QPalette aPal = myX->palette();
- aPal.setColor( QPalette::Disabled, QPalette::Text, QColor( 0, 0, 0 ) ) ;
+ aPal.setColor( QPalette::Disabled, QPalette::Text, QColor( 0, 0, 0 ) );
myX->setPalette( aPal );
myY->setPalette( aPal );
myZ->setPalette( aPal );
setHelpFileName( "create_point_page.html" );
-
+
Init();
}
/* Get setting of step value from file configuration */
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100 );
-
+
/* min, max, step and decimals for spin boxes */
initSpinBox( GroupXYZ->SpinBox_DX, COORD_MIN, COORD_MAX, step, 6 ); // VSR: TODO: DBL_DIGITS_DISPLAY
initSpinBox( GroupXYZ->SpinBox_DY, COORD_MIN, COORD_MAX, step, 6 ); // VSR: TODO: DBL_DIGITS_DISPLAY
connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
-
connect( myParamCoord->button( PARAM_VALUE ), SIGNAL( clicked() ), this, SLOT( ClickParamCoord() ) );
connect( myParamCoord->button( COORD_VALUE ), SIGNAL( clicked() ), this, SLOT( ClickParamCoord() ) );
connect( GroupOnCurve->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged() ),
this, SLOT(SelectionIntoArgument() ) );
-
initName( tr( "GEOM_VERTEX" ) );
-
+
ConstructorsClicked( 0 );
}
// purpose : Radio button management
//=================================================================================
void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
-{
+{
globalSelection(); // close local contexts, if any
switch ( constructorId ) {
case GEOM_POINT_XYZ:
{
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
-
+
GroupRefPoint->hide();
GroupOnCurve->hide();
GroupLineIntersection->hide();
myEditCurrentArgument = GroupRefPoint->LineEdit1;
myEditCurrentArgument->setText( "" );
myRefPoint = GEOM::GEOM_Object::_nil();
- GroupRefPoint->PushButton1->setDown(true);
+ GroupRefPoint->PushButton1->setDown(true);
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
-
+
myParamCoord->button( PARAM_VALUE )->hide();
myParamCoord->button( COORD_VALUE )->hide();
GroupXYZ->hide();
GroupOnCurve->hide();
GroupLineIntersection->hide();
GroupOnSurface->hide();
-
+
GroupRefPoint->show();
-
+
myCoordGrp->show();
break;
}
{
if ( !onAccept() )
return false;
-
+
initName();
ConstructorsClicked( getConstructorId() );
return true;
//Find SubShape Object in Father
GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
-
+
if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
GEOM::GEOM_IShapesOperations_var aShapesOp =
getGeomEngine()->GetIShapesOperations(getStudyId());
}
}
}
-
+
displayPreview();
}
void BasicGUI_PointDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
- if ( send == GroupRefPoint->LineEdit1 ||
+ if ( send == GroupRefPoint->LineEdit1 ||
send == GroupOnCurve->LineEdit1 ||
- send == GroupLineIntersection->LineEdit1 ||
+ send == GroupLineIntersection->LineEdit1 ||
send == GroupLineIntersection->LineEdit2 ) {
myEditCurrentArgument = send;
GEOMBase_Skeleton::LineEditReturnPressed();
if ( send == GroupRefPoint->PushButton1 ) {
GroupRefPoint->LineEdit1->setFocus();
myEditCurrentArgument = GroupRefPoint->LineEdit1;
-
+
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
}
else if ( send == GroupOnCurve->PushButton1 ) {
GroupOnCurve->LineEdit1->setFocus();
myEditCurrentArgument = GroupOnCurve->LineEdit1;
-
+
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
}
else if ( send == GroupOnSurface->PushButton1 )
ok = GroupXYZ->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok;
}
return !myFace->_is_nil() && ok;
-
}
return false;
}
aParameters << GroupXYZ->SpinBox_DX->text();
aParameters << GroupXYZ->SpinBox_DY->text();
aParameters << GroupXYZ->SpinBox_DZ->text();
-
+
anObj = anOper->MakePointXYZ( x, y, z );
res = true;
break;
aParameters << GroupRefPoint->SpinBox_DX->text();
aParameters << GroupRefPoint->SpinBox_DY->text();
aParameters << GroupRefPoint->SpinBox_DZ->text();
-
+
anObj = anOper->MakePointWithReference( myRefPoint, dx, dy, dz );
res = true;
break;
double x = GroupXYZ->SpinBox_DX->value();
double y = GroupXYZ->SpinBox_DY->value();
double z = GroupXYZ->SpinBox_DZ->value();
-
+
aParameters << GroupXYZ->SpinBox_DX->text();
aParameters << GroupXYZ->SpinBox_DY->text();
aParameters << GroupXYZ->SpinBox_DZ->text();
-
+
anObj = anOper->MakePointOnCurveByCoord( myEdge, x, y, z );
}
res = true;
break;
}
case GEOM_POINT_INTINT :
- anOper->MakePointOnLinesIntersection( myLine1, myLine2 );
+ anObj = anOper->MakePointOnLinesIntersection( myLine1, myLine2 );
res = true;
break;
case GEOM_POINT_SURF :
double x = GroupXYZ->SpinBox_DX->value();
double y = GroupXYZ->SpinBox_DY->value();
double z = GroupXYZ->SpinBox_DZ->value();
-
+
aParameters << GroupXYZ->SpinBox_DX->text();
aParameters << GroupXYZ->SpinBox_DY->text();
aParameters << GroupXYZ->SpinBox_DZ->text();
-
+
anObj = anOper->MakePointOnSurfaceByCoord( myFace, x, y, z );
}
res = true;
break;
}
}
-
+
const int id = getConstructorId();
- if(!anObj->_is_nil() && !IsPreview() && (id == GEOM_POINT_XYZ ||
+ if(!anObj->_is_nil() && !IsPreview() && (id == GEOM_POINT_XYZ ||
id == GEOM_POINT_REF ||
id == GEOM_POINT_EDGE ||
id == GEOM_POINT_SURF) ) {
anObj->SetParameters(aParameters.join(":").toLatin1().constData());
}
-
if ( id == GEOM_POINT_REF || id == GEOM_POINT_EDGE || id == GEOM_POINT_SURF ) {
TopoDS_Shape aShape;
myZ->setText( "" );
}
}
-
+
if ( !anObj->_is_nil() ) {
objects.push_back( anObj._retn() );
}
-
+
return res;
}
{
bool isParam = myParamCoord->checkedId() == PARAM_VALUE;
GroupXYZ->setShown( !isParam );
-
+
const int id = getConstructorId();
if ( id == GEOM_POINT_EDGE ) {
GroupOnCurve->TextLabel2->setShown( isParam );