mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-02-05 20:54:17 +05:00
Added a mechanism to store AIS_AngleDimension objects and display them all along the sketch creation process as a control tool for the user
This commit is contained in:
parent
40cd2e5cb1
commit
de4f7327f4
@ -174,6 +174,9 @@ void EntityGUI_3DSketcherDlg::Init()
|
|||||||
myOK = false;
|
myOK = false;
|
||||||
myOrientation = 1;
|
myOrientation = 1;
|
||||||
|
|
||||||
|
SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
|
||||||
|
myAnglePrs = dynamic_cast<SOCC_Prs*>(((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0));
|
||||||
|
|
||||||
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
|
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
|
||||||
|
|
||||||
/* Get setting of step value from file configuration */
|
/* Get setting of step value from file configuration */
|
||||||
@ -308,6 +311,23 @@ void EntityGUI_3DSketcherDlg::ClickOnAddPoint()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Erase cotation presentation
|
||||||
|
SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
|
||||||
|
((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Erase(myAnglePrs, true);
|
||||||
|
|
||||||
|
// Store last angle cotation if any
|
||||||
|
if(GroupType->RadioButton3->isChecked() && GroupAngles->SpinBox_DL->value()>Precision::Confusion())
|
||||||
|
{
|
||||||
|
double anAngle2 = 0.0;
|
||||||
|
if (GroupAngles->checkBox->isChecked())
|
||||||
|
anAngle2 = GroupAngles->SpinBox_DA2->value();
|
||||||
|
|
||||||
|
displayAngle(GroupAngles->SpinBox_DA->value(), anAngle2, GroupAngles->SpinBox_DL->value(), myOrientation, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Display modified presentation
|
||||||
|
((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Display(myAnglePrs);
|
||||||
|
|
||||||
myPointsList.append( getCurrentPoint() );
|
myPointsList.append( getCurrentPoint() );
|
||||||
myRedoList.clear();
|
myRedoList.clear();
|
||||||
|
|
||||||
@ -318,6 +338,7 @@ void EntityGUI_3DSketcherDlg::ClickOnAddPoint()
|
|||||||
}
|
}
|
||||||
UpdateButtonsState();
|
UpdateButtonsState();
|
||||||
GEOMBase_Helper::displayPreview( true, false, true, true, myLineWidth );
|
GEOMBase_Helper::displayPreview( true, false, true, true, myLineWidth );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -459,6 +480,7 @@ void EntityGUI_3DSketcherDlg::ActivateThisDialog()
|
|||||||
void EntityGUI_3DSketcherDlg::ValueChangedInSpinBox( double newValue )
|
void EntityGUI_3DSketcherDlg::ValueChangedInSpinBox( double newValue )
|
||||||
{
|
{
|
||||||
GEOMBase_Helper::displayPreview( true, false, true, true, myLineWidth );
|
GEOMBase_Helper::displayPreview( true, false, true, true, myLineWidth );
|
||||||
|
|
||||||
if(GroupType->RadioButton3->isChecked() && GroupAngles->SpinBox_DL->value()>Precision::Confusion())
|
if(GroupType->RadioButton3->isChecked() && GroupAngles->SpinBox_DL->value()>Precision::Confusion())
|
||||||
{
|
{
|
||||||
double anAngle2 = 0.0;
|
double anAngle2 = 0.0;
|
||||||
@ -752,9 +774,10 @@ void EntityGUI_3DSketcherDlg::displayPreview( GEOM::GEOM_Object_ptr object,
|
|||||||
if ( aPrs != 0 && !aPrs->IsNull() )
|
if ( aPrs != 0 && !aPrs->IsNull() )
|
||||||
GEOMBase_Helper::displayPreview( aPrs, append, update );
|
GEOMBase_Helper::displayPreview( aPrs, append, update );
|
||||||
|
|
||||||
if(GroupType->RadioButton3->isChecked())
|
// Display trihedron
|
||||||
displayTrihedron(3);
|
// if(GroupType->RadioButton3->isChecked())
|
||||||
else
|
// displayTrihedron(3);
|
||||||
|
// else
|
||||||
displayTrihedron(2);
|
displayTrihedron(2);
|
||||||
|
|
||||||
getDisplayer()->UnsetName();
|
getDisplayer()->UnsetName();
|
||||||
@ -790,11 +813,11 @@ void EntityGUI_3DSketcherDlg::displayTrihedron(int selMode)
|
|||||||
// Function : displayAngle()
|
// Function : displayAngle()
|
||||||
// Purpose : Method for displaying angle dimensions
|
// Purpose : Method for displaying angle dimensions
|
||||||
//================================================================
|
//================================================================
|
||||||
void EntityGUI_3DSketcherDlg::displayAngle(double theAngle1, double theAngle2, double theLength, int theOrientation)
|
void EntityGUI_3DSketcherDlg::displayAngle(double theAngle1, double theAngle2, double theLength, int theOrientation, bool store)
|
||||||
{
|
{
|
||||||
if(Abs(theAngle2 - 90.0) < Precision::Angular())
|
if(Abs(theAngle2 - 90.0) < Precision::Angular())
|
||||||
return;
|
return;
|
||||||
// Add trihedron to preview
|
|
||||||
SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
|
SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
|
||||||
|
|
||||||
XYZ Last = getLastPoint();
|
XYZ Last = getLastPoint();
|
||||||
@ -839,8 +862,6 @@ void EntityGUI_3DSketcherDlg::displayAngle(double theAngle1, double theAngle2, d
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MESSAGE("REPERE1 : Last x ="<<Last.x<<"y ="<<Last.y<<"z ="<<Last.z)
|
|
||||||
MESSAGE("Current x ="<<Current.x<<"y ="<<Current.y<<"z ="<<Current.z)
|
|
||||||
TopoDS_Vertex V1 = BRepBuilderAPI_MakeVertex(P1);
|
TopoDS_Vertex V1 = BRepBuilderAPI_MakeVertex(P1);
|
||||||
TopoDS_Vertex V2 = BRepBuilderAPI_MakeVertex(P2);
|
TopoDS_Vertex V2 = BRepBuilderAPI_MakeVertex(P2);
|
||||||
TopoDS_Vertex LastV = BRepBuilderAPI_MakeVertex(Last_Pnt);
|
TopoDS_Vertex LastV = BRepBuilderAPI_MakeVertex(Last_Pnt);
|
||||||
@ -871,6 +892,10 @@ void EntityGUI_3DSketcherDlg::displayAngle(double theAngle1, double theAngle2, d
|
|||||||
if (aSPrs)
|
if (aSPrs)
|
||||||
{
|
{
|
||||||
aSPrs->AddObject(anAngleIO);
|
aSPrs->AddObject(anAngleIO);
|
||||||
|
if (store)
|
||||||
|
{
|
||||||
|
myAnglePrs->AddObject(anAngleIO);
|
||||||
|
}
|
||||||
if (twoAngles)
|
if (twoAngles)
|
||||||
{
|
{
|
||||||
gce_MakePln gce_MP2(Last_Pnt, P2, Current_Pnt);
|
gce_MakePln gce_MP2(Last_Pnt, P2, Current_Pnt);
|
||||||
@ -882,7 +907,12 @@ void EntityGUI_3DSketcherDlg::displayAngle(double theAngle1, double theAngle2, d
|
|||||||
anAngle2IO->Attributes()->SetAngleAspect(asp);
|
anAngle2IO->Attributes()->SetAngleAspect(asp);
|
||||||
|
|
||||||
aSPrs->AddObject(anAngle2IO);
|
aSPrs->AddObject(anAngle2IO);
|
||||||
|
if (store)
|
||||||
|
{
|
||||||
|
myAnglePrs->AddObject(anAngle2IO);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (!store)
|
||||||
GEOMBase_Helper::displayPreview( aSPrs, true, true );
|
GEOMBase_Helper::displayPreview( aSPrs, true, true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,7 @@ class QDoubleSpinBox;
|
|||||||
class EntityGUI_3Spin;
|
class EntityGUI_3Spin;
|
||||||
class EntityGUI_Angles;
|
class EntityGUI_Angles;
|
||||||
class DlgRef_3Radio;
|
class DlgRef_3Radio;
|
||||||
|
class SOCC_Prs;
|
||||||
|
|
||||||
#ifndef COORD_MIN
|
#ifndef COORD_MIN
|
||||||
# define COORD_MIN -1e+15
|
# define COORD_MIN -1e+15
|
||||||
@ -80,7 +81,7 @@ private:
|
|||||||
|
|
||||||
void displayTrihedron( int );
|
void displayTrihedron( int );
|
||||||
|
|
||||||
void displayAngle( double, double, double, int );
|
void displayAngle( double, double, double, int, bool store = false );
|
||||||
|
|
||||||
bool createShapes( GEOM::GEOM_Object_ptr,
|
bool createShapes( GEOM::GEOM_Object_ptr,
|
||||||
TopoDS_Shape&,
|
TopoDS_Shape&,
|
||||||
@ -103,6 +104,7 @@ private:
|
|||||||
bool myOK;
|
bool myOK;
|
||||||
double myLineWidth;
|
double myLineWidth;
|
||||||
GeometryGUI* myGeometryGUI;
|
GeometryGUI* myGeometryGUI;
|
||||||
|
SOCC_Prs* myAnglePrs;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void ClickOnOk();
|
void ClickOnOk();
|
||||||
|
Loading…
Reference in New Issue
Block a user