Style fixes : remove trailing spaces.

This commit is contained in:
Pascal Obry 2020-03-27 15:46:51 +01:00
parent 496aa6dc0f
commit 5dfdaa8e0b
6 changed files with 382 additions and 382 deletions

View File

@ -193,7 +193,7 @@ void AIS_Text::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentation
}; };
bool isSame (double d1, double d2) bool isSame (double d1, double d2)
{ {
return Abs(d1 - d2) <= Precision::Confusion(); return Abs(d1 - d2) <= Precision::Confusion();
} }
@ -236,12 +236,12 @@ EntityGUI_3DSketcherDlg::EntityGUI_3DSketcherDlg (GeometryGUI* theGeometryGUI, Q
GroupType->RadioButton2->setText(tr("GEOM_SKETCHER_REL")); GroupType->RadioButton2->setText(tr("GEOM_SKETCHER_REL"));
GroupType->RadioButton3->setText(tr("(X,Y,Z)")); GroupType->RadioButton3->setText(tr("(X,Y,Z)"));
GroupType->RadioButton4->setText(tr("GEOM_ANGLES")); GroupType->RadioButton4->setText(tr("GEOM_ANGLES"));
myTypeGroup1 = new QButtonGroup(this); myTypeGroup1 = new QButtonGroup(this);
myTypeGroup1->setExclusive(true); myTypeGroup1->setExclusive(true);
myTypeGroup1->addButton(GroupType->RadioButton1, 0); myTypeGroup1->addButton(GroupType->RadioButton1, 0);
myTypeGroup1->addButton(GroupType->RadioButton2, 1); myTypeGroup1->addButton(GroupType->RadioButton2, 1);
myTypeGroup2 = new QButtonGroup(this); myTypeGroup2 = new QButtonGroup(this);
myTypeGroup2->setExclusive(true); myTypeGroup2->setExclusive(true);
myTypeGroup2->addButton(GroupType->RadioButton3, 0); myTypeGroup2->addButton(GroupType->RadioButton3, 0);
@ -261,13 +261,13 @@ EntityGUI_3DSketcherDlg::EntityGUI_3DSketcherDlg (GeometryGUI* theGeometryGUI, Q
GroupAngles->buttonUndo->setIcon(image1); GroupAngles->buttonUndo->setIcon(image1);
GroupAngles->buttonRedo->setIcon(image2); GroupAngles->buttonRedo->setIcon(image2);
GroupAngles->TextLabel1->setText(tr("GEOM_LENGTH")); GroupAngles->TextLabel1->setText(tr("GEOM_LENGTH"));
GroupAngles->TextLabel2->setText(tr("GEOM_ANGLE")); GroupAngles->TextLabel2->setText(tr("GEOM_ANGLE"));
GroupAngles->checkBox ->setText(tr("GEOM_ANGLE_2")); GroupAngles->checkBox ->setText(tr("GEOM_ANGLE_2"));
GroupAngles->checkBox_2->setText(tr("GEOM_HEIGHT")); GroupAngles->checkBox_2->setText(tr("GEOM_HEIGHT"));
GroupControls = new EntityGUI_Controls(centralWidget()); GroupControls = new EntityGUI_Controls(centralWidget());
GroupControls->GroupBox1->setTitle(tr("GEOM_CONTROLS")); GroupControls->GroupBox1->setTitle(tr("GEOM_CONTROLS"));
GroupControls->CheckBox1->setText(tr("GEOM_SHOW_LENGTH")); GroupControls->CheckBox1->setText(tr("GEOM_SHOW_LENGTH"));
GroupControls->CheckBox2->setText(tr("GEOM_SHOW_ANGLE")); GroupControls->CheckBox2->setText(tr("GEOM_SHOW_ANGLE"));
GroupControls->CheckBox3->setText(tr("GEOM_SHOW_POINTS_COORD")); GroupControls->CheckBox3->setText(tr("GEOM_SHOW_POINTS_COORD"));
GroupControls->lineEdit_1->setReadOnly(true); GroupControls->lineEdit_1->setReadOnly(true);
@ -358,7 +358,7 @@ void EntityGUI_3DSketcherDlg::Init()
GroupControls->CheckBox1->setChecked(true); GroupControls->CheckBox1->setChecked(true);
GroupControls->CheckBox2->setChecked(true); GroupControls->CheckBox2->setChecked(true);
GroupControls->CheckBox3->setChecked(true); GroupControls->CheckBox3->setChecked(true);
isLengthVisible = true; isLengthVisible = true;
isAngleVisible = true; isAngleVisible = true;
@ -406,14 +406,14 @@ void EntityGUI_3DSketcherDlg::Init()
connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
initName(tr("GEOM_3DSKETCHER")); initName(tr("GEOM_3DSKETCHER"));
GroupControls->CheckBox3->click(); GroupControls->CheckBox3->click();
UpdateButtonsState(); UpdateButtonsState();
myMode = 0; myMode = 0;
myCoordType = 0; myCoordType = 0;
GEOMBase_Helper::displayPreview(true, false, true, true, myLineWidth); GEOMBase_Helper::displayPreview(true, false, true, true, myLineWidth);
} }
@ -424,21 +424,21 @@ void EntityGUI_3DSketcherDlg::Init()
void EntityGUI_3DSketcherDlg::TypeClicked (int id) void EntityGUI_3DSketcherDlg::TypeClicked (int id)
{ {
QButtonGroup* send = (QButtonGroup*) sender(); QButtonGroup* send = (QButtonGroup*) sender();
int coordType = myCoordType; int coordType = myCoordType;
int mode = myMode; int mode = myMode;
if (send == myTypeGroup1) if (send == myTypeGroup1)
{ {
if(id == myMode) return; if(id == myMode) return;
mode = id; mode = id;
} }
else if (send == myTypeGroup2) else if (send == myTypeGroup2)
{ {
if (id == myCoordType) return; if (id == myCoordType) return;
coordType = id; coordType = id;
} }
GroupAngles->hide(); GroupAngles->hide();
Group3Spin->show(); Group3Spin->show();
@ -506,15 +506,15 @@ void EntityGUI_3DSketcherDlg::TypeClicked (int id)
// purpose : called when the point coordinates is Applyed // purpose : called when the point coordinates is Applyed
//================================================================================= //=================================================================================
void EntityGUI_3DSketcherDlg::ClickOnAddPoint() void EntityGUI_3DSketcherDlg::ClickOnAddPoint()
{ {
QString msg; QString msg;
if (!isValid(msg)) { if (!isValid(msg)) {
showError(msg); showError(msg);
return; return;
} }
myPrsType = prsType(); myPrsType = prsType();
// if(myMode == 1) // if(myMode == 1)
displayDimensions( /*store = */true); displayDimensions( /*store = */true);
@ -536,9 +536,9 @@ void EntityGUI_3DSketcherDlg::ClickOnAddPoint()
GroupAngles->SpinBox_DL->setValue(0.0); GroupAngles->SpinBox_DL->setValue(0.0);
GroupAngles->SpinBox_DA2->setValue(0.0); GroupAngles->SpinBox_DA2->setValue(0.0);
} }
UpdatePointCoordinates(); UpdatePointCoordinates();
UpdateButtonsState(); UpdateButtonsState();
GEOMBase_Helper::displayPreview(true, false, true, true, myLineWidth); GEOMBase_Helper::displayPreview(true, false, true, true, myLineWidth);
} }
@ -549,7 +549,7 @@ void EntityGUI_3DSketcherDlg::ClickOnAddPoint()
//================================================================================= //=================================================================================
void EntityGUI_3DSketcherDlg::UpdateButtonsState() void EntityGUI_3DSketcherDlg::UpdateButtonsState()
{ {
if (myPointsList.count() == 0) if (myPointsList.count() == 0)
{ {
GroupType->RadioButton1->click(); GroupType->RadioButton1->click();
GroupType->RadioButton3->click(); GroupType->RadioButton3->click();
@ -571,13 +571,13 @@ void EntityGUI_3DSketcherDlg::UpdatePointCoordinates()
{ {
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
int aPrecision = resMgr->integerValue("Geometry", "length_precision", 6); int aPrecision = resMgr->integerValue("Geometry", "length_precision", 6);
if (myPointsList.count() == 0) if (myPointsList.count() == 0)
{ {
GroupControls->lineEdit_1->setText(""); GroupControls->lineEdit_1->setText("");
GroupControls->lineEdit_2->setText(""); GroupControls->lineEdit_2->setText("");
GroupControls->lineEdit_3->setText(""); GroupControls->lineEdit_3->setText("");
GroupControls->lineEdit_4->setText(""); GroupControls->lineEdit_4->setText("");
GroupControls->lineEdit_5->setText(""); GroupControls->lineEdit_5->setText("");
GroupControls->lineEdit_6->setText(""); GroupControls->lineEdit_6->setText("");
@ -587,7 +587,7 @@ void EntityGUI_3DSketcherDlg::UpdatePointCoordinates()
GroupControls->lineEdit_1->setText(DlgRef::PrintDoubleValue(getLastPoint().x, aPrecision)); GroupControls->lineEdit_1->setText(DlgRef::PrintDoubleValue(getLastPoint().x, aPrecision));
GroupControls->lineEdit_2->setText(DlgRef::PrintDoubleValue(getLastPoint().y, aPrecision)); GroupControls->lineEdit_2->setText(DlgRef::PrintDoubleValue(getLastPoint().y, aPrecision));
GroupControls->lineEdit_3->setText(DlgRef::PrintDoubleValue(getLastPoint().z, aPrecision)); GroupControls->lineEdit_3->setText(DlgRef::PrintDoubleValue(getLastPoint().z, aPrecision));
GroupControls->lineEdit_4->setText(""); GroupControls->lineEdit_4->setText("");
GroupControls->lineEdit_5->setText(""); GroupControls->lineEdit_5->setText("");
GroupControls->lineEdit_6->setText(""); GroupControls->lineEdit_6->setText("");
@ -598,7 +598,7 @@ void EntityGUI_3DSketcherDlg::UpdatePointCoordinates()
GroupControls->lineEdit_5->setText(DlgRef::PrintDoubleValue(getLastPoint().y, aPrecision)); GroupControls->lineEdit_5->setText(DlgRef::PrintDoubleValue(getLastPoint().y, aPrecision));
GroupControls->lineEdit_6->setText(DlgRef::PrintDoubleValue(getLastPoint().z, aPrecision)); GroupControls->lineEdit_6->setText(DlgRef::PrintDoubleValue(getLastPoint().z, aPrecision));
} }
} }
//================================================================================= //=================================================================================
@ -609,7 +609,7 @@ void EntityGUI_3DSketcherDlg::ClickOnUndo()
{ {
myIsUndoRedo = true; myIsUndoRedo = true;
if (myPointsList.count() > 0) { if (myPointsList.count() > 0) {
myRedoList.append(myPointsList.last()); myRedoList.append(myPointsList.last());
// Erase dimensions presentations // Erase dimensions presentations
@ -617,7 +617,7 @@ void EntityGUI_3DSketcherDlg::ClickOnUndo()
((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Erase(myLengthPrs, true); ((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Erase(myLengthPrs, true);
((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Erase(myAnglePrs, true); ((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Erase(myAnglePrs, true);
((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Erase(myTextPrs, true); ((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Erase(myTextPrs, true);
removeLastIOFromPrs(); removeLastIOFromPrs();
// Display modified presentation // Display modified presentation
@ -626,13 +626,13 @@ void EntityGUI_3DSketcherDlg::ClickOnUndo()
if (isAngleVisible) if (isAngleVisible)
((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Display(myAnglePrs); ((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Display(myAnglePrs);
((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Display(myTextPrs); ((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Display(myTextPrs);
// Remove last point from list // Remove last point from list
myWorkPoint = myPointsList.last(); myWorkPoint = myPointsList.last();
myPointsList.removeLast(); myPointsList.removeLast();
GEOMBase_Helper::displayPreview(true, false, true, true, myLineWidth); GEOMBase_Helper::displayPreview(true, false, true, true, myLineWidth);
UpdateButtonsState(); UpdateButtonsState();
// Update of point coordinates in the control groupbox // Update of point coordinates in the control groupbox
UpdatePointCoordinates(); UpdatePointCoordinates();
@ -649,7 +649,7 @@ void EntityGUI_3DSketcherDlg::ClickOnRedo()
{ {
myIsUndoRedo = true; myIsUndoRedo = true;
if (myRedoList.count() > 0) { if (myRedoList.count() > 0) {
myPointsList.append(myRedoList.last()); myPointsList.append(myRedoList.last());
// Erase dimensions presentations // Erase dimensions presentations
@ -657,7 +657,7 @@ void EntityGUI_3DSketcherDlg::ClickOnRedo()
((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Erase(myLengthPrs, true); ((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Erase(myLengthPrs, true);
((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Erase(myAnglePrs, true); ((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Erase(myAnglePrs, true);
((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Erase(myTextPrs, true); ((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Erase(myTextPrs, true);
restoreLastIOToPrs(); restoreLastIOToPrs();
// Display modified presentation // Display modified presentation
@ -666,13 +666,13 @@ void EntityGUI_3DSketcherDlg::ClickOnRedo()
if (isAngleVisible) if (isAngleVisible)
((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Display(myAnglePrs); ((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Display(myAnglePrs);
((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Display(myTextPrs); ((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Display(myTextPrs);
// Remove last point from redo list // Remove last point from redo list
myWorkPoint = myRedoList.last(); myWorkPoint = myRedoList.last();
myRedoList.removeLast(); myRedoList.removeLast();
GEOMBase_Helper::displayPreview(true, false, true, true, myLineWidth); GEOMBase_Helper::displayPreview(true, false, true, true, myLineWidth);
UpdateButtonsState(); UpdateButtonsState();
// Update of point coordinates in the control groupbox // Update of point coordinates in the control groupbox
UpdatePointCoordinates(); UpdatePointCoordinates();
@ -689,7 +689,7 @@ void EntityGUI_3DSketcherDlg::removeLastIOFromPrs ()
{ {
AIS_ListOfInteractive anIOList; AIS_ListOfInteractive anIOList;
XYZ Last = getLastPoint(); XYZ Last = getLastPoint();
for (int l = 0; l<Last.L; l++) for (int l = 0; l<Last.L; l++)
{ {
myLengthPrs->GetObjects(anIOList); myLengthPrs->GetObjects(anIOList);
@ -717,12 +717,12 @@ void EntityGUI_3DSketcherDlg::removeLastIOFromPrs ()
void EntityGUI_3DSketcherDlg::restoreLastIOToPrs () void EntityGUI_3DSketcherDlg::restoreLastIOToPrs ()
{ {
XYZ LastDeleted = myRedoList.last(); XYZ LastDeleted = myRedoList.last();
for (int l = 0; l<LastDeleted.L; l++) for (int l = 0; l<LastDeleted.L; l++)
{ {
myLengthPrs->PrependObject(myLengthIORedoList.First()); // Restore last removed IO myLengthPrs->PrependObject(myLengthIORedoList.First()); // Restore last removed IO
myLengthIORedoList.RemoveFirst(); // Remove it from redo list myLengthIORedoList.RemoveFirst(); // Remove it from redo list
} }
for (int a = 0; a<LastDeleted.A; a++) for (int a = 0; a<LastDeleted.A; a++)
{ {
myAnglePrs->PrependObject(myAngleIORedoList.First()); // Restore last removed IO myAnglePrs->PrependObject(myAngleIORedoList.First()); // Restore last removed IO
@ -891,7 +891,7 @@ void EntityGUI_3DSketcherDlg::BoxChecked (bool checked)
GroupControls->lineEdit_4->setVisible(checked); GroupControls->lineEdit_4->setVisible(checked);
GroupControls->lineEdit_5->setVisible(checked); GroupControls->lineEdit_5->setVisible(checked);
GroupControls->lineEdit_6->setVisible(checked); GroupControls->lineEdit_6->setVisible(checked);
GroupControls->label_1->setVisible(checked); GroupControls->label_1->setVisible(checked);
GroupControls->label_2->setVisible(checked); GroupControls->label_2->setVisible(checked);
GroupControls->label_3->setVisible(checked); GroupControls->label_3->setVisible(checked);
@ -900,14 +900,14 @@ void EntityGUI_3DSketcherDlg::BoxChecked (bool checked)
GroupControls->label_6->setVisible(checked); GroupControls->label_6->setVisible(checked);
GroupControls->label_7->setVisible(checked); GroupControls->label_7->setVisible(checked);
GroupControls->label_8->setVisible(checked); GroupControls->label_8->setVisible(checked);
GroupControls->updateGeometry(); GroupControls->updateGeometry();
GroupControls->resize(minimumSizeHint()); GroupControls->resize(minimumSizeHint());
} }
updateGeometry(); updateGeometry();
resize(minimumSizeHint()); resize(minimumSizeHint());
GEOMBase_Helper::displayPreview(true, false, true, true, myLineWidth); GEOMBase_Helper::displayPreview(true, false, true, true, myLineWidth);
} }
@ -1089,11 +1089,11 @@ EntityGUI_3DSketcherDlg::XYZ EntityGUI_3DSketcherDlg::getCurrentPoint() const
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
int aPrecision = resMgr->integerValue("Geometry", "length_precision", 7); int aPrecision = resMgr->integerValue("Geometry", "length_precision", 7);
bool spherical = GroupAngles->checkBox->isChecked(); bool spherical = GroupAngles->checkBox->isChecked();
bool cylindrical = GroupAngles->checkBox_2->isChecked(); bool cylindrical = GroupAngles->checkBox_2->isChecked();
if (myCoordType == 1) if (myCoordType == 1)
{ {
if (GroupAngles->radioButton_1->isChecked()) if (GroupAngles->radioButton_1->isChecked())
xyz.command = "OXY"; xyz.command = "OXY";
@ -1101,17 +1101,17 @@ EntityGUI_3DSketcherDlg::XYZ EntityGUI_3DSketcherDlg::getCurrentPoint() const
xyz.command = "OYZ"; xyz.command = "OYZ";
else else
xyz.command = "OXZ"; xyz.command = "OXZ";
if (cylindrical) // Cylindrical coordinates (radius, angle, height) if (cylindrical) // Cylindrical coordinates (radius, angle, height)
xyz.command += "C"; xyz.command += "C";
else else
xyz.command += "S"; // Spherical coordinates (radius, angle1, angle2) --> polar if angle2 = 0 xyz.command += "S"; // Spherical coordinates (radius, angle1, angle2) --> polar if angle2 = 0
if (myMode == 0) // Absolute coordinates if (myMode == 0) // Absolute coordinates
xyz.command += "A "; xyz.command += "A ";
else if (myMode == 1) // Relative coordinates else if (myMode == 1) // Relative coordinates
xyz.command += "R "; xyz.command += "R ";
double anAngle = GroupAngles->SpinBox_DA->value(); double anAngle = GroupAngles->SpinBox_DA->value();
double aLength = GroupAngles->SpinBox_DL->value(); double aLength = GroupAngles->SpinBox_DL->value();
@ -1122,7 +1122,7 @@ EntityGUI_3DSketcherDlg::XYZ EntityGUI_3DSketcherDlg::getCurrentPoint() const
anAngle2 = GroupAngles->SpinBox_DA2->value(); anAngle2 = GroupAngles->SpinBox_DA2->value();
da2 = GroupAngles->SpinBox_DA2->text(); da2 = GroupAngles->SpinBox_DA2->text();
} }
double aHeight = 0.0; double aHeight = 0.0;
QString dh = "0"; QString dh = "0";
if (cylindrical) { if (cylindrical) {
@ -1133,8 +1133,8 @@ EntityGUI_3DSketcherDlg::XYZ EntityGUI_3DSketcherDlg::getCurrentPoint() const
xyz.command += xyz.command +=
QString::number(anAngle, 'g', aPrecision) + " "; QString::number(anAngle, 'g', aPrecision) + " ";
xyz.params = xyz.params =
GroupAngles->SpinBox_DA->text() + ":"; GroupAngles->SpinBox_DA->text() + ":";
if(cylindrical) if(cylindrical)
{ {
xyz.command += xyz.command +=
@ -1149,21 +1149,21 @@ EntityGUI_3DSketcherDlg::XYZ EntityGUI_3DSketcherDlg::getCurrentPoint() const
xyz.params += xyz.params +=
dh + ":"; dh + ":";
} }
xyz.command += xyz.command +=
QString::number(aLength, 'g', aPrecision); QString::number(aLength, 'g', aPrecision);
xyz.params += xyz.params +=
GroupAngles->SpinBox_DL->text(); GroupAngles->SpinBox_DL->text();
// Calculate point coordinates for preview // Calculate point coordinates for preview
anAngle = anAngle * M_PI/180.0; anAngle = anAngle * M_PI/180.0;
anAngle2 = anAngle2 * M_PI/180.0; anAngle2 = anAngle2 * M_PI/180.0;
double aProjectedLength = aLength * cos(anAngle2); double aProjectedLength = aLength * cos(anAngle2);
XYZ xyzP = getLastPoint(); XYZ xyzP = getLastPoint();
if (myMode == 0) if (myMode == 0)
xyzP.x=xyzP.y=xyzP.z=0.0; xyzP.x=xyzP.y=xyzP.z=0.0;
if (GroupAngles->radioButton_1->isChecked()) // OXY if (GroupAngles->radioButton_1->isChecked()) // OXY
{ {
xyz.x = xyzP.x + aProjectedLength * cos(anAngle); xyz.x = xyzP.x + aProjectedLength * cos(anAngle);
@ -1224,7 +1224,7 @@ EntityGUI_3DSketcherDlg::XYZ EntityGUI_3DSketcherDlg::getCurrentPoint() const
xyz.A = myPrsType.A; // Number of angle diomensions xyz.A = myPrsType.A; // Number of angle diomensions
xyz.L = myPrsType.L; // Number of length dimensions xyz.L = myPrsType.L; // Number of length dimensions
xyz.T = myPrsType.T; // Number of text objects xyz.T = myPrsType.T; // Number of text objects
return xyz; return xyz;
} }
@ -1235,10 +1235,10 @@ EntityGUI_3DSketcherDlg::XYZ EntityGUI_3DSketcherDlg::getCurrentPoint() const
// relative positioning of dimension presentations // relative positioning of dimension presentations
//================================================================================= //=================================================================================
gp_Dir EntityGUI_3DSketcherDlg::getPresentationPlane() const gp_Dir EntityGUI_3DSketcherDlg::getPresentationPlane() const
{ {
bool withAngle = (myCoordType == 1); bool withAngle = (myCoordType == 1);
bool twoAngles = GroupAngles->checkBox->isChecked(); bool twoAngles = GroupAngles->checkBox->isChecked();
XYZ Last = getLastPoint(); XYZ Last = getLastPoint();
XYZ Current; XYZ Current;
if( myIsUndoRedo ) { if( myIsUndoRedo ) {
@ -1246,34 +1246,34 @@ gp_Dir EntityGUI_3DSketcherDlg::getPresentationPlane() const
} else { } else {
Current = getCurrentPoint(); Current = getCurrentPoint();
} }
XYZ Penultimate = getPenultimatePoint(); XYZ Penultimate = getPenultimatePoint();
gp_Pnt P1 = gp_Pnt(Last.x,Last.y,Last.z); gp_Pnt P1 = gp_Pnt(Last.x,Last.y,Last.z);
if (myMode == 0) // Absolute coordinates if (myMode == 0) // Absolute coordinates
P1 = gp::Origin(); P1 = gp::Origin();
gp_Pnt P2 = gp_Pnt(Current.x,Current.y,Current.z); gp_Pnt P2 = gp_Pnt(Current.x,Current.y,Current.z);
gp_Pnt P3 = gp_Pnt(Penultimate.x,Penultimate.y,Penultimate.z); gp_Pnt P3 = gp_Pnt(Penultimate.x,Penultimate.y,Penultimate.z);
gp_Vec Vec1(P1,P2); gp_Vec Vec1(P1,P2);
gp_Vec Vec2(P1,P3); gp_Vec Vec2(P1,P3);
gp_Dir aNormal; // Normal defining the plane of the presentation gp_Dir aNormal; // Normal defining the plane of the presentation
if (withAngle) // If one angle if (withAngle) // If one angle
{ {
// Transformation from the current coordinate system // Transformation from the current coordinate system
// to the reference coordinate system // to the reference coordinate system
gp_Trsf aTransform = toReferenceSystem (P1); gp_Trsf aTransform = toReferenceSystem (P1);
gp_Dir N1 = gp::DZ(); gp_Dir N1 = gp::DZ();
gp_Dir N2 = gp::DY(); gp_Dir N2 = gp::DY();
N1.Transform(aTransform); N1.Transform(aTransform);
N2.Transform(aTransform); N2.Transform(aTransform);
if (Vec1.CrossMagnitude(N1) > Precision::Confusion()) if (Vec1.CrossMagnitude(N1) > Precision::Confusion())
{ {
// The plane is orthogonal to the angle presentation plane // The plane is orthogonal to the angle presentation plane
// and contains the current edge // and contains the current edge
aNormal = N1.Crossed(gp_Dir(Vec1)); aNormal = N1.Crossed(gp_Dir(Vec1));
} }
@ -1281,19 +1281,19 @@ gp_Dir EntityGUI_3DSketcherDlg::getPresentationPlane() const
aNormal = N2; aNormal = N2;
if (twoAngles) if (twoAngles)
{ {
gp_Vec V = Vec1.Transformed(aTransform.Inverted()); gp_Vec V = Vec1.Transformed(aTransform.Inverted());
gp_Vec Vec3(V.X(),V.Y(),0.0); gp_Vec Vec3(V.X(),V.Y(),0.0);
// Express the coordinates in the reference coordinate system (OXY) // Express the coordinates in the reference coordinate system (OXY)
Vec3.Transform(aTransform); Vec3.Transform(aTransform);
if(Abs(Vec1.CrossMagnitude(Vec3)) > Precision::Confusion()) if(Abs(Vec1.CrossMagnitude(Vec3)) > Precision::Confusion())
{ {
// set the normal as the cross product of the current edge with its projection // set the normal as the cross product of the current edge with its projection
// it ensures that the dimension changes side when the angle becomes negative // it ensures that the dimension changes side when the angle becomes negative
aNormal = gp_Dir(Vec1.Crossed(Vec3)); aNormal = gp_Dir(Vec1.Crossed(Vec3));
} }
} }
} }
else else
{ {
@ -1308,7 +1308,7 @@ gp_Dir EntityGUI_3DSketcherDlg::getPresentationPlane() const
} }
// If no angles, the plane is the one formed by the last edge and the current one // If no angles, the plane is the one formed by the last edge and the current one
if(Abs(Vec1.CrossMagnitude(Vec2)) > Precision::Confusion()) { if(Abs(Vec1.CrossMagnitude(Vec2)) > Precision::Confusion()) {
aNormal = gp_Dir(Vec1.Crossed(Vec2)); aNormal = gp_Dir(Vec1.Crossed(Vec2));
} }
} }
return aNormal; return aNormal;
@ -1388,15 +1388,15 @@ void EntityGUI_3DSketcherDlg::displayTrihedron (int selMode)
{ {
// Add trihedron to preview // Add trihedron to preview
SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow(); SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
SOCC_Viewer* anOCCViewer = dynamic_cast<SOCC_Viewer*>( vw->getViewManager()->getViewModel() ); SOCC_Viewer* anOCCViewer = dynamic_cast<SOCC_Viewer*>( vw->getViewManager()->getViewModel() );
if( !anOCCViewer ) if( !anOCCViewer )
return; return;
Handle(AIS_InteractiveContext) anAISContext = anOCCViewer->getAISContext(); Handle(AIS_InteractiveContext) anAISContext = anOCCViewer->getAISContext();
if( !anAISContext ) if( !anAISContext )
return; return;
gp_Pnt P(getLastPoint().x,getLastPoint().y,getLastPoint().z); gp_Pnt P(getLastPoint().x,getLastPoint().y,getLastPoint().z);
Handle(Geom_Axis2Placement) anAxis = new Geom_Axis2Placement(P,gp::DZ(),gp::DX()); Handle(Geom_Axis2Placement) anAxis = new Geom_Axis2Placement(P,gp::DZ(),gp::DX());
Handle(AIS_Trihedron) anIO = new AIS_Trihedron(anAxis); Handle(AIS_Trihedron) anIO = new AIS_Trihedron(anAxis);
@ -1422,39 +1422,39 @@ void EntityGUI_3DSketcherDlg::displayDimensions (bool store)
XYZ Current = getCurrentPoint(); XYZ Current = getCurrentPoint();
gp_Pnt Last_Pnt(Last.x,Last.y,Last.z); gp_Pnt Last_Pnt(Last.x,Last.y,Last.z);
gp_Pnt P0 = Last_Pnt; gp_Pnt P0 = Last_Pnt;
gp_Pnt Origin = gp::Origin(); gp_Pnt Origin = gp::Origin();
if (myMode == 0) // Absolute coordinates if (myMode == 0) // Absolute coordinates
P0 = Origin; P0 = Origin;
gp_Pnt Current_Pnt(Current.x,Current.y,Current.z); gp_Pnt Current_Pnt(Current.x,Current.y,Current.z);
gp_Pnt P1, P2; gp_Pnt P1, P2;
// Check if last end current point are coincident // Check if last end current point are coincident
if (Last_Pnt.IsEqual(Current_Pnt, 1e-7)) if (Last_Pnt.IsEqual(Current_Pnt, 1e-7))
return; return;
gp_Dir aNormal = getPresentationPlane(); gp_Dir aNormal = getPresentationPlane();
if (myCoordType == 0) if (myCoordType == 0)
{ {
bool oneDimensionalMove = (isSame(Last_Pnt.X(), Current_Pnt.X()) && bool oneDimensionalMove = (isSame(Last_Pnt.X(), Current_Pnt.X()) &&
isSame(Last_Pnt.Y(), Current_Pnt.Y()) ) || isSame(Last_Pnt.Y(), Current_Pnt.Y()) ) ||
(isSame(Last_Pnt.Y(), Current_Pnt.Y()) && (isSame(Last_Pnt.Y(), Current_Pnt.Y()) &&
isSame(Last_Pnt.Z(), Current_Pnt.Z()) ) || isSame(Last_Pnt.Z(), Current_Pnt.Z()) ) ||
(isSame(Last_Pnt.X(), Current_Pnt.X()) && (isSame(Last_Pnt.X(), Current_Pnt.X()) &&
isSame(Last_Pnt.Z(), Current_Pnt.Z()) ); isSame(Last_Pnt.Z(), Current_Pnt.Z()) );
if (myMode == 0) if (myMode == 0)
{ {
std::string aCoordText = "( " + doubleToString(Current_Pnt.X()) + std::string aCoordText = "( " + doubleToString(Current_Pnt.X()) +
", " + doubleToString(Current_Pnt.Y()) + ", " + doubleToString(Current_Pnt.Y()) +
", " + doubleToString(Current_Pnt.Z()) + " )"; ", " + doubleToString(Current_Pnt.Z()) + " )";
displayText(aCoordText, Current_Pnt, store); displayText(aCoordText, Current_Pnt, store);
} }
else else
{ {
if (oneDimensionalMove) if (oneDimensionalMove)
{ {
// For better colocation of dimensions if only one coordinate changes (aNormal is a better choice) // For better colocation of dimensions if only one coordinate changes (aNormal is a better choice)
@ -1470,25 +1470,25 @@ void EntityGUI_3DSketcherDlg::displayDimensions (bool store)
} }
else if (myCoordType == 1) // ANGLES else if (myCoordType == 1) // ANGLES
{ {
bool spherical = GroupAngles->checkBox->isChecked(); bool spherical = GroupAngles->checkBox->isChecked();
bool cylindrical = GroupAngles->checkBox_2->isChecked(); bool cylindrical = GroupAngles->checkBox_2->isChecked();
double anAngle1 = GroupAngles->SpinBox_DA->value(); double anAngle1 = GroupAngles->SpinBox_DA->value();
double aLength = GroupAngles->SpinBox_DL->value(); double aLength = GroupAngles->SpinBox_DL->value();
// Set the coordinates in the current coordinate system // Set the coordinates in the current coordinate system
P1.SetCoord( aLength, 0.0, 0.0); // X direction P1.SetCoord( aLength, 0.0, 0.0); // X direction
P2.SetCoord( aLength * cos(anAngle1 * M_PI / 180. ), P2.SetCoord( aLength * cos(anAngle1 * M_PI / 180. ),
aLength * sin(anAngle1 * M_PI / 180. ), aLength * sin(anAngle1 * M_PI / 180. ),
0.0); 0.0);
// Express the coordinates in the reference coordinate system (OXY) // Express the coordinates in the reference coordinate system (OXY)
gp_Trsf aTransform = toReferenceSystem(P0); gp_Trsf aTransform = toReferenceSystem(P0);
P1.Transform(aTransform); P1.Transform(aTransform);
P2.Transform(aTransform); P2.Transform(aTransform);
P1.Translate(Origin, P0); P1.Translate(Origin, P0);
P2.Translate(Origin, P0); P2.Translate(Origin, P0);
if(myMode !=0 || !store) if(myMode !=0 || !store)
displayAngle(anAngle1, P0, P1, P2, store); displayAngle(anAngle1, P0, P1, P2, store);
else else
@ -1496,7 +1496,7 @@ void EntityGUI_3DSketcherDlg::displayDimensions (bool store)
std::string anAngleText = doubleToString(anAngle1) + " deg."; std::string anAngleText = doubleToString(anAngle1) + " deg.";
displayText(anAngleText, Current_Pnt, store); displayText(anAngleText, Current_Pnt, store);
} }
if(spherical) if(spherical)
{ {
double anAngle2 = GroupAngles->SpinBox_DA2->value(); double anAngle2 = GroupAngles->SpinBox_DA2->value();
@ -1507,17 +1507,17 @@ void EntityGUI_3DSketcherDlg::displayDimensions (bool store)
{ {
bool sameRadius = isSame ( radius(Last_Pnt), radius(Current_Pnt) ); bool sameRadius = isSame ( radius(Last_Pnt), radius(Current_Pnt) );
bool sameHeight = isSame ( height(Last_Pnt), height(Current_Pnt) ); bool sameHeight = isSame ( height(Last_Pnt), height(Current_Pnt) );
gp_Vec aVec(P2, Current_Pnt); gp_Vec aVec(P2, Current_Pnt);
if (myMode == 0 && !sameRadius) if (myMode == 0 && !sameRadius)
{ {
displayLength(P0.Translated(aVec), P2.Translated(aVec), aNormal, store); // Radius displayLength(P0.Translated(aVec), P2.Translated(aVec), aNormal, store); // Radius
} }
else if (myMode == 1) else if (myMode == 1)
displayLength(P0, P2, aNormal, store); displayLength(P0, P2, aNormal, store);
if ( cylindrical && if ( cylindrical &&
(myMode == 1 || !sameHeight) ) (myMode == 1 || !sameHeight) )
displayLength(P2, Current_Pnt, aNormal.Reversed(), store); // Height displayLength(P2, Current_Pnt, aNormal.Reversed(), store); // Height
} }
@ -1529,31 +1529,31 @@ void EntityGUI_3DSketcherDlg::displayDimensions (bool store)
// Purpose : Method for displaying angle dimensions // Purpose : Method for displaying angle dimensions
//================================================================ //================================================================
void EntityGUI_3DSketcherDlg::displayAngle (double theAngle, void EntityGUI_3DSketcherDlg::displayAngle (double theAngle,
gp_Pnt P0, gp_Pnt P0,
gp_Pnt P1, gp_Pnt P1,
gp_Pnt P2, gp_Pnt P2,
bool store) bool store)
{ {
SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow(); SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
// Creation of the AIS object // Creation of the AIS object
Handle(AIS_AngleDimension) anAngleIO = createAISAngleDimension(theAngle, Handle(AIS_AngleDimension) anAngleIO = createAISAngleDimension(theAngle,
P0, P0,
P1, P1,
P2); P2);
if (anAngleIO.IsNull()) if (anAngleIO.IsNull())
return; return;
if (store) if (store)
{ {
// Erase dimensions presentations // Erase dimensions presentations
((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Erase(myAnglePrs, true); ((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Erase(myAnglePrs, true);
myAnglePrs->PrependObject(anAngleIO); myAnglePrs->PrependObject(anAngleIO);
// Display modified presentation // Display modified presentation
if (isAngleVisible) if (isAngleVisible)
((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Display(myAnglePrs); ((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Display(myAnglePrs);
// Update dimension presentation angle count for later undo / redo // Update dimension presentation angle count for later undo / redo
myPrsType.A += 1; myPrsType.A += 1;
} }
@ -1561,11 +1561,11 @@ void EntityGUI_3DSketcherDlg::displayAngle (double theAngle,
{ {
SOCC_Prs* aSPrs = dynamic_cast<SOCC_Prs*> SOCC_Prs* aSPrs = dynamic_cast<SOCC_Prs*>
(((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0)); (((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0));
if (aSPrs) if (aSPrs)
{ {
aSPrs->AddObject(anAngleIO); aSPrs->AddObject(anAngleIO);
GEOMBase_Helper::displayPreview(aSPrs, true, true); GEOMBase_Helper::displayPreview(aSPrs, true, true);
} }
} }
} }
@ -1582,12 +1582,12 @@ void EntityGUI_3DSketcherDlg::displayLength (gp_Pnt P1,
bool store) bool store)
{ {
SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow(); SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
double aLength = P1.Distance(P2); double aLength = P1.Distance(P2);
if (aLength < Precision::Confusion()) if (aLength < Precision::Confusion())
return; return;
Handle(AIS_LengthDimension) anIO = createAISLengthDimension(aLength, P1, P2, theNormal); Handle(AIS_LengthDimension) anIO = createAISLengthDimension(aLength, P1, P2, theNormal);
if (store) if (store)
@ -1599,7 +1599,7 @@ void EntityGUI_3DSketcherDlg::displayLength (gp_Pnt P1,
// Display modified presentation // Display modified presentation
if (isLengthVisible) if (isLengthVisible)
((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Display(myLengthPrs); ((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Display(myLengthPrs);
// Update dimension presentation length count for later undo / redo // Update dimension presentation length count for later undo / redo
myPrsType.L += 1; myPrsType.L += 1;
} }
@ -1625,7 +1625,7 @@ void EntityGUI_3DSketcherDlg::displayText ( std::string theText,
bool store ) bool store )
{ {
SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow(); SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
Handle(AIS_Text) anIO = new AIS_Text(TCollection_ExtendedString(theText.c_str()), P); Handle(AIS_Text) anIO = new AIS_Text(TCollection_ExtendedString(theText.c_str()), P);
if (store) if (store)
@ -1636,7 +1636,7 @@ void EntityGUI_3DSketcherDlg::displayText ( std::string theText,
// Display modified presentation // Display modified presentation
((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Display(myTextPrs); ((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Display(myTextPrs);
// Update dimension presentation text count for later undo / redo // Update dimension presentation text count for later undo / redo
myPrsType.T += 1; myPrsType.T += 1;
} }
@ -1658,15 +1658,15 @@ void EntityGUI_3DSketcherDlg::displayText ( std::string theText,
// Purpose : Method for creation of a length dimension object // Purpose : Method for creation of a length dimension object
// Returns an Handle on the AIS_LengthDimension object // Returns an Handle on the AIS_LengthDimension object
//================================================================ //================================================================
Handle(AIS_LengthDimension) EntityGUI_3DSketcherDlg::createAISLengthDimension(double theLength, Handle(AIS_LengthDimension) EntityGUI_3DSketcherDlg::createAISLengthDimension(double theLength,
gp_Pnt P1, gp_Pnt P1,
gp_Pnt P2, gp_Pnt P2,
gp_Dir theNormal) gp_Dir theNormal)
{ {
// Plane construction // Plane construction
gce_MakePln gce_MP(P1, theNormal); gce_MakePln gce_MP(P1, theNormal);
Handle(Geom_Plane) aPlane = new Geom_Plane(gce_MP.Value()); Handle(Geom_Plane) aPlane = new Geom_Plane(gce_MP.Value());
TopoDS_Vertex aVert1 = BRepBuilderAPI_MakeVertex(P1); TopoDS_Vertex aVert1 = BRepBuilderAPI_MakeVertex(P1);
TopoDS_Vertex aVert2 = BRepBuilderAPI_MakeVertex(P2); TopoDS_Vertex aVert2 = BRepBuilderAPI_MakeVertex(P2);
@ -1696,14 +1696,14 @@ Handle(AIS_LengthDimension) EntityGUI_3DSketcherDlg::createAISLengthDimension(do
// Purpose : Method for creation of an angle dimension object // Purpose : Method for creation of an angle dimension object
// Returns an Handle on the AIS_AngleDimension object // Returns an Handle on the AIS_AngleDimension object
//================================================================ //================================================================
Handle(AIS_AngleDimension) EntityGUI_3DSketcherDlg::createAISAngleDimension(double theAngle, Handle(AIS_AngleDimension) EntityGUI_3DSketcherDlg::createAISAngleDimension(double theAngle,
gp_Pnt P0, gp_Pnt P0,
gp_Pnt P1, gp_Pnt P1,
gp_Pnt P2) gp_Pnt P2)
{ {
// Length of the built segment // Length of the built segment
double aLength = P0.Distance(P1); double aLength = P0.Distance(P1);
// Check input data // Check input data
if (Abs(theAngle) < Precision::Angular() || if (Abs(theAngle) < Precision::Angular() ||
aLength < Precision::Confusion()) aLength < Precision::Confusion())
@ -1825,11 +1825,11 @@ std::string EntityGUI_3DSketcherDlg::doubleToString (double num)
// Purpose : // Purpose :
//================================================================ //================================================================
gp_Trsf EntityGUI_3DSketcherDlg::toReferenceSystem(gp_Pnt origin) const gp_Trsf EntityGUI_3DSketcherDlg::toReferenceSystem(gp_Pnt origin) const
{ {
gp_Trsf T; // Identity transformation gp_Trsf T; // Identity transformation
gp_Ax3 reference_system; // OXY gp_Ax3 reference_system; // OXY
reference_system.SetLocation(origin); reference_system.SetLocation(origin);
gp_Ax3 current_system = reference_system; gp_Ax3 current_system = reference_system;
switch (myOrientation) switch (myOrientation)
{ {
@ -1844,9 +1844,9 @@ gp_Trsf EntityGUI_3DSketcherDlg::toReferenceSystem(gp_Pnt origin) const
break; break;
} }
} }
T.SetTransformation( current_system, reference_system ); T.SetTransformation( current_system, reference_system );
return T; return T;
} }
@ -1868,7 +1868,7 @@ double EntityGUI_3DSketcherDlg::radius (gp_Pnt thePnt) const
// Get the point coordinates in the current coordinates system // Get the point coordinates in the current coordinates system
gp_Trsf aTrsf = toCurrentSystem(gp::Origin()); gp_Trsf aTrsf = toCurrentSystem(gp::Origin());
gp_Pnt aPnt = thePnt.Transformed(aTrsf); gp_Pnt aPnt = thePnt.Transformed(aTrsf);
double radius = sqrt(aPnt.X()*aPnt.X() + aPnt.Y()*aPnt.Y()); double radius = sqrt(aPnt.X()*aPnt.X() + aPnt.Y()*aPnt.Y());
return radius; return radius;
} }
@ -1882,6 +1882,6 @@ double EntityGUI_3DSketcherDlg::height (gp_Pnt thePnt) const
// Get the point coordinates in the current coordinates system // Get the point coordinates in the current coordinates system
gp_Trsf aTrsf = toCurrentSystem(gp::Origin()); gp_Trsf aTrsf = toCurrentSystem(gp::Origin());
gp_Pnt aPnt = thePnt.Transformed(aTrsf); gp_Pnt aPnt = thePnt.Transformed(aTrsf);
return aPnt.Z(); return aPnt.Z();
} }

View File

@ -35,7 +35,7 @@
//================================================================================= //=================================================================================
// class : EntityGUI_IsolineDlg // class : EntityGUI_IsolineDlg
// purpose : // purpose :
//================================================================================= //=================================================================================
EntityGUI_IsolineDlg::EntityGUI_IsolineDlg (GeometryGUI *theGeometryGUI, EntityGUI_IsolineDlg::EntityGUI_IsolineDlg (GeometryGUI *theGeometryGUI,
QWidget *parent, QWidget *parent,
@ -85,7 +85,7 @@ EntityGUI_IsolineDlg::EntityGUI_IsolineDlg (GeometryGUI *theGeometryGUI,
//================================================================================= //=================================================================================
// function : ~EntityGUI_IsolineDlg() // function : ~EntityGUI_IsolineDlg()
// purpose : // purpose :
//================================================================================= //=================================================================================
EntityGUI_IsolineDlg::~EntityGUI_IsolineDlg() EntityGUI_IsolineDlg::~EntityGUI_IsolineDlg()
{ {

File diff suppressed because it is too large Load Diff

View File

@ -48,14 +48,14 @@
//================================================================================= //=================================================================================
// class : GEOMBase_Skeleton() // class : GEOMBase_Skeleton()
// purpose : Constructs a GEOMBase_Skeleton which is a child of 'parent', with the // purpose : Constructs a GEOMBase_Skeleton which is a child of 'parent', with the
// name 'name' and widget flags set to 'f'. // name 'name' and widget flags set to 'f'.
// The dialog will by default be modeless, unless you set 'modal' to // The dialog will by default be modeless, unless you set 'modal' to
// true to construct a modal dialog. // true to construct a modal dialog.
//================================================================================= //=================================================================================
GEOMBase_Skeleton::GEOMBase_Skeleton( GeometryGUI* theGeometryGUI, QWidget* parent, GEOMBase_Skeleton::GEOMBase_Skeleton( GeometryGUI* theGeometryGUI, QWidget* parent,
bool modal, Qt::WindowFlags fl ) bool modal, Qt::WindowFlags fl )
: QDialog( parent, fl ), : QDialog( parent, fl ),
GEOMBase_Helper( dynamic_cast<SUIT_Desktop*>( parent ) ), GEOMBase_Helper( dynamic_cast<SUIT_Desktop*>( parent ) ),
myGeomGUI( theGeometryGUI ), myGeomGUI( theGeometryGUI ),
myRBGroup( 0 ) myRBGroup( 0 )
@ -140,16 +140,16 @@ void GEOMBase_Skeleton::Init()
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
bool aPrv = (resMgr == 0) ? false : resMgr->booleanValue( "Geometry", "geom_preview", false ); bool aPrv = (resMgr == 0) ? false : resMgr->booleanValue( "Geometry", "geom_preview", false );
myMainFrame->CheckBoxPreview->setChecked( aPrv ); myMainFrame->CheckBoxPreview->setChecked( aPrv );
myMainFrame->GroupBoxPublish->hide(); myMainFrame->GroupBoxPublish->hide();
} }
//================================================================================= //=================================================================================
// function : initSpinBox() // function : initSpinBox()
// purpose : // purpose :
//================================================================================= //=================================================================================
void GEOMBase_Skeleton::initSpinBox( QSpinBox* spinBox, void GEOMBase_Skeleton::initSpinBox( QSpinBox* spinBox,
int min, int max, int step ) int min, int max, int step )
{ {
spinBox->setRange( min, max ); spinBox->setRange( min, max );
@ -158,25 +158,25 @@ void GEOMBase_Skeleton::initSpinBox( QSpinBox* spinBox,
//================================================================================= //=================================================================================
// function : initSpinBox() // function : initSpinBox()
// purpose : // purpose :
//================================================================================= //=================================================================================
void GEOMBase_Skeleton::initSpinBox( SalomeApp_DoubleSpinBox* spinBox, void GEOMBase_Skeleton::initSpinBox( SalomeApp_DoubleSpinBox* spinBox,
double min, double max, double min, double max,
double step, const char* quantity ) double step, const char* quantity )
{ {
// Obtain precision from preferences // Obtain precision from preferences
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
int aPrecision = resMgr->integerValue( "Geometry", quantity, 6 ); int aPrecision = resMgr->integerValue( "Geometry", quantity, 6 );
spinBox->setPrecision( aPrecision ); spinBox->setPrecision( aPrecision );
spinBox->setDecimals( qAbs( aPrecision ) ); // it's necessary to set decimals before the range setting, spinBox->setDecimals( qAbs( aPrecision ) ); // it's necessary to set decimals before the range setting,
// by default Qt rounds boundaries to 2 decimals at setRange // by default Qt rounds boundaries to 2 decimals at setRange
spinBox->setRange( min, max ); spinBox->setRange( min, max );
spinBox->setSingleStep( step ); spinBox->setSingleStep( step );
// Add a hint for the user saying how to tune precision // Add a hint for the user saying how to tune precision
QString userPropName = QObject::tr( QString( "GEOM_PREF_%1" ).arg( quantity ).toLatin1().constData() ); QString userPropName = QObject::tr( QString( "GEOM_PREF_%1" ).arg( quantity ).toLatin1().constData() );
spinBox->setProperty( "validity_tune_hint", spinBox->setProperty( "validity_tune_hint",
QVariant( QObject::tr( "GEOM_PRECISION_HINT" ).arg( userPropName ) ) ); QVariant( QObject::tr( "GEOM_PRECISION_HINT" ).arg( userPropName ) ) );
} }
@ -356,7 +356,7 @@ void GEOMBase_Skeleton::ClickOnHelp()
} else { } else {
context = myHelpContext; context = myHelpContext;
} }
if ( app ) if ( app )
app->onHelpContextModule( context , myHelpFileName ); app->onHelpContextModule( context , myHelpFileName );
else { else {
QString platform; QString platform;
@ -430,7 +430,7 @@ void GEOMBase_Skeleton::keyPressEvent( QKeyEvent* e )
//================================================================================= //=================================================================================
// function : showOnlyPreviewControl() // function : showOnlyPreviewControl()
// purpose : display only CheckBoxPreview check box, // purpose : display only CheckBoxPreview check box,
// hide CheckBoxRestoreSS and CheckBoxAddPrefix // hide CheckBoxRestoreSS and CheckBoxAddPrefix
//================================================================================= //=================================================================================
void GEOMBase_Skeleton::showOnlyPreviewControl(){ void GEOMBase_Skeleton::showOnlyPreviewControl(){
mainFrame()->GroupBoxPublish->show(); mainFrame()->GroupBoxPublish->show();

View File

@ -396,7 +396,7 @@ bool GroupGUI_GroupDlg::ClickOnApply()
setIsDisableBrowsing( true ); setIsDisableBrowsing( true );
setIsDisplayResult( false ); setIsDisplayResult( false );
} }
myIsAccept = onAccept(myMode == CreateGroup, true, isApplyAndClose()); myIsAccept = onAccept(myMode == CreateGroup, true, isApplyAndClose());
if (!myIsAccept) if (!myIsAccept)
return false; return false;
@ -552,7 +552,7 @@ void GroupGUI_GroupDlg::setInPlaceObj(GEOM::GEOM_Object_var theObj, const bool i
GEOM::ListOfLong_var aCurrList = aShapesOp->GetSameIDs( myMainObj, aSubObjects[i] ); GEOM::ListOfLong_var aCurrList = aShapesOp->GetSameIDs( myMainObj, aSubObjects[i] );
if( aCurrList->length() > 1 ) { if( aCurrList->length() > 1 ) {
//rnv : To Fix the 21561: EDF 2184 GEOM: Group with second shape restriction. //rnv : To Fix the 21561: EDF 2184 GEOM: Group with second shape restriction.
// In case if GetSameIDs(...) method return more then one ID use // In case if GetSameIDs(...) method return more then one ID use
// GetSharedShapes(...) method to get sub-shapes of the second shape. // GetSharedShapes(...) method to get sub-shapes of the second shape.
GEOM::ListOfGO_var aSubObjects2 = aShapesOp->GetSharedShapes( myMainObj, aSubObjects[i], getShapeType() ); GEOM::ListOfGO_var aSubObjects2 = aShapesOp->GetSharedShapes( myMainObj, aSubObjects[i], getShapeType() );
for( int j = 0; j < aSubObjects2->length(); j++ ) { for( int j = 0; j < aSubObjects2->length(); j++ ) {
@ -775,7 +775,7 @@ void GroupGUI_GroupDlg::showOnlySelected()
Handle(SALOME_InteractiveObject) io = Handle(SALOME_InteractiveObject) io =
new SALOME_InteractiveObject (aMainEntry.in(), "GEOM", "TEMP_IO"); new SALOME_InteractiveObject (aMainEntry.in(), "GEOM", "TEMP_IO");
if (view->isVisible(io)) myIsHiddenMain = true; if (view->isVisible(io)) myIsHiddenMain = true;
//keep the selected entry and IO in the map for checking //keep the selected entry and IO in the map for checking
std::map<QString, Handle(SALOME_InteractiveObject)> aSelEntriesMap; std::map<QString, Handle(SALOME_InteractiveObject)> aSelEntriesMap;
SALOME_ListIteratorOfListIO aSelIt(aSelList); SALOME_ListIteratorOfListIO aSelIt(aSelList);
@ -787,7 +787,7 @@ void GroupGUI_GroupDlg::showOnlySelected()
SALOME_ListIO displayed; SALOME_ListIO displayed;
view->GetVisible(displayed); view->GetVisible(displayed);
// Erase all, except the selected sub-shapes // Erase all, except the selected sub-shapes
std::map<QString, Handle(SALOME_InteractiveObject)>::iterator std::map<QString, Handle(SALOME_InteractiveObject)>::iterator
aSelDispIter = aSelEntriesMap.end(); aSelDispIter = aSelEntriesMap.end();
SALOME_ListIteratorOfListIO aDispIt( displayed ); SALOME_ListIteratorOfListIO aDispIt( displayed );
for ( ; aDispIt.More(); aDispIt.Next() ) { for ( ; aDispIt.More(); aDispIt.Next() ) {
@ -1165,7 +1165,7 @@ void GroupGUI_GroupDlg::updateState (bool isAdd)
myRemBtn->setEnabled(hasSel); myRemBtn->setEnabled(hasSel);
myRestrictGroupBox->setEnabled(!CORBA::is_nil(myMainObj)); myRestrictGroupBox->setEnabled(!CORBA::is_nil(myMainObj));
mySelAllBtn->setEnabled(!CORBA::is_nil(myMainObj)); mySelAllBtn->setEnabled(!CORBA::is_nil(myMainObj));
mySelBtn2->setEnabled(subSelectionWay() != ALL_SUBSHAPES); mySelBtn2->setEnabled(subSelectionWay() != ALL_SUBSHAPES);
myShape2Name->setEnabled(subSelectionWay() != ALL_SUBSHAPES); myShape2Name->setEnabled(subSelectionWay() != ALL_SUBSHAPES);
myFilterGrp->setEnabled(!CORBA::is_nil(myMainObj) && myFilterGrp->setEnabled(!CORBA::is_nil(myMainObj) &&
@ -1179,7 +1179,7 @@ void GroupGUI_GroupDlg::updateState (bool isAdd)
#ifndef DISABLE_PLOT2DVIEWER #ifndef DISABLE_PLOT2DVIEWER
myPlotDistributionButton->setEnabled( myFilterGrp->isEnabled() && myPlotDistributionButton->setEnabled( myFilterGrp->isEnabled() &&
myIsShapeType && myIsShapeType &&
( getShapeType() == TopAbs_EDGE || ( getShapeType() == TopAbs_EDGE ||
getShapeType() == TopAbs_FACE || getShapeType() == TopAbs_FACE ||
getShapeType() == TopAbs_SOLID ) && getShapeType() == TopAbs_SOLID ) &&
hasCurrentEntities ); hasCurrentEntities );
@ -1423,7 +1423,7 @@ void GroupGUI_GroupDlg::ClickOnOkFilter()
{ {
if (CORBA::is_nil(myMainObj) || subSelectionWay() != ALL_SUBSHAPES || !myIsShapeType || getShapeType() == TopAbs_VERTEX) if (CORBA::is_nil(myMainObj) || subSelectionWay() != ALL_SUBSHAPES || !myIsShapeType || getShapeType() == TopAbs_VERTEX)
return; return;
TopoDS_Shape aMainShape = GEOM_Client::get_client().GetShape(GeometryGUI::GetGeomGen(), myMainObj); TopoDS_Shape aMainShape = GEOM_Client::get_client().GetShape(GeometryGUI::GetGeomGen(), myMainObj);
TopTools_IndexedMapOfShape aSubShapesMap; TopTools_IndexedMapOfShape aSubShapesMap;
TopExp::MapShapes(aMainShape, aSubShapesMap); TopExp::MapShapes(aMainShape, aSubShapesMap);

View File

@ -92,7 +92,7 @@ MeasureGUI_CreateDimensionDlg::MeasureGUI_CreateDimensionDlg( const GEOM::GeomOb
SLOT( OnStartSelection( const QList<TopAbs_ShapeEnum>& ) ) ); SLOT( OnStartSelection( const QList<TopAbs_ShapeEnum>& ) ) );
connect( myDiameterArgs, SIGNAL( StartSelection( const QList<TopAbs_ShapeEnum>& ) ), connect( myDiameterArgs, SIGNAL( StartSelection( const QList<TopAbs_ShapeEnum>& ) ),
SLOT( OnStartSelection( const QList<TopAbs_ShapeEnum>& ) ) ); SLOT( OnStartSelection( const QList<TopAbs_ShapeEnum>& ) ) );
connect( myAngleArgs, SIGNAL( StartSelection( const QList<TopAbs_ShapeEnum>& ) ), connect( myAngleArgs, SIGNAL( StartSelection( const QList<TopAbs_ShapeEnum>& ) ),
SLOT( OnStartSelection( const QList<TopAbs_ShapeEnum>& ) ) ); SLOT( OnStartSelection( const QList<TopAbs_ShapeEnum>& ) ) );
connect( myLengthArgs, SIGNAL( StopSelection() ), SLOT( OnStopSelection() ) ); connect( myLengthArgs, SIGNAL( StopSelection() ), SLOT( OnStopSelection() ) );
@ -109,7 +109,7 @@ MeasureGUI_CreateDimensionDlg::MeasureGUI_CreateDimensionDlg( const GEOM::GeomOb
// construct main layout // construct main layout
QVBoxLayout* aCustomWidLayout = new QVBoxLayout( centralWidget() ); QVBoxLayout* aCustomWidLayout = new QVBoxLayout( centralWidget() );
aCustomWidLayout->setMargin( 0 ); aCustomWidLayout->setMargin( 0 );
aCustomWidLayout->setSpacing( 6 ); aCustomWidLayout->setSpacing( 6 );
aCustomWidLayout->addWidget( aGroupArgs ); aCustomWidLayout->addWidget( aGroupArgs );
@ -155,7 +155,7 @@ MeasureGUI_CreateDimensionDlg::~MeasureGUI_CreateDimensionDlg()
//================================================================================= //=================================================================================
// function : ActiveArgs // function : ActiveArgs
// purpose : // purpose :
//================================================================================= //=================================================================================
MeasureGUI_CreateDimensionDlg::BaseSelectorPane* MeasureGUI_CreateDimensionDlg::ActiveArgs() MeasureGUI_CreateDimensionDlg::BaseSelectorPane* MeasureGUI_CreateDimensionDlg::ActiveArgs()
{ {
@ -171,7 +171,7 @@ MeasureGUI_CreateDimensionDlg::BaseSelectorPane* MeasureGUI_CreateDimensionDlg::
//================================================================================= //=================================================================================
// function : GenerateName // function : GenerateName
// purpose : // purpose :
//================================================================================= //=================================================================================
QString MeasureGUI_CreateDimensionDlg::GenerateName( const QString& thePrefix ) QString MeasureGUI_CreateDimensionDlg::GenerateName( const QString& thePrefix )
{ {
@ -213,7 +213,7 @@ QString MeasureGUI_CreateDimensionDlg::GenerateName( const QString& thePrefix )
//================================================================================= //=================================================================================
// function : ConstructTypeChanged // function : ConstructTypeChanged
// purpose : // purpose :
//================================================================================= //=================================================================================
void MeasureGUI_CreateDimensionDlg::ConstructTypeChanged( int theType ) void MeasureGUI_CreateDimensionDlg::ConstructTypeChanged( int theType )
{ {
@ -240,7 +240,7 @@ void MeasureGUI_CreateDimensionDlg::ConstructTypeChanged( int theType )
//================================================================================= //=================================================================================
// function : OnArgumentTabChanged // function : OnArgumentTabChanged
// purpose : // purpose :
//================================================================================= //=================================================================================
void MeasureGUI_CreateDimensionDlg::OnArgumentTabChanged() void MeasureGUI_CreateDimensionDlg::OnArgumentTabChanged()
{ {
@ -308,9 +308,9 @@ void MeasureGUI_CreateDimensionDlg::SelectionIntoArgument()
return; return;
} }
GEOM::GeomObjPtr aSelectedMain = GEOM::GeomObjPtr aSelectedMain =
!aSelected->IsMainShape() !aSelected->IsMainShape()
? aSelected->GetMainShape() ? aSelected->GetMainShape()
: GEOM::GeomObjPtr(); : GEOM::GeomObjPtr();
if ( myParentObj != aSelected && myParentObj != aSelectedMain ) if ( myParentObj != aSelected && myParentObj != aSelectedMain )
@ -361,7 +361,7 @@ void MeasureGUI_CreateDimensionDlg::OnSelectionDone()
//================================================================================= //=================================================================================
// function : ClickOnOk // function : ClickOnOk
// purpose : // purpose :
//================================================================================= //=================================================================================
void MeasureGUI_CreateDimensionDlg::ClickOnOk() void MeasureGUI_CreateDimensionDlg::ClickOnOk()
{ {
@ -374,7 +374,7 @@ void MeasureGUI_CreateDimensionDlg::ClickOnOk()
//================================================================================= //=================================================================================
// function : ClickOnApply // function : ClickOnApply
// purpose : // purpose :
//================================================================================= //=================================================================================
bool MeasureGUI_CreateDimensionDlg::ClickOnApply() bool MeasureGUI_CreateDimensionDlg::ClickOnApply()
{ {
@ -404,7 +404,7 @@ bool MeasureGUI_CreateDimensionDlg::ClickOnApply()
//================================================================================= //=================================================================================
// function : StartLocalEditing // function : StartLocalEditing
// purpose : // purpose :
//================================================================================= //=================================================================================
void MeasureGUI_CreateDimensionDlg::StartLocalEditing() void MeasureGUI_CreateDimensionDlg::StartLocalEditing()
{ {
@ -455,7 +455,7 @@ void MeasureGUI_CreateDimensionDlg::StartLocalEditing()
//================================================================================= //=================================================================================
// function : StopLocalEditing // function : StopLocalEditing
// purpose : // purpose :
//================================================================================= //=================================================================================
void MeasureGUI_CreateDimensionDlg::StopLocalEditing() void MeasureGUI_CreateDimensionDlg::StopLocalEditing()
{ {
@ -478,7 +478,7 @@ void MeasureGUI_CreateDimensionDlg::StopLocalEditing()
//================================================================================= //=================================================================================
// function : Init // function : Init
// purpose : // purpose :
//================================================================================= //=================================================================================
void MeasureGUI_CreateDimensionDlg::Init() void MeasureGUI_CreateDimensionDlg::Init()
{ {
@ -495,7 +495,7 @@ void MeasureGUI_CreateDimensionDlg::Init()
//================================================================================= //=================================================================================
// function : CreateDimensionPrs // function : CreateDimensionPrs
// purpose : // purpose :
//================================================================================= //=================================================================================
Handle(AIS_Dimension) MeasureGUI_CreateDimensionDlg::CreateDimension() Handle(AIS_Dimension) MeasureGUI_CreateDimensionDlg::CreateDimension()
{ {
@ -670,7 +670,7 @@ Handle(AIS_Dimension) MeasureGUI_CreateDimensionDlg::CreateDimension()
//================================================================================= //=================================================================================
// class : AddDimensionToOwner // class : AddDimensionToOwner
// purpose : // purpose :
//================================================================================= //=================================================================================
bool MeasureGUI_CreateDimensionDlg::AddDimensionToOwner() bool MeasureGUI_CreateDimensionDlg::AddDimensionToOwner()
{ {
@ -949,7 +949,7 @@ void MeasureGUI_CreateDimensionDlg::BaseSelectorPane::SelectionIntoArguments( co
//================================================================================= //=================================================================================
// function : BaseSelectorPane::GetSelection // function : BaseSelectorPane::GetSelection
// purpose : // purpose :
//================================================================================= //=================================================================================
GEOM::GeomObjPtr MeasureGUI_CreateDimensionDlg::BaseSelectorPane::GetSelection( QLineEdit* theSelector ) const GEOM::GeomObjPtr MeasureGUI_CreateDimensionDlg::BaseSelectorPane::GetSelection( QLineEdit* theSelector ) const
{ {