<endsubmenu />
<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=""/>
- <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=""/>
<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="">
<!-- ********************************* Settings (menubar) ********************************* -->
<menu-item label-id="Preferences" item-id="4" pos-id="">
<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="412" pos-id="" label-id="Name/Store automatic" 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=""/>
<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="414" 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="412" pos-id="" label-id="Shading Color" 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="414" pos-id="" label-id="Step value" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</submenu>
<endsubmenu />
<separator pos-id="-1"/>
<popup-item item-id="901" pos-id="" label-id="Rename" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</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 -->
</application> <!-- APPLICATION END -->
{
BasicGUI* myBasicGUI = new BasicGUI();
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)
{
case 4011: // POINT
{
Handle(AIS_InteractiveContext) ic;
- if(myBasicGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myBasicGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
ic = v3d->getAISContext();
}
BasicGUI_PointDlg *aDlg = new BasicGUI_PointDlg(parent, "", myBasicGUI, Sel, ic);
{
BasicGUI* myBasicGUI = new BasicGUI();
- if(myBasicGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
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();
OCCViewer_ViewPort* vp = ((OCCViewer_ViewFrame*)studyFrame->getRightFrame()->getViewFrame())->getViewPort();
if(DialogPt != 0)
DialogPt->PointIntoCoordinates(thePoint, true); /* display point */
else
- myBasicGUI->myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
return false;
}
GEOM::GEOM_Shape_var P = myGeom->MakeVertex(x, y, z);
P->NameType(tr("GEOM_VERTEX"));
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) {
QtCatchCorbaException(S_ex);
myGeomBase->GetBipointDxDyDz(InitPoint, LastPoint, dx, dy, dz);
Standard_Real length = InitPoint.Distance(LastPoint);
if(length <= Precision::Confusion()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
return;
}
GEOM::GEOM_Shape_ptr result = myGeom->MakeLine(pstruct, dstruct);
if(result->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
return;
}
result->NameType(tr("GEOM_LINE"));
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) {
QtCatchCorbaException(S_ex);
GEOM::GEOM_Shape_var result = myGeom->MakeCircle(pstruct, dstruct, Radius);
if(result->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
return;
}
result->NameType(tr("GEOM_CIRCLE"));
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) {
QtCatchCorbaException(S_ex);
GEOM::GEOM_Shape_var result = myGeom->MakeEllipse(pstruct, dstruct, Major_Radius, Minor_Radius);
if(result->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
return;
}
result->NameType(tr("GEOM_ELLIPSE"));
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) {
QtCatchCorbaException(S_ex);
GEOM::PointStruct pE = myGeom->MakePointStruct(EndPoint.X(), EndPoint.Y(), EndPoint.Z());
GEOM::GEOM_Shape_var result = myGeom->MakeArc(pI, pC, pE);
if(result->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
return;
}
result->NameType(tr("GEOM_ARC"));
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) {
QtCatchCorbaException(S_ex);
GEOM::GEOM_Shape_var Vector = myGeom->MakeVector(pstruct1, pstruct2);
Vector->NameType(tr("GEOM_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) {
QtCatchCorbaException(S_ex);
GEOM::GEOM_Shape_ptr plane = myGeom->MakePlane(pstruct, dstruct, TrimSize);
plane->NameType(tr("GEOM_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) {
QtCatchCorbaException(S_ex);
//=======================================================================
void BasicGUI::MakeWorkingPlane(const gp_Pnt P, const gp_Dir D)
{
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() != VIEW_OCC) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NOT_FOR_VTK_VIEWER"));
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() != VIEW_OCC) {
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NOT_FOR_VTK_VIEWER"));
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();
view3d->SetAt(P.X(), P.Y(), P.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;
}
//=================================================================================
void BasicGUI_ArcDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
myGeomBase->EraseSimulationShape();
using namespace std;
#include "BasicGUI_CircleDlg.h"
+#include <gp_Lin.hxx>
+#include <gp_Circ.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepAdaptor_Curve.hxx>
#include "QAD_Config.h"
//=================================================================================
void BasicGUI_CircleDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
myGeomBase->EraseSimulationShape();
using namespace std;
#include "BasicGUI_EllipseDlg.h"
-#include "gp_Elips.hxx"
-#include "QAD_Config.h"
-
+#include <gp_Lin.hxx>
+#include <gp_Elips.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepAdaptor_Curve.hxx>
+#include "QAD_Config.h"
//=================================================================================
// class : BasicGUI_EllipseDlg()
//=================================================================================
void BasicGUI_EllipseDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
myGeomBase->EraseSimulationShape();
//=================================================================================
void BasicGUI_LineDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
myGeomBase->EraseSimulationShape();
//=================================================================================
void BasicGUI_PlaneDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
myGeomBase->EraseSimulationShape();
#include <BRepAlgoAPI.hxx>
#include <Geom_Curve.hxx>
-#include "QAD_Config.h"
-
//=================================================================================
// class : BasicGUI_PointDlg()
// purpose : Constructs a BasicGUI_PointDlg which is a child of 'parent', with the
myPoint.SetCoord(0.0, 0.0, 0.0);
myOkEdge = false;
- myGeomGUI->SetState(POINT_METHOD);
+ myGeomGUI->myState = 0;
/* Vertices Filter for all arguments */
myEdgeFilter = new GEOM_ShapeTypeFilter(TopAbs_EDGE, myGeom);
GroupPoints->SpinBox_DY->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();
- myGeomBase->SetDisplayedObjectList();
+ //myGeomBase->SetDisplayedObjectList();
/* sub shapes selection */
myLocalContextMode = TopAbs_VERTEX;
myIC->ActivateStandardMode(myLocalContextMode);
{
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();
- myGeomBase->SetDisplayedObjectList();
+ //myGeomBase->SetDisplayedObjectList();
/* sub shapes selection */
myLocalContextMode = TopAbs_VERTEX;
myIC->ActivateStandardMode(myLocalContextMode);
}
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);
myUseLocalContext = false;
}
//=================================================================================
void BasicGUI_PointDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if(mySimulationTopoDs.IsNull())
return;
myGeomBase->EraseSimulationShape();
mySimulationTopoDs.Nullify();
/* Close local context */
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
myIC->CloseLocalContext(myLocalContextId);
myUseLocalContext = false;
}
double z = GroupPoints->SpinBox_DZ->GetValue();
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 */
myLocalContextId = myIC->OpenLocalContext();
- myGeomBase->SetDisplayedObjectList();
+ //myGeomBase->SetDisplayedObjectList();
/* sub shapes selection */
myLocalContextMode = TopAbs_VERTEX;
myIC->ActivateStandardMode(myLocalContextMode);
//=======================================================================
void BasicGUI_PointDlg::ClickOnCancel()
{
- if(myConstructorId == 0 && myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ if(myConstructorId == 0 && QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
myIC = v3d->getAISContext();
if(myIC->HasOpenedContext()) {
myIC->CloseLocalContext(myLocalContextId);
}
}
+ myGeomGUI->myState = -1;
GEOMBase_Skeleton::ClickOnCancel();
return;
}
GEOMBase_Skeleton::ActivateThisDialog();
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
- myGeomGUI->SetState(POINT_METHOD);
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ myGeomGUI->myState = 0;
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
myIC = v3d->getAISContext();
myLocalContextId = myIC->OpenLocalContext();
- myGeomBase->SetDisplayedObjectList();
+ //myGeomBase->SetDisplayedObjectList();
/* sub shapes selection */
myLocalContextMode = TopAbs_VERTEX;
myIC->ActivateStandardMode(myLocalContextMode);
//=================================================================================
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);
myUseLocalContext = false;
}
+ myGeomGUI->myState = -1;
GEOMBase_Skeleton::DeactivateActiveDialog();
return;
}
//=================================================================================
void BasicGUI_VectorDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
myGeomBase->EraseSimulationShape();
//=================================================================================
void BasicGUI_WorkingPlaneDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if(myOkPlane)
myBasicGUI->MakeWorkingPlane(myLoc, myDir);
BasicGUI_PlaneDlg.h \
BasicGUI_WorkingPlaneDlg.h
-LIB_CLIENT_IDL = SALOME_Exception.idl \
- GEOM_Gen.idl \
- GEOM_Shape.idl \
- SALOMEDS.idl \
- SALOMEDS_Attributes.idl \
- SALOME_ModuleCatalog.idl \
- SALOME_Component.idl \
+LIB_CLIENT_IDL =
LIB_SERVER_IDL =
# additionnal information to compil and link file
-CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
-CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
+CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -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@
{
BooleanGUI* myBooleanGUI = new BooleanGUI();
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)
{
try {
GEOM::GEOM_Shape_ptr result = myGeom->MakeBoolean(Shape1, Shape2, operation);
if(result->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
return;
}
result->NameType(type);
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) {
QtCatchCorbaException(S_ex);
//=================================================================================
void BooleanGUI_CommonDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if(myOkShape1 && myOkShape2)
myBooleanGUI->MakeBooleanAndDisplay(myGeomShape1 ,myGeomShape2, 1);
//=================================================================================
void BooleanGUI_CutDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if(myOkShape1 && myOkShape2)
myBooleanGUI->MakeBooleanAndDisplay(myGeomShape1 ,myGeomShape2, 2);
//=================================================================================
void BooleanGUI_FuseDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if(myOkShape1 && myOkShape2)
myBooleanGUI->MakeBooleanAndDisplay(myGeomShape1 ,myGeomShape2, 3);
//=================================================================================
void BooleanGUI_SectionDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if(myOkShape1 && myOkShape2)
myBooleanGUI->MakeBooleanAndDisplay(myGeomShape1 ,myGeomShape2, 4);
BooleanGUI_CutDlg.h \
BooleanGUI_SectionDlg.h
-LIB_CLIENT_IDL = SALOME_Exception.idl \
- GEOM_Gen.idl \
- GEOM_Shape.idl \
- SALOMEDS.idl \
- SALOMEDS_Attributes.idl \
- SALOME_ModuleCatalog.idl \
- SALOME_Component.idl \
+LIB_CLIENT_IDL =
LIB_SERVER_IDL =
# additionnal information to compil and link file
-CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
-CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
+CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -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@
{
BuildGUI* myBuildGUI = new BuildGUI();
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)
{
case 407: // EXPLODE : use ic
{
Handle(AIS_InteractiveContext) ic;
- if(myBuildGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myBuildGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
ic = v3d->getAISContext();
}
BuildGUI_SubShapeDlg *aDlg = new BuildGUI_SubShapeDlg(parent, "", myBuildGUI, Sel, ic);
GEOM::PointStruct ps2 = myGeom->MakePointStruct(P2.X(), P2.Y(), P2.Z());
GEOM::GEOM_Shape_var result = myGeom->MakeEdge(ps1, ps2);
if(result->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
return;
}
result->NameType(tr("GEOM_EDGE"));
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) {
QtCatchCorbaException(S_ex);
try {
GEOM::GEOM_Shape_var result = myGeom->MakeWire(listShapesIOR);
if(result->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
return;
}
result->NameType(tr("GEOM_WIRE"));
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) {
QtCatchCorbaException(S_ex);
try {
GEOM::GEOM_Shape_var result = myGeom->MakeFace(aWire, wantPlanar);
if(result->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
return;
}
if (wantPlanar)
else
result->NameType(tr("GEOM_FACE"));
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) {
QtCatchCorbaException(S_ex);
try {
GEOM::GEOM_Shape_var result = myGeom->MakeShell(listShapesIOR);
if(result->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
return;
}
result->NameType(tr("GEOM_SHELL"));
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) {
QtCatchCorbaException(S_ex);
try {
GEOM::GEOM_Shape_var result = myGeom->MakeSolid(listShapesIOR);
if(result->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
return;
}
result->NameType(tr("GEOM_SOLID"));
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) {
QtCatchCorbaException(S_ex);
try {
GEOM::GEOM_Shape_var result = myGeom->MakeCompound(listShapesIOR);
if(result->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
return;
}
result->NameType(tr("GEOM_COMPOUND"));
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) {
QtCatchCorbaException(S_ex);
//=====================================================================================
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::SObject_var RefSO;
SALOMEDS::GenericAttribute_var anAttr;
//=====================================================================================
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);
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;
}
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::AttributeName_var aName;
SALOMEDS::AttributeIOR_var anIOR;
try {
listGeomShapes = myGeom->SubShapeAll(aShape, SubShapeType);
if(listGeomShapes->length() < 1) {
- myGeomGUI->GetDesktop()->putInfo (tr("GEOM_PRP_ABORT"));
+ QAD_Application::getDesktop()->putInfo (tr("GEOM_PRP_ABORT"));
return false;
}
}
}
/* open transaction */
- QAD_Operation* op = new SALOMEGUI_ImportOperation(myGeomGUI->GetActiveStudy());
+ QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy());
op->start();
TopoDS_Shape mainTopo = myGeomGUI->GetShapeReader().GetShape(myGeom, aShape);
TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, aResult);
if (S.IsNull()) {
- myGeomGUI->GetDesktop()->putInfo (tr("GEOM_PRP_ABORT"));
+ QAD_Application::getDesktop()->putInfo (tr("GEOM_PRP_ABORT"));
return false;
}
bool allreadyexist = false;
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
Handle(GEOM_AISShape) result = new GEOM_AISShape(S, nameG);
ic->Display(result);
}
- else if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
- VTKViewer_RenderWindowInteractor* myRenderInter= ((VTKViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
+ else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
+ VTKViewer_RenderWindowInteractor* myRenderInter= ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
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();
Handle(GEOM_InteractiveObject) IO = new GEOM_InteractiveObject(aResult->Name(), myGeomGUI->GetFatherior(), "GEOM");
/* commit transaction */
op->finish();
- myGeomGUI->GetActiveStudy()->updateObjBrowser();
- myGeomGUI->GetDesktop()->putInfo (tr("GEOM_PRP_READY"));
+ QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser();
+ QAD_Application::getDesktop()->putInfo (tr("GEOM_PRP_READY"));
return true;
}
bool BuildGUI::OnSubShapeGetSelected(const TopoDS_Shape& ShapeTopo, const char* ShapeTopoIOR, const int SubShapeType, Standard_Integer& aLocalContextId, bool& myUseLocalContext)
{
//* Test the type of viewer */
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
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);
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;
}
- 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();
if( myUseLocalContext == false ) {
SALOMEDS::SObject_var SO = aStudy->FindObjectIOR(aResult->Name());
/* open transaction */
- QAD_Operation* op = new SALOMEGUI_ImportOperation(myGeomGUI->GetActiveStudy());
+ QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy());
op->start();
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::AttributeName_var aName;
SALOMEDS::AttributeIOR_var anIOR;
DisplayGUI* myDisplayGUI = new DisplayGUI();
myDisplayGUI->OnDisplayAll(true);
- myGeomGUI->GetActiveStudy()->updateObjBrowser();
- myGeomGUI->GetDesktop()->putInfo (tr("GEOM_PRP_READY"));
+ QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser();
+ QAD_Application::getDesktop()->putInfo (tr("GEOM_PRP_READY"));
return true;
}
#define BUILDGUI_H
#include "GEOMBase.h"
+#include <gp_Pnt.hxx>
//=================================================================================
// class : BuildGUI
//=================================================================================
void BuildGUI_CompoundDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if(myOkListShapes)
myBuildGUI->MakeCompoundAndDisplay(myListShapes);
return;
//=================================================================================
void BuildGUI_EdgeDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
myGeomBase->EraseSimulationShape();
//=================================================================================
void BuildGUI_FaceDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if(myOkShape)
myBuildGUI->MakeFaceAndDisplay(myGeomShape, GroupPoints->CheckButton1->isChecked());
return;
//=================================================================================
void BuildGUI_ShellDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if(myOkListShapes)
myBuildGUI->MakeShellAndDisplay(myListShapes);
//=================================================================================
void BuildGUI_SolidDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if(myOkListShapes)
myBuildGUI->MakeSolidAndDisplay(myListShapes);
#include "OCCViewer_Viewer3d.h"
#include <TopExp_Explorer.hxx>
+#include <TopTools_MapOfShape.hxx>
#include <qmessagebox.h>
myShapeType = GroupPoints->ComboBox1->currentItem();
myOkSelectSubMode = GroupPoints->CheckButton1->isChecked();
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() != VIEW_OCC)
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() != VIEW_OCC)
GroupPoints->CheckButton1->setEnabled(false);
/* signals and slots connections */
//=================================================================================
void BuildGUI_SubShapeDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
bool testResult = false;
myAbort = false; /* Not aborted by default */
testResult = myBuildGUI->OnSubShapeGetSelected(myShape, myShapeIOR, myShapeType, myLocalContextId, myUseLocalContext);
if(!testResult) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
myAbort = true;
}
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 ...*/
this->ResetStateOfDialog();
//=================================================================================
void BuildGUI_SubShapeDlg::ClickOnCancel()
{
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
myIC = v3d->getAISContext();
if(myUseLocalContext) {
myIC->CloseLocalContext(myLocalContextId);
return;
if(!IO->hasEntry()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
return;
}
myOkShape = true;
}
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::GenericAttribute_var anAttr;
SALOMEDS::AttributeIOR_var anIOR;
{
GEOMBase_Skeleton::ActivateThisDialog();
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);
else
GroupPoints->CheckButton1->setEnabled(false);
GroupPoints->CheckButton1->setChecked(FALSE);
/* Close its local contact if opened */
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
myIC = v3d->getAISContext();
if(myUseLocalContext) {
myIC->CloseLocalContext(myLocalContextId);
/* No sub shape selection if main shape not selected */
if(!myOkShape) {
this->ResetStateOfDialog();
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SELECT_FIRST"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SELECT_FIRST"));
return;
}
GroupPoints->CheckButton1->setChecked( FALSE );
//no meaning to allow user selection for type = shape
//TODO - add another message
- //myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SELECT_FIRST")) ;
+ //QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SELECT_FIRST")) ;
return;
}
myOkSelectSubMode = GroupPoints->CheckButton1->isChecked();
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
myIC = v3d->getAISContext();
if(myUseLocalContext) {
myDisplayGUI->OnDisplayAll(true);
}
else {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NOT_FOR_VTK_VIEWER"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NOT_FOR_VTK_VIEWER"));
return;
}
DisplayGUI* myDisplayGUI = new DisplayGUI();
myDisplayGUI->PrepareSubShapeSelection(myShapeType, myLocalContextId);
myUseLocalContext = true;
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SELECT_FACE"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SELECT_FACE"));
}
return;
}
GroupPoints->CheckButton1->setChecked(FALSE);
myOkSelectSubMode = FALSE;
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
myIC = v3d->getAISContext();
if(myUseLocalContext) {
//=================================================================================
void BuildGUI_WireDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if(myOkListShapes)
myBuildGUI->MakeWireAndDisplay(myListShapes);
return;
BuildGUI_SolidDlg.h \
BuildGUI_CompoundDlg.h
-LIB_CLIENT_IDL = SALOME_Exception.idl \
- GEOM_Gen.idl \
- GEOM_Shape.idl \
- SALOMEDS.idl \
- SALOMEDS_Attributes.idl \
- SALOME_ModuleCatalog.idl \
- SALOME_Component.idl \
+LIB_CLIENT_IDL =
LIB_SERVER_IDL =
# additionnal information to compil and link file
-CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
-CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
+CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -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@
{
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);
- 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();
if(themode==0) {
myRenderInter->SetDisplayMode(1);
- myDisplayGUI->myGeomGUI->GetDesktop()->menuBar()->changeItem(211, tr("GEOM_MEN_WIREFRAME"));
+ QAD_Application::getDesktop()->menuBar()->changeItem(211, tr("GEOM_MEN_WIREFRAME"));
}
else {
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();
}
- else if(myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
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();
AIS_DisplayMode mode = (AIS_DisplayMode)ic->DisplayMode();
AIS_DisplayMode newmode = (mode == AIS_WireFrame ? AIS_Shaded : AIS_WireFrame);
ic->SetDisplayMode(newmode, Standard_False);
if(newmode == 1)
- myDisplayGUI->myGeomGUI->GetDesktop()->menuBar()->changeItem(211, tr("GEOM_MEN_WIREFRAME"));
+ QAD_Application::getDesktop()->menuBar()->changeItem(211, tr("GEOM_MEN_WIREFRAME"));
else
- myDisplayGUI->myGeomGUI->GetDesktop()->menuBar()->changeItem(211, tr("GEOM_MEN_SHADING"));
+ QAD_Application::getDesktop()->menuBar()->changeItem(211, tr("GEOM_MEN_SHADING"));
QApplication::restoreOverrideCursor();
}
}
case 212: // MENU VIEW - DISPLAY ALL
{
- if(myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK)
- ((VTKViewer_ViewFrame*)myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor()->DisplayAll();
- else if(myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC)
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK)
+ ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor()->DisplayAll();
+ else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC)
myDisplayGUI->OnDisplayAll();
break;
}
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();
- else if(myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC)
+ else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC)
myDisplayGUI->OnDisplayOnly();
break;
}
case 214: // MENU VIEW - ERASE ALL
{
- if(myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK)
- ((VTKViewer_ViewFrame*)myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor()->EraseAll();
- else if(myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK)
+ ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor()->EraseAll();
+ else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
ic->EraseAll(Standard_True, Standard_False);
}
case 8031: // POPUP VIEWER - WIREFRAME/SHADING
{
- if(myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_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());
QApplication::setOverrideCursor(Qt::waitCursor);
myRenderInter->Render();
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);
- SALOME_Selection* Sel = SALOME_Selection::Selection(myDisplayGUI->myGeomGUI->GetActiveStudy()->getSelection());
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection());
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
SALOME_ListIteratorOfListIO It(Sel->StoredIObjects());
for(;It.More();It.Next()) {
{
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();
OCCViewer_Viewer3d* v3d;
Handle(AIS_InteractiveContext) ic;
vtkRenderer* Renderer;
- if(myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- v3d = ((OCCViewer_ViewFrame*)myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
ic = v3d->getAISContext();
}
- else if(myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
- Renderer = ((VTKViewer_ViewFrame*)myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer();
+ else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
+ Renderer = ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer();
}
else
return;
if(theIO.IsNull())
MESSAGE("BuildPresentation(): null SALOME_InteractiveObject passed")
- if(myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_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());
- 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::AttributeName_var aName;
// this SObject may be GEOM module root SObject
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()) {
while (anIter->More() && !useSubItems) {
SALOMEDS::SObject_var subobj = anIter->Value();
if(obj->FindAttribute(anAttr, "AttributeName")) {
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();
theAllActors->InitTraversal();
vtkActor* actor = (vtkActor*)theAllActors->GetNextActor();
}
if(!isDisplayed) {
// open transaction
- QAD_Operation* op = new SALOMEGUI_ImportOperation( myDisplayGUI->myGeomGUI->GetActiveStudy() );
+ QAD_Operation* op = new SALOMEGUI_ImportOperation( QAD_Application::getDesktop()->getActiveStudy() );
op->start();
SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(fatherSF);
}
// No viewer update should be done here!
//myRenderInter->Render();
- //myDisplayGUI->myGeomGUI->GetActiveStudy()->updateObjBrowser( true );
+ //QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser( true );
}
- else if(myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(myDisplayGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->entry());
+ else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->entry());
SALOMEDS::GenericAttribute_var anAttr;
SALOMEDS::AttributeName_var aName;
SALOMEDS::AttributeIOR_var anIOR;
// this SObject may be GEOM module root SObject
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()) {
while(anIter->More() && !useSubItems) {
SALOMEDS::SObject_var subobj = anIter->Value();
else {
if(!useSubItems) {
// open transaction
- QAD_Operation* op = new SALOMEGUI_ImportOperation( myDisplayGUI->myGeomGUI->GetActiveStudy() );
+ QAD_Operation* op = new SALOMEGUI_ImportOperation( QAD_Application::getDesktop()->getActiveStudy() );
op->start();
if (fatherSF->_is_nil())
MESSAGE("BuildPresentation(): fatherSF is nil!")
op->finish();
}
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");
IO->setEntry(obj->GetID());
aSh->setIO(IO);
}
}
// No viewer update should be done here!
- //myDisplayGUI->myGeomGUI->GetActiveStudy()->updateObjBrowser( true );
+ //QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser( true );
//ic->UpdateCurrentViewer();
}
}
//=====================================================================================
void DisplayGUI::OnDisplayAll(bool onlyPreviousDisplayedObject)
{
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
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();
myContext->Display(v3d->getTrihedron());
}
}
else {
- AIS_ListIteratorOfListOfInteractive ite(myGeomGUI->GetListDisplayedObject());
+ AIS_ListOfInteractive aListDisplayedObject;
+ myContext->DisplayedObjects(aListDisplayedObject);
+ AIS_ListIteratorOfListOfInteractive ite(aListDisplayedObject);
while(ite.More()) {
if(ite.Value()->IsInstance(STANDARD_TYPE(GEOM_AISShape))) {
Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast(ite.Value());
QApplication::setOverrideCursor(Qt::waitCursor);
// 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();
theActors->InitTraversal();
vtkActor *ac = theActors->GetNextActor();
}
// 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::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::AttributeName_var aName;
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());
for(;It.More();It.Next()) {
Handle(SALOME_InteractiveObject) IObject = It.Value();
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)) {
myRenderInter->Display(IObject);
if(!obj->FindAttribute(anAttr, "AttributeIOR"))
break;
// 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;
anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
if(obj->FindAttribute(anAttr, "AttributeName")) {
aName = SALOMEDS::AttributeName::_narrow(anAttr);
// open transaction
- QAD_Operation* op = new SALOMEGUI_ImportOperation(myGeomGUI->GetActiveStudy());
+ QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy());
op->start();
SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(fatherSF);
// commit transaction
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();
vtkActorCollection* theActors = GEOM_AssemblyBuilder::BuildActors(Shape, 0, themode, Standard_True);
theActors->InitTraversal();
GActor->setName(IObject->getName());
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();
anActor = (vtkActor*)theActors->GetNextActor();
}
}
}
}
- myGeomGUI->GetActiveStudy()->updateObjBrowser(true);
+ QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser(true);
QApplication::restoreOverrideCursor();
return;
//=====================================================================================
void DisplayGUI::OnDisplayOnly()
{
- if (myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
+ if (QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
return;
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
- SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
AIS_ListOfInteractive List;
}
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());
for(;It1.More();It1.Next()) {
Handle(SALOME_InteractiveObject) IObject = It1.Value();
SALOMEDS::SObject_var fatherSF =
- aStudy->FindObjectID(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->entry());
+ aStudy->FindObjectID(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->entry());
if(v3d->isInViewer(IObject, true)) {
AIS_ListOfInteractive List1;
ic->ObjectsInCollector(List1);
if(obj->FindAttribute(anAttr, "AttributeName")) {
aName = SALOMEDS::AttributeName::_narrow(anAttr);
// open transaction
- QAD_Operation* op = new SALOMEGUI_ImportOperation(myGeomGUI->GetActiveStudy());
+ QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy());
op->start();
SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(fatherSF);
//=====================================================================================
void DisplayGUI::OnErase()
{
- SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
- SALOME_Selection* Sel = SALOME_Selection::Selection(myGeomGUI->GetActiveStudy()->getSelection());
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
+ SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
+ SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection());
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
// VTK
SALOME_ListIteratorOfListIO It(Sel->StoredIObjects());
Handle(SALOME_InteractiveObject) anIObject;
for(;It.More();It.Next()) {
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)) {
myRenderInter->Erase(anIObject);
if(!obj->_is_nil()) {
if(obj->FindAttribute(anAttr, "AttributeIOR")) {
// 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;
while(anIter->More() && !useSubItems) {
SALOMEDS::SObject_var subobj = anIter->Value();
TopoDS_Shape Shape = myGeomGUI->GetShapeReader().GetShape(myGeom, aShape);
if(obj->FindAttribute(anAttr, "AttributeName")) {
// 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();
theAllActors->InitTraversal();
vtkActor* actor = (vtkActor*)theAllActors->GetNextActor();
}
}
}
- else if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_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();
SALOME_ListIteratorOfListIO It(Sel->StoredIObjects());
Handle(SALOME_InteractiveObject) anIObject;
if(!obj->_is_nil()) {
if(obj->FindAttribute(anAttr, "AttributeIOR")) {
// 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;
while(anIter->More() && !useSubItems) {
SALOMEDS::SObject_var subobj = anIter->Value();
bool DisplayGUI::PrepareSubShapeSelection(const int SubShapeType, Standard_Integer& returnLocalContextId)
{
//* Test the type of viewer */
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
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();
/* local context opening */
- myGeomBase->SetDisplayedObjectList();
+ //myGeomBase->SetDisplayedObjectList();
this->OnDisplayOnly();
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());
for(;It.More();It.Next()) {
Handle(SALOME_InteractiveObject) IObject = It.Value();
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;
}
bool DisplayGUI::PrepareSubShapeSelectionArgumentShape(const TopoDS_Shape& aShape,const int SubShapeType, Standard_Integer& returnLocalContextId)
{
//* Test the type of viewer */
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
return false;
if(aShape.IsNull())
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();
/* local context opening */
- myGeomBase->SetDisplayedObjectList();
+ //myGeomBase->SetDisplayedObjectList();
this->OnDisplayOnly();
returnLocalContextId = ic->OpenLocalContext(Standard_False, Standard_True, Standard_False, Standard_False) ;
// ic->Load(Shape, (8 - SubShapeType), Standard_True);
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;
}
LIB_MOC = \
DisplayGUI.h
-LIB_CLIENT_IDL = SALOME_Exception.idl \
- GEOM_Gen.idl \
- GEOM_Shape.idl \
- SALOMEDS.idl \
- SALOMEDS_Attributes.idl \
- SALOME_ModuleCatalog.idl \
- SALOME_Component.idl \
+LIB_CLIENT_IDL = SALOME_Exception.idl
LIB_SERVER_IDL =
# additionnal information to compil and link file
-CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
-CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
+CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -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@
--- /dev/null
+// 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
+}
--- /dev/null
+// 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
--- /dev/null
+/****************************************************************************
+** 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
+}
+
--- /dev/null
+/****************************************************************************
+** 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
--- /dev/null
+/****************************************************************************
+** 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
+}
+
--- /dev/null
+/****************************************************************************
+** 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
DlgRef_2Sel_QTD.cxx \
DlgRef_3Sel_QTD.cxx \
DlgRef_1Sel1Check_QTD.cxx \
+ DlgRef_1Sel3Check_QTD.cxx \
DlgRef_1Sel1Check1List_QTD.cxx \
DlgRef_1Sel1Spin_QTD.cxx \
DlgRef_1Sel2Spin_QTD.cxx \
DlgRef_2Sel1Spin_QTD.cxx \
DlgRef_2Sel2Spin_QTD.cxx \
DlgRef_2Sel3Spin_QTD.cxx \
+ DlgRef_1Sel1Spin1Check_QTD.cxx \
DlgRef_2Sel1Spin1Check_QTD.cxx \
DlgRef_2Sel2Spin1Check_QTD.cxx \
DlgRef_2Sel4Spin1Check_QTD.cxx \
DlgRef_2Sel1Spin.cxx \
DlgRef_2Sel2Spin.cxx \
DlgRef_2Sel3Spin.cxx \
+ DlgRef_1Sel1Spin1Check.cxx \
DlgRef_2Sel1Spin1Check.cxx \
DlgRef_2Sel2Spin1Check.cxx \
DlgRef_2Sel4Spin1Check.cxx \
DlgRef_2Sel_QTD.h \
DlgRef_3Sel_QTD.h \
DlgRef_1Sel1Check_QTD.h \
+ DlgRef_1Sel3Check_QTD.h \
DlgRef_1Sel1Check1List_QTD.h \
DlgRef_1Sel1Spin_QTD.h \
DlgRef_1Sel2Spin_QTD.h \
DlgRef_2Sel1Spin_QTD.h \
DlgRef_2Sel2Spin_QTD.h \
DlgRef_2Sel3Spin_QTD.h \
+ DlgRef_1Sel1Spin1Check_QTD.h \
DlgRef_2Sel1Spin1Check_QTD.h \
DlgRef_2Sel2Spin1Check_QTD.h \
DlgRef_2Sel4Spin1Check_QTD.h \
DlgRef_2Sel1Spin.h \
DlgRef_2Sel2Spin.h \
DlgRef_2Sel3Spin.h \
+ DlgRef_1Sel1Spin1Check.h \
DlgRef_2Sel1Spin1Check.h \
DlgRef_2Sel2Spin1Check.h \
DlgRef_2Sel4Spin1Check.h \
# header files
EXPORT_HEADERS= $(LIB_MOC)
-LIB_CLIENT_IDL = SALOME_Exception.idl \
- GEOM_Gen.idl \
- GEOM_Shape.idl \
- SALOMEDS.idl \
- SALOMEDS_Attributes.idl \
- SALOME_ModuleCatalog.idl \
- SALOME_Component.idl \
+LIB_CLIENT_IDL =
LIB_SERVER_IDL =
# additionnal information to compil and link file
-CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
-CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
-LDFLAGS += -lSalomeGUI -L${KERNEL_ROOT_DIR}/lib/salome
+CPPFLAGS += $(QT_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
+CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
+
+LDFLAGS +=
@CONCLUDE@
--- /dev/null
+<!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>
--- /dev/null
+<!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>
#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_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.cxx -impl DlgRef_1Sel2Spin_QTD.h DlgRef_1Sel2Spin_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_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.cxx -impl DlgRef_1Sel1Check1List_QTD.h DlgRef_1Sel1Check1List_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_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.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.cxx -impl DlgRef_3Sel_QTD.h DlgRef_3Sel_QTD.ui
#include "QAD_RightFrame.h"
#include "QAD_MessageBox.h"
+#include "QAD_Resource.h"
#include "GEOM_AssemblyBuilder.h"
#include "VTKViewer_ViewFrame.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()
// purpose : Constructor
{
myGeomGUI = GEOMContext::GetGeomGUI();
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;
}
}
+//=================================================================================
+// 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()
// purpose : Displays a CORBA shape
{
// MESSAGE ( "GEOMBase::Display init ")
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();
if(aShape->_is_nil()) {
if(shape.IsNull())
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::GenericAttribute_var anAttr;
SALOMEDS::AttributeName_var aName;
SALOMEDS::SComponent_var father = aStudy->FindComponent("GEOM");
int aLocked = false;
if(father->_is_nil()) {
- QAD_Operation* op = new SALOMEGUI_ImportOperation(myGeomGUI->GetActiveStudy());
+ QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy());
op->start();
aLocked = aStudy->GetProperties()->IsLocked();
if(aLocked)
anAttr = aStudyBuilder->FindOrCreateAttribute(father, "AttributePixMap");
aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
aPixmap->SetPixMap("ICON_OBJBROWSER_Geometry");
- myGeomGUI->GetActiveStudy()->updateObjBrowser();
+ QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser();
if(aLocked)
aStudy->GetProperties()->SetLocked(true);
op->finish();
nameG = TCollection_AsciiString(name);
// VTK
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
- VTKViewer_RenderWindowInteractor* myRenderInter = ((VTKViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
+ 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();
vtkActorCollection* theActors = GEOM_AssemblyBuilder::BuildActors(shape, 0, themode, Standard_True);
}
}
// OCC
- else if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
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");
theResult->setIO(IO);
theResult->setName(nameG.ToCString());
}
Sel->AddIObject(IO, false);
- myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame()->Repaint();
- if(myGeomGUI->GetSettings_AddInStudy())
+ QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame()->Repaint();
+ if(mySettings_AddInStudy)
AddInStudy(false, IO);
return true;
//=====================================================================================
bool GEOMBase::AddInStudy(bool selection, const Handle(SALOME_InteractiveObject)& anIO)
{
- SALOME_Selection* Sel = SALOME_Selection::Selection(myGeomGUI->GetActiveStudy()->getSelection());
- if (!(!myGeomGUI->GetSettings_AddInStudy() || selection)) {
+ SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection());
+ if (!(!mySettings_AddInStudy || selection)) {
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::GenericAttribute_var anAttr;
SALOMEDS::AttributeName_var aName;
SALOMEDS::SComponent_var father = aStudy->FindComponent("GEOM");
int aLocked = false;
if(father->_is_nil()) {
- QAD_Operation* op = new SALOMEGUI_ImportOperation(myGeomGUI->GetActiveStudy());
+ QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy());
op->start();
aLocked = aStudy->GetProperties()->IsLocked();
if(aLocked)
aStudyBuilder->DefineComponentInstance(father, myGeom);
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;
GEOM_Actor* GActor;
bool found = false;
// VTK
- if (myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
- vtkRenderer *Renderer = ((VTKViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer();
+ if (QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
+ vtkRenderer *Renderer = ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer();
vtkActorCollection* theActors = Renderer->GetActors();
theActors->InitTraversal();
return false;
}
// OCC
- else if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
AIS_ListOfInteractive List;
return false;
}
- if(!myGeomGUI->GetSettings_AddInStudy() || selection) {
+ if(!mySettings_AddInStudy || selection) {
QString Name = SALOMEGUI_NameDlg::getName(QAD_Application::getDesktop(), anIO->getName());
if(!Name.isEmpty()) {
// VTK
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK)
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK)
GActor->setName(strdup(Name.latin1()));
// OCC
- else if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC)
+ else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC)
GAISShape->setName(strdup(Name.latin1()));
}
else
}
// open transaction
- QAD_Operation* op = new SALOMEGUI_ImportOperation(myGeomGUI->GetActiveStudy());
+ QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy());
op->start();
SALOMEDS::SObject_var newObj = aStudyBuilder->NewObject(father);
aPixmap->SetPixMap("ICON_OBJBROWSER_VERTEX");
// VTK
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
GActor->setIO(GIO);
aName->SetValue(GActor->getName());
}
// OCC
- else if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
GAISShape->setIO(GIO);
aName->SetValue(GAISShape->getName());
}
}
op->finish();
- if(!myGeomGUI->GetSettings_AddInStudy() || selection)
- myGeomGUI->GetActiveStudy()->updateObjBrowser();
+ if(!mySettings_AddInStudy || selection)
+ QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser();
else {
- myGeomGUI->GetActiveStudy()->updateObjBrowser(false);
+ QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser(false);
Sel->AddIObject(GIO);
}
return true;
Handle(SALOME_InteractiveObject) IO = Sel->firstIObject();
/* case SObject */
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::GenericAttribute_var anAttr;
SALOMEDS::AttributeIOR_var anIOR;
}
+//=======================================================================
+// 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()
// purpose :
Handle(GEOM_AISShape) GEOMBase::ConvertIOinGEOMAISShape(const Handle(SALOME_InteractiveObject)& IO, Standard_Boolean& testResult, bool onlyInActiveView)
{
Handle(GEOM_AISShape) res;
- int nbSf = myGeomGUI->GetActiveStudy()->getStudyFramesCount();
+ int nbSf = QAD_Application::getDesktop()->getActiveStudy()->getStudyFramesCount();
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) {
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)sf->getRightFrame()->getViewFrame())->getViewer();
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
Handle(GEOM_InteractiveObject) GIO = Handle(GEOM_InteractiveObject)::DownCast(aSh->getIO());
if(GIO->isSame(IO)) {
if(onlyInActiveView) {
- if(sf == myGeomGUI->GetActiveStudy()->getActiveStudyFrame()) {
+ if(sf == QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()) {
testResult = true;
return aSh;
}
/* case SObject */
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::GenericAttribute_var anAttr;
SALOMEDS::AttributeIOR_var anIOR;
for(int i=0; It.More(); It.Next(), i++) {
Handle(SALOME_InteractiveObject) IObject = It.Value();
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::GenericAttribute_var anAttr;
SALOMEDS::AttributeIOR_var anIOR;
// function : SetDisplayedObjectList()
// purpose :
//================================================================================
-void GEOMBase::SetDisplayedObjectList()
-{
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
- return;
+// void GEOMBase::SetDisplayedObjectList()
+// {
+// if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
+// return;
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
- myGeomGUI->GetListDisplayedObject().Clear();
+// OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+// myGeomGUI->GetListDisplayedObject().Clear();
- Handle (AIS_InteractiveContext) aContext = v3d->getAISContext();
- aContext->DisplayedObjects(myGeomGUI->GetListDisplayedObject());
-}
+// Handle (AIS_InteractiveContext) aContext = v3d->getAISContext();
+// aContext->DisplayedObjects(myGeomGUI->GetListDisplayedObject());
+// }
//=====================================================================================
return;
//NRI DEBUG : 14/02/2002
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
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();
try {
/* erase any previous */
- ic->Erase(myGeomGUI->mySimulationShape, Standard_True, Standard_False);
- ic->ClearPrs(myGeomGUI->mySimulationShape);
- myGeomGUI->mySimulationShape = new AIS_Shape(TopoDS_Shape());
- myGeomGUI->mySimulationShape->Set(S);
- myGeomGUI->mySimulationShape->SetColor(Quantity_NOC_VIOLET);
- ic->Deactivate(myGeomGUI->mySimulationShape);
- ic->Display(myGeomGUI->mySimulationShape, Standard_False);
+ ic->Erase(mySimulationShape, Standard_True, Standard_False);
+ ic->ClearPrs(mySimulationShape);
+ mySimulationShape = new AIS_Shape(TopoDS_Shape());
+ mySimulationShape->Set(S);
+ mySimulationShape->SetColor(Quantity_NOC_VIOLET);
+ ic->Deactivate(mySimulationShape);
+ ic->Display(mySimulationShape, Standard_False);
ic->UpdateCurrentViewer();
}
catch(Standard_Failure) {
MESSAGE("Exception catched in GEOMBase::DisplaySimulationShape ");
}
- myGeomGUI->mySimulationShape->UnsetColor();
+ mySimulationShape->UnsetColor();
return;
}
//==================================================================================
void GEOMBase::EraseSimulationShape()
{
- int count = myGeomGUI->GetActiveStudy()->getStudyFramesCount();
+ int count = QAD_Application::getDesktop()->getActiveStudy()->getStudyFramesCount();
for(int i = 0; i < count; i++) {
- if(myGeomGUI->GetActiveStudy()->getStudyFrame(i)->getTypeView() == VIEW_OCC) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getStudyFrame(i)->getRightFrame()->getViewFrame())->getViewer();
+ if(QAD_Application::getDesktop()->getActiveStudy()->getStudyFrame(i)->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getStudyFrame(i)->getRightFrame()->getViewFrame())->getViewer();
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
- ic->Erase(myGeomGUI->mySimulationShape, Standard_True, Standard_False);
- ic->ClearPrs(myGeomGUI->mySimulationShape);
+ ic->Erase(mySimulationShape, Standard_True, Standard_False);
+ ic->ClearPrs(mySimulationShape);
ic->UpdateCurrentViewer();
}
}
//=================================================================================
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;
- 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();
Standard_Real Width, Height;
view3d->Size(Width, Height);
bool GEOMBase::SelectionByNameInDialogs(QWidget* aWidget, const QString& objectUserName, SALOME_Selection* Sel)
{
/* 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;
listSO = ST->FindObjectByName(objectUserName, "GEOM");
y = abs(PP->y() + PP->size().height() - aDlg->size().height() - 10);
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);}
+}
#define GEOMBASE_H
#include "GEOMContext.h"
+
+// SALOME Includes
+#include "QAD_Config.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
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 AddInStudy(bool selection = false, const Handle(SALOME_InteractiveObject)& anIO = 0);
void ConvertListOfIOInListOfIOR(const SALOME_ListIO& aList,
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 */
bool VertexToPoint(const TopoDS_Shape& S, gp_Pnt& P);
const char* aTitle = 0, const double bottom = -1E6,
const double top = +1E6, const int decimals = 6);
- void SetDisplayedObjectList();
+ //void SetDisplayedObjectList();
/* Simulation management */
bool CreateArrowForLinearEdge(const TopoDS_Shape& tds, TopoDS_Shape& ArrowCone);
GEOMContext* myGeomGUI;
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
mySelection->ClearFilters();
disconnect(mySelection, 0, this, 0);
- myGeomGUI->ResetState();
+ //myGeomGUI->ResetState();
reject();
return;
{
this->setEnabled(false);
mySelection->ClearFilters();
- myGeomGUI->ResetState();
+ //myGeomGUI->ResetState();
disconnect(mySelection, 0, this, 0);
myGeomBase->EraseSimulationShape();
myGeomGUI->SetActiveDialogBox(0);
# header files
EXPORT_HEADERS= GEOMBase.h \
- GEOMBase_Sketcher.h \
GEOMBase_Skeleton.h
LIB_SRC = GEOMBase.cxx \
GEOMBase_Skeleton.cxx \
- GEOMBase_Sketcher.cxx \
GEOMBase_aParameterDlg.cxx
LIB_MOC = \
GEOMBase.h \
GEOMBase_Skeleton.h \
- GEOMBase_Sketcher.h \
GEOMBase_aParameterDlg.h
LIB_CLIENT_IDL = SALOME_Exception.idl \
- GEOM_Gen.idl \
- GEOM_Shape.idl \
SALOMEDS.idl \
- SALOMEDS_Attributes.idl \
- SALOME_ModuleCatalog.idl \
- SALOME_Component.idl \
+ SALOMEDS_Attributes.idl
LIB_SERVER_IDL =
# additionnal information to compil and link file
-CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
-CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
+CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -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@
// SALOME Includes
#include "QAD_RightFrame.h"
-#include "QAD_Resource.h"
#include "QAD_Config.h"
-#include "OCCViewer_ViewPort.h"
-#include "OCCViewer_ViewPort3d.h"
#include "OCCViewer_Viewer3d.h"
#include "VTKViewer_ViewFrame.h"
#include "SALOME_Selection.h"
-#include "SALOME_ListIteratorOfListIO.hxx"
/* The object itself created in the static method 'GetOrCreateGEOMBase()' */
static GEOMContext* GeomGUI = 0;
typedef bool OGE(int, QAD_Desktop*);
typedef bool OMP(QMouseEvent*, QAD_Desktop*, QAD_StudyFrame*);
typedef void BP(const Handle(SALOME_InteractiveObject)&);
-
-//=================================================================================
-// 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;
-
-};
-
+typedef bool CP(QAD_Desktop*, QPopupMenu*, const QString&,
+ const QString&, const QString&);
//=======================================================================
// function : GeometryGUI()
{
GeometryGUI::GetOrCreateGeometryGUI(parent);
- QMenuBar* Mb = GeomGUI->GetDesktop()->getMainMenuBar();
+ QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
bool ViewOCC;
- if(GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC)
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC)
ViewOCC = true;
- else if(GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK)
+ else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK)
ViewOCC = false;
else
return false;
- Mb->setItemEnabled(404, ViewOCC);//Sketch
- Mb->setItemEnabled(405, ViewOCC);//Sketch
- Mb->setItemEnabled(406, ViewOCC);//Sketch
+ Mb->setItemEnabled(404, ViewOCC);//SKETCHER
Mb->setItemEnabled(603, ViewOCC);//SuppressFace
Mb->setItemEnabled(604, ViewOCC);//SuppressHole
Mb->setItemEnabled(413, ViewOCC);// ShadingColor 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
theCommandID == 112 || // MENU FILE - IMPORT IGES
theCommandID == 123 || // MENU FILE - EXPORT STEP
theCommandID == 31 || // MENU EDIT - COPY
theCommandID == 33 || // MENU EDIT - DELETE
- theCommandID == 411 || // MENU SETTINGS - COPY
- theCommandID == 412 || // MENU SETTINGS - ADD IN STUDY
- theCommandID == 413 || // MENU SETTINGS - SHADING COLOR
- theCommandID == 414 || // MENU SETTINGS - ISOS
- theCommandID == 415 || // MENU SETTINGS - STEP VALUE FOR SPIN BOXES
+ theCommandID == 411 || // MENU SETTINGS - ADD IN STUDY
+ theCommandID == 412 || // MENU SETTINGS - SHADING COLOR
+ theCommandID == 413 || // MENU SETTINGS - ISOS
+ theCommandID == 414 || // MENU SETTINGS - STEP VALUE FOR SPIN BOXES
theCommandID == 5103 || // MENU TOOLS - CHECK GEOMETRY
theCommandID == 8032 || // POPUP VIEWER - COLOR
theCommandID == 8033 || // POPUP VIEWER - TRANSPARENCY
if(!GeomGUI->LoadLibrary("libDisplayGUI.so"))
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
theCommandID == 4012 || // MENU BASIC - LINE
theCommandID == 4013 || // MENU BASIC - CIRCLE
if(!GeomGUI->LoadLibrary("libGenerationGUI.so"))
return false;
}
+ else if(theCommandID == 404) { // SKETCHER
+ if(!GeomGUI->LoadLibrary("libSketcherGUI.so"))
+ return false;
+ }
else if(theCommandID == 407 || // MENU BUILD - EXPLODE
theCommandID == 4081 || // MENU BUILD - EDGE
theCommandID == 4082 || // MENU BUILD - WIRE
{
GeometryGUI::GetOrCreateGeometryGUI(parent);
- if(GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
+ 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;
}
{
GeometryGUI::GetOrCreateGeometryGUI(parent);
- if(GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
return false;
- if(GeomGUI->GetState() == CURRENT_SKETCH) {
- 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->myState == 0) {
if(!GeomGUI->LoadLibrary("libBasicGUI.so"))
return false;
}
-//=================================================================================
-// 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()
// purpose : [static]
bool GeometryGUI::SetSettings(QAD_Desktop* parent)
{
GeometryGUI::GetOrCreateGeometryGUI(parent);
-
- /* 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())
- GeomGUI->GetShadingColor() = Quantity_Color (SCr.toInt()/255., SCg.toInt()/255., SCb.toInt()/255., Quantity_TOC_RGB);
+ QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
+ QAD_Study* ActiveStudy = parent->getActiveStudy();
/* Wireframe or Shading */
int DisplayMode = 0;
- if(parent->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)parent->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ if(ActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)ActiveStudy->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
DisplayMode = ic->DisplayMode();
}
- else if(parent->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
- VTKViewer_RenderWindowInteractor* myRenderInter = ((VTKViewer_ViewFrame*)parent->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
+ else if(ActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
+ VTKViewer_RenderWindowInteractor* myRenderInter = ((VTKViewer_ViewFrame*)ActiveStudy->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
DisplayMode = myRenderInter->GetDisplayMode();
}
if(DisplayMode == 1)
- parent->menuBar()->changeItem(211, tr("GEOM_MEN_WIREFRAME"));
+ Mb->changeItem(211, tr("GEOM_MEN_WIREFRAME"));
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 */
QString AddInStudy = QAD_CONFIG->getSetting("Geometry:SettingsAddInStudy");
+ int Settings_AddInStudy;
if(!AddInStudy.isEmpty())
- GeomGUI->GetSettings_AddInStudy() = AddInStudy.toInt();
+ Settings_AddInStudy = AddInStudy.toInt();
else
- GeomGUI->GetSettings_AddInStudy() = 1;
- parent->menuBar()->findItem(412, &pp);
- pp->setItemChecked(412, GeomGUI->GetSettings_AddInStudy());
+ Settings_AddInStudy = 1;
+ Mb->setItemChecked(411, Settings_AddInStudy);
+
/* step value */
QString S = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep");
if(S.isEmpty())
QAD_CONFIG->addSetting("Geometry:SettingsGeomStep", "100");
-
+
+
/* isos */
- QAD_Study* ActiveStudy = parent->getActiveStudy();
int count = ActiveStudy->getStudyFramesCount();
bool ViewOCC = false;
}
}
- QMenuBar* Mb = GeomGUI->GetDesktop()->getMainMenuBar();
-
- Mb->setItemEnabled(404, ViewOCC);//Sketch
- Mb->setItemEnabled(405, ViewOCC);//Sketch
- Mb->setItemEnabled(406, ViewOCC);//Sketch
+ Mb->setItemEnabled(404, ViewOCC);//SKETCHER
Mb->setItemEnabled(603, ViewOCC);//SuppressFace
Mb->setItemEnabled(604, ViewOCC);//SuppressHole
{
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 = "";
+ theContext = "";
+
+ if((theParent.compare("Viewer") == 0)) {
+ if(Sel->IObjectCount() == 0)
+ theContext = "NothingSelected";
+ }
if(Sel->IObjectCount() == 1) {
Handle(SALOME_InteractiveObject) IO = Sel->firstIObject();
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()) {
SALOMEDS::SComponent_var scomp = sobj->GetFatherComponent();
if(strcmp(scomp->GetID(), IO->getEntry()) == 0) {
}
}
- if((theParent.compare("Viewer")==0)) {
- if(GeomGUI->GetState() == CURRENT_SKETCH)
- theContext = "Sketch";
- else {
- if(Sel->IObjectCount() > 0)
- theContext = "";
- else
- theContext = "NothingSelected";
- }
- }
- else
- theContext = "";
-
return;
}
//=================================================================================
bool GeometryGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString& theContext,
const QString& theParent, const QString& theObject)
-{
+{
GeometryGUI::GetOrCreateGeometryGUI(parent);
- /* Deactivate any non modal dialog box to get the neutral point */
- 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))
+ if(!GeomGUI->LoadLibrary("libGEOMBase.so"))
return false;
- if(GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)GeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
- Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
- if(theParent.compare("Viewer")==0) {
- if(theContext.compare("Sketch")==0) {
- SketchStatus myCS = GeomGUI->GetSketcher().GetCurrentStatus();
- popup->setCheckable(TRUE);
- 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;
- }
+ //Load Function BuildPresentation
+ OSD_Function osdF = GeomGUI->myGUILibrary.DlSymb("CustomPopup");
+ CP (*f1) = NULL;
+ if(osdF != NULL) {
+ f1 = (bool (*) (QAD_Desktop*, QPopupMenu*, const QString&,
+ const QString&, const QString&)) osdF;
+ (*f1)(parent, popup, theContext, theParent, theObject);
}
- else if(GeomGUI->GetActiveStudy()->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 = 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
+ else
return false;
- }
- return false;
+
+ return true;
}
GeometryGUI::GetOrCreateGeometryGUI(parent);
if(GeomGUI != 0) {
- if(GeomGUI->GetState() == CURRENT_SKETCH) {
- GeomGUI->GetSketcher().Clear();
- GeomGUI->ResetState();
- }
-
- QMenuBar* Mb = GeomGUI->GetDesktop()->getMainMenuBar();
+ QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
bool ViewOCC = false;
- if(GeomGUI->GetDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC)
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC)
ViewOCC = true;
- Mb->setItemEnabled(404, ViewOCC);//Sketch
- Mb->setItemEnabled(405, ViewOCC);//Sketch
- Mb->setItemEnabled(406, ViewOCC);//Sketch
+ Mb->setItemEnabled(404, ViewOCC);//SKETCHER
Mb->setItemEnabled(603, ViewOCC);//SuppressFace
Mb->setItemEnabled(604, ViewOCC);//SuppressHole
Mb->setItemEnabled(413, ViewOCC);// ShadingColor Settings
Mb->setItemEnabled(414, ViewOCC);// Isos Settings
- //GeomGUI->EraseSimulationShape();
GeomGUI->EmitSignalCloseAllDialogs();
GeomGUI = 0;
}
f1 = (void (*) (const Handle(SALOME_InteractiveObject)&)) osdF;
(*f1)(theIO);
}
- else
- return;
return;
}
GeometryGUI.h \
LIB_CLIENT_IDL = SALOME_Exception.idl \
- GEOM_Gen.idl \
- GEOM_Shape.idl \
SALOMEDS.idl \
- SALOMEDS_Attributes.idl \
- SALOME_ModuleCatalog.idl \
- SALOME_Component.idl \
+ SALOMEDS_Attributes.idl
LIB_SERVER_IDL =
# additionnal information to compil and link file
-CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
-CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
+CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -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@
{
GEOMToolsGUI* myGEOMToolsGUI = new GEOMToolsGUI();
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)
{
case 31: // COPY
}
case 111: // IMPORT BREP
{
- myGEOMToolsGUI->myGeomGUI->SetState(111);
- myGEOMToolsGUI->Import();
- myGEOMToolsGUI->myGeomGUI->ResetState();
+ myGEOMToolsGUI->Import(theCommandID);
break;
}
case 112: // IMPORT IGES
{
- myGEOMToolsGUI->myGeomGUI->SetState(112);
- myGEOMToolsGUI->Import();
- myGEOMToolsGUI->myGeomGUI->ResetState();
+ myGEOMToolsGUI->Import(theCommandID);
break;
}
case 113: // IMPORT STEP
{
- myGEOMToolsGUI->myGeomGUI->SetState(113);
- myGEOMToolsGUI->Import();
- myGEOMToolsGUI->myGeomGUI->ResetState();
+ myGEOMToolsGUI->Import(theCommandID);
break;
}
case 121: // EXPORT BREP
{
- myGEOMToolsGUI->myGeomGUI->SetState(121);
- myGEOMToolsGUI->Export();
- myGEOMToolsGUI->myGeomGUI->ResetState();
+ myGEOMToolsGUI->Export(theCommandID);
break;
}
case 122: // EXPORT IGES
{
- myGEOMToolsGUI->myGeomGUI->SetState(122);
- myGEOMToolsGUI->Export();
- myGEOMToolsGUI->myGeomGUI->ResetState();
+ myGEOMToolsGUI->Export(theCommandID);
break;
}
case 123: // EXPORT STEP
{
- myGEOMToolsGUI->myGeomGUI->SetState(123);
- myGEOMToolsGUI->Export();
- myGEOMToolsGUI->myGeomGUI->ResetState();
+ myGEOMToolsGUI->Export(theCommandID);
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;
QMenuItem* item = parent->menuBar()->findItem(411, &pp);
bool check = !pp->isItemChecked(411);
- pp->setItemChecked(411, check);
- myGEOMToolsGUI->myGeomGUI->GetSettings_Copy() = check;
- QAD_CONFIG->addSetting("Geometry:SettingsCopy", myGEOMToolsGUI->myGeomGUI->GetSettings_Copy());
+ pp->setItemChecked(411,check);
+ //myGEOMToolsGUI->myGeomGUI->GetSettings_AddInStudy() = check;
+ QAD_CONFIG->addSetting("Geometry:SettingsAddInStudy", check);
break;
}
- case 412: // SETTINGS - ADD IN STUDY
+ case 412: // SETTINGS - SHADING COLOR
{
- QMenuBar* Mb = myGEOMToolsGUI->myGeomGUI->GetDesktop()->getMainMenuBar();
- 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)
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
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();
QString SCr = QAD_CONFIG->getSetting("Geometry:SettingsShadingColorRed");
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()) {
- 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;
ic->DisplayedObjects(List);
while(ite.More()) {
if(ite.Value()->IsInstance(STANDARD_TYPE(GEOM_AISShape))) {
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);
}
ite.Next();
}
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;
- 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();
QString IsoU = QAD_CONFIG->getSetting("Geometry:SettingsIsoU");
else
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 VIso = IsoV.toInt();
ic->UpdateCurrentViewer();
break;
}
- case 415: // SETTINGS : STEP VALUE FOR SPIN BOXES
+ case 414: // SETTINGS : STEP VALUE FOR SPIN BOXES
{
QString step = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep");
if(step.isEmpty())
aName = SALOMEDS::AttributeName::_narrow(anAttr);
QString nm = QString(aName->Value());
- nm = SALOMEGUI_NameDlg::getName(myGEOMToolsGUI->myGeomGUI->GetDesktop(), nm);
+ nm = SALOMEGUI_NameDlg::getName(QAD_Application::getDesktop(), nm);
if(!nm.isEmpty()) {
QApplication::setOverrideCursor(Qt::waitCursor);
- myGEOMToolsGUI->myGeomGUI->GetActiveStudy()->renameIObject(IObject, nm);
+ QAD_Application::getDesktop()->getActiveStudy()->renameIObject(IObject, nm);
QApplication::restoreOverrideCursor();
}
}
}
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(">>> ");
PyEditor->handleReturn();
}
case 8032: // COLOR - POPUP VIEWER
{
- if(myGEOMToolsGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_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());
Handle(SALOME_InteractiveObject) FirstIOS = Sel->firstIObject();
if(!FirstIOS.IsNull()) {
QColor initcolor = myRenderInter->GetColor(FirstIOS);
- QColor c = QColorDialog::getColor( initcolor, myGEOMToolsGUI->myGeomGUI->GetDesktop());
+ QColor c = QColorDialog::getColor( initcolor, QAD_Application::getDesktop());
if(c.isValid()) {
QApplication::setOverrideCursor(Qt::waitCursor);
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();
Standard_Boolean found;
Handle(GEOM_AISShape) Shape = myGEOMToolsGUI->myGeomBase->ConvertIOinGEOMAISShape(IO, found, true);
Quantity_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()) {
CSFColor = Quantity_Color (c.red()/255., c.green()/255., c.blue()/255., Quantity_TOC_RGB);
{
OCCViewer_Viewer3d* v3d;
Handle(AIS_InteractiveContext) ic;
- if(myGEOMToolsGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGEOMToolsGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
}
GEOMBase_TransparencyDlg *aDlg = new GEOMBase_TransparencyDlg(parent, "", Sel, ic);
}
case 8034: // ISOS - POPUP VIEWER
{
- if(myGEOMToolsGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
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();
ic->InitCurrent();
IsoV = "1";
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->SpinBoxV->setValue(IsoV.toInt());
if(!obj->FindAttribute(anAttr, "AttributeIOR") &&
obj->FindAttribute(anAttr, "AttributePersistentRef")) {
// 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)) {
SALOMEDS::Driver_var driver = SALOMEDS::Driver::_narrow(comp);
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
}
-//=======================================================================
-// 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()
// purpose :
void GEOMToolsGUI::OnEditDelete()
{
if ( QAD_MessageBox::warn2
- ( myGeomGUI->GetDesktop(),
+ ( QAD_Application::getDesktop(),
tr ("GEOM_WRN_WARNING"),
tr ("GEOM_REALLY_DELETE"),
tr ("GEOM_BUT_YES"), tr ("GEOM_BUT_NO"), 1, 0, 0) != 1 )
return;
- int nbSf = myGeomGUI->GetActiveStudy()->getStudyFramesCount();
+ int nbSf = QAD_Application::getDesktop()->getActiveStudy()->getStudyFramesCount();
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::GenericAttribute_var anAttr;
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() );
for(;It.More();It.Next()) {
Handle(SALOME_InteractiveObject) IObject = It.Value();
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() );
/* Erase child graphical objects */
myGeomGUI->GetShapeReader().RemoveShapeFromBuffer( ASCior ) ;
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 ) {
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)sf->getRightFrame()->getViewFrame())->getViewer();
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 )
myContext->Erase( Result, true, false );
} else if ( sf->getTypeView() == VIEW_VTK ) {
//vtkRenderer* Renderer = ((VTKViewer_ViewFrame*)sf->getRightFrame()->getViewFrame())->getRenderer();
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 ) {
//Renderer->RemoveActor(ac);
if ( ac->hasIO() )
/* Erase main graphical object */
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 ) {
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)sf->getRightFrame()->getViewFrame())->getViewer();
Handle (AIS_InteractiveContext) myContext = v3d->getAISContext();
/* Erase objects in Study */
SALOMEDS::SObject_var obj = aStudy->FindObjectID( IObject->getEntry() );
if ( !obj->_is_nil() ) {
- QAD_Operation* op = new SALOMEGUI_ImportOperation(myGeomGUI->GetActiveStudy());
+ QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy());
op->start();
aStudyBuilder->RemoveObject(obj);
op->finish();
/* Clear any previous selection */
Sel->ClearIObjects() ;
- myGeomGUI->GetActiveStudy()->updateObjBrowser();
+ QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser();
}
//==============================================================================
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;
const SALOME_ListIO& List = Sel->StoredIObjects();
}
}
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_READY"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_READY"));
}
// function : Import
// 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();
GEOM::GEOM_Shape_var aShape;
QString file;
QStringList filtersList;
- switch(myGeomGUI->GetState())
+ switch(aState)
{
case 111 : // Import BREP
{
filtersList.append(tr("GEOM_MEN_IMPORT_BREP"));
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()) {
QApplication::setOverrideCursor(Qt::waitCursor);
try {
filtersList.append( tr("GEOM_MEN_IMPORT_IGES") ) ;
filtersList.append( tr("GEOM_MEN_ALL_FILES") ) ;
- file = QAD_FileDlg::getFileName(myGeomGUI->GetDesktop(),
+ file = QAD_FileDlg::getFileName(QAD_Application::getDesktop(),
"",
filtersList,
tr("GEOM_MEN_IMPORT"),
filtersList.append( tr("GEOM_MEN_IMPORT_STEP") ) ;
filtersList.append( tr("GEOM_MEN_ALL_FILES") ) ;
- file = QAD_FileDlg::getFileName(myGeomGUI->GetDesktop(),
+ file = QAD_FileDlg::getFileName(QAD_Application::getDesktop(),
"",
filtersList,
tr("GEOM_MEN_IMPORT"),
}
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::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::AttributeName_var aName;
SALOMEDS::AttributePixMap_var aPixmap;
int aLocked = false;
if (father->_is_nil()) {
- QAD_Operation* op = new SALOMEGUI_ImportOperation(myGeomGUI->GetActiveStudy() );
+ QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy() );
op->start();
aLocked = aStudy->GetProperties()->IsLocked();
if (aLocked) aStudy->GetProperties()->SetLocked(false);
anAttr = aStudyBuilder->FindOrCreateAttribute(father, "AttributeName");
aName = SALOMEDS::AttributeName::_narrow(anAttr);
// aName->SetValue( tr("GEOM_MEN_COMPONENT") );
- aName->SetValue(myGeomGUI->GetDesktop()->getComponentUserName( "GEOM" ) );
+ aName->SetValue(QAD_Application::getDesktop()->getComponentUserName( "GEOM" ) );
anAttr = aStudyBuilder->FindOrCreateAttribute(father, "AttributePixMap");
aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
aPixmap->SetPixMap( "ICON_OBJBROWSER_Geometry" );
QString nameShape = QAD_Tools::getFileNameFromPath(file,false) + QString("_%1").arg(myGeomGUI->GetNbGeom()++);
if(myGeomBase->Display(aShape, strdup(nameShape.latin1()))) {
- myGeomGUI->GetActiveStudy()->setMessage( tr("GEOM_INF_LOADED").arg(QAD_Tools::getFileNameFromPath( file )) );
- myGeomGUI->GetDesktop()->putInfo( tr("GEOM_PRP_READY"));
+ QAD_Application::getDesktop()->getActiveStudy()->setMessage( tr("GEOM_INF_LOADED").arg(QAD_Tools::getFileNameFromPath( file )) );
+ QAD_Application::getDesktop()->putInfo( tr("GEOM_PRP_READY"));
}
}
QApplication::restoreOverrideCursor();
// function : Export
// 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();
GEOM::GEOM_Shape_var aShape;
tr("GEOM_MEN_IMPORT_IGES"),
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() );
- switch (myGeomGUI->GetState())
+ switch (aState)
{
case 121 :
{
GEOM::GEOM_Shape_var aShape = myGeomBase->ConvertIOinGEOMShape(IObject, found);
// Handle(GEOM_AISShape) Shape = myGeomGUI->ConvertIOinGEOMAISShape(IObject, found, true);
if ( found ) {
- QString file = QAD_FileDlg::getFileName(myGeomGUI->GetDesktop(),
+ QString file = QAD_FileDlg::getFileName(QAD_Application::getDesktop(),
QString( IObject->getName() ) + ".brep",
tr("GEOM_MEN_IMPORT_BREP"),
tr("GEOM_MEN_EXPORT"),
GEOM::GEOM_Shape_var aShape = myGeomBase->ConvertIOinGEOMShape(IObject, found);
// Handle(GEOM_AISShape) Shape = myGeomGUI->ConvertIOinGEOMAISShape(IObject, found, true);
if ( found ) {
- QString file = QAD_FileDlg::getFileName(myGeomGUI->GetDesktop(),
+ QString file = QAD_FileDlg::getFileName(QAD_Application::getDesktop(),
QString( IObject->getName() ) + ".igs",
tr("GEOM_MEN_IMPORT_IGES"),
tr("GEOM_MEN_EXPORT"),
GEOM::GEOM_Shape_var aShape = myGeomBase->ConvertIOinGEOMShape(IObject, found);
// Handle(GEOM_AISShape) Shape = myGeomBase->ConvertIOinGEOMAISShape(IObject, found, true);
if ( found ) {
- file = QAD_FileDlg::getFileName(myGeomGUI->GetDesktop(),
+ file = QAD_FileDlg::getFileName(QAD_Application::getDesktop(),
QString( IObject->getName() ) + ".stp",
tr("GEOM_MEN_IMPORT_STEP"),
tr("GEOM_MEN_EXPORT"),
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 */
- bool Import();
- bool Export();
+ bool Import(int aState);
+ bool Export(int aState);
void OnEditCopy();
void OnEditDelete();
#include "QAD_RightFrame.h"
#include "SALOME_ListIteratorOfListIO.hxx"
+#include <AIS_InteractiveContext.hxx>
#include <qframe.h>
#include <qlabel.h>
//=================================================================================
void GEOMBase_TransparencyDlg::ValueHasChanged(int newValue)
{
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_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());
Handle(SALOME_InteractiveObject) FirstIOS = mySel->firstIObject();
QApplication::restoreOverrideCursor();
}
- else if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
// OCC
SALOME_ListIteratorOfListIO It(this->mySel->StoredIObjects());
Handle(SALOME_InteractiveObject) FirstIOS = mySel->firstIObject();
#include <qvariant.h>
#include <qdialog.h>
-#include "SALOME_Selection.h"
-#include "SALOME_InteractiveObject.hxx"
-#include "GEOM_InteractiveObject.hxx"
-#include "GEOM_AISShape.hxx"
+/* #include "SALOME_Selection.h" */
+/* #include "SALOME_InteractiveObject.hxx" */
+/* #include "GEOM_InteractiveObject.hxx" */
+/* #include "GEOM_AISShape.hxx" */
#include "GEOMBase.h"
GEOMToolsGUI_NbIsosDlg.h \
GEOMToolsGUI_TransparencyDlg.h
-LIB_CLIENT_IDL = SALOME_Exception.idl \
- GEOM_Gen.idl \
- GEOM_Shape.idl \
- SALOMEDS.idl \
- SALOMEDS_Attributes.idl \
- SALOME_ModuleCatalog.idl \
- SALOME_Component.idl \
+LIB_CLIENT_IDL = SALOMEDS_Attributes.idl
LIB_SERVER_IDL =
# additionnal information to compil and link file
-CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
-CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
+CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -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@
{
GenerationGUI* myGenerationGUI = new GenerationGUI();
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)
{
{
try {
if(BaseShape->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
return;
}
GEOM::PointStruct PS2 = myGeom->MakePointStruct(P2.X(), P2.Y(), P2.Z());
GEOM::GEOM_Shape_ptr result = myGeom->MakePrism(BaseShape, PS1, PS2);
if(result->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
return;
}
result->NameType(type);
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) {
QtCatchCorbaException(S_ex);
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) ;
if(result->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
return;
}
result->NameType(type);
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) {
QtCatchCorbaException(S_ex);
GEOM::GEOM_Shape_ptr result = myGeom->MakeFilling(SectionShape, mindeg, maxdeg,
tol3d, tol2d, nbiter);
if(result->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
return;
}
result->NameType(type);
if(myGeomBase->Display(result))
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
return;
}
catch(const SALOME::SALOME_Exception& S_ex) {
myGeomBase->GetShapeTypeString(S,type);
result->NameType(type);
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
}
else {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
}
}
catch (const SALOME::SALOME_Exception& S_ex) {
//=================================================================================
void GenerationGUI_FillingDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
myMinDeg = GroupPoints->SpinBox_1->value();
myTol2D = GroupPoints->SpinBox_2->value();
using namespace std;
#include "GenerationGUI_PipeDlg.h"
+#include <TopoDS_Edge.hxx>
+#include <BRepBuilderAPI_MakeWire.hxx>
#include <BRepOffsetAPI_MakePipe.hxx>
#include <BRepAlgoAPI.hxx>
//=================================================================================
void GenerationGUI_PipeDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
myGeomBase->EraseSimulationShape();
//=================================================================================
void GenerationGUI_PrismDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
myGeomBase->EraseSimulationShape();
using namespace std;
#include "GenerationGUI_RevolDlg.h"
+#include <gp_Lin.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepPrimAPI_MakeRevol.hxx>
#include "QAD_Config.h"
//=================================================================================
void GenerationGUI_RevolDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
myGeomBase->EraseSimulationShape();
GenerationGUI_FillingDlg.h \
GenerationGUI_PipeDlg.h
-LIB_CLIENT_IDL = SALOME_Exception.idl \
- GEOM_Gen.idl \
- GEOM_Shape.idl \
- SALOMEDS.idl \
- SALOMEDS_Attributes.idl \
- SALOME_ModuleCatalog.idl \
- SALOME_Component.idl \
+LIB_CLIENT_IDL =
LIB_SERVER_IDL =
# additionnal information to compil and link file
-CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
-CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
+CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -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@
@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@
MeasureGUI_WhatisDlg.h \
MeasureGUI_CheckShapeDlg.h
-LIB_CLIENT_IDL = SALOME_Exception.idl \
- GEOM_Gen.idl \
- GEOM_Shape.idl \
- SALOMEDS.idl \
- SALOMEDS_Attributes.idl \
- SALOME_ModuleCatalog.idl \
- SALOME_Component.idl \
+LIB_CLIENT_IDL =
LIB_SERVER_IDL =
# additionnal information to compil and link file
-CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
-CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
+CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -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@
{
MeasureGUI* myMeasureGUI = new MeasureGUI();
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)
{
try {
GEOM::GEOM_Shape_var result = myGeom->MakeCDG(Shape);
if(result->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
return;
}
result->NameType(tr("GEOM_POINT"));
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) {
QtCatchCorbaException(S_ex);
BRepBndLib::Add(S,B);
B.Get(axmin, aymin, azmin, axmax, aymax, azmax);
GroupC1->LineEdit11->setText(tr("%1").arg(axmin, 12, 'f', 6));
- GroupC1->LineEdit12->setText(tr("%1").arg(aymin, 12, 'f', 6));
- GroupC1->LineEdit21->setText(tr("%1").arg(azmin, 12, 'f', 6));
- GroupC1->LineEdit22->setText(tr("%1").arg(axmax, 12, 'f', 6));
- GroupC1->LineEdit31->setText(tr("%1").arg(aymax, 12, 'f', 6));
+ GroupC1->LineEdit12->setText(tr("%1").arg(axmax, 12, 'f', 6));
+ GroupC1->LineEdit21->setText(tr("%1").arg(aymin, 12, 'f', 6));
+ GroupC1->LineEdit22->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));
mySimulationTopoDs = BRepPrimAPI_MakeBox(gp_Pnt(axmin, aymin, azmin), gp_Pnt(axmax, aymax, azmax)).Shape();
//=================================================================================
void MeasureGUI_CenterMassDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
myGeomBase->EraseSimulationShape();
#include "MeasureGUI.h"
+#include <gp_Pnt.hxx>
+
//=================================================================================
// class : MeasureGUI_CenterMassDlg
// purpose :
#include "QAD_RightFrame.h"
#include "OCCViewer_Viewer3d.h"
+#include <Geom_Plane.hxx>
+#include <TopoDS_Edge.hxx>
#include <BRepExtrema_DistShapeShape.hxx>
#include <AIS_LengthDimension.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
GroupC1->LineEdit3->setText(S);
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
ic->Display(Distance);
ic->UpdateCurrentViewer();
//=================================================================================
void MeasureGUI_DistanceDlg::EraseDistance()
{
- int count = myGeomGUI->GetActiveStudy()->getStudyFramesCount();
+ int count = QAD_Application::getDesktop()->getActiveStudy()->getStudyFramesCount();
for(int i = 0; i < count; i++) {
- if (myGeomGUI->GetActiveStudy()->getStudyFrame(i)->getTypeView() == VIEW_OCC ) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getStudyFrame(i)->getRightFrame()->getViewFrame())->getViewer();
+ if (QAD_Application::getDesktop()->getActiveStudy()->getStudyFrame(i)->getTypeView() == VIEW_OCC ) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getStudyFrame(i)->getRightFrame()->getViewFrame())->getViewer();
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
AIS_ListOfInteractive L;
using namespace std;
#include "MeasureGUI_MaxToleranceDlg.h"
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Face.hxx>
#include <TopExp_Explorer.hxx>
#include <BRep_Tool.hxx>
mySimulationTopoDs.Nullify();
disconnect(mySelection, 0, this, 0);
- myGeomGUI->ResetState();
+ //myGeomGUI->ResetState();
reject();
return;
void MeasureGUI_Skeleton::DeactivateActiveDialog()
{
this->setEnabled(false);
- myGeomGUI->ResetState();
+ //myGeomGUI->ResetState();
disconnect(mySelection, 0, this, 0);
myGeomBase->EraseSimulationShape();
myGeomGUI->SetActiveDialogBox(0);
using namespace std;
#include "MeasureGUI_WhatisDlg.h"
+#include <TopTools_MapOfShape.hxx>
+#include <TCollection_AsciiString.hxx>
+#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopoDS_Iterator.hxx>
OperationGUI_FilletDlg.h \
OperationGUI_ChamferDlg.h
-LIB_CLIENT_IDL = SALOME_Exception.idl \
- GEOM_Gen.idl \
- GEOM_Shape.idl \
- SALOMEDS.idl \
- SALOMEDS_Attributes.idl \
- SALOME_ModuleCatalog.idl \
- SALOME_Component.idl \
+LIB_CLIENT_IDL =
LIB_SERVER_IDL =
# additionnal information to compil and link file
-CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
-CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
+CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -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@
#include "OCCViewer_ViewFrame.h"
#include "SALOMEGUI_QtCatchCorbaException.hxx"
+#include <TopTools_MapOfShape.hxx>
#include <TopExp_Explorer.hxx>
#include <Precision.hxx>
{
OperationGUI* myOperationGUI = new OperationGUI();
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)
{
case 505: // FILLET
{
Handle(AIS_InteractiveContext) ic;
- if(myOperationGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myOperationGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
ic = v3d->getAISContext();
}
OperationGUI_FilletDlg *aDlg = new OperationGUI_FilletDlg(parent, "", myOperationGUI, Sel, ic);
case 506: // CHAMFER
{
Handle(AIS_InteractiveContext) ic;
- if(myOperationGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myOperationGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
ic = v3d->getAISContext();
}
OperationGUI_ChamferDlg *aDlg = new OperationGUI_ChamferDlg(parent, "", myOperationGUI, Sel, ic);
listKeepInsIOR, listRemoveInsIOR,
(CORBA::Short) limit);
if(result->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
return;
}
result->NameType(tr("GEOM_PARTITION"));
if(myGeomBase->Display(result))
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
return;
}
catch(const SALOME::SALOME_Exception& S_ex) {
GEOM::GEOM_Shape_var Result = myGeom->Archimede(Shape, aWeight, aWaterDensity, aMeshingDeflection);
Result->NameType(tr("GEOM_PLANE"));
if(myGeomBase->Display(Result)) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
}
return;
}
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::GenericAttribute_var anAttr;
SALOMEDS::AttributeIOR_var anIOR;
GEOM::GEOM_Shape_var Result = myGeom->Archimede(Shape, aWeight, aWaterDensity, aMeshingDeflection);
Result->NameType(tr("GEOM_PLANE"));
if (myGeomBase->Display(Result)) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
}
}
}
GEOM::GEOM_Shape::ListOfSubShapeID_var ListOfID = new GEOM::GEOM_Shape::ListOfSubShapeID;
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);
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;
}
GEOM::GEOM_Shape_var aShape = myGeom->GetIORFromString(ShapeTopoIOR);
GEOM::GEOM_Shape_var result = myGeom->MakeFillet(aShape, Radius, SubShapeType, ListOfID);
if(result->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
return false;
}
TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, result);
result->NameType(type);
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) {
QtCatchCorbaException(S_ex);
const double Radius, const int SubShapeType,
Standard_Integer& aLocalContextId, bool& myUseLocalContext)
{
- if (myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
+ if (QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
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();
if(myUseLocalContext == false) {
/* No local context opened for fillet method */
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
return false;
}
aResult->NameType(type);
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) {
QtCatchCorbaException(S_ex);
DisplayGUI* myDisplayGUI = new DisplayGUI();
myDisplayGUI->OnDisplayAll(true) ;
- myGeomGUI->GetActiveStudy()->updateObjBrowser();
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_READY"));
+ QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser();
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_READY"));
return true;
}
//=====================================================================================
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);
- SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
+ SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
SALOMEDS::SObject_var theObj = aStudy->FindObjectIOR(ShapeTopoIOR);
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;
}
GEOM::GEOM_Shape_var aShape = myGeom->GetIORFromString(ShapeTopoIOR);
GEOM::GEOM_Shape_var result = myGeom->MakeChamfer(aShape, D1, D2, SubShapeType, ListOfID);
if(result->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
return false;
}
result->NameType(type);
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) {
QtCatchCorbaException(S_ex);
const double D1, const double D2, const int SubShapeType,
Standard_Integer& aLocalContextId, bool& myUseLocalContext)
{
- if (myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
+ if (QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
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();
if(myUseLocalContext == false) {
/* No local context opened for chamfer method */
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
return false;
}
aResult->NameType(type);
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) {
QtCatchCorbaException(S_ex);
DisplayGUI* myDisplayGUI = new DisplayGUI();
myDisplayGUI->OnDisplayAll(true) ;
- myGeomGUI->GetActiveStudy()->updateObjBrowser();
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_READY"));
+ QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser();
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_READY"));
return true;
}
//=================================================================================
void OperationGUI_ArchimedeDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if(myOkIO)
myOperationGUI->Archimede(myIO, myWeight, myWaterDensity, myMeshingDeflection);
return;
#include "OperationGUI_ChamferDlg.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 <BRepTools.hxx>
#include <BRep_Tool.hxx>
#include <TopExp.hxx>
+#include <Precision.hxx>
//=================================================================================
// class : OperationGUI_ChamferDlg()
myConstructorId = 0;
myEditCurrentArgument = Group1->LineEdit1;
- myD1 = 50.0;
- myOkD1 = true;
- myD2 = 50.0;
- myOkD2 = true;
+ myD1 = 5.0;
+ myD2 = 5.0;
myOkShape = false;
myIC = ic;
myLocalContextId = -1;
myUseLocalContext = false;
- /* Get setting of step value from file configuration */
- QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep");
- step = St.toDouble();
-
+ double SpecificStep = 10.0;
/* min, max, step and decimals for spin boxes */
- Group1->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3);
- Group2->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3);
- Group3->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3);
- Group1->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, step, 3);
- Group2->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, step, 3);
- Group3->SpinBox_DY->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, SpecificStep, 3);
+ Group3->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
+ Group1->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
+ Group2->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
+ Group3->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
Group1->SpinBox_DX->SetValue(myD1);
Group2->SpinBox_DX->SetValue(myD1);
mySimulationTopoDs.Nullify();
disconnect(mySelection, 0, this, 0);
myOkShape = false;
- myD1 = 50.0;
- myD2 = 50.0;
- myOkD1 = true;
- myOkD2 = true;
-
-
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
- myIC = v3d->getAISContext();
- if(myUseLocalContext) {
- myIC->CloseLocalContext(myLocalContextId);
- DisplayGUI* myDisplayGUI = new DisplayGUI();
- myDisplayGUI->OnDisplayAll(true);
- myUseLocalContext = false;
- }
+ myD1 = 5.0;
+ myD2 = 5.0;
+
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myUseLocalContext) {
+ myIC->CloseLocalContext(myLocalContextId);
+ DisplayGUI* myDisplayGUI = new DisplayGUI();
+ myDisplayGUI->OnDisplayAll(true);
+ myUseLocalContext = false;
}
+ connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
switch (constructorId)
{
case 0: /* Chamfer All */
Group1->SpinBox_DX->SetValue(myD1);
Group1->SpinBox_DY->SetValue(myD2);
- connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
break;
}
case 1: /* Chamfer edges */
Group2->SpinBox_DX->SetValue(myD1);
Group2->SpinBox_DY->SetValue(myD2);
- connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
break;
}
case 2: /* Chamfer Faces */
Group3->SpinBox_DX->SetValue(myD1);
Group3->SpinBox_DY->SetValue(myD2);
- connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
break;
}
}
//=================================================================================
void OperationGUI_ChamferDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QApplication::setOverrideCursor(Qt::waitCursor);
+ QAD_Application::getDesktop()->putInfo(tr(""));
myGeomBase->EraseSimulationShape();
mySimulationTopoDs.Nullify();
{
case 0 : /* Chamfer All */
{
- if(myOkD1 && myOkD2 && myOkShape)
+ if(myOkShape)
testResult = myOperationGUI->OnChamferGetAll(myShape, myD1, myD2, myShapeType, myShapeIOR);
break;
}
case 1 : /* Chamfer Edge */
{
- if(myOkD1 && myOkD2 && myOkShape)
+ if(myOkShape)
testResult = myOperationGUI->OnChamferGetSelected(myShape, myShapeIOR, myD1, myD2, myShapeType,
myLocalContextId, myUseLocalContext);
break;
}
case 2 : /* Chamfer Face */
{
- if(myOkD1 && myOkD2 && myOkShape)
+ if(myOkShape)
testResult = myOperationGUI->OnChamferGetSelected(myShape, myShapeIOR, myD1, myD2, myShapeType,
myLocalContextId, myUseLocalContext);
break;
}
if(!testResult)
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
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 ...*/
this->ResetStateOfDialog();
+ QApplication::restoreOverrideCursor();
return;
}
//=================================================================================
void OperationGUI_ChamferDlg::ClickOnCancel()
{
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- 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);
- }
- }
+ this->ResetStateOfDialog();
GEOMBase_Skeleton::ClickOnCancel();
return;
}
void OperationGUI_ChamferDlg::SelectionIntoArgument()
{
myGeomBase->EraseSimulationShape();
+ mySimulationTopoDs.Nullify();
myEditCurrentArgument->setText("");
this->ResetStateOfDialog();
QString aString = ""; /* name of selection */
if(!myGeomBase->GetTopoFromSelection(mySelection, S))
return;
if(!IO->hasEntry()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
return;
}
}
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::GenericAttribute_var anAttr;
SALOMEDS::AttributeIOR_var anIOR;
}
}
}
- this->MakePreview();
+ if(myConstructorId == 0)
+ this->MakePreview();
}
else
void OperationGUI_ChamferDlg::DeactivateActiveDialog()
{
this->ResetStateOfDialog();
- DisplayGUI* myDisplayGUI = new DisplayGUI();
- myDisplayGUI->OnDisplayAll(true);
GEOMBase_Skeleton::DeactivateActiveDialog();
return;
}
QObject* send = (QObject*)sender();
if(send == Group1->SpinBox_DX || send == Group2->SpinBox_DX || send == Group3->SpinBox_DX) { /* D1 */
myD1 = newValue;
- myOkD1 = true;
- this->MakePreview();
+ if(myConstructorId == 0)
+ this->MakePreview();
return ;
}
else if(send == Group1->SpinBox_DY || send == Group2->SpinBox_DY || send == Group3->SpinBox_DY) { /* D2 */
myD2 = newValue;
- myOkD2 = true;
- this->MakePreview();
+ if(myConstructorId == 0)
+ this->MakePreview();
return;
}
return;
{
myOkShape = false;
myEditCurrentArgument->setText("");
+ QApplication::restoreOverrideCursor();
/* Close its local contact if opened */
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- 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);
- }
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myUseLocalContext) {
+ myIC->CloseLocalContext(myLocalContextId);
+ myUseLocalContext = false;
+ DisplayGUI* myDisplayGUI = new DisplayGUI();
+ myDisplayGUI->OnDisplayAll(true);
}
return;
}
//=================================================================================
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 {
- BRepFilletAPI_MakeChamfer MC(myShape);
- switch (myConstructorId)
- {
- 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);
+ if(myD1 <= Precision::Confusion() || myD2 <= Precision::Confusion()) {
+ QApplication::restoreOverrideCursor();
+ return;
}
+
+ 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) {
- myGeomBase->EraseSimulationShape();
- mySimulationTopoDs.Nullify();
+ MESSAGE("Exception catched in MakePreview");
+ QApplication::restoreOverrideCursor();
+ return;
}
+ QApplication::restoreOverrideCursor();
return;
+
}
OperationGUI* myOperationGUI;
- double step;
int myConstructorId; /* Current constructor id = radio button id */
/* Interactive and local context management see also : bool myUseLocalContext() */
bool myOkShape;
char* myShapeIOR;
int myShapeType;
- bool myOkD1;
double myD1;
- bool myOkD2;
double myD2;
DlgRef_1Sel2Spin* Group1;
#include "OperationGUI_FilletDlg.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 <BRepFilletAPI_MakeFillet.hxx>
+#include <Precision.hxx>
//=================================================================================
// class : OperationGUI_FilletDlg()
myConstructorId = 0;
myEditCurrentArgument = Group1->LineEdit1;
- myRadius = 50.0;
- myOkRadius = true;
+ myRadius = 5.0;
myOkShape = false;
myIC = ic;
myLocalContextId = -1;
myUseLocalContext = false;
- /* Get setting of step value from file configuration */
- QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep");
- step = St.toDouble();
-
+ double SpecificStep = 10.0;
/* min, max, step and decimals for spin boxes */
- Group1->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3);
- Group2->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3);
- Group3->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, SpecificStep, 3);
+ Group3->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
Group1->SpinBox_DX->SetValue(myRadius);
Group2->SpinBox_DX->SetValue(myRadius);
mySimulationTopoDs.Nullify();
disconnect(mySelection, 0, this, 0);
myOkShape = false;
- myRadius = 50.0;
- myOkRadius = true;
-
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
- myIC = v3d->getAISContext();
- if(myUseLocalContext) {
- myIC->CloseLocalContext(myLocalContextId);
- DisplayGUI* myDisplayGUI = new DisplayGUI();
- myDisplayGUI->OnDisplayAll(true);
- this->myUseLocalContext = false;
- }
+ myRadius = 5.0;
+
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myUseLocalContext) {
+ myIC->CloseLocalContext(myLocalContextId);
+ DisplayGUI* myDisplayGUI = new DisplayGUI();
+ myDisplayGUI->OnDisplayAll(true);
+ myUseLocalContext = false;
}
+ connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
switch (constructorId)
{
case 0: /* Fillet All */
myShapeType = -1;
Group1->SpinBox_DX->SetValue(myRadius);
- connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
break;
}
case 1: /* Fillet edges */
myShapeType = 6;
Group2->SpinBox_DX->SetValue(myRadius);
- connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
break;
}
case 2: /* Fillet Faces */
myShapeType = 4;
Group3->SpinBox_DX->SetValue(myRadius);
- connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
break;
}
}
//=================================================================================
void OperationGUI_FilletDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QApplication::setOverrideCursor(Qt::waitCursor);
+ QAD_Application::getDesktop()->putInfo(tr(""));
myGeomBase->EraseSimulationShape();
mySimulationTopoDs.Nullify();
{
case 0 : /* Fillet All */
{
- if(myOkRadius && myOkShape)
+ if(myOkShape)
testResult = myOperationGUI->OnFilletGetAll(myShape, myRadius, myShapeType, myShapeIOR);
break;
}
case 1 : /* Fillet Edge */
{
- if(myOkRadius && myOkShape)
+ if(myOkShape)
testResult = myOperationGUI->OnFilletGetSelected(myShape, myShapeIOR, myRadius, myShapeType, myLocalContextId, myUseLocalContext);
break;
}
case 2 : /* Fillet Face */
{
- if(myOkRadius && myOkShape)
+ if(myOkShape)
testResult = myOperationGUI->OnFilletGetSelected(myShape, myShapeIOR, myRadius, myShapeType, myLocalContextId, myUseLocalContext);
break;
}
}
if(!testResult)
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
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 ...*/
this->ResetStateOfDialog();
+ QApplication::restoreOverrideCursor();
return;
}
//=================================================================================
void OperationGUI_FilletDlg::ClickOnCancel()
{
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- 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);
- }
- }
+ this->ResetStateOfDialog();
GEOMBase_Skeleton::ClickOnCancel();
return;
}
void OperationGUI_FilletDlg::SelectionIntoArgument()
{
myGeomBase->EraseSimulationShape();
+ mySimulationTopoDs.Nullify();
myEditCurrentArgument->setText("");
this->ResetStateOfDialog();
QString aString = ""; /* name of selection */
if(!myGeomBase->GetTopoFromSelection(mySelection, S))
return;
if(!IO->hasEntry()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
return;
}
}
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::GenericAttribute_var anAttr;
SALOMEDS::AttributeIOR_var anIOR;
}
}
}
- this->MakePreview();
-
+ if(myConstructorId == 0)
+ this->MakePreview();
}
else
return;
//=================================================================================
void OperationGUI_FilletDlg::DeactivateActiveDialog()
{
- this->ResetStateOfDialog();
- DisplayGUI* myDisplayGUI = new DisplayGUI();
- myDisplayGUI->OnDisplayAll(true);
- GEOMBase_Skeleton::DeactivateActiveDialog();
+ this->ResetStateOfDialog();
+ GEOMBase_Skeleton::DeactivateActiveDialog();
+ return;
}
{
myOkShape = false;
myEditCurrentArgument->setText("");
+ QApplication::restoreOverrideCursor();
/* Close its local contact if opened */
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- 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);
- }
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myUseLocalContext) {
+ myIC->CloseLocalContext(myLocalContextId);
+ myUseLocalContext = false;
+ DisplayGUI* myDisplayGUI = new DisplayGUI();
+ myDisplayGUI->OnDisplayAll(true);
}
return;
}
mySimulationTopoDs.Nullify();
myRadius = newValue;
- myOkRadius = true;
- MakePreview();
+ if(myConstructorId == 0)
+ this->MakePreview();
return;
}
//=================================================================================
void OperationGUI_FilletDlg::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 {
- 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();
- break;
- }
- }
- if(!tds.IsNull()) {
- mySimulationTopoDs = tds;
- myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
+ 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) {
- myGeomBase->EraseSimulationShape();
- mySimulationTopoDs.Nullify();
+ MESSAGE("Exception catched in MakePreview");
+ QApplication::restoreOverrideCursor();
+ return;
}
+ QApplication::restoreOverrideCursor();
return;
}
OperationGUI* myOperationGUI;
- double step;
int myConstructorId; /* Current constructor id = radio button id */
/* Interactive and local context management see also : bool myUseLocalContext() */
bool myOkShape;
char* myShapeIOR;
int myShapeType;
- bool myOkRadius;
double myRadius;
DlgRef_1Sel1Spin* Group1;
//=================================================================================
void OperationGUI_PartitionDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if(myOkListShapes || myOkListTools || myOkKeepShape || myOkRemoveShape) {
GEOM::shape_type limit;
PrimitiveGUI_TorusDlg.h \
PrimitiveGUI_ConeDlg.h
-LIB_CLIENT_IDL = SALOME_Exception.idl \
- GEOM_Gen.idl \
- GEOM_Shape.idl \
- SALOMEDS.idl \
- SALOMEDS_Attributes.idl \
- SALOME_ModuleCatalog.idl \
- SALOME_Component.idl \
+LIB_CLIENT_IDL =
LIB_SERVER_IDL =
# additionnal information to compil and link file
-CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
-CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
+CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -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@
{
PrimitiveGUI* aPrimitiveGUI = new PrimitiveGUI();
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)
{
case 4021: // BOX
GEOM::GEOM_Shape_var box = myGeom->MakeBox(P1.X(), P1.Y(), P1.Z(), P2.X(), P2.Y(), P2.Z());
box->NameType(tr("GEOM_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) {
QtCatchCorbaException(S_ex);
GEOM::GEOM_Shape_var result = myGeom->MakeCylinder(pstruct, dstruct, Radius, aHeight);
if (result->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
return;
}
result->NameType(tr("GEOM_CYLINDER"));
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) {
QtCatchCorbaException(S_ex);
GEOM::GEOM_Shape_ptr result = myGeom->MakeSphere(aCenterPoint.X(),aCenterPoint.Y(),aCenterPoint.Z(), aRadius);
result->NameType(tr("GEOM_SPHERE"));
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) {
QtCatchCorbaException(S_ex);
GEOM::GEOM_Shape_var result = myGeom->MakeTorus(pstruct, dstruct, Radius1, Radius2);
if(result->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
return;
}
result->NameType(tr("GEOM_TORUS"));
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) {
QtCatchCorbaException(S_ex);
GEOM::GEOM_Shape_var result = myGeom->MakeCone(pstruct, dstruct, Radius1, Radius2, aHeight);
if(result->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
return;
}
result->NameType(tr("GEOM_CONE"));
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) {
QtCatchCorbaException(S_ex);
//=================================================================================
void PrimitiveGUI_BoxDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
myGeomBase->EraseSimulationShape();
using namespace std;
#include "PrimitiveGUI_ConeDlg.h"
+#include <gp_Lin.hxx>
#include <BRepPrimAPI_MakeCone.hxx>
#include <BRepPrimAPI_MakeCylinder.hxx>
#include <BRepAdaptor_Curve.hxx>
//=================================================================================
void PrimitiveGUI_ConeDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
myGeomBase->EraseSimulationShape();
using namespace std;
#include "PrimitiveGUI_CylinderDlg.h"
+#include <gp_Lin.hxx>
#include <BRepPrimAPI_MakeCylinder.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <Precision.hxx>
//=================================================================================
void PrimitiveGUI_CylinderDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
myGeomBase->EraseSimulationShape();
//=================================================================================
void PrimitiveGUI_SphereDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if(mySimulationTopoDs.IsNull())
return;
myGeomBase->EraseSimulationShape();
using namespace std;
#include "PrimitiveGUI_TorusDlg.h"
+#include <gp_Lin.hxx>
#include <BRepPrimAPI_MakeTorus.hxx>
#include <BRepAdaptor_Curve.hxx>
#include "QAD_Config.h"
//=================================================================================
void PrimitiveGUI_TorusDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
myGeomBase->EraseSimulationShape();
RepairGUI_SuppressFacesDlg.h \
RepairGUI_SuppressHoleDlg.h
-LIB_CLIENT_IDL = SALOME_Exception.idl \
- GEOM_Gen.idl \
- GEOM_Shape.idl \
- SALOMEDS.idl \
- SALOMEDS_Attributes.idl \
- SALOME_ModuleCatalog.idl \
- SALOME_Component.idl \
+LIB_CLIENT_IDL =
LIB_SERVER_IDL =
# additionnal information to compil and link file
-CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
-CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
+CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -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@
{
RepairGUI* myRepairGUI = new RepairGUI();
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)
{
case 603: // SUPPRESS FACES : use ic
{
Handle(AIS_InteractiveContext) ic;
- if(myRepairGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myRepairGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
ic = v3d->getAISContext();
}
RepairGUI_SuppressFacesDlg *aDlg = new RepairGUI_SuppressFacesDlg(parent, "", myRepairGUI, Sel, ic);
case 604: // SUPPRESS HOLES : use ic
{
Handle(AIS_InteractiveContext) ic;
- if(myRepairGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myRepairGUI->myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
ic = v3d->getAISContext();
}
RepairGUI_SuppressHoleDlg *aDlg = new RepairGUI_SuppressHoleDlg(parent, "", myRepairGUI, Sel, ic);
try {
GEOM::GEOM_Shape_var result = myGeom->MakeSewing(listShapesIOR, precision);
if(result->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
return;
}
result->NameType(type);
if(myGeomBase->Display(result))
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
return;
}
catch(const SALOME::SALOME_Exception& S_ex) {
try {
GEOM::GEOM_Shape_var result = myGeom->OrientationChange(Shape);
if(result->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
return;
}
result->NameType(Shape->NameType());
if(myGeomBase->Display(result))
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
return;
}
catch(const SALOME::SALOME_Exception& S_ex) {
const GEOM::GEOM_Shape::ListOfSubShapeID& ListOfIdEndFace)
{
/* Test the type of viewer */
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC )
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC )
return false;
try {
aResult->NameType(type);
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) {
QtCatchCorbaException(S_ex);
const GEOM::GEOM_Shape::ListOfSubShapeID& ListOfIdWires)
{
/* Test the type of viewer */
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
return false;
try {
aResult->NameType(type);
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) {
QtCatchCorbaException(S_ex);
const Standard_Integer& aLocalContextId, bool& myUseLocalContext)
{
/* Test the type of viewer */
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
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);
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;
}
- 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();
if(myUseLocalContext == false) {
/* Display with name */
if(!myGeomBase->Display(aShellOrFace, nameG)) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
return false;
}
}
- myGeomGUI->GetDesktop()->putInfo (tr("GEOM_PRP_READY"));
+ QAD_Application::getDesktop()->putInfo (tr("GEOM_PRP_READY"));
return true;
}
void GeometryGUI_FillingHoleDlg::ClickOnApply()
{
bool testResult = false ;
- myGeomGUI->GetDesktop()->putInfo( tr("") ) ;
+ QAD_Application::getDesktop()->putInfo( tr("") ) ;
switch(myConstructorId)
{
testResult = myGeomGUI->OnFillingHole( myShape, myShapeIOR, myLocalContextId, myUseLocalContext ) ;
}
if( !testResult ) {
- myGeomGUI->GetDesktop()->putInfo(tr("Operation aborted")) ;
+ QAD_Application::getDesktop()->putInfo(tr("Operation aborted")) ;
}
else {
- myGeomGUI->GetDesktop()->putInfo(tr("Operation done"));
+ QAD_Application::getDesktop()->putInfo(tr("Operation done"));
}
/* Reset arguments to allow a new selection */
this->ResetStateOfDialog() ;
return ;
// 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 ;
// }
}
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::GenericAttribute_var anAttr;
SALOMEDS::AttributeIOR_var anIOR;
if( !this->myOkShape ) {
this->ResetStateOfDialog() ;
- myGeomGUI->GetDesktop()->putInfo(tr("Select main shape first")) ;
+ QAD_Application::getDesktop()->putInfo(tr("Select main shape first")) ;
return ;
}
TopAbs_ShapeEnum aType = TopAbs_EDGE ;
myGeomGUI->PrepareSubShapeSelection( int(aType), this->myLocalContextId ) ;
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 ;
}
#include "RepairGUI_OrientationDlg.h"
#include <Precision.hxx>
-#include "QAD_Config.h"
-
#include <TopoDS_Compound.hxx>
#include <BRep_Builder.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepAdaptor_Surface.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()
// purpose : Constructs a RepairGUI_OrientationDlg which is a child of 'parent', with the
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
//=================================================================================
-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 )
+RepairGUI_OrientationDlg::RepairGUI_OrientationDlg(QWidget* parent, const char* name, RepairGUI* theRepairGUI, SALOME_Selection* Sel, bool modal, WFlags fl)
+ :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 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 );
-
- /***************************************************************/
- 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" );
- GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) );
- GroupButtons->setTitle( tr( "" ) );
- 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 );
- 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 );
-
- /***************************************************************/
- GroupC1 = new QGroupBox( this, "GroupC1" );
- GroupC1->setTitle( tr( "GEOM_ARGUMENTS" ) );
- GroupC1->setMinimumSize( QSize( 0, 0 ) );
- GroupC1->setFrameShape( QGroupBox::Box );
- 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 );
- LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" );
- GroupC1Layout->addWidget( LineEditC1A1, 0, 2 );
-
- /* Spin box construction */
- 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 */
-
+ QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_ORIENTATION")));
+ QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
+
+ setCaption(tr("GEOM_ORIENTATION_TITLE"));
+
+ /***************************************************************/
+ GroupConstructors->setTitle(tr("GEOM_ORIENTATION"));
+ RadioButton1->setPixmap(image0);
+ RadioButton2->close(TRUE);
+ RadioButton3->close(TRUE);
+
+ GroupPoints = new DlgRef_1Sel1Spin1Check(this, "GroupPoints");
+ GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
+ GroupPoints->TextLabel1->setText(tr("GEOM_OBJECT"));
+ GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR_LENGTH"));
+ GroupPoints->CheckButton1->setText(tr("GEOM_ORIENTATION_OPT"));
+ GroupPoints->PushButton1->setPixmap(image1);
+
+ Layout1->addWidget(GroupPoints, 1, 0);
+ /***************************************************************/
+
+ /* Initialisations */
+ myRepairGUI = theRepairGUI;
+ Init();
}
+
//=================================================================================
// function : ~RepairGUI_OrientationDlg()
// purpose : Destroys the object and frees any allocated resources
//=================================================================================
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
}
// function : Init()
// purpose :
//=================================================================================
-void RepairGUI_OrientationDlg::Init( SALOME_Selection* Sel )
+void RepairGUI_OrientationDlg::Init()
{
+ /* init variables */
+ myEditCurrentArgument = GroupPoints->LineEdit1;
- double step ;
- QString St = QAD_CONFIG->getSetting( "Geometry:SettingsGeomStep" ) ;
- step = St.toDouble() ;
-
- /* min, max, step and decimals for spin boxes */
- SpinBox_C1A2->RangeStepAndValidator( 0.001, 999.999, step, 3 ) ;
- SpinBox_C1A2->SetValue( 25.0 ) ; /* = myLength */
+ myLength = 25.0;
+ myOkShape = false;
- GroupC1->show();
- myConstructorId = 0 ;
- Constructor1->setChecked( TRUE );
- CheckBoxReverse->setChecked( FALSE );
- myEditCurrentArgument = LineEditC1A1 ;
- mySelection = Sel;
- myGeomBase = new GEOMBase() ;
- myGeomGUI = GEOMContext::GetGeomGUI() ;
+ double SpecificStep = 10;
+ /* min, max, step and decimals for spin boxes & initial values */
+ GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
+ GroupPoints->SpinBox_DX->SetValue(myLength);
- myLength = 25.0 ;
- myOkShape = false ;
- myOkLength = true;
- mySimulationTopoDs.Nullify() ;
- myShape.Nullify() ;
- myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ;
+ /* signals and slots connections */
+ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+ connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
- // TODO : previous selection into argument ?
+ connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
- /* Filter definitions */
- Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM");
- myGeom = GEOM::GEOM_Gen::_narrow(comp);
+ connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
- /* 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( 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( SpinBox_C1A2, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ;
-
- connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ;
- connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
- /* to close dialog if study change */
- connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ;
-
- /* Move widget on the botton right corner of main widget */
- int x, y ;
- myGeomBase->DefineDlgPosition( this, x, y ) ;
- this->move( x, y ) ;
- this->show() ; /* displays Dialog */
-
- return ;
-}
+ connect(GroupPoints->CheckButton1, SIGNAL(stateChanged(int)), this, SLOT(ReverseAngle(int)));
+
+ connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ /* displays Dialog */
+ GroupPoints->show();
+ this->show();
-//=================================================================================
-// function : ConstructorsClicked()
-// purpose : Radio button management
-//=================================================================================
-void RepairGUI_OrientationDlg::ConstructorsClicked(int constructorId)
-{
- return ;
+ return;
}
+
//=================================================================================
// function : ClickOnOk()
// purpose :
//=================================================================================
void RepairGUI_OrientationDlg::ClickOnOk()
{
- this->ClickOnApply() ;
- this->ClickOnCancel() ;
-
- return ;
+ this->ClickOnApply();
+ ClickOnCancel();
+ return;
}
+
//=================================================================================
// function : ClickOnApply()
// purpose :
//=================================================================================
void RepairGUI_OrientationDlg::ClickOnApply()
{
- /* Leave simulation display in this method ! */
- myGeomGUI->GetDesktop()->putInfo( tr("") ) ;
-
- switch(myConstructorId)
- {
- case 0 :
- {
- 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 ) ;
+ QAD_Application::getDesktop()->putInfo(tr(""));
+ if (mySimulationTopoDs.IsNull())
+ return;
+ myGeomBase->EraseSimulationShape();
+ mySimulationTopoDs.Nullify();
+
+ if(myOkShape && GroupPoints->CheckButton1->isChecked()) {
+ myRepairGUI->MakeOrientationChangeAndDisplay(myGeomShape);
+ GroupPoints->CheckButton1->setChecked(FALSE);
}
- return ;
+ return;
}
-
//=================================================================================
// function : SelectionIntoArgument()
// purpose : Called when selection as changed or other case
//=================================================================================
void RepairGUI_OrientationDlg::SelectionIntoArgument()
{
- myGeomBase->EraseSimulationShape() ;
- this->mySimulationTopoDs.Nullify() ;
-
- /* Name of future selection */
- QString aString = "";
-
- int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString) ;
- if ( nbSel != 1 ) {
- if ( myEditCurrentArgument == LineEditC1A1 ) {
- LineEditC1A1->setText("") ;
- this->myOkShape = false ;
- }
- return ;
- }
+ myGeomBase->EraseSimulationShape();
+ mySimulationTopoDs.Nullify();
+ myEditCurrentArgument->setText("");
+ QString aString = ""; /* name of selection */
- /* nbSel == 1 ! */
- TopoDS_Shape S;
- Standard_Boolean testResult ;
- Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ;
- if( !myGeomBase->GetTopoFromSelection(mySelection, S) )
- return ;
-
- /* Constructor */
- if ( myEditCurrentArgument == LineEditC1A1 ) {
- myGeomShape = myGeomBase->ConvertIOinGEOMShape(IO, testResult) ;
- if( !testResult )
- return ;
- LineEditC1A1->setText(aString) ;
- myShape = S ;
- myOkShape = true ;
+ int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
+ if(nbSel != 1) {
+ if(myEditCurrentArgument == GroupPoints->LineEdit1)
+ myOkShape = false;
+ return;
}
-
- if( myOkShape && myOkLength ) {
- MakeOrientationSimulationAndDisplay( this->myShape, this->myLength ) ;
+
+ // nbSel == 1
+ TopoDS_Shape S;
+ Standard_Boolean testResult;
+ Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
+ if(!myGeomBase->GetTopoFromSelection(mySelection, S))
+ return;
+
+ if(myEditCurrentArgument == GroupPoints->LineEdit1) {
+ myGeomShape = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
+ if(!testResult)
+ return;
+ myEditCurrentArgument->setText(aString);
+ myShape = S;
+ myOkShape = true;
}
- return ;
+
+ if(myOkShape)
+ this->MakeOrientationSimulationAndDisplay();
+ return;
}
//=================================================================================
-// function : SetEditCurrentArgument()
+// function : LineEditReturnPressed()
// purpose :
//=================================================================================
-void RepairGUI_OrientationDlg::SetEditCurrentArgument()
+void RepairGUI_OrientationDlg::LineEditReturnPressed()
{
- QPushButton* send = (QPushButton*)sender();
- switch (myConstructorId)
- {
- case 0: /* default constructor */
- {
- if(send == SelectButtonC1A1) {
- LineEditC1A1->setFocus() ;
- myEditCurrentArgument = LineEditC1A1 ;
- }
- SelectionIntoArgument() ;
- break;
- }
- }
- return ;
-}
-
+ QLineEdit* send = (QLineEdit*)sender();
+ if(send == GroupPoints->LineEdit1)
+ myEditCurrentArgument = GroupPoints->LineEdit1;
+ else
+ return;
-//=================================================================================
-// function : ValueChangedInSpinBox()
-// purpose :
-//=================================================================================
-void RepairGUI_OrientationDlg::ValueChangedInSpinBox( double newValue )
-{
- myGeomBase->EraseSimulationShape() ;
- mySimulationTopoDs.Nullify() ;
-
- QObject* send = (QObject*)sender() ;
- if( send == SpinBox_C1A2 ) {
- this->myLength = newValue ;
- myOkLength = true ;
- }
-
- if ( myConstructorId == 0 && myOkShape && myOkLength == true ) {
- MakeOrientationSimulationAndDisplay( this->myShape, this->myLength ) ;
- }
- return ;
+ GEOMBase_Skeleton::LineEditReturnPressed();
+ return;
}
//=================================================================================
-// function : DeactivateActiveDialog()
+// function : SetEditCurrentArgument()
// purpose :
//=================================================================================
-void RepairGUI_OrientationDlg::DeactivateActiveDialog()
+void RepairGUI_OrientationDlg::SetEditCurrentArgument()
{
- if ( GroupConstructors->isEnabled() ) {
- GroupConstructors->setEnabled(false) ;
- GroupButtons->setEnabled(false) ;
- GroupC1->setEnabled(false) ;
- disconnect( mySelection, 0, this, 0 );
- myGeomBase->EraseSimulationShape() ;
+ QPushButton* send = (QPushButton*)sender();
+
+ if(send == GroupPoints->PushButton1) {
+ GroupPoints->LineEdit1->setFocus();
+ myEditCurrentArgument = GroupPoints->LineEdit1;
}
- return ;
+ this->SelectionIntoArgument();
+
+ return;
}
//=================================================================================
void RepairGUI_OrientationDlg::ActivateThisDialog()
{
- /* Emit a signal to deactivate the active dialog */
- myGeomGUI->EmitSignalDeactivateDialog() ;
- GroupConstructors->setEnabled(true) ;
- GroupButtons->setEnabled(true) ;
- GroupC1->setEnabled(true) ;
-
- connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
- if( !mySimulationTopoDs.IsNull() )
- myGeomBase->DisplaySimulationShape( mySimulationTopoDs ) ;
-
- return ;
+ GEOMBase_Skeleton::ActivateThisDialog();
+ connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ GroupPoints->LineEdit1->setFocus();
+ myEditCurrentArgument = GroupPoints->LineEdit1;
+ if(!mySimulationTopoDs.IsNull())
+ myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
+ return;
}
//=================================================================================
void RepairGUI_OrientationDlg::enterEvent(QEvent* e)
{
- if ( GroupConstructors->isEnabled() )
- return ;
- ActivateThisDialog() ;
- return ;
+ if (GroupConstructors->isEnabled())
+ return;
+ this->ActivateThisDialog();
+ return;
}
-
//=================================================================================
-// function : closeEvent()
+// function : ValueChangedInSpinBox()
// purpose :
//=================================================================================
-void RepairGUI_OrientationDlg::closeEvent( QCloseEvent* e )
+void RepairGUI_OrientationDlg::ValueChangedInSpinBox(double newValue)
{
- /* same than click on cancel button */
- this->ClickOnCancel() ;
- return ;
+ myLength = newValue;
+ if(myOkShape)
+ this->MakeOrientationSimulationAndDisplay();
+ return;
}
-
-//===========================================================================================
+//=================================================================================
// function : ReverseOrientation()
// purpose :
-//===========================================================================================
-void RepairGUI_OrientationDlg::ReverseOrientation(int state)
+//=================================================================================
+void RepairGUI_OrientationDlg::ReverseAngle(int state)
{
- if( this->myOkShape && myOkLength == true ) {
- MakeOrientationSimulationAndDisplay( this->myShape, this-> myLength ) ;
- }
- return ;
+ if(myOkShape)
+ this->MakeOrientationSimulationAndDisplay();
+ return;
}
-//===========================================================================================
+//==================================================================================
// function : MakeOrientationSimulationAndDisplay()
// purpose : Create 'aCompound1' and 'aCompound2' each contains edges oriented
// : respectively FORWARD and REVERSE for all faces of 'aTopoDS'
// : These edges represent normal vectors on faces of 'aTopoDS'
// : 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() ;
- mySimulationTopoDs.Nullify() ;
+ myGeomBase->EraseSimulationShape();
+ mySimulationTopoDs.Nullify();
- TopoDS_Compound aCompound1, aCompound2 ;
- TopoDS_Compound NullComp ;
+ TopoDS_Compound aCompound1, aCompound2;
+ TopoDS_Compound NullComp;
BRep_Builder aBuilder1, aBuilder2;
- aCompound1 = aCompound2 = NullComp ;
- aBuilder1.MakeCompound(aCompound1) ;
- aBuilder2.MakeCompound(aCompound2) ;
-
- if( aTopoDS.IsNull() )
- return ;
+ aCompound1 = aCompound2 = NullComp;
+ aBuilder1.MakeCompound(aCompound1);
+ aBuilder2.MakeCompound(aCompound2);
- /* Case of an edge */
- if( aTopoDS.ShapeType() == TopAbs_EDGE ) {
- /* Try to display a cone simulation shape to show direction of edge */
- TopoDS_Shape tmpShape = aTopoDS ;
- if( this->CheckBoxReverse->isChecked() ) {
- if( aTopoDS.Orientation() == TopAbs_FORWARD)
- tmpShape.Orientation(TopAbs_REVERSED) ;
- else
- tmpShape.Orientation(TopAbs_FORWARD) ;
- }
- if( myGeomBase->CreateArrowForLinearEdge( tmpShape, mySimulationTopoDs ) ) {
- myGeomBase->DisplaySimulationShape( mySimulationTopoDs ) ;
+ if(myShape.IsNull())
+ return;
+
+ try {
+ /* Case of an edge */
+ if(myShape.ShapeType() == TopAbs_EDGE) {
+ /* Try to display a cone simulation shape to show direction of edge */
+ TopoDS_Shape tmpShape = myShape ;
+ if(GroupPoints->CheckButton1->isChecked()) {
+ if(myShape.Orientation() == TopAbs_FORWARD)
+ tmpShape.Orientation(TopAbs_REVERSED);
+ else
+ tmpShape.Orientation(TopAbs_FORWARD);
+ }
+ if(myGeomBase->CreateArrowForLinearEdge(tmpShape, mySimulationTopoDs))
+ myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
+ return;
}
- return ;
- }
-
- gp_Pnt P1, P2 ;
- 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;
+ 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 ;
+ 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 ;
+ 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 ) ;
- }
+ 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
- P2.Translate(-V) ;
- BRepBuilderAPI_MakeEdge anEdge(P1, P2) ;
- aBuilder1.Add( aCompound1, anEdge ) ;
+ 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 ) ;
+ 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++ ;
- }
+ ex.Next();
+ test++;
+ }
- /* display simulation compounds */
- if( test > 0 && this->CheckBoxReverse->isChecked() ) {
- mySimulationTopoDs = aCompound1 ;
+ /* display simulation compounds */
+ if(test > 0 && GroupPoints->CheckButton1->isChecked())
+ mySimulationTopoDs = aCompound1;
+ else if(test > 0 && !GroupPoints->CheckButton1->isChecked())
+ mySimulationTopoDs = aCompound2;
+
+ if(!mySimulationTopoDs.IsNull())
+ myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
}
- else if ( test > 0 && !CheckBoxReverse->isChecked() ) {
- mySimulationTopoDs = aCompound2 ;
- }
- if(!mySimulationTopoDs.IsNull() )
- myGeomBase->DisplaySimulationShape(mySimulationTopoDs) ;
-
- return ;
+ catch(Standard_Failure)
+ MESSAGE("Exception catched in MakeOrientationSimulationAndDisplay");
+ return;
}
#ifndef DIALOGBOX_ORIENTATION_H
#define DIALOGBOX_ORIENTATION_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;
+#include "GEOMBase_Skeleton.h"
+#include "DlgRef_1Sel1Spin1Check.h"
+#include "RepairGUI.h"
//=================================================================================
// class : DialogBox_ORIENTATION
// purpose :
//=================================================================================
-class RepairGUI_OrientationDlg : public QDialog
+class RepairGUI_OrientationDlg : public GEOMBase_Skeleton
{
Q_OBJECT
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();
private :
- 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 Init();
+ void enterEvent(QEvent* e);
+ void MakeOrientationSimulationAndDisplay();
- void closeEvent( QCloseEvent* e ) ;
- void enterEvent( QEvent* e);
- void Init( SALOME_Selection* Sel ) ;
- void MakeOrientationSimulationAndDisplay( const TopoDS_Shape& aTopoDS, Standard_Real length ) ;
+ RepairGUI* myRepairGUI;
- QButtonGroup* GroupConstructors;
- QRadioButton* Constructor1;
- QGroupBox* GroupButtons;
- QPushButton* buttonOk;
- QPushButton* buttonCancel;
- QPushButton* buttonApply;
- QGroupBox* GroupC1;
- QLineEdit* LineEditC1A1;
- DlgRef_SpinBox* SpinBox_C1A2 ;
+ GEOM::GEOM_Shape_var myGeomShape; /* is myShape */
+ TopoDS_Shape myShape; /* topology used */
+ Standard_Real myLength; /* to simulate normal vector */
+ bool myOkShape;
- QPushButton* SelectButtonC1A1;
- QLabel* TextLabelC1A1;
- QLabel* TextLabelC1A2;
- QCheckBox* CheckBoxReverse;
+ DlgRef_1Sel1Spin1Check* GroupPoints;
private slots:
-
- void ConstructorsClicked(int constructorId);
void ClickOnOk();
- void ClickOnCancel();
void ClickOnApply();
- void SetEditCurrentArgument() ;
- void SelectionIntoArgument() ;
- void LineEditReturnPressed() ;
- void DeactivateActiveDialog() ;
- void ActivateThisDialog() ;
- void ReverseOrientation(int state) ;
- void ValueChangedInSpinBox( double newValue ) ;
-
-protected:
+ void ActivateThisDialog();
+ void LineEditReturnPressed();
+ void SelectionIntoArgument();
+ void SetEditCurrentArgument();
+ void ReverseAngle(int state);
+ void ValueChangedInSpinBox(double newValue);
- QGridLayout* RepairGUI_OrientationDlgLayout;
- QGridLayout* GroupConstructorsLayout;
- QGridLayout* GroupButtonsLayout;
- QGridLayout* GroupC1Layout;
};
#endif // DIALOGBOX_ORIENTATION_H
//=================================================================================
void RepairGUI_SewingDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if(myOkListShapes)
myRepairGUI->MakeSewingAndDisplay(myListShapes, myPrecision);
return;
#include "RepairGUI_SuppressFacesDlg.h"
#include "DisplayGUI.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>
+#include "QAD_RightFrame.h"
+#include "OCCViewer_Viewer3d.h"
//=================================================================================
// class : RepairGUI_SuppressFacesDlg()
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
//=================================================================================
-RepairGUI_SuppressFacesDlg::RepairGUI_SuppressFacesDlg( QWidget* parent,
- const char* name,
- 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 )
+RepairGUI_SuppressFacesDlg::RepairGUI_SuppressFacesDlg(QWidget* parent, const char* name, RepairGUI* theRepairGUI, SALOME_Selection* Sel, Handle(AIS_InteractiveContext) ic, bool modal, WFlags fl)
+ :GEOMBase_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{
- QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_SUPRESS_FACE")));
- QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT")));
+ QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_SUPRESS_FACE")));
+ QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
- if ( !name )
- 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->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_SuppressFacesDlgLayout->addWidget( GroupConstructors, 0, 0 );
-
- /***************************************************************/
- GroupC1 = new QGroupBox( this, "GroupC1" );
- GroupC1->setTitle( tr( "GEOM_ARGUMENTS" ) );
- GroupC1->setMinimumSize( QSize( 0, 0 ) );
- GroupC1->setFrameShape( QGroupBox::Box );
- 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 );
-
- /***************************************************************/
- 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) ;
-
+ setCaption(tr("GEOM_SUPRESSFACE_TITLE"));
+
+ /***************************************************************/
+ GroupConstructors->setTitle(tr("GEOM_SUPRESSFACE"));
+ RadioButton1->setPixmap(image0);
+ RadioButton2->close(TRUE);
+ RadioButton3->close(TRUE);
+
+ GroupPoints = new DlgRef_1Sel1Check_QTD(this, "GroupPoints");
+ GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
+ GroupPoints->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
+ GroupPoints->CheckButton1->setText(tr("GEOM_SUPRESSFACE_SELECT"));
+ GroupPoints->PushButton1->setPixmap(image1);
+
+ Layout1->addWidget(GroupPoints, 1, 0);
+ /***************************************************************/
+
+ /* Initialisations */
+ myRepairGUI = theRepairGUI;
+ Init(ic);
}
//=================================================================================
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()
// 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();
- myConstructorId = 0 ;
- Constructor1->setChecked( TRUE );
- myEditCurrentArgument = LineEditC1A1 ;
- mySelection = Sel;
- myShape.Nullify() ;
+ myOkSelectSubMode = false;
+ myOkShape = myUseLocalContext = false;
+ myIC = ic;
+ myLocalContextId = -1;
- myIC = ic ;
- myUseLocalContext = false ;
- myOkShape = false ;
- myGeomBase = new GEOMBase() ;
- myGeomGUI = GEOMContext::GetGeomGUI() ;
-
- /* Select sub shapes mode not checked */
- CheckBox1->setChecked( FALSE );
- myOkSelectSubMode = false ;
+ /* signals and slots connections */
+ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+ connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
+ connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
- // TODO : previous selection into argument ?
+ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+ connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
- /* Filter definitions */
- Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM");
- myGeom = GEOM::GEOM_Gen::_narrow(comp);
+ connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
- /* signals and slots connections */
- connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
- connect( buttonApply, SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
- connect( buttonClose, SIGNAL( clicked() ), this, SLOT( ClickOnClose() ) );
- connect( GroupConstructors, SIGNAL( clicked(int) ), this, SLOT( ConstructorsClicked(int) ));
-
- connect( SelectButtonC1A1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ));
- connect( CheckBox1, SIGNAL( stateChanged(int) ), this, SLOT( ActivateUserSelection() ));
- 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 */
- int x, y ;
- 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()));
+ /* displays Dialog */
+ GroupPoints->show();
+ this->show();
-//=================================================================================
-// function : ConstructorsClicked()
-// purpose : Radio button management
-//=================================================================================
-void RepairGUI_SuppressFacesDlg::ConstructorsClicked(int constructorId)
-{
- return ;
+ return;
}
//=================================================================================
void RepairGUI_SuppressFacesDlg::ClickOnOk()
{
- this->ClickOnApply() ;
- accept();
-
- return ;
+ this->ClickOnApply();
+ this->ClickOnCancel();
+ return;
}
//=================================================================================
void RepairGUI_SuppressFacesDlg::ClickOnApply()
{
- bool testResult = false ;
- switch(myConstructorId)
- {
- case 0 :
- {
- if( myOkShape && myOkSelectSubMode ) {
- testResult = myRepairGUI->OnSuppressFaces( myShape, myShapeIOR, myLocalContextId, myUseLocalContext ) ;
- }
- if( !testResult ) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT")) ;
- }
- else {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE")) ;
- }
- /* Reset arguments to allow a new selection */
- this->ResetStateOfDialog() ;
- break ;
- }
- }
+ QAD_Application::getDesktop()->putInfo(tr(""));
+ bool testResult = false;
+
+ if(myOkShape && myOkSelectSubMode)
+ testResult = myRepairGUI->OnSuppressFaces(myShape, myShapeIOR, myLocalContextId, myUseLocalContext);
+
+ if(!testResult)
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
+ else
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
+
+ /* Reset arguments to allow a new selection */
+ this->ResetStateOfDialog();
return ;
}
-
//=================================================================================
-// function : ClickOnClose()
+// function : ClickOnCancel()
// purpose :
//=================================================================================
-void RepairGUI_SuppressFacesDlg::ClickOnClose()
+void RepairGUI_SuppressFacesDlg::ClickOnCancel()
{
- disconnect( mySelection, 0, this, 0 );
- myGeomGUI->ResetState() ;
-
- if(myUseLocalContext) {
- myIC->CloseLocalContext(myLocalContextId) ;
- this->myUseLocalContext = false ;
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ myIC = v3d->getAISContext();
+ if(myUseLocalContext) {
+ myIC->CloseLocalContext(myLocalContextId);
+ myUseLocalContext = false;
+ }
DisplayGUI* myDisplayGUI = new DisplayGUI();
- myDisplayGUI->OnDisplayAll(true) ;
+ myDisplayGUI->OnDisplayAll(true);
}
- reject() ;
- return ;
+ GEOMBase_Skeleton::ClickOnCancel();
+ return;
}
//=================================================================================
void RepairGUI_SuppressFacesDlg::SelectionIntoArgument()
{
-
- /* Reset argument and local context when selection as changed */
- this->ResetStateOfDialog() ;
-
+ myEditCurrentArgument->setText("");
+ this->ResetStateOfDialog();
QString aString = ""; /* name of selection */
-
- int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString) ;
- if ( nbSel != 1 )
- return ;
+
+ int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
+ if(nbSel != 1) {
+ myOkShape = false;
+ return;
+ }
/* nbSel == 1 */
- TopoDS_Shape S ;
- Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ;
-
- if( !myGeomBase->GetTopoFromSelection(mySelection, S) )
- return ;
+ TopoDS_Shape S;
+ Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
+ if(!myGeomBase->GetTopoFromSelection(mySelection, S))
+ return;
- if( !IO->hasEntry() ) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY")) ;
- return ;
+ if(!IO->hasEntry()) {
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
+ return;
}
-
+
/* 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 ( IO->IsInstance(STANDARD_TYPE(GEOM_InteractiveObject)) ) {
- Handle(GEOM_InteractiveObject) GIObject = Handle(GEOM_InteractiveObject)::DownCast( IO );
+ if(!S.IsNull() && (S.ShapeType() == TopAbs_SOLID || S.ShapeType() == TopAbs_SHELL || S.ShapeType() == TopAbs_COMPOUND)) {
+ if(IO->IsInstance(STANDARD_TYPE(GEOM_InteractiveObject))) {
+ Handle(GEOM_InteractiveObject) GIObject = Handle(GEOM_InteractiveObject)::DownCast(IO);
myShapeIOR = GIObject->getIOR(); /* the Geom IOR string of selection */
- LineEditC1A1->setText(aString) ;
- myShape = S ;
- myOkShape = true ;
+ myEditCurrentArgument->setText(aString);
+ myShape = S;
+ myOkShape = true;
return;
}
- if ( IO->hasEntry() ) {
- SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
- SALOMEDS::SObject_var obj = aStudy->FindObjectID( IO->getEntry() );
+ if(IO->hasEntry()) {
+ SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
+ SALOMEDS::SObject_var obj = aStudy->FindObjectID(IO->getEntry());
SALOMEDS::GenericAttribute_var anAttr;
- SALOMEDS::AttributeIOR_var anIOR;
- if ( !obj->_is_nil() ) {
- if (obj->FindAttribute(anAttr, "AttributeIOR")) {
+ SALOMEDS::AttributeIOR_var anIOR;
+ if(!obj->_is_nil()) {
+ if(obj->FindAttribute(anAttr, "AttributeIOR")) {
anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
myShapeIOR = anIOR->Value();
- myOkShape = true ;
- myShape = S ;
- LineEditC1A1->setText(aString) ;
+ myOkShape = true;
+ myShape = S;
+ myEditCurrentArgument->setText(aString);
return;
}
}
}
}
- return ;
+ return;
}
void RepairGUI_SuppressFacesDlg::SetEditCurrentArgument()
{
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();
+ myEditCurrentArgument = GroupPoints->LineEdit1;
+ }
+ this->SelectionIntoArgument();
+
+ return;
}
//=================================================================================
void RepairGUI_SuppressFacesDlg::LineEditReturnPressed()
{
- return ;
+ QLineEdit* send = (QLineEdit*)sender();
+ if(send == GroupPoints->LineEdit1)
+ myEditCurrentArgument = GroupPoints->LineEdit1;
+ else
+ return;
+
+ GEOMBase_Skeleton::LineEditReturnPressed();
+ return;
}
//=================================================================================
void RepairGUI_SuppressFacesDlg::DeactivateActiveDialog()
{
- if ( GroupConstructors->isEnabled() ) {
-
- this->ResetStateOfDialog() ;
-
- 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) ;
+ if(GroupConstructors->isEnabled()) {
+ this->ResetStateOfDialog();
+ GEOMBase_Skeleton::DeactivateActiveDialog();
}
- return ;
+ return;
}
//=================================================================================
void RepairGUI_SuppressFacesDlg::ActivateThisDialog()
{
- /* Emit a signal to deactivate other active dialog */
- myGeomGUI->EmitSignalDeactivateDialog() ;
- GroupConstructors->setEnabled(true) ;
- GroupC1->setEnabled(true) ;
- GroupButtons->setEnabled(true) ;
- connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
- myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ;
- return ;
+ GEOMBase_Skeleton::ActivateThisDialog();
+ connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ return;
}
//=================================================================================
void RepairGUI_SuppressFacesDlg::enterEvent(QEvent* e)
{
- if ( GroupConstructors->isEnabled() )
- return ;
- ActivateThisDialog() ;
- return ;
+ if(GroupConstructors->isEnabled())
+ return;
+ this->ActivateThisDialog();
+ return;
}
// function : closeEvent()
// purpose :
//=================================================================================
-void RepairGUI_SuppressFacesDlg::closeEvent( QCloseEvent* e )
+void RepairGUI_SuppressFacesDlg::closeEvent(QCloseEvent* e)
{
/* same than click on cancel button */
- this->ClickOnClose() ;
- return ;
+ this->ClickOnCancel();
+ return;
}
//=================================================================================
void RepairGUI_SuppressFacesDlg::ActivateUserSelection()
{
- if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) {
- if( !this->myOkShape ) {
- this->ResetStateOfDialog() ;
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SELECT_FIRST")) ;
- return ;
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ if(!myOkShape) {
+ this->ResetStateOfDialog();
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SELECT_FIRST"));
+ return;
}
- this->myOkSelectSubMode = CheckBox1->isChecked() ;
+ myOkSelectSubMode = GroupPoints->CheckButton1->isChecked();
- if( this->myUseLocalContext ) {
- myIC->CloseLocalContext(myLocalContextId) ;
- this->myUseLocalContext = false ;
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ myIC = v3d->getAISContext();
+ if(myUseLocalContext) {
+ myIC->CloseLocalContext(myLocalContextId);
+ myUseLocalContext = false;
+ }
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 */
DisplayGUI* myDisplayGUI = new DisplayGUI();
- myDisplayGUI->PrepareSubShapeSelection( int(TopAbs_FACE), this->myLocalContextId ) ;
- myUseLocalContext = true ;
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SELECT_FACE")) ;
+ myDisplayGUI->PrepareSubShapeSelection(int(TopAbs_FACE), myLocalContextId);
+ myUseLocalContext = true;
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SELECT_FACE"));
}
- } else {
- CheckBox1->setChecked( false );
- }
-
- return ;
+ }
+ else
+ GroupPoints->CheckButton1->setChecked(false);
+ return;
}
//=================================================================================
void RepairGUI_SuppressFacesDlg::ResetStateOfDialog()
{
- this->myOkShape = false ;
- this->myEditCurrentArgument->setText("") ;
+ myOkShape = false ;
+ myEditCurrentArgument->setText("");
/* Select sub shapes mode not checked */
- this->myOkSelectSubMode = false ;
- this->CheckBox1->setChecked( FALSE );
+ myOkSelectSubMode = false;
+ GroupPoints->CheckButton1->setChecked(FALSE);
/* Close its local contact if opened */
- if( this->myUseLocalContext ) {
- myIC->CloseLocalContext(this->myLocalContextId) ;
- this->myUseLocalContext = false ;
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ myIC = v3d->getAISContext();
+ if(myUseLocalContext) {
+ myIC->CloseLocalContext(myLocalContextId);
+ myUseLocalContext = false;
+ }
DisplayGUI* myDisplayGUI = new DisplayGUI();
- myDisplayGUI->OnDisplayAll(true) ;
+ myDisplayGUI->OnDisplayAll(true);
}
- return ;
+ return;
}
#ifndef DIALOGBOX_SUPPRESSFACES_H
#define DIALOGBOX_SUPPRESSFACES_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;
+#include "GEOMBase_Skeleton.h"
+#include "DlgRef_1Sel1Check_QTD.h"
+#include "RepairGUI.h"
//=================================================================================
// class : RepairGUI_SuppressFacesDlg
// purpose :
//=================================================================================
-class RepairGUI_SuppressFacesDlg : public QDialog
+class RepairGUI_SuppressFacesDlg : public GEOMBase_Skeleton
{
Q_OBJECT
public:
- 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 );
+ 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);
~RepairGUI_SuppressFacesDlg();
private :
- RepairGUI* myRepairGUI;
- void Init( SALOME_Selection* Sel, Handle (AIS_InteractiveContext) ic ) ;
- void closeEvent( QCloseEvent* e ) ;
- void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */
- void ResetStateOfDialog() ;
-
- /* Interactive and local context management see also : bool myUseLocalContext() */
- Handle (AIS_InteractiveContext) myIC ; /* Interactive context */
- Standard_Integer myLocalContextId ; /* identify a local context used by this method */
- bool myUseLocalContext ; /* true when this method as opened a local context */
+ void Init(Handle(AIS_InteractiveContext) ic);
+ void enterEvent(QEvent* e);
+ void closeEvent(QCloseEvent* e);
- GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */
- GEOMBase* myGeomBase ; /* Current GeomGUI object */
- GEOMContext* myGeomGUI ; /* Current GeomGUI object */
- SALOME_Selection* mySelection ; /* User shape selection */
+ void ResetStateOfDialog();
- TopoDS_Shape myShape ;
- char* myShapeIOR ;
- bool myOkShape ;
+ RepairGUI* myRepairGUI;
- 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;
+ /* Interactive and local context management see also : bool myUseLocalContext() */
+ Handle(AIS_InteractiveContext) myIC; /* Interactive context */
+ Standard_Integer myLocalContextId; /* identify a local context used by this method */
+ bool myUseLocalContext; /* true when this method as opened a local context */
- QCheckBox* CheckBox1;
+ TopoDS_Shape myShape;
+ char* myShapeIOR;
+ bool myOkShape;
+ bool myOkSelectSubMode; /* true = sub mode selection activated */
-private slots:
+ DlgRef_1Sel1Check_QTD* GroupPoints;
- void ConstructorsClicked(int constructorId);
+private slots:
void ClickOnOk();
- void ClickOnApply() ;
- void ClickOnClose();
-
- void LineEditReturnPressed() ;
- void SetEditCurrentArgument() ;
- void SelectionIntoArgument() ;
- void DeactivateActiveDialog() ;
- void ActivateThisDialog() ;
- void ActivateUserSelection() ;
+ void ClickOnApply();
+ void ClickOnCancel();
+ void ActivateThisDialog();
+ void DeactivateActiveDialog();
+ void LineEditReturnPressed();
+ void SelectionIntoArgument();
+ void SetEditCurrentArgument();
+ void ActivateUserSelection();
-protected:
- QGridLayout* RepairGUI_SuppressFacesDlgLayout;
- QGridLayout* GroupConstructorsLayout;
- QGridLayout* GroupC1Layout;
- QHBoxLayout* Layout2;
- QGridLayout* GroupButtonsLayout;
};
#endif // DIALOGBOX_SUPPRESSFACES_H
//=================================================================================
void RepairGUI_SuppressHoleDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo( tr("") ) ;
+ QAD_Application::getDesktop()->putInfo( tr("") ) ;
bool testResult = false ;
if( !myOkShape )
myDisplayGUI->OnDisplayAll(true) ;/* Display all objects so that next method using ic can memorize them */
if( !aTest || myListOfIdWire->length() != 1 ) {
CheckBox2->setChecked(FALSE) ;
- myGeomGUI->GetDesktop()->putInfo( tr("GEOM_PRP_ABORT") ) ;
+ QAD_Application::getDesktop()->putInfo( tr("GEOM_PRP_ABORT") ) ;
}
else {
myListOfIdEndFace->length(0) ; /* no end face */
myDisplayGUI->OnDisplayAll(true) ; /* Display all objects so that next method using ic can memorize them */
if( !aTest || myListOfIdEndFace->length() != 1 ) {
CheckBox3->setChecked(FALSE) ;
- myGeomGUI->GetDesktop()->putInfo( tr("GEOM_PRP_ABORT") ) ;
+ QAD_Application::getDesktop()->putInfo( tr("GEOM_PRP_ABORT") ) ;
}
else {
QApplication::setOverrideCursor( Qt::waitCursor );
if( !aTest || myListOfIdWire->length() < 1 ) {
CheckBoxC2_1->setChecked(FALSE) ;
- myGeomGUI->GetDesktop()->putInfo( tr("GEOM_PRP_ABORT") ) ;
+ QAD_Application::getDesktop()->putInfo( tr("GEOM_PRP_ABORT") ) ;
}
else {
QApplication::setOverrideCursor( Qt::waitCursor );
if( !testResult )
- myGeomGUI->GetDesktop()->putInfo( tr("GEOM_PRP_ABORT") ) ;
+ QAD_Application::getDesktop()->putInfo( tr("GEOM_PRP_ABORT") ) ;
else
- myGeomGUI->GetDesktop()->putInfo( tr("GEOM_PRP_DONE") ) ;
+ QAD_Application::getDesktop()->putInfo( tr("GEOM_PRP_DONE") ) ;
/* Reset arguments to allow a new selection */
this->ResetStateOfDialog() ;
void RepairGUI_SuppressHoleDlg::ClickOnClose()
{
disconnect( mySelection, 0, this, 0 );
- myGeomGUI->ResetState() ;
+ //myGeomGUI->ResetState() ;
- if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
- myIC = v3d->getAISContext(); // myIC = myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getViewerOCC()->getAISContext();
+ if ( QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ myIC = v3d->getAISContext(); // myIC = QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getViewerOCC()->getAISContext();
if(myUseLocalContext) {
myIC->CloseLocalContext(myLocalContextId) ;
this->myUseLocalContext = false ;
}
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::GenericAttribute_var anAttr;
SALOMEDS::AttributeIOR_var anIOR;
GroupC2->setEnabled(false) ;
GroupButtons->setEnabled(false) ;
- myGeomGUI->ResetState() ;
+ //myGeomGUI->ResetState() ;
myGeomGUI->SetActiveDialogBox(0) ;
DisplayGUI* myDisplayGUI = new DisplayGUI();
myDisplayGUI->OnDisplayAll(true) ;
{
if( !this->myOkShape ) {
this->ResetStateOfDialog() ;
- myGeomGUI->GetDesktop()->putInfo( tr("GEOM_MAIN_OBJECT") ) ;
+ QAD_Application::getDesktop()->putInfo( tr("GEOM_MAIN_OBJECT") ) ;
return ;
}
/* Test the viewer type VTK */
- if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC ) {
- myGeomGUI->GetDesktop()->putInfo( tr("GEOM_PRP_NOT_FOR_VTK_VIEWER") ) ;
+ if ( QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC ) {
+ QAD_Application::getDesktop()->putInfo( tr("GEOM_PRP_NOT_FOR_VTK_VIEWER") ) ;
this->ResetStateOfDialog() ;
return;
}
DisplayGUI* myDisplayGUI = new DisplayGUI();
myDisplayGUI->PrepareSubShapeSelection( int(TopAbs_FACE), this->myLocalContextId ) ;
myUseLocalContext = true ;
- myGeomGUI->GetDesktop()->putInfo( tr("GEOM_SUPPRESSHOLE_SELECTFACE") ) ;
+ QAD_Application::getDesktop()->putInfo( tr("GEOM_SUPPRESSHOLE_SELECTFACE") ) ;
}
else {
this->ResetPartial() ;
if( !this->myOkShape ) {
this->ResetStateOfDialog() ;
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_MAIN_OBJECT") ) ;
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_MAIN_OBJECT") ) ;
return ;
}
/* Test the type of viewer VTK */
- if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC ) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NOT_FOR_VTK_VIEWER") ) ;
+ if ( QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC ) {
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NOT_FOR_VTK_VIEWER") ) ;
this->ResetStateOfDialog() ;
return;
}
if( !aTest || myListOfIdFace->length() != 1 ) {
CheckBox1->setChecked(FALSE) ;
myOkSelectFace = false ;
- myGeomGUI->GetDesktop()->putInfo( tr("GEOM_PRP_ABORT") ) ;
+ QAD_Application::getDesktop()->putInfo( tr("GEOM_PRP_ABORT") ) ;
}
else {
myOkSelectFace = true ;
DisplayGUI* myDisplayGUI = new DisplayGUI();
myDisplayGUI->PrepareSubShapeSelectionArgumentShape( this->myFace, int(TopAbs_WIRE), this->myLocalContextId ) ;
myUseLocalContext = true ;
- myGeomGUI->GetDesktop()->putInfo( tr("GEOM_SUPPRESSHOLE_SELECTWIRE") ) ;
+ QAD_Application::getDesktop()->putInfo( tr("GEOM_SUPPRESSHOLE_SELECTWIRE") ) ;
}
else {
this->ResetPartial() ;
if( !this->myOkShape ) {
this->ResetStateOfDialog() ;
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_MAIN_OBJECT") ) ;
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_MAIN_OBJECT") ) ;
return ;
}
/* Test the type of viewer VTK */
- if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC ) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NOT_FOR_VTK_VIEWER") ) ;
+ if ( QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC ) {
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NOT_FOR_VTK_VIEWER") ) ;
this->ResetStateOfDialog() ;
return;
}
if( !aTest || myListOfIdWire->length() != 1 ) {
CheckBox2->setChecked(FALSE) ;
CheckBox3->setChecked(FALSE) ;
- myGeomGUI->GetDesktop()->putInfo( tr("GEOM_PRP_ABORT") ) ;
+ QAD_Application::getDesktop()->putInfo( tr("GEOM_PRP_ABORT") ) ;
return ;
}
}
DisplayGUI* myDisplayGUI = new DisplayGUI();
myDisplayGUI->PrepareSubShapeSelectionArgumentShape( this->myShape, int(TopAbs_FACE), this->myLocalContextId ) ;
myUseLocalContext = true ;
- myGeomGUI->GetDesktop()->putInfo( tr("GEOM_SUPPRESSHOLE_SELECTFACE_END") ) ;
+ QAD_Application::getDesktop()->putInfo( tr("GEOM_SUPPRESSHOLE_SELECTFACE_END") ) ;
}
else {
this->ResetPartial() ;
if( !this->myOkShape ) {
this->ResetStateOfDialog() ;
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_MAIN_OBJECT") ) ;
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_MAIN_OBJECT") ) ;
return ;
}
/* Test the type of viewer VTK */
- if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC ) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NOT_FOR_VTK_VIEWER") ) ;
+ if ( QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC ) {
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NOT_FOR_VTK_VIEWER") ) ;
this->ResetStateOfDialog() ;
return;
}
DisplayGUI* myDisplayGUI = new DisplayGUI();
myDisplayGUI->PrepareSubShapeSelectionArgumentShape( this->myShape, int(TopAbs_WIRE), this->myLocalContextId ) ;
myUseLocalContext = true ;
- myGeomGUI->GetDesktop()->putInfo( tr("GEOM_SUPPRESSHOLE_SELECT_HOLES_ON_FACE") ) ;
+ QAD_Application::getDesktop()->putInfo( tr("GEOM_SUPPRESSHOLE_SELECT_HOLES_ON_FACE") ) ;
}
else {
this->ResetPartial() ;
myListOfIdEndFace->length(0) ;
/* Close its local contact if opened */
- if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) {
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
- myIC = v3d->getAISContext(); // myIC = myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getViewerOCC()->getAISContext();
+ if ( QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ myIC = v3d->getAISContext(); // myIC = QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getViewerOCC()->getAISContext();
if( this->myUseLocalContext ) {
myIC->CloseLocalContext(this->myLocalContextId) ;
this->myUseLocalContext = false ;
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 */
- if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
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();
ic->InitSelected();
TransformationGUI_MirrorDlg.h \
TransformationGUI_ScaleDlg.h
-LIB_CLIENT_IDL = SALOME_Exception.idl \
- GEOM_Gen.idl \
- GEOM_Shape.idl \
- SALOMEDS.idl \
- SALOMEDS_Attributes.idl \
- SALOME_ModuleCatalog.idl \
- SALOME_Component.idl \
+LIB_CLIENT_IDL =
LIB_SERVER_IDL =
# additionnal information to compil and link file
-CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
-CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
+CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -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@
{
TransformationGUI* myTransformationGUI = new TransformationGUI();
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)
{
try {
GEOM::GEOM_Shape_var result = myGeom->MakeTranslation(Shape, V.X(), V.Y(), V.Z());
if(result->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
return;
}
result->NameType(Shape->NameType());
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) {
QtCatchCorbaException(S_ex);
dir.X(), dir.Y(), dir.Z());
GEOM::GEOM_Shape_var result = myGeom->MakeRotation(Shape, axis, angle);
if(result->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
return ;
}
result->NameType(Shape->NameType());
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) {
QtCatchCorbaException(S_ex);
try {
GEOM::GEOM_Shape_var result = myGeom->MakeMirrorByPlane(Shape1, Shape2);
if(result->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
return;
}
result->NameType(Shape1->NameType());
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) {
QtCatchCorbaException(S_ex);
GEOM::GEOM_Shape_var result = myGeom->MakeScaleTransform(Shape, P, factor);
result->NameType(Shape->NameType());
if(myGeomBase->Display(result))
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
else
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
}
catch(const SALOME::SALOME_Exception& S_ex) {
QtCatchCorbaException(S_ex);
GEOM::GEOM_Shape_var result = myGeom->MakeMultiTranslation1D(Shape, dstruct, Step, NbTimes);
if(result->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
return;
}
result->NameType(tr("GEOM_COMPOUND"));
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) {
QtCatchCorbaException(S_ex);
GEOM::GEOM_Shape_var result = myGeom->MakeMultiTranslation2D(Shape, dstruct1, Step1, NbTimes1,
dstruct2, Step2, NbTimes2);
if(result->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
return;
}
result->NameType(tr("GEOM_COMPOUND"));
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) {
QtCatchCorbaException(S_ex);
GEOM::GEOM_Shape_var result = myGeom->MakeMultiRotation1D(Shape, dstruct, pstruct, NbTimes);
if(result->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
return;
}
result->NameType(tr("GEOM_COMPOUND"));
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) {
QtCatchCorbaException(S_ex);
GEOM::GEOM_Shape_var result = myGeom->MakeMultiRotation2D(Shape, dstruct, pstruct,
Ang, NbTimes1, Step, NbTimes2);
if(result->_is_nil()) {
- myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
return;
}
result->NameType(tr("GEOM_COMPOUND"));
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) {
QtCatchCorbaException(S_ex);
#define TRANSFORMATIONGUI_H
#include "GEOMBase.h"
+#include <gp_Vec.hxx>
//=================================================================================
// class : TransformationGUI
//=================================================================================
void TransformationGUI_MirrorDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
myGeomBase->EraseSimulationShape();
using namespace std;
#include "TransformationGUI_MultiRotationDlg.h"
-#include "QAD_Config.h"
-
+#include <gp_Lin.hxx>
#include <Precision.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <GeomAPI_ProjectPointOnCurve.hxx>
#include <TopoDS_Compound.hxx>
#include <Geom_Line.hxx>
#include <BRepBuilderAPI_Transform.hxx>
+#include "QAD_Config.h"
//=================================================================================
// class : TransformationGUI_MultiRotationDlg()
//=================================================================================
void TransformationGUI_MultiRotationDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
myGeomBase->EraseSimulationShape();
using namespace std;
#include "TransformationGUI_MultiTranslationDlg.h"
-#include "QAD_Config.h"
-
+#include <gp_Lin.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <BRepBuilderAPI_Transform.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepGProp.hxx>
#include <GProp_GProps.hxx>
#include <TopoDS_Compound.hxx>
+#include "QAD_Config.h"
//=================================================================================
// class : TransformationGUI_MultiTranslationDlg()
//=================================================================================
void TransformationGUI_MultiTranslationDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
myGeomBase->EraseSimulationShape();
using namespace std;
#include "TransformationGUI_RotationDlg.h"
+#include <gp_Lin.hxx>
#include <BRepBuilderAPI_Transform.hxx>
#include <BRepAdaptor_Curve.hxx>
//=================================================================================
void TransformationGUI_RotationDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
myGeomBase->EraseSimulationShape();
//=================================================================================
void TransformationGUI_ScaleDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
myGeomBase->EraseSimulationShape();
//=================================================================================
void TransformationGUI_TranslationDlg::ClickOnApply()
{
- myGeomGUI->GetDesktop()->putInfo(tr(""));
+ QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
myGeomBase->EraseSimulationShape();