mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-02-24 00:35:36 +05:00
DCQ: New architecture...
This commit is contained in:
parent
e1866186e9
commit
d8cfb81717
@ -71,21 +71,6 @@
|
|||||||
<endsubmenu />
|
<endsubmenu />
|
||||||
<separator pos-id=""/>
|
<separator pos-id=""/>
|
||||||
<popup-item item-id="404" pos-id="" label-id="Sketch" icon-id="sketch.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
<popup-item item-id="404" pos-id="" label-id="Sketch" icon-id="sketch.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||||
<submenu label-id="Sketch Constraints" item-id="405" pos-id="">
|
|
||||||
<popup-item item-id="4051" pos-id="" label-id="Set Plane" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
|
||||||
<separator pos-id=""/>
|
|
||||||
<popup-item item-id="4052" pos-id="" label-id="Tangent" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
|
||||||
<popup-item item-id="4053" pos-id="" label-id="Perpendicular" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
|
||||||
</submenu>
|
|
||||||
<endsubmenu />
|
|
||||||
<submenu label-id="Sketch Options" item-id="406" pos-id="">
|
|
||||||
<popup-item item-id="4061" pos-id="" label-id="Length Dimension" icon-id="" tooltip-id="" accel-id="" toggle-id="true" execute-action=""/>
|
|
||||||
<popup-item item-id="4062" pos-id="" label-id="Angle Dimension" icon-id="" tooltip-id="" accel-id="" toggle-id="true" execute-action=""/>
|
|
||||||
<popup-item item-id="4063" pos-id="" label-id="Radius Dimension" icon-id="" tooltip-id="" accel-id="" toggle-id="true" execute-action=""/>
|
|
||||||
<popup-item item-id="4064" pos-id="" label-id="X Dimension" icon-id="" tooltip-id="" accel-id="" toggle-id="false" execute-action=""/>
|
|
||||||
<popup-item item-id="4065" pos-id="" label-id="Y Dimension" icon-id="" tooltip-id="" accel-id="" toggle-id="false" execute-action=""/>
|
|
||||||
</submenu>
|
|
||||||
<endsubmenu />
|
|
||||||
<separator pos-id=""/>
|
<separator pos-id=""/>
|
||||||
<popup-item item-id="407" pos-id="" label-id="Explode" icon-id="subshape.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
<popup-item item-id="407" pos-id="" label-id="Explode" icon-id="subshape.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||||
<submenu label-id="Build" item-id="408" pos-id="">
|
<submenu label-id="Build" item-id="408" pos-id="">
|
||||||
@ -164,12 +149,11 @@
|
|||||||
<!-- ********************************* Settings (menubar) ********************************* -->
|
<!-- ********************************* Settings (menubar) ********************************* -->
|
||||||
<menu-item label-id="Preferences" item-id="4" pos-id="">
|
<menu-item label-id="Preferences" item-id="4" pos-id="">
|
||||||
<submenu label-id="Geometry" item-id="41" pos-id="-1">
|
<submenu label-id="Geometry" item-id="41" pos-id="-1">
|
||||||
<popup-item item-id="411" pos-id="" label-id="Automatic copy" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
<popup-item item-id="411" pos-id="" label-id="Name/Store automatic" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||||
<popup-item item-id="412" pos-id="" label-id="Name/Store automatic" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
|
||||||
<separator pos-id=""/>
|
<separator pos-id=""/>
|
||||||
<popup-item item-id="413" pos-id="" label-id="Shading Color" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
<popup-item item-id="412" pos-id="" label-id="Shading Color" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||||
<popup-item item-id="414" pos-id="" label-id="Isos" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
<popup-item item-id="413" pos-id="" label-id="Isos" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||||
<popup-item item-id="415" pos-id="" label-id="Step value" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
<popup-item item-id="414" pos-id="" label-id="Step value" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||||
</submenu>
|
</submenu>
|
||||||
<endsubmenu />
|
<endsubmenu />
|
||||||
<separator pos-id="-1"/>
|
<separator pos-id="-1"/>
|
||||||
@ -257,19 +241,5 @@
|
|||||||
<popup-item item-id="901" pos-id="" label-id="Rename" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
<popup-item item-id="901" pos-id="" label-id="Rename" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
||||||
</popupmenu>
|
</popupmenu>
|
||||||
|
|
||||||
<popupmenu label-id="Sketch" context-id="Sketch" parent-id="Viewer" object-id="">
|
|
||||||
<popup-item item-id="4041" pos-id="" label-id="Segment" icon-id="" tooltip-id="" accel-id="" toggle-id="true" execute-action=""/>
|
|
||||||
<popup-item item-id="4042" pos-id="" label-id="Arc" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
|
||||||
<separator pos-id=""/>
|
|
||||||
<popup-item item-id="4043" pos-id="" label-id="Set Angle" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
|
||||||
<popup-item item-id="4044" pos-id="" label-id="Set X" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
|
||||||
<popup-item item-id="4045" pos-id="" label-id="Set Y" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
|
||||||
<separator pos-id=""/>
|
|
||||||
<popup-item item-id="4046" pos-id="" label-id="Undo" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
|
||||||
<separator pos-id=""/>
|
|
||||||
<popup-item item-id="4047" pos-id="" label-id="End" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
|
||||||
<popup-item item-id="4048" pos-id="" label-id="Close" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
|
|
||||||
</popupmenu>
|
|
||||||
|
|
||||||
</desktop> <!-- DESKTOP END -->
|
</desktop> <!-- DESKTOP END -->
|
||||||
</application> <!-- APPLICATION END -->
|
</application> <!-- APPLICATION END -->
|
||||||
|
@ -78,15 +78,15 @@ bool BasicGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
{
|
{
|
||||||
BasicGUI* myBasicGUI = new BasicGUI();
|
BasicGUI* myBasicGUI = new BasicGUI();
|
||||||
myBasicGUI->myGeomGUI->EmitSignalDeactivateDialog();
|
myBasicGUI->myGeomGUI->EmitSignalDeactivateDialog();
|
||||||
SALOME_Selection* Sel = SALOME_Selection::Selection(myBasicGUI->myGeomGUI->GetActiveStudy()->getSelection());
|
SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection());
|
||||||
|
|
||||||
switch (theCommandID)
|
switch (theCommandID)
|
||||||
{
|
{
|
||||||
case 4011: // POINT
|
case 4011: // POINT
|
||||||
{
|
{
|
||||||
Handle(AIS_InteractiveContext) ic;
|
Handle(AIS_InteractiveContext) ic;
|
||||||
if(myBasicGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myBasicGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
ic = v3d->getAISContext();
|
ic = v3d->getAISContext();
|
||||||
}
|
}
|
||||||
BasicGUI_PointDlg *aDlg = new BasicGUI_PointDlg(parent, "", myBasicGUI, Sel, ic);
|
BasicGUI_PointDlg *aDlg = new BasicGUI_PointDlg(parent, "", myBasicGUI, Sel, ic);
|
||||||
@ -145,10 +145,10 @@ bool BasicGUI::OnMousePress(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame
|
|||||||
{
|
{
|
||||||
BasicGUI* myBasicGUI = new BasicGUI();
|
BasicGUI* myBasicGUI = new BasicGUI();
|
||||||
|
|
||||||
if(myBasicGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myBasicGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
OCCViewer_ViewPort* vp = ((OCCViewer_ViewFrame*)studyFrame->getRightFrame()->getViewFrame())->getViewPort();
|
OCCViewer_ViewPort* vp = ((OCCViewer_ViewFrame*)studyFrame->getRightFrame()->getViewFrame())->getViewPort();
|
||||||
|
|
||||||
@ -176,7 +176,7 @@ bool BasicGUI::OnMousePress(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame
|
|||||||
if(DialogPt != 0)
|
if(DialogPt != 0)
|
||||||
DialogPt->PointIntoCoordinates(thePoint, true); /* display point */
|
DialogPt->PointIntoCoordinates(thePoint, true); /* display point */
|
||||||
else
|
else
|
||||||
myBasicGUI->myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -219,7 +219,7 @@ void BasicGUI::MakePointAndDisplay(const double x, const double y, const double
|
|||||||
GEOM::GEOM_Shape_var P = myGeom->MakeVertex(x, y, z);
|
GEOM::GEOM_Shape_var P = myGeom->MakeVertex(x, y, z);
|
||||||
P->NameType(tr("GEOM_VERTEX"));
|
P->NameType(tr("GEOM_VERTEX"));
|
||||||
if (myGeomBase->Display(P))
|
if (myGeomBase->Display(P))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -239,7 +239,7 @@ void BasicGUI::MakeLineAndDisplay(const gp_Pnt InitPoint, const gp_Pnt LastPoint
|
|||||||
myGeomBase->GetBipointDxDyDz(InitPoint, LastPoint, dx, dy, dz);
|
myGeomBase->GetBipointDxDyDz(InitPoint, LastPoint, dx, dy, dz);
|
||||||
Standard_Real length = InitPoint.Distance(LastPoint);
|
Standard_Real length = InitPoint.Distance(LastPoint);
|
||||||
if(length <= Precision::Confusion()) {
|
if(length <= Precision::Confusion()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -262,13 +262,13 @@ void BasicGUI::MakeLineAndDisplay(const gp_Pnt InitPoint, const gp_Pnt LastPoint
|
|||||||
|
|
||||||
GEOM::GEOM_Shape_ptr result = myGeom->MakeLine(pstruct, dstruct);
|
GEOM::GEOM_Shape_ptr result = myGeom->MakeLine(pstruct, dstruct);
|
||||||
if(result->_is_nil()) {
|
if(result->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
result->NameType(tr("GEOM_LINE"));
|
result->NameType(tr("GEOM_LINE"));
|
||||||
|
|
||||||
if(myGeomBase->Display(result))
|
if(myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_READY"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_READY"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -290,12 +290,12 @@ void BasicGUI::MakeCircleAndDisplay(const gp_Pnt CenterPoint, const gp_Dir dir,
|
|||||||
|
|
||||||
GEOM::GEOM_Shape_var result = myGeom->MakeCircle(pstruct, dstruct, Radius);
|
GEOM::GEOM_Shape_var result = myGeom->MakeCircle(pstruct, dstruct, Radius);
|
||||||
if(result->_is_nil()) {
|
if(result->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
result->NameType(tr("GEOM_CIRCLE"));
|
result->NameType(tr("GEOM_CIRCLE"));
|
||||||
if(myGeomBase->Display(result))
|
if(myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -318,12 +318,12 @@ void BasicGUI::MakeEllipseAndDisplay(const gp_Pnt CenterPoint, const gp_Dir dir,
|
|||||||
|
|
||||||
GEOM::GEOM_Shape_var result = myGeom->MakeEllipse(pstruct, dstruct, Major_Radius, Minor_Radius);
|
GEOM::GEOM_Shape_var result = myGeom->MakeEllipse(pstruct, dstruct, Major_Radius, Minor_Radius);
|
||||||
if(result->_is_nil()) {
|
if(result->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
result->NameType(tr("GEOM_ELLIPSE"));
|
result->NameType(tr("GEOM_ELLIPSE"));
|
||||||
if(myGeomBase->Display(result))
|
if(myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -349,12 +349,12 @@ void BasicGUI::MakeArcAndDisplay(gp_Pnt InitPoint, gp_Pnt CirclePoint, gp_Pnt En
|
|||||||
GEOM::PointStruct pE = myGeom->MakePointStruct(EndPoint.X(), EndPoint.Y(), EndPoint.Z());
|
GEOM::PointStruct pE = myGeom->MakePointStruct(EndPoint.X(), EndPoint.Y(), EndPoint.Z());
|
||||||
GEOM::GEOM_Shape_var result = myGeom->MakeArc(pI, pC, pE);
|
GEOM::GEOM_Shape_var result = myGeom->MakeArc(pI, pC, pE);
|
||||||
if(result->_is_nil()) {
|
if(result->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
result->NameType(tr("GEOM_ARC"));
|
result->NameType(tr("GEOM_ARC"));
|
||||||
if (myGeomBase->Display(result))
|
if (myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -375,7 +375,7 @@ void BasicGUI::MakeVectorAndDisplay(const gp_Pnt P1, const gp_Pnt P2)
|
|||||||
GEOM::GEOM_Shape_var Vector = myGeom->MakeVector(pstruct1, pstruct2);
|
GEOM::GEOM_Shape_var Vector = myGeom->MakeVector(pstruct1, pstruct2);
|
||||||
Vector->NameType(tr("GEOM_VECTOR"));
|
Vector->NameType(tr("GEOM_VECTOR"));
|
||||||
if(myGeomBase->Display(Vector))
|
if(myGeomBase->Display(Vector))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -402,7 +402,7 @@ void BasicGUI::MakePlaneAndDisplay(const gp_Pnt P1, const Standard_Real dx, cons
|
|||||||
GEOM::GEOM_Shape_ptr plane = myGeom->MakePlane(pstruct, dstruct, TrimSize);
|
GEOM::GEOM_Shape_ptr plane = myGeom->MakePlane(pstruct, dstruct, TrimSize);
|
||||||
plane->NameType(tr("GEOM_PLANE"));
|
plane->NameType(tr("GEOM_PLANE"));
|
||||||
if(myGeomBase->Display(plane))
|
if(myGeomBase->Display(plane))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -417,16 +417,16 @@ void BasicGUI::MakePlaneAndDisplay(const gp_Pnt P1, const Standard_Real dx, cons
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BasicGUI::MakeWorkingPlane(const gp_Pnt P, const gp_Dir D)
|
void BasicGUI::MakeWorkingPlane(const gp_Pnt P, const gp_Dir D)
|
||||||
{
|
{
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() != VIEW_OCC) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() != VIEW_OCC) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NOT_FOR_VTK_VIEWER"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NOT_FOR_VTK_VIEWER"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
OCCViewer_ViewPort* vp = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewPort();
|
OCCViewer_ViewPort* vp = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewPort();
|
||||||
Handle(V3d_View) view3d = ((OCCViewer_ViewPort3d*)vp)->getView();
|
Handle(V3d_View) view3d = ((OCCViewer_ViewPort3d*)vp)->getView();
|
||||||
view3d->SetAt(P.X(), P.Y(), P.Z());
|
view3d->SetAt(P.X(), P.Y(), P.Z());
|
||||||
view3d->SetProj(D.X(), D.Y(), D.Z());
|
view3d->SetProj(D.X(), D.Y(), D.Z());
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ void BasicGUI_ArcDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void BasicGUI_ArcDlg::ClickOnApply()
|
void BasicGUI_ArcDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
if (mySimulationTopoDs.IsNull())
|
if (mySimulationTopoDs.IsNull())
|
||||||
return;
|
return;
|
||||||
myGeomBase->EraseSimulationShape();
|
myGeomBase->EraseSimulationShape();
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
#include "BasicGUI_CircleDlg.h"
|
#include "BasicGUI_CircleDlg.h"
|
||||||
|
|
||||||
|
#include <gp_Lin.hxx>
|
||||||
|
#include <gp_Circ.hxx>
|
||||||
#include <BRepBuilderAPI_MakeEdge.hxx>
|
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||||
#include <BRepAdaptor_Curve.hxx>
|
#include <BRepAdaptor_Curve.hxx>
|
||||||
#include "QAD_Config.h"
|
#include "QAD_Config.h"
|
||||||
@ -145,7 +147,7 @@ void BasicGUI_CircleDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void BasicGUI_CircleDlg::ClickOnApply()
|
void BasicGUI_CircleDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
if (mySimulationTopoDs.IsNull())
|
if (mySimulationTopoDs.IsNull())
|
||||||
return;
|
return;
|
||||||
myGeomBase->EraseSimulationShape();
|
myGeomBase->EraseSimulationShape();
|
||||||
|
@ -28,11 +28,11 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
#include "BasicGUI_EllipseDlg.h"
|
#include "BasicGUI_EllipseDlg.h"
|
||||||
|
|
||||||
#include "gp_Elips.hxx"
|
#include <gp_Lin.hxx>
|
||||||
#include "QAD_Config.h"
|
#include <gp_Elips.hxx>
|
||||||
|
|
||||||
#include <BRepBuilderAPI_MakeEdge.hxx>
|
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||||
#include <BRepAdaptor_Curve.hxx>
|
#include <BRepAdaptor_Curve.hxx>
|
||||||
|
#include "QAD_Config.h"
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : BasicGUI_EllipseDlg()
|
// class : BasicGUI_EllipseDlg()
|
||||||
@ -153,7 +153,7 @@ void BasicGUI_EllipseDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void BasicGUI_EllipseDlg::ClickOnApply()
|
void BasicGUI_EllipseDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
if (mySimulationTopoDs.IsNull())
|
if (mySimulationTopoDs.IsNull())
|
||||||
return;
|
return;
|
||||||
myGeomBase->EraseSimulationShape();
|
myGeomBase->EraseSimulationShape();
|
||||||
|
@ -135,7 +135,7 @@ void BasicGUI_LineDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void BasicGUI_LineDlg::ClickOnApply()
|
void BasicGUI_LineDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
if (mySimulationTopoDs.IsNull())
|
if (mySimulationTopoDs.IsNull())
|
||||||
return;
|
return;
|
||||||
myGeomBase->EraseSimulationShape();
|
myGeomBase->EraseSimulationShape();
|
||||||
|
@ -273,7 +273,7 @@ void BasicGUI_PlaneDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void BasicGUI_PlaneDlg::ClickOnApply()
|
void BasicGUI_PlaneDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
if (mySimulationTopoDs.IsNull())
|
if (mySimulationTopoDs.IsNull())
|
||||||
return;
|
return;
|
||||||
myGeomBase->EraseSimulationShape();
|
myGeomBase->EraseSimulationShape();
|
||||||
|
@ -37,8 +37,6 @@ using namespace std;
|
|||||||
#include <BRepAlgoAPI.hxx>
|
#include <BRepAlgoAPI.hxx>
|
||||||
#include <Geom_Curve.hxx>
|
#include <Geom_Curve.hxx>
|
||||||
|
|
||||||
#include "QAD_Config.h"
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : BasicGUI_PointDlg()
|
// 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
|
||||||
@ -108,7 +106,7 @@ void BasicGUI_PointDlg::Init(const Handle(AIS_InteractiveContext)& ic)
|
|||||||
myPoint.SetCoord(0.0, 0.0, 0.0);
|
myPoint.SetCoord(0.0, 0.0, 0.0);
|
||||||
myOkEdge = false;
|
myOkEdge = false;
|
||||||
|
|
||||||
myGeomGUI->SetState(POINT_METHOD);
|
myGeomGUI->myState = 0;
|
||||||
|
|
||||||
/* Vertices Filter for all arguments */
|
/* Vertices Filter for all arguments */
|
||||||
myEdgeFilter = new GEOM_ShapeTypeFilter(TopAbs_EDGE, myGeom);
|
myEdgeFilter = new GEOM_ShapeTypeFilter(TopAbs_EDGE, myGeom);
|
||||||
@ -128,9 +126,9 @@ void BasicGUI_PointDlg::Init(const Handle(AIS_InteractiveContext)& ic)
|
|||||||
GroupPoints->SpinBox_DY->SetValue(0.0);
|
GroupPoints->SpinBox_DY->SetValue(0.0);
|
||||||
GroupPoints->SpinBox_DZ->SetValue(0.0);
|
GroupPoints->SpinBox_DZ->SetValue(0.0);
|
||||||
|
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
myLocalContextId = myIC->OpenLocalContext();
|
myLocalContextId = myIC->OpenLocalContext();
|
||||||
myGeomBase->SetDisplayedObjectList();
|
//myGeomBase->SetDisplayedObjectList();
|
||||||
/* sub shapes selection */
|
/* sub shapes selection */
|
||||||
myLocalContextMode = TopAbs_VERTEX;
|
myLocalContextMode = TopAbs_VERTEX;
|
||||||
myIC->ActivateStandardMode(myLocalContextMode);
|
myIC->ActivateStandardMode(myLocalContextMode);
|
||||||
@ -197,9 +195,9 @@ void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
|
|||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
if(myUseLocalContext == false && myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
if(myUseLocalContext == false && QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
myLocalContextId = myIC->OpenLocalContext();
|
myLocalContextId = myIC->OpenLocalContext();
|
||||||
myGeomBase->SetDisplayedObjectList();
|
//myGeomBase->SetDisplayedObjectList();
|
||||||
/* sub shapes selection */
|
/* sub shapes selection */
|
||||||
myLocalContextMode = TopAbs_VERTEX;
|
myLocalContextMode = TopAbs_VERTEX;
|
||||||
myIC->ActivateStandardMode(myLocalContextMode);
|
myIC->ActivateStandardMode(myLocalContextMode);
|
||||||
@ -216,7 +214,7 @@ void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
|
|||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
if(myUseLocalContext == true && myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
if(myUseLocalContext == true && QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
myIC->CloseLocalContext(myLocalContextId);
|
myIC->CloseLocalContext(myLocalContextId);
|
||||||
myUseLocalContext = false;
|
myUseLocalContext = false;
|
||||||
}
|
}
|
||||||
@ -257,14 +255,14 @@ void BasicGUI_PointDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void BasicGUI_PointDlg::ClickOnApply()
|
void BasicGUI_PointDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
if(mySimulationTopoDs.IsNull())
|
if(mySimulationTopoDs.IsNull())
|
||||||
return;
|
return;
|
||||||
myGeomBase->EraseSimulationShape();
|
myGeomBase->EraseSimulationShape();
|
||||||
mySimulationTopoDs.Nullify();
|
mySimulationTopoDs.Nullify();
|
||||||
|
|
||||||
/* Close local context */
|
/* Close local context */
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
myIC->CloseLocalContext(myLocalContextId);
|
myIC->CloseLocalContext(myLocalContextId);
|
||||||
myUseLocalContext = false;
|
myUseLocalContext = false;
|
||||||
}
|
}
|
||||||
@ -279,10 +277,10 @@ void BasicGUI_PointDlg::ClickOnApply()
|
|||||||
double z = GroupPoints->SpinBox_DZ->GetValue();
|
double z = GroupPoints->SpinBox_DZ->GetValue();
|
||||||
|
|
||||||
myBasicGUI->MakePointAndDisplay(x,y,z); /* WARNING : no display if a local context is opened */
|
myBasicGUI->MakePointAndDisplay(x,y,z); /* WARNING : no display if a local context is opened */
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
/* no display if a local context is opened */
|
/* no display if a local context is opened */
|
||||||
myLocalContextId = myIC->OpenLocalContext();
|
myLocalContextId = myIC->OpenLocalContext();
|
||||||
myGeomBase->SetDisplayedObjectList();
|
//myGeomBase->SetDisplayedObjectList();
|
||||||
/* sub shapes selection */
|
/* sub shapes selection */
|
||||||
myLocalContextMode = TopAbs_VERTEX;
|
myLocalContextMode = TopAbs_VERTEX;
|
||||||
myIC->ActivateStandardMode(myLocalContextMode);
|
myIC->ActivateStandardMode(myLocalContextMode);
|
||||||
@ -309,8 +307,8 @@ void BasicGUI_PointDlg::ClickOnApply()
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BasicGUI_PointDlg::ClickOnCancel()
|
void BasicGUI_PointDlg::ClickOnCancel()
|
||||||
{
|
{
|
||||||
if(myConstructorId == 0 && myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
if(myConstructorId == 0 && QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
myIC = v3d->getAISContext();
|
myIC = v3d->getAISContext();
|
||||||
if(myIC->HasOpenedContext()) {
|
if(myIC->HasOpenedContext()) {
|
||||||
myIC->CloseLocalContext(myLocalContextId);
|
myIC->CloseLocalContext(myLocalContextId);
|
||||||
@ -318,6 +316,7 @@ void BasicGUI_PointDlg::ClickOnCancel()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
myGeomGUI->myState = -1;
|
||||||
GEOMBase_Skeleton::ClickOnCancel();
|
GEOMBase_Skeleton::ClickOnCancel();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -426,12 +425,12 @@ void BasicGUI_PointDlg::ActivateThisDialog( )
|
|||||||
GEOMBase_Skeleton::ActivateThisDialog();
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
|
||||||
myGeomGUI->SetState(POINT_METHOD);
|
myGeomGUI->myState = 0;
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
myIC = v3d->getAISContext();
|
myIC = v3d->getAISContext();
|
||||||
myLocalContextId = myIC->OpenLocalContext();
|
myLocalContextId = myIC->OpenLocalContext();
|
||||||
myGeomBase->SetDisplayedObjectList();
|
//myGeomBase->SetDisplayedObjectList();
|
||||||
/* sub shapes selection */
|
/* sub shapes selection */
|
||||||
myLocalContextMode = TopAbs_VERTEX;
|
myLocalContextMode = TopAbs_VERTEX;
|
||||||
myIC->ActivateStandardMode(myLocalContextMode);
|
myIC->ActivateStandardMode(myLocalContextMode);
|
||||||
@ -453,10 +452,11 @@ void BasicGUI_PointDlg::ActivateThisDialog( )
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void BasicGUI_PointDlg::DeactivateActiveDialog()
|
void BasicGUI_PointDlg::DeactivateActiveDialog()
|
||||||
{
|
{
|
||||||
if(myConstructorId == 0 && myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
if(myConstructorId == 0 && QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
myIC->CloseLocalContext(myLocalContextId);
|
myIC->CloseLocalContext(myLocalContextId);
|
||||||
myUseLocalContext = false;
|
myUseLocalContext = false;
|
||||||
}
|
}
|
||||||
|
myGeomGUI->myState = -1;
|
||||||
GEOMBase_Skeleton::DeactivateActiveDialog();
|
GEOMBase_Skeleton::DeactivateActiveDialog();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -237,7 +237,7 @@ void BasicGUI_VectorDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void BasicGUI_VectorDlg::ClickOnApply()
|
void BasicGUI_VectorDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
if (mySimulationTopoDs.IsNull())
|
if (mySimulationTopoDs.IsNull())
|
||||||
return;
|
return;
|
||||||
myGeomBase->EraseSimulationShape();
|
myGeomBase->EraseSimulationShape();
|
||||||
|
@ -127,7 +127,7 @@ void BasicGUI_WorkingPlaneDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void BasicGUI_WorkingPlaneDlg::ClickOnApply()
|
void BasicGUI_WorkingPlaneDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
if(myOkPlane)
|
if(myOkPlane)
|
||||||
myBasicGUI->MakeWorkingPlane(myLoc, myDir);
|
myBasicGUI->MakeWorkingPlane(myLoc, myDir);
|
||||||
|
|
||||||
|
@ -61,21 +61,15 @@ LIB_MOC = \
|
|||||||
BasicGUI_PlaneDlg.h \
|
BasicGUI_PlaneDlg.h \
|
||||||
BasicGUI_WorkingPlaneDlg.h
|
BasicGUI_WorkingPlaneDlg.h
|
||||||
|
|
||||||
LIB_CLIENT_IDL = SALOME_Exception.idl \
|
LIB_CLIENT_IDL =
|
||||||
GEOM_Gen.idl \
|
|
||||||
GEOM_Shape.idl \
|
|
||||||
SALOMEDS.idl \
|
|
||||||
SALOMEDS_Attributes.idl \
|
|
||||||
SALOME_ModuleCatalog.idl \
|
|
||||||
SALOME_Component.idl \
|
|
||||||
|
|
||||||
LIB_SERVER_IDL =
|
LIB_SERVER_IDL =
|
||||||
|
|
||||||
# additionnal information to compil and link file
|
# additionnal information to compil and link file
|
||||||
|
|
||||||
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
||||||
CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
|
CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
|
||||||
|
|
||||||
LDFLAGS += -lOCCViewer -lVTKViewer -lSalomeObject -lSalomeGUI -lGEOMClient -lGEOMObject -lGEOMFiltersSelection -lDlgRef -lGEOMContext -lGEOMBase -L${KERNEL_ROOT_DIR}/lib/salome
|
LDFLAGS += -lGEOMFiltersSelection -lGEOMBase
|
||||||
|
|
||||||
@CONCLUDE@
|
@CONCLUDE@
|
||||||
|
@ -66,7 +66,7 @@ bool BooleanGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
{
|
{
|
||||||
BooleanGUI* myBooleanGUI = new BooleanGUI();
|
BooleanGUI* myBooleanGUI = new BooleanGUI();
|
||||||
myBooleanGUI->myGeomGUI->EmitSignalDeactivateDialog();
|
myBooleanGUI->myGeomGUI->EmitSignalDeactivateDialog();
|
||||||
SALOME_Selection* Sel = SALOME_Selection::Selection(myBooleanGUI->myGeomGUI->GetActiveStudy()->getSelection());
|
SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection());
|
||||||
|
|
||||||
switch (theCommandID)
|
switch (theCommandID)
|
||||||
{
|
{
|
||||||
@ -109,7 +109,7 @@ void BooleanGUI::MakeBooleanAndDisplay(GEOM::GEOM_Shape_ptr Shape1, GEOM::GEOM_S
|
|||||||
try {
|
try {
|
||||||
GEOM::GEOM_Shape_ptr result = myGeom->MakeBoolean(Shape1, Shape2, operation);
|
GEOM::GEOM_Shape_ptr result = myGeom->MakeBoolean(Shape1, Shape2, operation);
|
||||||
if(result->_is_nil()) {
|
if(result->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ void BooleanGUI::MakeBooleanAndDisplay(GEOM::GEOM_Shape_ptr Shape1, GEOM::GEOM_S
|
|||||||
result->NameType(type);
|
result->NameType(type);
|
||||||
|
|
||||||
if (myGeomBase->Display(result))
|
if (myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch (const SALOME::SALOME_Exception& S_ex) {
|
catch (const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
|
@ -128,7 +128,7 @@ void BooleanGUI_CommonDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void BooleanGUI_CommonDlg::ClickOnApply()
|
void BooleanGUI_CommonDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
|
|
||||||
if(myOkShape1 && myOkShape2)
|
if(myOkShape1 && myOkShape2)
|
||||||
myBooleanGUI->MakeBooleanAndDisplay(myGeomShape1 ,myGeomShape2, 1);
|
myBooleanGUI->MakeBooleanAndDisplay(myGeomShape1 ,myGeomShape2, 1);
|
||||||
|
@ -127,7 +127,7 @@ void BooleanGUI_CutDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void BooleanGUI_CutDlg::ClickOnApply()
|
void BooleanGUI_CutDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
|
|
||||||
if(myOkShape1 && myOkShape2)
|
if(myOkShape1 && myOkShape2)
|
||||||
myBooleanGUI->MakeBooleanAndDisplay(myGeomShape1 ,myGeomShape2, 2);
|
myBooleanGUI->MakeBooleanAndDisplay(myGeomShape1 ,myGeomShape2, 2);
|
||||||
|
@ -127,7 +127,7 @@ void BooleanGUI_FuseDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void BooleanGUI_FuseDlg::ClickOnApply()
|
void BooleanGUI_FuseDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
|
|
||||||
if(myOkShape1 && myOkShape2)
|
if(myOkShape1 && myOkShape2)
|
||||||
myBooleanGUI->MakeBooleanAndDisplay(myGeomShape1 ,myGeomShape2, 3);
|
myBooleanGUI->MakeBooleanAndDisplay(myGeomShape1 ,myGeomShape2, 3);
|
||||||
|
@ -128,7 +128,7 @@ void BooleanGUI_SectionDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void BooleanGUI_SectionDlg::ClickOnApply()
|
void BooleanGUI_SectionDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
|
|
||||||
if(myOkShape1 && myOkShape2)
|
if(myOkShape1 && myOkShape2)
|
||||||
myBooleanGUI->MakeBooleanAndDisplay(myGeomShape1 ,myGeomShape2, 4);
|
myBooleanGUI->MakeBooleanAndDisplay(myGeomShape1 ,myGeomShape2, 4);
|
||||||
|
@ -53,21 +53,15 @@ LIB_MOC = \
|
|||||||
BooleanGUI_CutDlg.h \
|
BooleanGUI_CutDlg.h \
|
||||||
BooleanGUI_SectionDlg.h
|
BooleanGUI_SectionDlg.h
|
||||||
|
|
||||||
LIB_CLIENT_IDL = SALOME_Exception.idl \
|
LIB_CLIENT_IDL =
|
||||||
GEOM_Gen.idl \
|
|
||||||
GEOM_Shape.idl \
|
|
||||||
SALOMEDS.idl \
|
|
||||||
SALOMEDS_Attributes.idl \
|
|
||||||
SALOME_ModuleCatalog.idl \
|
|
||||||
SALOME_Component.idl \
|
|
||||||
|
|
||||||
LIB_SERVER_IDL =
|
LIB_SERVER_IDL =
|
||||||
|
|
||||||
# additionnal information to compil and link file
|
# additionnal information to compil and link file
|
||||||
|
|
||||||
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
||||||
CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
|
CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
|
||||||
|
|
||||||
LDFLAGS += -lOCCViewer -lVTKViewer -lSalomeObject -lSalomeGUI -lGEOMClient -lGEOMObject -lDlgRef -lGEOMContext -lGEOMBase -L${KERNEL_ROOT_DIR}/lib/salome
|
LDFLAGS += -lGEOMBase
|
||||||
|
|
||||||
@CONCLUDE@
|
@CONCLUDE@
|
||||||
|
@ -80,15 +80,15 @@ bool BuildGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
{
|
{
|
||||||
BuildGUI* myBuildGUI = new BuildGUI();
|
BuildGUI* myBuildGUI = new BuildGUI();
|
||||||
myBuildGUI->myGeomGUI->EmitSignalDeactivateDialog();
|
myBuildGUI->myGeomGUI->EmitSignalDeactivateDialog();
|
||||||
SALOME_Selection* Sel = SALOME_Selection::Selection(myBuildGUI->myGeomGUI->GetActiveStudy()->getSelection());
|
SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection());
|
||||||
|
|
||||||
switch (theCommandID)
|
switch (theCommandID)
|
||||||
{
|
{
|
||||||
case 407: // EXPLODE : use ic
|
case 407: // EXPLODE : use ic
|
||||||
{
|
{
|
||||||
Handle(AIS_InteractiveContext) ic;
|
Handle(AIS_InteractiveContext) ic;
|
||||||
if(myBuildGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myBuildGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
ic = v3d->getAISContext();
|
ic = v3d->getAISContext();
|
||||||
}
|
}
|
||||||
BuildGUI_SubShapeDlg *aDlg = new BuildGUI_SubShapeDlg(parent, "", myBuildGUI, Sel, ic);
|
BuildGUI_SubShapeDlg *aDlg = new BuildGUI_SubShapeDlg(parent, "", myBuildGUI, Sel, ic);
|
||||||
@ -145,12 +145,12 @@ void BuildGUI::MakeLinearEdgeAndDisplay(const gp_Pnt P1, const gp_Pnt P2)
|
|||||||
GEOM::PointStruct ps2 = myGeom->MakePointStruct(P2.X(), P2.Y(), P2.Z());
|
GEOM::PointStruct ps2 = myGeom->MakePointStruct(P2.X(), P2.Y(), P2.Z());
|
||||||
GEOM::GEOM_Shape_var result = myGeom->MakeEdge(ps1, ps2);
|
GEOM::GEOM_Shape_var result = myGeom->MakeEdge(ps1, ps2);
|
||||||
if(result->_is_nil()) {
|
if(result->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
result->NameType(tr("GEOM_EDGE"));
|
result->NameType(tr("GEOM_EDGE"));
|
||||||
if(myGeomBase->Display(result))
|
if(myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -168,12 +168,12 @@ void BuildGUI::MakeWireAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR)
|
|||||||
try {
|
try {
|
||||||
GEOM::GEOM_Shape_var result = myGeom->MakeWire(listShapesIOR);
|
GEOM::GEOM_Shape_var result = myGeom->MakeWire(listShapesIOR);
|
||||||
if(result->_is_nil()) {
|
if(result->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
result->NameType(tr("GEOM_WIRE"));
|
result->NameType(tr("GEOM_WIRE"));
|
||||||
if(myGeomBase->Display(result))
|
if(myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -191,7 +191,7 @@ void BuildGUI::MakeFaceAndDisplay(GEOM::GEOM_Shape_ptr aWire, const Standard_Boo
|
|||||||
try {
|
try {
|
||||||
GEOM::GEOM_Shape_var result = myGeom->MakeFace(aWire, wantPlanar);
|
GEOM::GEOM_Shape_var result = myGeom->MakeFace(aWire, wantPlanar);
|
||||||
if(result->_is_nil()) {
|
if(result->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (wantPlanar)
|
if (wantPlanar)
|
||||||
@ -199,7 +199,7 @@ void BuildGUI::MakeFaceAndDisplay(GEOM::GEOM_Shape_ptr aWire, const Standard_Boo
|
|||||||
else
|
else
|
||||||
result->NameType(tr("GEOM_FACE"));
|
result->NameType(tr("GEOM_FACE"));
|
||||||
if(myGeomBase->Display(result))
|
if(myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -217,12 +217,12 @@ void BuildGUI::MakeShellAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR)
|
|||||||
try {
|
try {
|
||||||
GEOM::GEOM_Shape_var result = myGeom->MakeShell(listShapesIOR);
|
GEOM::GEOM_Shape_var result = myGeom->MakeShell(listShapesIOR);
|
||||||
if(result->_is_nil()) {
|
if(result->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
result->NameType(tr("GEOM_SHELL"));
|
result->NameType(tr("GEOM_SHELL"));
|
||||||
if(myGeomBase->Display(result))
|
if(myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -240,12 +240,12 @@ void BuildGUI::MakeSolidAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR)
|
|||||||
try {
|
try {
|
||||||
GEOM::GEOM_Shape_var result = myGeom->MakeSolid(listShapesIOR);
|
GEOM::GEOM_Shape_var result = myGeom->MakeSolid(listShapesIOR);
|
||||||
if(result->_is_nil()) {
|
if(result->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
result->NameType(tr("GEOM_SOLID"));
|
result->NameType(tr("GEOM_SOLID"));
|
||||||
if(myGeomBase->Display(result))
|
if(myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -263,12 +263,12 @@ void BuildGUI::MakeCompoundAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR)
|
|||||||
try {
|
try {
|
||||||
GEOM::GEOM_Shape_var result = myGeom->MakeCompound(listShapesIOR);
|
GEOM::GEOM_Shape_var result = myGeom->MakeCompound(listShapesIOR);
|
||||||
if(result->_is_nil()) {
|
if(result->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
result->NameType(tr("GEOM_COMPOUND"));
|
result->NameType(tr("GEOM_COMPOUND"));
|
||||||
if(myGeomBase->Display(result))
|
if(myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -285,7 +285,7 @@ void BuildGUI::MakeCompoundAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR)
|
|||||||
//=====================================================================================
|
//=====================================================================================
|
||||||
bool BuildGUI::SObjectExist(SALOMEDS::SObject_ptr theFatherObject, const char* IOR)
|
bool BuildGUI::SObjectExist(SALOMEDS::SObject_ptr theFatherObject, const char* IOR)
|
||||||
{
|
{
|
||||||
SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
|
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
|
||||||
SALOMEDS::ChildIterator_var it = aStudy->NewChildIterator(theFatherObject);
|
SALOMEDS::ChildIterator_var it = aStudy->NewChildIterator(theFatherObject);
|
||||||
SALOMEDS::SObject_var RefSO;
|
SALOMEDS::SObject_var RefSO;
|
||||||
SALOMEDS::GenericAttribute_var anAttr;
|
SALOMEDS::GenericAttribute_var anAttr;
|
||||||
@ -315,15 +315,15 @@ bool BuildGUI::SObjectExist(SALOMEDS::SObject_ptr theFatherObject, const char* I
|
|||||||
//=====================================================================================
|
//=====================================================================================
|
||||||
bool BuildGUI::OnSubShapeGetAll(const TopoDS_Shape& ShapeTopo, const char* ShapeTopoIOR, const int SubShapeType)
|
bool BuildGUI::OnSubShapeGetAll(const TopoDS_Shape& ShapeTopo, const char* ShapeTopoIOR, const int SubShapeType)
|
||||||
{
|
{
|
||||||
SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
|
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
|
||||||
SALOMEDS::SObject_var theObj = aStudy->FindObjectIOR(ShapeTopoIOR);
|
SALOMEDS::SObject_var theObj = aStudy->FindObjectIOR(ShapeTopoIOR);
|
||||||
if(theObj->_is_nil()) {
|
if(theObj->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
|
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
|
||||||
SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->entry());
|
SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->entry());
|
||||||
SALOMEDS::GenericAttribute_var anAttr;
|
SALOMEDS::GenericAttribute_var anAttr;
|
||||||
SALOMEDS::AttributeName_var aName;
|
SALOMEDS::AttributeName_var aName;
|
||||||
SALOMEDS::AttributeIOR_var anIOR;
|
SALOMEDS::AttributeIOR_var anIOR;
|
||||||
@ -338,7 +338,7 @@ bool BuildGUI::OnSubShapeGetAll(const TopoDS_Shape& ShapeTopo, const char* Shape
|
|||||||
try {
|
try {
|
||||||
listGeomShapes = myGeom->SubShapeAll(aShape, SubShapeType);
|
listGeomShapes = myGeom->SubShapeAll(aShape, SubShapeType);
|
||||||
if(listGeomShapes->length() < 1) {
|
if(listGeomShapes->length() < 1) {
|
||||||
myGeomGUI->GetDesktop()->putInfo (tr("GEOM_PRP_ABORT"));
|
QAD_Application::getDesktop()->putInfo (tr("GEOM_PRP_ABORT"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -347,7 +347,7 @@ bool BuildGUI::OnSubShapeGetAll(const TopoDS_Shape& ShapeTopo, const char* Shape
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* open transaction */
|
/* open transaction */
|
||||||
QAD_Operation* op = new SALOMEGUI_ImportOperation(myGeomGUI->GetActiveStudy());
|
QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy());
|
||||||
op->start();
|
op->start();
|
||||||
|
|
||||||
TopoDS_Shape mainTopo = myGeomGUI->GetShapeReader().GetShape(myGeom, aShape);
|
TopoDS_Shape mainTopo = myGeomGUI->GetShapeReader().GetShape(myGeom, aShape);
|
||||||
@ -370,7 +370,7 @@ bool BuildGUI::OnSubShapeGetAll(const TopoDS_Shape& ShapeTopo, const char* Shape
|
|||||||
TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, aResult);
|
TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, aResult);
|
||||||
|
|
||||||
if (S.IsNull()) {
|
if (S.IsNull()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo (tr("GEOM_PRP_ABORT"));
|
QAD_Application::getDesktop()->putInfo (tr("GEOM_PRP_ABORT"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -389,8 +389,8 @@ bool BuildGUI::OnSubShapeGetAll(const TopoDS_Shape& ShapeTopo, const char* Shape
|
|||||||
|
|
||||||
bool allreadyexist = false;
|
bool allreadyexist = false;
|
||||||
|
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
|
|
||||||
Handle(GEOM_AISShape) result = new GEOM_AISShape(S, nameG);
|
Handle(GEOM_AISShape) result = new GEOM_AISShape(S, nameG);
|
||||||
@ -451,11 +451,11 @@ bool BuildGUI::OnSubShapeGetAll(const TopoDS_Shape& ShapeTopo, const char* Shape
|
|||||||
ic->Display(result);
|
ic->Display(result);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
|
else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
|
||||||
VTKViewer_RenderWindowInteractor* myRenderInter= ((VTKViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
|
VTKViewer_RenderWindowInteractor* myRenderInter= ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
|
||||||
|
|
||||||
int themode = myRenderInter->GetDisplayMode();
|
int themode = myRenderInter->GetDisplayMode();
|
||||||
vtkRenderer *theRenderer = ((VTKViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer();
|
vtkRenderer *theRenderer = ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer();
|
||||||
vtkRenderWindow *renWin = theRenderer->GetRenderWindow();
|
vtkRenderWindow *renWin = theRenderer->GetRenderWindow();
|
||||||
|
|
||||||
Handle(GEOM_InteractiveObject) IO = new GEOM_InteractiveObject(aResult->Name(), myGeomGUI->GetFatherior(), "GEOM");
|
Handle(GEOM_InteractiveObject) IO = new GEOM_InteractiveObject(aResult->Name(), myGeomGUI->GetFatherior(), "GEOM");
|
||||||
@ -520,8 +520,8 @@ bool BuildGUI::OnSubShapeGetAll(const TopoDS_Shape& ShapeTopo, const char* Shape
|
|||||||
/* commit transaction */
|
/* commit transaction */
|
||||||
op->finish();
|
op->finish();
|
||||||
|
|
||||||
myGeomGUI->GetActiveStudy()->updateObjBrowser();
|
QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser();
|
||||||
myGeomGUI->GetDesktop()->putInfo (tr("GEOM_PRP_READY"));
|
QAD_Application::getDesktop()->putInfo (tr("GEOM_PRP_READY"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -533,17 +533,17 @@ bool BuildGUI::OnSubShapeGetAll(const TopoDS_Shape& ShapeTopo, const char* Shape
|
|||||||
bool BuildGUI::OnSubShapeGetSelected(const TopoDS_Shape& ShapeTopo, const char* ShapeTopoIOR, const int SubShapeType, Standard_Integer& aLocalContextId, bool& myUseLocalContext)
|
bool BuildGUI::OnSubShapeGetSelected(const TopoDS_Shape& ShapeTopo, const char* ShapeTopoIOR, const int SubShapeType, Standard_Integer& aLocalContextId, bool& myUseLocalContext)
|
||||||
{
|
{
|
||||||
//* Test the type of viewer */
|
//* Test the type of viewer */
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
|
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
|
||||||
SALOMEDS::SObject_var theObj = aStudy->FindObjectIOR(ShapeTopoIOR);
|
SALOMEDS::SObject_var theObj = aStudy->FindObjectIOR(ShapeTopoIOR);
|
||||||
if(theObj->_is_nil()) {
|
if(theObj->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
|
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
|
|
||||||
if( myUseLocalContext == false ) {
|
if( myUseLocalContext == false ) {
|
||||||
@ -639,11 +639,11 @@ bool BuildGUI::OnSubShapeGetSelected(const TopoDS_Shape& ShapeTopo, const char*
|
|||||||
SALOMEDS::SObject_var SO = aStudy->FindObjectIOR(aResult->Name());
|
SALOMEDS::SObject_var SO = aStudy->FindObjectIOR(aResult->Name());
|
||||||
|
|
||||||
/* open transaction */
|
/* open transaction */
|
||||||
QAD_Operation* op = new SALOMEGUI_ImportOperation(myGeomGUI->GetActiveStudy());
|
QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy());
|
||||||
op->start();
|
op->start();
|
||||||
|
|
||||||
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
|
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
|
||||||
SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->entry());
|
SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->entry());
|
||||||
SALOMEDS::GenericAttribute_var anAttr;
|
SALOMEDS::GenericAttribute_var anAttr;
|
||||||
SALOMEDS::AttributeName_var aName;
|
SALOMEDS::AttributeName_var aName;
|
||||||
SALOMEDS::AttributeIOR_var anIOR;
|
SALOMEDS::AttributeIOR_var anIOR;
|
||||||
@ -708,8 +708,8 @@ bool BuildGUI::OnSubShapeGetSelected(const TopoDS_Shape& ShapeTopo, const char*
|
|||||||
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
||||||
myDisplayGUI->OnDisplayAll(true);
|
myDisplayGUI->OnDisplayAll(true);
|
||||||
|
|
||||||
myGeomGUI->GetActiveStudy()->updateObjBrowser();
|
QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser();
|
||||||
myGeomGUI->GetDesktop()->putInfo (tr("GEOM_PRP_READY"));
|
QAD_Application::getDesktop()->putInfo (tr("GEOM_PRP_READY"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#define BUILDGUI_H
|
#define BUILDGUI_H
|
||||||
|
|
||||||
#include "GEOMBase.h"
|
#include "GEOMBase.h"
|
||||||
|
#include <gp_Pnt.hxx>
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : BuildGUI
|
// class : BuildGUI
|
||||||
|
@ -116,7 +116,7 @@ void BuildGUI_CompoundDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void BuildGUI_CompoundDlg::ClickOnApply()
|
void BuildGUI_CompoundDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
if(myOkListShapes)
|
if(myOkListShapes)
|
||||||
myBuildGUI->MakeCompoundAndDisplay(myListShapes);
|
myBuildGUI->MakeCompoundAndDisplay(myListShapes);
|
||||||
return;
|
return;
|
||||||
|
@ -134,7 +134,7 @@ void BuildGUI_EdgeDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void BuildGUI_EdgeDlg::ClickOnApply()
|
void BuildGUI_EdgeDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
if (mySimulationTopoDs.IsNull())
|
if (mySimulationTopoDs.IsNull())
|
||||||
return;
|
return;
|
||||||
myGeomBase->EraseSimulationShape();
|
myGeomBase->EraseSimulationShape();
|
||||||
|
@ -123,7 +123,7 @@ void BuildGUI_FaceDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void BuildGUI_FaceDlg::ClickOnApply()
|
void BuildGUI_FaceDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
if(myOkShape)
|
if(myOkShape)
|
||||||
myBuildGUI->MakeFaceAndDisplay(myGeomShape, GroupPoints->CheckButton1->isChecked());
|
myBuildGUI->MakeFaceAndDisplay(myGeomShape, GroupPoints->CheckButton1->isChecked());
|
||||||
return;
|
return;
|
||||||
|
@ -125,7 +125,7 @@ void BuildGUI_ShellDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void BuildGUI_ShellDlg::ClickOnApply()
|
void BuildGUI_ShellDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
|
|
||||||
if(myOkListShapes)
|
if(myOkListShapes)
|
||||||
myBuildGUI->MakeShellAndDisplay(myListShapes);
|
myBuildGUI->MakeShellAndDisplay(myListShapes);
|
||||||
|
@ -124,7 +124,7 @@ void BuildGUI_SolidDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void BuildGUI_SolidDlg::ClickOnApply()
|
void BuildGUI_SolidDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
|
|
||||||
if(myOkListShapes)
|
if(myOkListShapes)
|
||||||
myBuildGUI->MakeSolidAndDisplay(myListShapes);
|
myBuildGUI->MakeSolidAndDisplay(myListShapes);
|
||||||
|
@ -34,6 +34,7 @@ using namespace std;
|
|||||||
#include "OCCViewer_Viewer3d.h"
|
#include "OCCViewer_Viewer3d.h"
|
||||||
|
|
||||||
#include <TopExp_Explorer.hxx>
|
#include <TopExp_Explorer.hxx>
|
||||||
|
#include <TopTools_MapOfShape.hxx>
|
||||||
|
|
||||||
#include <qmessagebox.h>
|
#include <qmessagebox.h>
|
||||||
|
|
||||||
@ -112,7 +113,7 @@ void BuildGUI_SubShapeDlg::Init(Handle(AIS_InteractiveContext) ic)
|
|||||||
myShapeType = GroupPoints->ComboBox1->currentItem();
|
myShapeType = GroupPoints->ComboBox1->currentItem();
|
||||||
myOkSelectSubMode = GroupPoints->CheckButton1->isChecked();
|
myOkSelectSubMode = GroupPoints->CheckButton1->isChecked();
|
||||||
|
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() != VIEW_OCC)
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() != VIEW_OCC)
|
||||||
GroupPoints->CheckButton1->setEnabled(false);
|
GroupPoints->CheckButton1->setEnabled(false);
|
||||||
|
|
||||||
/* signals and slots connections */
|
/* signals and slots connections */
|
||||||
@ -163,7 +164,7 @@ void BuildGUI_SubShapeDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void BuildGUI_SubShapeDlg::ClickOnApply()
|
void BuildGUI_SubShapeDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
bool testResult = false;
|
bool testResult = false;
|
||||||
myAbort = false; /* Not aborted by default */
|
myAbort = false; /* Not aborted by default */
|
||||||
|
|
||||||
@ -190,11 +191,11 @@ void BuildGUI_SubShapeDlg::ClickOnApply()
|
|||||||
testResult = myBuildGUI->OnSubShapeGetSelected(myShape, myShapeIOR, myShapeType, myLocalContextId, myUseLocalContext);
|
testResult = myBuildGUI->OnSubShapeGetSelected(myShape, myShapeIOR, myShapeType, myLocalContextId, myUseLocalContext);
|
||||||
|
|
||||||
if(!testResult) {
|
if(!testResult) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
myAbort = true;
|
myAbort = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
|
|
||||||
/* Reset all arguments and local context to allow user a new selection ...*/
|
/* Reset all arguments and local context to allow user a new selection ...*/
|
||||||
this->ResetStateOfDialog();
|
this->ResetStateOfDialog();
|
||||||
@ -208,8 +209,8 @@ void BuildGUI_SubShapeDlg::ClickOnApply()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void BuildGUI_SubShapeDlg::ClickOnCancel()
|
void BuildGUI_SubShapeDlg::ClickOnCancel()
|
||||||
{
|
{
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
myIC = v3d->getAISContext();
|
myIC = v3d->getAISContext();
|
||||||
if(myUseLocalContext) {
|
if(myUseLocalContext) {
|
||||||
myIC->CloseLocalContext(myLocalContextId);
|
myIC->CloseLocalContext(myLocalContextId);
|
||||||
@ -247,7 +248,7 @@ void BuildGUI_SubShapeDlg::SelectionIntoArgument()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if(!IO->hasEntry()) {
|
if(!IO->hasEntry()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -260,7 +261,7 @@ void BuildGUI_SubShapeDlg::SelectionIntoArgument()
|
|||||||
myOkShape = true;
|
myOkShape = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
|
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
|
||||||
SALOMEDS::SObject_var obj = aStudy->FindObjectID(IO->getEntry());
|
SALOMEDS::SObject_var obj = aStudy->FindObjectID(IO->getEntry());
|
||||||
SALOMEDS::GenericAttribute_var anAttr;
|
SALOMEDS::GenericAttribute_var anAttr;
|
||||||
SALOMEDS::AttributeIOR_var anIOR;
|
SALOMEDS::AttributeIOR_var anIOR;
|
||||||
@ -382,7 +383,7 @@ void BuildGUI_SubShapeDlg::ActivateThisDialog()
|
|||||||
{
|
{
|
||||||
GEOMBase_Skeleton::ActivateThisDialog();
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC)
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC)
|
||||||
GroupPoints->CheckButton1->setEnabled(true);
|
GroupPoints->CheckButton1->setEnabled(true);
|
||||||
else
|
else
|
||||||
GroupPoints->CheckButton1->setEnabled(false);
|
GroupPoints->CheckButton1->setEnabled(false);
|
||||||
@ -452,8 +453,8 @@ void BuildGUI_SubShapeDlg::ResetStateOfDialog()
|
|||||||
GroupPoints->CheckButton1->setChecked(FALSE);
|
GroupPoints->CheckButton1->setChecked(FALSE);
|
||||||
|
|
||||||
/* Close its local contact if opened */
|
/* Close its local contact if opened */
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
myIC = v3d->getAISContext();
|
myIC = v3d->getAISContext();
|
||||||
if(myUseLocalContext) {
|
if(myUseLocalContext) {
|
||||||
myIC->CloseLocalContext(myLocalContextId);
|
myIC->CloseLocalContext(myLocalContextId);
|
||||||
@ -476,7 +477,7 @@ void BuildGUI_SubShapeDlg::AllOrNotAll()
|
|||||||
/* No sub shape selection if main shape not selected */
|
/* No sub shape selection if main shape not selected */
|
||||||
if(!myOkShape) {
|
if(!myOkShape) {
|
||||||
this->ResetStateOfDialog();
|
this->ResetStateOfDialog();
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SELECT_FIRST"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SELECT_FIRST"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -486,14 +487,14 @@ void BuildGUI_SubShapeDlg::AllOrNotAll()
|
|||||||
GroupPoints->CheckButton1->setChecked( FALSE );
|
GroupPoints->CheckButton1->setChecked( FALSE );
|
||||||
//no meaning to allow user selection for type = shape
|
//no meaning to allow user selection for type = shape
|
||||||
//TODO - add another message
|
//TODO - add another message
|
||||||
//myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SELECT_FIRST")) ;
|
//QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SELECT_FIRST")) ;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
myOkSelectSubMode = GroupPoints->CheckButton1->isChecked();
|
myOkSelectSubMode = GroupPoints->CheckButton1->isChecked();
|
||||||
|
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
myIC = v3d->getAISContext();
|
myIC = v3d->getAISContext();
|
||||||
|
|
||||||
if(myUseLocalContext) {
|
if(myUseLocalContext) {
|
||||||
@ -504,7 +505,7 @@ void BuildGUI_SubShapeDlg::AllOrNotAll()
|
|||||||
myDisplayGUI->OnDisplayAll(true);
|
myDisplayGUI->OnDisplayAll(true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NOT_FOR_VTK_VIEWER"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NOT_FOR_VTK_VIEWER"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -513,7 +514,7 @@ void BuildGUI_SubShapeDlg::AllOrNotAll()
|
|||||||
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
||||||
myDisplayGUI->PrepareSubShapeSelection(myShapeType, myLocalContextId);
|
myDisplayGUI->PrepareSubShapeSelection(myShapeType, myLocalContextId);
|
||||||
myUseLocalContext = true;
|
myUseLocalContext = true;
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SELECT_FACE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SELECT_FACE"));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -534,8 +535,8 @@ void BuildGUI_SubShapeDlg::ComboTextChanged()
|
|||||||
GroupPoints->CheckButton1->setChecked(FALSE);
|
GroupPoints->CheckButton1->setChecked(FALSE);
|
||||||
myOkSelectSubMode = FALSE;
|
myOkSelectSubMode = FALSE;
|
||||||
|
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
myIC = v3d->getAISContext();
|
myIC = v3d->getAISContext();
|
||||||
|
|
||||||
if(myUseLocalContext) {
|
if(myUseLocalContext) {
|
||||||
|
@ -116,7 +116,7 @@ void BuildGUI_WireDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void BuildGUI_WireDlg::ClickOnApply()
|
void BuildGUI_WireDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
if(myOkListShapes)
|
if(myOkListShapes)
|
||||||
myBuildGUI->MakeWireAndDisplay(myListShapes);
|
myBuildGUI->MakeWireAndDisplay(myListShapes);
|
||||||
return;
|
return;
|
||||||
|
@ -59,21 +59,15 @@ LIB_MOC = \
|
|||||||
BuildGUI_SolidDlg.h \
|
BuildGUI_SolidDlg.h \
|
||||||
BuildGUI_CompoundDlg.h
|
BuildGUI_CompoundDlg.h
|
||||||
|
|
||||||
LIB_CLIENT_IDL = SALOME_Exception.idl \
|
LIB_CLIENT_IDL =
|
||||||
GEOM_Gen.idl \
|
|
||||||
GEOM_Shape.idl \
|
|
||||||
SALOMEDS.idl \
|
|
||||||
SALOMEDS_Attributes.idl \
|
|
||||||
SALOME_ModuleCatalog.idl \
|
|
||||||
SALOME_Component.idl \
|
|
||||||
|
|
||||||
LIB_SERVER_IDL =
|
LIB_SERVER_IDL =
|
||||||
|
|
||||||
# additionnal information to compil and link file
|
# additionnal information to compil and link file
|
||||||
|
|
||||||
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
||||||
CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
|
CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
|
||||||
|
|
||||||
LDFLAGS += -lOCCViewer -lVTKViewer -lSalomeObject -lSalomeGUI -lGEOMClient -lGEOMObject -lGEOMFiltersSelection -lDlgRef -lGEOMContext -lGEOMBase -lDisplayGUI -L${KERNEL_ROOT_DIR}/lib/salome
|
LDFLAGS += -lGEOMFiltersSelection -lDisplayGUI
|
||||||
|
|
||||||
@CONCLUDE@
|
@CONCLUDE@
|
||||||
|
@ -73,27 +73,27 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
{
|
{
|
||||||
case 211: // MENU VIEW - WIREFRAME/SHADING
|
case 211: // MENU VIEW - WIREFRAME/SHADING
|
||||||
{
|
{
|
||||||
if(myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
|
||||||
QApplication::setOverrideCursor(waitCursor);
|
QApplication::setOverrideCursor(waitCursor);
|
||||||
|
|
||||||
VTKViewer_RenderWindowInteractor* myRenderInter= ((VTKViewer_ViewFrame*)myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
|
VTKViewer_RenderWindowInteractor* myRenderInter= ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
|
||||||
|
|
||||||
int themode = myRenderInter->GetDisplayMode();
|
int themode = myRenderInter->GetDisplayMode();
|
||||||
if(themode==0) {
|
if(themode==0) {
|
||||||
myRenderInter->SetDisplayMode(1);
|
myRenderInter->SetDisplayMode(1);
|
||||||
myDisplayGUI->myGeomGUI->GetDesktop()->menuBar()->changeItem(211, tr("GEOM_MEN_WIREFRAME"));
|
QAD_Application::getDesktop()->menuBar()->changeItem(211, tr("GEOM_MEN_WIREFRAME"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
myRenderInter->SetDisplayMode(0);
|
myRenderInter->SetDisplayMode(0);
|
||||||
myDisplayGUI->myGeomGUI->GetDesktop()->menuBar()->changeItem(211, tr("GEOM_MEN_SHADING"));
|
QAD_Application::getDesktop()->menuBar()->changeItem(211, tr("GEOM_MEN_SHADING"));
|
||||||
}
|
}
|
||||||
|
|
||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
}
|
}
|
||||||
else if(myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
QApplication::setOverrideCursor(Qt::waitCursor);
|
QApplication::setOverrideCursor(Qt::waitCursor);
|
||||||
|
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
|
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
AIS_DisplayMode mode = (AIS_DisplayMode)ic->DisplayMode();
|
AIS_DisplayMode mode = (AIS_DisplayMode)ic->DisplayMode();
|
||||||
AIS_DisplayMode newmode = (mode == AIS_WireFrame ? AIS_Shaded : AIS_WireFrame);
|
AIS_DisplayMode newmode = (mode == AIS_WireFrame ? AIS_Shaded : AIS_WireFrame);
|
||||||
@ -115,9 +115,9 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
|
|
||||||
ic->SetDisplayMode(newmode, Standard_False);
|
ic->SetDisplayMode(newmode, Standard_False);
|
||||||
if(newmode == 1)
|
if(newmode == 1)
|
||||||
myDisplayGUI->myGeomGUI->GetDesktop()->menuBar()->changeItem(211, tr("GEOM_MEN_WIREFRAME"));
|
QAD_Application::getDesktop()->menuBar()->changeItem(211, tr("GEOM_MEN_WIREFRAME"));
|
||||||
else
|
else
|
||||||
myDisplayGUI->myGeomGUI->GetDesktop()->menuBar()->changeItem(211, tr("GEOM_MEN_SHADING"));
|
QAD_Application::getDesktop()->menuBar()->changeItem(211, tr("GEOM_MEN_SHADING"));
|
||||||
|
|
||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
}
|
}
|
||||||
@ -125,26 +125,26 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
}
|
}
|
||||||
case 212: // MENU VIEW - DISPLAY ALL
|
case 212: // MENU VIEW - DISPLAY ALL
|
||||||
{
|
{
|
||||||
if(myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK)
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK)
|
||||||
((VTKViewer_ViewFrame*)myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor()->DisplayAll();
|
((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor()->DisplayAll();
|
||||||
else if(myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC)
|
else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC)
|
||||||
myDisplayGUI->OnDisplayAll();
|
myDisplayGUI->OnDisplayAll();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 213: // MENU VIEW - DISPLAY ONLY
|
case 213: // MENU VIEW - DISPLAY ONLY
|
||||||
{
|
{
|
||||||
if(myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK)
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK)
|
||||||
myDisplayGUI->OnVTKDisplayOnly();
|
myDisplayGUI->OnVTKDisplayOnly();
|
||||||
else if(myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC)
|
else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC)
|
||||||
myDisplayGUI->OnDisplayOnly();
|
myDisplayGUI->OnDisplayOnly();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 214: // MENU VIEW - ERASE ALL
|
case 214: // MENU VIEW - ERASE ALL
|
||||||
{
|
{
|
||||||
if(myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK)
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK)
|
||||||
((VTKViewer_ViewFrame*)myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor()->EraseAll();
|
((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor()->EraseAll();
|
||||||
else if(myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
|
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
|
|
||||||
ic->EraseAll(Standard_True, Standard_False);
|
ic->EraseAll(Standard_True, Standard_False);
|
||||||
@ -159,11 +159,11 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
}
|
}
|
||||||
case 8031: // POPUP VIEWER - WIREFRAME/SHADING
|
case 8031: // POPUP VIEWER - WIREFRAME/SHADING
|
||||||
{
|
{
|
||||||
if(myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
|
||||||
// VTK
|
// VTK
|
||||||
VTKViewer_RenderWindowInteractor* myRenderInter = ((VTKViewer_ViewFrame*)myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
|
VTKViewer_RenderWindowInteractor* myRenderInter = ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
|
||||||
|
|
||||||
SALOME_Selection* Sel = SALOME_Selection::Selection(myDisplayGUI->myGeomGUI->GetActiveStudy()->getSelection());
|
SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection());
|
||||||
SALOME_ListIteratorOfListIO It(Sel->StoredIObjects());
|
SALOME_ListIteratorOfListIO It(Sel->StoredIObjects());
|
||||||
|
|
||||||
QApplication::setOverrideCursor(Qt::waitCursor);
|
QApplication::setOverrideCursor(Qt::waitCursor);
|
||||||
@ -174,10 +174,10 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
myRenderInter->Render();
|
myRenderInter->Render();
|
||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
}
|
}
|
||||||
else if(myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
QApplication::setOverrideCursor(Qt::waitCursor);
|
QApplication::setOverrideCursor(Qt::waitCursor);
|
||||||
SALOME_Selection* Sel = SALOME_Selection::Selection(myDisplayGUI->myGeomGUI->GetActiveStudy()->getSelection());
|
SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection());
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
|
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
SALOME_ListIteratorOfListIO It(Sel->StoredIObjects());
|
SALOME_ListIteratorOfListIO It(Sel->StoredIObjects());
|
||||||
for(;It.More();It.Next()) {
|
for(;It.More();It.Next()) {
|
||||||
@ -217,19 +217,19 @@ void DisplayGUI::BuildPresentation(const Handle(SALOME_InteractiveObject)& theIO
|
|||||||
{
|
{
|
||||||
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
||||||
|
|
||||||
SALOMEDS::Study_var aStudy = myDisplayGUI->myGeomGUI->GetActiveStudy()->getStudyDocument();
|
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
|
||||||
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
|
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
|
||||||
|
|
||||||
OCCViewer_Viewer3d* v3d;
|
OCCViewer_Viewer3d* v3d;
|
||||||
Handle(AIS_InteractiveContext) ic;
|
Handle(AIS_InteractiveContext) ic;
|
||||||
vtkRenderer* Renderer;
|
vtkRenderer* Renderer;
|
||||||
|
|
||||||
if(myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
v3d = ((OCCViewer_ViewFrame*)myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
ic = v3d->getAISContext();
|
ic = v3d->getAISContext();
|
||||||
}
|
}
|
||||||
else if(myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
|
else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
|
||||||
Renderer = ((VTKViewer_ViewFrame*)myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer();
|
Renderer = ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
@ -237,14 +237,14 @@ void DisplayGUI::BuildPresentation(const Handle(SALOME_InteractiveObject)& theIO
|
|||||||
if(theIO.IsNull())
|
if(theIO.IsNull())
|
||||||
MESSAGE("BuildPresentation(): null SALOME_InteractiveObject passed")
|
MESSAGE("BuildPresentation(): null SALOME_InteractiveObject passed")
|
||||||
|
|
||||||
if(myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
|
||||||
// VTK
|
// VTK
|
||||||
|
|
||||||
SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->entry());
|
SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->entry());
|
||||||
|
|
||||||
SALOMEDS::SObject_var obj = aStudy->FindObjectID(theIO->getEntry());
|
SALOMEDS::SObject_var obj = aStudy->FindObjectID(theIO->getEntry());
|
||||||
|
|
||||||
VTKViewer_RenderWindowInteractor* myRenderInter = ((VTKViewer_ViewFrame*)myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
|
VTKViewer_RenderWindowInteractor* myRenderInter = ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
|
||||||
|
|
||||||
SALOMEDS::GenericAttribute_var anAttr;
|
SALOMEDS::GenericAttribute_var anAttr;
|
||||||
SALOMEDS::AttributeName_var aName;
|
SALOMEDS::AttributeName_var aName;
|
||||||
@ -260,7 +260,7 @@ void DisplayGUI::BuildPresentation(const Handle(SALOME_InteractiveObject)& theIO
|
|||||||
// this SObject may be GEOM module root SObject
|
// this SObject may be GEOM module root SObject
|
||||||
|
|
||||||
bool useSubItems = false;
|
bool useSubItems = false;
|
||||||
SALOMEDS::ChildIterator_var anIter = myDisplayGUI->myGeomGUI->GetActiveStudy()->getStudyDocument()->NewChildIterator(obj);
|
SALOMEDS::ChildIterator_var anIter = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument()->NewChildIterator(obj);
|
||||||
if(myDisplayGUI->myGeom->GetIORFromString(SALOMEDS::AttributeIOR::_narrow(anAttr)->Value())->_is_nil()) {
|
if(myDisplayGUI->myGeom->GetIORFromString(SALOMEDS::AttributeIOR::_narrow(anAttr)->Value())->_is_nil()) {
|
||||||
while (anIter->More() && !useSubItems) {
|
while (anIter->More() && !useSubItems) {
|
||||||
SALOMEDS::SObject_var subobj = anIter->Value();
|
SALOMEDS::SObject_var subobj = anIter->Value();
|
||||||
@ -287,7 +287,7 @@ void DisplayGUI::BuildPresentation(const Handle(SALOME_InteractiveObject)& theIO
|
|||||||
if(obj->FindAttribute(anAttr, "AttributeName")) {
|
if(obj->FindAttribute(anAttr, "AttributeName")) {
|
||||||
aName = SALOMEDS::AttributeName::_narrow(anAttr);
|
aName = SALOMEDS::AttributeName::_narrow(anAttr);
|
||||||
|
|
||||||
vtkRenderer* theRenderer = ((VTKViewer_ViewFrame*)myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer();
|
vtkRenderer* theRenderer = ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer();
|
||||||
vtkActorCollection* theAllActors = theRenderer->GetActors();
|
vtkActorCollection* theAllActors = theRenderer->GetActors();
|
||||||
theAllActors->InitTraversal();
|
theAllActors->InitTraversal();
|
||||||
vtkActor* actor = (vtkActor*)theAllActors->GetNextActor();
|
vtkActor* actor = (vtkActor*)theAllActors->GetNextActor();
|
||||||
@ -309,7 +309,7 @@ void DisplayGUI::BuildPresentation(const Handle(SALOME_InteractiveObject)& theIO
|
|||||||
}
|
}
|
||||||
if(!isDisplayed) {
|
if(!isDisplayed) {
|
||||||
// open transaction
|
// open transaction
|
||||||
QAD_Operation* op = new SALOMEGUI_ImportOperation( myDisplayGUI->myGeomGUI->GetActiveStudy() );
|
QAD_Operation* op = new SALOMEGUI_ImportOperation( QAD_Application::getDesktop()->getActiveStudy() );
|
||||||
op->start();
|
op->start();
|
||||||
|
|
||||||
SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(fatherSF);
|
SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(fatherSF);
|
||||||
@ -360,10 +360,10 @@ void DisplayGUI::BuildPresentation(const Handle(SALOME_InteractiveObject)& theIO
|
|||||||
}
|
}
|
||||||
// No viewer update should be done here!
|
// No viewer update should be done here!
|
||||||
//myRenderInter->Render();
|
//myRenderInter->Render();
|
||||||
//myDisplayGUI->myGeomGUI->GetActiveStudy()->updateObjBrowser( true );
|
//QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser( true );
|
||||||
}
|
}
|
||||||
else if(myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->entry());
|
SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->entry());
|
||||||
SALOMEDS::GenericAttribute_var anAttr;
|
SALOMEDS::GenericAttribute_var anAttr;
|
||||||
SALOMEDS::AttributeName_var aName;
|
SALOMEDS::AttributeName_var aName;
|
||||||
SALOMEDS::AttributeIOR_var anIOR;
|
SALOMEDS::AttributeIOR_var anIOR;
|
||||||
@ -386,7 +386,7 @@ void DisplayGUI::BuildPresentation(const Handle(SALOME_InteractiveObject)& theIO
|
|||||||
// this SObject may be GEOM module root SObject
|
// this SObject may be GEOM module root SObject
|
||||||
|
|
||||||
bool useSubItems = false;
|
bool useSubItems = false;
|
||||||
SALOMEDS::ChildIterator_var anIter = myDisplayGUI->myGeomGUI->GetActiveStudy()->getStudyDocument()->NewChildIterator(obj);
|
SALOMEDS::ChildIterator_var anIter = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument()->NewChildIterator(obj);
|
||||||
if(myDisplayGUI->myGeom->GetIORFromString(SALOMEDS::AttributeIOR::_narrow(anAttr)->Value())->_is_nil()) {
|
if(myDisplayGUI->myGeom->GetIORFromString(SALOMEDS::AttributeIOR::_narrow(anAttr)->Value())->_is_nil()) {
|
||||||
while(anIter->More() && !useSubItems) {
|
while(anIter->More() && !useSubItems) {
|
||||||
SALOMEDS::SObject_var subobj = anIter->Value();
|
SALOMEDS::SObject_var subobj = anIter->Value();
|
||||||
@ -434,7 +434,7 @@ void DisplayGUI::BuildPresentation(const Handle(SALOME_InteractiveObject)& theIO
|
|||||||
else {
|
else {
|
||||||
if(!useSubItems) {
|
if(!useSubItems) {
|
||||||
// open transaction
|
// open transaction
|
||||||
QAD_Operation* op = new SALOMEGUI_ImportOperation( myDisplayGUI->myGeomGUI->GetActiveStudy() );
|
QAD_Operation* op = new SALOMEGUI_ImportOperation( QAD_Application::getDesktop()->getActiveStudy() );
|
||||||
op->start();
|
op->start();
|
||||||
if (fatherSF->_is_nil())
|
if (fatherSF->_is_nil())
|
||||||
MESSAGE("BuildPresentation(): fatherSF is nil!")
|
MESSAGE("BuildPresentation(): fatherSF is nil!")
|
||||||
@ -444,7 +444,7 @@ void DisplayGUI::BuildPresentation(const Handle(SALOME_InteractiveObject)& theIO
|
|||||||
op->finish();
|
op->finish();
|
||||||
}
|
}
|
||||||
Handle(GEOM_AISShape) aSh = new GEOM_AISShape(Shape, aName->Value());
|
Handle(GEOM_AISShape) aSh = new GEOM_AISShape(Shape, aName->Value());
|
||||||
aSh->SetShadingColor(myDisplayGUI->myGeomGUI->GetShadingColor());
|
aSh->SetShadingColor(myDisplayGUI->myGeomBase->myShadingColor);
|
||||||
Handle(GEOM_InteractiveObject) IO = new GEOM_InteractiveObject(anIOR->Value(), myDisplayGUI->myGeomGUI->GetFatherior(), "GEOM");
|
Handle(GEOM_InteractiveObject) IO = new GEOM_InteractiveObject(anIOR->Value(), myDisplayGUI->myGeomGUI->GetFatherior(), "GEOM");
|
||||||
IO->setEntry(obj->GetID());
|
IO->setEntry(obj->GetID());
|
||||||
aSh->setIO(IO);
|
aSh->setIO(IO);
|
||||||
@ -476,7 +476,7 @@ void DisplayGUI::BuildPresentation(const Handle(SALOME_InteractiveObject)& theIO
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// No viewer update should be done here!
|
// No viewer update should be done here!
|
||||||
//myDisplayGUI->myGeomGUI->GetActiveStudy()->updateObjBrowser( true );
|
//QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser( true );
|
||||||
//ic->UpdateCurrentViewer();
|
//ic->UpdateCurrentViewer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -488,10 +488,10 @@ void DisplayGUI::BuildPresentation(const Handle(SALOME_InteractiveObject)& theIO
|
|||||||
//=====================================================================================
|
//=====================================================================================
|
||||||
void DisplayGUI::OnDisplayAll(bool onlyPreviousDisplayedObject)
|
void DisplayGUI::OnDisplayAll(bool onlyPreviousDisplayedObject)
|
||||||
{
|
{
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
Handle (AIS_InteractiveContext) myContext = v3d->getAISContext();
|
Handle (AIS_InteractiveContext) myContext = v3d->getAISContext();
|
||||||
|
|
||||||
myContext->Display(v3d->getTrihedron());
|
myContext->Display(v3d->getTrihedron());
|
||||||
@ -514,7 +514,9 @@ void DisplayGUI::OnDisplayAll(bool onlyPreviousDisplayedObject)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
AIS_ListIteratorOfListOfInteractive ite(myGeomGUI->GetListDisplayedObject());
|
AIS_ListOfInteractive aListDisplayedObject;
|
||||||
|
myContext->DisplayedObjects(aListDisplayedObject);
|
||||||
|
AIS_ListIteratorOfListOfInteractive ite(aListDisplayedObject);
|
||||||
while(ite.More()) {
|
while(ite.More()) {
|
||||||
if(ite.Value()->IsInstance(STANDARD_TYPE(GEOM_AISShape))) {
|
if(ite.Value()->IsInstance(STANDARD_TYPE(GEOM_AISShape))) {
|
||||||
Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast(ite.Value());
|
Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast(ite.Value());
|
||||||
@ -541,7 +543,7 @@ void DisplayGUI::OnVTKDisplayOnly()
|
|||||||
QApplication::setOverrideCursor(Qt::waitCursor);
|
QApplication::setOverrideCursor(Qt::waitCursor);
|
||||||
|
|
||||||
// Erase all not selected actors
|
// Erase all not selected actors
|
||||||
vtkRenderer* aren = ((VTKViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer();
|
vtkRenderer* aren = ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer();
|
||||||
vtkActorCollection* theActors = aren->GetActors();
|
vtkActorCollection* theActors = aren->GetActors();
|
||||||
theActors->InitTraversal();
|
theActors->InitTraversal();
|
||||||
vtkActor *ac = theActors->GetNextActor();
|
vtkActor *ac = theActors->GetNextActor();
|
||||||
@ -555,21 +557,21 @@ void DisplayGUI::OnVTKDisplayOnly()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Display selection
|
// Display selection
|
||||||
SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
|
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
|
||||||
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
|
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
|
||||||
SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->entry());
|
SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->entry());
|
||||||
SALOMEDS::GenericAttribute_var anAttr;
|
SALOMEDS::GenericAttribute_var anAttr;
|
||||||
SALOMEDS::AttributeName_var aName;
|
SALOMEDS::AttributeName_var aName;
|
||||||
SALOMEDS::AttributeIOR_var anIOR;
|
SALOMEDS::AttributeIOR_var anIOR;
|
||||||
|
|
||||||
SALOME_Selection* Sel = SALOME_Selection::Selection(myGeomGUI->GetActiveStudy()->getSelection());
|
SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection());
|
||||||
SALOME_ListIteratorOfListIO It(Sel->StoredIObjects());
|
SALOME_ListIteratorOfListIO It(Sel->StoredIObjects());
|
||||||
|
|
||||||
for(;It.More();It.Next()) {
|
for(;It.More();It.Next()) {
|
||||||
Handle(SALOME_InteractiveObject) IObject = It.Value();
|
Handle(SALOME_InteractiveObject) IObject = It.Value();
|
||||||
SALOMEDS::SObject_var obj = aStudy->FindObjectID( IObject->getEntry() );
|
SALOMEDS::SObject_var obj = aStudy->FindObjectID( IObject->getEntry() );
|
||||||
|
|
||||||
VTKViewer_RenderWindowInteractor* myRenderInter = ((VTKViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
|
VTKViewer_RenderWindowInteractor* myRenderInter = ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
|
||||||
|
|
||||||
if(myRenderInter->isInViewer(IObject)) {
|
if(myRenderInter->isInViewer(IObject)) {
|
||||||
myRenderInter->Display(IObject);
|
myRenderInter->Display(IObject);
|
||||||
@ -580,7 +582,7 @@ void DisplayGUI::OnVTKDisplayOnly()
|
|||||||
if(!obj->FindAttribute(anAttr, "AttributeIOR"))
|
if(!obj->FindAttribute(anAttr, "AttributeIOR"))
|
||||||
break;
|
break;
|
||||||
// If selected object contains displayable subobjects, then do nothing
|
// If selected object contains displayable subobjects, then do nothing
|
||||||
SALOMEDS::ChildIterator_var anIter = myGeomGUI->GetActiveStudy()->getStudyDocument()->NewChildIterator(obj);
|
SALOMEDS::ChildIterator_var anIter = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument()->NewChildIterator(obj);
|
||||||
SALOMEDS::GenericAttribute_var aTmpAttr;
|
SALOMEDS::GenericAttribute_var aTmpAttr;
|
||||||
|
|
||||||
anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
|
anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
|
||||||
@ -591,7 +593,7 @@ void DisplayGUI::OnVTKDisplayOnly()
|
|||||||
if(obj->FindAttribute(anAttr, "AttributeName")) {
|
if(obj->FindAttribute(anAttr, "AttributeName")) {
|
||||||
aName = SALOMEDS::AttributeName::_narrow(anAttr);
|
aName = SALOMEDS::AttributeName::_narrow(anAttr);
|
||||||
// open transaction
|
// open transaction
|
||||||
QAD_Operation* op = new SALOMEGUI_ImportOperation(myGeomGUI->GetActiveStudy());
|
QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy());
|
||||||
op->start();
|
op->start();
|
||||||
|
|
||||||
SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(fatherSF);
|
SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(fatherSF);
|
||||||
@ -599,7 +601,7 @@ void DisplayGUI::OnVTKDisplayOnly()
|
|||||||
// commit transaction
|
// commit transaction
|
||||||
op->finish();
|
op->finish();
|
||||||
|
|
||||||
vtkRenderer* theRenderer = ((VTKViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer();
|
vtkRenderer* theRenderer = ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer();
|
||||||
int themode = myRenderInter->GetDisplayMode();
|
int themode = myRenderInter->GetDisplayMode();
|
||||||
vtkActorCollection* theActors = GEOM_AssemblyBuilder::BuildActors(Shape, 0, themode, Standard_True);
|
vtkActorCollection* theActors = GEOM_AssemblyBuilder::BuildActors(Shape, 0, themode, Standard_True);
|
||||||
theActors->InitTraversal();
|
theActors->InitTraversal();
|
||||||
@ -610,7 +612,7 @@ void DisplayGUI::OnVTKDisplayOnly()
|
|||||||
GActor->setName(IObject->getName());
|
GActor->setName(IObject->getName());
|
||||||
|
|
||||||
theRenderer->AddActor(GActor);
|
theRenderer->AddActor(GActor);
|
||||||
vtkRenderWindow *renWin = ((VTKViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer()->GetRenderWindow();
|
vtkRenderWindow *renWin = ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer()->GetRenderWindow();
|
||||||
renWin->Render();
|
renWin->Render();
|
||||||
anActor = (vtkActor*)theActors->GetNextActor();
|
anActor = (vtkActor*)theActors->GetNextActor();
|
||||||
}
|
}
|
||||||
@ -618,7 +620,7 @@ void DisplayGUI::OnVTKDisplayOnly()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
myGeomGUI->GetActiveStudy()->updateObjBrowser(true);
|
QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser(true);
|
||||||
|
|
||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
return;
|
return;
|
||||||
@ -631,11 +633,11 @@ void DisplayGUI::OnVTKDisplayOnly()
|
|||||||
//=====================================================================================
|
//=====================================================================================
|
||||||
void DisplayGUI::OnDisplayOnly()
|
void DisplayGUI::OnDisplayOnly()
|
||||||
{
|
{
|
||||||
if (myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
if (QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
|
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
|
||||||
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
|
|
||||||
AIS_ListOfInteractive List;
|
AIS_ListOfInteractive List;
|
||||||
@ -652,14 +654,14 @@ void DisplayGUI::OnDisplayOnly()
|
|||||||
}
|
}
|
||||||
|
|
||||||
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
|
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
|
||||||
SALOME_Selection* Sel = SALOME_Selection::Selection(myGeomGUI->GetActiveStudy()->getSelection());
|
SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection());
|
||||||
|
|
||||||
SALOME_ListIteratorOfListIO It1(Sel->StoredIObjects());
|
SALOME_ListIteratorOfListIO It1(Sel->StoredIObjects());
|
||||||
for(;It1.More();It1.Next()) {
|
for(;It1.More();It1.Next()) {
|
||||||
Handle(SALOME_InteractiveObject) IObject = It1.Value();
|
Handle(SALOME_InteractiveObject) IObject = It1.Value();
|
||||||
|
|
||||||
SALOMEDS::SObject_var fatherSF =
|
SALOMEDS::SObject_var fatherSF =
|
||||||
aStudy->FindObjectID(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->entry());
|
aStudy->FindObjectID(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->entry());
|
||||||
if(v3d->isInViewer(IObject, true)) {
|
if(v3d->isInViewer(IObject, true)) {
|
||||||
AIS_ListOfInteractive List1;
|
AIS_ListOfInteractive List1;
|
||||||
ic->ObjectsInCollector(List1);
|
ic->ObjectsInCollector(List1);
|
||||||
@ -697,7 +699,7 @@ void DisplayGUI::OnDisplayOnly()
|
|||||||
if(obj->FindAttribute(anAttr, "AttributeName")) {
|
if(obj->FindAttribute(anAttr, "AttributeName")) {
|
||||||
aName = SALOMEDS::AttributeName::_narrow(anAttr);
|
aName = SALOMEDS::AttributeName::_narrow(anAttr);
|
||||||
// open transaction
|
// open transaction
|
||||||
QAD_Operation* op = new SALOMEGUI_ImportOperation(myGeomGUI->GetActiveStudy());
|
QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy());
|
||||||
op->start();
|
op->start();
|
||||||
|
|
||||||
SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(fatherSF);
|
SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(fatherSF);
|
||||||
@ -728,15 +730,15 @@ void DisplayGUI::OnDisplayOnly()
|
|||||||
//=====================================================================================
|
//=====================================================================================
|
||||||
void DisplayGUI::OnErase()
|
void DisplayGUI::OnErase()
|
||||||
{
|
{
|
||||||
SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
|
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
|
||||||
SALOME_Selection* Sel = SALOME_Selection::Selection(myGeomGUI->GetActiveStudy()->getSelection());
|
SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection());
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
|
||||||
// VTK
|
// VTK
|
||||||
SALOME_ListIteratorOfListIO It(Sel->StoredIObjects());
|
SALOME_ListIteratorOfListIO It(Sel->StoredIObjects());
|
||||||
Handle(SALOME_InteractiveObject) anIObject;
|
Handle(SALOME_InteractiveObject) anIObject;
|
||||||
for(;It.More();It.Next()) {
|
for(;It.More();It.Next()) {
|
||||||
anIObject = It.Value();
|
anIObject = It.Value();
|
||||||
VTKViewer_RenderWindowInteractor* myRenderInter= ((VTKViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
|
VTKViewer_RenderWindowInteractor* myRenderInter= ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
|
||||||
|
|
||||||
if(myRenderInter->isInViewer(anIObject)) {
|
if(myRenderInter->isInViewer(anIObject)) {
|
||||||
myRenderInter->Erase(anIObject);
|
myRenderInter->Erase(anIObject);
|
||||||
@ -748,7 +750,7 @@ void DisplayGUI::OnErase()
|
|||||||
if(!obj->_is_nil()) {
|
if(!obj->_is_nil()) {
|
||||||
if(obj->FindAttribute(anAttr, "AttributeIOR")) {
|
if(obj->FindAttribute(anAttr, "AttributeIOR")) {
|
||||||
// this SObject may be GEOM module root SObject
|
// this SObject may be GEOM module root SObject
|
||||||
SALOMEDS::ChildIterator_var anIter = myGeomGUI->GetActiveStudy()->getStudyDocument()->NewChildIterator(obj);
|
SALOMEDS::ChildIterator_var anIter = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument()->NewChildIterator(obj);
|
||||||
bool useSubItems = false;
|
bool useSubItems = false;
|
||||||
while(anIter->More() && !useSubItems) {
|
while(anIter->More() && !useSubItems) {
|
||||||
SALOMEDS::SObject_var subobj = anIter->Value();
|
SALOMEDS::SObject_var subobj = anIter->Value();
|
||||||
@ -768,7 +770,7 @@ void DisplayGUI::OnErase()
|
|||||||
TopoDS_Shape Shape = myGeomGUI->GetShapeReader().GetShape(myGeom, aShape);
|
TopoDS_Shape Shape = myGeomGUI->GetShapeReader().GetShape(myGeom, aShape);
|
||||||
if(obj->FindAttribute(anAttr, "AttributeName")) {
|
if(obj->FindAttribute(anAttr, "AttributeName")) {
|
||||||
// searchin for already displayed objects with the same shape
|
// searchin for already displayed objects with the same shape
|
||||||
vtkRenderer* theRenderer = ((VTKViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer();
|
vtkRenderer* theRenderer = ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer();
|
||||||
vtkActorCollection* theAllActors = theRenderer->GetActors();
|
vtkActorCollection* theAllActors = theRenderer->GetActors();
|
||||||
theAllActors->InitTraversal();
|
theAllActors->InitTraversal();
|
||||||
vtkActor* actor = (vtkActor*)theAllActors->GetNextActor();
|
vtkActor* actor = (vtkActor*)theAllActors->GetNextActor();
|
||||||
@ -812,9 +814,9 @@ void DisplayGUI::OnErase()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
// OCC
|
// OCC
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
SALOME_ListIteratorOfListIO It(Sel->StoredIObjects());
|
SALOME_ListIteratorOfListIO It(Sel->StoredIObjects());
|
||||||
Handle(SALOME_InteractiveObject) anIObject;
|
Handle(SALOME_InteractiveObject) anIObject;
|
||||||
@ -835,7 +837,7 @@ void DisplayGUI::OnErase()
|
|||||||
if(!obj->_is_nil()) {
|
if(!obj->_is_nil()) {
|
||||||
if(obj->FindAttribute(anAttr, "AttributeIOR")) {
|
if(obj->FindAttribute(anAttr, "AttributeIOR")) {
|
||||||
// this SObject may be GEOM module root SObject
|
// this SObject may be GEOM module root SObject
|
||||||
SALOMEDS::ChildIterator_var anIter = myGeomGUI->GetActiveStudy()->getStudyDocument()->NewChildIterator(obj);
|
SALOMEDS::ChildIterator_var anIter = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument()->NewChildIterator(obj);
|
||||||
bool useSubItems = false;
|
bool useSubItems = false;
|
||||||
while(anIter->More() && !useSubItems) {
|
while(anIter->More() && !useSubItems) {
|
||||||
SALOMEDS::SObject_var subobj = anIter->Value();
|
SALOMEDS::SObject_var subobj = anIter->Value();
|
||||||
@ -905,18 +907,18 @@ void DisplayGUI::OnErase()
|
|||||||
bool DisplayGUI::PrepareSubShapeSelection(const int SubShapeType, Standard_Integer& returnLocalContextId)
|
bool DisplayGUI::PrepareSubShapeSelection(const int SubShapeType, Standard_Integer& returnLocalContextId)
|
||||||
{
|
{
|
||||||
//* Test the type of viewer */
|
//* Test the type of viewer */
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
|
|
||||||
/* local context opening */
|
/* local context opening */
|
||||||
myGeomBase->SetDisplayedObjectList();
|
//myGeomBase->SetDisplayedObjectList();
|
||||||
this->OnDisplayOnly();
|
this->OnDisplayOnly();
|
||||||
|
|
||||||
returnLocalContextId = ic->OpenLocalContext(Standard_False, Standard_True, Standard_False, Standard_False);
|
returnLocalContextId = ic->OpenLocalContext(Standard_False, Standard_True, Standard_False, Standard_False);
|
||||||
SALOME_Selection* Sel = SALOME_Selection::Selection(myGeomGUI->GetActiveStudy()->getSelection());
|
SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection());
|
||||||
SALOME_ListIteratorOfListIO It(Sel->StoredIObjects());
|
SALOME_ListIteratorOfListIO It(Sel->StoredIObjects());
|
||||||
for(;It.More();It.Next()) {
|
for(;It.More();It.Next()) {
|
||||||
Handle(SALOME_InteractiveObject) IObject = It.Value();
|
Handle(SALOME_InteractiveObject) IObject = It.Value();
|
||||||
@ -927,7 +929,7 @@ bool DisplayGUI::PrepareSubShapeSelection(const int SubShapeType, Standard_Integ
|
|||||||
ic->HilightWithColor(Shape, Quantity_NOC_RED);
|
ic->HilightWithColor(Shape, Quantity_NOC_RED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SELECT_SUBSHAPES"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SELECT_SUBSHAPES"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -939,17 +941,17 @@ bool DisplayGUI::PrepareSubShapeSelection(const int SubShapeType, Standard_Integ
|
|||||||
bool DisplayGUI::PrepareSubShapeSelectionArgumentShape(const TopoDS_Shape& aShape,const int SubShapeType, Standard_Integer& returnLocalContextId)
|
bool DisplayGUI::PrepareSubShapeSelectionArgumentShape(const TopoDS_Shape& aShape,const int SubShapeType, Standard_Integer& returnLocalContextId)
|
||||||
{
|
{
|
||||||
//* Test the type of viewer */
|
//* Test the type of viewer */
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(aShape.IsNull())
|
if(aShape.IsNull())
|
||||||
return false ;
|
return false ;
|
||||||
|
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
|
|
||||||
/* local context opening */
|
/* local context opening */
|
||||||
myGeomBase->SetDisplayedObjectList();
|
//myGeomBase->SetDisplayedObjectList();
|
||||||
this->OnDisplayOnly();
|
this->OnDisplayOnly();
|
||||||
|
|
||||||
returnLocalContextId = ic->OpenLocalContext(Standard_False, Standard_True, Standard_False, Standard_False) ;
|
returnLocalContextId = ic->OpenLocalContext(Standard_False, Standard_True, Standard_False, Standard_False) ;
|
||||||
@ -961,7 +963,7 @@ bool DisplayGUI::PrepareSubShapeSelectionArgumentShape(const TopoDS_Shape& aShap
|
|||||||
// ic->Load(Shape, (8 - SubShapeType), Standard_True);
|
// ic->Load(Shape, (8 - SubShapeType), Standard_True);
|
||||||
ic->HilightWithColor(Shape, Quantity_NOC_RED);
|
ic->HilightWithColor(Shape, Quantity_NOC_RED);
|
||||||
|
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SELECT_SUBSHAPES"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SELECT_SUBSHAPES"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,21 +45,15 @@ LIB_SRC = DisplayGUI.cxx
|
|||||||
LIB_MOC = \
|
LIB_MOC = \
|
||||||
DisplayGUI.h
|
DisplayGUI.h
|
||||||
|
|
||||||
LIB_CLIENT_IDL = SALOME_Exception.idl \
|
LIB_CLIENT_IDL = SALOME_Exception.idl
|
||||||
GEOM_Gen.idl \
|
|
||||||
GEOM_Shape.idl \
|
|
||||||
SALOMEDS.idl \
|
|
||||||
SALOMEDS_Attributes.idl \
|
|
||||||
SALOME_ModuleCatalog.idl \
|
|
||||||
SALOME_Component.idl \
|
|
||||||
|
|
||||||
LIB_SERVER_IDL =
|
LIB_SERVER_IDL =
|
||||||
|
|
||||||
# additionnal information to compil and link file
|
# additionnal information to compil and link file
|
||||||
|
|
||||||
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
||||||
CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
|
CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
|
||||||
|
|
||||||
LDFLAGS += -lOCCViewer -lVTKViewer -lSalomeObject -lSalomeGUI -lGEOMClient -lGEOMObject -lGEOMContext -lGEOMBase -L${KERNEL_ROOT_DIR}/lib/salome
|
LDFLAGS += -lGEOMBase
|
||||||
|
|
||||||
@CONCLUDE@
|
@CONCLUDE@
|
||||||
|
54
src/DlgRef/DlgRef_1Sel1Spin1Check.cxx
Normal file
54
src/DlgRef/DlgRef_1Sel1Spin1Check.cxx
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
|
//
|
||||||
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// File : DlgRef_1Sel1Spin1Check.cxx
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#include "DlgRef_1Sel1Spin1Check.h"
|
||||||
|
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qspinbox.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_1Sel1Spin which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'
|
||||||
|
*/
|
||||||
|
DlgRef_1Sel1Spin1Check::DlgRef_1Sel1Spin1Check(QWidget* parent, const char* name, WFlags fl)
|
||||||
|
:DlgRef_1Sel1Spin1Check_QTD(parent, name, fl)
|
||||||
|
{
|
||||||
|
SpinBox1->close(TRUE);
|
||||||
|
SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
|
||||||
|
Layout2->addWidget(SpinBox_DX, 0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
DlgRef_1Sel1Spin1Check::~DlgRef_1Sel1Spin1Check()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
47
src/DlgRef/DlgRef_1Sel1Spin1Check.h
Normal file
47
src/DlgRef/DlgRef_1Sel1Spin1Check.h
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
|
//
|
||||||
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// File : DlgRef_1Sel1Spin1Check.h
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#ifndef DLGREF_1SEL1SPIN1CHECK_H
|
||||||
|
#define DLGREF_1SEL1SPIN1CHECK_H
|
||||||
|
|
||||||
|
#include "DlgRef_1Sel1Spin1Check_QTD.h"
|
||||||
|
#include "DlgRef_SpinBox.h"
|
||||||
|
|
||||||
|
class DlgRef_1Sel1Spin1Check : public DlgRef_1Sel1Spin1Check_QTD
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_1Sel1Spin1Check(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
|
||||||
|
~DlgRef_1Sel1Spin1Check();
|
||||||
|
|
||||||
|
DlgRef_SpinBox* SpinBox_DX;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_1SEL1SPIN1CHECK_H
|
95
src/DlgRef/DlgRef_1Sel1Spin1Check_QTD.cxx
Normal file
95
src/DlgRef/DlgRef_1Sel1Spin1Check_QTD.cxx
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form implementation generated from reading ui file 'DlgRef_1Sel1Spin1Check_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: lun nov 17 14:16:09 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#include "DlgRef_1Sel1Spin1Check_QTD.h"
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <qlineedit.h>
|
||||||
|
#include <qpushbutton.h>
|
||||||
|
#include <qradiobutton.h>
|
||||||
|
#include <qspinbox.h>
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qtooltip.h>
|
||||||
|
#include <qwhatsthis.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_1Sel1Spin1Check_QTD which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'.
|
||||||
|
*/
|
||||||
|
DlgRef_1Sel1Spin1Check_QTD::DlgRef_1Sel1Spin1Check_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||||
|
: QWidget( parent, name, fl )
|
||||||
|
{
|
||||||
|
if ( !name )
|
||||||
|
setName( "DlgRef_1Sel1Spin1Check_QTD" );
|
||||||
|
resize( 129, 106 );
|
||||||
|
setCaption( trUtf8( "DlgRef_1Sel1Spin1Check_QTD" ) );
|
||||||
|
DlgRef_1Sel1Spin1Check_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_1Sel1Spin1Check_QTDLayout");
|
||||||
|
|
||||||
|
GroupBox1 = new QGroupBox( this, "GroupBox1" );
|
||||||
|
GroupBox1->setTitle( trUtf8( "" ) );
|
||||||
|
GroupBox1->setColumnLayout(0, Qt::Vertical );
|
||||||
|
GroupBox1->layout()->setSpacing( 6 );
|
||||||
|
GroupBox1->layout()->setMargin( 11 );
|
||||||
|
GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
|
||||||
|
GroupBox1Layout->setAlignment( Qt::AlignTop );
|
||||||
|
|
||||||
|
Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
|
||||||
|
QSpacerItem* spacer = new QSpacerItem( 0, 120, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||||
|
Layout1->addItem( spacer, 3, 2 );
|
||||||
|
|
||||||
|
TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
|
||||||
|
TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel1->setText( trUtf8( "TL1" ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( TextLabel1, 0, 0 );
|
||||||
|
|
||||||
|
PushButton1 = new QPushButton( GroupBox1, "PushButton1" );
|
||||||
|
PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
PushButton1->setText( trUtf8( "" ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( PushButton1, 0, 1 );
|
||||||
|
|
||||||
|
Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
|
||||||
|
|
||||||
|
SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
|
||||||
|
SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( SpinBox1, 0, 1 );
|
||||||
|
|
||||||
|
TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
|
||||||
|
TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel2->setText( trUtf8( "TL2" ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( TextLabel2, 0, 0 );
|
||||||
|
|
||||||
|
Layout1->addMultiCellLayout( Layout2, 1, 1, 0, 2 );
|
||||||
|
|
||||||
|
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
|
||||||
|
|
||||||
|
Layout1->addWidget( LineEdit1, 0, 2 );
|
||||||
|
|
||||||
|
CheckButton1 = new QRadioButton( GroupBox1, "CheckButton1" );
|
||||||
|
CheckButton1->setText( trUtf8( "" ) );
|
||||||
|
|
||||||
|
Layout1->addMultiCellWidget( CheckButton1, 2, 2, 0, 2 );
|
||||||
|
|
||||||
|
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||||
|
|
||||||
|
DlgRef_1Sel1Spin1Check_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
DlgRef_1Sel1Spin1Check_QTD::~DlgRef_1Sel1Spin1Check_QTD()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
48
src/DlgRef/DlgRef_1Sel1Spin1Check_QTD.h
Normal file
48
src/DlgRef/DlgRef_1Sel1Spin1Check_QTD.h
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form interface generated from reading ui file 'DlgRef_1Sel1Spin1Check_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: lun nov 17 14:16:09 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#ifndef DLGREF_1SEL1SPIN1CHECK_QTD_H
|
||||||
|
#define DLGREF_1SEL1SPIN1CHECK_QTD_H
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qwidget.h>
|
||||||
|
class QVBoxLayout;
|
||||||
|
class QHBoxLayout;
|
||||||
|
class QGridLayout;
|
||||||
|
class QGroupBox;
|
||||||
|
class QLabel;
|
||||||
|
class QLineEdit;
|
||||||
|
class QPushButton;
|
||||||
|
class QRadioButton;
|
||||||
|
class QSpinBox;
|
||||||
|
|
||||||
|
class DlgRef_1Sel1Spin1Check_QTD : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_1Sel1Spin1Check_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||||
|
~DlgRef_1Sel1Spin1Check_QTD();
|
||||||
|
|
||||||
|
QGroupBox* GroupBox1;
|
||||||
|
QLabel* TextLabel1;
|
||||||
|
QPushButton* PushButton1;
|
||||||
|
QSpinBox* SpinBox1;
|
||||||
|
QLabel* TextLabel2;
|
||||||
|
QLineEdit* LineEdit1;
|
||||||
|
QRadioButton* CheckButton1;
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QGridLayout* DlgRef_1Sel1Spin1Check_QTDLayout;
|
||||||
|
QGridLayout* GroupBox1Layout;
|
||||||
|
QGridLayout* Layout1;
|
||||||
|
QGridLayout* Layout2;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_1SEL1SPIN1CHECK_QTD_H
|
89
src/DlgRef/DlgRef_1Sel3Check_QTD.cxx
Normal file
89
src/DlgRef/DlgRef_1Sel3Check_QTD.cxx
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form implementation generated from reading ui file 'DlgRef_1Sel3Check_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: lun nov 17 11:32:21 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#include "DlgRef_1Sel3Check_QTD.h"
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <qlineedit.h>
|
||||||
|
#include <qpushbutton.h>
|
||||||
|
#include <qradiobutton.h>
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qtooltip.h>
|
||||||
|
#include <qwhatsthis.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_1Sel3Check_QTD which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'.
|
||||||
|
*/
|
||||||
|
DlgRef_1Sel3Check_QTD::DlgRef_1Sel3Check_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||||
|
: QWidget( parent, name, fl )
|
||||||
|
{
|
||||||
|
if ( !name )
|
||||||
|
setName( "DlgRef_1Sel3Check_QTD" );
|
||||||
|
resize( 129, 114 );
|
||||||
|
setCaption( trUtf8( "DlgRef_1Sel3Check_QTD" ) );
|
||||||
|
DlgRef_1Sel3Check_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_1Sel3Check_QTDLayout");
|
||||||
|
|
||||||
|
GroupBox1 = new QGroupBox( this, "GroupBox1" );
|
||||||
|
GroupBox1->setTitle( trUtf8( "" ) );
|
||||||
|
GroupBox1->setColumnLayout(0, Qt::Vertical );
|
||||||
|
GroupBox1->layout()->setSpacing( 6 );
|
||||||
|
GroupBox1->layout()->setMargin( 11 );
|
||||||
|
GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
|
||||||
|
GroupBox1Layout->setAlignment( Qt::AlignTop );
|
||||||
|
|
||||||
|
Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
|
||||||
|
|
||||||
|
CheckButton2 = new QRadioButton( GroupBox1, "CheckButton2" );
|
||||||
|
CheckButton2->setText( trUtf8( "" ) );
|
||||||
|
|
||||||
|
Layout1->addMultiCellWidget( CheckButton2, 2, 2, 0, 2 );
|
||||||
|
|
||||||
|
TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
|
||||||
|
TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel1->setText( trUtf8( "TL1" ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( TextLabel1, 0, 0 );
|
||||||
|
|
||||||
|
PushButton1 = new QPushButton( GroupBox1, "PushButton1" );
|
||||||
|
PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
PushButton1->setText( trUtf8( "" ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( PushButton1, 0, 1 );
|
||||||
|
QSpacerItem* spacer = new QSpacerItem( 0, 60, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||||
|
Layout1->addItem( spacer, 4, 2 );
|
||||||
|
|
||||||
|
CheckButton3 = new QRadioButton( GroupBox1, "CheckButton3" );
|
||||||
|
CheckButton3->setText( trUtf8( "" ) );
|
||||||
|
|
||||||
|
Layout1->addMultiCellWidget( CheckButton3, 3, 3, 0, 2 );
|
||||||
|
|
||||||
|
CheckButton1 = new QRadioButton( GroupBox1, "CheckButton1" );
|
||||||
|
CheckButton1->setText( trUtf8( "" ) );
|
||||||
|
|
||||||
|
Layout1->addMultiCellWidget( CheckButton1, 1, 1, 0, 2 );
|
||||||
|
|
||||||
|
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
|
||||||
|
|
||||||
|
Layout1->addWidget( LineEdit1, 0, 2 );
|
||||||
|
|
||||||
|
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||||
|
|
||||||
|
DlgRef_1Sel3Check_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
DlgRef_1Sel3Check_QTD::~DlgRef_1Sel3Check_QTD()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
46
src/DlgRef/DlgRef_1Sel3Check_QTD.h
Normal file
46
src/DlgRef/DlgRef_1Sel3Check_QTD.h
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form interface generated from reading ui file 'DlgRef_1Sel3Check_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: lun nov 17 11:32:20 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#ifndef DLGREF_1SEL3CHECK_QTD_H
|
||||||
|
#define DLGREF_1SEL3CHECK_QTD_H
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qwidget.h>
|
||||||
|
class QVBoxLayout;
|
||||||
|
class QHBoxLayout;
|
||||||
|
class QGridLayout;
|
||||||
|
class QGroupBox;
|
||||||
|
class QLabel;
|
||||||
|
class QLineEdit;
|
||||||
|
class QPushButton;
|
||||||
|
class QRadioButton;
|
||||||
|
|
||||||
|
class DlgRef_1Sel3Check_QTD : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_1Sel3Check_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||||
|
~DlgRef_1Sel3Check_QTD();
|
||||||
|
|
||||||
|
QGroupBox* GroupBox1;
|
||||||
|
QRadioButton* CheckButton2;
|
||||||
|
QLabel* TextLabel1;
|
||||||
|
QPushButton* PushButton1;
|
||||||
|
QRadioButton* CheckButton3;
|
||||||
|
QRadioButton* CheckButton1;
|
||||||
|
QLineEdit* LineEdit1;
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QGridLayout* DlgRef_1Sel3Check_QTDLayout;
|
||||||
|
QGridLayout* GroupBox1Layout;
|
||||||
|
QGridLayout* Layout1;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_1SEL3CHECK_QTD_H
|
@ -42,6 +42,7 @@ LIB_SRC = DlgRef_Skeleton_QTD.cxx \
|
|||||||
DlgRef_2Sel_QTD.cxx \
|
DlgRef_2Sel_QTD.cxx \
|
||||||
DlgRef_3Sel_QTD.cxx \
|
DlgRef_3Sel_QTD.cxx \
|
||||||
DlgRef_1Sel1Check_QTD.cxx \
|
DlgRef_1Sel1Check_QTD.cxx \
|
||||||
|
DlgRef_1Sel3Check_QTD.cxx \
|
||||||
DlgRef_1Sel1Check1List_QTD.cxx \
|
DlgRef_1Sel1Check1List_QTD.cxx \
|
||||||
DlgRef_1Sel1Spin_QTD.cxx \
|
DlgRef_1Sel1Spin_QTD.cxx \
|
||||||
DlgRef_1Sel2Spin_QTD.cxx \
|
DlgRef_1Sel2Spin_QTD.cxx \
|
||||||
@ -51,6 +52,7 @@ LIB_SRC = DlgRef_Skeleton_QTD.cxx \
|
|||||||
DlgRef_2Sel1Spin_QTD.cxx \
|
DlgRef_2Sel1Spin_QTD.cxx \
|
||||||
DlgRef_2Sel2Spin_QTD.cxx \
|
DlgRef_2Sel2Spin_QTD.cxx \
|
||||||
DlgRef_2Sel3Spin_QTD.cxx \
|
DlgRef_2Sel3Spin_QTD.cxx \
|
||||||
|
DlgRef_1Sel1Spin1Check_QTD.cxx \
|
||||||
DlgRef_2Sel1Spin1Check_QTD.cxx \
|
DlgRef_2Sel1Spin1Check_QTD.cxx \
|
||||||
DlgRef_2Sel2Spin1Check_QTD.cxx \
|
DlgRef_2Sel2Spin1Check_QTD.cxx \
|
||||||
DlgRef_2Sel4Spin1Check_QTD.cxx \
|
DlgRef_2Sel4Spin1Check_QTD.cxx \
|
||||||
@ -69,6 +71,7 @@ LIB_SRC = DlgRef_Skeleton_QTD.cxx \
|
|||||||
DlgRef_2Sel1Spin.cxx \
|
DlgRef_2Sel1Spin.cxx \
|
||||||
DlgRef_2Sel2Spin.cxx \
|
DlgRef_2Sel2Spin.cxx \
|
||||||
DlgRef_2Sel3Spin.cxx \
|
DlgRef_2Sel3Spin.cxx \
|
||||||
|
DlgRef_1Sel1Spin1Check.cxx \
|
||||||
DlgRef_2Sel1Spin1Check.cxx \
|
DlgRef_2Sel1Spin1Check.cxx \
|
||||||
DlgRef_2Sel2Spin1Check.cxx \
|
DlgRef_2Sel2Spin1Check.cxx \
|
||||||
DlgRef_2Sel4Spin1Check.cxx \
|
DlgRef_2Sel4Spin1Check.cxx \
|
||||||
@ -84,6 +87,7 @@ LIB_MOC = \
|
|||||||
DlgRef_2Sel_QTD.h \
|
DlgRef_2Sel_QTD.h \
|
||||||
DlgRef_3Sel_QTD.h \
|
DlgRef_3Sel_QTD.h \
|
||||||
DlgRef_1Sel1Check_QTD.h \
|
DlgRef_1Sel1Check_QTD.h \
|
||||||
|
DlgRef_1Sel3Check_QTD.h \
|
||||||
DlgRef_1Sel1Check1List_QTD.h \
|
DlgRef_1Sel1Check1List_QTD.h \
|
||||||
DlgRef_1Sel1Spin_QTD.h \
|
DlgRef_1Sel1Spin_QTD.h \
|
||||||
DlgRef_1Sel2Spin_QTD.h \
|
DlgRef_1Sel2Spin_QTD.h \
|
||||||
@ -93,6 +97,7 @@ LIB_MOC = \
|
|||||||
DlgRef_2Sel1Spin_QTD.h \
|
DlgRef_2Sel1Spin_QTD.h \
|
||||||
DlgRef_2Sel2Spin_QTD.h \
|
DlgRef_2Sel2Spin_QTD.h \
|
||||||
DlgRef_2Sel3Spin_QTD.h \
|
DlgRef_2Sel3Spin_QTD.h \
|
||||||
|
DlgRef_1Sel1Spin1Check_QTD.h \
|
||||||
DlgRef_2Sel1Spin1Check_QTD.h \
|
DlgRef_2Sel1Spin1Check_QTD.h \
|
||||||
DlgRef_2Sel2Spin1Check_QTD.h \
|
DlgRef_2Sel2Spin1Check_QTD.h \
|
||||||
DlgRef_2Sel4Spin1Check_QTD.h \
|
DlgRef_2Sel4Spin1Check_QTD.h \
|
||||||
@ -111,6 +116,7 @@ LIB_MOC = \
|
|||||||
DlgRef_2Sel1Spin.h \
|
DlgRef_2Sel1Spin.h \
|
||||||
DlgRef_2Sel2Spin.h \
|
DlgRef_2Sel2Spin.h \
|
||||||
DlgRef_2Sel3Spin.h \
|
DlgRef_2Sel3Spin.h \
|
||||||
|
DlgRef_1Sel1Spin1Check.h \
|
||||||
DlgRef_2Sel1Spin1Check.h \
|
DlgRef_2Sel1Spin1Check.h \
|
||||||
DlgRef_2Sel2Spin1Check.h \
|
DlgRef_2Sel2Spin1Check.h \
|
||||||
DlgRef_2Sel4Spin1Check.h \
|
DlgRef_2Sel4Spin1Check.h \
|
||||||
@ -123,19 +129,14 @@ LIB_MOC = \
|
|||||||
# header files
|
# header files
|
||||||
EXPORT_HEADERS= $(LIB_MOC)
|
EXPORT_HEADERS= $(LIB_MOC)
|
||||||
|
|
||||||
LIB_CLIENT_IDL = SALOME_Exception.idl \
|
LIB_CLIENT_IDL =
|
||||||
GEOM_Gen.idl \
|
|
||||||
GEOM_Shape.idl \
|
|
||||||
SALOMEDS.idl \
|
|
||||||
SALOMEDS_Attributes.idl \
|
|
||||||
SALOME_ModuleCatalog.idl \
|
|
||||||
SALOME_Component.idl \
|
|
||||||
|
|
||||||
LIB_SERVER_IDL =
|
LIB_SERVER_IDL =
|
||||||
|
|
||||||
# additionnal information to compil and link file
|
# additionnal information to compil and link file
|
||||||
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
CPPFLAGS += $(QT_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
||||||
CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
|
CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
|
||||||
LDFLAGS += -lSalomeGUI -L${KERNEL_ROOT_DIR}/lib/salome
|
|
||||||
|
LDFLAGS +=
|
||||||
|
|
||||||
@CONCLUDE@
|
@CONCLUDE@
|
||||||
|
173
src/DlgRef/UIFiles/DlgRef_1Sel1Spin1Check_QTD.ui
Normal file
173
src/DlgRef/UIFiles/DlgRef_1Sel1Spin1Check_QTD.ui
Normal file
@ -0,0 +1,173 @@
|
|||||||
|
<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
|
||||||
|
<class>DlgRef_1Sel1Spin1Check_QTD</class>
|
||||||
|
<widget class="QWidget">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>DlgRef_1Sel1Spin1Check_QTD</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>129</width>
|
||||||
|
<height>106</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="caption">
|
||||||
|
<string>DlgRef_1Sel1Spin1Check_QTD</string>
|
||||||
|
</property>
|
||||||
|
<grid>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>unnamed</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QGroupBox" row="0" column="0">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>GroupBox1</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string></string>
|
||||||
|
</property>
|
||||||
|
<grid>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>unnamed</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>11</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QLayoutWidget" row="0" column="0">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>Layout1</cstring>
|
||||||
|
</property>
|
||||||
|
<grid>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>unnamed</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<spacer row="3" column="2">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>Spacer5</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>Expanding</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>120</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
<widget class="QLabel" row="0" column="0">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>TextLabel1</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy>
|
||||||
|
<hsizetype>0</hsizetype>
|
||||||
|
<vsizetype>0</vsizetype>
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>TL1</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QPushButton" row="0" column="1">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>PushButton1</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy>
|
||||||
|
<hsizetype>0</hsizetype>
|
||||||
|
<vsizetype>0</vsizetype>
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLayoutWidget" row="1" column="0" rowspan="1" colspan="3">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>Layout2</cstring>
|
||||||
|
</property>
|
||||||
|
<grid>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>unnamed</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QSpinBox" row="0" column="1">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>SpinBox1</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy>
|
||||||
|
<hsizetype>7</hsizetype>
|
||||||
|
<vsizetype>0</vsizetype>
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" row="0" column="0">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>TextLabel2</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy>
|
||||||
|
<hsizetype>0</hsizetype>
|
||||||
|
<vsizetype>0</vsizetype>
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>TL2</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</grid>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLineEdit" row="0" column="2">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>LineEdit1</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QRadioButton" row="2" column="0" rowspan="1" colspan="3">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>CheckButton1</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</grid>
|
||||||
|
</widget>
|
||||||
|
</grid>
|
||||||
|
</widget>
|
||||||
|
</grid>
|
||||||
|
</widget>
|
||||||
|
<layoutdefaults spacing="6" margin="11"/>
|
||||||
|
</UI>
|
144
src/DlgRef/UIFiles/DlgRef_1Sel3Check_QTD.ui
Normal file
144
src/DlgRef/UIFiles/DlgRef_1Sel3Check_QTD.ui
Normal file
@ -0,0 +1,144 @@
|
|||||||
|
<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
|
||||||
|
<class>DlgRef_1Sel3Check_QTD</class>
|
||||||
|
<widget class="QWidget">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>DlgRef_1Sel3Check_QTD</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>129</width>
|
||||||
|
<height>114</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="caption">
|
||||||
|
<string>DlgRef_1Sel3Check_QTD</string>
|
||||||
|
</property>
|
||||||
|
<grid>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>unnamed</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QGroupBox" row="0" column="0">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>GroupBox1</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string></string>
|
||||||
|
</property>
|
||||||
|
<grid>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>unnamed</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>11</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QLayoutWidget" row="0" column="0">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>Layout1</cstring>
|
||||||
|
</property>
|
||||||
|
<grid>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>unnamed</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QRadioButton" row="2" column="0" rowspan="1" colspan="3">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>CheckButton2</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" row="0" column="0">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>TextLabel1</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy>
|
||||||
|
<hsizetype>0</hsizetype>
|
||||||
|
<vsizetype>0</vsizetype>
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>TL1</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QPushButton" row="0" column="1">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>PushButton1</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy>
|
||||||
|
<hsizetype>0</hsizetype>
|
||||||
|
<vsizetype>0</vsizetype>
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<spacer row="4" column="2">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>Spacer5</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>Expanding</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>60</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
<widget class="QRadioButton" row="3" column="0" rowspan="1" colspan="3">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>CheckButton3</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QRadioButton" row="1" column="0" rowspan="1" colspan="3">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>CheckButton1</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLineEdit" row="0" column="2">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>LineEdit1</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</grid>
|
||||||
|
</widget>
|
||||||
|
</grid>
|
||||||
|
</widget>
|
||||||
|
</grid>
|
||||||
|
</widget>
|
||||||
|
<layoutdefaults spacing="6" margin="11"/>
|
||||||
|
</UI>
|
@ -9,6 +9,9 @@
|
|||||||
#uic -o DlgRef_1Sel1Spin_QTD.h DlgRef_1Sel1Spin_QTD.ui
|
#uic -o DlgRef_1Sel1Spin_QTD.h DlgRef_1Sel1Spin_QTD.ui
|
||||||
#uic -o DlgRef_1Sel1Spin_QTD.cxx -impl DlgRef_1Sel1Spin_QTD.h DlgRef_1Sel1Spin_QTD.ui
|
#uic -o DlgRef_1Sel1Spin_QTD.cxx -impl DlgRef_1Sel1Spin_QTD.h DlgRef_1Sel1Spin_QTD.ui
|
||||||
|
|
||||||
|
uic -o DlgRef_1Sel1Spin1Check_QTD.h DlgRef_1Sel1Spin1Check_QTD.ui
|
||||||
|
uic -o DlgRef_1Sel1Spin1Check_QTD.cxx -impl DlgRef_1Sel1Spin1Check_QTD.h DlgRef_1Sel1Spin1Check_QTD.ui
|
||||||
|
|
||||||
#uic -o DlgRef_1Sel2Spin_QTD.h DlgRef_1Sel2Spin_QTD.ui
|
#uic -o DlgRef_1Sel2Spin_QTD.h DlgRef_1Sel2Spin_QTD.ui
|
||||||
#uic -o DlgRef_1Sel2Spin_QTD.cxx -impl DlgRef_1Sel2Spin_QTD.h DlgRef_1Sel2Spin_QTD.ui
|
#uic -o DlgRef_1Sel2Spin_QTD.cxx -impl DlgRef_1Sel2Spin_QTD.h DlgRef_1Sel2Spin_QTD.ui
|
||||||
|
|
||||||
@ -24,6 +27,9 @@
|
|||||||
#uic -o DlgRef_1Sel1Check_QTD.h DlgRef_1Sel1Check_QTD.ui
|
#uic -o DlgRef_1Sel1Check_QTD.h DlgRef_1Sel1Check_QTD.ui
|
||||||
#uic -o DlgRef_1Sel1Check_QTD.cxx -impl DlgRef_1Sel1Check_QTD.h DlgRef_1Sel1Check_QTD.ui
|
#uic -o DlgRef_1Sel1Check_QTD.cxx -impl DlgRef_1Sel1Check_QTD.h DlgRef_1Sel1Check_QTD.ui
|
||||||
|
|
||||||
|
#uic -o DlgRef_1Sel3Check_QTD.h DlgRef_1Sel3Check_QTD.ui
|
||||||
|
#uic -o DlgRef_1Sel3Check_QTD.cxx -impl DlgRef_1Sel3Check_QTD.h DlgRef_1Sel3Check_QTD.ui
|
||||||
|
|
||||||
#uic -o DlgRef_1Sel1Check1List_QTD.h DlgRef_1Sel1Check1List_QTD.ui
|
#uic -o DlgRef_1Sel1Check1List_QTD.h DlgRef_1Sel1Check1List_QTD.ui
|
||||||
#uic -o DlgRef_1Sel1Check1List_QTD.cxx -impl DlgRef_1Sel1Check1List_QTD.h DlgRef_1Sel1Check1List_QTD.ui
|
#uic -o DlgRef_1Sel1Check1List_QTD.cxx -impl DlgRef_1Sel1Check1List_QTD.h DlgRef_1Sel1Check1List_QTD.ui
|
||||||
|
|
||||||
@ -48,8 +54,8 @@
|
|||||||
#uic -o DlgRef_2Sel4Spin1Check_QTD.h DlgRef_2Sel4Spin1Check_QTD.ui
|
#uic -o DlgRef_2Sel4Spin1Check_QTD.h DlgRef_2Sel4Spin1Check_QTD.ui
|
||||||
#uic -o DlgRef_2Sel4Spin1Check_QTD.cxx -impl DlgRef_2Sel4Spin1Check_QTD.h DlgRef_2Sel4Spin1Check_QTD.ui
|
#uic -o DlgRef_2Sel4Spin1Check_QTD.cxx -impl DlgRef_2Sel4Spin1Check_QTD.h DlgRef_2Sel4Spin1Check_QTD.ui
|
||||||
|
|
||||||
uic -o DlgRef_4Sel1List_QTD.h DlgRef_4Sel1List_QTD.ui
|
#uic -o DlgRef_4Sel1List_QTD.h DlgRef_4Sel1List_QTD.ui
|
||||||
uic -o DlgRef_4Sel1List_QTD.cxx -impl DlgRef_4Sel1List_QTD.h DlgRef_4Sel1List_QTD.ui
|
#uic -o DlgRef_4Sel1List_QTD.cxx -impl DlgRef_4Sel1List_QTD.h DlgRef_4Sel1List_QTD.ui
|
||||||
|
|
||||||
#uic -o DlgRef_3Sel_QTD.h DlgRef_3Sel_QTD.ui
|
#uic -o DlgRef_3Sel_QTD.h DlgRef_3Sel_QTD.ui
|
||||||
#uic -o DlgRef_3Sel_QTD.cxx -impl DlgRef_3Sel_QTD.h DlgRef_3Sel_QTD.ui
|
#uic -o DlgRef_3Sel_QTD.cxx -impl DlgRef_3Sel_QTD.h DlgRef_3Sel_QTD.ui
|
||||||
|
@ -35,6 +35,7 @@ using namespace std;
|
|||||||
|
|
||||||
#include "QAD_RightFrame.h"
|
#include "QAD_RightFrame.h"
|
||||||
#include "QAD_MessageBox.h"
|
#include "QAD_MessageBox.h"
|
||||||
|
#include "QAD_Resource.h"
|
||||||
|
|
||||||
#include "GEOM_AssemblyBuilder.h"
|
#include "GEOM_AssemblyBuilder.h"
|
||||||
#include "VTKViewer_ViewFrame.h"
|
#include "VTKViewer_ViewFrame.h"
|
||||||
@ -69,6 +70,36 @@ using namespace std;
|
|||||||
|
|
||||||
#include "GEOMBase_aParameterDlg.h"
|
#include "GEOMBase_aParameterDlg.h"
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : CustomItem
|
||||||
|
// purpose : Set Font to a text.
|
||||||
|
//=================================================================================
|
||||||
|
class CustomItem : public QCustomMenuItem
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CustomItem(const QString& s, const QFont& f)
|
||||||
|
:string(s), font(f){};
|
||||||
|
~CustomItem(){}
|
||||||
|
|
||||||
|
void paint(QPainter* p, const QColorGroup& /*cg*/, bool /*act*/,
|
||||||
|
bool /*enabled*/, int x, int y, int w, int h)
|
||||||
|
{
|
||||||
|
p->setFont(font);
|
||||||
|
p->drawText(x, y, w, h, AlignHCenter | AlignVCenter | ShowPrefix | DontClip, string);
|
||||||
|
}
|
||||||
|
|
||||||
|
QSize sizeHint()
|
||||||
|
{
|
||||||
|
return QFontMetrics(font).size(AlignHCenter | AlignVCenter | ShowPrefix | DontClip, string);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString string;
|
||||||
|
QFont font;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : GEOMBase()
|
// function : GEOMBase()
|
||||||
// purpose : Constructor
|
// purpose : Constructor
|
||||||
@ -78,6 +109,21 @@ GEOMBase::GEOMBase() :
|
|||||||
{
|
{
|
||||||
myGeomGUI = GEOMContext::GetGeomGUI();
|
myGeomGUI = GEOMContext::GetGeomGUI();
|
||||||
myGeom = myGeomGUI->myComponentGeom;
|
myGeom = myGeomGUI->myComponentGeom;
|
||||||
|
|
||||||
|
/* Shading Color */
|
||||||
|
QString SCr = QAD_CONFIG->getSetting("Geometry:SettingsShadingColorRed");
|
||||||
|
QString SCg = QAD_CONFIG->getSetting("Geometry:SettingsShadingColorGreen");
|
||||||
|
QString SCb = QAD_CONFIG->getSetting("Geometry:SettingsShadingColorBlue");
|
||||||
|
if(!SCr.isEmpty() && !SCg.isEmpty() && !SCb.isEmpty())
|
||||||
|
myShadingColor = Quantity_Color(SCr.toInt()/255., SCg.toInt()/255., SCb.toInt()/255., Quantity_TOC_RGB);
|
||||||
|
else
|
||||||
|
myShadingColor = Quantity_Color(Quantity_NOC_GOLDENROD);
|
||||||
|
|
||||||
|
QString AddInStudy = QAD_CONFIG->getSetting("Geometry:SettingsAddInStudy");
|
||||||
|
if(!AddInStudy.isEmpty())
|
||||||
|
mySettings_AddInStudy = AddInStudy.toInt();
|
||||||
|
else
|
||||||
|
mySettings_AddInStudy = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -90,6 +136,319 @@ GEOMBase::~GEOMBase()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : CustomPopup()
|
||||||
|
// purpose : [static]
|
||||||
|
//=================================================================================
|
||||||
|
bool GEOMBase::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString& theContext,
|
||||||
|
const QString& theParent, const QString& theObject)
|
||||||
|
{
|
||||||
|
GEOMBase* myGeomBase = new GEOMBase();
|
||||||
|
QAD_Study* ActiveStudy = parent->getActiveStudy();
|
||||||
|
|
||||||
|
/* Deactivate any non modal dialog box to get the neutral point */
|
||||||
|
myGeomBase->myGeomGUI->EmitSignalDeactivateDialog();
|
||||||
|
|
||||||
|
SALOME_Selection* Sel = SALOME_Selection::Selection(ActiveStudy->getSelection());
|
||||||
|
int nbSel = Sel->IObjectCount();
|
||||||
|
|
||||||
|
if((nbSel == 0))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if(ActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)ActiveStudy->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
|
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
|
if(theParent.compare("Viewer") == 0) {
|
||||||
|
if(theObject.compare("Component") == 0) {
|
||||||
|
popup->removeItem(QAD_DisplayOnly_Popup_ID);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
QFont f = QApplication::font();
|
||||||
|
f.setBold(TRUE);
|
||||||
|
if(nbSel == 1) {
|
||||||
|
Handle(SALOME_InteractiveObject) IObject = Sel->firstIObject();
|
||||||
|
popup->removeItem(QAD_TopLabel_Popup_ID);
|
||||||
|
popup->insertItem(new CustomItem (QString(IObject->getName()), f), QAD_TopLabel_Popup_ID, 0);
|
||||||
|
if(IObject->hasEntry())
|
||||||
|
popup->setItemEnabled(804, false); //Add in Study Menu
|
||||||
|
else
|
||||||
|
popup->setItemEnabled(804, true); //Add in Study Menu
|
||||||
|
|
||||||
|
if(IObject->IsKind(STANDARD_TYPE(GEOM_InteractiveObject))) {
|
||||||
|
Standard_Boolean found;
|
||||||
|
Handle(GEOM_AISShape) Result = myGeomBase->ConvertIOinGEOMAISShape(IObject, found, true);
|
||||||
|
|
||||||
|
if(found) {
|
||||||
|
if(Result->DisplayMode() == 1)
|
||||||
|
popup->changeItem(8031, tr("GEOM_MEN_WIREFRAME")); //Shading/Wireframe Menu
|
||||||
|
else
|
||||||
|
popup->changeItem(8031, tr("GEOM_MEN_SHADING")); //Shading/Wireframe Menu
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!(v3d->isInViewer(IObject) && v3d->isVisible(IObject)))
|
||||||
|
popup->removeItem(QAD_Erase_Popup_ID);
|
||||||
|
else
|
||||||
|
popup->removeItem(QAD_Display_Popup_ID);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
popup->removeItem(QAD_DisplayOnly_Popup_ID);
|
||||||
|
popup->removeItem(QAD_TopLabel_Popup_ID);
|
||||||
|
popup->insertItem(new CustomItem (tr("GEOM_MEN_POPUP_NAME").arg(nbSel), f), QAD_TopLabel_Popup_ID, 0);
|
||||||
|
popup->setItemEnabled(804, false); //Add in Study Menu
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if(theParent.compare("ObjectBrowser") == 0) {
|
||||||
|
popup->removeItem(QAD_TopLabel_Popup_ID);
|
||||||
|
int id = popup->idAt(0); // separator
|
||||||
|
if(id < 0)
|
||||||
|
popup->removeItem(id);
|
||||||
|
|
||||||
|
// checking for GEOM label in the selected list
|
||||||
|
SALOME_ListIteratorOfListIO It(Sel->StoredIObjects());
|
||||||
|
Handle(SALOME_InteractiveObject) anIObject;
|
||||||
|
|
||||||
|
bool useSubItems = false;
|
||||||
|
bool needOpen = false;
|
||||||
|
bool needDisplay = false;
|
||||||
|
bool needErase = false;
|
||||||
|
SALOMEDS::GenericAttribute_var aTmpAttr;
|
||||||
|
for(;It.More();It.Next()) {
|
||||||
|
anIObject = It.Value();
|
||||||
|
if(!anIObject->hasEntry())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if(v3d->isInViewer(anIObject) && v3d->isVisible(anIObject))
|
||||||
|
needErase = true;
|
||||||
|
else
|
||||||
|
needDisplay = true;
|
||||||
|
SALOMEDS::SObject_var obj = ActiveStudy->getStudyDocument()->FindObjectID(anIObject->getEntry());
|
||||||
|
if(!obj->_is_nil()) {
|
||||||
|
GEOM::GEOM_Shape_var aShape;
|
||||||
|
if(obj->FindAttribute(aTmpAttr, "AttributeIOR")) {
|
||||||
|
char *str = SALOMEDS::AttributeIOR::_narrow(aTmpAttr)->Value();
|
||||||
|
if(str && strlen(str))
|
||||||
|
aShape = myGeomBase->myGeom->GetIORFromString(str);
|
||||||
|
}
|
||||||
|
else if(obj->FindAttribute(aTmpAttr, "AttributePersistentRef"))
|
||||||
|
needOpen = true;
|
||||||
|
|
||||||
|
if(aShape->_is_nil()) {
|
||||||
|
SALOMEDS::ChildIterator_var anIter = ActiveStudy->getStudyDocument()->NewChildIterator(obj);
|
||||||
|
while(anIter->More()) {
|
||||||
|
SALOMEDS::SObject_var subobj = anIter->Value();
|
||||||
|
if(subobj->FindAttribute(aTmpAttr, "AttributeIOR")) {
|
||||||
|
useSubItems = true;
|
||||||
|
needErase = true;
|
||||||
|
needDisplay = true;
|
||||||
|
}
|
||||||
|
else if(subobj->FindAttribute(aTmpAttr, "AttributePersistentRef")) {
|
||||||
|
needOpen = true;
|
||||||
|
useSubItems = true;
|
||||||
|
}
|
||||||
|
anIter->Next();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// remove useless popup items
|
||||||
|
if(nbSel != 1)
|
||||||
|
popup->removeItem(901); // rename
|
||||||
|
if(useSubItems)
|
||||||
|
popup->removeItem(QAD_DisplayOnly_Popup_ID); // display only
|
||||||
|
|
||||||
|
if(!needOpen) {
|
||||||
|
int index = popup->indexOf(9024); // open
|
||||||
|
popup->removeItem(9024);
|
||||||
|
popup->removeItemAt(index); // separator under Open
|
||||||
|
|
||||||
|
if (!needDisplay)
|
||||||
|
popup->removeItem(QAD_Display_Popup_ID);
|
||||||
|
if (!needErase)
|
||||||
|
popup->removeItem(QAD_Erase_Popup_ID);
|
||||||
|
|
||||||
|
if(!needDisplay && !needErase) {
|
||||||
|
int id = popup->idAt(popup->count()-1); // last item
|
||||||
|
popup->removeItem(id); // separator
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
popup->removeItem(QAD_DisplayOnly_Popup_ID); // display only
|
||||||
|
popup->removeItem(QAD_Display_Popup_ID);
|
||||||
|
popup->removeItem(QAD_Erase_Popup_ID);
|
||||||
|
if (nbSel != 1) {
|
||||||
|
int id = popup->idAt(popup->count()-1); // last item
|
||||||
|
popup->removeItem(id); // separator
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(ActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
|
||||||
|
// MESSAGE ( " CUSTOM POPUP VIEWER VTK ")
|
||||||
|
if((theParent.compare("Viewer") == 0)) {
|
||||||
|
popup->setItemEnabled(8034, false); //Isos Menu
|
||||||
|
if(theObject.compare("Component") == 0) {
|
||||||
|
popup->removeItem(QAD_DisplayOnly_Popup_ID);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//int id = popup->idAt(0);
|
||||||
|
QFont f = QApplication::font();
|
||||||
|
f.setBold(TRUE);
|
||||||
|
|
||||||
|
if(nbSel == 1) {
|
||||||
|
Handle(SALOME_InteractiveObject) IObject = Sel->firstIObject();
|
||||||
|
popup->removeItem(QAD_TopLabel_Popup_ID);
|
||||||
|
popup->insertItem(new CustomItem (QString(IObject->getName()), f), QAD_TopLabel_Popup_ID, 0);
|
||||||
|
if(IObject->hasEntry()) {
|
||||||
|
popup->setItemEnabled(804, false); //Add in Study Menu
|
||||||
|
SALOMEDS::Study_var aStudy = ActiveStudy->getStudyDocument();
|
||||||
|
SALOMEDS::SObject_var SO = aStudy->FindObjectID(IObject->getEntry());
|
||||||
|
SALOMEDS::GenericAttribute_var anAttr;
|
||||||
|
SALOMEDS::AttributeIOR_var anIOR;
|
||||||
|
if(!SO->_is_nil()) {
|
||||||
|
if(SO->FindAttribute(anAttr, "AttributeIOR")) {
|
||||||
|
anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
|
||||||
|
Standard_Boolean found;
|
||||||
|
GEOM_Actor* Result = myGeomBase->ConvertIORinGEOMActor(anIOR->Value(), found, true);
|
||||||
|
if(found) {
|
||||||
|
if(Result->getDisplayMode() == 1)
|
||||||
|
popup->changeItem(8031, tr("GEOM_MEN_WIREFRAME")); //Shading/Wireframe Menu
|
||||||
|
else
|
||||||
|
popup->changeItem(8031, tr("GEOM_MEN_SHADING")); //Shading/Wireframe Menu
|
||||||
|
|
||||||
|
if(!Result->GetVisibility())
|
||||||
|
popup->removeItem(QAD_Erase_Popup_ID);
|
||||||
|
else
|
||||||
|
popup->removeItem(QAD_Display_Popup_ID);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
popup->removeItem(QAD_Erase_Popup_ID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
popup->setItemEnabled(804, true); //Add in Study Menu
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
popup->removeItem(QAD_DisplayOnly_Popup_ID);
|
||||||
|
popup->removeItem(QAD_TopLabel_Popup_ID);
|
||||||
|
popup->insertItem( new CustomItem (tr("GEOM_MEN_POPUP_NAME").arg(nbSel), f), QAD_TopLabel_Popup_ID, 0);
|
||||||
|
popup->setItemEnabled(804, false); //Add in Study Menu
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if(theParent.compare("ObjectBrowser") == 0) {
|
||||||
|
popup->removeItem(QAD_TopLabel_Popup_ID);
|
||||||
|
int id = popup->idAt(0); // separator
|
||||||
|
if(id < 0)
|
||||||
|
popup->removeItem(id);
|
||||||
|
|
||||||
|
// checking for GEOM label in the selected list
|
||||||
|
SALOME_ListIteratorOfListIO It(Sel->StoredIObjects());
|
||||||
|
Handle(SALOME_InteractiveObject) anIObject;
|
||||||
|
|
||||||
|
bool useSubItems = false;
|
||||||
|
bool needOpen = false;
|
||||||
|
bool needDisplay = false;
|
||||||
|
bool needErase = false;
|
||||||
|
SALOMEDS::GenericAttribute_var aTmpAttr;
|
||||||
|
VTKViewer_RenderWindowInteractor* myRenderInter = ((VTKViewer_ViewFrame*)ActiveStudy->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
|
||||||
|
for(;It.More();It.Next()) {
|
||||||
|
anIObject = It.Value();
|
||||||
|
if(!anIObject->hasEntry())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if(myRenderInter->isInViewer(anIObject) && myRenderInter->isVisible(anIObject))
|
||||||
|
needErase = true;
|
||||||
|
else
|
||||||
|
needDisplay = true;
|
||||||
|
|
||||||
|
SALOMEDS::SObject_var obj = ActiveStudy->getStudyDocument()->FindObjectID(anIObject->getEntry());
|
||||||
|
if(!obj->_is_nil()) {
|
||||||
|
GEOM::GEOM_Shape_var aShape;
|
||||||
|
if(obj->FindAttribute(aTmpAttr, "AttributeIOR")) {
|
||||||
|
char *str = SALOMEDS::AttributeIOR::_narrow(aTmpAttr)->Value();
|
||||||
|
if(str && strlen(str))
|
||||||
|
aShape = myGeomBase->myGeom->GetIORFromString(str);
|
||||||
|
}
|
||||||
|
else if(obj->FindAttribute(aTmpAttr, "AttributePersistentRef"))
|
||||||
|
needOpen = true;
|
||||||
|
|
||||||
|
if(aShape->_is_nil()) {
|
||||||
|
SALOMEDS::ChildIterator_var anIter = ActiveStudy->getStudyDocument()->NewChildIterator(obj);
|
||||||
|
while(anIter->More()) {
|
||||||
|
SALOMEDS::SObject_var subobj = anIter->Value();
|
||||||
|
if(subobj->FindAttribute(aTmpAttr, "AttributeIOR")) {
|
||||||
|
useSubItems = true;
|
||||||
|
needDisplay = true;
|
||||||
|
needErase = true;
|
||||||
|
}
|
||||||
|
else if(subobj->FindAttribute(aTmpAttr, "AttributePersistentRef")) {
|
||||||
|
needOpen = true;
|
||||||
|
useSubItems = true;
|
||||||
|
}
|
||||||
|
anIter->Next();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// remove useless popup items
|
||||||
|
if(nbSel != 1)
|
||||||
|
popup->removeItem(901); // rename
|
||||||
|
if(useSubItems)
|
||||||
|
popup->removeItem(QAD_DisplayOnly_Popup_ID); // display only
|
||||||
|
|
||||||
|
if(!needOpen) {
|
||||||
|
int index = popup->indexOf(9024); // open
|
||||||
|
popup->removeItem(9024);
|
||||||
|
popup->removeItemAt(index); // separator under Open
|
||||||
|
|
||||||
|
if(!needDisplay)
|
||||||
|
popup->removeItem(QAD_Display_Popup_ID);
|
||||||
|
if(!needErase)
|
||||||
|
popup->removeItem(QAD_Erase_Popup_ID);
|
||||||
|
if(!needDisplay && !needErase) {
|
||||||
|
int id = popup->idAt(popup->count()-1); // last item
|
||||||
|
popup->removeItem(id); // separator
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
popup->removeItem(QAD_DisplayOnly_Popup_ID); // display only
|
||||||
|
popup->removeItem(QAD_Display_Popup_ID);
|
||||||
|
popup->removeItem(QAD_Erase_Popup_ID);
|
||||||
|
if(nbSel!=1) {
|
||||||
|
int id = popup->idAt(popup->count()-1); // last item
|
||||||
|
popup->removeItem(id); // separator
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else { // other viewer types not supported.
|
||||||
|
while(1) {
|
||||||
|
int id = popup->idAt(0);
|
||||||
|
if(id <= QAD_TopLabel_Popup_ID && id != -1)
|
||||||
|
popup->removeItemAt(0);
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
popup->removeItem(QAD_DisplayOnly_Popup_ID);
|
||||||
|
popup->removeItem(QAD_Display_Popup_ID);
|
||||||
|
popup->removeItem(QAD_Erase_Popup_ID);
|
||||||
|
int id = popup->idAt(popup->count() - 1); // last item
|
||||||
|
if(id < 0 && id != -1)
|
||||||
|
popup->removeItem(id); // separator
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//=====================================================================================
|
//=====================================================================================
|
||||||
// function : Display()
|
// function : Display()
|
||||||
// purpose : Displays a CORBA shape
|
// purpose : Displays a CORBA shape
|
||||||
@ -98,7 +457,7 @@ bool GEOMBase::Display(GEOM::GEOM_Shape_ptr aShape, Standard_CString name)
|
|||||||
{
|
{
|
||||||
// MESSAGE ( "GEOMBase::Display init ")
|
// MESSAGE ( "GEOMBase::Display init ")
|
||||||
Handle(GEOM_InteractiveObject) IO;
|
Handle(GEOM_InteractiveObject) IO;
|
||||||
SALOME_Selection* Sel = SALOME_Selection::Selection(myGeomGUI->GetActiveStudy()->getSelection());
|
SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection());
|
||||||
Sel->ClearIObjects();
|
Sel->ClearIObjects();
|
||||||
|
|
||||||
if(aShape->_is_nil()) {
|
if(aShape->_is_nil()) {
|
||||||
@ -110,7 +469,7 @@ bool GEOMBase::Display(GEOM::GEOM_Shape_ptr aShape, Standard_CString name)
|
|||||||
if(shape.IsNull())
|
if(shape.IsNull())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
|
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
|
||||||
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
|
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
|
||||||
SALOMEDS::GenericAttribute_var anAttr;
|
SALOMEDS::GenericAttribute_var anAttr;
|
||||||
SALOMEDS::AttributeName_var aName;
|
SALOMEDS::AttributeName_var aName;
|
||||||
@ -119,7 +478,7 @@ bool GEOMBase::Display(GEOM::GEOM_Shape_ptr aShape, Standard_CString name)
|
|||||||
SALOMEDS::SComponent_var father = aStudy->FindComponent("GEOM");
|
SALOMEDS::SComponent_var father = aStudy->FindComponent("GEOM");
|
||||||
int aLocked = false;
|
int aLocked = false;
|
||||||
if(father->_is_nil()) {
|
if(father->_is_nil()) {
|
||||||
QAD_Operation* op = new SALOMEGUI_ImportOperation(myGeomGUI->GetActiveStudy());
|
QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy());
|
||||||
op->start();
|
op->start();
|
||||||
aLocked = aStudy->GetProperties()->IsLocked();
|
aLocked = aStudy->GetProperties()->IsLocked();
|
||||||
if(aLocked)
|
if(aLocked)
|
||||||
@ -131,7 +490,7 @@ bool GEOMBase::Display(GEOM::GEOM_Shape_ptr aShape, Standard_CString name)
|
|||||||
anAttr = aStudyBuilder->FindOrCreateAttribute(father, "AttributePixMap");
|
anAttr = aStudyBuilder->FindOrCreateAttribute(father, "AttributePixMap");
|
||||||
aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
|
aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
|
||||||
aPixmap->SetPixMap("ICON_OBJBROWSER_Geometry");
|
aPixmap->SetPixMap("ICON_OBJBROWSER_Geometry");
|
||||||
myGeomGUI->GetActiveStudy()->updateObjBrowser();
|
QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser();
|
||||||
if(aLocked)
|
if(aLocked)
|
||||||
aStudy->GetProperties()->SetLocked(true);
|
aStudy->GetProperties()->SetLocked(true);
|
||||||
op->finish();
|
op->finish();
|
||||||
@ -156,10 +515,10 @@ bool GEOMBase::Display(GEOM::GEOM_Shape_ptr aShape, Standard_CString name)
|
|||||||
nameG = TCollection_AsciiString(name);
|
nameG = TCollection_AsciiString(name);
|
||||||
|
|
||||||
// VTK
|
// VTK
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
|
||||||
VTKViewer_RenderWindowInteractor* myRenderInter = ((VTKViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
|
VTKViewer_RenderWindowInteractor* myRenderInter = ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
|
||||||
|
|
||||||
vtkRenderer *theRenderer = ((VTKViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer();
|
vtkRenderer *theRenderer = ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer();
|
||||||
int themode = myRenderInter->GetDisplayMode();
|
int themode = myRenderInter->GetDisplayMode();
|
||||||
|
|
||||||
vtkActorCollection* theActors = GEOM_AssemblyBuilder::BuildActors(shape, 0, themode, Standard_True);
|
vtkActorCollection* theActors = GEOM_AssemblyBuilder::BuildActors(shape, 0, themode, Standard_True);
|
||||||
@ -177,11 +536,11 @@ bool GEOMBase::Display(GEOM::GEOM_Shape_ptr aShape, Standard_CString name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// OCC
|
// OCC
|
||||||
else if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
|
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
Handle(GEOM_AISShape) theResult = new GEOM_AISShape(shape, nameG.ToCString());
|
Handle(GEOM_AISShape) theResult = new GEOM_AISShape(shape, nameG.ToCString());
|
||||||
theResult->SetShadingColor(myGeomGUI->GetShadingColor());
|
theResult->SetShadingColor(myShadingColor);
|
||||||
IO = new GEOM_InteractiveObject(aShape->Name(), myGeomGUI->GetFatherior(), "GEOM");
|
IO = new GEOM_InteractiveObject(aShape->Name(), myGeomGUI->GetFatherior(), "GEOM");
|
||||||
theResult->setIO(IO);
|
theResult->setIO(IO);
|
||||||
theResult->setName(nameG.ToCString());
|
theResult->setName(nameG.ToCString());
|
||||||
@ -194,8 +553,8 @@ bool GEOMBase::Display(GEOM::GEOM_Shape_ptr aShape, Standard_CString name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Sel->AddIObject(IO, false);
|
Sel->AddIObject(IO, false);
|
||||||
myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame()->Repaint();
|
QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame()->Repaint();
|
||||||
if(myGeomGUI->GetSettings_AddInStudy())
|
if(mySettings_AddInStudy)
|
||||||
AddInStudy(false, IO);
|
AddInStudy(false, IO);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -208,12 +567,12 @@ bool GEOMBase::Display(GEOM::GEOM_Shape_ptr aShape, Standard_CString name)
|
|||||||
//=====================================================================================
|
//=====================================================================================
|
||||||
bool GEOMBase::AddInStudy(bool selection, const Handle(SALOME_InteractiveObject)& anIO)
|
bool GEOMBase::AddInStudy(bool selection, const Handle(SALOME_InteractiveObject)& anIO)
|
||||||
{
|
{
|
||||||
SALOME_Selection* Sel = SALOME_Selection::Selection(myGeomGUI->GetActiveStudy()->getSelection());
|
SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection());
|
||||||
if (!(!myGeomGUI->GetSettings_AddInStudy() || selection)) {
|
if (!(!mySettings_AddInStudy || selection)) {
|
||||||
Sel->ClearIObjects();
|
Sel->ClearIObjects();
|
||||||
}
|
}
|
||||||
|
|
||||||
SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
|
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
|
||||||
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
|
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
|
||||||
SALOMEDS::GenericAttribute_var anAttr;
|
SALOMEDS::GenericAttribute_var anAttr;
|
||||||
SALOMEDS::AttributeName_var aName;
|
SALOMEDS::AttributeName_var aName;
|
||||||
@ -224,7 +583,7 @@ bool GEOMBase::AddInStudy(bool selection, const Handle(SALOME_InteractiveObject)
|
|||||||
SALOMEDS::SComponent_var father = aStudy->FindComponent("GEOM");
|
SALOMEDS::SComponent_var father = aStudy->FindComponent("GEOM");
|
||||||
int aLocked = false;
|
int aLocked = false;
|
||||||
if(father->_is_nil()) {
|
if(father->_is_nil()) {
|
||||||
QAD_Operation* op = new SALOMEGUI_ImportOperation(myGeomGUI->GetActiveStudy());
|
QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy());
|
||||||
op->start();
|
op->start();
|
||||||
aLocked = aStudy->GetProperties()->IsLocked();
|
aLocked = aStudy->GetProperties()->IsLocked();
|
||||||
if(aLocked)
|
if(aLocked)
|
||||||
@ -244,7 +603,7 @@ bool GEOMBase::AddInStudy(bool selection, const Handle(SALOME_InteractiveObject)
|
|||||||
aStudyBuilder->DefineComponentInstance(father, myGeom);
|
aStudyBuilder->DefineComponentInstance(father, myGeom);
|
||||||
father->ComponentIOR(myGeomGUI->GetFatherior());
|
father->ComponentIOR(myGeomGUI->GetFatherior());
|
||||||
|
|
||||||
SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->entry());
|
SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->entry());
|
||||||
|
|
||||||
Handle(GEOM_AISShape) GAISShape;
|
Handle(GEOM_AISShape) GAISShape;
|
||||||
GEOM_Actor* GActor;
|
GEOM_Actor* GActor;
|
||||||
@ -252,8 +611,8 @@ bool GEOMBase::AddInStudy(bool selection, const Handle(SALOME_InteractiveObject)
|
|||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
// VTK
|
// VTK
|
||||||
if (myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
|
if (QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
|
||||||
vtkRenderer *Renderer = ((VTKViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer();
|
vtkRenderer *Renderer = ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer();
|
||||||
|
|
||||||
vtkActorCollection* theActors = Renderer->GetActors();
|
vtkActorCollection* theActors = Renderer->GetActors();
|
||||||
theActors->InitTraversal();
|
theActors->InitTraversal();
|
||||||
@ -280,8 +639,8 @@ bool GEOMBase::AddInStudy(bool selection, const Handle(SALOME_InteractiveObject)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// OCC
|
// OCC
|
||||||
else if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
|
|
||||||
AIS_ListOfInteractive List;
|
AIS_ListOfInteractive List;
|
||||||
@ -309,14 +668,14 @@ bool GEOMBase::AddInStudy(bool selection, const Handle(SALOME_InteractiveObject)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!myGeomGUI->GetSettings_AddInStudy() || selection) {
|
if(!mySettings_AddInStudy || selection) {
|
||||||
QString Name = SALOMEGUI_NameDlg::getName(QAD_Application::getDesktop(), anIO->getName());
|
QString Name = SALOMEGUI_NameDlg::getName(QAD_Application::getDesktop(), anIO->getName());
|
||||||
if(!Name.isEmpty()) {
|
if(!Name.isEmpty()) {
|
||||||
// VTK
|
// VTK
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK)
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK)
|
||||||
GActor->setName(strdup(Name.latin1()));
|
GActor->setName(strdup(Name.latin1()));
|
||||||
// OCC
|
// OCC
|
||||||
else if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC)
|
else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC)
|
||||||
GAISShape->setName(strdup(Name.latin1()));
|
GAISShape->setName(strdup(Name.latin1()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -324,7 +683,7 @@ bool GEOMBase::AddInStudy(bool selection, const Handle(SALOME_InteractiveObject)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// open transaction
|
// open transaction
|
||||||
QAD_Operation* op = new SALOMEGUI_ImportOperation(myGeomGUI->GetActiveStudy());
|
QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy());
|
||||||
op->start();
|
op->start();
|
||||||
|
|
||||||
SALOMEDS::SObject_var newObj = aStudyBuilder->NewObject(father);
|
SALOMEDS::SObject_var newObj = aStudyBuilder->NewObject(father);
|
||||||
@ -364,12 +723,12 @@ bool GEOMBase::AddInStudy(bool selection, const Handle(SALOME_InteractiveObject)
|
|||||||
aPixmap->SetPixMap("ICON_OBJBROWSER_VERTEX");
|
aPixmap->SetPixMap("ICON_OBJBROWSER_VERTEX");
|
||||||
|
|
||||||
// VTK
|
// VTK
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
|
||||||
GActor->setIO(GIO);
|
GActor->setIO(GIO);
|
||||||
aName->SetValue(GActor->getName());
|
aName->SetValue(GActor->getName());
|
||||||
}
|
}
|
||||||
// OCC
|
// OCC
|
||||||
else if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
GAISShape->setIO(GIO);
|
GAISShape->setIO(GIO);
|
||||||
aName->SetValue(GAISShape->getName());
|
aName->SetValue(GAISShape->getName());
|
||||||
}
|
}
|
||||||
@ -405,10 +764,10 @@ bool GEOMBase::AddInStudy(bool selection, const Handle(SALOME_InteractiveObject)
|
|||||||
}
|
}
|
||||||
op->finish();
|
op->finish();
|
||||||
|
|
||||||
if(!myGeomGUI->GetSettings_AddInStudy() || selection)
|
if(!mySettings_AddInStudy || selection)
|
||||||
myGeomGUI->GetActiveStudy()->updateObjBrowser();
|
QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser();
|
||||||
else {
|
else {
|
||||||
myGeomGUI->GetActiveStudy()->updateObjBrowser(false);
|
QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser(false);
|
||||||
Sel->AddIObject(GIO);
|
Sel->AddIObject(GIO);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -491,7 +850,7 @@ bool GEOMBase::GetTopoFromSelection(SALOME_Selection *Sel, TopoDS_Shape& tds)
|
|||||||
Handle(SALOME_InteractiveObject) IO = Sel->firstIObject();
|
Handle(SALOME_InteractiveObject) IO = Sel->firstIObject();
|
||||||
/* case SObject */
|
/* case SObject */
|
||||||
if(IO->hasEntry()) {
|
if(IO->hasEntry()) {
|
||||||
SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
|
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
|
||||||
SALOMEDS::SObject_var obj = aStudy->FindObjectID(IO->getEntry());
|
SALOMEDS::SObject_var obj = aStudy->FindObjectID(IO->getEntry());
|
||||||
SALOMEDS::GenericAttribute_var anAttr;
|
SALOMEDS::GenericAttribute_var anAttr;
|
||||||
SALOMEDS::AttributeIOR_var anIOR;
|
SALOMEDS::AttributeIOR_var anIOR;
|
||||||
@ -642,6 +1001,101 @@ bool GEOMBase::GetShapeTypeString(const TopoDS_Shape& aShape, Standard_CString&
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
// function : ConvertIORinGEOMAISShape()
|
||||||
|
// purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Handle(GEOM_AISShape) GEOMBase::ConvertIORinGEOMAISShape(const char * IOR, Standard_Boolean& testResult, bool onlyInActiveView)
|
||||||
|
{
|
||||||
|
Handle(GEOM_AISShape) resultShape;
|
||||||
|
testResult = false;
|
||||||
|
int nbSf = QAD_Application::getDesktop()->getActiveStudy()->getStudyFramesCount();
|
||||||
|
for(int i = 0; i < nbSf; i++) {
|
||||||
|
QAD_StudyFrame* sf = QAD_Application::getDesktop()->getActiveStudy()->getStudyFrame(i);
|
||||||
|
if(sf->getTypeView() == VIEW_OCC) {
|
||||||
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)sf->getRightFrame()->getViewFrame())->getViewer();
|
||||||
|
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
|
|
||||||
|
AIS_ListOfInteractive List;
|
||||||
|
ic->DisplayedObjects(List);
|
||||||
|
AIS_ListOfInteractive List1;
|
||||||
|
ic->ObjectsInCollector(List1);
|
||||||
|
List.Append(List1);
|
||||||
|
|
||||||
|
AIS_ListIteratorOfListOfInteractive ite(List);
|
||||||
|
while(ite.More()) {
|
||||||
|
if(ite.Value()->IsInstance(STANDARD_TYPE(GEOM_AISShape))) {
|
||||||
|
Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast(ite.Value());
|
||||||
|
if(aSh->hasIO()) {
|
||||||
|
Handle(GEOM_InteractiveObject) GIO = Handle(GEOM_InteractiveObject)::DownCast(aSh->getIO());
|
||||||
|
Standard_CString theIOR = GIO->getIOR();
|
||||||
|
if(strcmp(IOR, theIOR) == 0) {
|
||||||
|
if(onlyInActiveView) {
|
||||||
|
if(sf == QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()) {
|
||||||
|
testResult = true;
|
||||||
|
resultShape = aSh;
|
||||||
|
return resultShape;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
testResult = true;
|
||||||
|
resultShape = aSh;
|
||||||
|
return resultShape;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ite.Next();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return resultShape;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
// function : ConvertIORinGEOMActor()
|
||||||
|
// purpose :
|
||||||
|
//=======================================================================
|
||||||
|
GEOM_Actor* GEOMBase::ConvertIORinGEOMActor(const char* IOR, Standard_Boolean& testResult, bool onlyInActiveView)
|
||||||
|
{
|
||||||
|
int nbSf = QAD_Application::getDesktop()->getActiveStudy()->getStudyFramesCount();
|
||||||
|
for(int i = 0; i < nbSf; i++) {
|
||||||
|
QAD_StudyFrame* sf = QAD_Application::getDesktop()->getActiveStudy()->getStudyFrame(i);
|
||||||
|
if(sf->getTypeView() == VIEW_VTK) {
|
||||||
|
vtkRenderer* Renderer = ((VTKViewer_ViewFrame*)sf->getRightFrame()->getViewFrame())->getRenderer();
|
||||||
|
vtkActorCollection* theActors = Renderer->GetActors();
|
||||||
|
theActors->InitTraversal();
|
||||||
|
vtkActor *ac = theActors->GetNextActor();
|
||||||
|
while(!(ac==NULL)) {
|
||||||
|
if( ac->IsA("GEOM_Actor")) {
|
||||||
|
GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(ac);
|
||||||
|
if(anActor->hasIO()) {
|
||||||
|
Handle(GEOM_InteractiveObject) GIO = Handle(GEOM_InteractiveObject)::DownCast(anActor->getIO());
|
||||||
|
Standard_CString theIOR = GIO->getIOR();
|
||||||
|
if(strcmp(IOR, theIOR) == 0) {
|
||||||
|
if(onlyInActiveView) {
|
||||||
|
if(sf == QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()) {
|
||||||
|
testResult = true;
|
||||||
|
return anActor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
testResult = true;
|
||||||
|
return anActor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ac = theActors->GetNextActor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
testResult = false;
|
||||||
|
return GEOM_Actor::New();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : ConvertIOinGEOMAISShape()
|
// function : ConvertIOinGEOMAISShape()
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -649,9 +1103,9 @@ bool GEOMBase::GetShapeTypeString(const TopoDS_Shape& aShape, Standard_CString&
|
|||||||
Handle(GEOM_AISShape) GEOMBase::ConvertIOinGEOMAISShape(const Handle(SALOME_InteractiveObject)& IO, Standard_Boolean& testResult, bool onlyInActiveView)
|
Handle(GEOM_AISShape) GEOMBase::ConvertIOinGEOMAISShape(const Handle(SALOME_InteractiveObject)& IO, Standard_Boolean& testResult, bool onlyInActiveView)
|
||||||
{
|
{
|
||||||
Handle(GEOM_AISShape) res;
|
Handle(GEOM_AISShape) res;
|
||||||
int nbSf = myGeomGUI->GetActiveStudy()->getStudyFramesCount();
|
int nbSf = QAD_Application::getDesktop()->getActiveStudy()->getStudyFramesCount();
|
||||||
for(int i = 0; i < nbSf; i++) {
|
for(int i = 0; i < nbSf; i++) {
|
||||||
QAD_StudyFrame* sf = myGeomGUI->GetActiveStudy()->getStudyFrame(i);
|
QAD_StudyFrame* sf = QAD_Application::getDesktop()->getActiveStudy()->getStudyFrame(i);
|
||||||
if(sf->getTypeView() == VIEW_OCC) {
|
if(sf->getTypeView() == VIEW_OCC) {
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)sf->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)sf->getRightFrame()->getViewFrame())->getViewer();
|
||||||
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
@ -670,7 +1124,7 @@ Handle(GEOM_AISShape) GEOMBase::ConvertIOinGEOMAISShape(const Handle(SALOME_Inte
|
|||||||
Handle(GEOM_InteractiveObject) GIO = Handle(GEOM_InteractiveObject)::DownCast(aSh->getIO());
|
Handle(GEOM_InteractiveObject) GIO = Handle(GEOM_InteractiveObject)::DownCast(aSh->getIO());
|
||||||
if(GIO->isSame(IO)) {
|
if(GIO->isSame(IO)) {
|
||||||
if(onlyInActiveView) {
|
if(onlyInActiveView) {
|
||||||
if(sf == myGeomGUI->GetActiveStudy()->getActiveStudyFrame()) {
|
if(sf == QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()) {
|
||||||
testResult = true;
|
testResult = true;
|
||||||
return aSh;
|
return aSh;
|
||||||
}
|
}
|
||||||
@ -702,7 +1156,7 @@ GEOM::GEOM_Shape_ptr GEOMBase::ConvertIOinGEOMShape(const Handle(SALOME_Interact
|
|||||||
|
|
||||||
/* case SObject */
|
/* case SObject */
|
||||||
if(IO->hasEntry()) {
|
if(IO->hasEntry()) {
|
||||||
SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
|
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
|
||||||
SALOMEDS::SObject_var obj = aStudy->FindObjectID(IO->getEntry());
|
SALOMEDS::SObject_var obj = aStudy->FindObjectID(IO->getEntry());
|
||||||
SALOMEDS::GenericAttribute_var anAttr;
|
SALOMEDS::GenericAttribute_var anAttr;
|
||||||
SALOMEDS::AttributeIOR_var anIOR;
|
SALOMEDS::AttributeIOR_var anIOR;
|
||||||
@ -740,7 +1194,7 @@ void GEOMBase::ConvertListOfIOInListOfIOR(const SALOME_ListIO& aList, GEOM::GEOM
|
|||||||
for(int i=0; It.More(); It.Next(), i++) {
|
for(int i=0; It.More(); It.Next(), i++) {
|
||||||
Handle(SALOME_InteractiveObject) IObject = It.Value();
|
Handle(SALOME_InteractiveObject) IObject = It.Value();
|
||||||
if(IObject->hasEntry()) {
|
if(IObject->hasEntry()) {
|
||||||
SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
|
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
|
||||||
SALOMEDS::SObject_var obj = aStudy->FindObjectID(IObject->getEntry());
|
SALOMEDS::SObject_var obj = aStudy->FindObjectID(IObject->getEntry());
|
||||||
SALOMEDS::GenericAttribute_var anAttr;
|
SALOMEDS::GenericAttribute_var anAttr;
|
||||||
SALOMEDS::AttributeIOR_var anIOR;
|
SALOMEDS::AttributeIOR_var anIOR;
|
||||||
@ -771,17 +1225,17 @@ void GEOMBase::ConvertListOfIOInListOfIOR(const SALOME_ListIO& aList, GEOM::GEOM
|
|||||||
// function : SetDisplayedObjectList()
|
// function : SetDisplayedObjectList()
|
||||||
// purpose :
|
// purpose :
|
||||||
//================================================================================
|
//================================================================================
|
||||||
void GEOMBase::SetDisplayedObjectList()
|
// void GEOMBase::SetDisplayedObjectList()
|
||||||
{
|
// {
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
// if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
||||||
return;
|
// return;
|
||||||
|
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
// OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
myGeomGUI->GetListDisplayedObject().Clear();
|
// myGeomGUI->GetListDisplayedObject().Clear();
|
||||||
|
|
||||||
Handle (AIS_InteractiveContext) aContext = v3d->getAISContext();
|
// Handle (AIS_InteractiveContext) aContext = v3d->getAISContext();
|
||||||
aContext->DisplayedObjects(myGeomGUI->GetListDisplayedObject());
|
// aContext->DisplayedObjects(myGeomGUI->GetListDisplayedObject());
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
//=====================================================================================
|
//=====================================================================================
|
||||||
@ -794,26 +1248,26 @@ void GEOMBase::DisplaySimulationShape(const TopoDS_Shape& S)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
//NRI DEBUG : 14/02/2002
|
//NRI DEBUG : 14/02/2002
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
|
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
try {
|
try {
|
||||||
/* erase any previous */
|
/* erase any previous */
|
||||||
ic->Erase(myGeomGUI->mySimulationShape, Standard_True, Standard_False);
|
ic->Erase(mySimulationShape, Standard_True, Standard_False);
|
||||||
ic->ClearPrs(myGeomGUI->mySimulationShape);
|
ic->ClearPrs(mySimulationShape);
|
||||||
myGeomGUI->mySimulationShape = new AIS_Shape(TopoDS_Shape());
|
mySimulationShape = new AIS_Shape(TopoDS_Shape());
|
||||||
myGeomGUI->mySimulationShape->Set(S);
|
mySimulationShape->Set(S);
|
||||||
myGeomGUI->mySimulationShape->SetColor(Quantity_NOC_VIOLET);
|
mySimulationShape->SetColor(Quantity_NOC_VIOLET);
|
||||||
ic->Deactivate(myGeomGUI->mySimulationShape);
|
ic->Deactivate(mySimulationShape);
|
||||||
ic->Display(myGeomGUI->mySimulationShape, Standard_False);
|
ic->Display(mySimulationShape, Standard_False);
|
||||||
ic->UpdateCurrentViewer();
|
ic->UpdateCurrentViewer();
|
||||||
}
|
}
|
||||||
catch(Standard_Failure) {
|
catch(Standard_Failure) {
|
||||||
MESSAGE("Exception catched in GEOMBase::DisplaySimulationShape ");
|
MESSAGE("Exception catched in GEOMBase::DisplaySimulationShape ");
|
||||||
}
|
}
|
||||||
myGeomGUI->mySimulationShape->UnsetColor();
|
mySimulationShape->UnsetColor();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -824,13 +1278,13 @@ void GEOMBase::DisplaySimulationShape(const TopoDS_Shape& S)
|
|||||||
//==================================================================================
|
//==================================================================================
|
||||||
void GEOMBase::EraseSimulationShape()
|
void GEOMBase::EraseSimulationShape()
|
||||||
{
|
{
|
||||||
int count = myGeomGUI->GetActiveStudy()->getStudyFramesCount();
|
int count = QAD_Application::getDesktop()->getActiveStudy()->getStudyFramesCount();
|
||||||
for(int i = 0; i < count; i++) {
|
for(int i = 0; i < count; i++) {
|
||||||
if(myGeomGUI->GetActiveStudy()->getStudyFrame(i)->getTypeView() == VIEW_OCC) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getStudyFrame(i)->getTypeView() == VIEW_OCC) {
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getStudyFrame(i)->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getStudyFrame(i)->getRightFrame()->getViewFrame())->getViewer();
|
||||||
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
|
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
ic->Erase(myGeomGUI->mySimulationShape, Standard_True, Standard_False);
|
ic->Erase(mySimulationShape, Standard_True, Standard_False);
|
||||||
ic->ClearPrs(myGeomGUI->mySimulationShape);
|
ic->ClearPrs(mySimulationShape);
|
||||||
ic->UpdateCurrentViewer();
|
ic->UpdateCurrentViewer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -844,10 +1298,10 @@ void GEOMBase::EraseSimulationShape()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
bool GEOMBase::CreateArrowForLinearEdge(const TopoDS_Shape& tds, TopoDS_Shape& ArrowCone)
|
bool GEOMBase::CreateArrowForLinearEdge(const TopoDS_Shape& tds, TopoDS_Shape& ArrowCone)
|
||||||
{
|
{
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() != VIEW_OCC || tds.ShapeType() != TopAbs_EDGE)
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() != VIEW_OCC || tds.ShapeType() != TopAbs_EDGE)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
OCCViewer_ViewPort* vp = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewPort();
|
OCCViewer_ViewPort* vp = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewPort();
|
||||||
Handle( V3d_View) view3d = ((OCCViewer_ViewPort3d*)vp)->getView();
|
Handle( V3d_View) view3d = ((OCCViewer_ViewPort3d*)vp)->getView();
|
||||||
Standard_Real Width, Height;
|
Standard_Real Width, Height;
|
||||||
view3d->Size(Width, Height);
|
view3d->Size(Width, Height);
|
||||||
@ -972,7 +1426,7 @@ double GEOMBase::Parameter(Standard_Boolean& res, const char* aValue1, const cha
|
|||||||
bool GEOMBase::SelectionByNameInDialogs(QWidget* aWidget, const QString& objectUserName, SALOME_Selection* Sel)
|
bool GEOMBase::SelectionByNameInDialogs(QWidget* aWidget, const QString& objectUserName, SALOME_Selection* Sel)
|
||||||
{
|
{
|
||||||
/* Find SObject with name in component GEOM */
|
/* Find SObject with name in component GEOM */
|
||||||
SALOMEDS::Study_var ST = myGeomGUI->GetActiveStudy()->getStudyDocument();
|
SALOMEDS::Study_var ST = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
|
||||||
SALOMEDS::Study::ListOfSObject_var listSO = new SALOMEDS::Study::ListOfSObject;
|
SALOMEDS::Study::ListOfSObject_var listSO = new SALOMEDS::Study::ListOfSObject;
|
||||||
listSO = ST->FindObjectByName(objectUserName, "GEOM");
|
listSO = ST->FindObjectByName(objectUserName, "GEOM");
|
||||||
|
|
||||||
@ -1018,3 +1472,14 @@ bool GEOMBase::DefineDlgPosition(QWidget* aDlg, int& x, int& y)
|
|||||||
y = abs(PP->y() + PP->size().height() - aDlg->size().height() - 10);
|
y = abs(PP->y() + PP->size().height() - aDlg->size().height() - 10);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=====================================================================================
|
||||||
|
// EXPORTED METHODS
|
||||||
|
//=====================================================================================
|
||||||
|
extern "C"
|
||||||
|
{
|
||||||
|
bool CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString & theContext,
|
||||||
|
const QString & theParent, const QString & theObject)
|
||||||
|
{return GEOMBase::CustomPopup(parent, popup, theContext, theParent, theObject);}
|
||||||
|
}
|
||||||
|
@ -30,7 +30,21 @@
|
|||||||
#define GEOMBASE_H
|
#define GEOMBASE_H
|
||||||
|
|
||||||
#include "GEOMContext.h"
|
#include "GEOMContext.h"
|
||||||
|
|
||||||
|
// SALOME Includes
|
||||||
|
#include "QAD_Config.h"
|
||||||
#include "SALOME_Selection.h"
|
#include "SALOME_Selection.h"
|
||||||
|
#include "GEOM_Actor.h"
|
||||||
|
#include "GEOM_AISShape.hxx"
|
||||||
|
#include "GEOM_InteractiveObject.hxx"
|
||||||
|
|
||||||
|
// Open CASCADE Includes
|
||||||
|
#include <Quantity_Color.hxx>
|
||||||
|
|
||||||
|
// IDL Headers
|
||||||
|
#include <SALOMEconfig.h>
|
||||||
|
#include CORBA_SERVER_HEADER(SALOMEDS)
|
||||||
|
#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : GEOMBase
|
// class : GEOMBase
|
||||||
@ -44,6 +58,9 @@ public :
|
|||||||
GEOMBase();
|
GEOMBase();
|
||||||
~GEOMBase();
|
~GEOMBase();
|
||||||
|
|
||||||
|
static bool CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString& theContext,
|
||||||
|
const QString& theParent, const QString& theObject);
|
||||||
|
|
||||||
bool Display(GEOM::GEOM_Shape_ptr aShape, Standard_CString name = "");
|
bool Display(GEOM::GEOM_Shape_ptr aShape, Standard_CString name = "");
|
||||||
bool AddInStudy(bool selection = false, const Handle(SALOME_InteractiveObject)& anIO = 0);
|
bool AddInStudy(bool selection = false, const Handle(SALOME_InteractiveObject)& anIO = 0);
|
||||||
|
|
||||||
@ -63,6 +80,12 @@ public :
|
|||||||
void ConvertListOfIOInListOfIOR(const SALOME_ListIO& aList,
|
void ConvertListOfIOInListOfIOR(const SALOME_ListIO& aList,
|
||||||
GEOM::GEOM_Gen::ListOfIOR& listIOR);
|
GEOM::GEOM_Gen::ListOfIOR& listIOR);
|
||||||
|
|
||||||
|
Handle(GEOM_AISShape) ConvertIORinGEOMAISShape(const char * IOR,
|
||||||
|
Standard_Boolean& testResult,
|
||||||
|
bool onlyInActiveView = false);
|
||||||
|
GEOM_Actor* ConvertIORinGEOMActor(const char * IOR, Standard_Boolean& testResult,
|
||||||
|
bool onlyInActiveView = false);
|
||||||
|
|
||||||
/* Geometry */
|
/* Geometry */
|
||||||
bool VertexToPoint(const TopoDS_Shape& S, gp_Pnt& P);
|
bool VertexToPoint(const TopoDS_Shape& S, gp_Pnt& P);
|
||||||
|
|
||||||
@ -76,7 +99,7 @@ public :
|
|||||||
const char* aTitle = 0, const double bottom = -1E6,
|
const char* aTitle = 0, const double bottom = -1E6,
|
||||||
const double top = +1E6, const int decimals = 6);
|
const double top = +1E6, const int decimals = 6);
|
||||||
|
|
||||||
void SetDisplayedObjectList();
|
//void SetDisplayedObjectList();
|
||||||
|
|
||||||
/* Simulation management */
|
/* Simulation management */
|
||||||
bool CreateArrowForLinearEdge(const TopoDS_Shape& tds, TopoDS_Shape& ArrowCone);
|
bool CreateArrowForLinearEdge(const TopoDS_Shape& tds, TopoDS_Shape& ArrowCone);
|
||||||
@ -90,6 +113,10 @@ public :
|
|||||||
GEOMContext* myGeomGUI;
|
GEOMContext* myGeomGUI;
|
||||||
GEOM::GEOM_Gen_var myGeom; /* Current Geom Component */
|
GEOM::GEOM_Gen_var myGeom; /* Current Geom Component */
|
||||||
|
|
||||||
|
Quantity_Color myShadingColor;
|
||||||
|
Handle(AIS_Shape) mySimulationShape; /* AIS shape used only during topo/geom simulations */
|
||||||
|
bool mySettings_AddInStudy;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -107,7 +107,7 @@ void GEOMBase_Skeleton::ClickOnCancel()
|
|||||||
mySelection->ClearFilters();
|
mySelection->ClearFilters();
|
||||||
disconnect(mySelection, 0, this, 0);
|
disconnect(mySelection, 0, this, 0);
|
||||||
|
|
||||||
myGeomGUI->ResetState();
|
//myGeomGUI->ResetState();
|
||||||
reject();
|
reject();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -140,7 +140,7 @@ void GEOMBase_Skeleton::DeactivateActiveDialog()
|
|||||||
{
|
{
|
||||||
this->setEnabled(false);
|
this->setEnabled(false);
|
||||||
mySelection->ClearFilters();
|
mySelection->ClearFilters();
|
||||||
myGeomGUI->ResetState();
|
//myGeomGUI->ResetState();
|
||||||
disconnect(mySelection, 0, this, 0);
|
disconnect(mySelection, 0, this, 0);
|
||||||
myGeomBase->EraseSimulationShape();
|
myGeomBase->EraseSimulationShape();
|
||||||
myGeomGUI->SetActiveDialogBox(0);
|
myGeomGUI->SetActiveDialogBox(0);
|
||||||
|
@ -39,35 +39,28 @@ LIB = libGEOMBase.la
|
|||||||
|
|
||||||
# header files
|
# header files
|
||||||
EXPORT_HEADERS= GEOMBase.h \
|
EXPORT_HEADERS= GEOMBase.h \
|
||||||
GEOMBase_Sketcher.h \
|
|
||||||
GEOMBase_Skeleton.h
|
GEOMBase_Skeleton.h
|
||||||
|
|
||||||
LIB_SRC = GEOMBase.cxx \
|
LIB_SRC = GEOMBase.cxx \
|
||||||
GEOMBase_Skeleton.cxx \
|
GEOMBase_Skeleton.cxx \
|
||||||
GEOMBase_Sketcher.cxx \
|
|
||||||
GEOMBase_aParameterDlg.cxx
|
GEOMBase_aParameterDlg.cxx
|
||||||
|
|
||||||
LIB_MOC = \
|
LIB_MOC = \
|
||||||
GEOMBase.h \
|
GEOMBase.h \
|
||||||
GEOMBase_Skeleton.h \
|
GEOMBase_Skeleton.h \
|
||||||
GEOMBase_Sketcher.h \
|
|
||||||
GEOMBase_aParameterDlg.h
|
GEOMBase_aParameterDlg.h
|
||||||
|
|
||||||
LIB_CLIENT_IDL = SALOME_Exception.idl \
|
LIB_CLIENT_IDL = SALOME_Exception.idl \
|
||||||
GEOM_Gen.idl \
|
|
||||||
GEOM_Shape.idl \
|
|
||||||
SALOMEDS.idl \
|
SALOMEDS.idl \
|
||||||
SALOMEDS_Attributes.idl \
|
SALOMEDS_Attributes.idl
|
||||||
SALOME_ModuleCatalog.idl \
|
|
||||||
SALOME_Component.idl \
|
|
||||||
|
|
||||||
LIB_SERVER_IDL =
|
LIB_SERVER_IDL =
|
||||||
|
|
||||||
# additionnal information to compil and link file
|
# additionnal information to compil and link file
|
||||||
|
|
||||||
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
||||||
CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
|
CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
|
||||||
|
|
||||||
LDFLAGS += -lOCCViewer -lVTKViewer -lSalomeObject -lSalomeGUI -lGEOMClient -lGEOMObject -lGEOMFiltersSelection -lGEOMSketcher -lDlgRef -lGEOMContext -L${KERNEL_ROOT_DIR}/lib/salome
|
LDFLAGS += -lDlgRef -lGEOMContext
|
||||||
|
|
||||||
@CONCLUDE@
|
@CONCLUDE@
|
||||||
|
@ -35,16 +35,12 @@ using namespace std;
|
|||||||
|
|
||||||
// SALOME Includes
|
// SALOME Includes
|
||||||
#include "QAD_RightFrame.h"
|
#include "QAD_RightFrame.h"
|
||||||
#include "QAD_Resource.h"
|
|
||||||
#include "QAD_Config.h"
|
#include "QAD_Config.h"
|
||||||
|
|
||||||
#include "OCCViewer_ViewPort.h"
|
|
||||||
#include "OCCViewer_ViewPort3d.h"
|
|
||||||
#include "OCCViewer_Viewer3d.h"
|
#include "OCCViewer_Viewer3d.h"
|
||||||
#include "VTKViewer_ViewFrame.h"
|
#include "VTKViewer_ViewFrame.h"
|
||||||
|
|
||||||
#include "SALOME_Selection.h"
|
#include "SALOME_Selection.h"
|
||||||
#include "SALOME_ListIteratorOfListIO.hxx"
|
|
||||||
|
|
||||||
/* The object itself created in the static method 'GetOrCreateGEOMBase()' */
|
/* The object itself created in the static method 'GetOrCreateGEOMBase()' */
|
||||||
static GEOMContext* GeomGUI = 0;
|
static GEOMContext* GeomGUI = 0;
|
||||||
@ -52,36 +48,8 @@ static GEOMContext* GeomGUI = 0;
|
|||||||
typedef bool OGE(int, QAD_Desktop*);
|
typedef bool OGE(int, QAD_Desktop*);
|
||||||
typedef bool OMP(QMouseEvent*, QAD_Desktop*, QAD_StudyFrame*);
|
typedef bool OMP(QMouseEvent*, QAD_Desktop*, QAD_StudyFrame*);
|
||||||
typedef void BP(const Handle(SALOME_InteractiveObject)&);
|
typedef void BP(const Handle(SALOME_InteractiveObject)&);
|
||||||
|
typedef bool CP(QAD_Desktop*, QPopupMenu*, const QString&,
|
||||||
//=================================================================================
|
const QString&, const QString&);
|
||||||
// class : CustomItem
|
|
||||||
// purpose : Set Font to a text.
|
|
||||||
//=================================================================================
|
|
||||||
class CustomItem : public QCustomMenuItem
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
CustomItem(const QString& s, const QFont& f)
|
|
||||||
:string(s), font(f){};
|
|
||||||
~CustomItem(){}
|
|
||||||
|
|
||||||
void paint(QPainter* p, const QColorGroup& /*cg*/, bool /*act*/,
|
|
||||||
bool /*enabled*/, int x, int y, int w, int h)
|
|
||||||
{
|
|
||||||
p->setFont(font);
|
|
||||||
p->drawText(x, y, w, h, AlignHCenter | AlignVCenter | ShowPrefix | DontClip, string);
|
|
||||||
}
|
|
||||||
|
|
||||||
QSize sizeHint()
|
|
||||||
{
|
|
||||||
return QFontMetrics(font).size(AlignHCenter | AlignVCenter | ShowPrefix | DontClip, string);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
QString string;
|
|
||||||
QFont font;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : GeometryGUI()
|
// function : GeometryGUI()
|
||||||
@ -122,19 +90,17 @@ bool GeometryGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
{
|
{
|
||||||
GeometryGUI::GetOrCreateGeometryGUI(parent);
|
GeometryGUI::GetOrCreateGeometryGUI(parent);
|
||||||
|
|
||||||
QMenuBar* Mb = GeomGUI->GetDesktop()->getMainMenuBar();
|
QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
|
||||||
bool ViewOCC;
|
bool ViewOCC;
|
||||||
|
|
||||||
if(GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC)
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC)
|
||||||
ViewOCC = true;
|
ViewOCC = true;
|
||||||
else if(GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK)
|
else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK)
|
||||||
ViewOCC = false;
|
ViewOCC = false;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Mb->setItemEnabled(404, ViewOCC);//Sketch
|
Mb->setItemEnabled(404, ViewOCC);//SKETCHER
|
||||||
Mb->setItemEnabled(405, ViewOCC);//Sketch
|
|
||||||
Mb->setItemEnabled(406, ViewOCC);//Sketch
|
|
||||||
|
|
||||||
Mb->setItemEnabled(603, ViewOCC);//SuppressFace
|
Mb->setItemEnabled(603, ViewOCC);//SuppressFace
|
||||||
Mb->setItemEnabled(604, ViewOCC);//SuppressHole
|
Mb->setItemEnabled(604, ViewOCC);//SuppressHole
|
||||||
@ -142,9 +108,6 @@ bool GeometryGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
Mb->setItemEnabled(413, ViewOCC);// ShadingColor Settings
|
Mb->setItemEnabled(413, ViewOCC);// ShadingColor Settings
|
||||||
Mb->setItemEnabled(414, ViewOCC);// Isos Settings
|
Mb->setItemEnabled(414, ViewOCC);// Isos Settings
|
||||||
|
|
||||||
if (GeomGUI->GetState() == CURRENT_SKETCH && theCommandID != 404 && theCommandID != 4041 && theCommandID != 4042 && theCommandID != 4043 && theCommandID != 4044 && theCommandID != 4045 && theCommandID != 4046 && theCommandID != 4047 && theCommandID != 4048 && theCommandID != 4051 && theCommandID != 4052 && theCommandID != 4053 && theCommandID != 4061 && theCommandID != 4062 && theCommandID != 4063 && theCommandID != 4064 && theCommandID != 4065)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if(theCommandID == 111 || // MENU FILE - IMPORT BREP
|
if(theCommandID == 111 || // MENU FILE - IMPORT BREP
|
||||||
theCommandID == 112 || // MENU FILE - IMPORT IGES
|
theCommandID == 112 || // MENU FILE - IMPORT IGES
|
||||||
theCommandID == 113 || // MENU FILE - IMPORT STEP
|
theCommandID == 113 || // MENU FILE - IMPORT STEP
|
||||||
@ -153,11 +116,10 @@ bool GeometryGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
theCommandID == 123 || // MENU FILE - EXPORT STEP
|
theCommandID == 123 || // MENU FILE - EXPORT STEP
|
||||||
theCommandID == 31 || // MENU EDIT - COPY
|
theCommandID == 31 || // MENU EDIT - COPY
|
||||||
theCommandID == 33 || // MENU EDIT - DELETE
|
theCommandID == 33 || // MENU EDIT - DELETE
|
||||||
theCommandID == 411 || // MENU SETTINGS - COPY
|
theCommandID == 411 || // MENU SETTINGS - ADD IN STUDY
|
||||||
theCommandID == 412 || // MENU SETTINGS - ADD IN STUDY
|
theCommandID == 412 || // MENU SETTINGS - SHADING COLOR
|
||||||
theCommandID == 413 || // MENU SETTINGS - SHADING COLOR
|
theCommandID == 413 || // MENU SETTINGS - ISOS
|
||||||
theCommandID == 414 || // MENU SETTINGS - ISOS
|
theCommandID == 414 || // MENU SETTINGS - STEP VALUE FOR SPIN BOXES
|
||||||
theCommandID == 415 || // MENU SETTINGS - STEP VALUE FOR SPIN BOXES
|
|
||||||
theCommandID == 5103 || // MENU TOOLS - CHECK GEOMETRY
|
theCommandID == 5103 || // MENU TOOLS - CHECK GEOMETRY
|
||||||
theCommandID == 8032 || // POPUP VIEWER - COLOR
|
theCommandID == 8032 || // POPUP VIEWER - COLOR
|
||||||
theCommandID == 8033 || // POPUP VIEWER - TRANSPARENCY
|
theCommandID == 8033 || // POPUP VIEWER - TRANSPARENCY
|
||||||
@ -177,27 +139,6 @@ bool GeometryGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
if(!GeomGUI->LoadLibrary("libDisplayGUI.so"))
|
if(!GeomGUI->LoadLibrary("libDisplayGUI.so"))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if(theCommandID == 404 || // SKETCHER
|
|
||||||
theCommandID == 4041 || // SKETCHER - POPUP VIEWER - SEGMENT
|
|
||||||
theCommandID == 4042 || // SKETCHER - POPUP VIEWER - ARC
|
|
||||||
theCommandID == 4043 || // SKETCHER - POPUP VIEWER - SET ANGLE
|
|
||||||
theCommandID == 4044 || // SKETCHER - POPUP VIEWER - SET X
|
|
||||||
theCommandID == 4045 || // SKETCHER - POPUP VIEWER - SET Y
|
|
||||||
theCommandID == 4046 || // SKETCHER - POPUP VIEWER - DELETE
|
|
||||||
theCommandID == 4047 || // SKETCHER - POPUP VIEWER - END
|
|
||||||
theCommandID == 4048 || // SKETCHER - POPUP VIEWER - CLOSE
|
|
||||||
theCommandID == 4051 || // SKETCHER - MENU - SET PLANE
|
|
||||||
theCommandID == 4052 || // SKETCHER - MENU - TANGENT
|
|
||||||
theCommandID == 4053 || // SKETCHER - MENU - PERPENDICULAR
|
|
||||||
theCommandID == 4061 || // SKETCHER - MENU - LENGTH
|
|
||||||
theCommandID == 4062 || // SKETCHER - MENU - ANGLE
|
|
||||||
theCommandID == 4063 || // SKETCHER - MENU - RADIUS
|
|
||||||
theCommandID == 4064 || // SKETCHER - MENU - X
|
|
||||||
theCommandID == 4065) { // SKETCHER - MENU - Y
|
|
||||||
// GEOMBase_Sketcher* mySketcherGUI = new GEOMBase_Sketcher();
|
|
||||||
// mySketcherGUI->OnGUIEvent(theCommandID, parent);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else if(theCommandID == 4011 || // MENU BASIC - POINT
|
else if(theCommandID == 4011 || // MENU BASIC - POINT
|
||||||
theCommandID == 4012 || // MENU BASIC - LINE
|
theCommandID == 4012 || // MENU BASIC - LINE
|
||||||
theCommandID == 4013 || // MENU BASIC - CIRCLE
|
theCommandID == 4013 || // MENU BASIC - CIRCLE
|
||||||
@ -224,6 +165,10 @@ bool GeometryGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
if(!GeomGUI->LoadLibrary("libGenerationGUI.so"))
|
if(!GeomGUI->LoadLibrary("libGenerationGUI.so"))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
else if(theCommandID == 404) { // SKETCHER
|
||||||
|
if(!GeomGUI->LoadLibrary("libSketcherGUI.so"))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
else if(theCommandID == 407 || // MENU BUILD - EXPLODE
|
else if(theCommandID == 407 || // MENU BUILD - EXPLODE
|
||||||
theCommandID == 4081 || // MENU BUILD - EDGE
|
theCommandID == 4081 || // MENU BUILD - EDGE
|
||||||
theCommandID == 4082 || // MENU BUILD - WIRE
|
theCommandID == 4082 || // MENU BUILD - WIRE
|
||||||
@ -300,8 +245,24 @@ bool GeometryGUI::OnKeyPress(QKeyEvent* pe, QAD_Desktop* parent, QAD_StudyFrame*
|
|||||||
{
|
{
|
||||||
GeometryGUI::GetOrCreateGeometryGUI(parent);
|
GeometryGUI::GetOrCreateGeometryGUI(parent);
|
||||||
|
|
||||||
if(GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
||||||
return false;
|
return false;
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : OnMouseMove()
|
||||||
|
// purpose : [static] manage mouse events
|
||||||
|
//=================================================================================
|
||||||
|
bool GeometryGUI::OnMouseMove(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame)
|
||||||
|
{
|
||||||
|
GeometryGUI::GetOrCreateGeometryGUI(parent);
|
||||||
|
|
||||||
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
||||||
|
return false;
|
||||||
|
else
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -314,19 +275,10 @@ bool GeometryGUI::OnMousePress(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFr
|
|||||||
{
|
{
|
||||||
GeometryGUI::GetOrCreateGeometryGUI(parent);
|
GeometryGUI::GetOrCreateGeometryGUI(parent);
|
||||||
|
|
||||||
if(GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(GeomGUI->GetState() == CURRENT_SKETCH) {
|
if(GeomGUI->myState == 0) {
|
||||||
GeomGUI->GetSketcher().ValidateEdge();
|
|
||||||
if(GeomGUI->GetSketcher().GetmyEdgesNumber() == 1) {
|
|
||||||
QMenuBar* Mb = GeomGUI->GetDesktop()->getMainMenuBar();
|
|
||||||
QMenuData* pp;
|
|
||||||
QMenuItem* item = Mb->findItem(405, &pp);
|
|
||||||
pp->setItemEnabled(405, true); // SKETCH CONTRAINTS
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(GeomGUI->GetState() == POINT_METHOD) {
|
|
||||||
if(!GeomGUI->LoadLibrary("libBasicGUI.so"))
|
if(!GeomGUI->LoadLibrary("libBasicGUI.so"))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -343,28 +295,6 @@ bool GeometryGUI::OnMousePress(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFr
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
|
||||||
// function : OnMouseMove()
|
|
||||||
// purpose : [static] manage mouse events
|
|
||||||
//=================================================================================
|
|
||||||
bool GeometryGUI::OnMouseMove(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame)
|
|
||||||
{
|
|
||||||
GeometryGUI::GetOrCreateGeometryGUI(parent);
|
|
||||||
|
|
||||||
if(GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
|
||||||
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
|
||||||
OCCViewer_ViewPort* vp = ((OCCViewer_ViewFrame*)studyFrame->getRightFrame()->getViewFrame())->getViewPort();
|
|
||||||
|
|
||||||
if(GeomGUI->GetState() == CURRENT_SKETCH)
|
|
||||||
GeomGUI->GetSketcher().MakeCurrentEdge(pe->x(), pe->y(), ((OCCViewer_ViewPort3d*)vp)->getView());
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : SetSettings()
|
// function : SetSettings()
|
||||||
// purpose : [static]
|
// purpose : [static]
|
||||||
@ -372,51 +302,44 @@ bool GeometryGUI::OnMouseMove(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFra
|
|||||||
bool GeometryGUI::SetSettings(QAD_Desktop* parent)
|
bool GeometryGUI::SetSettings(QAD_Desktop* parent)
|
||||||
{
|
{
|
||||||
GeometryGUI::GetOrCreateGeometryGUI(parent);
|
GeometryGUI::GetOrCreateGeometryGUI(parent);
|
||||||
|
QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
|
||||||
/* Shading Color */
|
QAD_Study* ActiveStudy = parent->getActiveStudy();
|
||||||
QString SCr = QAD_CONFIG->getSetting("Geometry:SettingsShadingColorRed");
|
|
||||||
QString SCg = QAD_CONFIG->getSetting("Geometry:SettingsShadingColorGreen");
|
|
||||||
QString SCb = QAD_CONFIG->getSetting("Geometry:SettingsShadingColorBlue");
|
|
||||||
if(!SCr.isEmpty() && !SCg.isEmpty() && !SCb.isEmpty())
|
|
||||||
GeomGUI->GetShadingColor() = Quantity_Color (SCr.toInt()/255., SCg.toInt()/255., SCb.toInt()/255., Quantity_TOC_RGB);
|
|
||||||
|
|
||||||
/* Wireframe or Shading */
|
/* Wireframe or Shading */
|
||||||
int DisplayMode = 0;
|
int DisplayMode = 0;
|
||||||
if(parent->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
if(ActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)parent->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)ActiveStudy->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
|
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
DisplayMode = ic->DisplayMode();
|
DisplayMode = ic->DisplayMode();
|
||||||
}
|
}
|
||||||
else if(parent->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
|
else if(ActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
|
||||||
VTKViewer_RenderWindowInteractor* myRenderInter = ((VTKViewer_ViewFrame*)parent->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
|
VTKViewer_RenderWindowInteractor* myRenderInter = ((VTKViewer_ViewFrame*)ActiveStudy->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
|
||||||
DisplayMode = myRenderInter->GetDisplayMode();
|
DisplayMode = myRenderInter->GetDisplayMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(DisplayMode == 1)
|
if(DisplayMode == 1)
|
||||||
parent->menuBar()->changeItem(211, tr("GEOM_MEN_WIREFRAME"));
|
Mb->changeItem(211, tr("GEOM_MEN_WIREFRAME"));
|
||||||
else
|
else
|
||||||
parent->menuBar()->changeItem(211, tr("GEOM_MEN_SHADING"));
|
Mb->changeItem(211, tr("GEOM_MEN_SHADING"));
|
||||||
|
|
||||||
QMenuData* pp;
|
|
||||||
if(parent->menuBar()->findItem(411, &pp))
|
|
||||||
pp->removeItem(411);
|
|
||||||
|
|
||||||
/* Add in Study */
|
/* Add in Study */
|
||||||
QString AddInStudy = QAD_CONFIG->getSetting("Geometry:SettingsAddInStudy");
|
QString AddInStudy = QAD_CONFIG->getSetting("Geometry:SettingsAddInStudy");
|
||||||
|
int Settings_AddInStudy;
|
||||||
if(!AddInStudy.isEmpty())
|
if(!AddInStudy.isEmpty())
|
||||||
GeomGUI->GetSettings_AddInStudy() = AddInStudy.toInt();
|
Settings_AddInStudy = AddInStudy.toInt();
|
||||||
else
|
else
|
||||||
GeomGUI->GetSettings_AddInStudy() = 1;
|
Settings_AddInStudy = 1;
|
||||||
parent->menuBar()->findItem(412, &pp);
|
Mb->setItemChecked(411, Settings_AddInStudy);
|
||||||
pp->setItemChecked(412, GeomGUI->GetSettings_AddInStudy());
|
|
||||||
|
|
||||||
/* step value */
|
/* step value */
|
||||||
QString S = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep");
|
QString S = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep");
|
||||||
if(S.isEmpty())
|
if(S.isEmpty())
|
||||||
QAD_CONFIG->addSetting("Geometry:SettingsGeomStep", "100");
|
QAD_CONFIG->addSetting("Geometry:SettingsGeomStep", "100");
|
||||||
|
|
||||||
|
|
||||||
/* isos */
|
/* isos */
|
||||||
QAD_Study* ActiveStudy = parent->getActiveStudy();
|
|
||||||
int count = ActiveStudy->getStudyFramesCount();
|
int count = ActiveStudy->getStudyFramesCount();
|
||||||
|
|
||||||
bool ViewOCC = false;
|
bool ViewOCC = false;
|
||||||
@ -436,11 +359,7 @@ bool GeometryGUI::SetSettings(QAD_Desktop* parent)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QMenuBar* Mb = GeomGUI->GetDesktop()->getMainMenuBar();
|
Mb->setItemEnabled(404, ViewOCC);//SKETCHER
|
||||||
|
|
||||||
Mb->setItemEnabled(404, ViewOCC);//Sketch
|
|
||||||
Mb->setItemEnabled(405, ViewOCC);//Sketch
|
|
||||||
Mb->setItemEnabled(406, ViewOCC);//Sketch
|
|
||||||
|
|
||||||
Mb->setItemEnabled(603, ViewOCC);//SuppressFace
|
Mb->setItemEnabled(603, ViewOCC);//SuppressFace
|
||||||
Mb->setItemEnabled(604, ViewOCC);//SuppressHole
|
Mb->setItemEnabled(604, ViewOCC);//SuppressHole
|
||||||
@ -460,13 +379,20 @@ void GeometryGUI::DefinePopup(QString & theContext, QString & theParent, QString
|
|||||||
{
|
{
|
||||||
GeometryGUI::GetOrCreateGeometryGUI(QAD_Application::getDesktop());
|
GeometryGUI::GetOrCreateGeometryGUI(QAD_Application::getDesktop());
|
||||||
|
|
||||||
SALOME_Selection* Sel = SALOME_Selection::Selection(GeomGUI->GetActiveStudy()->getSelection());
|
QAD_Study* ActiveStudy = QAD_Application::getDesktop()->getActiveStudy();
|
||||||
|
SALOME_Selection* Sel = SALOME_Selection::Selection(ActiveStudy->getSelection());
|
||||||
theObject = "";
|
theObject = "";
|
||||||
|
theContext = "";
|
||||||
|
|
||||||
|
if((theParent.compare("Viewer") == 0)) {
|
||||||
|
if(Sel->IObjectCount() == 0)
|
||||||
|
theContext = "NothingSelected";
|
||||||
|
}
|
||||||
|
|
||||||
if(Sel->IObjectCount() == 1) {
|
if(Sel->IObjectCount() == 1) {
|
||||||
Handle(SALOME_InteractiveObject) IO = Sel->firstIObject();
|
Handle(SALOME_InteractiveObject) IO = Sel->firstIObject();
|
||||||
if(IO->hasEntry()) {
|
if(IO->hasEntry()) {
|
||||||
SALOMEDS::SObject_var sobj = GeomGUI->GetActiveStudy()->getStudyDocument()->FindObjectID(IO->getEntry());
|
SALOMEDS::SObject_var sobj = ActiveStudy->getStudyDocument()->FindObjectID(IO->getEntry());
|
||||||
if(!sobj->_is_nil()) {
|
if(!sobj->_is_nil()) {
|
||||||
SALOMEDS::SComponent_var scomp = sobj->GetFatherComponent();
|
SALOMEDS::SComponent_var scomp = sobj->GetFatherComponent();
|
||||||
if(strcmp(scomp->GetID(), IO->getEntry()) == 0) {
|
if(strcmp(scomp->GetID(), IO->getEntry()) == 0) {
|
||||||
@ -477,19 +403,6 @@ void GeometryGUI::DefinePopup(QString & theContext, QString & theParent, QString
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if((theParent.compare("Viewer")==0)) {
|
|
||||||
if(GeomGUI->GetState() == CURRENT_SKETCH)
|
|
||||||
theContext = "Sketch";
|
|
||||||
else {
|
|
||||||
if(Sel->IObjectCount() > 0)
|
|
||||||
theContext = "";
|
|
||||||
else
|
|
||||||
theContext = "NothingSelected";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
theContext = "";
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -503,322 +416,21 @@ bool GeometryGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QStr
|
|||||||
{
|
{
|
||||||
GeometryGUI::GetOrCreateGeometryGUI(parent);
|
GeometryGUI::GetOrCreateGeometryGUI(parent);
|
||||||
|
|
||||||
/* Deactivate any non modal dialog box to get the neutral point */
|
if(!GeomGUI->LoadLibrary("libGEOMBase.so"))
|
||||||
GeomGUI->EmitSignalDeactivateDialog();
|
|
||||||
|
|
||||||
Engines::Component_var comp = GeomGUI->GetDesktop()->getEngine("FactoryServer", "GEOM");
|
|
||||||
GEOM::GEOM_Gen_var myComponentGeom = GEOM::GEOM_Gen::_narrow(comp);
|
|
||||||
|
|
||||||
SALOME_Selection* Sel = SALOME_Selection::Selection(GeomGUI->GetActiveStudy()->getSelection());
|
|
||||||
int nbSel = Sel->IObjectCount();
|
|
||||||
|
|
||||||
if((nbSel == 0) && (theContext.compare("Sketch")!=0))
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
//Load Function BuildPresentation
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OSD_Function osdF = GeomGUI->myGUILibrary.DlSymb("CustomPopup");
|
||||||
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
|
CP (*f1) = NULL;
|
||||||
if(theParent.compare("Viewer")==0) {
|
if(osdF != NULL) {
|
||||||
if(theContext.compare("Sketch")==0) {
|
f1 = (bool (*) (QAD_Desktop*, QPopupMenu*, const QString&,
|
||||||
SketchStatus myCS = GeomGUI->GetSketcher().GetCurrentStatus();
|
const QString&, const QString&)) osdF;
|
||||||
popup->setCheckable(TRUE);
|
(*f1)(parent, popup, theContext, theParent, theObject);
|
||||||
if(myCS == SEGMENT) {
|
|
||||||
popup->setItemChecked(4041,true); //Sketch Segment Menu
|
|
||||||
popup->setItemChecked(4042,false); //Sketch Arc Menu
|
|
||||||
}
|
|
||||||
else if(myCS == ARC_CHORD) {
|
|
||||||
popup->setItemChecked(4041,false); //Sketch Segment Menu
|
|
||||||
popup->setItemChecked(4042,true); //Sketch Arc Menu
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else if(theObject.compare("Component") == 0) {
|
|
||||||
popup->removeItem(QAD_DisplayOnly_Popup_ID);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
QFont f = QApplication::font();
|
|
||||||
f.setBold( TRUE );
|
|
||||||
if(nbSel==1) {
|
|
||||||
Handle(SALOME_InteractiveObject) IObject = Sel->firstIObject();
|
|
||||||
popup->removeItem(QAD_TopLabel_Popup_ID);
|
|
||||||
popup->insertItem(new CustomItem (QString(IObject->getName()), f), QAD_TopLabel_Popup_ID, 0);
|
|
||||||
if(IObject->hasEntry())
|
|
||||||
popup->setItemEnabled(804, false); //Add in Study Menu
|
|
||||||
else
|
|
||||||
popup->setItemEnabled(804, true); //Add in Study Menu
|
|
||||||
|
|
||||||
// if(IObject->IsKind(STANDARD_TYPE(GEOM_InteractiveObject))) {
|
|
||||||
// Standard_Boolean found;
|
|
||||||
// Handle(GEOM_AISShape) Result = GeomGUI->ConvertIOinGEOMAISShape(IObject, found, true);
|
|
||||||
|
|
||||||
// if(found) {
|
|
||||||
// if(Result->DisplayMode() == 1)
|
|
||||||
// popup->changeItem(8031, tr("GEOM_MEN_WIREFRAME")); //Shading/Wireframe Menu
|
|
||||||
// else
|
|
||||||
// popup->changeItem(8031, tr("GEOM_MEN_SHADING")); //Shading/Wireframe Menu
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
if(!(v3d->isInViewer(IObject) && v3d->isVisible(IObject)))
|
|
||||||
popup->removeItem(QAD_Erase_Popup_ID);
|
|
||||||
else
|
|
||||||
popup->removeItem(QAD_Display_Popup_ID);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
popup->removeItem(QAD_DisplayOnly_Popup_ID);
|
|
||||||
popup->removeItem(QAD_TopLabel_Popup_ID);
|
|
||||||
popup->insertItem(new CustomItem (tr("GEOM_MEN_POPUP_NAME").arg(nbSel), f), QAD_TopLabel_Popup_ID, 0);
|
|
||||||
popup->setItemEnabled(804, false); //Add in Study Menu
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else if(theParent.compare("ObjectBrowser")==0) {
|
|
||||||
popup->removeItem(QAD_TopLabel_Popup_ID);
|
|
||||||
int id = popup->idAt(0); // separator
|
|
||||||
if(id < 0)
|
|
||||||
popup->removeItem(id);
|
|
||||||
|
|
||||||
// checking for GEOM label in the selected list
|
|
||||||
SALOME_ListIteratorOfListIO It(Sel->StoredIObjects());
|
|
||||||
Handle(SALOME_InteractiveObject) anIObject;
|
|
||||||
|
|
||||||
bool useSubItems = false;
|
|
||||||
bool needOpen = false;
|
|
||||||
bool needDisplay = false;
|
|
||||||
bool needErase = false;
|
|
||||||
SALOMEDS::GenericAttribute_var aTmpAttr;
|
|
||||||
for(;It.More();It.Next()) {
|
|
||||||
anIObject = It.Value();
|
|
||||||
if(!anIObject->hasEntry())
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if(v3d->isInViewer(anIObject) && v3d->isVisible(anIObject))
|
|
||||||
needErase = true;
|
|
||||||
else
|
|
||||||
needDisplay = true;
|
|
||||||
SALOMEDS::SObject_var obj = GeomGUI->GetActiveStudy()->getStudyDocument()->FindObjectID(anIObject->getEntry());
|
|
||||||
if(!obj->_is_nil()) {
|
|
||||||
GEOM::GEOM_Shape_var aShape;
|
|
||||||
if(obj->FindAttribute(aTmpAttr, "AttributeIOR")) {
|
|
||||||
char *str = SALOMEDS::AttributeIOR::_narrow(aTmpAttr)->Value();
|
|
||||||
if(str && strlen(str))
|
|
||||||
aShape = myComponentGeom->GetIORFromString(str);
|
|
||||||
}
|
|
||||||
else if(obj->FindAttribute(aTmpAttr, "AttributePersistentRef"))
|
|
||||||
needOpen = true;
|
|
||||||
|
|
||||||
if(aShape->_is_nil()) {
|
|
||||||
SALOMEDS::ChildIterator_var anIter = GeomGUI->GetActiveStudy()->getStudyDocument()->NewChildIterator(obj);
|
|
||||||
while(anIter->More()) {
|
|
||||||
SALOMEDS::SObject_var subobj = anIter->Value();
|
|
||||||
if(subobj->FindAttribute(aTmpAttr, "AttributeIOR")) {
|
|
||||||
useSubItems = true;
|
|
||||||
needErase = true;
|
|
||||||
needDisplay = true;
|
|
||||||
}
|
|
||||||
else if(subobj->FindAttribute(aTmpAttr, "AttributePersistentRef")) {
|
|
||||||
needOpen = true;
|
|
||||||
useSubItems = true;
|
|
||||||
}
|
|
||||||
anIter->Next();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// remove useless popup items
|
|
||||||
if(nbSel != 1)
|
|
||||||
popup->removeItem(901); // rename
|
|
||||||
if(useSubItems)
|
|
||||||
popup->removeItem(QAD_DisplayOnly_Popup_ID); // display only
|
|
||||||
|
|
||||||
if(!needOpen) {
|
|
||||||
int index = popup->indexOf(9024); // open
|
|
||||||
popup->removeItem(9024);
|
|
||||||
popup->removeItemAt(index); // separator under Open
|
|
||||||
|
|
||||||
if (!needDisplay)
|
|
||||||
popup->removeItem(QAD_Display_Popup_ID);
|
|
||||||
if (!needErase)
|
|
||||||
popup->removeItem(QAD_Erase_Popup_ID);
|
|
||||||
|
|
||||||
if(!needDisplay && !needErase) {
|
|
||||||
int id = popup->idAt(popup->count()-1); // last item
|
|
||||||
popup->removeItem(id); // separator
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
popup->removeItem(QAD_DisplayOnly_Popup_ID); // display only
|
|
||||||
popup->removeItem(QAD_Display_Popup_ID);
|
|
||||||
popup->removeItem(QAD_Erase_Popup_ID);
|
|
||||||
if (nbSel!=1) {
|
|
||||||
int id = popup->idAt(popup->count()-1); // last item
|
|
||||||
popup->removeItem(id); // separator
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if(GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
|
else
|
||||||
// MESSAGE ( " CUSTOM POPUP VIEWER VTK ")
|
|
||||||
if((theParent.compare("Viewer")==0)) {
|
|
||||||
popup->setItemEnabled(8034, false); //Isos Menu
|
|
||||||
if(theObject.compare("Component") == 0) {
|
|
||||||
popup->removeItem(QAD_DisplayOnly_Popup_ID);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//int id = popup->idAt(0);
|
|
||||||
QFont f = QApplication::font();
|
|
||||||
f.setBold( TRUE );
|
|
||||||
|
|
||||||
if(nbSel==1) {
|
|
||||||
Handle(SALOME_InteractiveObject) IObject = Sel->firstIObject();
|
|
||||||
popup->removeItem(QAD_TopLabel_Popup_ID);
|
|
||||||
popup->insertItem(new CustomItem (QString(IObject->getName()), f), QAD_TopLabel_Popup_ID, 0);
|
|
||||||
if(IObject->hasEntry()) {
|
|
||||||
popup->setItemEnabled(804, false); //Add in Study Menu
|
|
||||||
SALOMEDS::Study_var aStudy = GeomGUI->GetActiveStudy()->getStudyDocument();
|
|
||||||
SALOMEDS::SObject_var SO = aStudy->FindObjectID(IObject->getEntry());
|
|
||||||
SALOMEDS::GenericAttribute_var anAttr;
|
|
||||||
SALOMEDS::AttributeIOR_var anIOR;
|
|
||||||
// if(!SO->_is_nil()) {
|
|
||||||
// if(SO->FindAttribute(anAttr, "AttributeIOR")) {
|
|
||||||
// anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
|
|
||||||
// Standard_Boolean found;
|
|
||||||
// GEOM_Actor* Result = GeomGUI->ConvertIORinGEOMActor(anIOR->Value(), found, true);
|
|
||||||
// if(found) {
|
|
||||||
// if(Result->getDisplayMode() == 1)
|
|
||||||
// popup->changeItem(8031, tr("GEOM_MEN_WIREFRAME")); //Shading/Wireframe Menu
|
|
||||||
// else
|
|
||||||
// popup->changeItem(8031, tr("GEOM_MEN_SHADING")); //Shading/Wireframe Menu
|
|
||||||
|
|
||||||
// if(!Result->GetVisibility())
|
|
||||||
// popup->removeItem(QAD_Erase_Popup_ID);
|
|
||||||
// else
|
|
||||||
// popup->removeItem(QAD_Display_Popup_ID);
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// popup->removeItem(QAD_Erase_Popup_ID);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
else
|
|
||||||
popup->setItemEnabled(804, true); //Add in Study Menu
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
popup->removeItem(QAD_DisplayOnly_Popup_ID);
|
|
||||||
popup->removeItem(QAD_TopLabel_Popup_ID);
|
|
||||||
popup->insertItem( new CustomItem (tr("GEOM_MEN_POPUP_NAME").arg(nbSel), f), QAD_TopLabel_Popup_ID, 0);
|
|
||||||
popup->setItemEnabled(804, false); //Add in Study Menu
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else if(theParent.compare("ObjectBrowser")==0) {
|
|
||||||
popup->removeItem(QAD_TopLabel_Popup_ID);
|
|
||||||
int id = popup->idAt(0); // separator
|
|
||||||
if(id < 0)
|
|
||||||
popup->removeItem(id);
|
|
||||||
|
|
||||||
// checking for GEOM label in the selected list
|
|
||||||
SALOME_ListIteratorOfListIO It(Sel->StoredIObjects());
|
|
||||||
Handle(SALOME_InteractiveObject) anIObject;
|
|
||||||
|
|
||||||
bool useSubItems = false;
|
|
||||||
bool needOpen = false;
|
|
||||||
bool needDisplay = false;
|
|
||||||
bool needErase = false;
|
|
||||||
SALOMEDS::GenericAttribute_var aTmpAttr;
|
|
||||||
VTKViewer_RenderWindowInteractor* myRenderInter = ((VTKViewer_ViewFrame*)GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
|
|
||||||
for(;It.More();It.Next()) {
|
|
||||||
anIObject = It.Value();
|
|
||||||
if(!anIObject->hasEntry())
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if(myRenderInter->isInViewer(anIObject) && myRenderInter->isVisible(anIObject))
|
|
||||||
needErase = true;
|
|
||||||
else
|
|
||||||
needDisplay = true;
|
|
||||||
|
|
||||||
SALOMEDS::SObject_var obj = GeomGUI->GetActiveStudy()->getStudyDocument()->FindObjectID( anIObject->getEntry());
|
|
||||||
if(!obj->_is_nil()) {
|
|
||||||
GEOM::GEOM_Shape_var aShape;
|
|
||||||
if(obj->FindAttribute(aTmpAttr, "AttributeIOR")) {
|
|
||||||
char *str = SALOMEDS::AttributeIOR::_narrow(aTmpAttr)->Value();
|
|
||||||
if(str && strlen(str))
|
|
||||||
aShape = myComponentGeom->GetIORFromString(str);
|
|
||||||
}
|
|
||||||
else if(obj->FindAttribute(aTmpAttr, "AttributePersistentRef"))
|
|
||||||
needOpen = true;
|
|
||||||
|
|
||||||
if(aShape->_is_nil()) {
|
|
||||||
SALOMEDS::ChildIterator_var anIter = GeomGUI->GetActiveStudy()->getStudyDocument()->NewChildIterator(obj);
|
|
||||||
while(anIter->More()) {
|
|
||||||
SALOMEDS::SObject_var subobj = anIter->Value();
|
|
||||||
if(subobj->FindAttribute(aTmpAttr, "AttributeIOR")) {
|
|
||||||
useSubItems = true;
|
|
||||||
needDisplay = true;
|
|
||||||
needErase = true;
|
|
||||||
}
|
|
||||||
else if(subobj->FindAttribute(aTmpAttr, "AttributePersistentRef")) {
|
|
||||||
needOpen = true;
|
|
||||||
useSubItems = true;
|
|
||||||
}
|
|
||||||
anIter->Next();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// remove useless popup items
|
|
||||||
if(nbSel != 1)
|
|
||||||
popup->removeItem(901); // rename
|
|
||||||
if(useSubItems)
|
|
||||||
popup->removeItem(QAD_DisplayOnly_Popup_ID); // display only
|
|
||||||
|
|
||||||
if(!needOpen) {
|
|
||||||
int index = popup->indexOf(9024); // open
|
|
||||||
popup->removeItem(9024);
|
|
||||||
popup->removeItemAt(index); // separator under Open
|
|
||||||
|
|
||||||
if(!needDisplay)
|
|
||||||
popup->removeItem(QAD_Display_Popup_ID);
|
|
||||||
if(!needErase)
|
|
||||||
popup->removeItem(QAD_Erase_Popup_ID);
|
|
||||||
if(!needDisplay && !needErase) {
|
|
||||||
int id = popup->idAt(popup->count()-1); // last item
|
|
||||||
popup->removeItem(id); // separator
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
popup->removeItem(QAD_DisplayOnly_Popup_ID); // display only
|
|
||||||
popup->removeItem(QAD_Display_Popup_ID);
|
|
||||||
popup->removeItem(QAD_Erase_Popup_ID);
|
|
||||||
if(nbSel!=1) {
|
|
||||||
int id = popup->idAt(popup->count()-1); // last item
|
|
||||||
popup->removeItem(id); // separator
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else { // other viewer types not supported.
|
|
||||||
while(1) {
|
|
||||||
int id = popup->idAt(0);
|
|
||||||
if(id <= QAD_TopLabel_Popup_ID && id != -1)
|
|
||||||
popup->removeItemAt(0);
|
|
||||||
else
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
popup->removeItem(QAD_DisplayOnly_Popup_ID);
|
|
||||||
popup->removeItem(QAD_Display_Popup_ID);
|
|
||||||
popup->removeItem(QAD_Erase_Popup_ID);
|
|
||||||
int id = popup->idAt(popup->count()-1); // last item
|
|
||||||
if(id < 0 && id != -1)
|
|
||||||
popup->removeItem(id); // separator
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -831,19 +443,12 @@ void GeometryGUI::activeStudyChanged(QAD_Desktop* parent)
|
|||||||
GeometryGUI::GetOrCreateGeometryGUI(parent);
|
GeometryGUI::GetOrCreateGeometryGUI(parent);
|
||||||
|
|
||||||
if(GeomGUI != 0) {
|
if(GeomGUI != 0) {
|
||||||
if(GeomGUI->GetState() == CURRENT_SKETCH) {
|
QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
|
||||||
GeomGUI->GetSketcher().Clear();
|
|
||||||
GeomGUI->ResetState();
|
|
||||||
}
|
|
||||||
|
|
||||||
QMenuBar* Mb = GeomGUI->GetDesktop()->getMainMenuBar();
|
|
||||||
bool ViewOCC = false;
|
bool ViewOCC = false;
|
||||||
if(GeomGUI->GetDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC)
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC)
|
||||||
ViewOCC = true;
|
ViewOCC = true;
|
||||||
|
|
||||||
Mb->setItemEnabled(404, ViewOCC);//Sketch
|
Mb->setItemEnabled(404, ViewOCC);//SKETCHER
|
||||||
Mb->setItemEnabled(405, ViewOCC);//Sketch
|
|
||||||
Mb->setItemEnabled(406, ViewOCC);//Sketch
|
|
||||||
|
|
||||||
Mb->setItemEnabled(603, ViewOCC);//SuppressFace
|
Mb->setItemEnabled(603, ViewOCC);//SuppressFace
|
||||||
Mb->setItemEnabled(604, ViewOCC);//SuppressHole
|
Mb->setItemEnabled(604, ViewOCC);//SuppressHole
|
||||||
@ -851,7 +456,6 @@ void GeometryGUI::activeStudyChanged(QAD_Desktop* parent)
|
|||||||
Mb->setItemEnabled(413, ViewOCC);// ShadingColor Settings
|
Mb->setItemEnabled(413, ViewOCC);// ShadingColor Settings
|
||||||
Mb->setItemEnabled(414, ViewOCC);// Isos Settings
|
Mb->setItemEnabled(414, ViewOCC);// Isos Settings
|
||||||
|
|
||||||
//GeomGUI->EraseSimulationShape();
|
|
||||||
GeomGUI->EmitSignalCloseAllDialogs();
|
GeomGUI->EmitSignalCloseAllDialogs();
|
||||||
GeomGUI = 0;
|
GeomGUI = 0;
|
||||||
}
|
}
|
||||||
@ -877,8 +481,6 @@ void GeometryGUI::BuildPresentation(const Handle(SALOME_InteractiveObject)& theI
|
|||||||
f1 = (void (*) (const Handle(SALOME_InteractiveObject)&)) osdF;
|
f1 = (void (*) (const Handle(SALOME_InteractiveObject)&)) osdF;
|
||||||
(*f1)(theIO);
|
(*f1)(theIO);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
return;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,20 +47,16 @@ LIB_MOC = \
|
|||||||
GeometryGUI.h \
|
GeometryGUI.h \
|
||||||
|
|
||||||
LIB_CLIENT_IDL = SALOME_Exception.idl \
|
LIB_CLIENT_IDL = SALOME_Exception.idl \
|
||||||
GEOM_Gen.idl \
|
|
||||||
GEOM_Shape.idl \
|
|
||||||
SALOMEDS.idl \
|
SALOMEDS.idl \
|
||||||
SALOMEDS_Attributes.idl \
|
SALOMEDS_Attributes.idl
|
||||||
SALOME_ModuleCatalog.idl \
|
|
||||||
SALOME_Component.idl \
|
|
||||||
|
|
||||||
LIB_SERVER_IDL =
|
LIB_SERVER_IDL =
|
||||||
|
|
||||||
# additionnal information to compil and link file
|
# additionnal information to compil and link file
|
||||||
|
|
||||||
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
||||||
CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
|
CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
|
||||||
|
|
||||||
LDFLAGS += -lOCCViewer -lVTKViewer -lSalomeObject -lSalomeGUI -lGEOMClient -lGEOMObject -lGEOMSketcher -lGEOMContext -L${KERNEL_ROOT_DIR}/lib/salome
|
LDFLAGS += -lGEOMContext
|
||||||
|
|
||||||
@CONCLUDE@
|
@CONCLUDE@
|
||||||
|
@ -83,9 +83,9 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
{
|
{
|
||||||
GEOMToolsGUI* myGEOMToolsGUI = new GEOMToolsGUI();
|
GEOMToolsGUI* myGEOMToolsGUI = new GEOMToolsGUI();
|
||||||
myGEOMToolsGUI->myGeomGUI->EmitSignalDeactivateDialog();
|
myGEOMToolsGUI->myGeomGUI->EmitSignalDeactivateDialog();
|
||||||
SALOME_Selection* Sel = SALOME_Selection::Selection(myGEOMToolsGUI->myGeomGUI->GetActiveStudy()->getSelection());
|
SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection());
|
||||||
|
|
||||||
SALOMEDS::Study_var aStudy = myGEOMToolsGUI->myGeomGUI->GetActiveStudy()->getStudyDocument();
|
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
|
||||||
switch (theCommandID)
|
switch (theCommandID)
|
||||||
{
|
{
|
||||||
case 31: // COPY
|
case 31: // COPY
|
||||||
@ -100,74 +100,51 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
}
|
}
|
||||||
case 111: // IMPORT BREP
|
case 111: // IMPORT BREP
|
||||||
{
|
{
|
||||||
myGEOMToolsGUI->myGeomGUI->SetState(111);
|
myGEOMToolsGUI->Import(theCommandID);
|
||||||
myGEOMToolsGUI->Import();
|
|
||||||
myGEOMToolsGUI->myGeomGUI->ResetState();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 112: // IMPORT IGES
|
case 112: // IMPORT IGES
|
||||||
{
|
{
|
||||||
myGEOMToolsGUI->myGeomGUI->SetState(112);
|
myGEOMToolsGUI->Import(theCommandID);
|
||||||
myGEOMToolsGUI->Import();
|
|
||||||
myGEOMToolsGUI->myGeomGUI->ResetState();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 113: // IMPORT STEP
|
case 113: // IMPORT STEP
|
||||||
{
|
{
|
||||||
myGEOMToolsGUI->myGeomGUI->SetState(113);
|
myGEOMToolsGUI->Import(theCommandID);
|
||||||
myGEOMToolsGUI->Import();
|
|
||||||
myGEOMToolsGUI->myGeomGUI->ResetState();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 121: // EXPORT BREP
|
case 121: // EXPORT BREP
|
||||||
{
|
{
|
||||||
myGEOMToolsGUI->myGeomGUI->SetState(121);
|
myGEOMToolsGUI->Export(theCommandID);
|
||||||
myGEOMToolsGUI->Export();
|
|
||||||
myGEOMToolsGUI->myGeomGUI->ResetState();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 122: // EXPORT IGES
|
case 122: // EXPORT IGES
|
||||||
{
|
{
|
||||||
myGEOMToolsGUI->myGeomGUI->SetState(122);
|
myGEOMToolsGUI->Export(theCommandID);
|
||||||
myGEOMToolsGUI->Export();
|
|
||||||
myGEOMToolsGUI->myGeomGUI->ResetState();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 123: // EXPORT STEP
|
case 123: // EXPORT STEP
|
||||||
{
|
{
|
||||||
myGEOMToolsGUI->myGeomGUI->SetState(123);
|
myGEOMToolsGUI->Export(theCommandID);
|
||||||
myGEOMToolsGUI->Export();
|
|
||||||
myGEOMToolsGUI->myGeomGUI->ResetState();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 411: // SETTINGS - COPY
|
case 411: // SETTINGS - ADD IN STUDY
|
||||||
{
|
{
|
||||||
QMenuBar* Mb = myGEOMToolsGUI->myGeomGUI->GetDesktop()->getMainMenuBar();
|
QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
|
||||||
QMenuData* pp;
|
QMenuData* pp;
|
||||||
QMenuItem* item = parent->menuBar()->findItem(411, &pp);
|
QMenuItem* item = parent->menuBar()->findItem(411, &pp);
|
||||||
bool check = !pp->isItemChecked(411);
|
bool check = !pp->isItemChecked(411);
|
||||||
pp->setItemChecked(411, check);
|
pp->setItemChecked(411,check);
|
||||||
myGEOMToolsGUI->myGeomGUI->GetSettings_Copy() = check;
|
//myGEOMToolsGUI->myGeomGUI->GetSettings_AddInStudy() = check;
|
||||||
QAD_CONFIG->addSetting("Geometry:SettingsCopy", myGEOMToolsGUI->myGeomGUI->GetSettings_Copy());
|
QAD_CONFIG->addSetting("Geometry:SettingsAddInStudy", check);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 412: // SETTINGS - ADD IN STUDY
|
case 412: // SETTINGS - SHADING COLOR
|
||||||
{
|
{
|
||||||
QMenuBar* Mb = myGEOMToolsGUI->myGeomGUI->GetDesktop()->getMainMenuBar();
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
||||||
QMenuData* pp;
|
|
||||||
QMenuItem* item = parent->menuBar()->findItem(412, &pp);
|
|
||||||
bool check = !pp->isItemChecked(412);
|
|
||||||
pp->setItemChecked(412,check);
|
|
||||||
myGEOMToolsGUI->myGeomGUI->GetSettings_AddInStudy() = check;
|
|
||||||
QAD_CONFIG->addSetting("Geometry:SettingsAddInStudy", myGEOMToolsGUI->myGeomGUI->GetSettings_AddInStudy());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 413: // SETTINGS - SHADING COLOR
|
|
||||||
{
|
|
||||||
if(myGEOMToolsGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGEOMToolsGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
|
|
||||||
QString SCr = QAD_CONFIG->getSetting("Geometry:SettingsShadingColorRed");
|
QString SCr = QAD_CONFIG->getSetting("Geometry:SettingsShadingColorRed");
|
||||||
@ -182,9 +159,9 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
color = QColor ((int)Default.Red() * 255.0, (int)Default.Green()* 255.0, (int)Default.Blue() * 255.0);
|
color = QColor ((int)Default.Red() * 255.0, (int)Default.Green()* 255.0, (int)Default.Blue() * 255.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
QColor c = QColorDialog::getColor(color, myGEOMToolsGUI->myGeomGUI->GetDesktop());
|
QColor c = QColorDialog::getColor(color, QAD_Application::getDesktop());
|
||||||
if(c.isValid()) {
|
if(c.isValid()) {
|
||||||
myGEOMToolsGUI->myGeomGUI->GetShadingColor() = Quantity_Color(c.red() / 255.0, c.green() / 255.0, c.blue() / 255.0, Quantity_TOC_RGB);
|
//myGEOMToolsGUI->myGeomGUI->GetShadingColor() = Quantity_Color(c.red() / 255.0, c.green() / 255.0, c.blue() / 255.0, Quantity_TOC_RGB);
|
||||||
|
|
||||||
AIS_ListOfInteractive List;
|
AIS_ListOfInteractive List;
|
||||||
ic->DisplayedObjects(List);
|
ic->DisplayedObjects(List);
|
||||||
@ -196,7 +173,7 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
while(ite.More()) {
|
while(ite.More()) {
|
||||||
if(ite.Value()->IsInstance(STANDARD_TYPE(GEOM_AISShape))) {
|
if(ite.Value()->IsInstance(STANDARD_TYPE(GEOM_AISShape))) {
|
||||||
Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast(ite.Value());
|
Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast(ite.Value());
|
||||||
aSh->SetShadingColor(myGEOMToolsGUI->myGeomGUI->GetShadingColor());
|
aSh->SetShadingColor(Quantity_Color(c.red() / 255.0, c.green() / 255.0, c.blue() / 255.0, Quantity_TOC_RGB));
|
||||||
ic->Redisplay(aSh, Standard_True, Standard_True);
|
ic->Redisplay(aSh, Standard_True, Standard_True);
|
||||||
}
|
}
|
||||||
ite.Next();
|
ite.Next();
|
||||||
@ -210,12 +187,12 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 414: // SETTINGS - ISOS
|
case 413: // SETTINGS - ISOS
|
||||||
{
|
{
|
||||||
if(myGEOMToolsGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGEOMToolsGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
|
|
||||||
QString IsoU = QAD_CONFIG->getSetting("Geometry:SettingsIsoU");
|
QString IsoU = QAD_CONFIG->getSetting("Geometry:SettingsIsoU");
|
||||||
@ -229,7 +206,7 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
else
|
else
|
||||||
IsoV = "1";
|
IsoV = "1";
|
||||||
|
|
||||||
GEOMBase_NbIsosDlg* NbIsosDlg = new GEOMBase_NbIsosDlg(myGEOMToolsGUI->myGeomGUI->GetDesktop(), tr("GEOM_MEN_ISOS"), TRUE);
|
GEOMBase_NbIsosDlg* NbIsosDlg = new GEOMBase_NbIsosDlg(QAD_Application::getDesktop(), tr("GEOM_MEN_ISOS"), TRUE);
|
||||||
int UIso = IsoU.toInt();
|
int UIso = IsoU.toInt();
|
||||||
int VIso = IsoV.toInt();
|
int VIso = IsoV.toInt();
|
||||||
|
|
||||||
@ -270,7 +247,7 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
ic->UpdateCurrentViewer();
|
ic->UpdateCurrentViewer();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 415: // SETTINGS : STEP VALUE FOR SPIN BOXES
|
case 414: // SETTINGS : STEP VALUE FOR SPIN BOXES
|
||||||
{
|
{
|
||||||
QString step = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep");
|
QString step = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep");
|
||||||
if(step.isEmpty())
|
if(step.isEmpty())
|
||||||
@ -314,10 +291,10 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
aName = SALOMEDS::AttributeName::_narrow(anAttr);
|
aName = SALOMEDS::AttributeName::_narrow(anAttr);
|
||||||
|
|
||||||
QString nm = QString(aName->Value());
|
QString nm = QString(aName->Value());
|
||||||
nm = SALOMEGUI_NameDlg::getName(myGEOMToolsGUI->myGeomGUI->GetDesktop(), nm);
|
nm = SALOMEGUI_NameDlg::getName(QAD_Application::getDesktop(), nm);
|
||||||
if(!nm.isEmpty()) {
|
if(!nm.isEmpty()) {
|
||||||
QApplication::setOverrideCursor(Qt::waitCursor);
|
QApplication::setOverrideCursor(Qt::waitCursor);
|
||||||
myGEOMToolsGUI->myGeomGUI->GetActiveStudy()->renameIObject(IObject, nm);
|
QAD_Application::getDesktop()->getActiveStudy()->renameIObject(IObject, nm);
|
||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -327,7 +304,7 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
}
|
}
|
||||||
case 5103: // CHECK GEOMETRY
|
case 5103: // CHECK GEOMETRY
|
||||||
{
|
{
|
||||||
QAD_PyEditor* PyEditor = myGEOMToolsGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getPyEditor();
|
QAD_PyEditor* PyEditor = QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getPyEditor();
|
||||||
PyEditor->setText("from GEOM_usinggeom import *\n");
|
PyEditor->setText("from GEOM_usinggeom import *\n");
|
||||||
PyEditor->setText(">>> ");
|
PyEditor->setText(">>> ");
|
||||||
PyEditor->handleReturn();
|
PyEditor->handleReturn();
|
||||||
@ -335,15 +312,15 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
}
|
}
|
||||||
case 8032: // COLOR - POPUP VIEWER
|
case 8032: // COLOR - POPUP VIEWER
|
||||||
{
|
{
|
||||||
if(myGEOMToolsGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
|
||||||
// VTK
|
// VTK
|
||||||
VTKViewer_RenderWindowInteractor* myRenderInter = ((VTKViewer_ViewFrame*)myGEOMToolsGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
|
VTKViewer_RenderWindowInteractor* myRenderInter = ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
|
||||||
|
|
||||||
SALOME_ListIteratorOfListIO It(Sel->StoredIObjects());
|
SALOME_ListIteratorOfListIO It(Sel->StoredIObjects());
|
||||||
Handle(SALOME_InteractiveObject) FirstIOS = Sel->firstIObject();
|
Handle(SALOME_InteractiveObject) FirstIOS = Sel->firstIObject();
|
||||||
if(!FirstIOS.IsNull()) {
|
if(!FirstIOS.IsNull()) {
|
||||||
QColor initcolor = myRenderInter->GetColor(FirstIOS);
|
QColor initcolor = myRenderInter->GetColor(FirstIOS);
|
||||||
QColor c = QColorDialog::getColor( initcolor, myGEOMToolsGUI->myGeomGUI->GetDesktop());
|
QColor c = QColorDialog::getColor( initcolor, QAD_Application::getDesktop());
|
||||||
|
|
||||||
if(c.isValid()) {
|
if(c.isValid()) {
|
||||||
QApplication::setOverrideCursor(Qt::waitCursor);
|
QApplication::setOverrideCursor(Qt::waitCursor);
|
||||||
@ -355,7 +332,7 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(myGEOMToolsGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
Handle(SALOME_InteractiveObject) IO = Sel->firstIObject();
|
Handle(SALOME_InteractiveObject) IO = Sel->firstIObject();
|
||||||
Standard_Boolean found;
|
Standard_Boolean found;
|
||||||
Handle(GEOM_AISShape) Shape = myGEOMToolsGUI->myGeomBase->ConvertIOinGEOMAISShape(IO, found, true);
|
Handle(GEOM_AISShape) Shape = myGEOMToolsGUI->myGeomBase->ConvertIOinGEOMAISShape(IO, found, true);
|
||||||
@ -363,7 +340,7 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
Quantity_Color CSFColor;
|
Quantity_Color CSFColor;
|
||||||
Shape->Color(CSFColor);
|
Shape->Color(CSFColor);
|
||||||
|
|
||||||
QColor c = QColorDialog::getColor(QColor(CSFColor.Red() * 255.0, CSFColor.Green()* 255.0, CSFColor.Blue() * 255.0), myGEOMToolsGUI->myGeomGUI->GetDesktop());
|
QColor c = QColorDialog::getColor(QColor(CSFColor.Red() * 255.0, CSFColor.Green()* 255.0, CSFColor.Blue() * 255.0), QAD_Application::getDesktop());
|
||||||
|
|
||||||
if(c.isValid()) {
|
if(c.isValid()) {
|
||||||
CSFColor = Quantity_Color (c.red()/255., c.green()/255., c.blue()/255., Quantity_TOC_RGB);
|
CSFColor = Quantity_Color (c.red()/255., c.green()/255., c.blue()/255., Quantity_TOC_RGB);
|
||||||
@ -389,8 +366,8 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
{
|
{
|
||||||
OCCViewer_Viewer3d* v3d;
|
OCCViewer_Viewer3d* v3d;
|
||||||
Handle(AIS_InteractiveContext) ic;
|
Handle(AIS_InteractiveContext) ic;
|
||||||
if(myGEOMToolsGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC) {
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGEOMToolsGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
}
|
}
|
||||||
GEOMBase_TransparencyDlg *aDlg = new GEOMBase_TransparencyDlg(parent, "", Sel, ic);
|
GEOMBase_TransparencyDlg *aDlg = new GEOMBase_TransparencyDlg(parent, "", Sel, ic);
|
||||||
@ -398,10 +375,10 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
}
|
}
|
||||||
case 8034: // ISOS - POPUP VIEWER
|
case 8034: // ISOS - POPUP VIEWER
|
||||||
{
|
{
|
||||||
if(myGEOMToolsGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGEOMToolsGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
|
|
||||||
ic->InitCurrent();
|
ic->InitCurrent();
|
||||||
@ -420,7 +397,7 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
IsoV = "1";
|
IsoV = "1";
|
||||||
|
|
||||||
GEOMBase_NbIsosDlg * NbIsosDlg =
|
GEOMBase_NbIsosDlg * NbIsosDlg =
|
||||||
new GEOMBase_NbIsosDlg(myGEOMToolsGUI->myGeomGUI->GetDesktop(), tr("GEOM_MEN_ISOS"), TRUE);
|
new GEOMBase_NbIsosDlg(QAD_Application::getDesktop(), tr("GEOM_MEN_ISOS"), TRUE);
|
||||||
|
|
||||||
NbIsosDlg->SpinBoxU->setValue(IsoU.toInt());
|
NbIsosDlg->SpinBoxU->setValue(IsoU.toInt());
|
||||||
NbIsosDlg->SpinBoxV->setValue(IsoV.toInt());
|
NbIsosDlg->SpinBoxV->setValue(IsoV.toInt());
|
||||||
@ -471,7 +448,7 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
if(!obj->FindAttribute(anAttr, "AttributeIOR") &&
|
if(!obj->FindAttribute(anAttr, "AttributeIOR") &&
|
||||||
obj->FindAttribute(anAttr, "AttributePersistentRef")) {
|
obj->FindAttribute(anAttr, "AttributePersistentRef")) {
|
||||||
// load
|
// load
|
||||||
Engines::Component_var comp = myGEOMToolsGUI->myGeomGUI->GetDesktop()->getEngine("FactoryServer","GEOM");
|
Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer","GEOM");
|
||||||
if (!CORBA::is_nil(comp)) {
|
if (!CORBA::is_nil(comp)) {
|
||||||
SALOMEDS::Driver_var driver = SALOMEDS::Driver::_narrow(comp);
|
SALOMEDS::Driver_var driver = SALOMEDS::Driver::_narrow(comp);
|
||||||
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
|
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
|
||||||
@ -502,101 +479,6 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
// function : ConvertIORinGEOMAISShape()
|
|
||||||
// purpose :
|
|
||||||
//=======================================================================
|
|
||||||
Handle(GEOM_AISShape) GEOMToolsGUI::ConvertIORinGEOMAISShape(const char * IOR, Standard_Boolean& testResult, bool onlyInActiveView)
|
|
||||||
{
|
|
||||||
Handle(GEOM_AISShape) resultShape;
|
|
||||||
testResult = false;
|
|
||||||
int nbSf = myGeomGUI->GetActiveStudy()->getStudyFramesCount();
|
|
||||||
for(int i = 0; i < nbSf; i++) {
|
|
||||||
QAD_StudyFrame* sf = myGeomGUI->GetActiveStudy()->getStudyFrame(i);
|
|
||||||
if(sf->getTypeView() == VIEW_OCC) {
|
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)sf->getRightFrame()->getViewFrame())->getViewer();
|
|
||||||
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
|
||||||
|
|
||||||
AIS_ListOfInteractive List;
|
|
||||||
ic->DisplayedObjects(List);
|
|
||||||
AIS_ListOfInteractive List1;
|
|
||||||
ic->ObjectsInCollector(List1);
|
|
||||||
List.Append(List1);
|
|
||||||
|
|
||||||
AIS_ListIteratorOfListOfInteractive ite(List);
|
|
||||||
while(ite.More()) {
|
|
||||||
if(ite.Value()->IsInstance(STANDARD_TYPE(GEOM_AISShape))) {
|
|
||||||
Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast(ite.Value());
|
|
||||||
if(aSh->hasIO()) {
|
|
||||||
Handle(GEOM_InteractiveObject) GIO = Handle(GEOM_InteractiveObject)::DownCast(aSh->getIO());
|
|
||||||
Standard_CString theIOR = GIO->getIOR();
|
|
||||||
if(strcmp(IOR, theIOR) == 0) {
|
|
||||||
if(onlyInActiveView) {
|
|
||||||
if(sf == myGeomGUI->GetActiveStudy()->getActiveStudyFrame()) {
|
|
||||||
testResult = true;
|
|
||||||
resultShape = aSh;
|
|
||||||
return resultShape;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
testResult = true;
|
|
||||||
resultShape = aSh;
|
|
||||||
return resultShape;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ite.Next();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return resultShape;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
// function : ConvertIORinGEOMActor()
|
|
||||||
// purpose :
|
|
||||||
//=======================================================================
|
|
||||||
GEOM_Actor* GEOMToolsGUI::ConvertIORinGEOMActor(const char* IOR, Standard_Boolean& testResult, bool onlyInActiveView)
|
|
||||||
{
|
|
||||||
int nbSf = myGeomGUI->GetActiveStudy()->getStudyFramesCount();
|
|
||||||
for(int i = 0; i < nbSf; i++) {
|
|
||||||
QAD_StudyFrame* sf = myGeomGUI->GetActiveStudy()->getStudyFrame(i);
|
|
||||||
if(sf->getTypeView() == VIEW_VTK) {
|
|
||||||
vtkRenderer* Renderer = ((VTKViewer_ViewFrame*)sf->getRightFrame()->getViewFrame())->getRenderer();
|
|
||||||
vtkActorCollection* theActors = Renderer->GetActors();
|
|
||||||
theActors->InitTraversal();
|
|
||||||
vtkActor *ac = theActors->GetNextActor();
|
|
||||||
while(!(ac==NULL)) {
|
|
||||||
if( ac->IsA("GEOM_Actor")) {
|
|
||||||
GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(ac);
|
|
||||||
if(anActor->hasIO()) {
|
|
||||||
Handle(GEOM_InteractiveObject) GIO = Handle(GEOM_InteractiveObject)::DownCast(anActor->getIO());
|
|
||||||
Standard_CString theIOR = GIO->getIOR();
|
|
||||||
if(strcmp(IOR, theIOR) == 0) {
|
|
||||||
if(onlyInActiveView) {
|
|
||||||
if(sf == myGeomGUI->GetActiveStudy()->getActiveStudyFrame()) {
|
|
||||||
testResult = true;
|
|
||||||
return anActor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
testResult = true;
|
|
||||||
return anActor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ac = theActors->GetNextActor();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
testResult = false;
|
|
||||||
return GEOM_Actor::New();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//===============================================================================
|
//===============================================================================
|
||||||
// function : OnEditDelete()
|
// function : OnEditDelete()
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -604,26 +486,26 @@ GEOM_Actor* GEOMToolsGUI::ConvertIORinGEOMActor(const char* IOR, Standard_Boolea
|
|||||||
void GEOMToolsGUI::OnEditDelete()
|
void GEOMToolsGUI::OnEditDelete()
|
||||||
{
|
{
|
||||||
if ( QAD_MessageBox::warn2
|
if ( QAD_MessageBox::warn2
|
||||||
( myGeomGUI->GetDesktop(),
|
( QAD_Application::getDesktop(),
|
||||||
tr ("GEOM_WRN_WARNING"),
|
tr ("GEOM_WRN_WARNING"),
|
||||||
tr ("GEOM_REALLY_DELETE"),
|
tr ("GEOM_REALLY_DELETE"),
|
||||||
tr ("GEOM_BUT_YES"), tr ("GEOM_BUT_NO"), 1, 0, 0) != 1 )
|
tr ("GEOM_BUT_YES"), tr ("GEOM_BUT_NO"), 1, 0, 0) != 1 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int nbSf = myGeomGUI->GetActiveStudy()->getStudyFramesCount();
|
int nbSf = QAD_Application::getDesktop()->getActiveStudy()->getStudyFramesCount();
|
||||||
|
|
||||||
Standard_Boolean found;
|
Standard_Boolean found;
|
||||||
SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
|
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
|
||||||
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
|
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
|
||||||
SALOMEDS::GenericAttribute_var anAttr;
|
SALOMEDS::GenericAttribute_var anAttr;
|
||||||
SALOMEDS::AttributeIOR_var anIOR;
|
SALOMEDS::AttributeIOR_var anIOR;
|
||||||
|
|
||||||
SALOME_Selection* Sel = SALOME_Selection::Selection( myGeomGUI->GetActiveStudy()->getSelection() );
|
SALOME_Selection* Sel = SALOME_Selection::Selection( QAD_Application::getDesktop()->getActiveStudy()->getSelection() );
|
||||||
SALOME_ListIteratorOfListIO It( Sel->StoredIObjects() );
|
SALOME_ListIteratorOfListIO It( Sel->StoredIObjects() );
|
||||||
for(;It.More();It.Next()) {
|
for(;It.More();It.Next()) {
|
||||||
Handle(SALOME_InteractiveObject) IObject = It.Value();
|
Handle(SALOME_InteractiveObject) IObject = It.Value();
|
||||||
if ( IObject->hasEntry() ) {
|
if ( IObject->hasEntry() ) {
|
||||||
SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
|
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
|
||||||
SALOMEDS::SObject_var SO = aStudy->FindObjectID( IObject->getEntry() );
|
SALOMEDS::SObject_var SO = aStudy->FindObjectID( IObject->getEntry() );
|
||||||
|
|
||||||
/* Erase child graphical objects */
|
/* Erase child graphical objects */
|
||||||
@ -637,17 +519,17 @@ void GEOMToolsGUI::OnEditDelete()
|
|||||||
myGeomGUI->GetShapeReader().RemoveShapeFromBuffer( ASCior ) ;
|
myGeomGUI->GetShapeReader().RemoveShapeFromBuffer( ASCior ) ;
|
||||||
|
|
||||||
for ( int i = 0; i < nbSf; i++ ) {
|
for ( int i = 0; i < nbSf; i++ ) {
|
||||||
QAD_StudyFrame* sf = myGeomGUI->GetActiveStudy()->getStudyFrame(i);
|
QAD_StudyFrame* sf = QAD_Application::getDesktop()->getActiveStudy()->getStudyFrame(i);
|
||||||
if ( sf->getTypeView() == VIEW_OCC ) {
|
if ( sf->getTypeView() == VIEW_OCC ) {
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)sf->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)sf->getRightFrame()->getViewFrame())->getViewer();
|
||||||
Handle (AIS_InteractiveContext) myContext = v3d->getAISContext();
|
Handle (AIS_InteractiveContext) myContext = v3d->getAISContext();
|
||||||
Handle(GEOM_AISShape) Result = this->ConvertIORinGEOMAISShape( anIOR->Value(), found );
|
Handle(GEOM_AISShape) Result = myGeomBase->ConvertIORinGEOMAISShape(anIOR->Value(), found);
|
||||||
if ( found )
|
if ( found )
|
||||||
myContext->Erase( Result, true, false );
|
myContext->Erase( Result, true, false );
|
||||||
} else if ( sf->getTypeView() == VIEW_VTK ) {
|
} else if ( sf->getTypeView() == VIEW_VTK ) {
|
||||||
//vtkRenderer* Renderer = ((VTKViewer_ViewFrame*)sf->getRightFrame()->getViewFrame())->getRenderer();
|
//vtkRenderer* Renderer = ((VTKViewer_ViewFrame*)sf->getRightFrame()->getViewFrame())->getRenderer();
|
||||||
VTKViewer_RenderWindowInteractor* myRenderInter= ((VTKViewer_ViewFrame*)sf->getRightFrame()->getViewFrame())->getRWInteractor();
|
VTKViewer_RenderWindowInteractor* myRenderInter= ((VTKViewer_ViewFrame*)sf->getRightFrame()->getViewFrame())->getRWInteractor();
|
||||||
GEOM_Actor* ac = this->ConvertIORinGEOMActor( anIOR->Value(), found );
|
GEOM_Actor* ac = myGeomBase->ConvertIORinGEOMActor(anIOR->Value(), found);
|
||||||
if ( found ) {
|
if ( found ) {
|
||||||
//Renderer->RemoveActor(ac);
|
//Renderer->RemoveActor(ac);
|
||||||
if ( ac->hasIO() )
|
if ( ac->hasIO() )
|
||||||
@ -660,7 +542,7 @@ void GEOMToolsGUI::OnEditDelete()
|
|||||||
|
|
||||||
/* Erase main graphical object */
|
/* Erase main graphical object */
|
||||||
for ( int i = 0; i < nbSf; i++ ) {
|
for ( int i = 0; i < nbSf; i++ ) {
|
||||||
QAD_StudyFrame* sf = myGeomGUI->GetActiveStudy()->getStudyFrame(i);
|
QAD_StudyFrame* sf = QAD_Application::getDesktop()->getActiveStudy()->getStudyFrame(i);
|
||||||
if ( sf->getTypeView() == VIEW_OCC ) {
|
if ( sf->getTypeView() == VIEW_OCC ) {
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)sf->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)sf->getRightFrame()->getViewFrame())->getViewer();
|
||||||
Handle (AIS_InteractiveContext) myContext = v3d->getAISContext();
|
Handle (AIS_InteractiveContext) myContext = v3d->getAISContext();
|
||||||
@ -683,7 +565,7 @@ void GEOMToolsGUI::OnEditDelete()
|
|||||||
/* Erase objects in Study */
|
/* Erase objects in Study */
|
||||||
SALOMEDS::SObject_var obj = aStudy->FindObjectID( IObject->getEntry() );
|
SALOMEDS::SObject_var obj = aStudy->FindObjectID( IObject->getEntry() );
|
||||||
if ( !obj->_is_nil() ) {
|
if ( !obj->_is_nil() ) {
|
||||||
QAD_Operation* op = new SALOMEGUI_ImportOperation(myGeomGUI->GetActiveStudy());
|
QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy());
|
||||||
op->start();
|
op->start();
|
||||||
aStudyBuilder->RemoveObject(obj);
|
aStudyBuilder->RemoveObject(obj);
|
||||||
op->finish();
|
op->finish();
|
||||||
@ -694,7 +576,7 @@ void GEOMToolsGUI::OnEditDelete()
|
|||||||
|
|
||||||
/* Clear any previous selection */
|
/* Clear any previous selection */
|
||||||
Sel->ClearIObjects() ;
|
Sel->ClearIObjects() ;
|
||||||
myGeomGUI->GetActiveStudy()->updateObjBrowser();
|
QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -704,7 +586,7 @@ void GEOMToolsGUI::OnEditDelete()
|
|||||||
//==============================================================================
|
//==============================================================================
|
||||||
void GEOMToolsGUI::OnEditCopy()
|
void GEOMToolsGUI::OnEditCopy()
|
||||||
{
|
{
|
||||||
SALOME_Selection* Sel = SALOME_Selection::Selection(myGeomGUI->GetActiveStudy()->getSelection() );
|
SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection() );
|
||||||
GEOM::GEOM_Gen::ListOfIOR_var listIOR = new GEOM::GEOM_Gen::ListOfIOR;
|
GEOM::GEOM_Gen::ListOfIOR_var listIOR = new GEOM::GEOM_Gen::ListOfIOR;
|
||||||
|
|
||||||
const SALOME_ListIO& List = Sel->StoredIObjects();
|
const SALOME_ListIO& List = Sel->StoredIObjects();
|
||||||
@ -725,7 +607,7 @@ void GEOMToolsGUI::OnEditCopy()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_READY"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_READY"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -733,23 +615,23 @@ void GEOMToolsGUI::OnEditCopy()
|
|||||||
// function : Import
|
// function : Import
|
||||||
// purpose : BRep, Iges, Step
|
// purpose : BRep, Iges, Step
|
||||||
//=====================================================================================
|
//=====================================================================================
|
||||||
bool GEOMToolsGUI::Import()
|
bool GEOMToolsGUI::Import(int aState)
|
||||||
{
|
{
|
||||||
SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
|
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
|
||||||
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
|
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
|
||||||
|
|
||||||
GEOM::GEOM_Shape_var aShape;
|
GEOM::GEOM_Shape_var aShape;
|
||||||
QString file;
|
QString file;
|
||||||
QStringList filtersList;
|
QStringList filtersList;
|
||||||
|
|
||||||
switch(myGeomGUI->GetState())
|
switch(aState)
|
||||||
{
|
{
|
||||||
case 111 : // Import BREP
|
case 111 : // Import BREP
|
||||||
{
|
{
|
||||||
filtersList.append(tr("GEOM_MEN_IMPORT_BREP"));
|
filtersList.append(tr("GEOM_MEN_IMPORT_BREP"));
|
||||||
filtersList.append(tr("GEOM_MEN_ALL_FILES"));
|
filtersList.append(tr("GEOM_MEN_ALL_FILES"));
|
||||||
|
|
||||||
file = QAD_FileDlg::getFileName(myGeomGUI->GetDesktop(), "", filtersList, tr("GEOM_MEN_IMPORT"), true);
|
file = QAD_FileDlg::getFileName(QAD_Application::getDesktop(), "", filtersList, tr("GEOM_MEN_IMPORT"), true);
|
||||||
if(!file.isEmpty()) {
|
if(!file.isEmpty()) {
|
||||||
QApplication::setOverrideCursor(Qt::waitCursor);
|
QApplication::setOverrideCursor(Qt::waitCursor);
|
||||||
try {
|
try {
|
||||||
@ -766,7 +648,7 @@ bool GEOMToolsGUI::Import()
|
|||||||
filtersList.append( tr("GEOM_MEN_IMPORT_IGES") ) ;
|
filtersList.append( tr("GEOM_MEN_IMPORT_IGES") ) ;
|
||||||
filtersList.append( tr("GEOM_MEN_ALL_FILES") ) ;
|
filtersList.append( tr("GEOM_MEN_ALL_FILES") ) ;
|
||||||
|
|
||||||
file = QAD_FileDlg::getFileName(myGeomGUI->GetDesktop(),
|
file = QAD_FileDlg::getFileName(QAD_Application::getDesktop(),
|
||||||
"",
|
"",
|
||||||
filtersList,
|
filtersList,
|
||||||
tr("GEOM_MEN_IMPORT"),
|
tr("GEOM_MEN_IMPORT"),
|
||||||
@ -787,7 +669,7 @@ bool GEOMToolsGUI::Import()
|
|||||||
filtersList.append( tr("GEOM_MEN_IMPORT_STEP") ) ;
|
filtersList.append( tr("GEOM_MEN_IMPORT_STEP") ) ;
|
||||||
filtersList.append( tr("GEOM_MEN_ALL_FILES") ) ;
|
filtersList.append( tr("GEOM_MEN_ALL_FILES") ) ;
|
||||||
|
|
||||||
file = QAD_FileDlg::getFileName(myGeomGUI->GetDesktop(),
|
file = QAD_FileDlg::getFileName(QAD_Application::getDesktop(),
|
||||||
"",
|
"",
|
||||||
filtersList,
|
filtersList,
|
||||||
tr("GEOM_MEN_IMPORT"),
|
tr("GEOM_MEN_IMPORT"),
|
||||||
@ -806,16 +688,16 @@ bool GEOMToolsGUI::Import()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( !file.isEmpty() ) {
|
if ( !file.isEmpty() ) {
|
||||||
myGeomGUI->GetDesktop()->putInfo( tr("GEOM_PRP_LOADING").arg(QAD_Tools::getFileNameFromPath( file )) );
|
QAD_Application::getDesktop()->putInfo( tr("GEOM_PRP_LOADING").arg(QAD_Tools::getFileNameFromPath( file )) );
|
||||||
|
|
||||||
SALOMEDS::SComponent_var father = aStudy->FindComponent("GEOM");
|
SALOMEDS::SComponent_var father = aStudy->FindComponent("GEOM");
|
||||||
SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->entry());
|
SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->entry());
|
||||||
SALOMEDS::GenericAttribute_var anAttr;
|
SALOMEDS::GenericAttribute_var anAttr;
|
||||||
SALOMEDS::AttributeName_var aName;
|
SALOMEDS::AttributeName_var aName;
|
||||||
SALOMEDS::AttributePixMap_var aPixmap;
|
SALOMEDS::AttributePixMap_var aPixmap;
|
||||||
int aLocked = false;
|
int aLocked = false;
|
||||||
if (father->_is_nil()) {
|
if (father->_is_nil()) {
|
||||||
QAD_Operation* op = new SALOMEGUI_ImportOperation(myGeomGUI->GetActiveStudy() );
|
QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy() );
|
||||||
op->start();
|
op->start();
|
||||||
aLocked = aStudy->GetProperties()->IsLocked();
|
aLocked = aStudy->GetProperties()->IsLocked();
|
||||||
if (aLocked) aStudy->GetProperties()->SetLocked(false);
|
if (aLocked) aStudy->GetProperties()->SetLocked(false);
|
||||||
@ -823,7 +705,7 @@ bool GEOMToolsGUI::Import()
|
|||||||
anAttr = aStudyBuilder->FindOrCreateAttribute(father, "AttributeName");
|
anAttr = aStudyBuilder->FindOrCreateAttribute(father, "AttributeName");
|
||||||
aName = SALOMEDS::AttributeName::_narrow(anAttr);
|
aName = SALOMEDS::AttributeName::_narrow(anAttr);
|
||||||
// aName->SetValue( tr("GEOM_MEN_COMPONENT") );
|
// aName->SetValue( tr("GEOM_MEN_COMPONENT") );
|
||||||
aName->SetValue(myGeomGUI->GetDesktop()->getComponentUserName( "GEOM" ) );
|
aName->SetValue(QAD_Application::getDesktop()->getComponentUserName( "GEOM" ) );
|
||||||
anAttr = aStudyBuilder->FindOrCreateAttribute(father, "AttributePixMap");
|
anAttr = aStudyBuilder->FindOrCreateAttribute(father, "AttributePixMap");
|
||||||
aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
|
aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
|
||||||
aPixmap->SetPixMap( "ICON_OBJBROWSER_Geometry" );
|
aPixmap->SetPixMap( "ICON_OBJBROWSER_Geometry" );
|
||||||
@ -837,8 +719,8 @@ bool GEOMToolsGUI::Import()
|
|||||||
QString nameShape = QAD_Tools::getFileNameFromPath(file,false) + QString("_%1").arg(myGeomGUI->GetNbGeom()++);
|
QString nameShape = QAD_Tools::getFileNameFromPath(file,false) + QString("_%1").arg(myGeomGUI->GetNbGeom()++);
|
||||||
|
|
||||||
if(myGeomBase->Display(aShape, strdup(nameShape.latin1()))) {
|
if(myGeomBase->Display(aShape, strdup(nameShape.latin1()))) {
|
||||||
myGeomGUI->GetActiveStudy()->setMessage( tr("GEOM_INF_LOADED").arg(QAD_Tools::getFileNameFromPath( file )) );
|
QAD_Application::getDesktop()->getActiveStudy()->setMessage( tr("GEOM_INF_LOADED").arg(QAD_Tools::getFileNameFromPath( file )) );
|
||||||
myGeomGUI->GetDesktop()->putInfo( tr("GEOM_PRP_READY"));
|
QAD_Application::getDesktop()->putInfo( tr("GEOM_PRP_READY"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
@ -850,9 +732,9 @@ bool GEOMToolsGUI::Import()
|
|||||||
// function : Export
|
// function : Export
|
||||||
// purpose : BRep, Iges, Step
|
// purpose : BRep, Iges, Step
|
||||||
//=====================================================================================
|
//=====================================================================================
|
||||||
bool GEOMToolsGUI::Export()
|
bool GEOMToolsGUI::Export(int aState)
|
||||||
{
|
{
|
||||||
SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
|
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
|
||||||
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
|
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
|
||||||
|
|
||||||
GEOM::GEOM_Shape_var aShape;
|
GEOM::GEOM_Shape_var aShape;
|
||||||
@ -861,10 +743,10 @@ bool GEOMToolsGUI::Export()
|
|||||||
tr("GEOM_MEN_IMPORT_IGES"),
|
tr("GEOM_MEN_IMPORT_IGES"),
|
||||||
tr("GEOM_MEN_IMPORT_STEP") };
|
tr("GEOM_MEN_IMPORT_STEP") };
|
||||||
|
|
||||||
SALOME_Selection* Sel = SALOME_Selection::Selection(myGeomGUI->GetActiveStudy()->getSelection());
|
SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection());
|
||||||
SALOME_ListIteratorOfListIO It( Sel->StoredIObjects() );
|
SALOME_ListIteratorOfListIO It( Sel->StoredIObjects() );
|
||||||
|
|
||||||
switch (myGeomGUI->GetState())
|
switch (aState)
|
||||||
{
|
{
|
||||||
case 121 :
|
case 121 :
|
||||||
{
|
{
|
||||||
@ -875,7 +757,7 @@ bool GEOMToolsGUI::Export()
|
|||||||
GEOM::GEOM_Shape_var aShape = myGeomBase->ConvertIOinGEOMShape(IObject, found);
|
GEOM::GEOM_Shape_var aShape = myGeomBase->ConvertIOinGEOMShape(IObject, found);
|
||||||
// Handle(GEOM_AISShape) Shape = myGeomGUI->ConvertIOinGEOMAISShape(IObject, found, true);
|
// Handle(GEOM_AISShape) Shape = myGeomGUI->ConvertIOinGEOMAISShape(IObject, found, true);
|
||||||
if ( found ) {
|
if ( found ) {
|
||||||
QString file = QAD_FileDlg::getFileName(myGeomGUI->GetDesktop(),
|
QString file = QAD_FileDlg::getFileName(QAD_Application::getDesktop(),
|
||||||
QString( IObject->getName() ) + ".brep",
|
QString( IObject->getName() ) + ".brep",
|
||||||
tr("GEOM_MEN_IMPORT_BREP"),
|
tr("GEOM_MEN_IMPORT_BREP"),
|
||||||
tr("GEOM_MEN_EXPORT"),
|
tr("GEOM_MEN_EXPORT"),
|
||||||
@ -903,7 +785,7 @@ bool GEOMToolsGUI::Export()
|
|||||||
GEOM::GEOM_Shape_var aShape = myGeomBase->ConvertIOinGEOMShape(IObject, found);
|
GEOM::GEOM_Shape_var aShape = myGeomBase->ConvertIOinGEOMShape(IObject, found);
|
||||||
// Handle(GEOM_AISShape) Shape = myGeomGUI->ConvertIOinGEOMAISShape(IObject, found, true);
|
// Handle(GEOM_AISShape) Shape = myGeomGUI->ConvertIOinGEOMAISShape(IObject, found, true);
|
||||||
if ( found ) {
|
if ( found ) {
|
||||||
QString file = QAD_FileDlg::getFileName(myGeomGUI->GetDesktop(),
|
QString file = QAD_FileDlg::getFileName(QAD_Application::getDesktop(),
|
||||||
QString( IObject->getName() ) + ".igs",
|
QString( IObject->getName() ) + ".igs",
|
||||||
tr("GEOM_MEN_IMPORT_IGES"),
|
tr("GEOM_MEN_IMPORT_IGES"),
|
||||||
tr("GEOM_MEN_EXPORT"),
|
tr("GEOM_MEN_EXPORT"),
|
||||||
@ -948,7 +830,7 @@ bool GEOMToolsGUI::Export()
|
|||||||
GEOM::GEOM_Shape_var aShape = myGeomBase->ConvertIOinGEOMShape(IObject, found);
|
GEOM::GEOM_Shape_var aShape = myGeomBase->ConvertIOinGEOMShape(IObject, found);
|
||||||
// Handle(GEOM_AISShape) Shape = myGeomBase->ConvertIOinGEOMAISShape(IObject, found, true);
|
// Handle(GEOM_AISShape) Shape = myGeomBase->ConvertIOinGEOMAISShape(IObject, found, true);
|
||||||
if ( found ) {
|
if ( found ) {
|
||||||
file = QAD_FileDlg::getFileName(myGeomGUI->GetDesktop(),
|
file = QAD_FileDlg::getFileName(QAD_Application::getDesktop(),
|
||||||
QString( IObject->getName() ) + ".stp",
|
QString( IObject->getName() ) + ".stp",
|
||||||
tr("GEOM_MEN_IMPORT_STEP"),
|
tr("GEOM_MEN_IMPORT_STEP"),
|
||||||
tr("GEOM_MEN_EXPORT"),
|
tr("GEOM_MEN_EXPORT"),
|
||||||
|
@ -45,15 +45,9 @@ public :
|
|||||||
|
|
||||||
static bool OnGUIEvent(int theCommandID, QAD_Desktop* parent);
|
static bool OnGUIEvent(int theCommandID, QAD_Desktop* parent);
|
||||||
|
|
||||||
Handle(GEOM_AISShape) ConvertIORinGEOMAISShape(const char * IOR,
|
|
||||||
Standard_Boolean& testResult,
|
|
||||||
bool onlyInActiveView = false);
|
|
||||||
GEOM_Actor* ConvertIORinGEOMActor(const char * IOR, Standard_Boolean& testResult,
|
|
||||||
bool onlyInActiveView = false);
|
|
||||||
|
|
||||||
/* Import and export topology methods */
|
/* Import and export topology methods */
|
||||||
bool Import();
|
bool Import(int aState);
|
||||||
bool Export();
|
bool Export(int aState);
|
||||||
|
|
||||||
void OnEditCopy();
|
void OnEditCopy();
|
||||||
void OnEditDelete();
|
void OnEditDelete();
|
||||||
|
@ -30,6 +30,7 @@ using namespace std;
|
|||||||
|
|
||||||
#include "QAD_RightFrame.h"
|
#include "QAD_RightFrame.h"
|
||||||
#include "SALOME_ListIteratorOfListIO.hxx"
|
#include "SALOME_ListIteratorOfListIO.hxx"
|
||||||
|
#include <AIS_InteractiveContext.hxx>
|
||||||
|
|
||||||
#include <qframe.h>
|
#include <qframe.h>
|
||||||
#include <qlabel.h>
|
#include <qlabel.h>
|
||||||
@ -177,9 +178,9 @@ void GEOMBase_TransparencyDlg::ClickOnClose()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void GEOMBase_TransparencyDlg::ValueHasChanged(int newValue)
|
void GEOMBase_TransparencyDlg::ValueHasChanged(int newValue)
|
||||||
{
|
{
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
|
||||||
// VTK
|
// VTK
|
||||||
VTKViewer_RenderWindowInteractor* myRenderInter= ((VTKViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
|
VTKViewer_RenderWindowInteractor* myRenderInter= ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
|
||||||
SALOME_ListIteratorOfListIO It(this->mySel->StoredIObjects());
|
SALOME_ListIteratorOfListIO It(this->mySel->StoredIObjects());
|
||||||
|
|
||||||
Handle(SALOME_InteractiveObject) FirstIOS = mySel->firstIObject();
|
Handle(SALOME_InteractiveObject) FirstIOS = mySel->firstIObject();
|
||||||
@ -200,7 +201,7 @@ void GEOMBase_TransparencyDlg::ValueHasChanged(int newValue)
|
|||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
// OCC
|
// OCC
|
||||||
SALOME_ListIteratorOfListIO It(this->mySel->StoredIObjects());
|
SALOME_ListIteratorOfListIO It(this->mySel->StoredIObjects());
|
||||||
Handle(SALOME_InteractiveObject) FirstIOS = mySel->firstIObject();
|
Handle(SALOME_InteractiveObject) FirstIOS = mySel->firstIObject();
|
||||||
|
@ -32,10 +32,10 @@
|
|||||||
#include <qvariant.h>
|
#include <qvariant.h>
|
||||||
#include <qdialog.h>
|
#include <qdialog.h>
|
||||||
|
|
||||||
#include "SALOME_Selection.h"
|
/* #include "SALOME_Selection.h" */
|
||||||
#include "SALOME_InteractiveObject.hxx"
|
/* #include "SALOME_InteractiveObject.hxx" */
|
||||||
#include "GEOM_InteractiveObject.hxx"
|
/* #include "GEOM_InteractiveObject.hxx" */
|
||||||
#include "GEOM_AISShape.hxx"
|
/* #include "GEOM_AISShape.hxx" */
|
||||||
|
|
||||||
#include "GEOMBase.h"
|
#include "GEOMBase.h"
|
||||||
|
|
||||||
|
@ -49,21 +49,15 @@ LIB_MOC = \
|
|||||||
GEOMToolsGUI_NbIsosDlg.h \
|
GEOMToolsGUI_NbIsosDlg.h \
|
||||||
GEOMToolsGUI_TransparencyDlg.h
|
GEOMToolsGUI_TransparencyDlg.h
|
||||||
|
|
||||||
LIB_CLIENT_IDL = SALOME_Exception.idl \
|
LIB_CLIENT_IDL = SALOMEDS_Attributes.idl
|
||||||
GEOM_Gen.idl \
|
|
||||||
GEOM_Shape.idl \
|
|
||||||
SALOMEDS.idl \
|
|
||||||
SALOMEDS_Attributes.idl \
|
|
||||||
SALOME_ModuleCatalog.idl \
|
|
||||||
SALOME_Component.idl \
|
|
||||||
|
|
||||||
LIB_SERVER_IDL =
|
LIB_SERVER_IDL =
|
||||||
|
|
||||||
# additionnal information to compil and link file
|
# additionnal information to compil and link file
|
||||||
|
|
||||||
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
||||||
CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
|
CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
|
||||||
|
|
||||||
LDFLAGS += -lOCCViewer -lVTKViewer -lSalomeObject -lSalomeGUI -lGEOMClient -lGEOMObject -lGEOMFiltersSelection -lGEOMContext -lGEOMBase -L${KERNEL_ROOT_DIR}/lib/salome
|
LDFLAGS += -lGEOMFiltersSelection -lGEOMBase
|
||||||
|
|
||||||
@CONCLUDE@
|
@CONCLUDE@
|
||||||
|
@ -66,7 +66,7 @@ bool GenerationGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
{
|
{
|
||||||
GenerationGUI* myGenerationGUI = new GenerationGUI();
|
GenerationGUI* myGenerationGUI = new GenerationGUI();
|
||||||
myGenerationGUI->myGeomGUI->EmitSignalDeactivateDialog();
|
myGenerationGUI->myGeomGUI->EmitSignalDeactivateDialog();
|
||||||
SALOME_Selection* Sel = SALOME_Selection::Selection(myGenerationGUI->myGeomGUI->GetActiveStudy()->getSelection());
|
SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection());
|
||||||
|
|
||||||
switch (theCommandID)
|
switch (theCommandID)
|
||||||
{
|
{
|
||||||
@ -108,7 +108,7 @@ void GenerationGUI::MakePrismAndDisplay(GEOM::GEOM_Shape_ptr BaseShape, const gp
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if(BaseShape->_is_nil()) {
|
if(BaseShape->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,7 +116,7 @@ void GenerationGUI::MakePrismAndDisplay(GEOM::GEOM_Shape_ptr BaseShape, const gp
|
|||||||
GEOM::PointStruct PS2 = myGeom->MakePointStruct(P2.X(), P2.Y(), P2.Z());
|
GEOM::PointStruct PS2 = myGeom->MakePointStruct(P2.X(), P2.Y(), P2.Z());
|
||||||
GEOM::GEOM_Shape_ptr result = myGeom->MakePrism(BaseShape, PS1, PS2);
|
GEOM::GEOM_Shape_ptr result = myGeom->MakePrism(BaseShape, PS1, PS2);
|
||||||
if(result->_is_nil()) {
|
if(result->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,7 +126,7 @@ void GenerationGUI::MakePrismAndDisplay(GEOM::GEOM_Shape_ptr BaseShape, const gp
|
|||||||
result->NameType(type);
|
result->NameType(type);
|
||||||
|
|
||||||
if(myGeomBase->Display(result))
|
if(myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -145,7 +145,7 @@ void GenerationGUI::MakeRevolutionAndDisplay(GEOM::GEOM_Shape_ptr Shape, const g
|
|||||||
GEOM::AxisStruct axis = myGeom->MakeAxisStruct(loc.X(), loc.Y(), loc.Z(), dir.X(), dir.Y(), dir.Z());
|
GEOM::AxisStruct axis = myGeom->MakeAxisStruct(loc.X(), loc.Y(), loc.Z(), dir.X(), dir.Y(), dir.Z());
|
||||||
GEOM::GEOM_Shape_ptr result = myGeom->MakeRevolution(Shape, axis, revolAngle) ;
|
GEOM::GEOM_Shape_ptr result = myGeom->MakeRevolution(Shape, axis, revolAngle) ;
|
||||||
if(result->_is_nil()) {
|
if(result->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,7 +155,7 @@ void GenerationGUI::MakeRevolutionAndDisplay(GEOM::GEOM_Shape_ptr Shape, const g
|
|||||||
result->NameType(type);
|
result->NameType(type);
|
||||||
|
|
||||||
if(myGeomBase->Display(result))
|
if(myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -176,7 +176,7 @@ void GenerationGUI::MakeFillingAndDisplay(GEOM::GEOM_Shape_ptr SectionShape, con
|
|||||||
GEOM::GEOM_Shape_ptr result = myGeom->MakeFilling(SectionShape, mindeg, maxdeg,
|
GEOM::GEOM_Shape_ptr result = myGeom->MakeFilling(SectionShape, mindeg, maxdeg,
|
||||||
tol3d, tol2d, nbiter);
|
tol3d, tol2d, nbiter);
|
||||||
if(result->_is_nil()) {
|
if(result->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,7 +186,7 @@ void GenerationGUI::MakeFillingAndDisplay(GEOM::GEOM_Shape_ptr SectionShape, con
|
|||||||
result->NameType(type);
|
result->NameType(type);
|
||||||
|
|
||||||
if(myGeomBase->Display(result))
|
if(myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
@ -210,10 +210,10 @@ void GenerationGUI::MakePipeAndDisplay(GEOM::GEOM_Shape_ptr aPath, GEOM::GEOM_Sh
|
|||||||
myGeomBase->GetShapeTypeString(S,type);
|
myGeomBase->GetShapeTypeString(S,type);
|
||||||
result->NameType(type);
|
result->NameType(type);
|
||||||
|
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (const SALOME::SALOME_Exception& S_ex) {
|
catch (const SALOME::SALOME_Exception& S_ex) {
|
||||||
|
@ -150,7 +150,7 @@ void GenerationGUI_FillingDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void GenerationGUI_FillingDlg::ClickOnApply()
|
void GenerationGUI_FillingDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
|
|
||||||
myMinDeg = GroupPoints->SpinBox_1->value();
|
myMinDeg = GroupPoints->SpinBox_1->value();
|
||||||
myTol2D = GroupPoints->SpinBox_2->value();
|
myTol2D = GroupPoints->SpinBox_2->value();
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
#include "GenerationGUI_PipeDlg.h"
|
#include "GenerationGUI_PipeDlg.h"
|
||||||
|
|
||||||
|
#include <TopoDS_Edge.hxx>
|
||||||
|
#include <BRepBuilderAPI_MakeWire.hxx>
|
||||||
#include <BRepOffsetAPI_MakePipe.hxx>
|
#include <BRepOffsetAPI_MakePipe.hxx>
|
||||||
#include <BRepAlgoAPI.hxx>
|
#include <BRepAlgoAPI.hxx>
|
||||||
|
|
||||||
@ -128,7 +130,7 @@ void GenerationGUI_PipeDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void GenerationGUI_PipeDlg::ClickOnApply()
|
void GenerationGUI_PipeDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
if (mySimulationTopoDs.IsNull())
|
if (mySimulationTopoDs.IsNull())
|
||||||
return;
|
return;
|
||||||
myGeomBase->EraseSimulationShape();
|
myGeomBase->EraseSimulationShape();
|
||||||
|
@ -146,7 +146,7 @@ void GenerationGUI_PrismDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void GenerationGUI_PrismDlg::ClickOnApply()
|
void GenerationGUI_PrismDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
if (mySimulationTopoDs.IsNull())
|
if (mySimulationTopoDs.IsNull())
|
||||||
return;
|
return;
|
||||||
myGeomBase->EraseSimulationShape();
|
myGeomBase->EraseSimulationShape();
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
#include "GenerationGUI_RevolDlg.h"
|
#include "GenerationGUI_RevolDlg.h"
|
||||||
|
|
||||||
|
#include <gp_Lin.hxx>
|
||||||
#include <BRepAdaptor_Curve.hxx>
|
#include <BRepAdaptor_Curve.hxx>
|
||||||
#include <BRepPrimAPI_MakeRevol.hxx>
|
#include <BRepPrimAPI_MakeRevol.hxx>
|
||||||
#include "QAD_Config.h"
|
#include "QAD_Config.h"
|
||||||
@ -144,7 +145,7 @@ void GenerationGUI_RevolDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void GenerationGUI_RevolDlg::ClickOnApply()
|
void GenerationGUI_RevolDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
if (mySimulationTopoDs.IsNull())
|
if (mySimulationTopoDs.IsNull())
|
||||||
return;
|
return;
|
||||||
myGeomBase->EraseSimulationShape();
|
myGeomBase->EraseSimulationShape();
|
||||||
|
@ -53,21 +53,15 @@ LIB_MOC = \
|
|||||||
GenerationGUI_FillingDlg.h \
|
GenerationGUI_FillingDlg.h \
|
||||||
GenerationGUI_PipeDlg.h
|
GenerationGUI_PipeDlg.h
|
||||||
|
|
||||||
LIB_CLIENT_IDL = SALOME_Exception.idl \
|
LIB_CLIENT_IDL =
|
||||||
GEOM_Gen.idl \
|
|
||||||
GEOM_Shape.idl \
|
|
||||||
SALOMEDS.idl \
|
|
||||||
SALOMEDS_Attributes.idl \
|
|
||||||
SALOME_ModuleCatalog.idl \
|
|
||||||
SALOME_Component.idl \
|
|
||||||
|
|
||||||
LIB_SERVER_IDL =
|
LIB_SERVER_IDL =
|
||||||
|
|
||||||
# additionnal information to compil and link file
|
# additionnal information to compil and link file
|
||||||
|
|
||||||
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
||||||
CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
|
CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
|
||||||
|
|
||||||
LDFLAGS += -lOCCViewer -lVTKViewer -lSalomeObject -lSalomeGUI -lGEOMClient -lGEOMObject -lGEOMFiltersSelection -lDlgRef -lGEOMContext -lGEOMBase $(CAS_LDPATH) -lTKOffset -L${KERNEL_ROOT_DIR}/lib/salome
|
LDFLAGS += -lGEOMFiltersSelection -lGEOMBase $(CAS_LDPATH) -lTKOffset
|
||||||
|
|
||||||
@CONCLUDE@
|
@CONCLUDE@
|
||||||
|
@ -32,6 +32,6 @@ VPATH=.:@srcdir@
|
|||||||
|
|
||||||
@COMMENCE@
|
@COMMENCE@
|
||||||
|
|
||||||
SUBDIRS = OBJECT SKETCHER ARCHIMEDE PARTITION GEOMDS GEOM GEOMClient GEOMFiltersSelection DlgRef GEOMContext GEOMBase DisplayGUI GEOMToolsGUI BasicGUI PrimitiveGUI GenerationGUI BuildGUI BooleanGUI TransformationGUI OperationGUI RepairGUI MeasureGUI GEOMGUI GEOM_SWIG
|
SUBDIRS = OBJECT ARCHIMEDE PARTITION GEOMDS GEOM GEOMClient GEOMFiltersSelection DlgRef GEOMContext GEOMBase DisplayGUI GEOMToolsGUI SketcherGUI BasicGUI PrimitiveGUI GenerationGUI BuildGUI BooleanGUI TransformationGUI OperationGUI RepairGUI MeasureGUI GEOMGUI GEOM_SWIG
|
||||||
|
|
||||||
@MODULE@
|
@MODULE@
|
||||||
|
@ -75,21 +75,15 @@ LIB_MOC = \
|
|||||||
MeasureGUI_WhatisDlg.h \
|
MeasureGUI_WhatisDlg.h \
|
||||||
MeasureGUI_CheckShapeDlg.h
|
MeasureGUI_CheckShapeDlg.h
|
||||||
|
|
||||||
LIB_CLIENT_IDL = SALOME_Exception.idl \
|
LIB_CLIENT_IDL =
|
||||||
GEOM_Gen.idl \
|
|
||||||
GEOM_Shape.idl \
|
|
||||||
SALOMEDS.idl \
|
|
||||||
SALOMEDS_Attributes.idl \
|
|
||||||
SALOME_ModuleCatalog.idl \
|
|
||||||
SALOME_Component.idl \
|
|
||||||
|
|
||||||
LIB_SERVER_IDL =
|
LIB_SERVER_IDL =
|
||||||
|
|
||||||
# additionnal information to compil and link file
|
# additionnal information to compil and link file
|
||||||
|
|
||||||
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
||||||
CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
|
CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
|
||||||
|
|
||||||
LDFLAGS += -lOCCViewer -lVTKViewer -lSalomeObject -lSalomeGUI -lGEOMClient -lGEOMObject -lGEOMBase -L${KERNEL_ROOT_DIR}/lib/salome
|
LDFLAGS += -lGEOMBase
|
||||||
|
|
||||||
@CONCLUDE@
|
@CONCLUDE@
|
||||||
|
@ -70,7 +70,7 @@ bool MeasureGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
{
|
{
|
||||||
MeasureGUI* myMeasureGUI = new MeasureGUI();
|
MeasureGUI* myMeasureGUI = new MeasureGUI();
|
||||||
myMeasureGUI->myGeomGUI->EmitSignalDeactivateDialog();
|
myMeasureGUI->myGeomGUI->EmitSignalDeactivateDialog();
|
||||||
SALOME_Selection* Sel = SALOME_Selection::Selection(myMeasureGUI->myGeomGUI->GetActiveStudy()->getSelection());
|
SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection());
|
||||||
|
|
||||||
switch (theCommandID)
|
switch (theCommandID)
|
||||||
{
|
{
|
||||||
@ -133,12 +133,12 @@ void MeasureGUI::MakeCDGAndDisplay(GEOM::GEOM_Shape_ptr Shape)
|
|||||||
try {
|
try {
|
||||||
GEOM::GEOM_Shape_var result = myGeom->MakeCDG(Shape);
|
GEOM::GEOM_Shape_var result = myGeom->MakeCDG(Shape);
|
||||||
if(result->_is_nil()) {
|
if(result->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
result->NameType(tr("GEOM_POINT"));
|
result->NameType(tr("GEOM_POINT"));
|
||||||
if(myGeomBase->Display(result))
|
if(myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
|
@ -227,10 +227,10 @@ void MeasureGUI_BndBoxDlg::CalculateAndDisplayBndBox(const TopoDS_Shape& S)
|
|||||||
BRepBndLib::Add(S,B);
|
BRepBndLib::Add(S,B);
|
||||||
B.Get(axmin, aymin, azmin, axmax, aymax, azmax);
|
B.Get(axmin, aymin, azmin, axmax, aymax, azmax);
|
||||||
GroupC1->LineEdit11->setText(tr("%1").arg(axmin, 12, 'f', 6));
|
GroupC1->LineEdit11->setText(tr("%1").arg(axmin, 12, 'f', 6));
|
||||||
GroupC1->LineEdit12->setText(tr("%1").arg(aymin, 12, 'f', 6));
|
GroupC1->LineEdit12->setText(tr("%1").arg(axmax, 12, 'f', 6));
|
||||||
GroupC1->LineEdit21->setText(tr("%1").arg(azmin, 12, 'f', 6));
|
GroupC1->LineEdit21->setText(tr("%1").arg(aymin, 12, 'f', 6));
|
||||||
GroupC1->LineEdit22->setText(tr("%1").arg(axmax, 12, 'f', 6));
|
GroupC1->LineEdit22->setText(tr("%1").arg(aymax, 12, 'f', 6));
|
||||||
GroupC1->LineEdit31->setText(tr("%1").arg(aymax, 12, 'f', 6));
|
GroupC1->LineEdit31->setText(tr("%1").arg(azmin, 12, 'f', 6));
|
||||||
GroupC1->LineEdit32->setText(tr("%1").arg(azmax, 12, 'f', 6));
|
GroupC1->LineEdit32->setText(tr("%1").arg(azmax, 12, 'f', 6));
|
||||||
|
|
||||||
mySimulationTopoDs = BRepPrimAPI_MakeBox(gp_Pnt(axmin, aymin, azmin), gp_Pnt(axmax, aymax, azmax)).Shape();
|
mySimulationTopoDs = BRepPrimAPI_MakeBox(gp_Pnt(axmin, aymin, azmin), gp_Pnt(axmax, aymax, azmax)).Shape();
|
||||||
|
@ -131,7 +131,7 @@ void MeasureGUI_CenterMassDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void MeasureGUI_CenterMassDlg::ClickOnApply()
|
void MeasureGUI_CenterMassDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
if (mySimulationTopoDs.IsNull())
|
if (mySimulationTopoDs.IsNull())
|
||||||
return;
|
return;
|
||||||
myGeomBase->EraseSimulationShape();
|
myGeomBase->EraseSimulationShape();
|
||||||
|
@ -33,6 +33,8 @@
|
|||||||
|
|
||||||
#include "MeasureGUI.h"
|
#include "MeasureGUI.h"
|
||||||
|
|
||||||
|
#include <gp_Pnt.hxx>
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : MeasureGUI_CenterMassDlg
|
// class : MeasureGUI_CenterMassDlg
|
||||||
// purpose :
|
// purpose :
|
||||||
|
@ -32,6 +32,8 @@ using namespace std;
|
|||||||
#include "QAD_RightFrame.h"
|
#include "QAD_RightFrame.h"
|
||||||
#include "OCCViewer_Viewer3d.h"
|
#include "OCCViewer_Viewer3d.h"
|
||||||
|
|
||||||
|
#include <Geom_Plane.hxx>
|
||||||
|
#include <TopoDS_Edge.hxx>
|
||||||
#include <BRepExtrema_DistShapeShape.hxx>
|
#include <BRepExtrema_DistShapeShape.hxx>
|
||||||
#include <AIS_LengthDimension.hxx>
|
#include <AIS_LengthDimension.hxx>
|
||||||
#include <BRepBuilderAPI_MakeEdge.hxx>
|
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||||
@ -324,8 +326,8 @@ void MeasureGUI_DistanceDlg::MakeDistanceSimulationAndDisplay(const TopoDS_Shape
|
|||||||
|
|
||||||
GroupC1->LineEdit3->setText(S);
|
GroupC1->LineEdit3->setText(S);
|
||||||
|
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
ic->Display(Distance);
|
ic->Display(Distance);
|
||||||
ic->UpdateCurrentViewer();
|
ic->UpdateCurrentViewer();
|
||||||
@ -346,10 +348,10 @@ void MeasureGUI_DistanceDlg::MakeDistanceSimulationAndDisplay(const TopoDS_Shape
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void MeasureGUI_DistanceDlg::EraseDistance()
|
void MeasureGUI_DistanceDlg::EraseDistance()
|
||||||
{
|
{
|
||||||
int count = myGeomGUI->GetActiveStudy()->getStudyFramesCount();
|
int count = QAD_Application::getDesktop()->getActiveStudy()->getStudyFramesCount();
|
||||||
for(int i = 0; i < count; i++) {
|
for(int i = 0; i < count; i++) {
|
||||||
if (myGeomGUI->GetActiveStudy()->getStudyFrame(i)->getTypeView() == VIEW_OCC ) {
|
if (QAD_Application::getDesktop()->getActiveStudy()->getStudyFrame(i)->getTypeView() == VIEW_OCC ) {
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getStudyFrame(i)->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getStudyFrame(i)->getRightFrame()->getViewFrame())->getViewer();
|
||||||
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
|
|
||||||
AIS_ListOfInteractive L;
|
AIS_ListOfInteractive L;
|
||||||
|
@ -29,6 +29,9 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
#include "MeasureGUI_MaxToleranceDlg.h"
|
#include "MeasureGUI_MaxToleranceDlg.h"
|
||||||
|
|
||||||
|
#include <TopoDS_Vertex.hxx>
|
||||||
|
#include <TopoDS_Edge.hxx>
|
||||||
|
#include <TopoDS_Face.hxx>
|
||||||
#include <TopExp_Explorer.hxx>
|
#include <TopExp_Explorer.hxx>
|
||||||
#include <BRep_Tool.hxx>
|
#include <BRep_Tool.hxx>
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ void MeasureGUI_Skeleton::ClickOnCancel()
|
|||||||
mySimulationTopoDs.Nullify();
|
mySimulationTopoDs.Nullify();
|
||||||
|
|
||||||
disconnect(mySelection, 0, this, 0);
|
disconnect(mySelection, 0, this, 0);
|
||||||
myGeomGUI->ResetState();
|
//myGeomGUI->ResetState();
|
||||||
reject();
|
reject();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -135,7 +135,7 @@ void MeasureGUI_Skeleton::LineEditReturnPressed()
|
|||||||
void MeasureGUI_Skeleton::DeactivateActiveDialog()
|
void MeasureGUI_Skeleton::DeactivateActiveDialog()
|
||||||
{
|
{
|
||||||
this->setEnabled(false);
|
this->setEnabled(false);
|
||||||
myGeomGUI->ResetState();
|
//myGeomGUI->ResetState();
|
||||||
disconnect(mySelection, 0, this, 0);
|
disconnect(mySelection, 0, this, 0);
|
||||||
myGeomBase->EraseSimulationShape();
|
myGeomBase->EraseSimulationShape();
|
||||||
myGeomGUI->SetActiveDialogBox(0);
|
myGeomGUI->SetActiveDialogBox(0);
|
||||||
|
@ -29,6 +29,9 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
#include "MeasureGUI_WhatisDlg.h"
|
#include "MeasureGUI_WhatisDlg.h"
|
||||||
|
|
||||||
|
#include <TopTools_MapOfShape.hxx>
|
||||||
|
#include <TCollection_AsciiString.hxx>
|
||||||
|
#include <TopTools_ListOfShape.hxx>
|
||||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||||
#include <TopoDS_Iterator.hxx>
|
#include <TopoDS_Iterator.hxx>
|
||||||
|
|
||||||
|
@ -53,21 +53,15 @@ LIB_MOC = \
|
|||||||
OperationGUI_FilletDlg.h \
|
OperationGUI_FilletDlg.h \
|
||||||
OperationGUI_ChamferDlg.h
|
OperationGUI_ChamferDlg.h
|
||||||
|
|
||||||
LIB_CLIENT_IDL = SALOME_Exception.idl \
|
LIB_CLIENT_IDL =
|
||||||
GEOM_Gen.idl \
|
|
||||||
GEOM_Shape.idl \
|
|
||||||
SALOMEDS.idl \
|
|
||||||
SALOMEDS_Attributes.idl \
|
|
||||||
SALOME_ModuleCatalog.idl \
|
|
||||||
SALOME_Component.idl \
|
|
||||||
|
|
||||||
LIB_SERVER_IDL =
|
LIB_SERVER_IDL =
|
||||||
|
|
||||||
# additionnal information to compil and link file
|
# additionnal information to compil and link file
|
||||||
|
|
||||||
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
||||||
CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
|
CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
|
||||||
|
|
||||||
LDFLAGS += -lOCCViewer -lVTKViewer -lSalomeObject -lSalomeGUI -lGEOMClient -lGEOMObject -lDlgRef -lGEOMContext -lGEOMBase -lDisplayGUI $(CAS_LDPATH) -lTKFillet -L${KERNEL_ROOT_DIR}/lib/salome
|
LDFLAGS += -lDisplayGUI $(CAS_LDPATH) -lTKFillet
|
||||||
|
|
||||||
@CONCLUDE@
|
@CONCLUDE@
|
||||||
|
@ -36,6 +36,7 @@ using namespace std;
|
|||||||
#include "OCCViewer_ViewFrame.h"
|
#include "OCCViewer_ViewFrame.h"
|
||||||
#include "SALOMEGUI_QtCatchCorbaException.hxx"
|
#include "SALOMEGUI_QtCatchCorbaException.hxx"
|
||||||
|
|
||||||
|
#include <TopTools_MapOfShape.hxx>
|
||||||
#include <TopExp_Explorer.hxx>
|
#include <TopExp_Explorer.hxx>
|
||||||
#include <Precision.hxx>
|
#include <Precision.hxx>
|
||||||
|
|
||||||
@ -74,7 +75,7 @@ bool OperationGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
{
|
{
|
||||||
OperationGUI* myOperationGUI = new OperationGUI();
|
OperationGUI* myOperationGUI = new OperationGUI();
|
||||||
myOperationGUI->myGeomGUI->EmitSignalDeactivateDialog();
|
myOperationGUI->myGeomGUI->EmitSignalDeactivateDialog();
|
||||||
SALOME_Selection* Sel = SALOME_Selection::Selection(myOperationGUI->myGeomGUI->GetActiveStudy()->getSelection());
|
SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection());
|
||||||
|
|
||||||
switch (theCommandID)
|
switch (theCommandID)
|
||||||
{
|
{
|
||||||
@ -91,8 +92,8 @@ bool OperationGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
case 505: // FILLET
|
case 505: // FILLET
|
||||||
{
|
{
|
||||||
Handle(AIS_InteractiveContext) ic;
|
Handle(AIS_InteractiveContext) ic;
|
||||||
if(myOperationGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myOperationGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
ic = v3d->getAISContext();
|
ic = v3d->getAISContext();
|
||||||
}
|
}
|
||||||
OperationGUI_FilletDlg *aDlg = new OperationGUI_FilletDlg(parent, "", myOperationGUI, Sel, ic);
|
OperationGUI_FilletDlg *aDlg = new OperationGUI_FilletDlg(parent, "", myOperationGUI, Sel, ic);
|
||||||
@ -101,8 +102,8 @@ bool OperationGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
case 506: // CHAMFER
|
case 506: // CHAMFER
|
||||||
{
|
{
|
||||||
Handle(AIS_InteractiveContext) ic;
|
Handle(AIS_InteractiveContext) ic;
|
||||||
if(myOperationGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myOperationGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
ic = v3d->getAISContext();
|
ic = v3d->getAISContext();
|
||||||
}
|
}
|
||||||
OperationGUI_ChamferDlg *aDlg = new OperationGUI_ChamferDlg(parent, "", myOperationGUI, Sel, ic);
|
OperationGUI_ChamferDlg *aDlg = new OperationGUI_ChamferDlg(parent, "", myOperationGUI, Sel, ic);
|
||||||
@ -133,12 +134,12 @@ void OperationGUI::MakePartitionAndDisplay(const GEOM::GEOM_Gen::ListOfIOR& list
|
|||||||
listKeepInsIOR, listRemoveInsIOR,
|
listKeepInsIOR, listRemoveInsIOR,
|
||||||
(CORBA::Short) limit);
|
(CORBA::Short) limit);
|
||||||
if(result->_is_nil()) {
|
if(result->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
result->NameType(tr("GEOM_PARTITION"));
|
result->NameType(tr("GEOM_PARTITION"));
|
||||||
if(myGeomBase->Display(result))
|
if(myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
@ -162,12 +163,12 @@ void OperationGUI::Archimede(const Handle(SALOME_InteractiveObject)& IO, const d
|
|||||||
GEOM::GEOM_Shape_var Result = myGeom->Archimede(Shape, aWeight, aWaterDensity, aMeshingDeflection);
|
GEOM::GEOM_Shape_var Result = myGeom->Archimede(Shape, aWeight, aWaterDensity, aMeshingDeflection);
|
||||||
Result->NameType(tr("GEOM_PLANE"));
|
Result->NameType(tr("GEOM_PLANE"));
|
||||||
if(myGeomBase->Display(Result)) {
|
if(myGeomBase->Display(Result)) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(IO->hasEntry()) {
|
if(IO->hasEntry()) {
|
||||||
SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
|
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
|
||||||
SALOMEDS::SObject_var obj = aStudy->FindObjectID( IO->getEntry());
|
SALOMEDS::SObject_var obj = aStudy->FindObjectID( IO->getEntry());
|
||||||
SALOMEDS::GenericAttribute_var anAttr;
|
SALOMEDS::GenericAttribute_var anAttr;
|
||||||
SALOMEDS::AttributeIOR_var anIOR;
|
SALOMEDS::AttributeIOR_var anIOR;
|
||||||
@ -178,7 +179,7 @@ void OperationGUI::Archimede(const Handle(SALOME_InteractiveObject)& IO, const d
|
|||||||
GEOM::GEOM_Shape_var Result = myGeom->Archimede(Shape, aWeight, aWaterDensity, aMeshingDeflection);
|
GEOM::GEOM_Shape_var Result = myGeom->Archimede(Shape, aWeight, aWaterDensity, aMeshingDeflection);
|
||||||
Result->NameType(tr("GEOM_PLANE"));
|
Result->NameType(tr("GEOM_PLANE"));
|
||||||
if (myGeomBase->Display(Result)) {
|
if (myGeomBase->Display(Result)) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -200,10 +201,10 @@ bool OperationGUI::OnFilletGetAll(const TopoDS_Shape& ShapeTopo, const double Ra
|
|||||||
GEOM::GEOM_Shape::ListOfSubShapeID_var ListOfID = new GEOM::GEOM_Shape::ListOfSubShapeID;
|
GEOM::GEOM_Shape::ListOfSubShapeID_var ListOfID = new GEOM::GEOM_Shape::ListOfSubShapeID;
|
||||||
ListOfID->length(0);
|
ListOfID->length(0);
|
||||||
|
|
||||||
SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
|
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
|
||||||
SALOMEDS::SObject_var theObj = aStudy->FindObjectIOR(ShapeTopoIOR);
|
SALOMEDS::SObject_var theObj = aStudy->FindObjectIOR(ShapeTopoIOR);
|
||||||
if(theObj->_is_nil()) {
|
if(theObj->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,7 +215,7 @@ bool OperationGUI::OnFilletGetAll(const TopoDS_Shape& ShapeTopo, const double Ra
|
|||||||
GEOM::GEOM_Shape_var aShape = myGeom->GetIORFromString(ShapeTopoIOR);
|
GEOM::GEOM_Shape_var aShape = myGeom->GetIORFromString(ShapeTopoIOR);
|
||||||
GEOM::GEOM_Shape_var result = myGeom->MakeFillet(aShape, Radius, SubShapeType, ListOfID);
|
GEOM::GEOM_Shape_var result = myGeom->MakeFillet(aShape, Radius, SubShapeType, ListOfID);
|
||||||
if(result->_is_nil()) {
|
if(result->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, result);
|
TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, result);
|
||||||
@ -223,7 +224,7 @@ bool OperationGUI::OnFilletGetAll(const TopoDS_Shape& ShapeTopo, const double Ra
|
|||||||
result->NameType(type);
|
result->NameType(type);
|
||||||
|
|
||||||
if(myGeomBase->Display(result))
|
if(myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch (const SALOME::SALOME_Exception& S_ex) {
|
catch (const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -240,15 +241,15 @@ bool OperationGUI::OnFilletGetSelected(const TopoDS_Shape& ShapeTopo, const char
|
|||||||
const double Radius, const int SubShapeType,
|
const double Radius, const int SubShapeType,
|
||||||
Standard_Integer& aLocalContextId, bool& myUseLocalContext)
|
Standard_Integer& aLocalContextId, bool& myUseLocalContext)
|
||||||
{
|
{
|
||||||
if (myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
if (QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
|
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
|
|
||||||
if(myUseLocalContext == false) {
|
if(myUseLocalContext == false) {
|
||||||
/* No local context opened for fillet method */
|
/* No local context opened for fillet method */
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -295,7 +296,7 @@ bool OperationGUI::OnFilletGetSelected(const TopoDS_Shape& ShapeTopo, const char
|
|||||||
aResult->NameType(type);
|
aResult->NameType(type);
|
||||||
|
|
||||||
if(myGeomBase->Display(aResult))
|
if(myGeomBase->Display(aResult))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -309,8 +310,8 @@ bool OperationGUI::OnFilletGetSelected(const TopoDS_Shape& ShapeTopo, const char
|
|||||||
|
|
||||||
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
||||||
myDisplayGUI->OnDisplayAll(true) ;
|
myDisplayGUI->OnDisplayAll(true) ;
|
||||||
myGeomGUI->GetActiveStudy()->updateObjBrowser();
|
QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser();
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_READY"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_READY"));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -322,13 +323,13 @@ bool OperationGUI::OnFilletGetSelected(const TopoDS_Shape& ShapeTopo, const char
|
|||||||
//=====================================================================================
|
//=====================================================================================
|
||||||
bool OperationGUI::OnChamferGetAll(const TopoDS_Shape& ShapeTopo, const double D1, const double D2, const int SubShapeType, const char* ShapeTopoIOR)
|
bool OperationGUI::OnChamferGetAll(const TopoDS_Shape& ShapeTopo, const double D1, const double D2, const int SubShapeType, const char* ShapeTopoIOR)
|
||||||
{
|
{
|
||||||
GEOM::GEOM_Shape::ListOfSubShapeID_var ListOfID = new GEOM::GEOM_Shape::ListOfSubShapeID;
|
GEOM::GEOM_Shape::ListOfSubShapeID_var ListOfID = new GEOM::GEOM_Shape::ListOfSubShapeID;
|
||||||
ListOfID->length(0);
|
ListOfID->length(0);
|
||||||
|
|
||||||
SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
|
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
|
||||||
SALOMEDS::SObject_var theObj = aStudy->FindObjectIOR(ShapeTopoIOR);
|
SALOMEDS::SObject_var theObj = aStudy->FindObjectIOR(ShapeTopoIOR);
|
||||||
if(theObj->_is_nil()) {
|
if(theObj->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -341,7 +342,7 @@ bool OperationGUI::OnChamferGetAll(const TopoDS_Shape& ShapeTopo, const double D
|
|||||||
GEOM::GEOM_Shape_var aShape = myGeom->GetIORFromString(ShapeTopoIOR);
|
GEOM::GEOM_Shape_var aShape = myGeom->GetIORFromString(ShapeTopoIOR);
|
||||||
GEOM::GEOM_Shape_var result = myGeom->MakeChamfer(aShape, D1, D2, SubShapeType, ListOfID);
|
GEOM::GEOM_Shape_var result = myGeom->MakeChamfer(aShape, D1, D2, SubShapeType, ListOfID);
|
||||||
if(result->_is_nil()) {
|
if(result->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -351,7 +352,7 @@ bool OperationGUI::OnChamferGetAll(const TopoDS_Shape& ShapeTopo, const double D
|
|||||||
result->NameType(type);
|
result->NameType(type);
|
||||||
|
|
||||||
if(myGeomBase->Display(result))
|
if(myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch (const SALOME::SALOME_Exception& S_ex) {
|
catch (const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -368,15 +369,15 @@ bool OperationGUI::OnChamferGetSelected(const TopoDS_Shape& ShapeTopo, const cha
|
|||||||
const double D1, const double D2, const int SubShapeType,
|
const double D1, const double D2, const int SubShapeType,
|
||||||
Standard_Integer& aLocalContextId, bool& myUseLocalContext)
|
Standard_Integer& aLocalContextId, bool& myUseLocalContext)
|
||||||
{
|
{
|
||||||
if (myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
if (QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
|
|
||||||
if(myUseLocalContext == false) {
|
if(myUseLocalContext == false) {
|
||||||
/* No local context opened for chamfer method */
|
/* No local context opened for chamfer method */
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -423,7 +424,7 @@ bool OperationGUI::OnChamferGetSelected(const TopoDS_Shape& ShapeTopo, const cha
|
|||||||
aResult->NameType(type);
|
aResult->NameType(type);
|
||||||
|
|
||||||
if(myGeomBase->Display(aResult))
|
if(myGeomBase->Display(aResult))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -437,8 +438,8 @@ bool OperationGUI::OnChamferGetSelected(const TopoDS_Shape& ShapeTopo, const cha
|
|||||||
|
|
||||||
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
||||||
myDisplayGUI->OnDisplayAll(true) ;
|
myDisplayGUI->OnDisplayAll(true) ;
|
||||||
myGeomGUI->GetActiveStudy()->updateObjBrowser();
|
QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser();
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_READY"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_READY"));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -152,7 +152,7 @@ void OperationGUI_ArchimedeDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void OperationGUI_ArchimedeDlg::ClickOnApply()
|
void OperationGUI_ArchimedeDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
if(myOkIO)
|
if(myOkIO)
|
||||||
myOperationGUI->Archimede(myIO, myWeight, myWaterDensity, myMeshingDeflection);
|
myOperationGUI->Archimede(myIO, myWeight, myWaterDensity, myMeshingDeflection);
|
||||||
return;
|
return;
|
||||||
|
@ -30,14 +30,13 @@ using namespace std;
|
|||||||
#include "OperationGUI_ChamferDlg.h"
|
#include "OperationGUI_ChamferDlg.h"
|
||||||
|
|
||||||
#include "DisplayGUI.h"
|
#include "DisplayGUI.h"
|
||||||
#include "QAD_Config.h"
|
|
||||||
#include "QAD_RightFrame.h"
|
|
||||||
#include "OCCViewer_Viewer3d.h"
|
|
||||||
|
|
||||||
|
#include <AIS_InteractiveContext.hxx>
|
||||||
#include <BRepFilletAPI_MakeChamfer.hxx>
|
#include <BRepFilletAPI_MakeChamfer.hxx>
|
||||||
#include <BRepTools.hxx>
|
#include <BRepTools.hxx>
|
||||||
#include <BRep_Tool.hxx>
|
#include <BRep_Tool.hxx>
|
||||||
#include <TopExp.hxx>
|
#include <TopExp.hxx>
|
||||||
|
#include <Precision.hxx>
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : OperationGUI_ChamferDlg()
|
// class : OperationGUI_ChamferDlg()
|
||||||
@ -114,26 +113,21 @@ void OperationGUI_ChamferDlg::Init(Handle (AIS_InteractiveContext) ic)
|
|||||||
myConstructorId = 0;
|
myConstructorId = 0;
|
||||||
myEditCurrentArgument = Group1->LineEdit1;
|
myEditCurrentArgument = Group1->LineEdit1;
|
||||||
|
|
||||||
myD1 = 50.0;
|
myD1 = 5.0;
|
||||||
myOkD1 = true;
|
myD2 = 5.0;
|
||||||
myD2 = 50.0;
|
|
||||||
myOkD2 = true;
|
|
||||||
myOkShape = false;
|
myOkShape = false;
|
||||||
myIC = ic;
|
myIC = ic;
|
||||||
myLocalContextId = -1;
|
myLocalContextId = -1;
|
||||||
myUseLocalContext = false;
|
myUseLocalContext = false;
|
||||||
|
|
||||||
/* Get setting of step value from file configuration */
|
double SpecificStep = 10.0;
|
||||||
QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep");
|
|
||||||
step = St.toDouble();
|
|
||||||
|
|
||||||
/* min, max, step and decimals for spin boxes */
|
/* min, max, step and decimals for spin boxes */
|
||||||
Group1->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3);
|
Group1->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
|
||||||
Group2->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3);
|
Group2->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
|
||||||
Group3->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3);
|
Group3->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
|
||||||
Group1->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, step, 3);
|
Group1->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
|
||||||
Group2->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, step, 3);
|
Group2->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
|
||||||
Group3->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, step, 3);
|
Group3->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
|
||||||
|
|
||||||
Group1->SpinBox_DX->SetValue(myD1);
|
Group1->SpinBox_DX->SetValue(myD1);
|
||||||
Group2->SpinBox_DX->SetValue(myD1);
|
Group2->SpinBox_DX->SetValue(myD1);
|
||||||
@ -196,23 +190,17 @@ void OperationGUI_ChamferDlg::ConstructorsClicked(int constructorId)
|
|||||||
mySimulationTopoDs.Nullify();
|
mySimulationTopoDs.Nullify();
|
||||||
disconnect(mySelection, 0, this, 0);
|
disconnect(mySelection, 0, this, 0);
|
||||||
myOkShape = false;
|
myOkShape = false;
|
||||||
myD1 = 50.0;
|
myD1 = 5.0;
|
||||||
myD2 = 50.0;
|
myD2 = 5.0;
|
||||||
myOkD1 = true;
|
|
||||||
myOkD2 = true;
|
|
||||||
|
|
||||||
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myUseLocalContext) {
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
myIC->CloseLocalContext(myLocalContextId);
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
||||||
myIC = v3d->getAISContext();
|
myDisplayGUI->OnDisplayAll(true);
|
||||||
if(myUseLocalContext) {
|
myUseLocalContext = false;
|
||||||
myIC->CloseLocalContext(myLocalContextId);
|
|
||||||
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
|
||||||
myDisplayGUI->OnDisplayAll(true);
|
|
||||||
myUseLocalContext = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
switch (constructorId)
|
switch (constructorId)
|
||||||
{
|
{
|
||||||
case 0: /* Chamfer All */
|
case 0: /* Chamfer All */
|
||||||
@ -228,7 +216,6 @@ void OperationGUI_ChamferDlg::ConstructorsClicked(int constructorId)
|
|||||||
|
|
||||||
Group1->SpinBox_DX->SetValue(myD1);
|
Group1->SpinBox_DX->SetValue(myD1);
|
||||||
Group1->SpinBox_DY->SetValue(myD2);
|
Group1->SpinBox_DY->SetValue(myD2);
|
||||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1: /* Chamfer edges */
|
case 1: /* Chamfer edges */
|
||||||
@ -244,7 +231,6 @@ void OperationGUI_ChamferDlg::ConstructorsClicked(int constructorId)
|
|||||||
|
|
||||||
Group2->SpinBox_DX->SetValue(myD1);
|
Group2->SpinBox_DX->SetValue(myD1);
|
||||||
Group2->SpinBox_DY->SetValue(myD2);
|
Group2->SpinBox_DY->SetValue(myD2);
|
||||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2: /* Chamfer Faces */
|
case 2: /* Chamfer Faces */
|
||||||
@ -260,7 +246,6 @@ void OperationGUI_ChamferDlg::ConstructorsClicked(int constructorId)
|
|||||||
|
|
||||||
Group3->SpinBox_DX->SetValue(myD1);
|
Group3->SpinBox_DX->SetValue(myD1);
|
||||||
Group3->SpinBox_DY->SetValue(myD2);
|
Group3->SpinBox_DY->SetValue(myD2);
|
||||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -286,7 +271,8 @@ void OperationGUI_ChamferDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void OperationGUI_ChamferDlg::ClickOnApply()
|
void OperationGUI_ChamferDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QApplication::setOverrideCursor(Qt::waitCursor);
|
||||||
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
myGeomBase->EraseSimulationShape();
|
myGeomBase->EraseSimulationShape();
|
||||||
mySimulationTopoDs.Nullify();
|
mySimulationTopoDs.Nullify();
|
||||||
|
|
||||||
@ -295,20 +281,20 @@ void OperationGUI_ChamferDlg::ClickOnApply()
|
|||||||
{
|
{
|
||||||
case 0 : /* Chamfer All */
|
case 0 : /* Chamfer All */
|
||||||
{
|
{
|
||||||
if(myOkD1 && myOkD2 && myOkShape)
|
if(myOkShape)
|
||||||
testResult = myOperationGUI->OnChamferGetAll(myShape, myD1, myD2, myShapeType, myShapeIOR);
|
testResult = myOperationGUI->OnChamferGetAll(myShape, myD1, myD2, myShapeType, myShapeIOR);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1 : /* Chamfer Edge */
|
case 1 : /* Chamfer Edge */
|
||||||
{
|
{
|
||||||
if(myOkD1 && myOkD2 && myOkShape)
|
if(myOkShape)
|
||||||
testResult = myOperationGUI->OnChamferGetSelected(myShape, myShapeIOR, myD1, myD2, myShapeType,
|
testResult = myOperationGUI->OnChamferGetSelected(myShape, myShapeIOR, myD1, myD2, myShapeType,
|
||||||
myLocalContextId, myUseLocalContext);
|
myLocalContextId, myUseLocalContext);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2 : /* Chamfer Face */
|
case 2 : /* Chamfer Face */
|
||||||
{
|
{
|
||||||
if(myOkD1 && myOkD2 && myOkShape)
|
if(myOkShape)
|
||||||
testResult = myOperationGUI->OnChamferGetSelected(myShape, myShapeIOR, myD1, myD2, myShapeType,
|
testResult = myOperationGUI->OnChamferGetSelected(myShape, myShapeIOR, myD1, myD2, myShapeType,
|
||||||
myLocalContextId, myUseLocalContext);
|
myLocalContextId, myUseLocalContext);
|
||||||
break;
|
break;
|
||||||
@ -316,11 +302,12 @@ void OperationGUI_ChamferDlg::ClickOnApply()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!testResult)
|
if(!testResult)
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
else
|
else
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
/* Reset all arguments and local context to allow user a new selection ...*/
|
/* Reset all arguments and local context to allow user a new selection ...*/
|
||||||
this->ResetStateOfDialog();
|
this->ResetStateOfDialog();
|
||||||
|
QApplication::restoreOverrideCursor();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -331,17 +318,7 @@ void OperationGUI_ChamferDlg::ClickOnApply()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void OperationGUI_ChamferDlg::ClickOnCancel()
|
void OperationGUI_ChamferDlg::ClickOnCancel()
|
||||||
{
|
{
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
this->ResetStateOfDialog();
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
|
||||||
myIC = v3d->getAISContext();
|
|
||||||
|
|
||||||
if(myUseLocalContext) {
|
|
||||||
myIC->CloseLocalContext(myLocalContextId);
|
|
||||||
myUseLocalContext = false;
|
|
||||||
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
|
||||||
myDisplayGUI->OnDisplayAll(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GEOMBase_Skeleton::ClickOnCancel();
|
GEOMBase_Skeleton::ClickOnCancel();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -354,6 +331,7 @@ void OperationGUI_ChamferDlg::ClickOnCancel()
|
|||||||
void OperationGUI_ChamferDlg::SelectionIntoArgument()
|
void OperationGUI_ChamferDlg::SelectionIntoArgument()
|
||||||
{
|
{
|
||||||
myGeomBase->EraseSimulationShape();
|
myGeomBase->EraseSimulationShape();
|
||||||
|
mySimulationTopoDs.Nullify();
|
||||||
myEditCurrentArgument->setText("");
|
myEditCurrentArgument->setText("");
|
||||||
this->ResetStateOfDialog();
|
this->ResetStateOfDialog();
|
||||||
QString aString = ""; /* name of selection */
|
QString aString = ""; /* name of selection */
|
||||||
@ -365,7 +343,7 @@ void OperationGUI_ChamferDlg::SelectionIntoArgument()
|
|||||||
if(!myGeomBase->GetTopoFromSelection(mySelection, S))
|
if(!myGeomBase->GetTopoFromSelection(mySelection, S))
|
||||||
return;
|
return;
|
||||||
if(!IO->hasEntry()) {
|
if(!IO->hasEntry()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -379,7 +357,7 @@ void OperationGUI_ChamferDlg::SelectionIntoArgument()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(IO->hasEntry()) {
|
if(IO->hasEntry()) {
|
||||||
SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
|
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
|
||||||
SALOMEDS::SObject_var obj = aStudy->FindObjectID(IO->getEntry());
|
SALOMEDS::SObject_var obj = aStudy->FindObjectID(IO->getEntry());
|
||||||
SALOMEDS::GenericAttribute_var anAttr;
|
SALOMEDS::GenericAttribute_var anAttr;
|
||||||
SALOMEDS::AttributeIOR_var anIOR;
|
SALOMEDS::AttributeIOR_var anIOR;
|
||||||
@ -394,7 +372,8 @@ void OperationGUI_ChamferDlg::SelectionIntoArgument()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this->MakePreview();
|
if(myConstructorId == 0)
|
||||||
|
this->MakePreview();
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -462,8 +441,6 @@ void OperationGUI_ChamferDlg::SetEditCurrentArgument()
|
|||||||
void OperationGUI_ChamferDlg::DeactivateActiveDialog()
|
void OperationGUI_ChamferDlg::DeactivateActiveDialog()
|
||||||
{
|
{
|
||||||
this->ResetStateOfDialog();
|
this->ResetStateOfDialog();
|
||||||
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
|
||||||
myDisplayGUI->OnDisplayAll(true);
|
|
||||||
GEOMBase_Skeleton::DeactivateActiveDialog();
|
GEOMBase_Skeleton::DeactivateActiveDialog();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -520,14 +497,14 @@ void OperationGUI_ChamferDlg::ValueChangedInSpinBox( double newValue )
|
|||||||
QObject* send = (QObject*)sender();
|
QObject* send = (QObject*)sender();
|
||||||
if(send == Group1->SpinBox_DX || send == Group2->SpinBox_DX || send == Group3->SpinBox_DX) { /* D1 */
|
if(send == Group1->SpinBox_DX || send == Group2->SpinBox_DX || send == Group3->SpinBox_DX) { /* D1 */
|
||||||
myD1 = newValue;
|
myD1 = newValue;
|
||||||
myOkD1 = true;
|
if(myConstructorId == 0)
|
||||||
this->MakePreview();
|
this->MakePreview();
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
else if(send == Group1->SpinBox_DY || send == Group2->SpinBox_DY || send == Group3->SpinBox_DY) { /* D2 */
|
else if(send == Group1->SpinBox_DY || send == Group2->SpinBox_DY || send == Group3->SpinBox_DY) { /* D2 */
|
||||||
myD2 = newValue;
|
myD2 = newValue;
|
||||||
myOkD2 = true;
|
if(myConstructorId == 0)
|
||||||
this->MakePreview();
|
this->MakePreview();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -542,18 +519,14 @@ void OperationGUI_ChamferDlg::ResetStateOfDialog()
|
|||||||
{
|
{
|
||||||
myOkShape = false;
|
myOkShape = false;
|
||||||
myEditCurrentArgument->setText("");
|
myEditCurrentArgument->setText("");
|
||||||
|
QApplication::restoreOverrideCursor();
|
||||||
|
|
||||||
/* Close its local contact if opened */
|
/* Close its local contact if opened */
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myUseLocalContext) {
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
myIC->CloseLocalContext(myLocalContextId);
|
||||||
myIC = v3d->getAISContext();
|
myUseLocalContext = false;
|
||||||
|
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
||||||
if(myUseLocalContext) {
|
myDisplayGUI->OnDisplayAll(true);
|
||||||
myIC->CloseLocalContext(myLocalContextId);
|
|
||||||
myUseLocalContext = false;
|
|
||||||
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
|
||||||
myDisplayGUI->OnDisplayAll(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -565,33 +538,49 @@ void OperationGUI_ChamferDlg::ResetStateOfDialog()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void OperationGUI_ChamferDlg::MakePreview()
|
void OperationGUI_ChamferDlg::MakePreview()
|
||||||
{
|
{
|
||||||
TopoDS_Shape tds;
|
QApplication::setOverrideCursor(Qt::waitCursor);
|
||||||
|
|
||||||
|
if(!myOkShape) {
|
||||||
|
QApplication::restoreOverrideCursor();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
GEOM::GEOM_Shape::ListOfSubShapeID_var ListOfID = new GEOM::GEOM_Shape::ListOfSubShapeID;
|
||||||
|
ListOfID->length(0);
|
||||||
|
|
||||||
|
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
|
||||||
|
SALOMEDS::SObject_var theObj = aStudy->FindObjectIOR(myShapeIOR);
|
||||||
|
if(theObj->_is_nil()) {
|
||||||
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
|
||||||
|
QApplication::restoreOverrideCursor();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
BRepFilletAPI_MakeChamfer MC(myShape);
|
if(myD1 <= Precision::Confusion() || myD2 <= Precision::Confusion()) {
|
||||||
switch (myConstructorId)
|
QApplication::restoreOverrideCursor();
|
||||||
{
|
return;
|
||||||
case 0: /* Chamfer All */
|
|
||||||
{
|
|
||||||
TopTools_IndexedDataMapOfShapeListOfShape M;
|
|
||||||
TopExp::MapShapesAndAncestors(myShape,TopAbs_EDGE,TopAbs_FACE,M);
|
|
||||||
for(int i = 1;i<=M.Extent();i++) {
|
|
||||||
TopoDS_Edge E = TopoDS::Edge(M.FindKey(i));
|
|
||||||
TopoDS_Face F = TopoDS::Face(M.FindFromIndex(i).First());
|
|
||||||
if(!BRepTools::IsReallyClosed(E, F) && !BRep_Tool::Degenerated(E))
|
|
||||||
MC.Add(myD1, myD2,E,F);
|
|
||||||
}
|
|
||||||
tds = MC.Shape();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!tds.IsNull()) {
|
|
||||||
mySimulationTopoDs = tds;
|
|
||||||
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GEOM::GEOM_Shape_var aShape = myGeom->GetIORFromString(myShapeIOR);
|
||||||
|
GEOM::GEOM_Shape_var result = myGeom->MakeChamfer(aShape, myD1, myD2, myShapeType, ListOfID);
|
||||||
|
if(result->_is_nil()) {
|
||||||
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
|
QApplication::restoreOverrideCursor();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, result);
|
||||||
|
|
||||||
|
mySimulationTopoDs = S;
|
||||||
|
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
|
||||||
}
|
}
|
||||||
catch(Standard_Failure) {
|
catch(Standard_Failure) {
|
||||||
myGeomBase->EraseSimulationShape();
|
MESSAGE("Exception catched in MakePreview");
|
||||||
mySimulationTopoDs.Nullify();
|
QApplication::restoreOverrideCursor();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
QApplication::restoreOverrideCursor();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,6 @@ private :
|
|||||||
|
|
||||||
OperationGUI* myOperationGUI;
|
OperationGUI* myOperationGUI;
|
||||||
|
|
||||||
double step;
|
|
||||||
int myConstructorId; /* Current constructor id = radio button id */
|
int myConstructorId; /* Current constructor id = radio button id */
|
||||||
|
|
||||||
/* Interactive and local context management see also : bool myUseLocalContext() */
|
/* Interactive and local context management see also : bool myUseLocalContext() */
|
||||||
@ -69,9 +68,7 @@ private :
|
|||||||
bool myOkShape;
|
bool myOkShape;
|
||||||
char* myShapeIOR;
|
char* myShapeIOR;
|
||||||
int myShapeType;
|
int myShapeType;
|
||||||
bool myOkD1;
|
|
||||||
double myD1;
|
double myD1;
|
||||||
bool myOkD2;
|
|
||||||
double myD2;
|
double myD2;
|
||||||
|
|
||||||
DlgRef_1Sel2Spin* Group1;
|
DlgRef_1Sel2Spin* Group1;
|
||||||
|
@ -30,12 +30,11 @@ using namespace std;
|
|||||||
#include "OperationGUI_FilletDlg.h"
|
#include "OperationGUI_FilletDlg.h"
|
||||||
|
|
||||||
#include "DisplayGUI.h"
|
#include "DisplayGUI.h"
|
||||||
#include "QAD_Config.h"
|
|
||||||
#include "QAD_RightFrame.h"
|
|
||||||
#include "OCCViewer_Viewer3d.h"
|
|
||||||
|
|
||||||
|
#include <AIS_InteractiveContext.hxx>
|
||||||
#include <TopExp_Explorer.hxx>
|
#include <TopExp_Explorer.hxx>
|
||||||
#include <BRepFilletAPI_MakeFillet.hxx>
|
#include <BRepFilletAPI_MakeFillet.hxx>
|
||||||
|
#include <Precision.hxx>
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : OperationGUI_FilletDlg()
|
// class : OperationGUI_FilletDlg()
|
||||||
@ -109,21 +108,17 @@ void OperationGUI_FilletDlg::Init(Handle(AIS_InteractiveContext) ic)
|
|||||||
myConstructorId = 0;
|
myConstructorId = 0;
|
||||||
myEditCurrentArgument = Group1->LineEdit1;
|
myEditCurrentArgument = Group1->LineEdit1;
|
||||||
|
|
||||||
myRadius = 50.0;
|
myRadius = 5.0;
|
||||||
myOkRadius = true;
|
|
||||||
myOkShape = false;
|
myOkShape = false;
|
||||||
myIC = ic;
|
myIC = ic;
|
||||||
myLocalContextId = -1;
|
myLocalContextId = -1;
|
||||||
myUseLocalContext = false;
|
myUseLocalContext = false;
|
||||||
|
|
||||||
/* Get setting of step value from file configuration */
|
double SpecificStep = 10.0;
|
||||||
QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep");
|
|
||||||
step = St.toDouble();
|
|
||||||
|
|
||||||
/* min, max, step and decimals for spin boxes */
|
/* min, max, step and decimals for spin boxes */
|
||||||
Group1->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3);
|
Group1->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
|
||||||
Group2->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3);
|
Group2->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
|
||||||
Group3->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3);
|
Group3->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
|
||||||
|
|
||||||
Group1->SpinBox_DX->SetValue(myRadius);
|
Group1->SpinBox_DX->SetValue(myRadius);
|
||||||
Group2->SpinBox_DX->SetValue(myRadius);
|
Group2->SpinBox_DX->SetValue(myRadius);
|
||||||
@ -177,20 +172,16 @@ void OperationGUI_FilletDlg::ConstructorsClicked(int constructorId)
|
|||||||
mySimulationTopoDs.Nullify();
|
mySimulationTopoDs.Nullify();
|
||||||
disconnect(mySelection, 0, this, 0);
|
disconnect(mySelection, 0, this, 0);
|
||||||
myOkShape = false;
|
myOkShape = false;
|
||||||
myRadius = 50.0;
|
myRadius = 5.0;
|
||||||
myOkRadius = true;
|
|
||||||
|
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myUseLocalContext) {
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
myIC->CloseLocalContext(myLocalContextId);
|
||||||
myIC = v3d->getAISContext();
|
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
||||||
if(myUseLocalContext) {
|
myDisplayGUI->OnDisplayAll(true);
|
||||||
myIC->CloseLocalContext(myLocalContextId);
|
myUseLocalContext = false;
|
||||||
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
|
||||||
myDisplayGUI->OnDisplayAll(true);
|
|
||||||
this->myUseLocalContext = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
switch (constructorId)
|
switch (constructorId)
|
||||||
{
|
{
|
||||||
case 0: /* Fillet All */
|
case 0: /* Fillet All */
|
||||||
@ -205,7 +196,6 @@ void OperationGUI_FilletDlg::ConstructorsClicked(int constructorId)
|
|||||||
myShapeType = -1;
|
myShapeType = -1;
|
||||||
|
|
||||||
Group1->SpinBox_DX->SetValue(myRadius);
|
Group1->SpinBox_DX->SetValue(myRadius);
|
||||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1: /* Fillet edges */
|
case 1: /* Fillet edges */
|
||||||
@ -220,7 +210,6 @@ void OperationGUI_FilletDlg::ConstructorsClicked(int constructorId)
|
|||||||
myShapeType = 6;
|
myShapeType = 6;
|
||||||
|
|
||||||
Group2->SpinBox_DX->SetValue(myRadius);
|
Group2->SpinBox_DX->SetValue(myRadius);
|
||||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2: /* Fillet Faces */
|
case 2: /* Fillet Faces */
|
||||||
@ -235,7 +224,6 @@ void OperationGUI_FilletDlg::ConstructorsClicked(int constructorId)
|
|||||||
myShapeType = 4;
|
myShapeType = 4;
|
||||||
|
|
||||||
Group3->SpinBox_DX->SetValue(myRadius);
|
Group3->SpinBox_DX->SetValue(myRadius);
|
||||||
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -261,7 +249,8 @@ void OperationGUI_FilletDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void OperationGUI_FilletDlg::ClickOnApply()
|
void OperationGUI_FilletDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QApplication::setOverrideCursor(Qt::waitCursor);
|
||||||
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
myGeomBase->EraseSimulationShape();
|
myGeomBase->EraseSimulationShape();
|
||||||
mySimulationTopoDs.Nullify();
|
mySimulationTopoDs.Nullify();
|
||||||
|
|
||||||
@ -270,30 +259,31 @@ void OperationGUI_FilletDlg::ClickOnApply()
|
|||||||
{
|
{
|
||||||
case 0 : /* Fillet All */
|
case 0 : /* Fillet All */
|
||||||
{
|
{
|
||||||
if(myOkRadius && myOkShape)
|
if(myOkShape)
|
||||||
testResult = myOperationGUI->OnFilletGetAll(myShape, myRadius, myShapeType, myShapeIOR);
|
testResult = myOperationGUI->OnFilletGetAll(myShape, myRadius, myShapeType, myShapeIOR);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1 : /* Fillet Edge */
|
case 1 : /* Fillet Edge */
|
||||||
{
|
{
|
||||||
if(myOkRadius && myOkShape)
|
if(myOkShape)
|
||||||
testResult = myOperationGUI->OnFilletGetSelected(myShape, myShapeIOR, myRadius, myShapeType, myLocalContextId, myUseLocalContext);
|
testResult = myOperationGUI->OnFilletGetSelected(myShape, myShapeIOR, myRadius, myShapeType, myLocalContextId, myUseLocalContext);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2 : /* Fillet Face */
|
case 2 : /* Fillet Face */
|
||||||
{
|
{
|
||||||
if(myOkRadius && myOkShape)
|
if(myOkShape)
|
||||||
testResult = myOperationGUI->OnFilletGetSelected(myShape, myShapeIOR, myRadius, myShapeType, myLocalContextId, myUseLocalContext);
|
testResult = myOperationGUI->OnFilletGetSelected(myShape, myShapeIOR, myRadius, myShapeType, myLocalContextId, myUseLocalContext);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!testResult)
|
if(!testResult)
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
else
|
else
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
/* Reset all arguments and local context to allow user a new selection ...*/
|
/* Reset all arguments and local context to allow user a new selection ...*/
|
||||||
this->ResetStateOfDialog();
|
this->ResetStateOfDialog();
|
||||||
|
QApplication::restoreOverrideCursor();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -304,17 +294,7 @@ void OperationGUI_FilletDlg::ClickOnApply()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void OperationGUI_FilletDlg::ClickOnCancel()
|
void OperationGUI_FilletDlg::ClickOnCancel()
|
||||||
{
|
{
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
this->ResetStateOfDialog();
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
|
||||||
myIC = v3d->getAISContext();
|
|
||||||
|
|
||||||
if(myUseLocalContext) {
|
|
||||||
myIC->CloseLocalContext(myLocalContextId);
|
|
||||||
myUseLocalContext = false;
|
|
||||||
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
|
||||||
myDisplayGUI->OnDisplayAll(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GEOMBase_Skeleton::ClickOnCancel();
|
GEOMBase_Skeleton::ClickOnCancel();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -327,6 +307,7 @@ void OperationGUI_FilletDlg::ClickOnCancel()
|
|||||||
void OperationGUI_FilletDlg::SelectionIntoArgument()
|
void OperationGUI_FilletDlg::SelectionIntoArgument()
|
||||||
{
|
{
|
||||||
myGeomBase->EraseSimulationShape();
|
myGeomBase->EraseSimulationShape();
|
||||||
|
mySimulationTopoDs.Nullify();
|
||||||
myEditCurrentArgument->setText("");
|
myEditCurrentArgument->setText("");
|
||||||
this->ResetStateOfDialog();
|
this->ResetStateOfDialog();
|
||||||
QString aString = ""; /* name of selection */
|
QString aString = ""; /* name of selection */
|
||||||
@ -338,7 +319,7 @@ void OperationGUI_FilletDlg::SelectionIntoArgument()
|
|||||||
if(!myGeomBase->GetTopoFromSelection(mySelection, S))
|
if(!myGeomBase->GetTopoFromSelection(mySelection, S))
|
||||||
return;
|
return;
|
||||||
if(!IO->hasEntry()) {
|
if(!IO->hasEntry()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -352,7 +333,7 @@ void OperationGUI_FilletDlg::SelectionIntoArgument()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(IO->hasEntry()) {
|
if(IO->hasEntry()) {
|
||||||
SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
|
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
|
||||||
SALOMEDS::SObject_var obj = aStudy->FindObjectID(IO->getEntry());
|
SALOMEDS::SObject_var obj = aStudy->FindObjectID(IO->getEntry());
|
||||||
SALOMEDS::GenericAttribute_var anAttr;
|
SALOMEDS::GenericAttribute_var anAttr;
|
||||||
SALOMEDS::AttributeIOR_var anIOR;
|
SALOMEDS::AttributeIOR_var anIOR;
|
||||||
@ -367,8 +348,8 @@ void OperationGUI_FilletDlg::SelectionIntoArgument()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this->MakePreview();
|
if(myConstructorId == 0)
|
||||||
|
this->MakePreview();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
@ -434,10 +415,9 @@ void OperationGUI_FilletDlg::SetEditCurrentArgument()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void OperationGUI_FilletDlg::DeactivateActiveDialog()
|
void OperationGUI_FilletDlg::DeactivateActiveDialog()
|
||||||
{
|
{
|
||||||
this->ResetStateOfDialog();
|
this->ResetStateOfDialog();
|
||||||
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
GEOMBase_Skeleton::DeactivateActiveDialog();
|
||||||
myDisplayGUI->OnDisplayAll(true);
|
return;
|
||||||
GEOMBase_Skeleton::DeactivateActiveDialog();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -488,18 +468,14 @@ void OperationGUI_FilletDlg::ResetStateOfDialog()
|
|||||||
{
|
{
|
||||||
myOkShape = false;
|
myOkShape = false;
|
||||||
myEditCurrentArgument->setText("");
|
myEditCurrentArgument->setText("");
|
||||||
|
QApplication::restoreOverrideCursor();
|
||||||
|
|
||||||
/* Close its local contact if opened */
|
/* Close its local contact if opened */
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myUseLocalContext) {
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
myIC->CloseLocalContext(myLocalContextId);
|
||||||
myIC = v3d->getAISContext();
|
myUseLocalContext = false;
|
||||||
|
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
||||||
if(myUseLocalContext) {
|
myDisplayGUI->OnDisplayAll(true);
|
||||||
myIC->CloseLocalContext(myLocalContextId);
|
|
||||||
myUseLocalContext = false;
|
|
||||||
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
|
||||||
myDisplayGUI->OnDisplayAll(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -515,9 +491,9 @@ void OperationGUI_FilletDlg::ValueChangedInSpinBox(double newValue)
|
|||||||
mySimulationTopoDs.Nullify();
|
mySimulationTopoDs.Nullify();
|
||||||
|
|
||||||
myRadius = newValue;
|
myRadius = newValue;
|
||||||
myOkRadius = true;
|
|
||||||
|
|
||||||
MakePreview();
|
if(myConstructorId == 0)
|
||||||
|
this->MakePreview();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -528,33 +504,47 @@ void OperationGUI_FilletDlg::ValueChangedInSpinBox(double newValue)
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void OperationGUI_FilletDlg::MakePreview()
|
void OperationGUI_FilletDlg::MakePreview()
|
||||||
{
|
{
|
||||||
TopoDS_Shape tds;
|
QApplication::setOverrideCursor(Qt::waitCursor);
|
||||||
try {
|
|
||||||
BRepFilletAPI_MakeFillet fill(myShape);
|
|
||||||
switch (myConstructorId)
|
|
||||||
{
|
|
||||||
case 0: /* Fillet All */
|
|
||||||
{
|
|
||||||
TopExp_Explorer Exp (myShape, TopAbs_EDGE);
|
|
||||||
for(Exp; Exp.More(); Exp.Next()) {
|
|
||||||
TopoDS_Edge E = TopoDS::Edge(Exp.Current());
|
|
||||||
fill.Add(E);
|
|
||||||
}
|
|
||||||
for(int i = 1;i<=fill.NbContours();i++)
|
|
||||||
fill.SetRadius(myRadius,i);
|
|
||||||
|
|
||||||
tds = fill.Shape();
|
if(!myOkShape) {
|
||||||
break;
|
QApplication::restoreOverrideCursor();
|
||||||
}
|
return;
|
||||||
}
|
}
|
||||||
if(!tds.IsNull()) {
|
|
||||||
mySimulationTopoDs = tds;
|
GEOM::GEOM_Shape::ListOfSubShapeID_var ListOfID = new GEOM::GEOM_Shape::ListOfSubShapeID;
|
||||||
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
|
ListOfID->length(0);
|
||||||
|
|
||||||
|
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
|
||||||
|
SALOMEDS::SObject_var theObj = aStudy->FindObjectIOR(myShapeIOR);
|
||||||
|
if(theObj->_is_nil()) {
|
||||||
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
|
||||||
|
QApplication::restoreOverrideCursor();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
if(myRadius <= Precision::Confusion()) {
|
||||||
|
QApplication::restoreOverrideCursor();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GEOM::GEOM_Shape_var aShape = myGeom->GetIORFromString(myShapeIOR);
|
||||||
|
GEOM::GEOM_Shape_var result = myGeom->MakeFillet(aShape, myRadius, myShapeType, ListOfID);
|
||||||
|
if(result->_is_nil()) {
|
||||||
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
|
QApplication::restoreOverrideCursor();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, result);
|
||||||
|
|
||||||
|
mySimulationTopoDs = S;
|
||||||
|
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
|
||||||
}
|
}
|
||||||
catch(Standard_Failure) {
|
catch(Standard_Failure) {
|
||||||
myGeomBase->EraseSimulationShape();
|
MESSAGE("Exception catched in MakePreview");
|
||||||
mySimulationTopoDs.Nullify();
|
QApplication::restoreOverrideCursor();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
QApplication::restoreOverrideCursor();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,6 @@ private :
|
|||||||
|
|
||||||
OperationGUI* myOperationGUI;
|
OperationGUI* myOperationGUI;
|
||||||
|
|
||||||
double step;
|
|
||||||
int myConstructorId; /* Current constructor id = radio button id */
|
int myConstructorId; /* Current constructor id = radio button id */
|
||||||
|
|
||||||
/* Interactive and local context management see also : bool myUseLocalContext() */
|
/* Interactive and local context management see also : bool myUseLocalContext() */
|
||||||
@ -69,7 +68,6 @@ private :
|
|||||||
bool myOkShape;
|
bool myOkShape;
|
||||||
char* myShapeIOR;
|
char* myShapeIOR;
|
||||||
int myShapeType;
|
int myShapeType;
|
||||||
bool myOkRadius;
|
|
||||||
double myRadius;
|
double myRadius;
|
||||||
|
|
||||||
DlgRef_1Sel1Spin* Group1;
|
DlgRef_1Sel1Spin* Group1;
|
||||||
|
@ -148,7 +148,7 @@ void OperationGUI_PartitionDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void OperationGUI_PartitionDlg::ClickOnApply()
|
void OperationGUI_PartitionDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
|
|
||||||
if(myOkListShapes || myOkListTools || myOkKeepShape || myOkRemoveShape) {
|
if(myOkListShapes || myOkListTools || myOkKeepShape || myOkRemoveShape) {
|
||||||
GEOM::shape_type limit;
|
GEOM::shape_type limit;
|
||||||
|
@ -55,21 +55,15 @@ LIB_MOC = \
|
|||||||
PrimitiveGUI_TorusDlg.h \
|
PrimitiveGUI_TorusDlg.h \
|
||||||
PrimitiveGUI_ConeDlg.h
|
PrimitiveGUI_ConeDlg.h
|
||||||
|
|
||||||
LIB_CLIENT_IDL = SALOME_Exception.idl \
|
LIB_CLIENT_IDL =
|
||||||
GEOM_Gen.idl \
|
|
||||||
GEOM_Shape.idl \
|
|
||||||
SALOMEDS.idl \
|
|
||||||
SALOMEDS_Attributes.idl \
|
|
||||||
SALOME_ModuleCatalog.idl \
|
|
||||||
SALOME_Component.idl \
|
|
||||||
|
|
||||||
LIB_SERVER_IDL =
|
LIB_SERVER_IDL =
|
||||||
|
|
||||||
# additionnal information to compil and link file
|
# additionnal information to compil and link file
|
||||||
|
|
||||||
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
||||||
CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
|
CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
|
||||||
|
|
||||||
LDFLAGS += -lOCCViewer -lVTKViewer -lSalomeObject -lSalomeGUI -lGEOMClient -lGEOMObject -lGEOMFiltersSelection -lDlgRef -lGEOMContext -lGEOMBase -L${KERNEL_ROOT_DIR}/lib/salome
|
LDFLAGS += -lGEOMFiltersSelection -lGEOMBase
|
||||||
|
|
||||||
@CONCLUDE@
|
@CONCLUDE@
|
||||||
|
@ -68,7 +68,7 @@ bool PrimitiveGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
{
|
{
|
||||||
PrimitiveGUI* aPrimitiveGUI = new PrimitiveGUI();
|
PrimitiveGUI* aPrimitiveGUI = new PrimitiveGUI();
|
||||||
aPrimitiveGUI->myGeomGUI->EmitSignalDeactivateDialog();
|
aPrimitiveGUI->myGeomGUI->EmitSignalDeactivateDialog();
|
||||||
SALOME_Selection* Sel = SALOME_Selection::Selection(aPrimitiveGUI->myGeomGUI->GetActiveStudy()->getSelection());
|
SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection());
|
||||||
switch (theCommandID)
|
switch (theCommandID)
|
||||||
{
|
{
|
||||||
case 4021: // BOX
|
case 4021: // BOX
|
||||||
@ -116,7 +116,7 @@ void PrimitiveGUI::MakeBoxAndDisplay(const gp_Pnt P1, const gp_Pnt P2)
|
|||||||
GEOM::GEOM_Shape_var box = myGeom->MakeBox(P1.X(), P1.Y(), P1.Z(), P2.X(), P2.Y(), P2.Z());
|
GEOM::GEOM_Shape_var box = myGeom->MakeBox(P1.X(), P1.Y(), P1.Z(), P2.X(), P2.Y(), P2.Z());
|
||||||
box->NameType(tr("GEOM_BOX"));
|
box->NameType(tr("GEOM_BOX"));
|
||||||
if(myGeomBase->Display(box))
|
if(myGeomBase->Display(box))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -141,12 +141,12 @@ void PrimitiveGUI::MakeCylinderAndDisplay(const gp_Pnt BasePoint, const gp_Dir a
|
|||||||
|
|
||||||
GEOM::GEOM_Shape_var result = myGeom->MakeCylinder(pstruct, dstruct, Radius, aHeight);
|
GEOM::GEOM_Shape_var result = myGeom->MakeCylinder(pstruct, dstruct, Radius, aHeight);
|
||||||
if (result->_is_nil()) {
|
if (result->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
result->NameType(tr("GEOM_CYLINDER"));
|
result->NameType(tr("GEOM_CYLINDER"));
|
||||||
if(myGeomBase->Display(result))
|
if(myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -168,7 +168,7 @@ void PrimitiveGUI::MakeSphereAndDisplay(const gp_Pnt aCenterPoint, const double
|
|||||||
GEOM::GEOM_Shape_ptr result = myGeom->MakeSphere(aCenterPoint.X(),aCenterPoint.Y(),aCenterPoint.Z(), aRadius);
|
GEOM::GEOM_Shape_ptr result = myGeom->MakeSphere(aCenterPoint.X(),aCenterPoint.Y(),aCenterPoint.Z(), aRadius);
|
||||||
result->NameType(tr("GEOM_SPHERE"));
|
result->NameType(tr("GEOM_SPHERE"));
|
||||||
if (myGeomBase->Display(result))
|
if (myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch (const SALOME::SALOME_Exception& S_ex) {
|
catch (const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -194,12 +194,12 @@ void PrimitiveGUI::MakeTorusAndDisplay(const gp_Pnt BasePoint, const gp_Dir aDir
|
|||||||
|
|
||||||
GEOM::GEOM_Shape_var result = myGeom->MakeTorus(pstruct, dstruct, Radius1, Radius2);
|
GEOM::GEOM_Shape_var result = myGeom->MakeTorus(pstruct, dstruct, Radius1, Radius2);
|
||||||
if(result->_is_nil()) {
|
if(result->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
result->NameType(tr("GEOM_TORUS"));
|
result->NameType(tr("GEOM_TORUS"));
|
||||||
if(myGeomBase->Display(result))
|
if(myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -225,12 +225,12 @@ void PrimitiveGUI::MakeConeAndDisplay(const gp_Pnt BasePoint, const gp_Dir aDir,
|
|||||||
|
|
||||||
GEOM::GEOM_Shape_var result = myGeom->MakeCone(pstruct, dstruct, Radius1, Radius2, aHeight);
|
GEOM::GEOM_Shape_var result = myGeom->MakeCone(pstruct, dstruct, Radius1, Radius2, aHeight);
|
||||||
if(result->_is_nil()) {
|
if(result->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
result->NameType(tr("GEOM_CONE"));
|
result->NameType(tr("GEOM_CONE"));
|
||||||
if(myGeomBase->Display(result))
|
if(myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
|
@ -221,7 +221,7 @@ void PrimitiveGUI_BoxDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void PrimitiveGUI_BoxDlg::ClickOnApply()
|
void PrimitiveGUI_BoxDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
if (mySimulationTopoDs.IsNull())
|
if (mySimulationTopoDs.IsNull())
|
||||||
return;
|
return;
|
||||||
myGeomBase->EraseSimulationShape();
|
myGeomBase->EraseSimulationShape();
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
#include "PrimitiveGUI_ConeDlg.h"
|
#include "PrimitiveGUI_ConeDlg.h"
|
||||||
|
|
||||||
|
#include <gp_Lin.hxx>
|
||||||
#include <BRepPrimAPI_MakeCone.hxx>
|
#include <BRepPrimAPI_MakeCone.hxx>
|
||||||
#include <BRepPrimAPI_MakeCylinder.hxx>
|
#include <BRepPrimAPI_MakeCylinder.hxx>
|
||||||
#include <BRepAdaptor_Curve.hxx>
|
#include <BRepAdaptor_Curve.hxx>
|
||||||
@ -246,7 +247,7 @@ void PrimitiveGUI_ConeDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void PrimitiveGUI_ConeDlg::ClickOnApply()
|
void PrimitiveGUI_ConeDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
if (mySimulationTopoDs.IsNull())
|
if (mySimulationTopoDs.IsNull())
|
||||||
return;
|
return;
|
||||||
myGeomBase->EraseSimulationShape();
|
myGeomBase->EraseSimulationShape();
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
#include "PrimitiveGUI_CylinderDlg.h"
|
#include "PrimitiveGUI_CylinderDlg.h"
|
||||||
|
|
||||||
|
#include <gp_Lin.hxx>
|
||||||
#include <BRepPrimAPI_MakeCylinder.hxx>
|
#include <BRepPrimAPI_MakeCylinder.hxx>
|
||||||
#include <BRepAdaptor_Curve.hxx>
|
#include <BRepAdaptor_Curve.hxx>
|
||||||
#include <Precision.hxx>
|
#include <Precision.hxx>
|
||||||
@ -233,7 +234,7 @@ void PrimitiveGUI_CylinderDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void PrimitiveGUI_CylinderDlg::ClickOnApply()
|
void PrimitiveGUI_CylinderDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
if (mySimulationTopoDs.IsNull())
|
if (mySimulationTopoDs.IsNull())
|
||||||
return;
|
return;
|
||||||
myGeomBase->EraseSimulationShape();
|
myGeomBase->EraseSimulationShape();
|
||||||
|
@ -205,7 +205,7 @@ void PrimitiveGUI_SphereDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void PrimitiveGUI_SphereDlg::ClickOnApply()
|
void PrimitiveGUI_SphereDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
if(mySimulationTopoDs.IsNull())
|
if(mySimulationTopoDs.IsNull())
|
||||||
return;
|
return;
|
||||||
myGeomBase->EraseSimulationShape();
|
myGeomBase->EraseSimulationShape();
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
#include "PrimitiveGUI_TorusDlg.h"
|
#include "PrimitiveGUI_TorusDlg.h"
|
||||||
|
|
||||||
|
#include <gp_Lin.hxx>
|
||||||
#include <BRepPrimAPI_MakeTorus.hxx>
|
#include <BRepPrimAPI_MakeTorus.hxx>
|
||||||
#include <BRepAdaptor_Curve.hxx>
|
#include <BRepAdaptor_Curve.hxx>
|
||||||
#include "QAD_Config.h"
|
#include "QAD_Config.h"
|
||||||
@ -229,7 +230,7 @@ void PrimitiveGUI_TorusDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void PrimitiveGUI_TorusDlg::ClickOnApply()
|
void PrimitiveGUI_TorusDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
if (mySimulationTopoDs.IsNull())
|
if (mySimulationTopoDs.IsNull())
|
||||||
return;
|
return;
|
||||||
myGeomBase->EraseSimulationShape();
|
myGeomBase->EraseSimulationShape();
|
||||||
|
@ -53,21 +53,15 @@ LIB_MOC = \
|
|||||||
RepairGUI_SuppressFacesDlg.h \
|
RepairGUI_SuppressFacesDlg.h \
|
||||||
RepairGUI_SuppressHoleDlg.h
|
RepairGUI_SuppressHoleDlg.h
|
||||||
|
|
||||||
LIB_CLIENT_IDL = SALOME_Exception.idl \
|
LIB_CLIENT_IDL =
|
||||||
GEOM_Gen.idl \
|
|
||||||
GEOM_Shape.idl \
|
|
||||||
SALOMEDS.idl \
|
|
||||||
SALOMEDS_Attributes.idl \
|
|
||||||
SALOME_ModuleCatalog.idl \
|
|
||||||
SALOME_Component.idl \
|
|
||||||
|
|
||||||
LIB_SERVER_IDL =
|
LIB_SERVER_IDL =
|
||||||
|
|
||||||
# additionnal information to compil and link file
|
# additionnal information to compil and link file
|
||||||
|
|
||||||
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
||||||
CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
|
CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
|
||||||
|
|
||||||
LDFLAGS += -lOCCViewer -lVTKViewer -lSalomeObject -lSalomeGUI -lGEOMClient -lGEOMObject -lDlgRef -lGEOMContext -lGEOMBase -lDisplayGUI -L${KERNEL_ROOT_DIR}/lib/salome
|
LDFLAGS += -lDisplayGUI
|
||||||
|
|
||||||
@CONCLUDE@
|
@CONCLUDE@
|
||||||
|
@ -70,7 +70,7 @@ bool RepairGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
{
|
{
|
||||||
RepairGUI* myRepairGUI = new RepairGUI();
|
RepairGUI* myRepairGUI = new RepairGUI();
|
||||||
myRepairGUI->myGeomGUI->EmitSignalDeactivateDialog();
|
myRepairGUI->myGeomGUI->EmitSignalDeactivateDialog();
|
||||||
SALOME_Selection* Sel = SALOME_Selection::Selection(myRepairGUI->myGeomGUI->GetActiveStudy()->getSelection());
|
SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection());
|
||||||
|
|
||||||
switch (theCommandID)
|
switch (theCommandID)
|
||||||
{
|
{
|
||||||
@ -87,8 +87,8 @@ bool RepairGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
case 603: // SUPPRESS FACES : use ic
|
case 603: // SUPPRESS FACES : use ic
|
||||||
{
|
{
|
||||||
Handle(AIS_InteractiveContext) ic;
|
Handle(AIS_InteractiveContext) ic;
|
||||||
if(myRepairGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myRepairGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
ic = v3d->getAISContext();
|
ic = v3d->getAISContext();
|
||||||
}
|
}
|
||||||
RepairGUI_SuppressFacesDlg *aDlg = new RepairGUI_SuppressFacesDlg(parent, "", myRepairGUI, Sel, ic);
|
RepairGUI_SuppressFacesDlg *aDlg = new RepairGUI_SuppressFacesDlg(parent, "", myRepairGUI, Sel, ic);
|
||||||
@ -97,8 +97,8 @@ bool RepairGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
case 604: // SUPPRESS HOLES : use ic
|
case 604: // SUPPRESS HOLES : use ic
|
||||||
{
|
{
|
||||||
Handle(AIS_InteractiveContext) ic;
|
Handle(AIS_InteractiveContext) ic;
|
||||||
if(myRepairGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myRepairGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
ic = v3d->getAISContext();
|
ic = v3d->getAISContext();
|
||||||
}
|
}
|
||||||
RepairGUI_SuppressHoleDlg *aDlg = new RepairGUI_SuppressHoleDlg(parent, "", myRepairGUI, Sel, ic);
|
RepairGUI_SuppressHoleDlg *aDlg = new RepairGUI_SuppressHoleDlg(parent, "", myRepairGUI, Sel, ic);
|
||||||
@ -124,7 +124,7 @@ void RepairGUI::MakeSewingAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR,
|
|||||||
try {
|
try {
|
||||||
GEOM::GEOM_Shape_var result = myGeom->MakeSewing(listShapesIOR, precision);
|
GEOM::GEOM_Shape_var result = myGeom->MakeSewing(listShapesIOR, precision);
|
||||||
if(result->_is_nil()) {
|
if(result->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,7 +134,7 @@ void RepairGUI::MakeSewingAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR,
|
|||||||
result->NameType(type);
|
result->NameType(type);
|
||||||
|
|
||||||
if(myGeomBase->Display(result))
|
if(myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
@ -153,12 +153,12 @@ void RepairGUI::MakeOrientationChangeAndDisplay(GEOM::GEOM_Shape_ptr Shape)
|
|||||||
try {
|
try {
|
||||||
GEOM::GEOM_Shape_var result = myGeom->OrientationChange(Shape);
|
GEOM::GEOM_Shape_var result = myGeom->OrientationChange(Shape);
|
||||||
if(result->_is_nil()) {
|
if(result->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
result->NameType(Shape->NameType());
|
result->NameType(Shape->NameType());
|
||||||
if(myGeomBase->Display(result))
|
if(myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
@ -181,7 +181,7 @@ bool RepairGUI::OnSuppressHole(const char* ShapeTopoIOR,
|
|||||||
const GEOM::GEOM_Shape::ListOfSubShapeID& ListOfIdEndFace)
|
const GEOM::GEOM_Shape::ListOfSubShapeID& ListOfIdEndFace)
|
||||||
{
|
{
|
||||||
/* Test the type of viewer */
|
/* Test the type of viewer */
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC )
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -194,7 +194,7 @@ bool RepairGUI::OnSuppressHole(const char* ShapeTopoIOR,
|
|||||||
aResult->NameType(type);
|
aResult->NameType(type);
|
||||||
|
|
||||||
if(myGeomBase->Display(aResult))
|
if(myGeomBase->Display(aResult))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -212,7 +212,7 @@ bool RepairGUI::OnSuppressHolesInFaceOrShell(const char* ShapeTopoIOR,
|
|||||||
const GEOM::GEOM_Shape::ListOfSubShapeID& ListOfIdWires)
|
const GEOM::GEOM_Shape::ListOfSubShapeID& ListOfIdWires)
|
||||||
{
|
{
|
||||||
/* Test the type of viewer */
|
/* Test the type of viewer */
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -225,7 +225,7 @@ bool RepairGUI::OnSuppressHolesInFaceOrShell(const char* ShapeTopoIOR,
|
|||||||
aResult->NameType(type);
|
aResult->NameType(type);
|
||||||
|
|
||||||
if(myGeomBase->Display(aResult))
|
if(myGeomBase->Display(aResult))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -243,17 +243,17 @@ bool RepairGUI::OnSuppressFaces(const TopoDS_Shape& ShapeTopo, const char* Shape
|
|||||||
const Standard_Integer& aLocalContextId, bool& myUseLocalContext)
|
const Standard_Integer& aLocalContextId, bool& myUseLocalContext)
|
||||||
{
|
{
|
||||||
/* Test the type of viewer */
|
/* Test the type of viewer */
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
|
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
|
||||||
SALOMEDS::SObject_var theObj = aStudy->FindObjectIOR(ShapeTopoIOR);
|
SALOMEDS::SObject_var theObj = aStudy->FindObjectIOR(ShapeTopoIOR);
|
||||||
if(theObj->_is_nil()) {
|
if(theObj->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
|
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
|
|
||||||
if(myUseLocalContext == false) {
|
if(myUseLocalContext == false) {
|
||||||
@ -320,12 +320,12 @@ bool RepairGUI::OnSuppressFaces(const TopoDS_Shape& ShapeTopo, const char* Shape
|
|||||||
|
|
||||||
/* Display with name */
|
/* Display with name */
|
||||||
if(!myGeomBase->Display(aShellOrFace, nameG)) {
|
if(!myGeomBase->Display(aShellOrFace, nameG)) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
myGeomGUI->GetDesktop()->putInfo (tr("GEOM_PRP_READY"));
|
QAD_Application::getDesktop()->putInfo (tr("GEOM_PRP_READY"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -265,7 +265,7 @@ void GeometryGUI_FillingHoleDlg::ClickOnOk()
|
|||||||
void GeometryGUI_FillingHoleDlg::ClickOnApply()
|
void GeometryGUI_FillingHoleDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
bool testResult = false ;
|
bool testResult = false ;
|
||||||
myGeomGUI->GetDesktop()->putInfo( tr("") ) ;
|
QAD_Application::getDesktop()->putInfo( tr("") ) ;
|
||||||
|
|
||||||
switch(myConstructorId)
|
switch(myConstructorId)
|
||||||
{
|
{
|
||||||
@ -275,10 +275,10 @@ void GeometryGUI_FillingHoleDlg::ClickOnApply()
|
|||||||
testResult = myGeomGUI->OnFillingHole( myShape, myShapeIOR, myLocalContextId, myUseLocalContext ) ;
|
testResult = myGeomGUI->OnFillingHole( myShape, myShapeIOR, myLocalContextId, myUseLocalContext ) ;
|
||||||
}
|
}
|
||||||
if( !testResult ) {
|
if( !testResult ) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("Operation aborted")) ;
|
QAD_Application::getDesktop()->putInfo(tr("Operation aborted")) ;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("Operation done"));
|
QAD_Application::getDesktop()->putInfo(tr("Operation done"));
|
||||||
}
|
}
|
||||||
/* Reset arguments to allow a new selection */
|
/* Reset arguments to allow a new selection */
|
||||||
this->ResetStateOfDialog() ;
|
this->ResetStateOfDialog() ;
|
||||||
@ -334,7 +334,7 @@ void GeometryGUI_FillingHoleDlg::SelectionIntoArgument()
|
|||||||
return ;
|
return ;
|
||||||
|
|
||||||
// if( !IO->hasEntry() ) {
|
// if( !IO->hasEntry() ) {
|
||||||
// myGeomGUI->GetDesktop()->putInfo(tr("Main shape must be in the study before")) ;
|
// QAD_Application::getDesktop()->putInfo(tr("Main shape must be in the study before")) ;
|
||||||
// return ;
|
// return ;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
@ -351,7 +351,7 @@ void GeometryGUI_FillingHoleDlg::SelectionIntoArgument()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( IO->hasEntry() ) {
|
if ( IO->hasEntry() ) {
|
||||||
SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
|
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
|
||||||
SALOMEDS::SObject_var obj = aStudy->FindObjectID( IO->getEntry() );
|
SALOMEDS::SObject_var obj = aStudy->FindObjectID( IO->getEntry() );
|
||||||
SALOMEDS::GenericAttribute_var anAttr;
|
SALOMEDS::GenericAttribute_var anAttr;
|
||||||
SALOMEDS::AttributeIOR_var anIOR;
|
SALOMEDS::AttributeIOR_var anIOR;
|
||||||
@ -492,7 +492,7 @@ void GeometryGUI_FillingHoleDlg::ActivateUserSelection()
|
|||||||
|
|
||||||
if( !this->myOkShape ) {
|
if( !this->myOkShape ) {
|
||||||
this->ResetStateOfDialog() ;
|
this->ResetStateOfDialog() ;
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("Select main shape first")) ;
|
QAD_Application::getDesktop()->putInfo(tr("Select main shape first")) ;
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -509,7 +509,7 @@ void GeometryGUI_FillingHoleDlg::ActivateUserSelection()
|
|||||||
TopAbs_ShapeEnum aType = TopAbs_EDGE ;
|
TopAbs_ShapeEnum aType = TopAbs_EDGE ;
|
||||||
myGeomGUI->PrepareSubShapeSelection( int(aType), this->myLocalContextId ) ;
|
myGeomGUI->PrepareSubShapeSelection( int(aType), this->myLocalContextId ) ;
|
||||||
myUseLocalContext = true ;
|
myUseLocalContext = true ;
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("Select edges to fill an hole and click on Ok/Apply")) ;
|
QAD_Application::getDesktop()->putInfo(tr("Select edges to fill an hole and click on Ok/Apply")) ;
|
||||||
}
|
}
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
@ -30,29 +30,12 @@ using namespace std;
|
|||||||
#include "RepairGUI_OrientationDlg.h"
|
#include "RepairGUI_OrientationDlg.h"
|
||||||
|
|
||||||
#include <Precision.hxx>
|
#include <Precision.hxx>
|
||||||
#include "QAD_Config.h"
|
|
||||||
|
|
||||||
#include <TopoDS_Compound.hxx>
|
#include <TopoDS_Compound.hxx>
|
||||||
#include <BRep_Builder.hxx>
|
#include <BRep_Builder.hxx>
|
||||||
#include <BRepBuilderAPI_MakeEdge.hxx>
|
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||||
#include <BRepAdaptor_Surface.hxx>
|
#include <BRepAdaptor_Surface.hxx>
|
||||||
#include <TopExp_Explorer.hxx>
|
#include <TopExp_Explorer.hxx>
|
||||||
|
|
||||||
#include <qbuttongroup.h>
|
|
||||||
#include <qcheckbox.h>
|
|
||||||
#include <qgroupbox.h>
|
|
||||||
#include <qlabel.h>
|
|
||||||
#include <qlineedit.h>
|
|
||||||
#include <qpushbutton.h>
|
|
||||||
#include <qradiobutton.h>
|
|
||||||
#include <qlayout.h>
|
|
||||||
#include <qvariant.h>
|
|
||||||
#include <qtooltip.h>
|
|
||||||
#include <qvalidator.h>
|
|
||||||
#include <qwhatsthis.h>
|
|
||||||
#include <qimage.h>
|
|
||||||
#include <qpixmap.h>
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : RepairGUI_OrientationDlg()
|
// class : RepairGUI_OrientationDlg()
|
||||||
// purpose : Constructs a RepairGUI_OrientationDlg which is a child of 'parent', with the
|
// purpose : Constructs a RepairGUI_OrientationDlg which is a child of 'parent', with the
|
||||||
@ -60,122 +43,43 @@ using namespace std;
|
|||||||
// 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.
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
RepairGUI_OrientationDlg::RepairGUI_OrientationDlg( QWidget* parent, const char* name, RepairGUI* theRepairGUI, SALOME_Selection* Sel, bool modal, WFlags fl )
|
RepairGUI_OrientationDlg::RepairGUI_OrientationDlg(QWidget* parent, const char* name, RepairGUI* theRepairGUI, SALOME_Selection* Sel, bool modal, WFlags fl)
|
||||||
: QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
|
:GEOMBase_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
|
||||||
{
|
{
|
||||||
QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_ORIENTATION")));
|
QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_ORIENTATION")));
|
||||||
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT")));
|
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||||
if ( !name )
|
|
||||||
setName( "RepairGUI_OrientationDlg" );
|
|
||||||
resize( 303, 242 );
|
|
||||||
setCaption( tr( "GEOM_ORIENTATION_TITLE" ) );
|
|
||||||
setSizeGripEnabled( TRUE );
|
|
||||||
RepairGUI_OrientationDlgLayout = new QGridLayout( this );
|
|
||||||
RepairGUI_OrientationDlgLayout->setSpacing( 6 );
|
|
||||||
RepairGUI_OrientationDlgLayout->setMargin( 11 );
|
|
||||||
|
|
||||||
/***************************************************************/
|
setCaption(tr("GEOM_ORIENTATION_TITLE"));
|
||||||
GroupConstructors = new QButtonGroup( this, "GroupConstructors" );
|
|
||||||
GroupConstructors->setTitle( tr( "GEOM_ORIENTATION" ) );
|
|
||||||
GroupConstructors->setExclusive( TRUE );
|
|
||||||
GroupConstructors->setColumnLayout(0, Qt::Vertical );
|
|
||||||
GroupConstructors->layout()->setSpacing( 0 );
|
|
||||||
GroupConstructors->layout()->setMargin( 0 );
|
|
||||||
GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() );
|
|
||||||
GroupConstructorsLayout->setAlignment( Qt::AlignTop );
|
|
||||||
GroupConstructorsLayout->setSpacing( 6 );
|
|
||||||
GroupConstructorsLayout->setMargin( 11 );
|
|
||||||
Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" );
|
|
||||||
Constructor1->setText( tr( "" ) );
|
|
||||||
Constructor1->setPixmap( image0 );
|
|
||||||
Constructor1->setChecked( TRUE );
|
|
||||||
Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) );
|
|
||||||
Constructor1->setMinimumSize( QSize( 50, 0 ) );
|
|
||||||
GroupConstructorsLayout->addWidget( Constructor1, 0, 0 );
|
|
||||||
QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
|
|
||||||
GroupConstructorsLayout->addItem( spacer, 0, 1 );
|
|
||||||
RepairGUI_OrientationDlgLayout->addWidget( GroupConstructors, 0, 0 );
|
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
GroupButtons = new QGroupBox( this, "GroupButtons" );
|
GroupConstructors->setTitle(tr("GEOM_ORIENTATION"));
|
||||||
GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) );
|
RadioButton1->setPixmap(image0);
|
||||||
GroupButtons->setTitle( tr( "" ) );
|
RadioButton2->close(TRUE);
|
||||||
GroupButtons->setColumnLayout(0, Qt::Vertical );
|
RadioButton3->close(TRUE);
|
||||||
GroupButtons->layout()->setSpacing( 0 );
|
|
||||||
GroupButtons->layout()->setMargin( 0 );
|
|
||||||
GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
|
|
||||||
GroupButtonsLayout->setAlignment( Qt::AlignTop );
|
|
||||||
GroupButtonsLayout->setSpacing( 6 );
|
|
||||||
GroupButtonsLayout->setMargin( 11 );
|
|
||||||
buttonCancel = new QPushButton( GroupButtons, "buttonCancel" );
|
|
||||||
buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) );
|
|
||||||
buttonCancel->setAutoDefault( TRUE );
|
|
||||||
GroupButtonsLayout->addWidget( buttonCancel, 0, 3 );
|
|
||||||
buttonApply = new QPushButton( GroupButtons, "buttonApply" );
|
|
||||||
buttonApply->setText( tr( "GEOM_BUT_APPLY" ) );
|
|
||||||
buttonApply->setAutoDefault( TRUE );
|
|
||||||
GroupButtonsLayout->addWidget( buttonApply, 0, 1 );
|
|
||||||
QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
|
|
||||||
GroupButtonsLayout->addItem( spacer_9, 0, 2 );
|
|
||||||
buttonOk = new QPushButton( GroupButtons, "buttonOk" );
|
|
||||||
buttonOk->setText( tr( "GEOM_BUT_OK" ) );
|
|
||||||
buttonOk->setAutoDefault( TRUE );
|
|
||||||
buttonOk->setDefault( TRUE );
|
|
||||||
GroupButtonsLayout->addWidget( buttonOk, 0, 0 );
|
|
||||||
RepairGUI_OrientationDlgLayout->addWidget( GroupButtons, 2, 0 );
|
|
||||||
|
|
||||||
/***************************************************************/
|
GroupPoints = new DlgRef_1Sel1Spin1Check(this, "GroupPoints");
|
||||||
GroupC1 = new QGroupBox( this, "GroupC1" );
|
GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
|
||||||
GroupC1->setTitle( tr( "GEOM_ARGUMENTS" ) );
|
GroupPoints->TextLabel1->setText(tr("GEOM_OBJECT"));
|
||||||
GroupC1->setMinimumSize( QSize( 0, 0 ) );
|
GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR_LENGTH"));
|
||||||
GroupC1->setFrameShape( QGroupBox::Box );
|
GroupPoints->CheckButton1->setText(tr("GEOM_ORIENTATION_OPT"));
|
||||||
GroupC1->setFrameShadow( QGroupBox::Sunken );
|
GroupPoints->PushButton1->setPixmap(image1);
|
||||||
GroupC1->setColumnLayout(0, Qt::Vertical );
|
|
||||||
GroupC1->layout()->setSpacing( 0 );
|
|
||||||
GroupC1->layout()->setMargin( 0 );
|
|
||||||
GroupC1Layout = new QGridLayout( GroupC1->layout() );
|
|
||||||
GroupC1Layout->setAlignment( Qt::AlignTop );
|
|
||||||
GroupC1Layout->setSpacing( 6 );
|
|
||||||
GroupC1Layout->setMargin( 11 );
|
|
||||||
LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" );
|
|
||||||
GroupC1Layout->addWidget( LineEditC1A1, 0, 2 );
|
|
||||||
|
|
||||||
/* Spin box construction */
|
Layout1->addWidget(GroupPoints, 1, 0);
|
||||||
SpinBox_C1A2 = new DlgRef_SpinBox( GroupC1, "GeomSpinBox_C1A2" ) ;
|
/***************************************************************/
|
||||||
GroupC1Layout->addWidget( SpinBox_C1A2, 1, 2 );
|
|
||||||
|
|
||||||
SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" );
|
|
||||||
SelectButtonC1A1->setText( tr( "" ) );
|
|
||||||
SelectButtonC1A1->setPixmap( image1 );
|
|
||||||
SelectButtonC1A1->setToggleButton( FALSE );
|
|
||||||
GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 );
|
|
||||||
TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" );
|
|
||||||
TextLabelC1A1->setText( tr( "GEOM_OBJECT" ) );
|
|
||||||
TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) );
|
|
||||||
TextLabelC1A1->setFrameShape( QLabel::NoFrame );
|
|
||||||
TextLabelC1A1->setFrameShadow( QLabel::Plain );
|
|
||||||
GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 );
|
|
||||||
TextLabelC1A2 = new QLabel( GroupC1, "TextLabelC1A2" );
|
|
||||||
TextLabelC1A2->setText( tr( "GEOM_VECTOR_LENGTH" ) );
|
|
||||||
TextLabelC1A2->setMinimumSize( QSize( 50, 0 ) );
|
|
||||||
GroupC1Layout->addWidget( TextLabelC1A2, 1, 0 );
|
|
||||||
CheckBoxReverse = new QCheckBox( GroupC1, "CheckBoxReverse" );
|
|
||||||
CheckBoxReverse->setText( tr( "GEOM_ORIENTATION_OPT" ) );
|
|
||||||
GroupC1Layout->addMultiCellWidget( CheckBoxReverse, 2, 2, 0, 2 );
|
|
||||||
RepairGUI_OrientationDlgLayout->addWidget( GroupC1, 1, 0 );
|
|
||||||
/***************************************************************/
|
|
||||||
myRepairGUI = theRepairGUI;
|
|
||||||
Init(Sel) ; /* Initialisations */
|
|
||||||
|
|
||||||
|
/* Initialisations */
|
||||||
|
myRepairGUI = theRepairGUI;
|
||||||
|
Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : ~RepairGUI_OrientationDlg()
|
// function : ~RepairGUI_OrientationDlg()
|
||||||
// purpose : Destroys the object and frees any allocated resources
|
// purpose : Destroys the object and frees any allocated resources
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
RepairGUI_OrientationDlg::~RepairGUI_OrientationDlg()
|
RepairGUI_OrientationDlg::~RepairGUI_OrientationDlg()
|
||||||
{
|
{
|
||||||
// no need to delete child widgets, Qt does it all for us
|
// no need to delete child widgets, Qt does it all for us
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -183,192 +87,127 @@ RepairGUI_OrientationDlg::~RepairGUI_OrientationDlg()
|
|||||||
// function : Init()
|
// function : Init()
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_OrientationDlg::Init( SALOME_Selection* Sel )
|
void RepairGUI_OrientationDlg::Init()
|
||||||
{
|
{
|
||||||
|
/* init variables */
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
|
|
||||||
double step ;
|
myLength = 25.0;
|
||||||
QString St = QAD_CONFIG->getSetting( "Geometry:SettingsGeomStep" ) ;
|
myOkShape = false;
|
||||||
step = St.toDouble() ;
|
|
||||||
|
|
||||||
/* min, max, step and decimals for spin boxes */
|
double SpecificStep = 10;
|
||||||
SpinBox_C1A2->RangeStepAndValidator( 0.001, 999.999, step, 3 ) ;
|
/* min, max, step and decimals for spin boxes & initial values */
|
||||||
SpinBox_C1A2->SetValue( 25.0 ) ; /* = myLength */
|
GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
|
||||||
|
GroupPoints->SpinBox_DX->SetValue(myLength);
|
||||||
GroupC1->show();
|
|
||||||
myConstructorId = 0 ;
|
|
||||||
Constructor1->setChecked( TRUE );
|
|
||||||
CheckBoxReverse->setChecked( FALSE );
|
|
||||||
myEditCurrentArgument = LineEditC1A1 ;
|
|
||||||
mySelection = Sel;
|
|
||||||
myGeomBase = new GEOMBase() ;
|
|
||||||
myGeomGUI = GEOMContext::GetGeomGUI() ;
|
|
||||||
|
|
||||||
myLength = 25.0 ;
|
|
||||||
myOkShape = false ;
|
|
||||||
myOkLength = true;
|
|
||||||
mySimulationTopoDs.Nullify() ;
|
|
||||||
myShape.Nullify() ;
|
|
||||||
myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ;
|
|
||||||
|
|
||||||
// TODO : previous selection into argument ?
|
|
||||||
|
|
||||||
/* Filter definitions */
|
|
||||||
Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM");
|
|
||||||
myGeom = GEOM::GEOM_Gen::_narrow(comp);
|
|
||||||
|
|
||||||
/* signals and slots connections */
|
/* signals and slots connections */
|
||||||
connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
|
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||||
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ;
|
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||||
connect( buttonApply, SIGNAL( clicked() ), this, SLOT(ClickOnApply() ) );
|
|
||||||
connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) );
|
|
||||||
connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
|
|
||||||
connect( CheckBoxReverse, SIGNAL (stateChanged(int) ), this, SLOT( ReverseOrientation(int) ) ) ;
|
|
||||||
|
|
||||||
connect( LineEditC1A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ;
|
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
connect( SpinBox_C1A2, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ;
|
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
|
|
||||||
connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ;
|
connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||||
connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
|
||||||
/* to close dialog if study change */
|
|
||||||
connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ;
|
|
||||||
|
|
||||||
/* Move widget on the botton right corner of main widget */
|
connect(GroupPoints->CheckButton1, SIGNAL(stateChanged(int)), this, SLOT(ReverseAngle(int)));
|
||||||
int x, y ;
|
|
||||||
myGeomBase->DefineDlgPosition( this, x, y ) ;
|
|
||||||
this->move( x, y ) ;
|
|
||||||
this->show() ; /* displays Dialog */
|
|
||||||
|
|
||||||
return ;
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
|
||||||
|
/* displays Dialog */
|
||||||
|
GroupPoints->show();
|
||||||
|
this->show();
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
|
||||||
// function : ConstructorsClicked()
|
|
||||||
// purpose : Radio button management
|
|
||||||
//=================================================================================
|
|
||||||
void RepairGUI_OrientationDlg::ConstructorsClicked(int constructorId)
|
|
||||||
{
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : ClickOnOk()
|
// function : ClickOnOk()
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_OrientationDlg::ClickOnOk()
|
void RepairGUI_OrientationDlg::ClickOnOk()
|
||||||
{
|
{
|
||||||
this->ClickOnApply() ;
|
this->ClickOnApply();
|
||||||
this->ClickOnCancel() ;
|
ClickOnCancel();
|
||||||
|
return;
|
||||||
return ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : ClickOnApply()
|
// function : ClickOnApply()
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_OrientationDlg::ClickOnApply()
|
void RepairGUI_OrientationDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
/* Leave simulation display in this method ! */
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
myGeomGUI->GetDesktop()->putInfo( tr("") ) ;
|
if (mySimulationTopoDs.IsNull())
|
||||||
|
return;
|
||||||
|
myGeomBase->EraseSimulationShape();
|
||||||
|
mySimulationTopoDs.Nullify();
|
||||||
|
|
||||||
switch(myConstructorId)
|
if(myOkShape && GroupPoints->CheckButton1->isChecked()) {
|
||||||
{
|
myRepairGUI->MakeOrientationChangeAndDisplay(myGeomShape);
|
||||||
case 0 :
|
GroupPoints->CheckButton1->setChecked(FALSE);
|
||||||
{
|
|
||||||
if(myOkShape && CheckBoxReverse->isChecked() && myOkLength == true ) {
|
|
||||||
myRepairGUI->MakeOrientationChangeAndDisplay( myGeomShape ) ;
|
|
||||||
CheckBoxReverse->setChecked( FALSE );
|
|
||||||
}
|
|
||||||
break ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// accept();
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
|
||||||
// function : ClickOnCancel()
|
|
||||||
// purpose :
|
|
||||||
//=================================================================================
|
|
||||||
void RepairGUI_OrientationDlg::ClickOnCancel()
|
|
||||||
{
|
|
||||||
myGeomBase->EraseSimulationShape() ;
|
|
||||||
mySimulationTopoDs.Nullify() ;
|
|
||||||
disconnect( mySelection, 0, this, 0 );
|
|
||||||
myGeomGUI->ResetState() ;
|
|
||||||
reject() ;
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
|
|
||||||
//=================================================================================
|
|
||||||
// function : LineEditReturnPressed()
|
|
||||||
// purpose :
|
|
||||||
//=================================================================================
|
|
||||||
void RepairGUI_OrientationDlg::LineEditReturnPressed()
|
|
||||||
{
|
|
||||||
QLineEdit* send = (QLineEdit*)sender();
|
|
||||||
if( send == LineEditC1A1 )
|
|
||||||
myEditCurrentArgument = LineEditC1A1 ;
|
|
||||||
else
|
|
||||||
return ;
|
|
||||||
|
|
||||||
/* User name of object input management */
|
|
||||||
/* If successfull the selection is changed and signal emitted... */
|
|
||||||
/* so SelectionIntoArgument() is automatically called. */
|
|
||||||
const QString objectUserName = myEditCurrentArgument->text() ;
|
|
||||||
QWidget* thisWidget = (QWidget*)this ;
|
|
||||||
if( myGeomBase->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) {
|
|
||||||
myEditCurrentArgument->setText( objectUserName ) ;
|
|
||||||
}
|
}
|
||||||
return ;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : SelectionIntoArgument()
|
// function : SelectionIntoArgument()
|
||||||
// purpose : Called when selection as changed or other case
|
// purpose : Called when selection as changed or other case
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_OrientationDlg::SelectionIntoArgument()
|
void RepairGUI_OrientationDlg::SelectionIntoArgument()
|
||||||
{
|
{
|
||||||
myGeomBase->EraseSimulationShape() ;
|
myGeomBase->EraseSimulationShape();
|
||||||
this->mySimulationTopoDs.Nullify() ;
|
mySimulationTopoDs.Nullify();
|
||||||
|
myEditCurrentArgument->setText("");
|
||||||
|
QString aString = ""; /* name of selection */
|
||||||
|
|
||||||
/* Name of future selection */
|
int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
|
||||||
QString aString = "";
|
if(nbSel != 1) {
|
||||||
|
if(myEditCurrentArgument == GroupPoints->LineEdit1)
|
||||||
int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString) ;
|
myOkShape = false;
|
||||||
if ( nbSel != 1 ) {
|
return;
|
||||||
if ( myEditCurrentArgument == LineEditC1A1 ) {
|
|
||||||
LineEditC1A1->setText("") ;
|
|
||||||
this->myOkShape = false ;
|
|
||||||
}
|
|
||||||
return ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* nbSel == 1 ! */
|
// nbSel == 1
|
||||||
TopoDS_Shape S;
|
TopoDS_Shape S;
|
||||||
Standard_Boolean testResult ;
|
Standard_Boolean testResult;
|
||||||
Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ;
|
Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
|
||||||
if( !myGeomBase->GetTopoFromSelection(mySelection, S) )
|
if(!myGeomBase->GetTopoFromSelection(mySelection, S))
|
||||||
return ;
|
return;
|
||||||
|
|
||||||
/* Constructor */
|
if(myEditCurrentArgument == GroupPoints->LineEdit1) {
|
||||||
if ( myEditCurrentArgument == LineEditC1A1 ) {
|
myGeomShape = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
|
||||||
myGeomShape = myGeomBase->ConvertIOinGEOMShape(IO, testResult) ;
|
if(!testResult)
|
||||||
if( !testResult )
|
return;
|
||||||
return ;
|
myEditCurrentArgument->setText(aString);
|
||||||
LineEditC1A1->setText(aString) ;
|
myShape = S;
|
||||||
myShape = S ;
|
myOkShape = true;
|
||||||
myOkShape = true ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( myOkShape && myOkLength ) {
|
if(myOkShape)
|
||||||
MakeOrientationSimulationAndDisplay( this->myShape, this->myLength ) ;
|
this->MakeOrientationSimulationAndDisplay();
|
||||||
}
|
return;
|
||||||
return ;
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : LineEditReturnPressed()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void RepairGUI_OrientationDlg::LineEditReturnPressed()
|
||||||
|
{
|
||||||
|
QLineEdit* send = (QLineEdit*)sender();
|
||||||
|
if(send == GroupPoints->LineEdit1)
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -379,58 +218,14 @@ void RepairGUI_OrientationDlg::SelectionIntoArgument()
|
|||||||
void RepairGUI_OrientationDlg::SetEditCurrentArgument()
|
void RepairGUI_OrientationDlg::SetEditCurrentArgument()
|
||||||
{
|
{
|
||||||
QPushButton* send = (QPushButton*)sender();
|
QPushButton* send = (QPushButton*)sender();
|
||||||
switch (myConstructorId)
|
|
||||||
{
|
|
||||||
case 0: /* default constructor */
|
|
||||||
{
|
|
||||||
if(send == SelectButtonC1A1) {
|
|
||||||
LineEditC1A1->setFocus() ;
|
|
||||||
myEditCurrentArgument = LineEditC1A1 ;
|
|
||||||
}
|
|
||||||
SelectionIntoArgument() ;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if(send == GroupPoints->PushButton1) {
|
||||||
//=================================================================================
|
GroupPoints->LineEdit1->setFocus();
|
||||||
// function : ValueChangedInSpinBox()
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
// purpose :
|
|
||||||
//=================================================================================
|
|
||||||
void RepairGUI_OrientationDlg::ValueChangedInSpinBox( double newValue )
|
|
||||||
{
|
|
||||||
myGeomBase->EraseSimulationShape() ;
|
|
||||||
mySimulationTopoDs.Nullify() ;
|
|
||||||
|
|
||||||
QObject* send = (QObject*)sender() ;
|
|
||||||
if( send == SpinBox_C1A2 ) {
|
|
||||||
this->myLength = newValue ;
|
|
||||||
myOkLength = true ;
|
|
||||||
}
|
}
|
||||||
|
this->SelectionIntoArgument();
|
||||||
|
|
||||||
if ( myConstructorId == 0 && myOkShape && myOkLength == true ) {
|
return;
|
||||||
MakeOrientationSimulationAndDisplay( this->myShape, this->myLength ) ;
|
|
||||||
}
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
|
||||||
// function : DeactivateActiveDialog()
|
|
||||||
// purpose :
|
|
||||||
//=================================================================================
|
|
||||||
void RepairGUI_OrientationDlg::DeactivateActiveDialog()
|
|
||||||
{
|
|
||||||
if ( GroupConstructors->isEnabled() ) {
|
|
||||||
GroupConstructors->setEnabled(false) ;
|
|
||||||
GroupButtons->setEnabled(false) ;
|
|
||||||
GroupC1->setEnabled(false) ;
|
|
||||||
disconnect( mySelection, 0, this, 0 );
|
|
||||||
myGeomBase->EraseSimulationShape() ;
|
|
||||||
}
|
|
||||||
return ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -440,17 +235,13 @@ void RepairGUI_OrientationDlg::DeactivateActiveDialog()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_OrientationDlg::ActivateThisDialog()
|
void RepairGUI_OrientationDlg::ActivateThisDialog()
|
||||||
{
|
{
|
||||||
/* Emit a signal to deactivate the active dialog */
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
myGeomGUI->EmitSignalDeactivateDialog() ;
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
GroupConstructors->setEnabled(true) ;
|
GroupPoints->LineEdit1->setFocus();
|
||||||
GroupButtons->setEnabled(true) ;
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
GroupC1->setEnabled(true) ;
|
if(!mySimulationTopoDs.IsNull())
|
||||||
|
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
|
||||||
connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
return;
|
||||||
if( !mySimulationTopoDs.IsNull() )
|
|
||||||
myGeomBase->DisplaySimulationShape( mySimulationTopoDs ) ;
|
|
||||||
|
|
||||||
return ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -460,147 +251,150 @@ void RepairGUI_OrientationDlg::ActivateThisDialog()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_OrientationDlg::enterEvent(QEvent* e)
|
void RepairGUI_OrientationDlg::enterEvent(QEvent* e)
|
||||||
{
|
{
|
||||||
if ( GroupConstructors->isEnabled() )
|
if (GroupConstructors->isEnabled())
|
||||||
return ;
|
return;
|
||||||
ActivateThisDialog() ;
|
this->ActivateThisDialog();
|
||||||
return ;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : closeEvent()
|
// function : ValueChangedInSpinBox()
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_OrientationDlg::closeEvent( QCloseEvent* e )
|
void RepairGUI_OrientationDlg::ValueChangedInSpinBox(double newValue)
|
||||||
{
|
{
|
||||||
/* same than click on cancel button */
|
myLength = newValue;
|
||||||
this->ClickOnCancel() ;
|
if(myOkShape)
|
||||||
return ;
|
this->MakeOrientationSimulationAndDisplay();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
//===========================================================================================
|
|
||||||
// function : ReverseOrientation()
|
// function : ReverseOrientation()
|
||||||
// purpose :
|
// purpose :
|
||||||
//===========================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_OrientationDlg::ReverseOrientation(int state)
|
void RepairGUI_OrientationDlg::ReverseAngle(int state)
|
||||||
{
|
{
|
||||||
if( this->myOkShape && myOkLength == true ) {
|
if(myOkShape)
|
||||||
MakeOrientationSimulationAndDisplay( this->myShape, this-> myLength ) ;
|
this->MakeOrientationSimulationAndDisplay();
|
||||||
}
|
return;
|
||||||
return ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//===========================================================================================
|
//==================================================================================
|
||||||
// function : MakeOrientationSimulationAndDisplay()
|
// function : MakeOrientationSimulationAndDisplay()
|
||||||
// purpose : Create 'aCompound1' and 'aCompound2' each contains edges oriented
|
// purpose : Create 'aCompound1' and 'aCompound2' each contains edges oriented
|
||||||
// : respectively FORWARD and REVERSE for all faces of 'aTopoDS'
|
// : respectively FORWARD and REVERSE for all faces of 'aTopoDS'
|
||||||
// : These edges represent normal vectors on faces of 'aTopoDS'
|
// : These edges represent normal vectors on faces of 'aTopoDS'
|
||||||
// : For a unique edge an arrow is displayed to show its orientation.
|
// : For a unique edge an arrow is displayed to show its orientation.
|
||||||
//===========================================================================================
|
//==================================================================================
|
||||||
void RepairGUI_OrientationDlg::MakeOrientationSimulationAndDisplay(const TopoDS_Shape& aTopoDS, Standard_Real length )
|
void RepairGUI_OrientationDlg::MakeOrientationSimulationAndDisplay()
|
||||||
{
|
{
|
||||||
myGeomBase->EraseSimulationShape() ;
|
myGeomBase->EraseSimulationShape();
|
||||||
mySimulationTopoDs.Nullify() ;
|
mySimulationTopoDs.Nullify();
|
||||||
|
|
||||||
TopoDS_Compound aCompound1, aCompound2 ;
|
TopoDS_Compound aCompound1, aCompound2;
|
||||||
TopoDS_Compound NullComp ;
|
TopoDS_Compound NullComp;
|
||||||
BRep_Builder aBuilder1, aBuilder2;
|
BRep_Builder aBuilder1, aBuilder2;
|
||||||
aCompound1 = aCompound2 = NullComp ;
|
aCompound1 = aCompound2 = NullComp;
|
||||||
aBuilder1.MakeCompound(aCompound1) ;
|
aBuilder1.MakeCompound(aCompound1);
|
||||||
aBuilder2.MakeCompound(aCompound2) ;
|
aBuilder2.MakeCompound(aCompound2);
|
||||||
|
|
||||||
if( aTopoDS.IsNull() )
|
if(myShape.IsNull())
|
||||||
return ;
|
return;
|
||||||
|
|
||||||
/* Case of an edge */
|
try {
|
||||||
if( aTopoDS.ShapeType() == TopAbs_EDGE ) {
|
/* Case of an edge */
|
||||||
/* Try to display a cone simulation shape to show direction of edge */
|
if(myShape.ShapeType() == TopAbs_EDGE) {
|
||||||
TopoDS_Shape tmpShape = aTopoDS ;
|
/* Try to display a cone simulation shape to show direction of edge */
|
||||||
if( this->CheckBoxReverse->isChecked() ) {
|
TopoDS_Shape tmpShape = myShape ;
|
||||||
if( aTopoDS.Orientation() == TopAbs_FORWARD)
|
if(GroupPoints->CheckButton1->isChecked()) {
|
||||||
tmpShape.Orientation(TopAbs_REVERSED) ;
|
if(myShape.Orientation() == TopAbs_FORWARD)
|
||||||
|
tmpShape.Orientation(TopAbs_REVERSED);
|
||||||
|
else
|
||||||
|
tmpShape.Orientation(TopAbs_FORWARD);
|
||||||
|
}
|
||||||
|
if(myGeomBase->CreateArrowForLinearEdge(tmpShape, mySimulationTopoDs))
|
||||||
|
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gp_Pnt P1, P2 ;
|
||||||
|
gp_Vec V, V1, V2;
|
||||||
|
TopExp_Explorer ex(myShape, TopAbs_FACE);
|
||||||
|
int test = 0;
|
||||||
|
while(ex.More()) {
|
||||||
|
const TopoDS_Face& F = TopoDS::Face(ex.Current());
|
||||||
|
/* find the center of the minmax */
|
||||||
|
BRepAdaptor_Surface SF(F);
|
||||||
|
Standard_Real u, v, x;
|
||||||
|
|
||||||
|
u = SF.FirstUParameter();
|
||||||
|
x = SF.LastUParameter();
|
||||||
|
if(Precision::IsInfinite(u)) {
|
||||||
|
if(Precision::IsInfinite(x))
|
||||||
|
u = 0.0;
|
||||||
|
else
|
||||||
|
u = x;
|
||||||
|
}
|
||||||
|
else if(!Precision::IsInfinite(x))
|
||||||
|
u = (u+x) / 2.0;
|
||||||
|
|
||||||
|
v = SF.FirstVParameter();
|
||||||
|
x = SF.LastVParameter();
|
||||||
|
if(Precision::IsInfinite(v)) {
|
||||||
|
if(Precision::IsInfinite(x))
|
||||||
|
v = 0.0;
|
||||||
|
else
|
||||||
|
v = x;
|
||||||
|
}
|
||||||
|
else if(!Precision::IsInfinite(x))
|
||||||
|
v = (v+x) / 2.0;
|
||||||
|
|
||||||
|
SF.D1(u, v, P1, V1, V2);
|
||||||
|
V = V1.Crossed(V2);
|
||||||
|
x = V.Magnitude();
|
||||||
|
if(x > 1.e-10)
|
||||||
|
V.Multiply(myLength/x);
|
||||||
|
else {
|
||||||
|
V.SetCoord(myLength/2.0, 0.0, 0.0);
|
||||||
|
MESSAGE ("Null normal in Orientation " << endl);
|
||||||
|
}
|
||||||
|
|
||||||
|
P2 = P1;
|
||||||
|
/* test orientation of each face and displays forward (aCompound1) */
|
||||||
|
if(F.Orientation() == TopAbs_FORWARD)
|
||||||
|
P2.Translate(V);
|
||||||
else
|
else
|
||||||
tmpShape.Orientation(TopAbs_FORWARD) ;
|
P2.Translate(-V);
|
||||||
|
BRepBuilderAPI_MakeEdge anEdge(P1, P2);
|
||||||
|
aBuilder1.Add(aCompound1, anEdge);
|
||||||
|
|
||||||
|
P2 = P1;
|
||||||
|
/* test orientation of each face and displays forward (aCompound2) */
|
||||||
|
if(F.Orientation() == TopAbs_FORWARD)
|
||||||
|
P2.Translate(-V);
|
||||||
|
else
|
||||||
|
P2.Translate(V);
|
||||||
|
anEdge = BRepBuilderAPI_MakeEdge(P1, P2);
|
||||||
|
aBuilder2.Add(aCompound2, anEdge);
|
||||||
|
|
||||||
|
ex.Next();
|
||||||
|
test++;
|
||||||
}
|
}
|
||||||
if( myGeomBase->CreateArrowForLinearEdge( tmpShape, mySimulationTopoDs ) ) {
|
|
||||||
myGeomBase->DisplaySimulationShape( mySimulationTopoDs ) ;
|
/* display simulation compounds */
|
||||||
}
|
if(test > 0 && GroupPoints->CheckButton1->isChecked())
|
||||||
return ;
|
mySimulationTopoDs = aCompound1;
|
||||||
|
else if(test > 0 && !GroupPoints->CheckButton1->isChecked())
|
||||||
|
mySimulationTopoDs = aCompound2;
|
||||||
|
|
||||||
|
if(!mySimulationTopoDs.IsNull())
|
||||||
|
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
|
||||||
}
|
}
|
||||||
|
catch(Standard_Failure)
|
||||||
|
MESSAGE("Exception catched in MakeOrientationSimulationAndDisplay");
|
||||||
gp_Pnt P1, P2 ;
|
return;
|
||||||
gp_Vec V, V1, V2 ;
|
|
||||||
TopExp_Explorer ex( aTopoDS, TopAbs_FACE );
|
|
||||||
int test = 0 ;
|
|
||||||
while (ex.More()) {
|
|
||||||
|
|
||||||
const TopoDS_Face& F = TopoDS::Face(ex.Current());
|
|
||||||
/* find the center of the minmax */
|
|
||||||
BRepAdaptor_Surface SF(F);
|
|
||||||
Standard_Real u, v, x;
|
|
||||||
|
|
||||||
u = SF.FirstUParameter();
|
|
||||||
x = SF.LastUParameter();
|
|
||||||
if ( Precision::IsInfinite(u) ) {
|
|
||||||
if( Precision::IsInfinite(x) ) u = 0.0 ; else u = x ;
|
|
||||||
}
|
|
||||||
else if ( !Precision::IsInfinite(x) )
|
|
||||||
u = (u+x) / 2.0 ;
|
|
||||||
|
|
||||||
v = SF.FirstVParameter();
|
|
||||||
x = SF.LastVParameter();
|
|
||||||
if ( Precision::IsInfinite(v) ) {
|
|
||||||
if ( Precision::IsInfinite(x) ) v = 0.0 ; else v = x ;
|
|
||||||
}
|
|
||||||
else if ( !Precision::IsInfinite(x) )
|
|
||||||
v = (v+x) / 2.0 ;
|
|
||||||
|
|
||||||
SF.D1( u, v, P1, V1, V2 );
|
|
||||||
V = V1.Crossed(V2);
|
|
||||||
x = V.Magnitude();
|
|
||||||
if ( x > 1.e-10 )
|
|
||||||
V.Multiply( length/x );
|
|
||||||
else {
|
|
||||||
V.SetCoord( length/2.0, 0.0, 0.0 ) ;
|
|
||||||
MESSAGE ("Null normal in Orientation " << endl ) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
P2 = P1;
|
|
||||||
/* test orientation of each face and displays forward (aCompound1) */
|
|
||||||
if( F.Orientation() == TopAbs_FORWARD )
|
|
||||||
P2.Translate(V);
|
|
||||||
else
|
|
||||||
P2.Translate(-V) ;
|
|
||||||
BRepBuilderAPI_MakeEdge anEdge(P1, P2) ;
|
|
||||||
aBuilder1.Add( aCompound1, anEdge ) ;
|
|
||||||
|
|
||||||
P2 = P1;
|
|
||||||
/* test orientation of each face and displays forward (aCompound2) */
|
|
||||||
if( F.Orientation() == TopAbs_FORWARD )
|
|
||||||
P2.Translate(-V);
|
|
||||||
else
|
|
||||||
P2.Translate(V) ;
|
|
||||||
anEdge = BRepBuilderAPI_MakeEdge(P1, P2) ;
|
|
||||||
aBuilder2.Add( aCompound2, anEdge ) ;
|
|
||||||
|
|
||||||
ex.Next();
|
|
||||||
test++ ;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* display simulation compounds */
|
|
||||||
if( test > 0 && this->CheckBoxReverse->isChecked() ) {
|
|
||||||
mySimulationTopoDs = aCompound1 ;
|
|
||||||
}
|
|
||||||
else if ( test > 0 && !CheckBoxReverse->isChecked() ) {
|
|
||||||
mySimulationTopoDs = aCompound2 ;
|
|
||||||
}
|
|
||||||
if(!mySimulationTopoDs.IsNull() )
|
|
||||||
myGeomBase->DisplaySimulationShape(mySimulationTopoDs) ;
|
|
||||||
|
|
||||||
return ;
|
|
||||||
}
|
}
|
||||||
|
@ -29,94 +29,47 @@
|
|||||||
#ifndef DIALOGBOX_ORIENTATION_H
|
#ifndef DIALOGBOX_ORIENTATION_H
|
||||||
#define DIALOGBOX_ORIENTATION_H
|
#define DIALOGBOX_ORIENTATION_H
|
||||||
|
|
||||||
|
#include "GEOMBase_Skeleton.h"
|
||||||
|
#include "DlgRef_1Sel1Spin1Check.h"
|
||||||
|
|
||||||
#include "RepairGUI.h"
|
#include "RepairGUI.h"
|
||||||
|
|
||||||
#include "DlgRef_SpinBox.h"
|
|
||||||
|
|
||||||
#include <qvariant.h>
|
|
||||||
#include <qdialog.h>
|
|
||||||
#include <qvalidator.h>
|
|
||||||
|
|
||||||
class QVBoxLayout;
|
|
||||||
class QHBoxLayout;
|
|
||||||
class QGridLayout;
|
|
||||||
class QButtonGroup;
|
|
||||||
class QCheckBox;
|
|
||||||
class QGroupBox;
|
|
||||||
class QLabel;
|
|
||||||
class QLineEdit;
|
|
||||||
class QPushButton;
|
|
||||||
class QRadioButton;
|
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : DialogBox_ORIENTATION
|
// class : DialogBox_ORIENTATION
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
class RepairGUI_OrientationDlg : public QDialog
|
class RepairGUI_OrientationDlg : public GEOMBase_Skeleton
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RepairGUI_OrientationDlg( QWidget* parent = 0, const char* name = 0, RepairGUI* theRepairGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
|
RepairGUI_OrientationDlg(QWidget* parent = 0, const char* name = 0, RepairGUI* theRepairGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
|
||||||
~RepairGUI_OrientationDlg();
|
~RepairGUI_OrientationDlg();
|
||||||
|
|
||||||
private :
|
private :
|
||||||
|
void Init();
|
||||||
|
void enterEvent(QEvent* e);
|
||||||
|
void MakeOrientationSimulationAndDisplay();
|
||||||
|
|
||||||
RepairGUI* myRepairGUI;
|
RepairGUI* myRepairGUI;
|
||||||
GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */
|
|
||||||
GEOMBase* myGeomBase ; /* Current GeomGUI object */
|
|
||||||
GEOMContext* myGeomGUI ; /* Current GeomGUI object */
|
|
||||||
TopoDS_Shape mySimulationTopoDs ; /* Shape used for simulation display */
|
|
||||||
SALOME_Selection* mySelection ; /* User shape selection */
|
|
||||||
GEOM::GEOM_Shape_var myGeomShape ; /* is myShape */
|
|
||||||
TopoDS_Shape myShape ; /* topology used */
|
|
||||||
Standard_Real myLength ; /* to simulate normal vector */
|
|
||||||
bool myOkShape ;
|
|
||||||
bool myOkLength ;
|
|
||||||
QDoubleValidator *myVa ; /* Double validator for numeric input */
|
|
||||||
QLineEdit* myEditCurrentArgument; /* Current LineEdit */
|
|
||||||
int myConstructorId ; /* Current constructor id = radio button id */
|
|
||||||
|
|
||||||
void closeEvent( QCloseEvent* e ) ;
|
GEOM::GEOM_Shape_var myGeomShape; /* is myShape */
|
||||||
void enterEvent( QEvent* e);
|
TopoDS_Shape myShape; /* topology used */
|
||||||
void Init( SALOME_Selection* Sel ) ;
|
Standard_Real myLength; /* to simulate normal vector */
|
||||||
void MakeOrientationSimulationAndDisplay( const TopoDS_Shape& aTopoDS, Standard_Real length ) ;
|
bool myOkShape;
|
||||||
|
|
||||||
QButtonGroup* GroupConstructors;
|
DlgRef_1Sel1Spin1Check* GroupPoints;
|
||||||
QRadioButton* Constructor1;
|
|
||||||
QGroupBox* GroupButtons;
|
|
||||||
QPushButton* buttonOk;
|
|
||||||
QPushButton* buttonCancel;
|
|
||||||
QPushButton* buttonApply;
|
|
||||||
QGroupBox* GroupC1;
|
|
||||||
QLineEdit* LineEditC1A1;
|
|
||||||
DlgRef_SpinBox* SpinBox_C1A2 ;
|
|
||||||
|
|
||||||
QPushButton* SelectButtonC1A1;
|
|
||||||
QLabel* TextLabelC1A1;
|
|
||||||
QLabel* TextLabelC1A2;
|
|
||||||
QCheckBox* CheckBoxReverse;
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
void ConstructorsClicked(int constructorId);
|
|
||||||
void ClickOnOk();
|
void ClickOnOk();
|
||||||
void ClickOnCancel();
|
|
||||||
void ClickOnApply();
|
void ClickOnApply();
|
||||||
void SetEditCurrentArgument() ;
|
void ActivateThisDialog();
|
||||||
void SelectionIntoArgument() ;
|
void LineEditReturnPressed();
|
||||||
void LineEditReturnPressed() ;
|
void SelectionIntoArgument();
|
||||||
void DeactivateActiveDialog() ;
|
void SetEditCurrentArgument();
|
||||||
void ActivateThisDialog() ;
|
void ReverseAngle(int state);
|
||||||
void ReverseOrientation(int state) ;
|
void ValueChangedInSpinBox(double newValue);
|
||||||
void ValueChangedInSpinBox( double newValue ) ;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
QGridLayout* RepairGUI_OrientationDlgLayout;
|
|
||||||
QGridLayout* GroupConstructorsLayout;
|
|
||||||
QGridLayout* GroupButtonsLayout;
|
|
||||||
QGridLayout* GroupC1Layout;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DIALOGBOX_ORIENTATION_H
|
#endif // DIALOGBOX_ORIENTATION_H
|
||||||
|
@ -134,7 +134,7 @@ void RepairGUI_SewingDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_SewingDlg::ClickOnApply()
|
void RepairGUI_SewingDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
if(myOkListShapes)
|
if(myOkListShapes)
|
||||||
myRepairGUI->MakeSewingAndDisplay(myListShapes, myPrecision);
|
myRepairGUI->MakeSewingAndDisplay(myListShapes, myPrecision);
|
||||||
return;
|
return;
|
||||||
|
@ -30,21 +30,8 @@ using namespace std;
|
|||||||
#include "RepairGUI_SuppressFacesDlg.h"
|
#include "RepairGUI_SuppressFacesDlg.h"
|
||||||
|
|
||||||
#include "DisplayGUI.h"
|
#include "DisplayGUI.h"
|
||||||
|
#include "QAD_RightFrame.h"
|
||||||
|
#include "OCCViewer_Viewer3d.h"
|
||||||
#include <qbuttongroup.h>
|
|
||||||
#include <qcheckbox.h>
|
|
||||||
#include <qgroupbox.h>
|
|
||||||
#include <qlabel.h>
|
|
||||||
#include <qlineedit.h>
|
|
||||||
#include <qpushbutton.h>
|
|
||||||
#include <qradiobutton.h>
|
|
||||||
#include <qlayout.h>
|
|
||||||
#include <qvariant.h>
|
|
||||||
#include <qtooltip.h>
|
|
||||||
#include <qwhatsthis.h>
|
|
||||||
#include <qimage.h>
|
|
||||||
#include <qpixmap.h>
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : RepairGUI_SuppressFacesDlg()
|
// class : RepairGUI_SuppressFacesDlg()
|
||||||
@ -53,119 +40,32 @@ using namespace std;
|
|||||||
// 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.
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
RepairGUI_SuppressFacesDlg::RepairGUI_SuppressFacesDlg( QWidget* parent,
|
RepairGUI_SuppressFacesDlg::RepairGUI_SuppressFacesDlg(QWidget* parent, const char* name, RepairGUI* theRepairGUI, SALOME_Selection* Sel, Handle(AIS_InteractiveContext) ic, bool modal, WFlags fl)
|
||||||
const char* name,
|
:GEOMBase_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
|
||||||
RepairGUI* theRepairGUI,
|
|
||||||
SALOME_Selection* Sel,
|
|
||||||
Handle (AIS_InteractiveContext) ic,
|
|
||||||
bool modal,
|
|
||||||
WFlags fl )
|
|
||||||
: QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
|
|
||||||
{
|
{
|
||||||
QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_SUPRESS_FACE")));
|
QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_SUPRESS_FACE")));
|
||||||
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT")));
|
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||||
|
|
||||||
if ( !name )
|
setCaption(tr("GEOM_SUPRESSFACE_TITLE"));
|
||||||
setName( "RepairGUI_SuppressFacesDlg" );
|
|
||||||
resize( 322, 203 );
|
|
||||||
setCaption( tr( "GEOM_SUPRESSFACE_TITLE" ) );
|
|
||||||
setSizeGripEnabled( TRUE );
|
|
||||||
RepairGUI_SuppressFacesDlgLayout = new QGridLayout( this );
|
|
||||||
RepairGUI_SuppressFacesDlgLayout->setSpacing( 6 );
|
|
||||||
RepairGUI_SuppressFacesDlgLayout->setMargin( 11 );
|
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
GroupConstructors = new QButtonGroup( this, "GroupConstructors" );
|
GroupConstructors->setTitle(tr("GEOM_SUPRESSFACE"));
|
||||||
GroupConstructors->setTitle( tr( "GEOM_SUPRESSFACE" ) );
|
RadioButton1->setPixmap(image0);
|
||||||
GroupConstructors->setExclusive( TRUE );
|
RadioButton2->close(TRUE);
|
||||||
GroupConstructors->setColumnLayout(0, Qt::Vertical );
|
RadioButton3->close(TRUE);
|
||||||
GroupConstructors->layout()->setSpacing( 0 );
|
|
||||||
GroupConstructors->layout()->setMargin( 0 );
|
|
||||||
GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() );
|
|
||||||
GroupConstructorsLayout->setAlignment( Qt::AlignTop );
|
|
||||||
GroupConstructorsLayout->setSpacing( 6 );
|
|
||||||
GroupConstructorsLayout->setMargin( 11 );
|
|
||||||
Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" );
|
|
||||||
Constructor1->setText( tr( "" ) );
|
|
||||||
Constructor1->setPixmap( image0 );
|
|
||||||
Constructor1->setChecked( TRUE );
|
|
||||||
Constructor1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth() ) );
|
|
||||||
Constructor1->setMinimumSize( QSize( 50, 0 ) );
|
|
||||||
GroupConstructorsLayout->addWidget( Constructor1, 0, 0 );
|
|
||||||
QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
|
|
||||||
GroupConstructorsLayout->addItem( spacer, 0, 1 );
|
|
||||||
RepairGUI_SuppressFacesDlgLayout->addWidget( GroupConstructors, 0, 0 );
|
|
||||||
|
|
||||||
/***************************************************************/
|
GroupPoints = new DlgRef_1Sel1Check_QTD(this, "GroupPoints");
|
||||||
GroupC1 = new QGroupBox( this, "GroupC1" );
|
GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
|
||||||
GroupC1->setTitle( tr( "GEOM_ARGUMENTS" ) );
|
GroupPoints->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
|
||||||
GroupC1->setMinimumSize( QSize( 0, 0 ) );
|
GroupPoints->CheckButton1->setText(tr("GEOM_SUPRESSFACE_SELECT"));
|
||||||
GroupC1->setFrameShape( QGroupBox::Box );
|
GroupPoints->PushButton1->setPixmap(image1);
|
||||||
GroupC1->setFrameShadow( QGroupBox::Sunken );
|
|
||||||
GroupC1->setColumnLayout(0, Qt::Vertical );
|
|
||||||
GroupC1->layout()->setSpacing( 0 );
|
|
||||||
GroupC1->layout()->setMargin( 0 );
|
|
||||||
GroupC1Layout = new QGridLayout( GroupC1->layout() );
|
|
||||||
GroupC1Layout->setAlignment( Qt::AlignTop );
|
|
||||||
GroupC1Layout->setSpacing( 6 );
|
|
||||||
GroupC1Layout->setMargin( 11 );
|
|
||||||
Layout2 = new QHBoxLayout;
|
|
||||||
Layout2->setSpacing( 6 );
|
|
||||||
Layout2->setMargin( 0 );
|
|
||||||
TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" );
|
|
||||||
TextLabelC1A1->setText( tr( "GEOM_MAIN_OBJECT" ) );
|
|
||||||
TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) );
|
|
||||||
TextLabelC1A1->setFrameShape( QLabel::NoFrame );
|
|
||||||
TextLabelC1A1->setFrameShadow( QLabel::Plain );
|
|
||||||
Layout2->addWidget( TextLabelC1A1 );
|
|
||||||
SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" );
|
|
||||||
SelectButtonC1A1->setText( tr( "" ) );
|
|
||||||
SelectButtonC1A1->setPixmap( image1 );
|
|
||||||
SelectButtonC1A1->setToggleButton( FALSE );
|
|
||||||
SelectButtonC1A1->setMaximumSize( QSize( 28, 32767 ) );
|
|
||||||
Layout2->addWidget( SelectButtonC1A1 );
|
|
||||||
LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" );
|
|
||||||
LineEditC1A1->setAlignment( int( QLineEdit::AlignLeft ) );
|
|
||||||
Layout2->addWidget( LineEditC1A1 );
|
|
||||||
GroupC1Layout->addLayout( Layout2, 0, 0 );
|
|
||||||
CheckBox1 = new QCheckBox( GroupC1, "CheckBox1" );
|
|
||||||
CheckBox1->setText( tr( "GEOM_SUPRESSFACE_SELECT" ) );
|
|
||||||
CheckBox1->setChecked( FALSE );
|
|
||||||
GroupC1Layout->addWidget( CheckBox1, 1, 0 );
|
|
||||||
RepairGUI_SuppressFacesDlgLayout->addWidget( GroupC1, 1, 0 );
|
|
||||||
|
|
||||||
/***************************************************************/
|
Layout1->addWidget(GroupPoints, 1, 0);
|
||||||
GroupButtons = new QGroupBox( this, "GroupButtons" );
|
/***************************************************************/
|
||||||
GroupButtons->setTitle( tr( "" ) );
|
|
||||||
GroupButtons->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, GroupButtons->sizePolicy().hasHeightForWidth() ) );
|
|
||||||
GroupButtons->setColumnLayout(0, Qt::Vertical );
|
|
||||||
GroupButtons->layout()->setSpacing( 0 );
|
|
||||||
GroupButtons->layout()->setMargin( 0 );
|
|
||||||
GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
|
|
||||||
GroupButtonsLayout->setAlignment( Qt::AlignTop );
|
|
||||||
GroupButtonsLayout->setSpacing( 6 );
|
|
||||||
GroupButtonsLayout->setMargin( 11 );
|
|
||||||
//
|
|
||||||
buttonOk = new QPushButton( GroupButtons, "buttonOk" );
|
|
||||||
buttonOk->setText( tr( "GEOM_BUT_OK" ) );
|
|
||||||
buttonOk->setAutoDefault( TRUE );
|
|
||||||
buttonOk->setDefault( TRUE );
|
|
||||||
GroupButtonsLayout->addWidget( buttonOk, 0, 0 );
|
|
||||||
buttonApply = new QPushButton( GroupButtons, "buttonApply" );
|
|
||||||
buttonApply->setText( tr( "GEOM_BUT_APPLY" ) );
|
|
||||||
buttonApply->setAutoDefault( TRUE );
|
|
||||||
GroupButtonsLayout->addWidget( buttonApply, 0, 1 );
|
|
||||||
QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
|
|
||||||
GroupButtonsLayout->addItem( spacer_2, 0, 2 );
|
|
||||||
buttonClose = new QPushButton( GroupButtons, "buttonClose" );
|
|
||||||
buttonClose->setText( tr( "GEOM_BUT_CLOSE" ) );
|
|
||||||
buttonClose->setAutoDefault( TRUE );
|
|
||||||
GroupButtonsLayout->addWidget( buttonClose, 0, 3 );
|
|
||||||
RepairGUI_SuppressFacesDlgLayout->addWidget( GroupButtons, 2, 0 );
|
|
||||||
myRepairGUI = theRepairGUI;
|
|
||||||
/* Initialisations */
|
|
||||||
Init(Sel, ic) ;
|
|
||||||
|
|
||||||
|
/* Initialisations */
|
||||||
|
myRepairGUI = theRepairGUI;
|
||||||
|
Init(ic);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -175,69 +75,44 @@ RepairGUI_SuppressFacesDlg::RepairGUI_SuppressFacesDlg( QWidget* parent,
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
RepairGUI_SuppressFacesDlg::~RepairGUI_SuppressFacesDlg()
|
RepairGUI_SuppressFacesDlg::~RepairGUI_SuppressFacesDlg()
|
||||||
{
|
{
|
||||||
// no need to delete child widgets, Qt does it all for us
|
// no need to delete child widgets, Qt does it all for us
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : Init()
|
// function : Init()
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_SuppressFacesDlg::Init( SALOME_Selection* Sel, Handle (AIS_InteractiveContext) ic )
|
void RepairGUI_SuppressFacesDlg::Init(Handle(AIS_InteractiveContext) ic)
|
||||||
{
|
{
|
||||||
|
/* init variables */
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
|
|
||||||
GroupC1->show();
|
myOkSelectSubMode = false;
|
||||||
myConstructorId = 0 ;
|
myOkShape = myUseLocalContext = false;
|
||||||
Constructor1->setChecked( TRUE );
|
myIC = ic;
|
||||||
myEditCurrentArgument = LineEditC1A1 ;
|
myLocalContextId = -1;
|
||||||
mySelection = Sel;
|
|
||||||
myShape.Nullify() ;
|
|
||||||
|
|
||||||
myIC = ic ;
|
|
||||||
myUseLocalContext = false ;
|
|
||||||
myOkShape = false ;
|
|
||||||
myGeomBase = new GEOMBase() ;
|
|
||||||
myGeomGUI = GEOMContext::GetGeomGUI() ;
|
|
||||||
|
|
||||||
/* Select sub shapes mode not checked */
|
|
||||||
CheckBox1->setChecked( FALSE );
|
|
||||||
myOkSelectSubMode = false ;
|
|
||||||
|
|
||||||
// TODO : previous selection into argument ?
|
|
||||||
|
|
||||||
/* Filter definitions */
|
|
||||||
Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM");
|
|
||||||
myGeom = GEOM::GEOM_Gen::_narrow(comp);
|
|
||||||
|
|
||||||
/* signals and slots connections */
|
/* signals and slots connections */
|
||||||
connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
|
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
|
||||||
connect( buttonApply, SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
|
connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
|
||||||
connect( buttonClose, SIGNAL( clicked() ), this, SLOT( ClickOnClose() ) );
|
connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
|
||||||
connect( GroupConstructors, SIGNAL( clicked(int) ), this, SLOT( ConstructorsClicked(int) ));
|
|
||||||
|
|
||||||
connect( SelectButtonC1A1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ));
|
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||||
connect( CheckBox1, SIGNAL( stateChanged(int) ), this, SLOT( ActivateUserSelection() ));
|
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||||
connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ));
|
|
||||||
connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ;
|
|
||||||
connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( ClickOnClose() ));
|
|
||||||
|
|
||||||
/* Move widget on the botton right corner of main widget */
|
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
int x, y ;
|
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
myGeomBase->DefineDlgPosition( this, x, y ) ;
|
|
||||||
this->move( x, y ) ;
|
|
||||||
this->show() ; /* display Dialog */
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
connect(GroupPoints->CheckButton1, SIGNAL(stateChanged(int)), this, SLOT(ActivateUserSelection()));
|
||||||
|
|
||||||
//=================================================================================
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
// function : ConstructorsClicked()
|
|
||||||
// purpose : Radio button management
|
/* displays Dialog */
|
||||||
//=================================================================================
|
GroupPoints->show();
|
||||||
void RepairGUI_SuppressFacesDlg::ConstructorsClicked(int constructorId)
|
this->show();
|
||||||
{
|
|
||||||
return ;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -247,10 +122,9 @@ void RepairGUI_SuppressFacesDlg::ConstructorsClicked(int constructorId)
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_SuppressFacesDlg::ClickOnOk()
|
void RepairGUI_SuppressFacesDlg::ClickOnOk()
|
||||||
{
|
{
|
||||||
this->ClickOnApply() ;
|
this->ClickOnApply();
|
||||||
accept();
|
this->ClickOnCancel();
|
||||||
|
return;
|
||||||
return ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -261,47 +135,41 @@ void RepairGUI_SuppressFacesDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_SuppressFacesDlg::ClickOnApply()
|
void RepairGUI_SuppressFacesDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
bool testResult = false ;
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
switch(myConstructorId)
|
bool testResult = false;
|
||||||
{
|
|
||||||
case 0 :
|
if(myOkShape && myOkSelectSubMode)
|
||||||
{
|
testResult = myRepairGUI->OnSuppressFaces(myShape, myShapeIOR, myLocalContextId, myUseLocalContext);
|
||||||
if( myOkShape && myOkSelectSubMode ) {
|
|
||||||
testResult = myRepairGUI->OnSuppressFaces( myShape, myShapeIOR, myLocalContextId, myUseLocalContext ) ;
|
if(!testResult)
|
||||||
}
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
if( !testResult ) {
|
else
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT")) ;
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
|
||||||
else {
|
/* Reset arguments to allow a new selection */
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE")) ;
|
this->ResetStateOfDialog();
|
||||||
}
|
|
||||||
/* Reset arguments to allow a new selection */
|
|
||||||
this->ResetStateOfDialog() ;
|
|
||||||
break ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : ClickOnClose()
|
// function : ClickOnCancel()
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_SuppressFacesDlg::ClickOnClose()
|
void RepairGUI_SuppressFacesDlg::ClickOnCancel()
|
||||||
{
|
{
|
||||||
disconnect( mySelection, 0, this, 0 );
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
myGeomGUI->ResetState() ;
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
|
myIC = v3d->getAISContext();
|
||||||
if(myUseLocalContext) {
|
if(myUseLocalContext) {
|
||||||
myIC->CloseLocalContext(myLocalContextId) ;
|
myIC->CloseLocalContext(myLocalContextId);
|
||||||
this->myUseLocalContext = false ;
|
myUseLocalContext = false;
|
||||||
|
}
|
||||||
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
||||||
myDisplayGUI->OnDisplayAll(true) ;
|
myDisplayGUI->OnDisplayAll(true);
|
||||||
}
|
}
|
||||||
reject() ;
|
GEOMBase_Skeleton::ClickOnCancel();
|
||||||
return ;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -312,59 +180,57 @@ void RepairGUI_SuppressFacesDlg::ClickOnClose()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_SuppressFacesDlg::SelectionIntoArgument()
|
void RepairGUI_SuppressFacesDlg::SelectionIntoArgument()
|
||||||
{
|
{
|
||||||
|
myEditCurrentArgument->setText("");
|
||||||
/* Reset argument and local context when selection as changed */
|
this->ResetStateOfDialog();
|
||||||
this->ResetStateOfDialog() ;
|
|
||||||
|
|
||||||
QString aString = ""; /* name of selection */
|
QString aString = ""; /* name of selection */
|
||||||
|
|
||||||
int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString) ;
|
int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
|
||||||
if ( nbSel != 1 )
|
if(nbSel != 1) {
|
||||||
return ;
|
myOkShape = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* nbSel == 1 */
|
/* nbSel == 1 */
|
||||||
TopoDS_Shape S ;
|
TopoDS_Shape S;
|
||||||
Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ;
|
Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
|
||||||
|
if(!myGeomBase->GetTopoFromSelection(mySelection, S))
|
||||||
|
return;
|
||||||
|
|
||||||
if( !myGeomBase->GetTopoFromSelection(mySelection, S) )
|
if(!IO->hasEntry()) {
|
||||||
return ;
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
|
||||||
|
return;
|
||||||
if( !IO->hasEntry() ) {
|
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY")) ;
|
|
||||||
return ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Test the exact type of topology to suppress faces into */
|
/* Test the exact type of topology to suppress faces into */
|
||||||
if ( !S.IsNull() && ( S.ShapeType() == TopAbs_SOLID || S.ShapeType() == TopAbs_SHELL || S.ShapeType() == TopAbs_COMPOUND ) ) {
|
if(!S.IsNull() && (S.ShapeType() == TopAbs_SOLID || S.ShapeType() == TopAbs_SHELL || S.ShapeType() == TopAbs_COMPOUND)) {
|
||||||
|
if(IO->IsInstance(STANDARD_TYPE(GEOM_InteractiveObject))) {
|
||||||
if ( IO->IsInstance(STANDARD_TYPE(GEOM_InteractiveObject)) ) {
|
Handle(GEOM_InteractiveObject) GIObject = Handle(GEOM_InteractiveObject)::DownCast(IO);
|
||||||
Handle(GEOM_InteractiveObject) GIObject = Handle(GEOM_InteractiveObject)::DownCast( IO );
|
|
||||||
myShapeIOR = GIObject->getIOR(); /* the Geom IOR string of selection */
|
myShapeIOR = GIObject->getIOR(); /* the Geom IOR string of selection */
|
||||||
LineEditC1A1->setText(aString) ;
|
myEditCurrentArgument->setText(aString);
|
||||||
myShape = S ;
|
myShape = S;
|
||||||
myOkShape = true ;
|
myOkShape = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( IO->hasEntry() ) {
|
if(IO->hasEntry()) {
|
||||||
SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
|
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
|
||||||
SALOMEDS::SObject_var obj = aStudy->FindObjectID( IO->getEntry() );
|
SALOMEDS::SObject_var obj = aStudy->FindObjectID(IO->getEntry());
|
||||||
SALOMEDS::GenericAttribute_var anAttr;
|
SALOMEDS::GenericAttribute_var anAttr;
|
||||||
SALOMEDS::AttributeIOR_var anIOR;
|
SALOMEDS::AttributeIOR_var anIOR;
|
||||||
if ( !obj->_is_nil() ) {
|
if(!obj->_is_nil()) {
|
||||||
if (obj->FindAttribute(anAttr, "AttributeIOR")) {
|
if(obj->FindAttribute(anAttr, "AttributeIOR")) {
|
||||||
anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
|
anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
|
||||||
myShapeIOR = anIOR->Value();
|
myShapeIOR = anIOR->Value();
|
||||||
myOkShape = true ;
|
myOkShape = true;
|
||||||
myShape = S ;
|
myShape = S;
|
||||||
LineEditC1A1->setText(aString) ;
|
myEditCurrentArgument->setText(aString);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return ;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -375,19 +241,14 @@ void RepairGUI_SuppressFacesDlg::SelectionIntoArgument()
|
|||||||
void RepairGUI_SuppressFacesDlg::SetEditCurrentArgument()
|
void RepairGUI_SuppressFacesDlg::SetEditCurrentArgument()
|
||||||
{
|
{
|
||||||
QPushButton* send = (QPushButton*)sender();
|
QPushButton* send = (QPushButton*)sender();
|
||||||
switch (myConstructorId)
|
|
||||||
{
|
if(send == GroupPoints->PushButton1) {
|
||||||
case 0: /* default constructor */
|
GroupPoints->LineEdit1->setFocus();
|
||||||
{
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
if(send == SelectButtonC1A1) {
|
}
|
||||||
LineEditC1A1->setFocus() ;
|
this->SelectionIntoArgument();
|
||||||
myEditCurrentArgument = LineEditC1A1;
|
|
||||||
SelectionIntoArgument() ;
|
return;
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -397,7 +258,14 @@ void RepairGUI_SuppressFacesDlg::SetEditCurrentArgument()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_SuppressFacesDlg::LineEditReturnPressed()
|
void RepairGUI_SuppressFacesDlg::LineEditReturnPressed()
|
||||||
{
|
{
|
||||||
return ;
|
QLineEdit* send = (QLineEdit*)sender();
|
||||||
|
if(send == GroupPoints->LineEdit1)
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -407,20 +275,11 @@ void RepairGUI_SuppressFacesDlg::LineEditReturnPressed()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_SuppressFacesDlg::DeactivateActiveDialog()
|
void RepairGUI_SuppressFacesDlg::DeactivateActiveDialog()
|
||||||
{
|
{
|
||||||
if ( GroupConstructors->isEnabled() ) {
|
if(GroupConstructors->isEnabled()) {
|
||||||
|
this->ResetStateOfDialog();
|
||||||
this->ResetStateOfDialog() ;
|
GEOMBase_Skeleton::DeactivateActiveDialog();
|
||||||
|
|
||||||
disconnect( mySelection, 0, this, 0 );
|
|
||||||
GroupConstructors->setEnabled(false) ;
|
|
||||||
GroupC1->setEnabled(false) ;
|
|
||||||
GroupButtons->setEnabled(false) ;
|
|
||||||
myGeomGUI->ResetState() ;
|
|
||||||
myGeomGUI->SetActiveDialogBox(0) ;
|
|
||||||
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
|
||||||
myDisplayGUI->OnDisplayAll(true) ;
|
|
||||||
}
|
}
|
||||||
return ;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -430,14 +289,9 @@ void RepairGUI_SuppressFacesDlg::DeactivateActiveDialog()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_SuppressFacesDlg::ActivateThisDialog()
|
void RepairGUI_SuppressFacesDlg::ActivateThisDialog()
|
||||||
{
|
{
|
||||||
/* Emit a signal to deactivate other active dialog */
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
myGeomGUI->EmitSignalDeactivateDialog() ;
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
GroupConstructors->setEnabled(true) ;
|
return;
|
||||||
GroupC1->setEnabled(true) ;
|
|
||||||
GroupButtons->setEnabled(true) ;
|
|
||||||
connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
|
||||||
myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ;
|
|
||||||
return ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -447,10 +301,10 @@ void RepairGUI_SuppressFacesDlg::ActivateThisDialog()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_SuppressFacesDlg::enterEvent(QEvent* e)
|
void RepairGUI_SuppressFacesDlg::enterEvent(QEvent* e)
|
||||||
{
|
{
|
||||||
if ( GroupConstructors->isEnabled() )
|
if(GroupConstructors->isEnabled())
|
||||||
return ;
|
return;
|
||||||
ActivateThisDialog() ;
|
this->ActivateThisDialog();
|
||||||
return ;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -458,11 +312,11 @@ void RepairGUI_SuppressFacesDlg::enterEvent(QEvent* e)
|
|||||||
// function : closeEvent()
|
// function : closeEvent()
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_SuppressFacesDlg::closeEvent( QCloseEvent* e )
|
void RepairGUI_SuppressFacesDlg::closeEvent(QCloseEvent* e)
|
||||||
{
|
{
|
||||||
/* same than click on cancel button */
|
/* same than click on cancel button */
|
||||||
this->ClickOnClose() ;
|
this->ClickOnCancel();
|
||||||
return ;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -472,34 +326,37 @@ void RepairGUI_SuppressFacesDlg::closeEvent( QCloseEvent* e )
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_SuppressFacesDlg::ActivateUserSelection()
|
void RepairGUI_SuppressFacesDlg::ActivateUserSelection()
|
||||||
{
|
{
|
||||||
if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
if( !this->myOkShape ) {
|
if(!myOkShape) {
|
||||||
this->ResetStateOfDialog() ;
|
this->ResetStateOfDialog();
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SELECT_FIRST")) ;
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SELECT_FIRST"));
|
||||||
return ;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->myOkSelectSubMode = CheckBox1->isChecked() ;
|
myOkSelectSubMode = GroupPoints->CheckButton1->isChecked();
|
||||||
|
|
||||||
if( this->myUseLocalContext ) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
myIC->CloseLocalContext(myLocalContextId) ;
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
this->myUseLocalContext = false ;
|
myIC = v3d->getAISContext();
|
||||||
|
if(myUseLocalContext) {
|
||||||
|
myIC->CloseLocalContext(myLocalContextId);
|
||||||
|
myUseLocalContext = false;
|
||||||
|
}
|
||||||
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
||||||
myDisplayGUI->OnDisplayAll(true) ;
|
myDisplayGUI->OnDisplayAll(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( myOkShape && myOkSelectSubMode ) {
|
if(myOkShape && myOkSelectSubMode) {
|
||||||
/* local context is defined into the method : 4 = FACES sub selection */
|
/* local context is defined into the method : 4 = FACES sub selection */
|
||||||
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
||||||
myDisplayGUI->PrepareSubShapeSelection( int(TopAbs_FACE), this->myLocalContextId ) ;
|
myDisplayGUI->PrepareSubShapeSelection(int(TopAbs_FACE), myLocalContextId);
|
||||||
myUseLocalContext = true ;
|
myUseLocalContext = true;
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SELECT_FACE")) ;
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SELECT_FACE"));
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
CheckBox1->setChecked( false );
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
return ;
|
GroupPoints->CheckButton1->setChecked(false);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -510,19 +367,23 @@ void RepairGUI_SuppressFacesDlg::ActivateUserSelection()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_SuppressFacesDlg::ResetStateOfDialog()
|
void RepairGUI_SuppressFacesDlg::ResetStateOfDialog()
|
||||||
{
|
{
|
||||||
this->myOkShape = false ;
|
myOkShape = false ;
|
||||||
this->myEditCurrentArgument->setText("") ;
|
myEditCurrentArgument->setText("");
|
||||||
|
|
||||||
/* Select sub shapes mode not checked */
|
/* Select sub shapes mode not checked */
|
||||||
this->myOkSelectSubMode = false ;
|
myOkSelectSubMode = false;
|
||||||
this->CheckBox1->setChecked( FALSE );
|
GroupPoints->CheckButton1->setChecked(FALSE);
|
||||||
|
|
||||||
/* Close its local contact if opened */
|
/* Close its local contact if opened */
|
||||||
if( this->myUseLocalContext ) {
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
myIC->CloseLocalContext(this->myLocalContextId) ;
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
this->myUseLocalContext = false ;
|
myIC = v3d->getAISContext();
|
||||||
|
if(myUseLocalContext) {
|
||||||
|
myIC->CloseLocalContext(myLocalContextId);
|
||||||
|
myUseLocalContext = false;
|
||||||
|
}
|
||||||
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
||||||
myDisplayGUI->OnDisplayAll(true) ;
|
myDisplayGUI->OnDisplayAll(true);
|
||||||
}
|
}
|
||||||
return ;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -29,102 +29,56 @@
|
|||||||
#ifndef DIALOGBOX_SUPPRESSFACES_H
|
#ifndef DIALOGBOX_SUPPRESSFACES_H
|
||||||
#define DIALOGBOX_SUPPRESSFACES_H
|
#define DIALOGBOX_SUPPRESSFACES_H
|
||||||
|
|
||||||
|
#include "GEOMBase_Skeleton.h"
|
||||||
|
#include "DlgRef_1Sel1Check_QTD.h"
|
||||||
|
|
||||||
#include "RepairGUI.h"
|
#include "RepairGUI.h"
|
||||||
|
|
||||||
#include <qvariant.h>
|
|
||||||
#include <qdialog.h>
|
|
||||||
|
|
||||||
#include <AIS_InteractiveContext.hxx>
|
|
||||||
|
|
||||||
class QVBoxLayout;
|
|
||||||
class QHBoxLayout;
|
|
||||||
class QGridLayout;
|
|
||||||
class QButtonGroup;
|
|
||||||
class QCheckBox;
|
|
||||||
class QGroupBox;
|
|
||||||
class QLabel;
|
|
||||||
class QLineEdit;
|
|
||||||
class QPushButton;
|
|
||||||
class QRadioButton;
|
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : RepairGUI_SuppressFacesDlg
|
// class : RepairGUI_SuppressFacesDlg
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
class RepairGUI_SuppressFacesDlg : public QDialog
|
class RepairGUI_SuppressFacesDlg : public GEOMBase_Skeleton
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RepairGUI_SuppressFacesDlg( QWidget* parent = 0,
|
RepairGUI_SuppressFacesDlg(QWidget* parent = 0, const char* name = 0, RepairGUI* theRepairGUI = 0, SALOME_Selection* Sel = 0, Handle(AIS_InteractiveContext) ic = 0, bool modal = FALSE, WFlags fl = 0);
|
||||||
const char* name = 0,
|
|
||||||
RepairGUI* theRepairGUI = 0,
|
|
||||||
SALOME_Selection* Sel = 0,
|
|
||||||
Handle (AIS_InteractiveContext) ic = 0,
|
|
||||||
bool modal = FALSE,
|
|
||||||
WFlags fl = 0 );
|
|
||||||
|
|
||||||
~RepairGUI_SuppressFacesDlg();
|
~RepairGUI_SuppressFacesDlg();
|
||||||
|
|
||||||
private :
|
private :
|
||||||
RepairGUI* myRepairGUI;
|
void Init(Handle(AIS_InteractiveContext) ic);
|
||||||
void Init( SALOME_Selection* Sel, Handle (AIS_InteractiveContext) ic ) ;
|
void enterEvent(QEvent* e);
|
||||||
void closeEvent( QCloseEvent* e ) ;
|
void closeEvent(QCloseEvent* e);
|
||||||
void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */
|
|
||||||
void ResetStateOfDialog() ;
|
void ResetStateOfDialog();
|
||||||
|
|
||||||
|
RepairGUI* myRepairGUI;
|
||||||
|
|
||||||
/* Interactive and local context management see also : bool myUseLocalContext() */
|
/* Interactive and local context management see also : bool myUseLocalContext() */
|
||||||
Handle (AIS_InteractiveContext) myIC ; /* Interactive context */
|
Handle(AIS_InteractiveContext) myIC; /* Interactive context */
|
||||||
Standard_Integer myLocalContextId ; /* identify a local context used by this method */
|
Standard_Integer myLocalContextId; /* identify a local context used by this method */
|
||||||
bool myUseLocalContext ; /* true when this method as opened a local context */
|
bool myUseLocalContext; /* true when this method as opened a local context */
|
||||||
|
|
||||||
GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */
|
TopoDS_Shape myShape;
|
||||||
GEOMBase* myGeomBase ; /* Current GeomGUI object */
|
char* myShapeIOR;
|
||||||
GEOMContext* myGeomGUI ; /* Current GeomGUI object */
|
bool myOkShape;
|
||||||
SALOME_Selection* mySelection ; /* User shape selection */
|
bool myOkSelectSubMode; /* true = sub mode selection activated */
|
||||||
|
|
||||||
TopoDS_Shape myShape ;
|
DlgRef_1Sel1Check_QTD* GroupPoints;
|
||||||
char* myShapeIOR ;
|
|
||||||
bool myOkShape ;
|
|
||||||
|
|
||||||
bool myOkSelectSubMode ; /* true = sub mode selection activated */
|
|
||||||
QLineEdit* myEditCurrentArgument; /* Current LineEdit */
|
|
||||||
int myConstructorId ; /* Current constructor id = radio button id */
|
|
||||||
|
|
||||||
QButtonGroup* GroupConstructors;
|
|
||||||
QRadioButton* Constructor1;
|
|
||||||
QGroupBox* GroupC1;
|
|
||||||
QLabel* TextLabelC1A1;
|
|
||||||
QPushButton* SelectButtonC1A1;
|
|
||||||
QLineEdit* LineEditC1A1;
|
|
||||||
QGroupBox* GroupButtons;
|
|
||||||
QPushButton* buttonOk;
|
|
||||||
QPushButton* buttonApply;
|
|
||||||
QPushButton* buttonClose;
|
|
||||||
|
|
||||||
QCheckBox* CheckBox1;
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
void ConstructorsClicked(int constructorId);
|
|
||||||
void ClickOnOk();
|
void ClickOnOk();
|
||||||
void ClickOnApply() ;
|
void ClickOnApply();
|
||||||
void ClickOnClose();
|
void ClickOnCancel();
|
||||||
|
void ActivateThisDialog();
|
||||||
|
void DeactivateActiveDialog();
|
||||||
|
void LineEditReturnPressed();
|
||||||
|
void SelectionIntoArgument();
|
||||||
|
void SetEditCurrentArgument();
|
||||||
|
void ActivateUserSelection();
|
||||||
|
|
||||||
void LineEditReturnPressed() ;
|
|
||||||
void SetEditCurrentArgument() ;
|
|
||||||
void SelectionIntoArgument() ;
|
|
||||||
void DeactivateActiveDialog() ;
|
|
||||||
void ActivateThisDialog() ;
|
|
||||||
void ActivateUserSelection() ;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
QGridLayout* RepairGUI_SuppressFacesDlgLayout;
|
|
||||||
QGridLayout* GroupConstructorsLayout;
|
|
||||||
QGridLayout* GroupC1Layout;
|
|
||||||
QHBoxLayout* Layout2;
|
|
||||||
QGridLayout* GroupButtonsLayout;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DIALOGBOX_SUPPRESSFACES_H
|
#endif // DIALOGBOX_SUPPRESSFACES_H
|
||||||
|
@ -401,7 +401,7 @@ void RepairGUI_SuppressHoleDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_SuppressHoleDlg::ClickOnApply()
|
void RepairGUI_SuppressHoleDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo( tr("") ) ;
|
QAD_Application::getDesktop()->putInfo( tr("") ) ;
|
||||||
bool testResult = false ;
|
bool testResult = false ;
|
||||||
|
|
||||||
if( !myOkShape )
|
if( !myOkShape )
|
||||||
@ -424,7 +424,7 @@ void RepairGUI_SuppressHoleDlg::ClickOnApply()
|
|||||||
myDisplayGUI->OnDisplayAll(true) ;/* Display all objects so that next method using ic can memorize them */
|
myDisplayGUI->OnDisplayAll(true) ;/* Display all objects so that next method using ic can memorize them */
|
||||||
if( !aTest || myListOfIdWire->length() != 1 ) {
|
if( !aTest || myListOfIdWire->length() != 1 ) {
|
||||||
CheckBox2->setChecked(FALSE) ;
|
CheckBox2->setChecked(FALSE) ;
|
||||||
myGeomGUI->GetDesktop()->putInfo( tr("GEOM_PRP_ABORT") ) ;
|
QAD_Application::getDesktop()->putInfo( tr("GEOM_PRP_ABORT") ) ;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
myListOfIdEndFace->length(0) ; /* no end face */
|
myListOfIdEndFace->length(0) ; /* no end face */
|
||||||
@ -442,7 +442,7 @@ void RepairGUI_SuppressHoleDlg::ClickOnApply()
|
|||||||
myDisplayGUI->OnDisplayAll(true) ; /* Display all objects so that next method using ic can memorize them */
|
myDisplayGUI->OnDisplayAll(true) ; /* Display all objects so that next method using ic can memorize them */
|
||||||
if( !aTest || myListOfIdEndFace->length() != 1 ) {
|
if( !aTest || myListOfIdEndFace->length() != 1 ) {
|
||||||
CheckBox3->setChecked(FALSE) ;
|
CheckBox3->setChecked(FALSE) ;
|
||||||
myGeomGUI->GetDesktop()->putInfo( tr("GEOM_PRP_ABORT") ) ;
|
QAD_Application::getDesktop()->putInfo( tr("GEOM_PRP_ABORT") ) ;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
QApplication::setOverrideCursor( Qt::waitCursor );
|
QApplication::setOverrideCursor( Qt::waitCursor );
|
||||||
@ -466,7 +466,7 @@ void RepairGUI_SuppressHoleDlg::ClickOnApply()
|
|||||||
|
|
||||||
if( !aTest || myListOfIdWire->length() < 1 ) {
|
if( !aTest || myListOfIdWire->length() < 1 ) {
|
||||||
CheckBoxC2_1->setChecked(FALSE) ;
|
CheckBoxC2_1->setChecked(FALSE) ;
|
||||||
myGeomGUI->GetDesktop()->putInfo( tr("GEOM_PRP_ABORT") ) ;
|
QAD_Application::getDesktop()->putInfo( tr("GEOM_PRP_ABORT") ) ;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
QApplication::setOverrideCursor( Qt::waitCursor );
|
QApplication::setOverrideCursor( Qt::waitCursor );
|
||||||
@ -480,9 +480,9 @@ void RepairGUI_SuppressHoleDlg::ClickOnApply()
|
|||||||
|
|
||||||
|
|
||||||
if( !testResult )
|
if( !testResult )
|
||||||
myGeomGUI->GetDesktop()->putInfo( tr("GEOM_PRP_ABORT") ) ;
|
QAD_Application::getDesktop()->putInfo( tr("GEOM_PRP_ABORT") ) ;
|
||||||
else
|
else
|
||||||
myGeomGUI->GetDesktop()->putInfo( tr("GEOM_PRP_DONE") ) ;
|
QAD_Application::getDesktop()->putInfo( tr("GEOM_PRP_DONE") ) ;
|
||||||
|
|
||||||
/* Reset arguments to allow a new selection */
|
/* Reset arguments to allow a new selection */
|
||||||
this->ResetStateOfDialog() ;
|
this->ResetStateOfDialog() ;
|
||||||
@ -498,11 +498,11 @@ void RepairGUI_SuppressHoleDlg::ClickOnApply()
|
|||||||
void RepairGUI_SuppressHoleDlg::ClickOnClose()
|
void RepairGUI_SuppressHoleDlg::ClickOnClose()
|
||||||
{
|
{
|
||||||
disconnect( mySelection, 0, this, 0 );
|
disconnect( mySelection, 0, this, 0 );
|
||||||
myGeomGUI->ResetState() ;
|
//myGeomGUI->ResetState() ;
|
||||||
|
|
||||||
if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) {
|
if ( QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) {
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
myIC = v3d->getAISContext(); // myIC = myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getViewerOCC()->getAISContext();
|
myIC = v3d->getAISContext(); // myIC = QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getViewerOCC()->getAISContext();
|
||||||
if(myUseLocalContext) {
|
if(myUseLocalContext) {
|
||||||
myIC->CloseLocalContext(myLocalContextId) ;
|
myIC->CloseLocalContext(myLocalContextId) ;
|
||||||
this->myUseLocalContext = false ;
|
this->myUseLocalContext = false ;
|
||||||
@ -560,7 +560,7 @@ void RepairGUI_SuppressHoleDlg::SelectionIntoArgument()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( IO->hasEntry() ) {
|
if ( IO->hasEntry() ) {
|
||||||
SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
|
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
|
||||||
SALOMEDS::SObject_var obj = aStudy->FindObjectID( IO->getEntry() );
|
SALOMEDS::SObject_var obj = aStudy->FindObjectID( IO->getEntry() );
|
||||||
SALOMEDS::GenericAttribute_var anAttr;
|
SALOMEDS::GenericAttribute_var anAttr;
|
||||||
SALOMEDS::AttributeIOR_var anIOR;
|
SALOMEDS::AttributeIOR_var anIOR;
|
||||||
@ -656,7 +656,7 @@ void RepairGUI_SuppressHoleDlg::DeactivateActiveDialog()
|
|||||||
GroupC2->setEnabled(false) ;
|
GroupC2->setEnabled(false) ;
|
||||||
GroupButtons->setEnabled(false) ;
|
GroupButtons->setEnabled(false) ;
|
||||||
|
|
||||||
myGeomGUI->ResetState() ;
|
//myGeomGUI->ResetState() ;
|
||||||
myGeomGUI->SetActiveDialogBox(0) ;
|
myGeomGUI->SetActiveDialogBox(0) ;
|
||||||
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
||||||
myDisplayGUI->OnDisplayAll(true) ;
|
myDisplayGUI->OnDisplayAll(true) ;
|
||||||
@ -719,13 +719,13 @@ void RepairGUI_SuppressHoleDlg::ActivateUserFaceSelection()
|
|||||||
{
|
{
|
||||||
if( !this->myOkShape ) {
|
if( !this->myOkShape ) {
|
||||||
this->ResetStateOfDialog() ;
|
this->ResetStateOfDialog() ;
|
||||||
myGeomGUI->GetDesktop()->putInfo( tr("GEOM_MAIN_OBJECT") ) ;
|
QAD_Application::getDesktop()->putInfo( tr("GEOM_MAIN_OBJECT") ) ;
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Test the viewer type VTK */
|
/* Test the viewer type VTK */
|
||||||
if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC ) {
|
if ( QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC ) {
|
||||||
myGeomGUI->GetDesktop()->putInfo( tr("GEOM_PRP_NOT_FOR_VTK_VIEWER") ) ;
|
QAD_Application::getDesktop()->putInfo( tr("GEOM_PRP_NOT_FOR_VTK_VIEWER") ) ;
|
||||||
this->ResetStateOfDialog() ;
|
this->ResetStateOfDialog() ;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -736,7 +736,7 @@ void RepairGUI_SuppressHoleDlg::ActivateUserFaceSelection()
|
|||||||
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
||||||
myDisplayGUI->PrepareSubShapeSelection( int(TopAbs_FACE), this->myLocalContextId ) ;
|
myDisplayGUI->PrepareSubShapeSelection( int(TopAbs_FACE), this->myLocalContextId ) ;
|
||||||
myUseLocalContext = true ;
|
myUseLocalContext = true ;
|
||||||
myGeomGUI->GetDesktop()->putInfo( tr("GEOM_SUPPRESSHOLE_SELECTFACE") ) ;
|
QAD_Application::getDesktop()->putInfo( tr("GEOM_SUPPRESSHOLE_SELECTFACE") ) ;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this->ResetPartial() ;
|
this->ResetPartial() ;
|
||||||
@ -756,13 +756,13 @@ void RepairGUI_SuppressHoleDlg::ActivateUserWireSelection()
|
|||||||
|
|
||||||
if( !this->myOkShape ) {
|
if( !this->myOkShape ) {
|
||||||
this->ResetStateOfDialog() ;
|
this->ResetStateOfDialog() ;
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_MAIN_OBJECT") ) ;
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_MAIN_OBJECT") ) ;
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Test the type of viewer VTK */
|
/* Test the type of viewer VTK */
|
||||||
if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC ) {
|
if ( QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC ) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NOT_FOR_VTK_VIEWER") ) ;
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NOT_FOR_VTK_VIEWER") ) ;
|
||||||
this->ResetStateOfDialog() ;
|
this->ResetStateOfDialog() ;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -777,7 +777,7 @@ void RepairGUI_SuppressHoleDlg::ActivateUserWireSelection()
|
|||||||
if( !aTest || myListOfIdFace->length() != 1 ) {
|
if( !aTest || myListOfIdFace->length() != 1 ) {
|
||||||
CheckBox1->setChecked(FALSE) ;
|
CheckBox1->setChecked(FALSE) ;
|
||||||
myOkSelectFace = false ;
|
myOkSelectFace = false ;
|
||||||
myGeomGUI->GetDesktop()->putInfo( tr("GEOM_PRP_ABORT") ) ;
|
QAD_Application::getDesktop()->putInfo( tr("GEOM_PRP_ABORT") ) ;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
myOkSelectFace = true ;
|
myOkSelectFace = true ;
|
||||||
@ -797,7 +797,7 @@ void RepairGUI_SuppressHoleDlg::ActivateUserWireSelection()
|
|||||||
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
||||||
myDisplayGUI->PrepareSubShapeSelectionArgumentShape( this->myFace, int(TopAbs_WIRE), this->myLocalContextId ) ;
|
myDisplayGUI->PrepareSubShapeSelectionArgumentShape( this->myFace, int(TopAbs_WIRE), this->myLocalContextId ) ;
|
||||||
myUseLocalContext = true ;
|
myUseLocalContext = true ;
|
||||||
myGeomGUI->GetDesktop()->putInfo( tr("GEOM_SUPPRESSHOLE_SELECTWIRE") ) ;
|
QAD_Application::getDesktop()->putInfo( tr("GEOM_SUPPRESSHOLE_SELECTWIRE") ) ;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this->ResetPartial() ;
|
this->ResetPartial() ;
|
||||||
@ -818,13 +818,13 @@ void RepairGUI_SuppressHoleDlg::ActivateUserEndFaceSelection()
|
|||||||
|
|
||||||
if( !this->myOkShape ) {
|
if( !this->myOkShape ) {
|
||||||
this->ResetStateOfDialog() ;
|
this->ResetStateOfDialog() ;
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_MAIN_OBJECT") ) ;
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_MAIN_OBJECT") ) ;
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Test the type of viewer VTK */
|
/* Test the type of viewer VTK */
|
||||||
if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC ) {
|
if ( QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC ) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NOT_FOR_VTK_VIEWER") ) ;
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NOT_FOR_VTK_VIEWER") ) ;
|
||||||
this->ResetStateOfDialog() ;
|
this->ResetStateOfDialog() ;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -840,7 +840,7 @@ void RepairGUI_SuppressHoleDlg::ActivateUserEndFaceSelection()
|
|||||||
if( !aTest || myListOfIdWire->length() != 1 ) {
|
if( !aTest || myListOfIdWire->length() != 1 ) {
|
||||||
CheckBox2->setChecked(FALSE) ;
|
CheckBox2->setChecked(FALSE) ;
|
||||||
CheckBox3->setChecked(FALSE) ;
|
CheckBox3->setChecked(FALSE) ;
|
||||||
myGeomGUI->GetDesktop()->putInfo( tr("GEOM_PRP_ABORT") ) ;
|
QAD_Application::getDesktop()->putInfo( tr("GEOM_PRP_ABORT") ) ;
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -855,7 +855,7 @@ void RepairGUI_SuppressHoleDlg::ActivateUserEndFaceSelection()
|
|||||||
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
||||||
myDisplayGUI->PrepareSubShapeSelectionArgumentShape( this->myShape, int(TopAbs_FACE), this->myLocalContextId ) ;
|
myDisplayGUI->PrepareSubShapeSelectionArgumentShape( this->myShape, int(TopAbs_FACE), this->myLocalContextId ) ;
|
||||||
myUseLocalContext = true ;
|
myUseLocalContext = true ;
|
||||||
myGeomGUI->GetDesktop()->putInfo( tr("GEOM_SUPPRESSHOLE_SELECTFACE_END") ) ;
|
QAD_Application::getDesktop()->putInfo( tr("GEOM_SUPPRESSHOLE_SELECTFACE_END") ) ;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this->ResetPartial() ;
|
this->ResetPartial() ;
|
||||||
@ -877,13 +877,13 @@ void RepairGUI_SuppressHoleDlg::ActivateUserWiresOnFaceShellSelection()
|
|||||||
|
|
||||||
if( !this->myOkShape ) {
|
if( !this->myOkShape ) {
|
||||||
this->ResetStateOfDialog() ;
|
this->ResetStateOfDialog() ;
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_MAIN_OBJECT") ) ;
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_MAIN_OBJECT") ) ;
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Test the type of viewer VTK */
|
/* Test the type of viewer VTK */
|
||||||
if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC ) {
|
if ( QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC ) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NOT_FOR_VTK_VIEWER") ) ;
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NOT_FOR_VTK_VIEWER") ) ;
|
||||||
this->ResetStateOfDialog() ;
|
this->ResetStateOfDialog() ;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -893,7 +893,7 @@ void RepairGUI_SuppressHoleDlg::ActivateUserWiresOnFaceShellSelection()
|
|||||||
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
DisplayGUI* myDisplayGUI = new DisplayGUI();
|
||||||
myDisplayGUI->PrepareSubShapeSelectionArgumentShape( this->myShape, int(TopAbs_WIRE), this->myLocalContextId ) ;
|
myDisplayGUI->PrepareSubShapeSelectionArgumentShape( this->myShape, int(TopAbs_WIRE), this->myLocalContextId ) ;
|
||||||
myUseLocalContext = true ;
|
myUseLocalContext = true ;
|
||||||
myGeomGUI->GetDesktop()->putInfo( tr("GEOM_SUPPRESSHOLE_SELECT_HOLES_ON_FACE") ) ;
|
QAD_Application::getDesktop()->putInfo( tr("GEOM_SUPPRESSHOLE_SELECT_HOLES_ON_FACE") ) ;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this->ResetPartial() ;
|
this->ResetPartial() ;
|
||||||
@ -966,9 +966,9 @@ void RepairGUI_SuppressHoleDlg::ResetPartial()
|
|||||||
myListOfIdEndFace->length(0) ;
|
myListOfIdEndFace->length(0) ;
|
||||||
|
|
||||||
/* Close its local contact if opened */
|
/* Close its local contact if opened */
|
||||||
if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) {
|
if ( QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) {
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
myIC = v3d->getAISContext(); // myIC = myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getViewerOCC()->getAISContext();
|
myIC = v3d->getAISContext(); // myIC = QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getViewerOCC()->getAISContext();
|
||||||
if( this->myUseLocalContext ) {
|
if( this->myUseLocalContext ) {
|
||||||
myIC->CloseLocalContext(this->myLocalContextId) ;
|
myIC->CloseLocalContext(this->myLocalContextId) ;
|
||||||
this->myUseLocalContext = false ;
|
this->myUseLocalContext = false ;
|
||||||
@ -989,10 +989,10 @@ void RepairGUI_SuppressHoleDlg::ResetPartial()
|
|||||||
bool RepairGUI_SuppressHoleDlg::GetIndexSubShapeSelected(const TopoDS_Shape& ShapeTopo, const int SubShapeType, GEOM::GEOM_Shape::ListOfSubShapeID& ListOfID, Standard_Integer& aLocalContextId, bool& myUseLocalContext)
|
bool RepairGUI_SuppressHoleDlg::GetIndexSubShapeSelected(const TopoDS_Shape& ShapeTopo, const int SubShapeType, GEOM::GEOM_Shape::ListOfSubShapeID& ListOfID, Standard_Integer& aLocalContextId, bool& myUseLocalContext)
|
||||||
{
|
{
|
||||||
//* Test the type of viewer */
|
//* Test the type of viewer */
|
||||||
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
|
|
||||||
ic->InitSelected();
|
ic->InitSelected();
|
||||||
|
@ -57,21 +57,15 @@ LIB_MOC = \
|
|||||||
TransformationGUI_MirrorDlg.h \
|
TransformationGUI_MirrorDlg.h \
|
||||||
TransformationGUI_ScaleDlg.h
|
TransformationGUI_ScaleDlg.h
|
||||||
|
|
||||||
LIB_CLIENT_IDL = SALOME_Exception.idl \
|
LIB_CLIENT_IDL =
|
||||||
GEOM_Gen.idl \
|
|
||||||
GEOM_Shape.idl \
|
|
||||||
SALOMEDS.idl \
|
|
||||||
SALOMEDS_Attributes.idl \
|
|
||||||
SALOME_ModuleCatalog.idl \
|
|
||||||
SALOME_Component.idl \
|
|
||||||
|
|
||||||
LIB_SERVER_IDL =
|
LIB_SERVER_IDL =
|
||||||
|
|
||||||
# additionnal information to compil and link file
|
# additionnal information to compil and link file
|
||||||
|
|
||||||
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
||||||
CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
|
CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
|
||||||
|
|
||||||
LDFLAGS += -lOCCViewer -lVTKViewer -lSalomeObject -lSalomeGUI -lGEOMClient -lGEOMObject -lGEOMFiltersSelection -lDlgRef -lGEOMContext -lGEOMBase -L${KERNEL_ROOT_DIR}/lib/salome
|
LDFLAGS += -lGEOMFiltersSelection -lGEOMBase
|
||||||
|
|
||||||
@CONCLUDE@
|
@CONCLUDE@
|
||||||
|
@ -68,7 +68,7 @@ bool TransformationGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
|||||||
{
|
{
|
||||||
TransformationGUI* myTransformationGUI = new TransformationGUI();
|
TransformationGUI* myTransformationGUI = new TransformationGUI();
|
||||||
myTransformationGUI->myGeomGUI->EmitSignalDeactivateDialog();
|
myTransformationGUI->myGeomGUI->EmitSignalDeactivateDialog();
|
||||||
SALOME_Selection* Sel = SALOME_Selection::Selection(myTransformationGUI->myGeomGUI->GetActiveStudy()->getSelection());
|
SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection());
|
||||||
|
|
||||||
switch (theCommandID)
|
switch (theCommandID)
|
||||||
{
|
{
|
||||||
@ -121,12 +121,12 @@ void TransformationGUI::MakeTranslationAndDisplay(GEOM::GEOM_Shape_ptr Shape, gp
|
|||||||
try {
|
try {
|
||||||
GEOM::GEOM_Shape_var result = myGeom->MakeTranslation(Shape, V.X(), V.Y(), V.Z());
|
GEOM::GEOM_Shape_var result = myGeom->MakeTranslation(Shape, V.X(), V.Y(), V.Z());
|
||||||
if(result->_is_nil()) {
|
if(result->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
result->NameType(Shape->NameType());
|
result->NameType(Shape->NameType());
|
||||||
if(myGeomBase->Display(result))
|
if(myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -147,12 +147,12 @@ void TransformationGUI::MakeRotationAndDisplay(GEOM::GEOM_Shape_ptr Shape, const
|
|||||||
dir.X(), dir.Y(), dir.Z());
|
dir.X(), dir.Y(), dir.Z());
|
||||||
GEOM::GEOM_Shape_var result = myGeom->MakeRotation(Shape, axis, angle);
|
GEOM::GEOM_Shape_var result = myGeom->MakeRotation(Shape, axis, angle);
|
||||||
if(result->_is_nil()) {
|
if(result->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
result->NameType(Shape->NameType());
|
result->NameType(Shape->NameType());
|
||||||
if(myGeomBase->Display(result))
|
if(myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -170,12 +170,12 @@ void TransformationGUI::MakeMirrorAndDisplay(GEOM::GEOM_Shape_ptr Shape1, GEOM::
|
|||||||
try {
|
try {
|
||||||
GEOM::GEOM_Shape_var result = myGeom->MakeMirrorByPlane(Shape1, Shape2);
|
GEOM::GEOM_Shape_var result = myGeom->MakeMirrorByPlane(Shape1, Shape2);
|
||||||
if(result->_is_nil()) {
|
if(result->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
result->NameType(Shape1->NameType());
|
result->NameType(Shape1->NameType());
|
||||||
if(myGeomBase->Display(result))
|
if(myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -196,9 +196,9 @@ void TransformationGUI::MakeScaleAndDisplay(GEOM::GEOM_Shape_ptr Shape, const gp
|
|||||||
GEOM::GEOM_Shape_var result = myGeom->MakeScaleTransform(Shape, P, factor);
|
GEOM::GEOM_Shape_var result = myGeom->MakeScaleTransform(Shape, P, factor);
|
||||||
result->NameType(Shape->NameType());
|
result->NameType(Shape->NameType());
|
||||||
if(myGeomBase->Display(result))
|
if(myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
else
|
else
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -220,12 +220,12 @@ void TransformationGUI::MakeMultiTranslation1DAndDisplay(GEOM::GEOM_Shape_ptr Sh
|
|||||||
|
|
||||||
GEOM::GEOM_Shape_var result = myGeom->MakeMultiTranslation1D(Shape, dstruct, Step, NbTimes);
|
GEOM::GEOM_Shape_var result = myGeom->MakeMultiTranslation1D(Shape, dstruct, Step, NbTimes);
|
||||||
if(result->_is_nil()) {
|
if(result->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
result->NameType(tr("GEOM_COMPOUND"));
|
result->NameType(tr("GEOM_COMPOUND"));
|
||||||
if(myGeomBase->Display(result))
|
if(myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -251,12 +251,12 @@ void TransformationGUI::MakeMultiTranslation2DAndDisplay(GEOM::GEOM_Shape_ptr Sh
|
|||||||
GEOM::GEOM_Shape_var result = myGeom->MakeMultiTranslation2D(Shape, dstruct1, Step1, NbTimes1,
|
GEOM::GEOM_Shape_var result = myGeom->MakeMultiTranslation2D(Shape, dstruct1, Step1, NbTimes1,
|
||||||
dstruct2, Step2, NbTimes2);
|
dstruct2, Step2, NbTimes2);
|
||||||
if(result->_is_nil()) {
|
if(result->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
result->NameType(tr("GEOM_COMPOUND"));
|
result->NameType(tr("GEOM_COMPOUND"));
|
||||||
if(myGeomBase->Display(result))
|
if(myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -279,12 +279,12 @@ void TransformationGUI::MakeMultiRotation1DAndDisplay(GEOM::GEOM_Shape_ptr Shape
|
|||||||
|
|
||||||
GEOM::GEOM_Shape_var result = myGeom->MakeMultiRotation1D(Shape, dstruct, pstruct, NbTimes);
|
GEOM::GEOM_Shape_var result = myGeom->MakeMultiRotation1D(Shape, dstruct, pstruct, NbTimes);
|
||||||
if(result->_is_nil()) {
|
if(result->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
result->NameType(tr("GEOM_COMPOUND"));
|
result->NameType(tr("GEOM_COMPOUND"));
|
||||||
if(myGeomBase->Display(result))
|
if(myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
@ -309,12 +309,12 @@ void TransformationGUI::MakeMultiRotation2DAndDisplay(GEOM::GEOM_Shape_ptr Shape
|
|||||||
GEOM::GEOM_Shape_var result = myGeom->MakeMultiRotation2D(Shape, dstruct, pstruct,
|
GEOM::GEOM_Shape_var result = myGeom->MakeMultiRotation2D(Shape, dstruct, pstruct,
|
||||||
Ang, NbTimes1, Step, NbTimes2);
|
Ang, NbTimes1, Step, NbTimes2);
|
||||||
if(result->_is_nil()) {
|
if(result->_is_nil()) {
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
result->NameType(tr("GEOM_COMPOUND"));
|
result->NameType(tr("GEOM_COMPOUND"));
|
||||||
if(myGeomBase->Display(result))
|
if(myGeomBase->Display(result))
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& S_ex) {
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
QtCatchCorbaException(S_ex);
|
QtCatchCorbaException(S_ex);
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#define TRANSFORMATIONGUI_H
|
#define TRANSFORMATIONGUI_H
|
||||||
|
|
||||||
#include "GEOMBase.h"
|
#include "GEOMBase.h"
|
||||||
|
#include <gp_Vec.hxx>
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : TransformationGUI
|
// class : TransformationGUI
|
||||||
|
@ -131,7 +131,7 @@ void TransformationGUI_MirrorDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void TransformationGUI_MirrorDlg::ClickOnApply()
|
void TransformationGUI_MirrorDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
if (mySimulationTopoDs.IsNull())
|
if (mySimulationTopoDs.IsNull())
|
||||||
return;
|
return;
|
||||||
myGeomBase->EraseSimulationShape();
|
myGeomBase->EraseSimulationShape();
|
||||||
|
@ -29,8 +29,7 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
#include "TransformationGUI_MultiRotationDlg.h"
|
#include "TransformationGUI_MultiRotationDlg.h"
|
||||||
|
|
||||||
#include "QAD_Config.h"
|
#include <gp_Lin.hxx>
|
||||||
|
|
||||||
#include <Precision.hxx>
|
#include <Precision.hxx>
|
||||||
#include <BRepBuilderAPI_MakeVertex.hxx>
|
#include <BRepBuilderAPI_MakeVertex.hxx>
|
||||||
#include <GeomAPI_ProjectPointOnCurve.hxx>
|
#include <GeomAPI_ProjectPointOnCurve.hxx>
|
||||||
@ -41,6 +40,7 @@ using namespace std;
|
|||||||
#include <TopoDS_Compound.hxx>
|
#include <TopoDS_Compound.hxx>
|
||||||
#include <Geom_Line.hxx>
|
#include <Geom_Line.hxx>
|
||||||
#include <BRepBuilderAPI_Transform.hxx>
|
#include <BRepBuilderAPI_Transform.hxx>
|
||||||
|
#include "QAD_Config.h"
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : TransformationGUI_MultiRotationDlg()
|
// class : TransformationGUI_MultiRotationDlg()
|
||||||
@ -258,7 +258,7 @@ void TransformationGUI_MultiRotationDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void TransformationGUI_MultiRotationDlg::ClickOnApply()
|
void TransformationGUI_MultiRotationDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
if (mySimulationTopoDs.IsNull())
|
if (mySimulationTopoDs.IsNull())
|
||||||
return;
|
return;
|
||||||
myGeomBase->EraseSimulationShape();
|
myGeomBase->EraseSimulationShape();
|
||||||
|
@ -29,8 +29,7 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
#include "TransformationGUI_MultiTranslationDlg.h"
|
#include "TransformationGUI_MultiTranslationDlg.h"
|
||||||
|
|
||||||
#include "QAD_Config.h"
|
#include <gp_Lin.hxx>
|
||||||
|
|
||||||
#include <BRepBuilderAPI_MakeVertex.hxx>
|
#include <BRepBuilderAPI_MakeVertex.hxx>
|
||||||
#include <BRepBuilderAPI_Transform.hxx>
|
#include <BRepBuilderAPI_Transform.hxx>
|
||||||
#include <BRepAdaptor_Curve.hxx>
|
#include <BRepAdaptor_Curve.hxx>
|
||||||
@ -38,6 +37,7 @@ using namespace std;
|
|||||||
#include <BRepGProp.hxx>
|
#include <BRepGProp.hxx>
|
||||||
#include <GProp_GProps.hxx>
|
#include <GProp_GProps.hxx>
|
||||||
#include <TopoDS_Compound.hxx>
|
#include <TopoDS_Compound.hxx>
|
||||||
|
#include "QAD_Config.h"
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : TransformationGUI_MultiTranslationDlg()
|
// class : TransformationGUI_MultiTranslationDlg()
|
||||||
@ -269,7 +269,7 @@ void TransformationGUI_MultiTranslationDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void TransformationGUI_MultiTranslationDlg::ClickOnApply()
|
void TransformationGUI_MultiTranslationDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
if (mySimulationTopoDs.IsNull())
|
if (mySimulationTopoDs.IsNull())
|
||||||
return;
|
return;
|
||||||
myGeomBase->EraseSimulationShape();
|
myGeomBase->EraseSimulationShape();
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
#include "TransformationGUI_RotationDlg.h"
|
#include "TransformationGUI_RotationDlg.h"
|
||||||
|
|
||||||
|
#include <gp_Lin.hxx>
|
||||||
#include <BRepBuilderAPI_Transform.hxx>
|
#include <BRepBuilderAPI_Transform.hxx>
|
||||||
#include <BRepAdaptor_Curve.hxx>
|
#include <BRepAdaptor_Curve.hxx>
|
||||||
|
|
||||||
@ -141,7 +142,7 @@ void TransformationGUI_RotationDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void TransformationGUI_RotationDlg::ClickOnApply()
|
void TransformationGUI_RotationDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
if (mySimulationTopoDs.IsNull())
|
if (mySimulationTopoDs.IsNull())
|
||||||
return;
|
return;
|
||||||
myGeomBase->EraseSimulationShape();
|
myGeomBase->EraseSimulationShape();
|
||||||
|
@ -140,7 +140,7 @@ void TransformationGUI_ScaleDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void TransformationGUI_ScaleDlg::ClickOnApply()
|
void TransformationGUI_ScaleDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
if (mySimulationTopoDs.IsNull())
|
if (mySimulationTopoDs.IsNull())
|
||||||
return;
|
return;
|
||||||
myGeomBase->EraseSimulationShape();
|
myGeomBase->EraseSimulationShape();
|
||||||
|
@ -148,7 +148,7 @@ void TransformationGUI_TranslationDlg::ClickOnOk()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void TransformationGUI_TranslationDlg::ClickOnApply()
|
void TransformationGUI_TranslationDlg::ClickOnApply()
|
||||||
{
|
{
|
||||||
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
QAD_Application::getDesktop()->putInfo(tr(""));
|
||||||
if (mySimulationTopoDs.IsNull())
|
if (mySimulationTopoDs.IsNull())
|
||||||
return;
|
return;
|
||||||
myGeomBase->EraseSimulationShape();
|
myGeomBase->EraseSimulationShape();
|
||||||
|
Loading…
Reference in New Issue
Block a user