mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-02-23 20:35:37 +05:00
DCQ : New GEOM Architecture
This commit is contained in:
parent
7f6a21ec46
commit
66dbb45c38
352
src/BasicGUI/BasicGUI.cxx
Normal file
352
src/BasicGUI/BasicGUI.cxx
Normal file
@ -0,0 +1,352 @@
|
|||||||
|
// 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 : BasicGUI.cxx
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
#include "BasicGUI.h"
|
||||||
|
|
||||||
|
#include "QAD_RightFrame.h"
|
||||||
|
#include "OCCViewer_Viewer3d.h"
|
||||||
|
#include "OCCViewer_ViewPort3d.h"
|
||||||
|
|
||||||
|
#include "BasicGUI_PointDlg.h" // Method POINT
|
||||||
|
#include "BasicGUI_LineDlg.h" // Method LINE
|
||||||
|
#include "BasicGUI_CircleDlg.h" // Method CIRCLE
|
||||||
|
#include "BasicGUI_EllipseDlg.h" // Method ELLIPSE
|
||||||
|
#include "BasicGUI_ArcDlg.h" // Method ARC
|
||||||
|
#include "BasicGUI_VectorDlg.h" // Method VECTOR
|
||||||
|
#include "BasicGUI_PlaneDlg.h" // Method PLANE
|
||||||
|
#include "BasicGUI_WorkingPlaneDlg.h" // Method WORKING PLANE
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
// function : BasicGUI()
|
||||||
|
// purpose : Constructor
|
||||||
|
//=======================================================================
|
||||||
|
BasicGUI::BasicGUI() :
|
||||||
|
QObject()
|
||||||
|
{
|
||||||
|
myGeomGUI = GEOMBase_Context::GetGeomGUI();
|
||||||
|
Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM");
|
||||||
|
myGeom = GEOM::GEOM_Gen::_narrow(comp);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
// function : ~BasicGUI()
|
||||||
|
// purpose : Destructor
|
||||||
|
//=======================================================================
|
||||||
|
BasicGUI::~BasicGUI()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
// function : OnGUIEvent()
|
||||||
|
// purpose :
|
||||||
|
//=======================================================================
|
||||||
|
bool BasicGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
||||||
|
{
|
||||||
|
myGeomGUI->EmitSignalDeactivateDialog();
|
||||||
|
SALOME_Selection* Sel = SALOME_Selection::Selection(myGeomGUI->GetActiveStudy()->getSelection());
|
||||||
|
|
||||||
|
switch (theCommandID)
|
||||||
|
{
|
||||||
|
case 3011: // POINT
|
||||||
|
{
|
||||||
|
Handle(AIS_InteractiveContext) ic;
|
||||||
|
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
|
ic = v3d->getAISContext();
|
||||||
|
}
|
||||||
|
BasicGUI_PointDlg *aDlg = new BasicGUI_PointDlg(parent, "", this, Sel, ic);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 3012: // LINE
|
||||||
|
{
|
||||||
|
BasicGUI_LineDlg *aDlg = new BasicGUI_LineDlg(parent, "", this, Sel);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 3013: // CIRCLE
|
||||||
|
{
|
||||||
|
BasicGUI_CircleDlg *aDlg = new BasicGUI_CircleDlg(parent, "", this, Sel);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 3014: // ELLIPSE
|
||||||
|
{
|
||||||
|
BasicGUI_EllipseDlg *aDlg = new BasicGUI_EllipseDlg(parent, "", this, Sel);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 3015: // ARC
|
||||||
|
{
|
||||||
|
BasicGUI_ArcDlg *aDlg = new BasicGUI_ArcDlg(parent, "", this, Sel);
|
||||||
|
break ;
|
||||||
|
}
|
||||||
|
case 3016: // VECTOR
|
||||||
|
{
|
||||||
|
BasicGUI_VectorDlg *aDlg = new BasicGUI_VectorDlg(parent, "", this, Sel);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 3017: // PLANE
|
||||||
|
{
|
||||||
|
BasicGUI_PlaneDlg *aDlg = new BasicGUI_PlaneDlg(parent, "", this, Sel);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 3018: // WORKING PLANE
|
||||||
|
{
|
||||||
|
BasicGUI_WorkingPlaneDlg *aDlg = new BasicGUI_WorkingPlaneDlg(parent, "", this, Sel);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
parent->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
// function : MakePointAndDisplay
|
||||||
|
// purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void BasicGUI::MakePointAndDisplay(const double x, const double y, const double z)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
GEOM::GEOM_Shape_var P = myGeom->MakeVertex(x, y, z);
|
||||||
|
P->NameType(tr("GEOM_VERTEX"));
|
||||||
|
if (myGeomGUI->Display(P))
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
|
}
|
||||||
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
|
QtCatchCorbaException(S_ex);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=====================================================================================
|
||||||
|
// function : MakeLineAndDisplay()
|
||||||
|
// purpose : Create an infinite oriented line (linear edge in fact)
|
||||||
|
//=====================================================================================
|
||||||
|
void BasicGUI::MakeLineAndDisplay(const gp_Pnt InitPoint, const gp_Pnt LastPoint)
|
||||||
|
{
|
||||||
|
gp_Pnt P1, P2;
|
||||||
|
double dx, dy, dz;
|
||||||
|
myGeomGUI->GetBipointDxDyDz(InitPoint, LastPoint, dx, dy, dz);
|
||||||
|
Standard_Real length = InitPoint.Distance(LastPoint);
|
||||||
|
if(length <= Precision::Confusion()) {
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Standard_Real coeff = 1E6 / length;
|
||||||
|
|
||||||
|
/* To create a line with length = 1E6 */
|
||||||
|
/* Precision::Infinite() is 1E100 in OCC */
|
||||||
|
P1.SetX(InitPoint.X() - (coeff * dx));
|
||||||
|
P1.SetY(InitPoint.Y() - (coeff * dy));
|
||||||
|
P1.SetZ(InitPoint.Z() - (coeff * dz));
|
||||||
|
|
||||||
|
P2.SetX(LastPoint.X() + (coeff * dx));
|
||||||
|
P2.SetY(LastPoint.Y() + (coeff * dy));
|
||||||
|
P2.SetZ(LastPoint.Z() + (coeff * dz));
|
||||||
|
|
||||||
|
try {
|
||||||
|
GEOM::PointStruct pstruct = myGeom->MakePointStruct(P1.X(), P1.Y(), P1.Z());
|
||||||
|
GEOM::PointStruct d = myGeom->MakePointStruct(P2.X(), P2.Y(), P2.Z());
|
||||||
|
GEOM::DirStruct dstruct = myGeom->MakeDirection(d);
|
||||||
|
|
||||||
|
GEOM::GEOM_Shape_ptr result = myGeom->MakeLine(pstruct, dstruct);
|
||||||
|
if(result->_is_nil()) {
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
result->NameType(tr("GEOM_LINE"));
|
||||||
|
|
||||||
|
if(myGeomGUI->Display(result))
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_READY"));
|
||||||
|
}
|
||||||
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
|
QtCatchCorbaException(S_ex);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=====================================================================================
|
||||||
|
// function : MakeCircleAndDisplay()
|
||||||
|
// purpose :
|
||||||
|
//=====================================================================================
|
||||||
|
void BasicGUI::MakeCircleAndDisplay(const gp_Pnt CenterPoint, const gp_Dir dir, const Standard_Real Radius)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
GEOM::PointStruct pstruct = myGeom->MakePointStruct(CenterPoint.X(), CenterPoint.Y(), CenterPoint.Z());
|
||||||
|
GEOM::PointStruct d = myGeom->MakePointStruct(dir.X(), dir.Y(), dir.Z());
|
||||||
|
GEOM::DirStruct dstruct = myGeom->MakeDirection(d);
|
||||||
|
|
||||||
|
GEOM::GEOM_Shape_var result = myGeom->MakeCircle(pstruct, dstruct, Radius);
|
||||||
|
if(result->_is_nil()) {
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
result->NameType(tr("GEOM_CIRCLE"));
|
||||||
|
if(myGeomGUI->Display(result))
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
|
}
|
||||||
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
|
QtCatchCorbaException(S_ex);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=====================================================================================
|
||||||
|
// function : MakeEllipseAndDisplay()
|
||||||
|
// purpose :
|
||||||
|
//=====================================================================================
|
||||||
|
void BasicGUI::MakeEllipseAndDisplay(const gp_Pnt CenterPoint, const gp_Dir dir,
|
||||||
|
const Standard_Real Major_Radius, const Standard_Real Minor_Radius)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
GEOM::PointStruct pstruct = myGeom->MakePointStruct(CenterPoint.X(), CenterPoint.Y(), CenterPoint.Z());
|
||||||
|
GEOM::PointStruct d = myGeom->MakePointStruct(dir.X(), dir.Y(), dir.Z());
|
||||||
|
GEOM::DirStruct dstruct = myGeom->MakeDirection(d) ;
|
||||||
|
|
||||||
|
GEOM::GEOM_Shape_var result = myGeom->MakeEllipse(pstruct, dstruct, Major_Radius, Minor_Radius);
|
||||||
|
if(result->_is_nil()) {
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
result->NameType(tr("GEOM_ELLIPSE"));
|
||||||
|
if(myGeomGUI->Display(result))
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
|
}
|
||||||
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
|
QtCatchCorbaException(S_ex);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=======================================================================================
|
||||||
|
// function : MakeArcAndDisplay()
|
||||||
|
// purpose : Make an arc of circle from InitPoint to CirclePoint and passing on EndPoint
|
||||||
|
//=======================================================================================
|
||||||
|
void BasicGUI::MakeArcAndDisplay(gp_Pnt InitPoint, gp_Pnt CirclePoint, gp_Pnt EndPoint)
|
||||||
|
{
|
||||||
|
gp_Vec v1(CirclePoint, InitPoint);
|
||||||
|
gp_Vec v2(CirclePoint, EndPoint);
|
||||||
|
if(v1.IsParallel(v2, Precision::Angular()))
|
||||||
|
return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
GEOM::PointStruct pI = myGeom->MakePointStruct(InitPoint.X(), InitPoint.Y(), InitPoint.Z());
|
||||||
|
GEOM::PointStruct pC = myGeom->MakePointStruct(CirclePoint.X(), CirclePoint.Y(), CirclePoint.Z());
|
||||||
|
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"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
result->NameType(tr("GEOM_ARC"));
|
||||||
|
if (myGeomGUI->Display(result))
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
|
}
|
||||||
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
|
QtCatchCorbaException(S_ex);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
// function : MakeVectorAndDisplay()
|
||||||
|
// purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void BasicGUI::MakeVectorAndDisplay(const gp_Pnt P1, const gp_Pnt P2)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
GEOM::PointStruct pstruct1 = myGeom->MakePointStruct(P1.X(), P1.Y(), P1.Z());
|
||||||
|
GEOM::PointStruct pstruct2 = myGeom->MakePointStruct(P2.X(), P2.Y(), P2.Z());
|
||||||
|
GEOM::GEOM_Shape_var Vector = myGeom->MakeVector(pstruct1, pstruct2);
|
||||||
|
Vector->NameType(tr("GEOM_VECTOR"));
|
||||||
|
if(myGeomGUI->Display(Vector))
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
|
}
|
||||||
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
|
QtCatchCorbaException(S_ex);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
// function : MakePlaneAndDisplay()
|
||||||
|
// purpose : Plane point is P1 and dx, dy, dz define a normal vector
|
||||||
|
//=======================================================================
|
||||||
|
void BasicGUI::MakePlaneAndDisplay(const gp_Pnt P1, const Standard_Real dx, const Standard_Real dy,
|
||||||
|
const Standard_Real dz, const Standard_Real TrimSize)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
gp_Dir aDirection;
|
||||||
|
aDirection.SetCoord(dx, dy, dz);
|
||||||
|
gp_Ax2 Axis(P1, aDirection);
|
||||||
|
|
||||||
|
GEOM::PointStruct pstruct = myGeom->MakePointStruct(P1.X(), P1.Y(), P1.Z());
|
||||||
|
GEOM::PointStruct d = myGeom->MakePointStruct(aDirection.X(), aDirection.Y(), aDirection.Z());
|
||||||
|
GEOM::DirStruct dstruct = myGeom->MakeDirection(d);
|
||||||
|
GEOM::GEOM_Shape_ptr plane = myGeom->MakePlane(pstruct, dstruct, TrimSize);
|
||||||
|
plane->NameType(tr("GEOM_PLANE"));
|
||||||
|
if(myGeomGUI->Display(plane))
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
|
}
|
||||||
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
|
QtCatchCorbaException(S_ex);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
// function : MakeWorkingPlane()
|
||||||
|
// purpose : Change the point of view3d
|
||||||
|
//=======================================================================
|
||||||
|
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"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
OCCViewer_ViewPort* vp = ((OCCViewer_ViewFrame*)myGeomGUI->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"));
|
||||||
|
return;
|
||||||
|
}
|
66
src/BasicGUI/BasicGUI.h
Normal file
66
src/BasicGUI/BasicGUI.h
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
// 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 : BasicGUI.h
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#ifndef BASICGUI_H
|
||||||
|
#define BASICGUI_H
|
||||||
|
|
||||||
|
#include "GEOMBase_Display.h"
|
||||||
|
#include "QAD_Config.h"
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BasicGUI
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
class BasicGUI : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT /* for QT compatibility */
|
||||||
|
|
||||||
|
public :
|
||||||
|
BasicGUI();
|
||||||
|
~BasicGUI();
|
||||||
|
|
||||||
|
bool OnGUIEvent(int theCommandID, QAD_Desktop* parent);
|
||||||
|
|
||||||
|
void MakePointAndDisplay(const double x, const double y, const double z);
|
||||||
|
void MakeLineAndDisplay(const gp_Pnt InitPoint, const gp_Pnt LastPoint);
|
||||||
|
void MakeCircleAndDisplay(const gp_Pnt CenterPoint, const gp_Dir dir, const Standard_Real Radius);
|
||||||
|
void MakeEllipseAndDisplay(const gp_Pnt CenterPoint, const gp_Dir dir,
|
||||||
|
const Standard_Real Major_Radius, const Standard_Real Minor_Radius);
|
||||||
|
void MakeArcAndDisplay(gp_Pnt InitPoint, gp_Pnt CirclePoint, gp_Pnt EndPoint);
|
||||||
|
void MakeVectorAndDisplay(const gp_Pnt P1, const gp_Pnt P2);
|
||||||
|
void MakePlaneAndDisplay(const gp_Pnt P1, const Standard_Real dx, const Standard_Real dy,
|
||||||
|
const Standard_Real dz, const Standard_Real TrimSize);
|
||||||
|
void MakeWorkingPlane(const gp_Pnt P, const gp_Dir D);
|
||||||
|
|
||||||
|
private:
|
||||||
|
GEOMBase_Context* myGeomGUI;
|
||||||
|
GEOM::GEOM_Gen_var myGeom; /* Current Geom Component */
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
305
src/BasicGUI/BasicGUI_ArcDlg.cxx
Normal file
305
src/BasicGUI/BasicGUI_ArcDlg.cxx
Normal file
@ -0,0 +1,305 @@
|
|||||||
|
// 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 : BasicGUI_ArcDlg.cxx
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
#include "BasicGUI_ArcDlg.h"
|
||||||
|
|
||||||
|
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||||
|
#include <GC_MakeArcOfCircle.hxx>
|
||||||
|
#include <Geom_TrimmedCurve.hxx>
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BasicGUI_ArcDlg()
|
||||||
|
// purpose : Constructs a BasicGUI_ArcDlg which is a child of 'parent', with the
|
||||||
|
// name 'name' and widget flags set to 'f'.
|
||||||
|
// The dialog will by default be modeless, unless you set 'modal' to
|
||||||
|
// TRUE to construct a modal dialog.
|
||||||
|
//=================================================================================
|
||||||
|
BasicGUI_ArcDlg::BasicGUI_ArcDlg(QWidget* parent, const char* name, BasicGUI* theBasicGUI, 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_ARC")));
|
||||||
|
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||||
|
|
||||||
|
setCaption(tr("GEOM_ARC_TITLE"));
|
||||||
|
|
||||||
|
/***************************************************************/
|
||||||
|
GroupConstructors->setTitle(tr("GEOM_ARC"));
|
||||||
|
RadioButton1->setPixmap(image0);
|
||||||
|
RadioButton2->close(TRUE);
|
||||||
|
RadioButton3->close(TRUE);
|
||||||
|
|
||||||
|
GroupPoints = new DlgRef_3Sel_QTD(this, "GroupPoints");
|
||||||
|
GroupPoints->GroupBox1->setTitle(tr("GEOM_POINTS"));
|
||||||
|
GroupPoints->TextLabel1->setText(tr("GEOM_POINT_I").arg("1"));
|
||||||
|
GroupPoints->TextLabel2->setText(tr("GEOM_POINT_I").arg("2"));
|
||||||
|
GroupPoints->TextLabel3->setText(tr("GEOM_POINT_I").arg("3"));
|
||||||
|
GroupPoints->PushButton1->setPixmap(image1);
|
||||||
|
GroupPoints->PushButton2->setPixmap(image1);
|
||||||
|
GroupPoints->PushButton3->setPixmap(image1);
|
||||||
|
|
||||||
|
Layout1->addWidget(GroupPoints, 1, 0);
|
||||||
|
/***************************************************************/
|
||||||
|
|
||||||
|
/* Initialisations */
|
||||||
|
myBasicGUI = theBasicGUI;
|
||||||
|
Init();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ~BasicGUI_ArcDlg()
|
||||||
|
// purpose : Destroys the object and frees any allocated resources
|
||||||
|
//=================================================================================
|
||||||
|
BasicGUI_ArcDlg::~BasicGUI_ArcDlg()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : Init()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_ArcDlg::Init()
|
||||||
|
{
|
||||||
|
/* init variables */
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
|
myOkPoint1 = myOkPoint2 = myOkPoint3 = false;
|
||||||
|
|
||||||
|
/* Vertices Filter for all arguments */
|
||||||
|
myVertexFilter = new GEOM_ShapeTypeFilter(TopAbs_VERTEX, myGeom);
|
||||||
|
mySelection->AddFilter(myVertexFilter);
|
||||||
|
|
||||||
|
/* signals and slots connections */
|
||||||
|
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||||
|
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||||
|
|
||||||
|
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
connect(GroupPoints->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
|
||||||
|
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
|
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
|
connect(GroupPoints->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
|
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
|
||||||
|
/* displays Dialog */
|
||||||
|
GroupPoints->show();
|
||||||
|
this->show();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnOk()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_ArcDlg::ClickOnOk()
|
||||||
|
{
|
||||||
|
this->ClickOnApply();
|
||||||
|
ClickOnCancel();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnApply()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_ArcDlg::ClickOnApply()
|
||||||
|
{
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
||||||
|
if (mySimulationTopoDs.IsNull())
|
||||||
|
return;
|
||||||
|
myGeomGUI->EraseSimulationShape();
|
||||||
|
mySimulationTopoDs.Nullify();
|
||||||
|
|
||||||
|
if(myOkPoint1 && myOkPoint2 && myOkPoint3)
|
||||||
|
myBasicGUI->MakeArcAndDisplay(myPoint1, myPoint2, myPoint3);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SelectionIntoArgument()
|
||||||
|
// purpose : Called when selection as changed or other case
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_ArcDlg::SelectionIntoArgument()
|
||||||
|
{
|
||||||
|
myGeomGUI->EraseSimulationShape();
|
||||||
|
myEditCurrentArgument->setText("");
|
||||||
|
QString aString = ""; /* name of selection */
|
||||||
|
|
||||||
|
int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString);
|
||||||
|
if (nbSel != 1) {
|
||||||
|
if (myEditCurrentArgument == GroupPoints->LineEdit1)
|
||||||
|
myOkPoint1 = false;
|
||||||
|
else if(myEditCurrentArgument == GroupPoints->LineEdit2)
|
||||||
|
myOkPoint2 = false;
|
||||||
|
else if(myEditCurrentArgument == GroupPoints->LineEdit3)
|
||||||
|
myOkPoint3 = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// nbSel == 1
|
||||||
|
TopoDS_Shape S;
|
||||||
|
if(!myGeomGUI->GetTopoFromSelection(mySelection, S))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(myEditCurrentArgument == GroupPoints->LineEdit1 && myGeomGUI->VertexToPoint(S, myPoint1)) {
|
||||||
|
myEditCurrentArgument->setText(aString);
|
||||||
|
myOkPoint1 = true;
|
||||||
|
}
|
||||||
|
else if(myEditCurrentArgument == GroupPoints->LineEdit2 && myGeomGUI->VertexToPoint(S, myPoint2)) {
|
||||||
|
myEditCurrentArgument->setText(aString);
|
||||||
|
myOkPoint2 = true;
|
||||||
|
}
|
||||||
|
else if(myEditCurrentArgument == GroupPoints->LineEdit3 && myGeomGUI->VertexToPoint(S, myPoint3)) {
|
||||||
|
myEditCurrentArgument->setText(aString);
|
||||||
|
myOkPoint3 = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(myOkPoint1 && myOkPoint2 && myOkPoint3)
|
||||||
|
this->MakeArcSimulationAndDisplay();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SetEditCurrentArgument()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_ArcDlg::SetEditCurrentArgument()
|
||||||
|
{
|
||||||
|
QPushButton* send = (QPushButton*)sender();
|
||||||
|
|
||||||
|
if(send == GroupPoints->PushButton1) {
|
||||||
|
GroupPoints->LineEdit1->setFocus();
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
|
}
|
||||||
|
else if(send == GroupPoints->PushButton2) {
|
||||||
|
GroupPoints->LineEdit2->setFocus();
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||||
|
}
|
||||||
|
else if(send == GroupPoints->PushButton3) {
|
||||||
|
GroupPoints->LineEdit3->setFocus();
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit3;
|
||||||
|
}
|
||||||
|
mySelection->AddFilter(myVertexFilter);
|
||||||
|
this->SelectionIntoArgument();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : LineEditReturnPressed()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_ArcDlg::LineEditReturnPressed()
|
||||||
|
{
|
||||||
|
QLineEdit* send = (QLineEdit*)sender();
|
||||||
|
if(send == GroupPoints->LineEdit1)
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
|
else if(send == GroupPoints->LineEdit2)
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||||
|
else if(send == GroupPoints->LineEdit3)
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit3;
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ActivateThisDialog()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_ArcDlg::ActivateThisDialog()
|
||||||
|
{
|
||||||
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
if(!mySimulationTopoDs.IsNull())
|
||||||
|
myGeomGUI->DisplaySimulationShape(mySimulationTopoDs);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : enterEvent()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_ArcDlg::enterEvent(QEvent* e)
|
||||||
|
{
|
||||||
|
if(GroupConstructors->isEnabled())
|
||||||
|
return;
|
||||||
|
this->ActivateThisDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : MakeArcSimulationAndDisplay()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_ArcDlg::MakeArcSimulationAndDisplay()
|
||||||
|
{
|
||||||
|
myGeomGUI->EraseSimulationShape();
|
||||||
|
mySimulationTopoDs.Nullify();
|
||||||
|
|
||||||
|
try {
|
||||||
|
if(myPoint2.IsEqual(myPoint1, Precision::Confusion()) ||
|
||||||
|
myPoint2.IsEqual(myPoint3, Precision::Confusion())) {
|
||||||
|
myEditCurrentArgument->setText("");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gp_Vec v1(myPoint2, myPoint1);
|
||||||
|
gp_Vec v2(myPoint2, myPoint3);
|
||||||
|
if(v1.IsParallel(v2, Precision::Angular())) {
|
||||||
|
myEditCurrentArgument->setText("");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
GC_MakeArcOfCircle Arc(myPoint1, myPoint2, myPoint3);
|
||||||
|
if(Arc.IsDone()) {
|
||||||
|
Handle(Geom_TrimmedCurve) curve = Arc.Value();
|
||||||
|
mySimulationTopoDs = BRepBuilderAPI_MakeEdge(curve).Shape();
|
||||||
|
myGeomGUI->DisplaySimulationShape(mySimulationTopoDs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(Standard_Failure) {
|
||||||
|
MESSAGE("Exception catched in MakeArcSimulationAndDisplay");
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
76
src/BasicGUI/BasicGUI_ArcDlg.h
Normal file
76
src/BasicGUI/BasicGUI_ArcDlg.h
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
// 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 : BasicGUI_ArcDlg.h
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
#ifndef DIALOGBOX_ARC_H
|
||||||
|
#define DIALOGBOX_ARC_H
|
||||||
|
|
||||||
|
#include "GEOMBase_Skeleton.h"
|
||||||
|
#include "DlgRef_3Sel_QTD.h"
|
||||||
|
|
||||||
|
#include "BasicGUI.h"
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BasicGUI_ArcDlg
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
class BasicGUI_ArcDlg : public GEOMBase_Skeleton
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
BasicGUI_ArcDlg( QWidget* parent = 0, const char* name = 0, BasicGUI* theBasicGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
|
||||||
|
~BasicGUI_ArcDlg();
|
||||||
|
|
||||||
|
private :
|
||||||
|
void Init();
|
||||||
|
void enterEvent(QEvent* e);
|
||||||
|
void MakeArcSimulationAndDisplay();
|
||||||
|
|
||||||
|
BasicGUI* myBasicGUI;
|
||||||
|
Handle(GEOM_ShapeTypeFilter) myVertexFilter; /* Filter selection */
|
||||||
|
|
||||||
|
gp_Pnt myPoint1;
|
||||||
|
gp_Pnt myPoint2;
|
||||||
|
gp_Pnt myPoint3;
|
||||||
|
bool myOkPoint1;
|
||||||
|
bool myOkPoint2;
|
||||||
|
bool myOkPoint3;
|
||||||
|
|
||||||
|
DlgRef_3Sel_QTD* GroupPoints;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void ClickOnOk();
|
||||||
|
void ClickOnApply();
|
||||||
|
void ActivateThisDialog();
|
||||||
|
void LineEditReturnPressed();
|
||||||
|
void SelectionIntoArgument();
|
||||||
|
void SetEditCurrentArgument();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DIALOGBOX_ARC_H
|
305
src/BasicGUI/BasicGUI_CircleDlg.cxx
Normal file
305
src/BasicGUI/BasicGUI_CircleDlg.cxx
Normal file
@ -0,0 +1,305 @@
|
|||||||
|
// 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 : BasicGUI_CircleDlg.cxx
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
#include "BasicGUI_CircleDlg.h"
|
||||||
|
|
||||||
|
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||||
|
#include <BRepAdaptor_Curve.hxx>
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BasicGUI_CircleDlg()
|
||||||
|
// purpose : Constructs a BasicGUI_CircleDlg which is a child of 'parent', with the
|
||||||
|
// name 'name' and widget flags set to 'f'.
|
||||||
|
// The dialog will by default be modeless, unless you set 'modal' to
|
||||||
|
// TRUE to construct a modal dialog.
|
||||||
|
//=================================================================================
|
||||||
|
BasicGUI_CircleDlg::BasicGUI_CircleDlg(QWidget* parent, const char* name, BasicGUI* theBasicGUI, 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_CIRCLE_PV")));
|
||||||
|
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||||
|
|
||||||
|
setCaption(tr("GEOM_CIRCLE_TITLE"));
|
||||||
|
|
||||||
|
/***************************************************************/
|
||||||
|
GroupConstructors->setTitle(tr("GEOM_CIRCLE"));
|
||||||
|
RadioButton1->setPixmap(image0);
|
||||||
|
RadioButton2->close(TRUE);
|
||||||
|
RadioButton3->close(TRUE);
|
||||||
|
|
||||||
|
GroupPoints = new DlgRef_2Sel1Spin(this, "GroupPoints");
|
||||||
|
GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
|
||||||
|
GroupPoints->TextLabel1->setText(tr("GEOM_CENTER_POINT"));
|
||||||
|
GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR"));
|
||||||
|
GroupPoints->TextLabel3->setText(tr("GEOM_RADIUS"));
|
||||||
|
GroupPoints->PushButton1->setPixmap(image1);
|
||||||
|
GroupPoints->PushButton2->setPixmap(image1);
|
||||||
|
|
||||||
|
Layout1->addWidget(GroupPoints, 1, 0);
|
||||||
|
/***************************************************************/
|
||||||
|
|
||||||
|
/* Initialisations */
|
||||||
|
myBasicGUI = theBasicGUI;
|
||||||
|
Init();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ~BasicGUI_CircleDlg()
|
||||||
|
// purpose : Destroys the object and frees any allocated resources
|
||||||
|
//=================================================================================
|
||||||
|
BasicGUI_CircleDlg::~BasicGUI_CircleDlg()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : Init()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_CircleDlg::Init()
|
||||||
|
{
|
||||||
|
/* init variables */
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
|
|
||||||
|
myRadius = 100.0;
|
||||||
|
myOkPoint1 = myOkDir = false;
|
||||||
|
|
||||||
|
myEdgeFilter = new GEOM_EdgeFilter(StdSelect_Line, myGeom);
|
||||||
|
myVertexFilter = new GEOM_ShapeTypeFilter(TopAbs_VERTEX, myGeom);
|
||||||
|
mySelection->AddFilter(myVertexFilter);
|
||||||
|
|
||||||
|
/* Get setting of step value from file configuration */
|
||||||
|
QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep");
|
||||||
|
step = St.toDouble();
|
||||||
|
|
||||||
|
/* min, max, step and decimals for spin boxes & initial values */
|
||||||
|
GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3);
|
||||||
|
GroupPoints->SpinBox_DX->SetValue(myRadius);
|
||||||
|
|
||||||
|
/* signals and slots connections */
|
||||||
|
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||||
|
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||||
|
|
||||||
|
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
|
||||||
|
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
|
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
|
|
||||||
|
connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||||
|
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
|
||||||
|
|
||||||
|
/* displays Dialog */
|
||||||
|
GroupPoints->show();
|
||||||
|
this->show();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnOk()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_CircleDlg::ClickOnOk()
|
||||||
|
{
|
||||||
|
this->ClickOnApply();
|
||||||
|
ClickOnCancel();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnApply()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_CircleDlg::ClickOnApply()
|
||||||
|
{
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
||||||
|
if (mySimulationTopoDs.IsNull())
|
||||||
|
return;
|
||||||
|
myGeomGUI->EraseSimulationShape();
|
||||||
|
mySimulationTopoDs.Nullify();
|
||||||
|
|
||||||
|
if(myOkPoint1 && myOkDir)
|
||||||
|
myBasicGUI->MakeCircleAndDisplay(myPoint1, myDir, myRadius);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SelectionIntoArgument()
|
||||||
|
// purpose : Called when selection as changed or other case
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_CircleDlg::SelectionIntoArgument()
|
||||||
|
{
|
||||||
|
myGeomGUI->EraseSimulationShape();
|
||||||
|
myEditCurrentArgument->setText("");
|
||||||
|
QString aString = ""; /* name of selection */
|
||||||
|
|
||||||
|
int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString);
|
||||||
|
if (nbSel != 1) {
|
||||||
|
if(myEditCurrentArgument == GroupPoints->LineEdit1)
|
||||||
|
myOkPoint1 = false;
|
||||||
|
else if (myEditCurrentArgument == GroupPoints->LineEdit2)
|
||||||
|
myOkDir = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* nbSel == 1 */
|
||||||
|
TopoDS_Shape S;
|
||||||
|
if(!myGeomGUI->GetTopoFromSelection(mySelection, S))
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* gp_Pnt : not used */
|
||||||
|
if(myEditCurrentArgument == GroupPoints->LineEdit1 && myGeomGUI->VertexToPoint(S, myPoint1)) {
|
||||||
|
GroupPoints->LineEdit1->setText(aString);
|
||||||
|
myOkPoint1 = true;
|
||||||
|
}
|
||||||
|
else if (myEditCurrentArgument == GroupPoints->LineEdit2) {
|
||||||
|
BRepAdaptor_Curve curv(TopoDS::Edge(S));
|
||||||
|
myDir = curv.Line().Direction();
|
||||||
|
GroupPoints->LineEdit2->setText(aString);
|
||||||
|
myOkDir = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(myOkPoint1 && myOkDir)
|
||||||
|
this->MakeCircleSimulationAndDisplay();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SetEditCurrentArgument()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_CircleDlg::SetEditCurrentArgument()
|
||||||
|
{
|
||||||
|
QPushButton* send = (QPushButton*)sender();
|
||||||
|
|
||||||
|
if(send == GroupPoints->PushButton1) {
|
||||||
|
GroupPoints->LineEdit1->setFocus();
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
|
mySelection->AddFilter(myVertexFilter);
|
||||||
|
}
|
||||||
|
else if(send == GroupPoints->PushButton2) {
|
||||||
|
GroupPoints->LineEdit2->setFocus();
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||||
|
mySelection->AddFilter(myEdgeFilter);
|
||||||
|
}
|
||||||
|
this->SelectionIntoArgument();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : LineEditReturnPressed()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_CircleDlg::LineEditReturnPressed()
|
||||||
|
{
|
||||||
|
QLineEdit* send = (QLineEdit*)sender();
|
||||||
|
if(send == GroupPoints->LineEdit1)
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
|
else if (send == GroupPoints->LineEdit2)
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ActivateThisDialog()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_CircleDlg::ActivateThisDialog()
|
||||||
|
{
|
||||||
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
if(!mySimulationTopoDs.IsNull())
|
||||||
|
myGeomGUI->DisplaySimulationShape(mySimulationTopoDs);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : enterEvent()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_CircleDlg::enterEvent(QEvent* e)
|
||||||
|
{
|
||||||
|
if (GroupConstructors->isEnabled())
|
||||||
|
return;
|
||||||
|
this->ActivateThisDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ValueChangedInSpinBox()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_CircleDlg::ValueChangedInSpinBox( double newValue )
|
||||||
|
{
|
||||||
|
myGeomGUI->EraseSimulationShape();
|
||||||
|
mySimulationTopoDs.Nullify();
|
||||||
|
|
||||||
|
myRadius = newValue;
|
||||||
|
|
||||||
|
if (myOkPoint1 && myOkDir)
|
||||||
|
MakeCircleSimulationAndDisplay();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : MakeCircleSimulationAndDisplay()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_CircleDlg::MakeCircleSimulationAndDisplay()
|
||||||
|
{
|
||||||
|
myGeomGUI->EraseSimulationShape();
|
||||||
|
mySimulationTopoDs.Nullify();
|
||||||
|
|
||||||
|
try {
|
||||||
|
gp_Ax2 anAxis(myPoint1, myDir);
|
||||||
|
gp_Circ circ(anAxis, myRadius);
|
||||||
|
BRepBuilderAPI_MakeEdge MakeEdge(circ);
|
||||||
|
mySimulationTopoDs = MakeEdge.Shape();
|
||||||
|
myGeomGUI->DisplaySimulationShape(mySimulationTopoDs);
|
||||||
|
}
|
||||||
|
catch(Standard_Failure) {
|
||||||
|
MESSAGE("Exception catched in MakeCircleSimulationAndDisplay");
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
83
src/BasicGUI/BasicGUI_CircleDlg.h
Normal file
83
src/BasicGUI/BasicGUI_CircleDlg.h
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
// 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 : BasicGUI_CircleDlg.h
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
#ifndef DIALOGBOX_CIRCLE_H
|
||||||
|
#define DIALOGBOX_CIRCLE_H
|
||||||
|
|
||||||
|
#include "GEOMBase_Skeleton.h"
|
||||||
|
#include "DlgRef_2Sel1Spin.h"
|
||||||
|
|
||||||
|
#include "BasicGUI.h"
|
||||||
|
|
||||||
|
#include "GEOM_EdgeFilter.hxx"
|
||||||
|
|
||||||
|
#include <gp_Dir.hxx>
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BasicGUI_CircleDlg
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
class BasicGUI_CircleDlg : public GEOMBase_Skeleton
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
BasicGUI_CircleDlg(QWidget* parent = 0, const char* name = 0, BasicGUI* theBasicGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
|
||||||
|
~BasicGUI_CircleDlg();
|
||||||
|
|
||||||
|
private :
|
||||||
|
void Init();
|
||||||
|
void enterEvent(QEvent* e);
|
||||||
|
void MakeCircleSimulationAndDisplay();
|
||||||
|
|
||||||
|
BasicGUI* myBasicGUI;
|
||||||
|
|
||||||
|
double step;
|
||||||
|
Handle(GEOM_ShapeTypeFilter) myVertexFilter;
|
||||||
|
Handle(GEOM_EdgeFilter) myEdgeFilter; /* Filter selection */
|
||||||
|
|
||||||
|
gp_Pnt myPoint1;
|
||||||
|
gp_Dir myDir;
|
||||||
|
Standard_Real myRadius;
|
||||||
|
bool myOkPoint1;
|
||||||
|
bool myOkDir;
|
||||||
|
|
||||||
|
DlgRef_2Sel1Spin* GroupPoints;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void ClickOnOk();
|
||||||
|
void ClickOnApply();
|
||||||
|
void ActivateThisDialog();
|
||||||
|
void LineEditReturnPressed();
|
||||||
|
void SelectionIntoArgument();
|
||||||
|
void SetEditCurrentArgument();
|
||||||
|
void ValueChangedInSpinBox(double newValue);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DIALOGBOX_CIRCLE_H
|
318
src/BasicGUI/BasicGUI_EllipseDlg.cxx
Normal file
318
src/BasicGUI/BasicGUI_EllipseDlg.cxx
Normal file
@ -0,0 +1,318 @@
|
|||||||
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
|
//
|
||||||
|
// Copyright (C) 2003 OPEN CASCADE
|
||||||
|
//
|
||||||
|
// 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 : BasicGUI_EllipseDlg.cxx
|
||||||
|
// Author : Nicolas REJNERI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
#include "BasicGUI_EllipseDlg.h"
|
||||||
|
|
||||||
|
#include "gp_Elips.hxx"
|
||||||
|
|
||||||
|
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||||
|
#include <BRepAdaptor_Curve.hxx>
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BasicGUI_EllipseDlg()
|
||||||
|
// purpose : Constructs a BasicGUI_EllipseDlg which is a child of 'parent', with the
|
||||||
|
// name 'name' and widget flags set to 'f'.
|
||||||
|
// The dialog will by default be modeless, unless you set 'modal' to
|
||||||
|
// TRUE to construct a modal dialog.
|
||||||
|
//=================================================================================
|
||||||
|
BasicGUI_EllipseDlg::BasicGUI_EllipseDlg(QWidget* parent, const char* name, BasicGUI* theBasicGUI, 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_ELLIPSE_PV")));
|
||||||
|
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||||
|
|
||||||
|
setCaption(tr("GEOM_ELLIPSE_TITLE"));
|
||||||
|
|
||||||
|
/***************************************************************/
|
||||||
|
GroupConstructors->setTitle(tr("GEOM_ELLIPSE"));
|
||||||
|
RadioButton1->setPixmap(image0);
|
||||||
|
RadioButton2->close(TRUE);
|
||||||
|
RadioButton3->close(TRUE);
|
||||||
|
|
||||||
|
GroupPoints = new DlgRef_2Sel2Spin(this, "GroupPoints");
|
||||||
|
GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
|
||||||
|
GroupPoints->TextLabel1->setText(tr("GEOM_CENTER"));
|
||||||
|
GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR"));
|
||||||
|
GroupPoints->TextLabel3->setText(tr("GEOM_RADIUS_MINOR"));
|
||||||
|
GroupPoints->TextLabel4->setText(tr("GEOM_RADIUS_MAJOR"));
|
||||||
|
GroupPoints->PushButton1->setPixmap(image1);
|
||||||
|
GroupPoints->PushButton2->setPixmap(image1);
|
||||||
|
|
||||||
|
Layout1->addWidget(GroupPoints, 1, 0);
|
||||||
|
/***************************************************************/
|
||||||
|
|
||||||
|
/* Initialisations */
|
||||||
|
myBasicGUI = theBasicGUI;
|
||||||
|
Init();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ~BasicGUI_EllipseDlg()
|
||||||
|
// purpose : Destroys the object and frees any allocated resources
|
||||||
|
//=================================================================================
|
||||||
|
BasicGUI_EllipseDlg::~BasicGUI_EllipseDlg()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : Init()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_EllipseDlg::Init()
|
||||||
|
{
|
||||||
|
/* init variables */
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
|
|
||||||
|
myMajorRadius = 200.0;
|
||||||
|
myMinorRadius = 100.0;
|
||||||
|
myOkPoint = myOkDir = false;
|
||||||
|
|
||||||
|
myEdgeFilter = new GEOM_EdgeFilter(StdSelect_Line, myGeom);
|
||||||
|
myVertexFilter = new GEOM_ShapeTypeFilter(TopAbs_VERTEX, myGeom);
|
||||||
|
mySelection->AddFilter(myVertexFilter);
|
||||||
|
|
||||||
|
/* Get setting of step value from file configuration */
|
||||||
|
QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep");
|
||||||
|
step = St.toDouble();
|
||||||
|
|
||||||
|
/* min, max, step and decimals for spin boxes & initial values */
|
||||||
|
GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3);
|
||||||
|
GroupPoints->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, step, 3);
|
||||||
|
GroupPoints->SpinBox_DX->SetValue(myMajorRadius);
|
||||||
|
GroupPoints->SpinBox_DY->SetValue(myMinorRadius);
|
||||||
|
|
||||||
|
/* signals and slots connections */
|
||||||
|
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||||
|
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||||
|
|
||||||
|
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
|
||||||
|
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
|
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
|
|
||||||
|
connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||||
|
connect(GroupPoints->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||||
|
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
|
||||||
|
|
||||||
|
/* displays Dialog */
|
||||||
|
GroupPoints->show();
|
||||||
|
this->show();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnOk()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_EllipseDlg::ClickOnOk()
|
||||||
|
{
|
||||||
|
this->ClickOnApply();
|
||||||
|
ClickOnCancel();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnApply()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_EllipseDlg::ClickOnApply()
|
||||||
|
{
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
||||||
|
if (mySimulationTopoDs.IsNull())
|
||||||
|
return;
|
||||||
|
myGeomGUI->EraseSimulationShape();
|
||||||
|
mySimulationTopoDs.Nullify();
|
||||||
|
|
||||||
|
if(myOkPoint && myOkDir)
|
||||||
|
myBasicGUI->MakeEllipseAndDisplay(myPoint, myDir, myMajorRadius, myMinorRadius);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SelectionIntoArgument()
|
||||||
|
// purpose : Called when selection as changed or other case
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_EllipseDlg::SelectionIntoArgument()
|
||||||
|
{
|
||||||
|
myGeomGUI->EraseSimulationShape();
|
||||||
|
myEditCurrentArgument->setText("");
|
||||||
|
QString aString = ""; /* name of selection */
|
||||||
|
|
||||||
|
int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString);
|
||||||
|
if (nbSel != 1) {
|
||||||
|
if(myEditCurrentArgument == GroupPoints->LineEdit1)
|
||||||
|
myOkPoint = false;
|
||||||
|
else if (myEditCurrentArgument == GroupPoints->LineEdit2)
|
||||||
|
myOkDir = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* nbSel == 1 */
|
||||||
|
TopoDS_Shape S;
|
||||||
|
if(!myGeomGUI->GetTopoFromSelection(mySelection, S))
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* gp_Pnt : not used */
|
||||||
|
if(myEditCurrentArgument == GroupPoints->LineEdit1 && myGeomGUI->VertexToPoint(S, myPoint)) {
|
||||||
|
GroupPoints->LineEdit1->setText(aString);
|
||||||
|
myOkPoint = true;
|
||||||
|
}
|
||||||
|
else if (myEditCurrentArgument == GroupPoints->LineEdit2) {
|
||||||
|
BRepAdaptor_Curve curv(TopoDS::Edge(S));
|
||||||
|
myDir = curv.Line().Direction();
|
||||||
|
GroupPoints->LineEdit2->setText(aString);
|
||||||
|
myOkDir = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(myOkPoint && myOkDir)
|
||||||
|
this->MakeEllipseSimulationAndDisplay();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SetEditCurrentArgument()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_EllipseDlg::SetEditCurrentArgument()
|
||||||
|
{
|
||||||
|
QPushButton* send = (QPushButton*)sender();
|
||||||
|
|
||||||
|
if(send == GroupPoints->PushButton1) {
|
||||||
|
GroupPoints->LineEdit1->setFocus();
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
|
mySelection->AddFilter(myVertexFilter);
|
||||||
|
}
|
||||||
|
else if(send == GroupPoints->PushButton2) {
|
||||||
|
GroupPoints->LineEdit2->setFocus();
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||||
|
mySelection->AddFilter(myEdgeFilter);
|
||||||
|
}
|
||||||
|
this->SelectionIntoArgument();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : LineEditReturnPressed()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_EllipseDlg::LineEditReturnPressed()
|
||||||
|
{
|
||||||
|
QLineEdit* send = (QLineEdit*)sender();
|
||||||
|
if(send == GroupPoints->LineEdit1)
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
|
else if (send == GroupPoints->LineEdit2)
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ActivateThisDialog()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_EllipseDlg::ActivateThisDialog()
|
||||||
|
{
|
||||||
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
if(!mySimulationTopoDs.IsNull())
|
||||||
|
myGeomGUI->DisplaySimulationShape(mySimulationTopoDs);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : enterEvent()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_EllipseDlg::enterEvent(QEvent* e)
|
||||||
|
{
|
||||||
|
if (GroupConstructors->isEnabled())
|
||||||
|
return;
|
||||||
|
this->ActivateThisDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ValueChangedInSpinBox()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_EllipseDlg::ValueChangedInSpinBox( double newValue )
|
||||||
|
{
|
||||||
|
myGeomGUI->EraseSimulationShape();
|
||||||
|
mySimulationTopoDs.Nullify();
|
||||||
|
QObject* send = (QObject*)sender();
|
||||||
|
|
||||||
|
if(send == GroupPoints->SpinBox_DX )
|
||||||
|
myMajorRadius = newValue;
|
||||||
|
else if(send == GroupPoints->SpinBox_DY)
|
||||||
|
myMinorRadius = newValue;
|
||||||
|
|
||||||
|
if (myOkPoint && myOkDir)
|
||||||
|
MakeEllipseSimulationAndDisplay();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : MakeEllipseSimulationAndDisplay()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_EllipseDlg::MakeEllipseSimulationAndDisplay()
|
||||||
|
{
|
||||||
|
myGeomGUI->EraseSimulationShape();
|
||||||
|
mySimulationTopoDs.Nullify();
|
||||||
|
|
||||||
|
if(myMajorRadius < myMinorRadius)
|
||||||
|
return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
gp_Ax2 anAxis(myPoint, myDir);
|
||||||
|
gp_Elips ellipse(anAxis, myMajorRadius, myMinorRadius);
|
||||||
|
BRepBuilderAPI_MakeEdge MakeEdge(ellipse);
|
||||||
|
mySimulationTopoDs = MakeEdge.Shape();
|
||||||
|
myGeomGUI->DisplaySimulationShape(mySimulationTopoDs);
|
||||||
|
}
|
||||||
|
catch(Standard_Failure) {
|
||||||
|
MESSAGE("Exception catched in MakeEllipseSimulationAndDisplay");
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
84
src/BasicGUI/BasicGUI_EllipseDlg.h
Normal file
84
src/BasicGUI/BasicGUI_EllipseDlg.h
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
|
//
|
||||||
|
// Copyright (C) 2003 OPEN CASCADE
|
||||||
|
//
|
||||||
|
// 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 : BasicGUI_EllipseDlg.h
|
||||||
|
// Author : Nicolas REJNERI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
#ifndef BASICGUI_ELLIPSE_H
|
||||||
|
#define BASICGUI_ELLIPSE_H
|
||||||
|
|
||||||
|
#include "GEOMBase_Skeleton.h"
|
||||||
|
#include "DlgRef_2Sel2Spin.h"
|
||||||
|
|
||||||
|
#include "BasicGUI.h"
|
||||||
|
|
||||||
|
#include "GEOM_EdgeFilter.hxx"
|
||||||
|
|
||||||
|
#include <gp_Dir.hxx>
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BasicGUI_EllipseDlg
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
class BasicGUI_EllipseDlg : public GEOMBase_Skeleton
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
BasicGUI_EllipseDlg(QWidget* parent = 0, const char* name = 0, BasicGUI* theBasicGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
|
||||||
|
~BasicGUI_EllipseDlg();
|
||||||
|
|
||||||
|
private :
|
||||||
|
void Init();
|
||||||
|
void enterEvent(QEvent* e);
|
||||||
|
void MakeEllipseSimulationAndDisplay();
|
||||||
|
|
||||||
|
BasicGUI* myBasicGUI;
|
||||||
|
|
||||||
|
double step;
|
||||||
|
Handle(GEOM_ShapeTypeFilter) myVertexFilter;
|
||||||
|
Handle(GEOM_EdgeFilter) myEdgeFilter; /* Filter selection */
|
||||||
|
|
||||||
|
gp_Pnt myPoint; /* Central point of ellipse */
|
||||||
|
bool myOkPoint; /* true when myPoint is defined */
|
||||||
|
gp_Dir myDir; /* to set normal axis of ellipse */
|
||||||
|
bool myOkDir; /* true when myPoint is defined */
|
||||||
|
|
||||||
|
Standard_Real myMajorRadius;
|
||||||
|
Standard_Real myMinorRadius;
|
||||||
|
|
||||||
|
DlgRef_2Sel2Spin* GroupPoints;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void ClickOnOk();
|
||||||
|
void ClickOnApply();
|
||||||
|
void ActivateThisDialog();
|
||||||
|
void LineEditReturnPressed();
|
||||||
|
void SelectionIntoArgument();
|
||||||
|
void SetEditCurrentArgument();
|
||||||
|
void ValueChangedInSpinBox(double newValue);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // BASICGUI_ELLIPSE_H
|
281
src/BasicGUI/BasicGUI_LineDlg.cxx
Normal file
281
src/BasicGUI/BasicGUI_LineDlg.cxx
Normal file
@ -0,0 +1,281 @@
|
|||||||
|
// 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 : BasicGUI_LineDlg.cxx
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
#include "BasicGUI_LineDlg.h"
|
||||||
|
|
||||||
|
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||||
|
#include <TopoDS_Compound.hxx>
|
||||||
|
#include <BRep_Builder.hxx>
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BasicGUI_LineDlg()
|
||||||
|
// purpose : Constructs a BasicGUI_LineDlg which is a child of 'parent', with the
|
||||||
|
// name 'name' and widget flags set to 'f'.
|
||||||
|
// The dialog will by default be modeless, unless you set 'modal' to
|
||||||
|
// TRUE to construct a modal dialog.
|
||||||
|
//=================================================================================
|
||||||
|
BasicGUI_LineDlg::BasicGUI_LineDlg(QWidget* parent, const char* name, BasicGUI* theBasicGUI, 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_LINE_2P")));
|
||||||
|
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT")));
|
||||||
|
|
||||||
|
setCaption(tr("GEOM_LINE_TITLE"));
|
||||||
|
|
||||||
|
/***************************************************************/
|
||||||
|
GroupConstructors->setTitle(tr("GEOM_LINE"));
|
||||||
|
RadioButton1->setPixmap(image0);
|
||||||
|
RadioButton2->close(TRUE);
|
||||||
|
RadioButton3->close(TRUE);
|
||||||
|
|
||||||
|
GroupPoints = new DlgRef_2Sel_QTD(this, "GroupPoints");
|
||||||
|
GroupPoints->GroupBox1->setTitle(tr("GEOM_POINTS"));
|
||||||
|
GroupPoints->TextLabel1->setText(tr("GEOM_POINT_I").arg("1"));
|
||||||
|
GroupPoints->TextLabel2->setText(tr("GEOM_POINT_I").arg("2"));
|
||||||
|
GroupPoints->PushButton1->setPixmap(image1);
|
||||||
|
GroupPoints->PushButton2->setPixmap(image1);
|
||||||
|
|
||||||
|
Layout1->addWidget(GroupPoints, 1, 0);
|
||||||
|
/***************************************************************/
|
||||||
|
|
||||||
|
/* Initialisations */
|
||||||
|
myBasicGUI = theBasicGUI;
|
||||||
|
Init();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ~BasicGUI_LineDlg()
|
||||||
|
// purpose : Destroys the object and frees any allocated resources
|
||||||
|
//=================================================================================
|
||||||
|
BasicGUI_LineDlg::~BasicGUI_LineDlg()
|
||||||
|
{
|
||||||
|
/* no need to delete child widgets, Qt does it all for us */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : Init()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_LineDlg::Init()
|
||||||
|
{
|
||||||
|
/* init variables */
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
|
|
||||||
|
myPoint1.SetCoord(0.0, 0.0, 0.0);
|
||||||
|
myPoint2.SetCoord(0.0, 0.0, 0.0);
|
||||||
|
myOkPoint1 = myOkPoint2 = false;
|
||||||
|
|
||||||
|
/* Vertices Filter for all arguments */
|
||||||
|
myVertexFilter = new GEOM_ShapeTypeFilter(TopAbs_VERTEX, myGeom);
|
||||||
|
mySelection->AddFilter(myVertexFilter);
|
||||||
|
|
||||||
|
/* signals and slots connections */
|
||||||
|
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||||
|
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||||
|
|
||||||
|
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
|
||||||
|
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
|
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
|
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
|
||||||
|
/* displays Dialog */
|
||||||
|
GroupPoints->show();
|
||||||
|
this->show();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnOk()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_LineDlg::ClickOnOk()
|
||||||
|
{
|
||||||
|
this->ClickOnApply();
|
||||||
|
ClickOnCancel();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnApply()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_LineDlg::ClickOnApply()
|
||||||
|
{
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
||||||
|
if (mySimulationTopoDs.IsNull())
|
||||||
|
return;
|
||||||
|
myGeomGUI->EraseSimulationShape();
|
||||||
|
mySimulationTopoDs.Nullify();
|
||||||
|
|
||||||
|
if(myOkPoint1 && myOkPoint2)
|
||||||
|
myBasicGUI->MakeLineAndDisplay(myPoint1, myPoint2);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SelectionIntoArgument()
|
||||||
|
// purpose : Called when selection as changed or other case
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_LineDlg::SelectionIntoArgument()
|
||||||
|
{
|
||||||
|
myGeomGUI->EraseSimulationShape();
|
||||||
|
myEditCurrentArgument->setText("");
|
||||||
|
QString aString = ""; /* name of selection */
|
||||||
|
|
||||||
|
int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString);
|
||||||
|
if(nbSel != 1) {
|
||||||
|
if(myEditCurrentArgument == GroupPoints->LineEdit1)
|
||||||
|
myOkPoint1 = false;
|
||||||
|
else if(myEditCurrentArgument == GroupPoints->LineEdit2)
|
||||||
|
myOkPoint2 = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// nbSel == 1
|
||||||
|
TopoDS_Shape S;
|
||||||
|
if(!myGeomGUI->GetTopoFromSelection(mySelection, S))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(myEditCurrentArgument == GroupPoints->LineEdit1 && myGeomGUI->VertexToPoint(S, myPoint1)) {
|
||||||
|
myEditCurrentArgument->setText(aString);
|
||||||
|
myOkPoint1 = true;
|
||||||
|
}
|
||||||
|
else if(myEditCurrentArgument == GroupPoints->LineEdit2 && myGeomGUI->VertexToPoint(S, myPoint2)) {
|
||||||
|
myEditCurrentArgument->setText(aString);
|
||||||
|
myOkPoint2 = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(myOkPoint1 && myOkPoint2 && myPoint1.Distance(myPoint2) > Precision::Confusion() ) {
|
||||||
|
mySimulationTopoDs = BRepBuilderAPI_MakeEdge(myPoint1, myPoint2).Shape();
|
||||||
|
/* Try to add an arrow at simulation shape */
|
||||||
|
bool notNeedToTest = this->AddArrowToSimulation(mySimulationTopoDs);
|
||||||
|
myGeomGUI->DisplaySimulationShape(mySimulationTopoDs);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SetEditCurrentArgument()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_LineDlg::SetEditCurrentArgument()
|
||||||
|
{
|
||||||
|
QPushButton* send = (QPushButton*)sender();
|
||||||
|
|
||||||
|
if(send == GroupPoints->PushButton1) {
|
||||||
|
GroupPoints->LineEdit1->setFocus();
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
|
}
|
||||||
|
else if(send == GroupPoints->PushButton2) {
|
||||||
|
GroupPoints->LineEdit2->setFocus();
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||||
|
}
|
||||||
|
mySelection->AddFilter(myVertexFilter);
|
||||||
|
this->SelectionIntoArgument();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : LineEditReturnPressed()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_LineDlg::LineEditReturnPressed()
|
||||||
|
{
|
||||||
|
QLineEdit* send = (QLineEdit*)sender();
|
||||||
|
if(send == GroupPoints->LineEdit1)
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
|
else if(send == GroupPoints->LineEdit2)
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ActivateThisDialog()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_LineDlg::ActivateThisDialog()
|
||||||
|
{
|
||||||
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
if(!mySimulationTopoDs.IsNull())
|
||||||
|
myGeomGUI->DisplaySimulationShape(mySimulationTopoDs);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : enterEvent()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_LineDlg::enterEvent(QEvent* e)
|
||||||
|
{
|
||||||
|
if(GroupConstructors->isEnabled())
|
||||||
|
return;
|
||||||
|
this->ActivateThisDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : AddArrowToSimulation()
|
||||||
|
// purpose : An arrow (cone topology) is added to 'modifiedShape'
|
||||||
|
// : to simulate a vector or an 'oriented line' display. The result is in 'modifiedShape'.
|
||||||
|
// : If an arrow can't be added returns false and 'modifiedShape' isn't modified !
|
||||||
|
//=================================================================================
|
||||||
|
bool BasicGUI_LineDlg::AddArrowToSimulation(TopoDS_Shape& modifiedShape)
|
||||||
|
{
|
||||||
|
TopoDS_Shape arrow;
|
||||||
|
/* Try to add a cone simulation shape to show direction of a linear edge */
|
||||||
|
if(myGeomGUI->CreateArrowForLinearEdge(modifiedShape, arrow)) {
|
||||||
|
TopoDS_Compound Comp;
|
||||||
|
BRep_Builder B;
|
||||||
|
B.MakeCompound (Comp);
|
||||||
|
B.Add(Comp, modifiedShape);
|
||||||
|
B.Add(Comp, arrow);
|
||||||
|
modifiedShape = Comp;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
74
src/BasicGUI/BasicGUI_LineDlg.h
Normal file
74
src/BasicGUI/BasicGUI_LineDlg.h
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
// 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 : BasicGUI_LineDlg.h
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
#ifndef DIALOGBOX_LINE_H
|
||||||
|
#define DIALOGBOX_LINE_H
|
||||||
|
|
||||||
|
#include "GEOMBase_Skeleton.h"
|
||||||
|
#include "DlgRef_2Sel_QTD.h"
|
||||||
|
|
||||||
|
#include "BasicGUI.h"
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BasicGUI_LineDlg
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
class BasicGUI_LineDlg : public GEOMBase_Skeleton
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
BasicGUI_LineDlg(QWidget* parent = 0, const char* name = 0, BasicGUI* theBasicGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
|
||||||
|
~BasicGUI_LineDlg();
|
||||||
|
|
||||||
|
private :
|
||||||
|
void Init();
|
||||||
|
void enterEvent(QEvent* e);
|
||||||
|
bool AddArrowToSimulation(TopoDS_Shape& modifiedShape);
|
||||||
|
|
||||||
|
BasicGUI* myBasicGUI;
|
||||||
|
Handle(GEOM_ShapeTypeFilter) myVertexFilter; /* Filter selection */
|
||||||
|
|
||||||
|
gp_Pnt myPoint1; /* Points containing the vector */
|
||||||
|
gp_Pnt myPoint2;
|
||||||
|
bool myOkPoint1; /* Are true when myPoint is defined */
|
||||||
|
bool myOkPoint2;
|
||||||
|
|
||||||
|
DlgRef_2Sel_QTD* GroupPoints;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void ClickOnOk();
|
||||||
|
void ClickOnApply();
|
||||||
|
void ActivateThisDialog();
|
||||||
|
void LineEditReturnPressed();
|
||||||
|
void SelectionIntoArgument();
|
||||||
|
void SetEditCurrentArgument();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DIALOGBOX_LINE_H
|
566
src/BasicGUI/BasicGUI_PlaneDlg.cxx
Normal file
566
src/BasicGUI/BasicGUI_PlaneDlg.cxx
Normal file
@ -0,0 +1,566 @@
|
|||||||
|
// 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 : BasicGUI_PlaneDlg.cxx
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
#include "BasicGUI_PlaneDlg.h"
|
||||||
|
|
||||||
|
#include <BRepBuilderAPI_MakeFace.hxx>
|
||||||
|
#include <BRepAdaptor_Surface.hxx>
|
||||||
|
#include <gp_Pln.hxx>
|
||||||
|
#include <gp_Ax1.hxx>
|
||||||
|
#include <gp_Dir.hxx>
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BasicGUI_PlaneDlg()
|
||||||
|
// purpose : Constructs a BasicGUI_PlaneDlg which is a child of 'parent', with the
|
||||||
|
// name 'name' and widget flags set to 'f'.
|
||||||
|
// The dialog will by default be modeless, unless you set 'modal' to
|
||||||
|
// TRUE to construct a modal dialog.
|
||||||
|
//=================================================================================
|
||||||
|
BasicGUI_PlaneDlg::BasicGUI_PlaneDlg(QWidget* parent, const char* name, BasicGUI* theBasicGUI, 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_PLANE_PV")));
|
||||||
|
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_PLANE_DXYZ")));
|
||||||
|
QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_PLANE_FACE")));
|
||||||
|
QPixmap image3(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||||
|
|
||||||
|
setCaption(tr("GEOM_PLANE_TITLE"));
|
||||||
|
|
||||||
|
/***************************************************************/
|
||||||
|
GroupConstructors->setTitle(tr("GEOM_PLANE"));
|
||||||
|
RadioButton1->setPixmap(image0);
|
||||||
|
RadioButton2->setPixmap(image1);
|
||||||
|
RadioButton3->setPixmap(image2);
|
||||||
|
|
||||||
|
GroupPointDirection = new DlgRef_2Sel1Spin(this, "GroupPointDirection");
|
||||||
|
GroupPointDirection->GroupBox1->setTitle(tr("GEOM_PLANE_PV"));
|
||||||
|
GroupPointDirection->TextLabel1->setText(tr("GEOM_POINT"));
|
||||||
|
GroupPointDirection->TextLabel2->setText(tr("GEOM_VECTOR"));
|
||||||
|
GroupPointDirection->TextLabel3->setText(tr("GEOM_PLANE_SIZE"));
|
||||||
|
GroupPointDirection->PushButton1->setPixmap(image3);
|
||||||
|
GroupPointDirection->PushButton2->setPixmap(image3);
|
||||||
|
|
||||||
|
GroupPointPlusCoordinates = new DlgRef_1Sel4Spin(this, "GroupPointPlusCoordinates" );
|
||||||
|
GroupPointPlusCoordinates->GroupBox1->setTitle(tr("GEOM_PLANE_PVC"));
|
||||||
|
GroupPointPlusCoordinates->TextLabel1->setText(tr("GEOM_POINT"));
|
||||||
|
GroupPointPlusCoordinates->TextLabel2->setText(tr("GEOM_COOR"));
|
||||||
|
GroupPointPlusCoordinates->TextLabel3->setText(tr("GEOM_DX"));
|
||||||
|
GroupPointPlusCoordinates->TextLabel4->setText(tr("GEOM_DY"));
|
||||||
|
GroupPointPlusCoordinates->TextLabel5->setText(tr("GEOM_DZ"));
|
||||||
|
GroupPointPlusCoordinates->TextLabel6->setText(tr("GEOM_PLANE_SIZE"));
|
||||||
|
GroupPointPlusCoordinates->PushButton1->setPixmap(image3);
|
||||||
|
|
||||||
|
GroupFace = new DlgRef_1Sel1Spin(this, "GroupFace");
|
||||||
|
GroupFace->GroupBox1->setTitle(tr("GEOM_FACE"));
|
||||||
|
GroupFace->TextLabel1->setText(tr("GEOM_SELECTION"));
|
||||||
|
GroupFace->TextLabel2->setText(tr("GEOM_PLANE_SIZE"));
|
||||||
|
GroupFace->PushButton1->setPixmap(image3);
|
||||||
|
|
||||||
|
Layout1->addWidget(GroupPointDirection, 1, 0);
|
||||||
|
Layout1->addWidget(GroupPointPlusCoordinates, 1, 0);
|
||||||
|
Layout1->addWidget(GroupFace, 1, 0);
|
||||||
|
/***************************************************************/
|
||||||
|
|
||||||
|
/* Initialisation */
|
||||||
|
myBasicGUI = theBasicGUI;
|
||||||
|
Init();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ~BasicGUI_PlaneDlg()
|
||||||
|
// purpose : Destroys the object and frees any allocated resources
|
||||||
|
//=================================================================================
|
||||||
|
BasicGUI_PlaneDlg::~BasicGUI_PlaneDlg()
|
||||||
|
{
|
||||||
|
/* no need to delete child widgets, Qt does it all for us */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : Init()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_PlaneDlg::Init()
|
||||||
|
{
|
||||||
|
/* init variables */
|
||||||
|
myConstructorId = 0;
|
||||||
|
myEditCurrentArgument = GroupPointDirection->LineEdit1;
|
||||||
|
|
||||||
|
myPoint1.SetCoord(0.0, 0.0, 0.0);
|
||||||
|
myOkPoint1 = myOkDirection = myOkCoordinates = myOkPlanarFace = false;
|
||||||
|
|
||||||
|
/* Filters definition */
|
||||||
|
myVertexFilter = new GEOM_ShapeTypeFilter(TopAbs_VERTEX, myGeom);
|
||||||
|
myEdgeFilter = new GEOM_ShapeTypeFilter(TopAbs_EDGE, myGeom);
|
||||||
|
myFaceFilter = new GEOM_FaceFilter(StdSelect_Plane, myGeom);
|
||||||
|
/* Filter for the next selection */
|
||||||
|
mySelection->AddFilter(myVertexFilter);
|
||||||
|
|
||||||
|
/* Get setting of step value from file configuration */
|
||||||
|
QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep");
|
||||||
|
step = St.toDouble();
|
||||||
|
this->myTrimSize = 2000.0;
|
||||||
|
|
||||||
|
/* min, max, step and decimals for spin boxes */
|
||||||
|
GroupPointDirection->SpinBox_DX->RangeStepAndValidator(+0.001, 10000000.0, step, 5);
|
||||||
|
GroupPointDirection->SpinBox_DX->SetValue(myTrimSize);
|
||||||
|
|
||||||
|
GroupPointPlusCoordinates->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3);
|
||||||
|
GroupPointPlusCoordinates->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3);
|
||||||
|
GroupPointPlusCoordinates->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3);
|
||||||
|
GroupPointPlusCoordinates->SpinBox_DX->SetValue(1.0);
|
||||||
|
GroupPointPlusCoordinates->SpinBox_DY->SetValue(1.0);
|
||||||
|
GroupPointPlusCoordinates->SpinBox_DZ->SetValue(1.0);
|
||||||
|
GroupPointPlusCoordinates->SpinBox_S->RangeStepAndValidator(+0.001, 10000000.0, step, 5);
|
||||||
|
GroupPointPlusCoordinates->SpinBox_S->SetValue(myTrimSize) ;
|
||||||
|
|
||||||
|
GroupFace->SpinBox_DX->RangeStepAndValidator(+0.001, 10000000.0, step, 5);
|
||||||
|
GroupFace->SpinBox_DX->SetValue(myTrimSize);
|
||||||
|
|
||||||
|
/* signals and slots connections */
|
||||||
|
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||||
|
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||||
|
connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int)));
|
||||||
|
|
||||||
|
connect(GroupPointDirection->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
connect(GroupPointDirection->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
connect(GroupPointPlusCoordinates->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
connect(GroupFace->PushButton1, SIGNAL(clicked()), this, SLOT( SetEditCurrentArgument()));
|
||||||
|
|
||||||
|
connect(GroupPointDirection->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
|
connect(GroupPointDirection->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
|
connect(GroupPointPlusCoordinates->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
|
connect(GroupFace->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
|
|
||||||
|
connect(GroupPointPlusCoordinates->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||||
|
connect(GroupPointPlusCoordinates->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||||
|
connect(GroupPointPlusCoordinates->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||||
|
connect(GroupPointPlusCoordinates->SpinBox_S, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||||
|
connect(GroupPointDirection->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||||
|
connect(GroupFace->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||||
|
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
|
||||||
|
/* Displays Dialog */
|
||||||
|
GroupPointPlusCoordinates->hide();
|
||||||
|
GroupFace->hide();
|
||||||
|
GroupPointDirection->show();
|
||||||
|
this->show();
|
||||||
|
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ConstructorsClicked()
|
||||||
|
// purpose : Radio button management
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_PlaneDlg::ConstructorsClicked(int constructorId)
|
||||||
|
{
|
||||||
|
myConstructorId = constructorId;
|
||||||
|
mySelection->ClearFilters();
|
||||||
|
myGeomGUI->EraseSimulationShape();
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
myOkPoint1 = myOkDirection = myOkCoordinates = myOkPlanarFace = false;
|
||||||
|
|
||||||
|
switch (constructorId)
|
||||||
|
{
|
||||||
|
case 0: /* plane from a point and a direction (vector, edge...) */
|
||||||
|
{
|
||||||
|
GroupPointPlusCoordinates->hide();
|
||||||
|
GroupFace->hide();
|
||||||
|
resize(0, 0);
|
||||||
|
GroupPointDirection->show();
|
||||||
|
|
||||||
|
myEditCurrentArgument = GroupPointDirection->LineEdit1;
|
||||||
|
GroupPointDirection->LineEdit1->setText(tr(""));
|
||||||
|
GroupPointDirection->LineEdit2->setText(tr(""));
|
||||||
|
|
||||||
|
/* for the first argument */
|
||||||
|
mySelection->AddFilter(myVertexFilter);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1: /* plane from a point and vector coordinates */
|
||||||
|
{
|
||||||
|
GroupPointDirection->hide();
|
||||||
|
GroupFace->hide();
|
||||||
|
resize(0, 0);
|
||||||
|
GroupPointPlusCoordinates->show();
|
||||||
|
|
||||||
|
myEditCurrentArgument = GroupPointPlusCoordinates->LineEdit1;
|
||||||
|
GroupPointPlusCoordinates->LineEdit1->setText(tr(""));
|
||||||
|
GroupPointPlusCoordinates->SpinBox_DX->SetValue(1.0);
|
||||||
|
GroupPointPlusCoordinates->SpinBox_DY->SetValue(1.0);
|
||||||
|
GroupPointPlusCoordinates->SpinBox_DZ->SetValue(1.0);
|
||||||
|
myOkCoordinates = true;
|
||||||
|
|
||||||
|
/* for the first argument */
|
||||||
|
mySelection->AddFilter(myVertexFilter);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2: /* plane from a planar face selection */
|
||||||
|
{
|
||||||
|
GroupPointDirection->hide();
|
||||||
|
GroupPointPlusCoordinates->hide();
|
||||||
|
resize(0, 0);
|
||||||
|
GroupFace->show();
|
||||||
|
|
||||||
|
myEditCurrentArgument = GroupFace->LineEdit1;
|
||||||
|
GroupFace->LineEdit1->setText(tr(""));
|
||||||
|
|
||||||
|
/* for the first argument */
|
||||||
|
mySelection->AddFilter(myFaceFilter);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnOk()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_PlaneDlg::ClickOnOk()
|
||||||
|
{
|
||||||
|
this->ClickOnApply();
|
||||||
|
ClickOnCancel();
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnApply()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_PlaneDlg::ClickOnApply()
|
||||||
|
{
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
||||||
|
if (mySimulationTopoDs.IsNull())
|
||||||
|
return;
|
||||||
|
myGeomGUI->EraseSimulationShape();
|
||||||
|
mySimulationTopoDs.Nullify();
|
||||||
|
|
||||||
|
switch(myConstructorId)
|
||||||
|
{
|
||||||
|
case 0 : /* args are myPoint1 and myDx, myDy, myDz from a vector(edge) */
|
||||||
|
{
|
||||||
|
if(myOkPoint1 && myOkDirection)
|
||||||
|
myBasicGUI->MakePlaneAndDisplay(myPoint1, myDx, myDy, myDz, myTrimSize);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1 : /* args are myPoint1 and myDx, myDy, myDz from a Spin Box */
|
||||||
|
{
|
||||||
|
if(myOkPoint1)
|
||||||
|
myBasicGUI->MakePlaneAndDisplay(myPoint1, myDx, myDy, myDz, myTrimSize);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2 : /* arg is a planar face selection */
|
||||||
|
{
|
||||||
|
if(myOkPlanarFace)
|
||||||
|
myBasicGUI->MakePlaneAndDisplay(myPoint1, myDx, myDy, myDz, myTrimSize);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SelectionIntoArgument()
|
||||||
|
// purpose : Called when selection has changed
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_PlaneDlg::SelectionIntoArgument()
|
||||||
|
{
|
||||||
|
myGeomGUI->EraseSimulationShape();
|
||||||
|
mySimulationTopoDs.Nullify();
|
||||||
|
QString aString = "";
|
||||||
|
|
||||||
|
int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString);
|
||||||
|
if(nbSel != 1) {
|
||||||
|
switch (myConstructorId)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
{
|
||||||
|
if(myEditCurrentArgument == GroupPointDirection->LineEdit1) {
|
||||||
|
GroupPointDirection->LineEdit1->setText("");
|
||||||
|
myOkPoint1 = false ;
|
||||||
|
}
|
||||||
|
else if(myEditCurrentArgument == GroupPointDirection->LineEdit2) {
|
||||||
|
GroupPointDirection->LineEdit2->setText("");
|
||||||
|
myOkDirection = false ;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
if(myEditCurrentArgument == GroupPointPlusCoordinates->LineEdit1) {
|
||||||
|
GroupPointPlusCoordinates->LineEdit1->setText("") ;
|
||||||
|
myOkPoint1 = false ;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2:
|
||||||
|
{
|
||||||
|
if(myEditCurrentArgument == GroupFace->LineEdit1) {
|
||||||
|
GroupFace->LineEdit1->setText("") ;
|
||||||
|
if(aString.compare("") == 0)
|
||||||
|
myOkPlanarFace = false;
|
||||||
|
else
|
||||||
|
myOkPlanarFace = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* nbSel == 1 */
|
||||||
|
TopoDS_Shape S;
|
||||||
|
if(!myGeomGUI->GetTopoFromSelection(mySelection, S))
|
||||||
|
return ;
|
||||||
|
|
||||||
|
/* FIRST CONSTRUCTOR */
|
||||||
|
if(myEditCurrentArgument == GroupPointDirection->LineEdit1 && myGeomGUI->VertexToPoint(S, myPoint1)) {
|
||||||
|
GroupPointDirection->LineEdit1->setText(aString);
|
||||||
|
myOkPoint1 = true;
|
||||||
|
}
|
||||||
|
else if( myEditCurrentArgument == GroupPointDirection->LineEdit2) {
|
||||||
|
/* We verify if the selection is a linear edge */
|
||||||
|
gp_Pnt Pfirst, Plast;
|
||||||
|
if( myGeomGUI->LinearEdgeExtremities(S, Pfirst, Plast)) {
|
||||||
|
myGeomGUI->GetBipointDxDyDz(Pfirst, Plast, myDx, myDy, myDz);
|
||||||
|
GroupPointDirection->LineEdit2->setText(aString);
|
||||||
|
myOkDirection = true;
|
||||||
|
this->myTrimSize = GroupPointDirection->SpinBox_DX->GetValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* SECOND CONSTRUCTOR */
|
||||||
|
else if(myEditCurrentArgument == GroupPointPlusCoordinates->LineEdit1 && myGeomGUI->VertexToPoint(S, myPoint1)) {
|
||||||
|
GroupPointPlusCoordinates->LineEdit1->setText(aString);
|
||||||
|
/* Get arguments */
|
||||||
|
myDx = GroupPointPlusCoordinates->SpinBox_DX->GetValue();
|
||||||
|
myDy = GroupPointPlusCoordinates->SpinBox_DY->GetValue();
|
||||||
|
myDz = GroupPointPlusCoordinates->SpinBox_DZ->GetValue();
|
||||||
|
this->myTrimSize = GroupPointPlusCoordinates->SpinBox_S->GetValue();
|
||||||
|
myOkPoint1 = true;
|
||||||
|
myOkCoordinates = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* THIRD CONSTRUCTOR */
|
||||||
|
else if(myEditCurrentArgument == GroupFace->LineEdit1) {
|
||||||
|
if(myOkPlanarFace) {
|
||||||
|
GroupFace->LineEdit1->setText(aString);
|
||||||
|
BRepAdaptor_Surface surf(TopoDS::Face(S));
|
||||||
|
gp_Pln Plane = surf.Plane();
|
||||||
|
|
||||||
|
gp_Pnt myPoint1 = Plane.Location();
|
||||||
|
gp_Ax1 ax = Plane.Axis();
|
||||||
|
myDx = (ax.Direction()).X();
|
||||||
|
myDy = (ax.Direction()).Y();
|
||||||
|
myDz = (ax.Direction()).Z();
|
||||||
|
this->myTrimSize = GroupFace->SpinBox_DX->GetValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Call method simulation */
|
||||||
|
if((myOkPoint1 && myOkDirection) || (myOkPoint1 && myOkCoordinates) || myOkPlanarFace) {
|
||||||
|
if(myDx*myDx + myDy*myDy + myDz*myDz > Precision::Confusion()*Precision::Confusion())
|
||||||
|
MakePlaneSimulationAndDisplay(myPoint1, myDx, myDy, myDz, myTrimSize) ;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SetEditCurrentArgument()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_PlaneDlg::SetEditCurrentArgument()
|
||||||
|
{
|
||||||
|
QPushButton* send = (QPushButton*)sender();
|
||||||
|
mySelection->ClearFilters() ;
|
||||||
|
|
||||||
|
switch (myConstructorId)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
{
|
||||||
|
if(send == GroupPointDirection->PushButton1) {
|
||||||
|
GroupPointDirection->LineEdit1->setFocus();
|
||||||
|
myEditCurrentArgument = GroupPointDirection->LineEdit1;
|
||||||
|
mySelection->AddFilter(myVertexFilter);
|
||||||
|
}
|
||||||
|
else if(send == GroupPointDirection->PushButton2) {
|
||||||
|
GroupPointDirection->LineEdit2->setFocus();
|
||||||
|
myEditCurrentArgument = GroupPointDirection->LineEdit2;
|
||||||
|
/* Edge filter here */
|
||||||
|
mySelection->AddFilter(myEdgeFilter);
|
||||||
|
SelectionIntoArgument();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
if(send == GroupPointPlusCoordinates->PushButton1) {
|
||||||
|
GroupPointPlusCoordinates->LineEdit1->setFocus();
|
||||||
|
myEditCurrentArgument = GroupPointPlusCoordinates->LineEdit1;
|
||||||
|
/* Vertex filter here */
|
||||||
|
mySelection->AddFilter(myVertexFilter);
|
||||||
|
SelectionIntoArgument();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2:
|
||||||
|
{
|
||||||
|
if(send == GroupFace->PushButton1) {
|
||||||
|
GroupFace->LineEdit1->setFocus();
|
||||||
|
myEditCurrentArgument = GroupFace->LineEdit1;
|
||||||
|
/* Face filter here */
|
||||||
|
mySelection->AddFilter(myFaceFilter);
|
||||||
|
SelectionIntoArgument();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : LineEditReturnPressed()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_PlaneDlg::LineEditReturnPressed()
|
||||||
|
{
|
||||||
|
QLineEdit* send = (QLineEdit*)sender();
|
||||||
|
if(send == GroupPointDirection->LineEdit1)
|
||||||
|
myEditCurrentArgument = GroupPointDirection->LineEdit1;
|
||||||
|
else if (send == GroupPointDirection->LineEdit2)
|
||||||
|
myEditCurrentArgument = GroupPointDirection->LineEdit2;
|
||||||
|
else if (send == GroupPointPlusCoordinates->LineEdit1)
|
||||||
|
myEditCurrentArgument = GroupPointPlusCoordinates->LineEdit1;
|
||||||
|
else if (send == GroupFace->LineEdit1)
|
||||||
|
myEditCurrentArgument = GroupFace->LineEdit1;
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ActivateThisDialog()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_PlaneDlg::ActivateThisDialog()
|
||||||
|
{
|
||||||
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
if(!mySimulationTopoDs.IsNull())
|
||||||
|
myGeomGUI->DisplaySimulationShape(mySimulationTopoDs);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : enterEvent()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_PlaneDlg::enterEvent(QEvent* e)
|
||||||
|
{
|
||||||
|
if (GroupConstructors->isEnabled())
|
||||||
|
return;
|
||||||
|
this->ActivateThisDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ValueChangedInSpinBox()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_PlaneDlg::ValueChangedInSpinBox( double newValue )
|
||||||
|
{
|
||||||
|
myGeomGUI->EraseSimulationShape();
|
||||||
|
mySimulationTopoDs.Nullify();
|
||||||
|
QObject* send = (QObject*)sender() ;
|
||||||
|
|
||||||
|
if(send == GroupPointPlusCoordinates->SpinBox_DX) {
|
||||||
|
myDx = newValue;
|
||||||
|
myDy = GroupPointPlusCoordinates->SpinBox_DY->GetValue();
|
||||||
|
myDz = GroupPointPlusCoordinates->SpinBox_DZ->GetValue();
|
||||||
|
} else if(send == GroupPointPlusCoordinates->SpinBox_DY) {
|
||||||
|
myDx = GroupPointPlusCoordinates->SpinBox_DX->GetValue();
|
||||||
|
myDy = newValue;
|
||||||
|
myDz = GroupPointPlusCoordinates->SpinBox_DZ->GetValue();
|
||||||
|
} else if(send == GroupPointPlusCoordinates->SpinBox_DZ) {
|
||||||
|
myDx = GroupPointPlusCoordinates->SpinBox_DX->GetValue();
|
||||||
|
myDy = GroupPointPlusCoordinates->SpinBox_DY->GetValue();
|
||||||
|
myDz = newValue;
|
||||||
|
} else if(send == GroupPointDirection->SpinBox_DX || send == GroupPointPlusCoordinates->SpinBox_S || send == GroupFace->SpinBox_DX) {
|
||||||
|
myTrimSize = newValue;
|
||||||
|
} else
|
||||||
|
return;
|
||||||
|
|
||||||
|
if((myOkPoint1 && myOkDirection) || (myOkPoint1 && myOkCoordinates) || myOkPlanarFace) {
|
||||||
|
if (myDx*myDx + myDy*myDy + myDz*myDz > Precision::Confusion() * Precision::Confusion())
|
||||||
|
MakePlaneSimulationAndDisplay( myPoint1, myDx, myDy, myDz, myTrimSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : MakePlaneSimulationAndDisplay(()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_PlaneDlg::MakePlaneSimulationAndDisplay(const gp_Pnt& P1,
|
||||||
|
const Standard_Real dx,
|
||||||
|
const Standard_Real dy,
|
||||||
|
const Standard_Real dz,
|
||||||
|
const Standard_Real trimsize)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
gp_Dir aDirection(dx, dy, dz);
|
||||||
|
/* We make a trimmed plane */
|
||||||
|
gp_Pln gplane(P1, aDirection);
|
||||||
|
mySimulationTopoDs = BRepBuilderAPI_MakeFace(gplane, -trimsize, +trimsize, -trimsize, +trimsize);
|
||||||
|
}
|
||||||
|
catch(Standard_Failure) {
|
||||||
|
MESSAGE( "Exception catched in MakePlaneSimulation" << endl );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
myGeomGUI->DisplaySimulationShape(mySimulationTopoDs);
|
||||||
|
return ;
|
||||||
|
}
|
96
src/BasicGUI/BasicGUI_PlaneDlg.h
Normal file
96
src/BasicGUI/BasicGUI_PlaneDlg.h
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
// 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 : BasicGUI_PlaneDlg.h
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
#ifndef DIALOGBOX_PLANE_H
|
||||||
|
#define DIALOGBOX_PLANE_H
|
||||||
|
|
||||||
|
#include "GEOMBase_Skeleton.h"
|
||||||
|
#include "DlgRef_2Sel1Spin.h"
|
||||||
|
#include "DlgRef_1Sel4Spin.h"
|
||||||
|
#include "DlgRef_1Sel1Spin.h"
|
||||||
|
|
||||||
|
#include "BasicGUI.h"
|
||||||
|
|
||||||
|
#include "GEOM_FaceFilter.hxx"
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BasicGUI_PlaneDlg
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
class BasicGUI_PlaneDlg : public GEOMBase_Skeleton
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
BasicGUI_PlaneDlg(QWidget* parent = 0, const char* name = 0, BasicGUI* theBasicGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
|
||||||
|
~BasicGUI_PlaneDlg();
|
||||||
|
|
||||||
|
private :
|
||||||
|
void Init();
|
||||||
|
void enterEvent(QEvent* e);
|
||||||
|
|
||||||
|
BasicGUI* myBasicGUI;
|
||||||
|
|
||||||
|
double step;
|
||||||
|
int myConstructorId;
|
||||||
|
Handle(GEOM_ShapeTypeFilter) myVertexFilter; /* Filters selection */
|
||||||
|
Handle(GEOM_ShapeTypeFilter) myEdgeFilter;
|
||||||
|
Handle(GEOM_FaceFilter) myFaceFilter;
|
||||||
|
|
||||||
|
gp_Pnt myPoint1; /* Point on the plane */
|
||||||
|
|
||||||
|
Standard_Real myDx;
|
||||||
|
Standard_Real myDy;
|
||||||
|
Standard_Real myDz;
|
||||||
|
Standard_Real myTrimSize;
|
||||||
|
|
||||||
|
bool myOkPoint1; /* true when argument is defined */
|
||||||
|
bool myOkDirection;
|
||||||
|
bool myOkCoordinates;
|
||||||
|
bool myOkPlanarFace;
|
||||||
|
|
||||||
|
DlgRef_2Sel1Spin* GroupPointDirection;
|
||||||
|
DlgRef_1Sel4Spin* GroupPointPlusCoordinates;
|
||||||
|
DlgRef_1Sel1Spin* GroupFace;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void ClickOnOk();
|
||||||
|
void ClickOnApply();
|
||||||
|
void ActivateThisDialog();
|
||||||
|
void SelectionIntoArgument();
|
||||||
|
void LineEditReturnPressed();
|
||||||
|
void SetEditCurrentArgument();
|
||||||
|
void ConstructorsClicked(int constructorId);
|
||||||
|
void ValueChangedInSpinBox(double newValue);
|
||||||
|
void MakePlaneSimulationAndDisplay(const gp_Pnt& P, const Standard_Real dx,
|
||||||
|
const Standard_Real dy, const Standard_Real dz,
|
||||||
|
const Standard_Real trimSize);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DIALOGBOX_PLANE_H
|
498
src/BasicGUI/BasicGUI_PointDlg.cxx
Normal file
498
src/BasicGUI/BasicGUI_PointDlg.cxx
Normal file
@ -0,0 +1,498 @@
|
|||||||
|
// 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 : BasicGUI_PointDlg.cxx
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
#include "BasicGUI_PointDlg.h"
|
||||||
|
|
||||||
|
#include <BRepBuilderAPI_MakeVertex.hxx>
|
||||||
|
#include <BRep_Tool.hxx>
|
||||||
|
#include <BRepAlgoAPI.hxx>
|
||||||
|
#include <Geom_Curve.hxx>
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BasicGUI_PointDlg()
|
||||||
|
// purpose : Constructs a BasicGUI_PointDlg which is a child of 'parent', with the
|
||||||
|
// name 'name' and widget flags set to 'f'.
|
||||||
|
// The dialog will by default be modeless, unless you set 'modal' to
|
||||||
|
// TRUE to construct a modal dialog.
|
||||||
|
//=================================================================================
|
||||||
|
BasicGUI_PointDlg::BasicGUI_PointDlg(QWidget* parent, const char* name, BasicGUI* theBasicGUI, SALOME_Selection* Sel, const 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_POINT_EDGE")));
|
||||||
|
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_POINT")));
|
||||||
|
QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||||
|
|
||||||
|
setCaption(tr("GEOM_POINT_TITLE"));
|
||||||
|
|
||||||
|
/***************************************************************/
|
||||||
|
GroupConstructors->setTitle(tr("GEOM_POINTS"));
|
||||||
|
RadioButton1->setPixmap(image0);
|
||||||
|
RadioButton2->setPixmap(image1);
|
||||||
|
RadioButton3->close(TRUE);
|
||||||
|
|
||||||
|
GroupPoints = new DlgRef_1Sel1Spin(this, "GroupPoints");
|
||||||
|
GroupPoints->GroupBox1->setTitle(tr("GEOM_PARAM_POINT"));
|
||||||
|
GroupPoints->TextLabel1->setText(tr("GEOM_EDGE"));
|
||||||
|
GroupPoints->TextLabel2->setText(tr("GEOM_PARAMETER"));
|
||||||
|
GroupPoints->PushButton1->setPixmap(image2);
|
||||||
|
|
||||||
|
GroupDimensions = new DlgRef_3Spin(this, "GroupDimensions");
|
||||||
|
GroupDimensions->GroupBox1->setTitle(tr("GEOM_COORDINATES"));
|
||||||
|
GroupDimensions->TextLabel1->setText(tr("GEOM_X"));
|
||||||
|
GroupDimensions->TextLabel2->setText(tr("GEOM_Y"));
|
||||||
|
GroupDimensions->TextLabel3->setText(tr("GEOM_Z"));
|
||||||
|
|
||||||
|
Layout1->addWidget(GroupPoints, 1, 0);
|
||||||
|
Layout1->addWidget(GroupDimensions, 1, 0);
|
||||||
|
/***************************************************************/
|
||||||
|
|
||||||
|
/* Initialisations */
|
||||||
|
myBasicGUI = theBasicGUI;
|
||||||
|
Init(ic);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
// function : ~BasicGUI_PointDlg()
|
||||||
|
// purpose : Destructor
|
||||||
|
//=======================================================================
|
||||||
|
BasicGUI_PointDlg::~BasicGUI_PointDlg()
|
||||||
|
{
|
||||||
|
/* no need to delete child widgets, Qt does it all for us */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : Init()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_PointDlg::Init(const Handle(AIS_InteractiveContext)& ic)
|
||||||
|
{
|
||||||
|
/* init variables */
|
||||||
|
myConstructorId = 0;
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
|
|
||||||
|
myIC = ic;
|
||||||
|
myParameter = 0.50;
|
||||||
|
myPoint.SetCoord(0.0, 0.0, 0.0);
|
||||||
|
myOkEdge = false;
|
||||||
|
|
||||||
|
myGeomGUI->SetState(POINT_METHOD);
|
||||||
|
|
||||||
|
/* Vertices Filter for all arguments */
|
||||||
|
myEdgeFilter = new GEOM_ShapeTypeFilter(TopAbs_EDGE, myGeom);
|
||||||
|
mySelection->AddFilter(myEdgeFilter);
|
||||||
|
|
||||||
|
/* Get setting of step value from file configuration */
|
||||||
|
QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep");
|
||||||
|
step = St.toDouble();
|
||||||
|
|
||||||
|
/* min, max, step and decimals for spin boxes */
|
||||||
|
double specificStep = 0.1;
|
||||||
|
GroupPoints->SpinBox_DX->RangeStepAndValidator(-999999.99999, 999999.99999, specificStep, 5);
|
||||||
|
GroupDimensions->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3);
|
||||||
|
GroupDimensions->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3);
|
||||||
|
GroupDimensions->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3);
|
||||||
|
GroupPoints->SpinBox_DX->SetValue(myParameter);
|
||||||
|
GroupDimensions->SpinBox_DX->SetValue(0.0);
|
||||||
|
GroupDimensions->SpinBox_DY->SetValue(0.0);
|
||||||
|
GroupDimensions->SpinBox_DZ->SetValue(0.0);
|
||||||
|
|
||||||
|
if (myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
|
myLocalContextId = myIC->OpenLocalContext();
|
||||||
|
myGeomGUI->SetDisplayedObjectList();
|
||||||
|
/* sub shapes selection */
|
||||||
|
myLocalContextMode = TopAbs_VERTEX;
|
||||||
|
myIC->ActivateStandardMode(myLocalContextMode);
|
||||||
|
myUseLocalContext = true;
|
||||||
|
} else {
|
||||||
|
myUseLocalContext = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
TopoDS_Shape S;
|
||||||
|
bool displayPoint = true;
|
||||||
|
if(myGeomGUI->GetTopoFromSelection(mySelection, S)) {
|
||||||
|
/* Filter a possibly previous selection and try to put it into coordinates */
|
||||||
|
if(myGeomGUI->VertexToPoint(S, myPoint))
|
||||||
|
displayPoint = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* signals and slots connections */
|
||||||
|
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||||
|
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||||
|
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
|
||||||
|
|
||||||
|
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
|
|
||||||
|
connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||||
|
connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||||
|
connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||||
|
connect(GroupDimensions->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||||
|
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
|
||||||
|
/* displays Dialog */
|
||||||
|
GroupDimensions->hide();
|
||||||
|
GroupPoints->show();
|
||||||
|
this->show();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ConstructorsClicked()
|
||||||
|
// purpose : Radio button management
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
|
||||||
|
{
|
||||||
|
myConstructorId = constructorId;
|
||||||
|
mySelection->ClearFilters();
|
||||||
|
myGeomGUI->EraseSimulationShape();
|
||||||
|
disconnect(mySelection, 0, this, 0);
|
||||||
|
|
||||||
|
switch (constructorId)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
{
|
||||||
|
if (myUseLocalContext == true && myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
|
myIC->CloseLocalContext(myLocalContextId);
|
||||||
|
myUseLocalContext = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
GroupDimensions->hide();
|
||||||
|
resize(0, 0);
|
||||||
|
GroupPoints->show();
|
||||||
|
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
|
GroupPoints->LineEdit1->setText("");
|
||||||
|
myOkEdge = false;
|
||||||
|
|
||||||
|
/* filter for next selections */
|
||||||
|
mySelection->AddFilter(myEdgeFilter);
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
if(myUseLocalContext == false && myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
|
myLocalContextId = myIC->OpenLocalContext();
|
||||||
|
myGeomGUI->SetDisplayedObjectList();
|
||||||
|
/* sub shapes selection */
|
||||||
|
myLocalContextMode = TopAbs_VERTEX;
|
||||||
|
myIC->ActivateStandardMode(myLocalContextMode);
|
||||||
|
myUseLocalContext = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
GroupPoints->hide();
|
||||||
|
resize(0, 0);
|
||||||
|
GroupDimensions->show();
|
||||||
|
|
||||||
|
/* Display point simulation */
|
||||||
|
PointIntoCoordinates(myPoint, true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnOk()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_PointDlg::ClickOnOk()
|
||||||
|
{
|
||||||
|
this->ClickOnApply();
|
||||||
|
ClickOnCancel();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnApply()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_PointDlg::ClickOnApply()
|
||||||
|
{
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
||||||
|
if(mySimulationTopoDs.IsNull())
|
||||||
|
return;
|
||||||
|
myGeomGUI->EraseSimulationShape();
|
||||||
|
mySimulationTopoDs.Nullify();
|
||||||
|
|
||||||
|
/* Close local context */
|
||||||
|
if (myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
|
myIC->CloseLocalContext(myLocalContextId);
|
||||||
|
myUseLocalContext = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(myConstructorId)
|
||||||
|
{
|
||||||
|
case 0 :
|
||||||
|
{
|
||||||
|
if(myOkEdge == true) {
|
||||||
|
/* this constructor method has no idl interface : we use same than constructor 0 */
|
||||||
|
myBasicGUI->MakePointAndDisplay(myPoint.X(), myPoint.Y(), myPoint.Z());
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1 :
|
||||||
|
{
|
||||||
|
/* Recup args and call method */
|
||||||
|
double x = GroupDimensions->SpinBox_DX->GetValue();
|
||||||
|
double y = GroupDimensions->SpinBox_DY->GetValue();
|
||||||
|
double z = GroupDimensions->SpinBox_DZ->GetValue();
|
||||||
|
|
||||||
|
myBasicGUI->MakePointAndDisplay(x,y,z); /* WARNING : no display if a local context is opened */
|
||||||
|
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
|
/* no display if a local context is opened */
|
||||||
|
myLocalContextId = myIC->OpenLocalContext();
|
||||||
|
myGeomGUI->SetDisplayedObjectList();
|
||||||
|
/* sub shapes selection */
|
||||||
|
myLocalContextMode = TopAbs_VERTEX;
|
||||||
|
myIC->ActivateStandardMode(myLocalContextMode);
|
||||||
|
myUseLocalContext = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SelectionIntoArgument()
|
||||||
|
// purpose : Called when selection as changed (for constructors not using local context)
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_PointDlg::SelectionIntoArgument()
|
||||||
|
{
|
||||||
|
myGeomGUI->EraseSimulationShape();
|
||||||
|
myEditCurrentArgument->setText("");
|
||||||
|
QString aString = ""; /* name of selection */
|
||||||
|
|
||||||
|
int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString);
|
||||||
|
if(nbSel != 1) {
|
||||||
|
myOkEdge = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// nbSel == 1
|
||||||
|
TopoDS_Shape S;
|
||||||
|
if(!myGeomGUI->GetTopoFromSelection(mySelection, S))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(S.ShapeType() == TopAbs_EDGE) {
|
||||||
|
if(CalculateVertexOnCurve(TopoDS::Edge(S), myParameter, mySimulationTopoDs)) {
|
||||||
|
if(myGeomGUI->VertexToPoint(mySimulationTopoDs, myPoint)) {
|
||||||
|
GroupPoints->LineEdit1->setText(aString);
|
||||||
|
myOkEdge = true;
|
||||||
|
myGeomGUI->DisplaySimulationShape(mySimulationTopoDs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : LineEditReturnPressed()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_PointDlg::LineEditReturnPressed()
|
||||||
|
{
|
||||||
|
QLineEdit* send = (QLineEdit*)sender();
|
||||||
|
if(send == GroupPoints->LineEdit1)
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SetEditCurrentArgument()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_PointDlg::SetEditCurrentArgument()
|
||||||
|
{
|
||||||
|
if(myConstructorId != 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
QPushButton* send = (QPushButton*)sender();
|
||||||
|
|
||||||
|
if(send == GroupPoints->PushButton1) {
|
||||||
|
GroupPoints->LineEdit1->setFocus();
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
|
mySelection->AddFilter(myEdgeFilter);
|
||||||
|
this->SelectionIntoArgument();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : enterEvent()
|
||||||
|
// purpose : to reactivate this dialog box when mouse enter onto the window
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_PointDlg::enterEvent(QEvent* e)
|
||||||
|
{
|
||||||
|
if (GroupConstructors->isEnabled())
|
||||||
|
return;
|
||||||
|
this->ActivateThisDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ActivateThisDialog()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_PointDlg::ActivateThisDialog( )
|
||||||
|
{
|
||||||
|
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();
|
||||||
|
// myIC = v3d->getAISContext();
|
||||||
|
// myLocalContextId = myIC->OpenLocalContext();
|
||||||
|
// myGeomGUI->SetDisplayedObjectList();
|
||||||
|
// /* sub shapes selection */
|
||||||
|
// myLocalContextMode = TopAbs_VERTEX ;
|
||||||
|
// myIC->ActivateStandardMode(myLocalContextMode);
|
||||||
|
// myUseLocalContext = true ;
|
||||||
|
// }
|
||||||
|
|
||||||
|
if(!mySimulationTopoDs.IsNull())
|
||||||
|
myGeomGUI->DisplaySimulationShape(mySimulationTopoDs);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ValueChangedInSpinBox()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_PointDlg::ValueChangedInSpinBox(double newValue)
|
||||||
|
{
|
||||||
|
myGeomGUI->EraseSimulationShape();
|
||||||
|
mySimulationTopoDs.Nullify();
|
||||||
|
|
||||||
|
DlgRef_SpinBox* send = (DlgRef_SpinBox*)sender();
|
||||||
|
double vx, vy, vz;
|
||||||
|
if(send == GroupDimensions->SpinBox_DX) {
|
||||||
|
vx = newValue;
|
||||||
|
vy = GroupDimensions->SpinBox_DY->GetValue();
|
||||||
|
vz = GroupDimensions->SpinBox_DZ->GetValue();
|
||||||
|
} else if(send == GroupDimensions->SpinBox_DY) {
|
||||||
|
vx = GroupDimensions->SpinBox_DX->GetValue();
|
||||||
|
vy = newValue;
|
||||||
|
vz = GroupDimensions->SpinBox_DZ->GetValue();
|
||||||
|
} else if(send == GroupDimensions->SpinBox_DZ) {
|
||||||
|
vx = GroupDimensions->SpinBox_DX->GetValue();
|
||||||
|
vy = GroupDimensions->SpinBox_DY->GetValue();
|
||||||
|
vz = newValue;
|
||||||
|
} else if(send == GroupPoints->SpinBox_DX) {
|
||||||
|
myParameter = newValue;
|
||||||
|
} else
|
||||||
|
return;
|
||||||
|
|
||||||
|
switch(myConstructorId)
|
||||||
|
{
|
||||||
|
case 0: // default constructor
|
||||||
|
{
|
||||||
|
this->SelectionIntoArgument();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
myPoint.SetCoord(vx, vy, vz);
|
||||||
|
mySimulationTopoDs = BRepBuilderAPI_MakeVertex (myPoint).Shape();
|
||||||
|
myGeomGUI->DisplaySimulationShape(mySimulationTopoDs);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : CalculateVertexOnCurve()
|
||||||
|
// purpose : Calculate a Vertex on the curve given by 'anEdge'.
|
||||||
|
// : The position of resultVertex is given by aParameter.
|
||||||
|
// : For a linear edge, aParameter=0.0 gives the first vertex of edge
|
||||||
|
// : aParameter=1.0 gives the last vertex of edge
|
||||||
|
// : aParameter=0.5 gives the vertex on the middle of edge
|
||||||
|
// : It is possible to get vertices out of edge using values > 1.0 or < 0.0
|
||||||
|
//=================================================================================
|
||||||
|
bool BasicGUI_PointDlg::CalculateVertexOnCurve(const TopoDS_Edge& anEdge, const Standard_Real aParameter, TopoDS_Shape& resultVertex)
|
||||||
|
{
|
||||||
|
if(anEdge.IsNull() || !BRepAlgoAPI::IsValid(anEdge))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
Standard_Real first, last;
|
||||||
|
Handle(Geom_Curve) curv = BRep_Tool::Curve(anEdge, first, last);
|
||||||
|
if(!curv->IsCN(0))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
Standard_Real param;
|
||||||
|
if(anEdge.Orientation() == TopAbs_FORWARD)
|
||||||
|
param = first + (last-first) * aParameter;
|
||||||
|
else
|
||||||
|
param = last + (first-last) * aParameter;
|
||||||
|
|
||||||
|
gp_Pnt paramPoint;
|
||||||
|
curv->D0(param, paramPoint);
|
||||||
|
resultVertex = BRepBuilderAPI_MakeVertex(paramPoint);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
// funcion : PointIntoCoordinates()
|
||||||
|
// purpose : Sets user point coordinates into this dialog Spin boxes
|
||||||
|
// : and displays it or not according to 'bool displayPoint'
|
||||||
|
//=======================================================================
|
||||||
|
void BasicGUI_PointDlg::PointIntoCoordinates(gp_Pnt P, bool displayPoint)
|
||||||
|
{
|
||||||
|
GroupDimensions->SpinBox_DX->SetValue(P.X());
|
||||||
|
GroupDimensions->SpinBox_DY->SetValue(P.Y());
|
||||||
|
GroupDimensions->SpinBox_DZ->SetValue(P.Z());
|
||||||
|
this->myPoint.SetCoord(P.X(), P.Y(), P.Z());
|
||||||
|
if(displayPoint) {
|
||||||
|
mySimulationTopoDs = BRepBuilderAPI_MakeVertex(P).Shape();
|
||||||
|
myGeomGUI->DisplaySimulationShape(mySimulationTopoDs);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
97
src/BasicGUI/BasicGUI_PointDlg.h
Normal file
97
src/BasicGUI/BasicGUI_PointDlg.h
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
// 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 : BasicGUI_PointDlg.h
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
#ifndef DIALOGBOX_POINT_H
|
||||||
|
#define DIALOGBOX_POINT_H
|
||||||
|
|
||||||
|
#include "GEOMBase_Skeleton.h"
|
||||||
|
#include "DlgRef_1Sel1Spin.h"
|
||||||
|
#include "DlgRef_3Spin.h"
|
||||||
|
|
||||||
|
#include "BasicGUI.h"
|
||||||
|
|
||||||
|
#include <TopoDS_Edge.hxx>
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BasicGUI_PointDlg
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
class BasicGUI_PointDlg : public GEOMBase_Skeleton
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
BasicGUI_PointDlg(QWidget* parent = 0, const char* name = 0, BasicGUI* theBasicGUI = 0, SALOME_Selection* Sel = 0, const Handle(AIS_InteractiveContext)& ic = 0, bool modal = FALSE, WFlags fl = 0);
|
||||||
|
|
||||||
|
~BasicGUI_PointDlg();
|
||||||
|
|
||||||
|
private :
|
||||||
|
void Init(const Handle(AIS_InteractiveContext)& ic);
|
||||||
|
void enterEvent(QEvent* e);
|
||||||
|
|
||||||
|
BasicGUI* myBasicGUI;
|
||||||
|
|
||||||
|
double step;
|
||||||
|
int myConstructorId;
|
||||||
|
Handle(GEOM_ShapeTypeFilter) myEdgeFilter; /* filter for selection */
|
||||||
|
|
||||||
|
gp_Pnt myPoint; /* Is 'mySimulationTopoDs' */
|
||||||
|
bool myOkEdge; /* true when an edge is selected by user */
|
||||||
|
double myParameter; /* Parameter used to create a vertex on edge (point on curve) */
|
||||||
|
|
||||||
|
/* Interactive and local context management see also : bool UseLocalContext() */
|
||||||
|
Handle(AIS_InteractiveContext) myIC; /* Interactive context from IAPP */
|
||||||
|
Standard_Integer myLocalContextId; /* identify a local context for this method */
|
||||||
|
TopAbs_ShapeEnum myLocalContextMode; /* identify a selection mode into local context */
|
||||||
|
bool myUseLocalContext; /* true when method as opened a local context */
|
||||||
|
|
||||||
|
DlgRef_1Sel1Spin* GroupPoints;
|
||||||
|
DlgRef_3Spin* GroupDimensions;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void ClickOnOk();
|
||||||
|
void ClickOnApply();
|
||||||
|
void ActivateThisDialog();
|
||||||
|
void LineEditReturnPressed();
|
||||||
|
void SelectionIntoArgument();
|
||||||
|
void SetEditCurrentArgument();
|
||||||
|
void ConstructorsClicked(int constructorId);
|
||||||
|
void ValueChangedInSpinBox(double newValue);
|
||||||
|
|
||||||
|
bool CalculateVertexOnCurve(const TopoDS_Edge& anEdge,
|
||||||
|
const Standard_Real aParameter,
|
||||||
|
TopoDS_Shape& resultVertex);
|
||||||
|
|
||||||
|
public:
|
||||||
|
void PointIntoCoordinates(gp_Pnt P, bool displayPoint);
|
||||||
|
/* return true if method has opened a local context */
|
||||||
|
bool UseLocalContext(){return myUseLocalContext;};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DIALOGBOX_POINT_H
|
467
src/BasicGUI/BasicGUI_VectorDlg.cxx
Normal file
467
src/BasicGUI/BasicGUI_VectorDlg.cxx
Normal file
@ -0,0 +1,467 @@
|
|||||||
|
// 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 : BasicGUI_VectorDlg.cxx
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
#include "BasicGUI_VectorDlg.h"
|
||||||
|
|
||||||
|
#include <TopoDS_Shape.hxx>
|
||||||
|
#include <TopoDS_Compound.hxx>
|
||||||
|
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||||
|
#include <BRep_Builder.hxx>
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BasicGUI_VectorDlg()
|
||||||
|
// purpose : Constructs a BasicGUI_VectorDlg which is a child of 'parent', with the
|
||||||
|
// name 'name' and widget flags set to 'f'.
|
||||||
|
// The dialog will by default be modeless, unless you set 'modal' to
|
||||||
|
// TRUE to construct a modal dialog.
|
||||||
|
//=================================================================================
|
||||||
|
BasicGUI_VectorDlg::BasicGUI_VectorDlg(QWidget* parent, const char* name, BasicGUI* theBasicGUI, 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_VECTOR_2P")));
|
||||||
|
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_VECTOR_DXYZ")));
|
||||||
|
QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||||
|
|
||||||
|
setCaption(tr("GEOM_VECTOR_TITLE"));
|
||||||
|
|
||||||
|
/***************************************************************/
|
||||||
|
GroupConstructors->setTitle(tr("GEOM_VECTOR"));
|
||||||
|
RadioButton1->setPixmap(image0);
|
||||||
|
RadioButton2->close(TRUE);
|
||||||
|
RadioButton3->close(TRUE);
|
||||||
|
|
||||||
|
GroupPoints = new DlgRef_2Sel_QTD(this, "GroupPoints");
|
||||||
|
GroupPoints->GroupBox1->setTitle(tr("GEOM_POINTS"));
|
||||||
|
GroupPoints->TextLabel1->setText(tr("GEOM_POINT_I").arg("1"));
|
||||||
|
GroupPoints->TextLabel2->setText(tr("GEOM_POINT_I").arg("2"));
|
||||||
|
GroupPoints->PushButton1->setPixmap(image1);
|
||||||
|
GroupPoints->PushButton2->setPixmap(image1);
|
||||||
|
|
||||||
|
GroupDimensions = new DlgRef_3Spin1Check(this, "GroupDimensions");
|
||||||
|
GroupDimensions->GroupBox1->setTitle(tr("GEOM_COORDINATES"));
|
||||||
|
GroupDimensions->TextLabel1->setText(tr("GEOM_DX"));
|
||||||
|
GroupDimensions->TextLabel2->setText(tr("GEOM_DY"));
|
||||||
|
GroupDimensions->TextLabel3->setText(tr("GEOM_DZ"));
|
||||||
|
GroupDimensions->CheckBox1->setText(tr("GEOM_REVERSE_VECTOR"));
|
||||||
|
|
||||||
|
Layout1->addWidget(GroupPoints, 1, 0);
|
||||||
|
Layout1->addWidget(GroupDimensions, 1, 0);
|
||||||
|
/***************************************************************/
|
||||||
|
|
||||||
|
/* Initialisations */
|
||||||
|
myBasicGUI = theBasicGUI;
|
||||||
|
Init();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ~BasicGUI_VectorDlg()
|
||||||
|
// purpose : Destroys the object and frees any allocated resources
|
||||||
|
//=================================================================================
|
||||||
|
BasicGUI_VectorDlg::~BasicGUI_VectorDlg()
|
||||||
|
{
|
||||||
|
/* no need to delete child widgets, Qt does it all for us */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : Init()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_VectorDlg::Init()
|
||||||
|
{
|
||||||
|
/* init variables */
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
|
|
||||||
|
myDx = 0.0;
|
||||||
|
myDy = 0.0;
|
||||||
|
myDz = 200.0;
|
||||||
|
myPoint1.SetCoord(0.0, 0.0, 0.0);
|
||||||
|
myPoint2.SetCoord(0.0, 0.0, 0.0);
|
||||||
|
myOkPoint1 = myOkPoint2 = false;
|
||||||
|
|
||||||
|
/* Vertices Filter for all arguments */
|
||||||
|
myVertexFilter = new GEOM_ShapeTypeFilter(TopAbs_VERTEX, myGeom);
|
||||||
|
myEdgeFilter = new GEOM_ShapeTypeFilter(TopAbs_EDGE, myGeom);
|
||||||
|
mySelection->AddFilter(myVertexFilter);
|
||||||
|
|
||||||
|
/* Get setting of step value from file configuration */
|
||||||
|
QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep");
|
||||||
|
step = St.toDouble();
|
||||||
|
|
||||||
|
/* min, max, step and decimals for spin boxes */
|
||||||
|
GroupDimensions->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3);
|
||||||
|
GroupDimensions->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3);
|
||||||
|
GroupDimensions->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3);
|
||||||
|
|
||||||
|
GroupDimensions->SpinBox_DX->SetValue(myDx);
|
||||||
|
GroupDimensions->SpinBox_DY->SetValue(myDy);
|
||||||
|
GroupDimensions->SpinBox_DZ->SetValue(myDz);
|
||||||
|
|
||||||
|
GroupDimensions->CheckBox1->setChecked(FALSE);
|
||||||
|
|
||||||
|
/* signals and slots connections */
|
||||||
|
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||||
|
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||||
|
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
|
||||||
|
|
||||||
|
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
|
||||||
|
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
|
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
|
|
||||||
|
connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||||
|
connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||||
|
connect(GroupDimensions->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||||
|
|
||||||
|
connect(GroupDimensions->CheckBox1, SIGNAL(stateChanged(int)), this, SLOT(ReverseVector(int)));
|
||||||
|
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
|
||||||
|
/* displays Dialog */
|
||||||
|
GroupDimensions->hide();
|
||||||
|
GroupPoints->show();
|
||||||
|
this->show();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ConstructorsClicked()
|
||||||
|
// purpose : Radio button management
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_VectorDlg::ConstructorsClicked(int constructorId)
|
||||||
|
{
|
||||||
|
myConstructorId = constructorId;
|
||||||
|
mySelection->ClearFilters();
|
||||||
|
myGeomGUI->EraseSimulationShape();
|
||||||
|
disconnect(mySelection, 0, this, 0);
|
||||||
|
myOkPoint1 = myOkPoint2 = false;
|
||||||
|
|
||||||
|
switch (constructorId)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
{
|
||||||
|
GroupDimensions->hide();
|
||||||
|
resize(0, 0);
|
||||||
|
GroupPoints->show();
|
||||||
|
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
|
GroupPoints->LineEdit1->setText("");
|
||||||
|
GroupPoints->LineEdit2->setText("");
|
||||||
|
|
||||||
|
/* filter for next selection */
|
||||||
|
mySelection->AddFilter(myVertexFilter);
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
GroupPoints->hide();
|
||||||
|
resize( 0, 0 );
|
||||||
|
GroupDimensions->show();
|
||||||
|
|
||||||
|
myDx = 0.0;
|
||||||
|
myDy = 0.0;
|
||||||
|
myDz = 200.0;
|
||||||
|
|
||||||
|
GroupDimensions->SpinBox_DX->SetValue(myDx);
|
||||||
|
GroupDimensions->SpinBox_DY->SetValue(myDy);
|
||||||
|
GroupDimensions->SpinBox_DZ->SetValue(myDz);
|
||||||
|
|
||||||
|
myPoint1.SetCoord(0.0, 0.0, 0.0) ;
|
||||||
|
myPoint2.SetCoord(myDx, myDy, myDz);
|
||||||
|
|
||||||
|
GroupDimensions->CheckBox1->setChecked(FALSE);
|
||||||
|
|
||||||
|
mySimulationTopoDs = BRepBuilderAPI_MakeEdge(myPoint1, myPoint2).Shape();
|
||||||
|
/* Add arrow in simulation */
|
||||||
|
bool noNeedToTest = AddArrowToSimulation(mySimulationTopoDs);
|
||||||
|
myGeomGUI->DisplaySimulationShape(mySimulationTopoDs);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnOk()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_VectorDlg::ClickOnOk()
|
||||||
|
{
|
||||||
|
this->ClickOnApply();
|
||||||
|
ClickOnCancel();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnApply()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_VectorDlg::ClickOnApply()
|
||||||
|
{
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
||||||
|
if (mySimulationTopoDs.IsNull())
|
||||||
|
return;
|
||||||
|
myGeomGUI->EraseSimulationShape();
|
||||||
|
mySimulationTopoDs.Nullify();
|
||||||
|
|
||||||
|
switch(myConstructorId)
|
||||||
|
{
|
||||||
|
case 0 :
|
||||||
|
{
|
||||||
|
if(myOkPoint1 && myOkPoint2)
|
||||||
|
myBasicGUI->MakeVectorAndDisplay(myPoint1, myPoint2);
|
||||||
|
break ;
|
||||||
|
}
|
||||||
|
case 1 :
|
||||||
|
{
|
||||||
|
/* Recup args and call method */
|
||||||
|
myDx = GroupDimensions->SpinBox_DX->GetValue();
|
||||||
|
myDy = GroupDimensions->SpinBox_DY->GetValue();
|
||||||
|
myDz = GroupDimensions->SpinBox_DZ->GetValue();
|
||||||
|
myPoint1.SetCoord(0.0, 0.0, 0.0);
|
||||||
|
myPoint2.SetCoord(myDx, myDy, myDz);
|
||||||
|
myBasicGUI->MakeVectorAndDisplay(myPoint1, myPoint2);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SelectionIntoArgument()
|
||||||
|
// purpose : Called when selection as changed or other case
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_VectorDlg::SelectionIntoArgument()
|
||||||
|
{
|
||||||
|
myGeomGUI->EraseSimulationShape();
|
||||||
|
myEditCurrentArgument->setText("");
|
||||||
|
QString aString = ""; /* name of selection */
|
||||||
|
|
||||||
|
int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString);
|
||||||
|
if (nbSel != 1) {
|
||||||
|
if (myEditCurrentArgument == GroupPoints->LineEdit1)
|
||||||
|
myOkPoint1 = false;
|
||||||
|
else if ( myEditCurrentArgument == GroupPoints->LineEdit2)
|
||||||
|
myOkPoint2 = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// nbSel == 1
|
||||||
|
TopoDS_Shape S;
|
||||||
|
if(!myGeomGUI->GetTopoFromSelection(mySelection, S))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(myEditCurrentArgument == GroupPoints->LineEdit1 && myGeomGUI->VertexToPoint(S, myPoint1)) {
|
||||||
|
myEditCurrentArgument->setText(aString);
|
||||||
|
myOkPoint1 = true;
|
||||||
|
}
|
||||||
|
else if(myEditCurrentArgument == GroupPoints->LineEdit2 && myGeomGUI->VertexToPoint(S, myPoint2)) {
|
||||||
|
myEditCurrentArgument->setText(aString);
|
||||||
|
myOkPoint2 = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(myOkPoint1 && myOkPoint2 && myPoint1.Distance(myPoint2) > Precision::Confusion()) {
|
||||||
|
mySimulationTopoDs = BRepBuilderAPI_MakeEdge(myPoint1, myPoint2).Shape();
|
||||||
|
/* Add arrow in simulation */
|
||||||
|
bool noNeedToTest = this->AddArrowToSimulation(mySimulationTopoDs);
|
||||||
|
myGeomGUI->DisplaySimulationShape(mySimulationTopoDs);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SetEditCurrentArgument()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_VectorDlg::SetEditCurrentArgument()
|
||||||
|
{
|
||||||
|
if(myConstructorId != 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
QPushButton* send = (QPushButton*)sender();
|
||||||
|
|
||||||
|
if(send == GroupPoints->PushButton1) {
|
||||||
|
GroupPoints->LineEdit1->setFocus();
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
|
}
|
||||||
|
else if(send == GroupPoints->PushButton2) {
|
||||||
|
GroupPoints->LineEdit2->setFocus();
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||||
|
}
|
||||||
|
mySelection->AddFilter(myVertexFilter);
|
||||||
|
this->SelectionIntoArgument();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : LineEditReturnPressed()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_VectorDlg::LineEditReturnPressed()
|
||||||
|
{
|
||||||
|
QLineEdit* send = (QLineEdit*)sender();
|
||||||
|
if(send == GroupPoints->LineEdit1)
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
|
else if (send == GroupPoints->LineEdit2)
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ActivateThisDialog()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_VectorDlg::ActivateThisDialog()
|
||||||
|
{
|
||||||
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
if(!mySimulationTopoDs.IsNull())
|
||||||
|
myGeomGUI->DisplaySimulationShape(mySimulationTopoDs);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : enterEvent()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_VectorDlg::enterEvent(QEvent* e)
|
||||||
|
{
|
||||||
|
if(GroupConstructors->isEnabled())
|
||||||
|
return;
|
||||||
|
this->ActivateThisDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ValueChangedInSpinBox()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_VectorDlg::ValueChangedInSpinBox( double newValue )
|
||||||
|
{
|
||||||
|
myGeomGUI->EraseSimulationShape();
|
||||||
|
mySimulationTopoDs.Nullify();
|
||||||
|
QObject* send = (QObject*)sender();
|
||||||
|
|
||||||
|
if(send == GroupDimensions->SpinBox_DX ) {
|
||||||
|
myDx = newValue;
|
||||||
|
myDy = GroupDimensions->SpinBox_DY->GetValue();
|
||||||
|
myDz = GroupDimensions->SpinBox_DZ->GetValue();
|
||||||
|
} else if (send == GroupDimensions->SpinBox_DY) {
|
||||||
|
myDx = GroupDimensions->SpinBox_DX->GetValue();
|
||||||
|
myDy = newValue;
|
||||||
|
myDz = GroupDimensions->SpinBox_DZ->GetValue();
|
||||||
|
} else if (send == GroupDimensions->SpinBox_DZ) {
|
||||||
|
myDx = GroupDimensions->SpinBox_DX->GetValue();
|
||||||
|
myDy = GroupDimensions->SpinBox_DY->GetValue();
|
||||||
|
myDz = newValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
myPoint1.SetCoord(0.0, 0.0, 0.0);
|
||||||
|
myPoint2.SetCoord(myDx, myDy, myDz);
|
||||||
|
|
||||||
|
if(myPoint1.Distance(myPoint2) > Precision::Confusion()) { // mySimulationTopoDs
|
||||||
|
mySimulationTopoDs = BRepBuilderAPI_MakeEdge(myPoint1, myPoint2).Shape();
|
||||||
|
/* Create simulation vector with an arrow */
|
||||||
|
this->AddArrowToSimulation(mySimulationTopoDs);
|
||||||
|
myGeomGUI->DisplaySimulationShape(mySimulationTopoDs);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : AddArrowToSimulation()
|
||||||
|
// purpose : An arrow (cone topology) is added to 'modifiedShape'
|
||||||
|
// : to simulate a vector or an 'oriented line' display. The result is in 'modifiedShape'.
|
||||||
|
// : If an arrow can't be added returns false and 'modifiedShape' isn't modified !
|
||||||
|
//=================================================================================
|
||||||
|
bool BasicGUI_VectorDlg::AddArrowToSimulation(TopoDS_Shape& modifiedShape)
|
||||||
|
{
|
||||||
|
TopoDS_Shape arrow;
|
||||||
|
/* Try to add a cone simulation shape to show direction of a linear edge */
|
||||||
|
if(myGeomGUI->CreateArrowForLinearEdge(modifiedShape, arrow)) {
|
||||||
|
TopoDS_Compound Comp;
|
||||||
|
BRep_Builder B;
|
||||||
|
B.MakeCompound (Comp);
|
||||||
|
B.Add(Comp, modifiedShape);
|
||||||
|
B.Add(Comp, arrow);
|
||||||
|
modifiedShape = Comp;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ReverseVector()
|
||||||
|
// purpose : 'state' not used here
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_VectorDlg::ReverseVector(int state)
|
||||||
|
{
|
||||||
|
myGeomGUI->EraseSimulationShape();
|
||||||
|
mySimulationTopoDs.Nullify();
|
||||||
|
|
||||||
|
myDx = -myDx;
|
||||||
|
myDy = -myDy;
|
||||||
|
myDz = -myDz;
|
||||||
|
|
||||||
|
GroupDimensions->SpinBox_DX->SetValue(myDx);
|
||||||
|
GroupDimensions->SpinBox_DY->SetValue(myDy);
|
||||||
|
GroupDimensions->SpinBox_DZ->SetValue(myDz);
|
||||||
|
|
||||||
|
myPoint1.SetCoord(0.0, 0.0, 0.0);
|
||||||
|
myPoint2.SetCoord(myDx, myDy, myDz);
|
||||||
|
|
||||||
|
/* In the appropriate constructor */
|
||||||
|
if(myPoint1.Distance(myPoint2) > Precision::Confusion()) {
|
||||||
|
mySimulationTopoDs = BRepBuilderAPI_MakeEdge(myPoint1, myPoint2).Shape();
|
||||||
|
/* Add arrow in simulation */
|
||||||
|
bool noNeedToTest = this->AddArrowToSimulation(mySimulationTopoDs);
|
||||||
|
myGeomGUI->DisplaySimulationShape(mySimulationTopoDs);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
86
src/BasicGUI/BasicGUI_VectorDlg.h
Normal file
86
src/BasicGUI/BasicGUI_VectorDlg.h
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
// 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 : BasicGUI_VectorDlg.h
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
#ifndef DIALOGBOX_VECTOR_H
|
||||||
|
#define DIALOGBOX_VECTOR_H
|
||||||
|
|
||||||
|
#include "GEOMBase_Skeleton.h"
|
||||||
|
#include "DlgRef_2Sel_QTD.h"
|
||||||
|
#include "DlgRef_3Spin1Check.h"
|
||||||
|
|
||||||
|
#include "BasicGUI.h"
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BasicGUI_VectorDlg
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
class BasicGUI_VectorDlg : public GEOMBase_Skeleton
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
BasicGUI_VectorDlg(QWidget* parent = 0, const char* name = 0, BasicGUI* theBasicGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
|
||||||
|
~BasicGUI_VectorDlg();
|
||||||
|
|
||||||
|
private :
|
||||||
|
void Init();
|
||||||
|
void enterEvent(QEvent* e);
|
||||||
|
bool AddArrowToSimulation(TopoDS_Shape& modifiedShape);
|
||||||
|
|
||||||
|
BasicGUI* myBasicGUI;
|
||||||
|
|
||||||
|
double step;
|
||||||
|
int myConstructorId;
|
||||||
|
Handle(GEOM_ShapeTypeFilter) myVertexFilter; /* Filter selection */
|
||||||
|
Handle(GEOM_ShapeTypeFilter) myEdgeFilter;
|
||||||
|
|
||||||
|
gp_Pnt myPoint1; /* Points containing the vector */
|
||||||
|
gp_Pnt myPoint2;
|
||||||
|
bool myOkPoint1; /* Are true when myPoint is defined */
|
||||||
|
bool myOkPoint2;
|
||||||
|
double myDx;
|
||||||
|
double myDy;
|
||||||
|
double myDz;
|
||||||
|
|
||||||
|
DlgRef_2Sel_QTD* GroupPoints;
|
||||||
|
DlgRef_3Spin1Check* GroupDimensions;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void ClickOnOk();
|
||||||
|
void ClickOnApply();
|
||||||
|
void ActivateThisDialog();
|
||||||
|
void LineEditReturnPressed();
|
||||||
|
void SelectionIntoArgument();
|
||||||
|
void SetEditCurrentArgument();
|
||||||
|
void ConstructorsClicked(int constructorId);
|
||||||
|
void ValueChangedInSpinBox(double newValue);
|
||||||
|
void ReverseVector(int state);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DIALOGBOX_VECTOR_H
|
232
src/BasicGUI/BasicGUI_WorkingPlaneDlg.cxx
Normal file
232
src/BasicGUI/BasicGUI_WorkingPlaneDlg.cxx
Normal file
@ -0,0 +1,232 @@
|
|||||||
|
// 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 : BasicGUI_WorkingPlaneDlg.cxx
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
#include "BasicGUI_WorkingPlaneDlg.h"
|
||||||
|
|
||||||
|
#include <BRepAdaptor_Surface.hxx>
|
||||||
|
#include <gp_Pln.hxx>
|
||||||
|
#include <gp_Dir.hxx>
|
||||||
|
#include <gp_Ax1.hxx>
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BasicGUI_WorkingPlaneDlg()
|
||||||
|
// purpose : Constructs a BasicGUI_WorkingPlaneDlg which is a child of 'parent', with the
|
||||||
|
// name 'name' and widget flags set to 'f'.
|
||||||
|
// The dialog will by default be modeless, unless you set 'modal' to
|
||||||
|
// TRUE to construct a modal dialog.
|
||||||
|
//=================================================================================
|
||||||
|
BasicGUI_WorkingPlaneDlg::BasicGUI_WorkingPlaneDlg(QWidget* parent, const char* name, BasicGUI* theBasicGUI, 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_WPLANE_FACE")));
|
||||||
|
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||||
|
|
||||||
|
setCaption(tr("GEOM_WPLANE_TITLE"));
|
||||||
|
|
||||||
|
/***************************************************************/
|
||||||
|
GroupConstructors->setTitle(tr("GEOM_WPLANE"));
|
||||||
|
RadioButton1->setPixmap(image0);
|
||||||
|
RadioButton2->close(TRUE);
|
||||||
|
RadioButton3->close(TRUE);
|
||||||
|
|
||||||
|
GroupWPlane = new DlgRef_1Sel_QTD(this, "GroupWPlane");
|
||||||
|
GroupWPlane->GroupBox1->setTitle(tr("GEOM_WPLANE_FACE"));
|
||||||
|
GroupWPlane->TextLabel1->setText(tr("GEOM_SELECTION"));
|
||||||
|
GroupWPlane->PushButton1->setPixmap(image1);
|
||||||
|
|
||||||
|
Layout1->addWidget(GroupWPlane, 1, 0);
|
||||||
|
/***************************************************************/
|
||||||
|
|
||||||
|
/* Initialisation */
|
||||||
|
myBasicGUI = theBasicGUI;
|
||||||
|
Init();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ~BasicGUI_WorkingPlaneDlg()
|
||||||
|
// purpose : Destroys the object and frees any allocated resources
|
||||||
|
//=================================================================================
|
||||||
|
BasicGUI_WorkingPlaneDlg::~BasicGUI_WorkingPlaneDlg()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : Init()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_WorkingPlaneDlg::Init()
|
||||||
|
{
|
||||||
|
/* init variables */
|
||||||
|
myEditCurrentArgument = GroupWPlane->LineEdit1;
|
||||||
|
|
||||||
|
myOkPlane = false;
|
||||||
|
|
||||||
|
/* Filter definition */
|
||||||
|
myFaceFilter = new GEOM_FaceFilter(StdSelect_Plane, myGeom);
|
||||||
|
mySelection->AddFilter(myFaceFilter); /* filter for next selection */
|
||||||
|
|
||||||
|
/* signals and slots connections */
|
||||||
|
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||||
|
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||||
|
|
||||||
|
connect(GroupWPlane->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
|
connect(GroupWPlane->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
|
||||||
|
/* displays Dialog */
|
||||||
|
GroupWPlane->show();
|
||||||
|
this->show();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnOk()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_WorkingPlaneDlg::ClickOnOk()
|
||||||
|
{
|
||||||
|
this->ClickOnApply();
|
||||||
|
ClickOnCancel();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnApply()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_WorkingPlaneDlg::ClickOnApply()
|
||||||
|
{
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
||||||
|
mySelection->ClearFilters();
|
||||||
|
if(myOkPlane)
|
||||||
|
myBasicGUI->MakeWorkingPlane(myLoc, myDir);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SelectionIntoArgument()
|
||||||
|
// purpose : Called when selection as changed or other case
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_WorkingPlaneDlg::SelectionIntoArgument()
|
||||||
|
{
|
||||||
|
myEditCurrentArgument->setText("");
|
||||||
|
QString aString = "";
|
||||||
|
|
||||||
|
int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString);
|
||||||
|
if(nbSel != 1) {
|
||||||
|
if(myEditCurrentArgument == GroupWPlane->LineEdit1)
|
||||||
|
myOkPlane = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* nbSel == 1 */
|
||||||
|
TopoDS_Shape S;
|
||||||
|
if(!myGeomGUI->GetTopoFromSelection(mySelection, S))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(myEditCurrentArgument == GroupWPlane->LineEdit1) {
|
||||||
|
BRepAdaptor_Surface surf(TopoDS::Face(S));
|
||||||
|
gp_Pln Plane = surf.Plane();
|
||||||
|
myLoc = Plane.Location();
|
||||||
|
myDir = Plane.Axis().Direction();
|
||||||
|
|
||||||
|
GroupWPlane->LineEdit1->setText(aString);
|
||||||
|
myOkPlane = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* no simulation */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SetEditCurrentArgument()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_WorkingPlaneDlg::SetEditCurrentArgument()
|
||||||
|
{
|
||||||
|
QPushButton* send = (QPushButton*)sender();
|
||||||
|
|
||||||
|
if(send == GroupWPlane->PushButton1) {
|
||||||
|
GroupWPlane->LineEdit1->setFocus();
|
||||||
|
myEditCurrentArgument = GroupWPlane->LineEdit1;
|
||||||
|
mySelection->AddFilter(myFaceFilter);
|
||||||
|
SelectionIntoArgument();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : LineEditReturnPressed()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_WorkingPlaneDlg::LineEditReturnPressed()
|
||||||
|
{
|
||||||
|
QLineEdit* send = (QLineEdit*)sender();
|
||||||
|
if(send == GroupWPlane->LineEdit1)
|
||||||
|
myEditCurrentArgument = GroupWPlane->LineEdit1;
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ActivateThisDialog()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_WorkingPlaneDlg::ActivateThisDialog()
|
||||||
|
{
|
||||||
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : enterEvent()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BasicGUI_WorkingPlaneDlg::enterEvent(QEvent* e)
|
||||||
|
{
|
||||||
|
if(GroupConstructors->isEnabled())
|
||||||
|
return;
|
||||||
|
this->ActivateThisDialog();
|
||||||
|
return;
|
||||||
|
}
|
74
src/BasicGUI/BasicGUI_WorkingPlaneDlg.h
Normal file
74
src/BasicGUI/BasicGUI_WorkingPlaneDlg.h
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
// 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 : BasicGUI_WorkingPlaneDlg.h
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
|
||||||
|
#ifndef DIALOGBOX_WORKINGPLANE_H
|
||||||
|
#define DIALOGBOX_WORKINGPLANE_H
|
||||||
|
|
||||||
|
#include "GEOMBase_Skeleton.h"
|
||||||
|
#include "DlgRef_1Sel_QTD.h"
|
||||||
|
|
||||||
|
#include "BasicGUI.h"
|
||||||
|
|
||||||
|
#include "GEOM_FaceFilter.hxx"
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BasicGUI_WorkingPlaneDlg
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
class BasicGUI_WorkingPlaneDlg : public GEOMBase_Skeleton
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
BasicGUI_WorkingPlaneDlg( QWidget* parent = 0, const char* name = 0, BasicGUI* theBasicGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
|
||||||
|
~BasicGUI_WorkingPlaneDlg();
|
||||||
|
|
||||||
|
private:
|
||||||
|
void Init();
|
||||||
|
void enterEvent(QEvent* e);
|
||||||
|
|
||||||
|
BasicGUI* myBasicGUI;
|
||||||
|
|
||||||
|
Handle(GEOM_FaceFilter) myFaceFilter; /* filter for selection */
|
||||||
|
|
||||||
|
gp_Pnt myLoc;
|
||||||
|
gp_Dir myDir;
|
||||||
|
bool myOkPlane; /* to check when arguments are defined */
|
||||||
|
|
||||||
|
DlgRef_1Sel_QTD* GroupWPlane;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void ClickOnOk();
|
||||||
|
void ClickOnApply();
|
||||||
|
void SetEditCurrentArgument();
|
||||||
|
void SelectionIntoArgument();
|
||||||
|
void LineEditReturnPressed();
|
||||||
|
void ActivateThisDialog();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DIALOGBOX_WORKINGPLANE_H
|
82
src/BasicGUI/Makefile.in
Normal file
82
src/BasicGUI/Makefile.in
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
# GEOM BASICGUI :
|
||||||
|
#
|
||||||
|
# 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 : Makefile.in
|
||||||
|
# Author : Damien COQUERET (OCC)
|
||||||
|
# Module : GEOM
|
||||||
|
# $Header:
|
||||||
|
|
||||||
|
top_srcdir=@top_srcdir@
|
||||||
|
top_builddir=../..
|
||||||
|
srcdir=@srcdir@
|
||||||
|
VPATH=.:@srcdir@:@top_srcdir@/idl
|
||||||
|
|
||||||
|
|
||||||
|
@COMMENCE@
|
||||||
|
|
||||||
|
# header files
|
||||||
|
EXPORT_HEADERS= BasicGUI.h \
|
||||||
|
BasicGUI_PointDlg.h
|
||||||
|
|
||||||
|
# Libraries targets
|
||||||
|
LIB = libBasicGUI.la
|
||||||
|
|
||||||
|
LIB_SRC = BasicGUI.cxx \
|
||||||
|
BasicGUI_PointDlg.cxx \
|
||||||
|
BasicGUI_LineDlg.cxx \
|
||||||
|
BasicGUI_CircleDlg.cxx \
|
||||||
|
BasicGUI_EllipseDlg.cxx \
|
||||||
|
BasicGUI_ArcDlg.cxx \
|
||||||
|
BasicGUI_VectorDlg.cxx \
|
||||||
|
BasicGUI_PlaneDlg.cxx \
|
||||||
|
BasicGUI_WorkingPlaneDlg.cxx
|
||||||
|
|
||||||
|
LIB_MOC = \
|
||||||
|
BasicGUI.h \
|
||||||
|
BasicGUI_PointDlg.h \
|
||||||
|
BasicGUI_LineDlg.h \
|
||||||
|
BasicGUI_CircleDlg.h \
|
||||||
|
BasicGUI_EllipseDlg.h \
|
||||||
|
BasicGUI_ArcDlg.h \
|
||||||
|
BasicGUI_VectorDlg.h \
|
||||||
|
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_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 += -lOCCViewer -lVTKViewer -lSalomeObject -lSalomeGUI -lGEOMClient -lGEOMObject -lGEOMFiltersSelection -lDlgRef -lGEOMBase $(OCC_KERNEL_LIBS) $(OCC_MODELER_LIBS) -L${KERNEL_ROOT_DIR}/lib/salome
|
||||||
|
|
||||||
|
@CONCLUDE@
|
128
src/BooleanGUI/BooleanGUI.cxx
Normal file
128
src/BooleanGUI/BooleanGUI.cxx
Normal file
@ -0,0 +1,128 @@
|
|||||||
|
// 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 : BooleanGUI.cxx
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
#include "BooleanGUI.h"
|
||||||
|
|
||||||
|
#include "QAD_Application.h"
|
||||||
|
#include "SALOMEGUI_QtCatchCorbaException.hxx"
|
||||||
|
|
||||||
|
#include "BooleanGUI_FuseDlg.h" // Method FUSE
|
||||||
|
#include "BooleanGUI_CommonDlg.h" // Method COMMON
|
||||||
|
#include "BooleanGUI_CutDlg.h" // Method CUT
|
||||||
|
#include "BooleanGUI_SectionDlg.h" // Method SECTION
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
// function : BooleanGUI()
|
||||||
|
// purpose : Constructor
|
||||||
|
//=======================================================================
|
||||||
|
BooleanGUI::BooleanGUI() :
|
||||||
|
QObject()
|
||||||
|
{
|
||||||
|
myGeomGUI = GEOMBase_Context::GetGeomGUI();
|
||||||
|
Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM");
|
||||||
|
myGeom = GEOM::GEOM_Gen::_narrow(comp);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
// function : ~BooleanGUI()
|
||||||
|
// purpose : Destructor
|
||||||
|
//=======================================================================
|
||||||
|
BooleanGUI::~BooleanGUI()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
// function : OnGUIEvent()
|
||||||
|
// purpose :
|
||||||
|
//=======================================================================
|
||||||
|
bool BooleanGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
||||||
|
{
|
||||||
|
myGeomGUI->EmitSignalDeactivateDialog();
|
||||||
|
SALOME_Selection* Sel = SALOME_Selection::Selection(myGeomGUI->GetActiveStudy()->getSelection());
|
||||||
|
|
||||||
|
switch (theCommandID)
|
||||||
|
{
|
||||||
|
case 4011: // FUSE
|
||||||
|
{
|
||||||
|
BooleanGUI_FuseDlg *aDlg = new BooleanGUI_FuseDlg(parent, "", this, Sel);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 4012: // COMMON
|
||||||
|
{
|
||||||
|
BooleanGUI_CommonDlg *aDlg = new BooleanGUI_CommonDlg(parent, "", this, Sel);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 4013: // CUT
|
||||||
|
{
|
||||||
|
BooleanGUI_CutDlg *aDlg = new BooleanGUI_CutDlg(parent, "", this, Sel);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 4014: // SECTION
|
||||||
|
{
|
||||||
|
BooleanGUI_SectionDlg *aDlg = new BooleanGUI_SectionDlg(parent, "", this, Sel);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
parent->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
// function : MakeBooleanAndDisplay()
|
||||||
|
// purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void BooleanGUI::MakeBooleanAndDisplay(GEOM::GEOM_Shape_ptr Shape1, GEOM::GEOM_Shape_ptr Shape2, const short operation)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
GEOM::GEOM_Shape_ptr result = myGeom->MakeBoolean(Shape1, Shape2, operation);
|
||||||
|
if(result->_is_nil()) {
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, result);
|
||||||
|
Standard_CString type;
|
||||||
|
myGeomGUI->GetShapeTypeString(S,type);
|
||||||
|
result->NameType(type);
|
||||||
|
|
||||||
|
if (myGeomGUI->Display(result, ""))
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
|
}
|
||||||
|
catch (const SALOME::SALOME_Exception& S_ex) {
|
||||||
|
QtCatchCorbaException(S_ex);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
58
src/BooleanGUI/BooleanGUI.h
Normal file
58
src/BooleanGUI/BooleanGUI.h
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
// 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 : BooleanGUI.h
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#ifndef BOOLEANGUI_H
|
||||||
|
#define BOOLEANGUI_H
|
||||||
|
|
||||||
|
#include "GEOMBase_Display.h"
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BooleanGUI
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
class BooleanGUI : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT /* for QT compatibility */
|
||||||
|
|
||||||
|
public :
|
||||||
|
BooleanGUI();
|
||||||
|
~BooleanGUI();
|
||||||
|
|
||||||
|
bool OnGUIEvent(int theCommandID, QAD_Desktop* parent);
|
||||||
|
|
||||||
|
void MakeBooleanAndDisplay(GEOM::GEOM_Shape_ptr Shape1,
|
||||||
|
GEOM::GEOM_Shape_ptr Shape2,
|
||||||
|
const short operation);
|
||||||
|
|
||||||
|
private:
|
||||||
|
GEOMBase_Context* myGeomGUI;
|
||||||
|
GEOM::GEOM_Gen_var myGeom; /* Current Geom Component */
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
250
src/BooleanGUI/BooleanGUI_CommonDlg.cxx
Normal file
250
src/BooleanGUI/BooleanGUI_CommonDlg.cxx
Normal file
@ -0,0 +1,250 @@
|
|||||||
|
// 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 : BooleanGUI_CommonDlg.cxx
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
#include "BooleanGUI_CommonDlg.h"
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BooleanGUI_CommonDlg()
|
||||||
|
// purpose : Constructs a BooleanGUI_CommonDlg which is a child of 'parent', with the
|
||||||
|
// name 'name' and widget flags set to 'f'.
|
||||||
|
// The dialog will by default be modeless, unless you set 'modal' to
|
||||||
|
// TRUE to construct a modal dialog.
|
||||||
|
//=================================================================================
|
||||||
|
BooleanGUI_CommonDlg::BooleanGUI_CommonDlg(QWidget* parent, const char* name, BooleanGUI* theBooleanGUI, 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_COMMON")));
|
||||||
|
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||||
|
|
||||||
|
setCaption(tr("GEOM_COMMON_TITLE"));
|
||||||
|
|
||||||
|
/***************************************************************/
|
||||||
|
GroupConstructors->setTitle(tr("GEOM_COMMON"));
|
||||||
|
RadioButton1->setPixmap(image0);
|
||||||
|
RadioButton2->close(TRUE);
|
||||||
|
RadioButton3->close(TRUE);
|
||||||
|
|
||||||
|
GroupCommon = new DlgRef_2Sel_QTD(this, "GroupCommon");
|
||||||
|
GroupCommon->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
|
||||||
|
GroupCommon->TextLabel1->setText(tr("GEOM_OBJECT_I").arg("1"));
|
||||||
|
GroupCommon->TextLabel2->setText(tr("GEOM_OBJECT_I").arg("2"));
|
||||||
|
GroupCommon->PushButton1->setPixmap(image1);
|
||||||
|
GroupCommon->PushButton2->setPixmap(image1);
|
||||||
|
|
||||||
|
Layout1->addWidget(GroupCommon, 1, 0);
|
||||||
|
/***************************************************************/
|
||||||
|
|
||||||
|
/* Initialisation */
|
||||||
|
myBooleanGUI = theBooleanGUI;
|
||||||
|
Init();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ~BooleanGUI_CommonDlg()
|
||||||
|
// purpose : Destroys the object and frees any allocated resources
|
||||||
|
//=================================================================================
|
||||||
|
BooleanGUI_CommonDlg::~BooleanGUI_CommonDlg()
|
||||||
|
{
|
||||||
|
/* no need to delete child widgets, Qt does it all for us */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : Init()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_CommonDlg::Init()
|
||||||
|
{
|
||||||
|
/* init variables */
|
||||||
|
myEditCurrentArgument = GroupCommon->LineEdit1;
|
||||||
|
|
||||||
|
myShape1.Nullify();
|
||||||
|
myShape2.Nullify();
|
||||||
|
myOkShape1 = myOkShape2 = false;
|
||||||
|
|
||||||
|
/* signals and slots connections */
|
||||||
|
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||||
|
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||||
|
|
||||||
|
connect(GroupCommon->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
|
connect(GroupCommon->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
|
|
||||||
|
connect(GroupCommon->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
connect(GroupCommon->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
|
||||||
|
/* displays Dialog */
|
||||||
|
GroupCommon->show();
|
||||||
|
this->show();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnOk()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_CommonDlg::ClickOnOk()
|
||||||
|
{
|
||||||
|
this->ClickOnApply();
|
||||||
|
ClickOnCancel();
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnApply()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_CommonDlg::ClickOnApply()
|
||||||
|
{
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
||||||
|
|
||||||
|
if(myOkShape1 && myOkShape2)
|
||||||
|
myBooleanGUI->MakeBooleanAndDisplay(myGeomShape1 ,myGeomShape2, 1);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SelectionIntoArgument()
|
||||||
|
// purpose : Called when selection has changed
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_CommonDlg::SelectionIntoArgument()
|
||||||
|
{
|
||||||
|
myEditCurrentArgument->setText("");
|
||||||
|
QString aString = "";
|
||||||
|
|
||||||
|
int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString);
|
||||||
|
if(nbSel != 1) {
|
||||||
|
if(myEditCurrentArgument == GroupCommon->LineEdit1)
|
||||||
|
myOkShape1 = false;
|
||||||
|
else if( myEditCurrentArgument == GroupCommon->LineEdit2)
|
||||||
|
myOkShape2 = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* nbSel == 1 */
|
||||||
|
TopoDS_Shape S;
|
||||||
|
Standard_Boolean testResult;
|
||||||
|
Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
|
||||||
|
|
||||||
|
if(!myGeomGUI->GetTopoFromSelection(mySelection, S))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(myEditCurrentArgument == GroupCommon->LineEdit1) {
|
||||||
|
myGeomShape1 = myGeomGUI->ConvertIOinGEOMShape(IO, testResult);
|
||||||
|
if(!testResult)
|
||||||
|
return;
|
||||||
|
myShape1 = S;
|
||||||
|
GroupCommon->LineEdit1->setText(aString);
|
||||||
|
myOkShape1 = true;
|
||||||
|
}
|
||||||
|
else if(myEditCurrentArgument == GroupCommon->LineEdit2) {
|
||||||
|
myGeomShape2 = myGeomGUI->ConvertIOinGEOMShape(IO, testResult);
|
||||||
|
if(!testResult)
|
||||||
|
return;
|
||||||
|
myShape2 = S;
|
||||||
|
GroupCommon->LineEdit2->setText(aString);
|
||||||
|
myOkShape2 = true;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SetEditCurrentArgument()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_CommonDlg::SetEditCurrentArgument()
|
||||||
|
{
|
||||||
|
QPushButton* send = (QPushButton*)sender();
|
||||||
|
|
||||||
|
if(send == GroupCommon->PushButton1) {
|
||||||
|
GroupCommon->LineEdit1->setFocus();
|
||||||
|
myEditCurrentArgument = GroupCommon->LineEdit1;
|
||||||
|
}
|
||||||
|
else if(send == GroupCommon->PushButton2) {
|
||||||
|
GroupCommon->LineEdit2->setFocus();
|
||||||
|
myEditCurrentArgument = GroupCommon->LineEdit2;
|
||||||
|
}
|
||||||
|
SelectionIntoArgument();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : LineEditReturnPressed()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_CommonDlg::LineEditReturnPressed()
|
||||||
|
{
|
||||||
|
QLineEdit* send = (QLineEdit*)sender();
|
||||||
|
if(send == GroupCommon->LineEdit1)
|
||||||
|
myEditCurrentArgument = GroupCommon->LineEdit1;
|
||||||
|
else if(send == GroupCommon->LineEdit2)
|
||||||
|
myEditCurrentArgument = GroupCommon->LineEdit2;
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ActivateThisDialog()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_CommonDlg::ActivateThisDialog()
|
||||||
|
{
|
||||||
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : enterEvent()
|
||||||
|
// purpose : when mouse enter onto the QWidget
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_CommonDlg::enterEvent(QEvent * e)
|
||||||
|
{
|
||||||
|
if (GroupConstructors->isEnabled())
|
||||||
|
return;
|
||||||
|
this->ActivateThisDialog();
|
||||||
|
return;
|
||||||
|
}
|
76
src/BooleanGUI/BooleanGUI_CommonDlg.h
Normal file
76
src/BooleanGUI/BooleanGUI_CommonDlg.h
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
// 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 : BooleanGUI_CommonDlg.h
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
#ifndef DIALOGBOX_COMMON_H
|
||||||
|
#define DIALOGBOX_COMMON_H
|
||||||
|
|
||||||
|
#include "GEOMBase_Skeleton.h"
|
||||||
|
#include "DlgRef_2Sel_QTD.h"
|
||||||
|
|
||||||
|
#include "BooleanGUI.h"
|
||||||
|
|
||||||
|
#include <BRepAlgoAPI_Common.hxx>
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BooleanGUI_CommonDlg
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
class BooleanGUI_CommonDlg : public GEOMBase_Skeleton
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
BooleanGUI_CommonDlg(QWidget* parent = 0, const char* name = 0, BooleanGUI* theBooleanGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
|
||||||
|
~BooleanGUI_CommonDlg();
|
||||||
|
|
||||||
|
private:
|
||||||
|
void Init();
|
||||||
|
void enterEvent(QEvent * e);
|
||||||
|
|
||||||
|
BooleanGUI* myBooleanGUI;
|
||||||
|
|
||||||
|
TopoDS_Shape myShape1; /* topology used */
|
||||||
|
TopoDS_Shape myShape2; /* topology used */
|
||||||
|
GEOM::GEOM_Shape_var myGeomShape1; /* is myShape1 */
|
||||||
|
GEOM::GEOM_Shape_var myGeomShape2; /* is myShape2 */
|
||||||
|
bool myOkShape1;
|
||||||
|
bool myOkShape2; /* to check when arguments are defined */
|
||||||
|
|
||||||
|
DlgRef_2Sel_QTD* GroupCommon;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void ClickOnOk();
|
||||||
|
void ClickOnApply();
|
||||||
|
void SetEditCurrentArgument();
|
||||||
|
void SelectionIntoArgument();
|
||||||
|
void LineEditReturnPressed();
|
||||||
|
void ActivateThisDialog();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DIALOGBOX_COMMON_H
|
248
src/BooleanGUI/BooleanGUI_CutDlg.cxx
Normal file
248
src/BooleanGUI/BooleanGUI_CutDlg.cxx
Normal file
@ -0,0 +1,248 @@
|
|||||||
|
// 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 : BooleanGUI_CutDlg.cxx
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
#include "BooleanGUI_CutDlg.h"
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BooleanGUI_CutDlg()
|
||||||
|
// purpose : Constructs a BooleanGUI_CutDlg which is a child of 'parent', with the
|
||||||
|
// name 'name' and widget flags set to 'f'.
|
||||||
|
// The dialog will by default be modeless, unless you set 'modal' to
|
||||||
|
// TRUE to construct a modal dialog.
|
||||||
|
//=================================================================================
|
||||||
|
BooleanGUI_CutDlg::BooleanGUI_CutDlg(QWidget* parent, const char* name, BooleanGUI* theBooleanGUI, 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_CUT")));
|
||||||
|
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||||
|
|
||||||
|
setCaption(tr("GEOM_CUT_TITLE"));
|
||||||
|
|
||||||
|
/***************************************************************/
|
||||||
|
GroupConstructors->setTitle(tr("GEOM_CUT"));
|
||||||
|
RadioButton1->setPixmap(image0);
|
||||||
|
RadioButton2->close(TRUE);
|
||||||
|
RadioButton3->close(TRUE);
|
||||||
|
|
||||||
|
GroupCut = new DlgRef_2Sel_QTD(this, "GroupCut");
|
||||||
|
GroupCut->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
|
||||||
|
GroupCut->TextLabel1->setText(tr("GEOM_OBJECT_I").arg("1"));
|
||||||
|
GroupCut->TextLabel2->setText(tr("GEOM_OBJECT_I").arg("2"));
|
||||||
|
GroupCut->PushButton1->setPixmap(image1);
|
||||||
|
GroupCut->PushButton2->setPixmap(image1);
|
||||||
|
|
||||||
|
Layout1->addWidget(GroupCut, 1, 0);
|
||||||
|
/***************************************************************/
|
||||||
|
|
||||||
|
/* Initialisation */
|
||||||
|
myBooleanGUI = theBooleanGUI;
|
||||||
|
Init();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ~BooleanGUI_CutDlg()
|
||||||
|
// purpose : Destroys the object and frees any allocated resources
|
||||||
|
//=================================================================================
|
||||||
|
BooleanGUI_CutDlg::~BooleanGUI_CutDlg()
|
||||||
|
{
|
||||||
|
/* no need to delete child widgets, Qt does it all for us */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : Init()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_CutDlg::Init()
|
||||||
|
{
|
||||||
|
/* init variables */
|
||||||
|
myEditCurrentArgument = GroupCut->LineEdit1;
|
||||||
|
|
||||||
|
myShape1.Nullify();
|
||||||
|
myShape2.Nullify();
|
||||||
|
myOkShape1 = myOkShape2 = false;
|
||||||
|
|
||||||
|
/* signals and slots connections */
|
||||||
|
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||||
|
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||||
|
|
||||||
|
connect(GroupCut->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
|
connect(GroupCut->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
|
|
||||||
|
connect(GroupCut->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
connect(GroupCut->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
|
||||||
|
/* displays Dialog */
|
||||||
|
GroupCut->show();
|
||||||
|
this->show();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnOk()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_CutDlg::ClickOnOk()
|
||||||
|
{
|
||||||
|
this->ClickOnApply();
|
||||||
|
ClickOnCancel();
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnApply()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_CutDlg::ClickOnApply()
|
||||||
|
{
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
||||||
|
|
||||||
|
if(myOkShape1 && myOkShape2)
|
||||||
|
myBooleanGUI->MakeBooleanAndDisplay(myGeomShape1 ,myGeomShape2, 2);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SelectionIntoArgument()
|
||||||
|
// purpose : Called when selection has changed
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_CutDlg::SelectionIntoArgument()
|
||||||
|
{
|
||||||
|
myEditCurrentArgument->setText("");
|
||||||
|
QString aString = "";
|
||||||
|
|
||||||
|
int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString);
|
||||||
|
if(nbSel != 1) {
|
||||||
|
if(myEditCurrentArgument == GroupCut->LineEdit1)
|
||||||
|
myOkShape1 = false;
|
||||||
|
else if( myEditCurrentArgument == GroupCut->LineEdit2)
|
||||||
|
myOkShape2 = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* nbSel == 1 */
|
||||||
|
TopoDS_Shape S;
|
||||||
|
Standard_Boolean testResult;
|
||||||
|
Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
|
||||||
|
|
||||||
|
if(!myGeomGUI->GetTopoFromSelection(mySelection, S))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(myEditCurrentArgument == GroupCut->LineEdit1) {
|
||||||
|
myGeomShape1 = myGeomGUI->ConvertIOinGEOMShape(IO, testResult);
|
||||||
|
if(!testResult)
|
||||||
|
return;
|
||||||
|
myShape1 = S;
|
||||||
|
GroupCut->LineEdit1->setText(aString);
|
||||||
|
myOkShape1 = true;
|
||||||
|
}
|
||||||
|
else if(myEditCurrentArgument == GroupCut->LineEdit2) {
|
||||||
|
myGeomShape2 = myGeomGUI->ConvertIOinGEOMShape(IO, testResult);
|
||||||
|
if(!testResult)
|
||||||
|
return;
|
||||||
|
myShape2 = S;
|
||||||
|
GroupCut->LineEdit2->setText(aString);
|
||||||
|
myOkShape2 = true;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SetEditCurrentArgument()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_CutDlg::SetEditCurrentArgument()
|
||||||
|
{
|
||||||
|
QPushButton* send = (QPushButton*)sender();
|
||||||
|
|
||||||
|
if(send == GroupCut->PushButton1) {
|
||||||
|
GroupCut->LineEdit1->setFocus();
|
||||||
|
myEditCurrentArgument = GroupCut->LineEdit1;
|
||||||
|
}
|
||||||
|
else if(send == GroupCut->PushButton2) {
|
||||||
|
GroupCut->LineEdit2->setFocus();
|
||||||
|
myEditCurrentArgument = GroupCut->LineEdit2;
|
||||||
|
}
|
||||||
|
SelectionIntoArgument();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : LineEditReturnPressed()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_CutDlg::LineEditReturnPressed()
|
||||||
|
{
|
||||||
|
QLineEdit* send = (QLineEdit*)sender();
|
||||||
|
if(send == GroupCut->LineEdit1)
|
||||||
|
myEditCurrentArgument = GroupCut->LineEdit1;
|
||||||
|
else if(send == GroupCut->LineEdit2)
|
||||||
|
myEditCurrentArgument = GroupCut->LineEdit2;
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ActivateThisDialog()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_CutDlg::ActivateThisDialog()
|
||||||
|
{
|
||||||
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : enterEvent()
|
||||||
|
// purpose : when mouse enter onto the QWidget
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_CutDlg::enterEvent(QEvent * e)
|
||||||
|
{
|
||||||
|
if(GroupConstructors->isEnabled())
|
||||||
|
return;
|
||||||
|
this->ActivateThisDialog();
|
||||||
|
return;
|
||||||
|
}
|
76
src/BooleanGUI/BooleanGUI_CutDlg.h
Normal file
76
src/BooleanGUI/BooleanGUI_CutDlg.h
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
// 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 : BooleanGUI_CutDlg.h
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
#ifndef DIALOGBOX_CUT_H
|
||||||
|
#define DIALOGBOX_CUT_H
|
||||||
|
|
||||||
|
#include "GEOMBase_Skeleton.h"
|
||||||
|
#include "DlgRef_2Sel_QTD.h"
|
||||||
|
|
||||||
|
#include "BooleanGUI.h"
|
||||||
|
|
||||||
|
#include <BRepAlgoAPI_Cut.hxx>
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BooleanGUI_CutDlg
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
class BooleanGUI_CutDlg : public GEOMBase_Skeleton
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
BooleanGUI_CutDlg( QWidget* parent = 0, const char* name = 0, BooleanGUI* theBooleanGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
|
||||||
|
~BooleanGUI_CutDlg();
|
||||||
|
|
||||||
|
private:
|
||||||
|
void Init();
|
||||||
|
void enterEvent(QEvent* e);
|
||||||
|
|
||||||
|
BooleanGUI* myBooleanGUI;
|
||||||
|
|
||||||
|
TopoDS_Shape myShape1; /* topology used to fuse */
|
||||||
|
TopoDS_Shape myShape2; /* topology used to fuse */
|
||||||
|
GEOM::GEOM_Shape_var myGeomShape1; /* is myShape1 */
|
||||||
|
GEOM::GEOM_Shape_var myGeomShape2; /* is myShape2 */
|
||||||
|
bool myOkShape1; /* to check when arguments are defined */
|
||||||
|
bool myOkShape2;
|
||||||
|
|
||||||
|
DlgRef_2Sel_QTD* GroupCut;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void ClickOnOk();
|
||||||
|
void ClickOnApply();
|
||||||
|
void SetEditCurrentArgument();
|
||||||
|
void SelectionIntoArgument();
|
||||||
|
void LineEditReturnPressed();
|
||||||
|
void ActivateThisDialog();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DIALOGBOX_CUT_H
|
248
src/BooleanGUI/BooleanGUI_FuseDlg.cxx
Normal file
248
src/BooleanGUI/BooleanGUI_FuseDlg.cxx
Normal file
@ -0,0 +1,248 @@
|
|||||||
|
// 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 : BooleanGUI_FuseDlg.cxx
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
#include "BooleanGUI_FuseDlg.h"
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BooleanGUI_FuseDlg()
|
||||||
|
// purpose : Constructs a BooleanGUI_FuseDlg which is a child of 'parent', with the
|
||||||
|
// name 'name' and widget flags set to 'f'.
|
||||||
|
// The dialog will by default be modeless, unless you set 'modal' to
|
||||||
|
// TRUE to construct a modal dialog.
|
||||||
|
//=================================================================================
|
||||||
|
BooleanGUI_FuseDlg::BooleanGUI_FuseDlg(QWidget* parent, const char* name, BooleanGUI* theBooleanGUI, 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_FUSE")));
|
||||||
|
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||||
|
|
||||||
|
setCaption(tr("GEOM_FUSE_TITLE"));
|
||||||
|
|
||||||
|
/***************************************************************/
|
||||||
|
GroupConstructors->setTitle(tr("GEOM_FUSE"));
|
||||||
|
RadioButton1->setPixmap(image0);
|
||||||
|
RadioButton2->close(TRUE);
|
||||||
|
RadioButton3->close(TRUE);
|
||||||
|
|
||||||
|
GroupFuse = new DlgRef_2Sel_QTD(this, "GroupFuse");
|
||||||
|
GroupFuse->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
|
||||||
|
GroupFuse->TextLabel1->setText(tr("GEOM_OBJECT_I").arg("1"));
|
||||||
|
GroupFuse->TextLabel2->setText(tr("GEOM_OBJECT_I").arg("2"));
|
||||||
|
GroupFuse->PushButton1->setPixmap(image1);
|
||||||
|
GroupFuse->PushButton2->setPixmap(image1);
|
||||||
|
|
||||||
|
Layout1->addWidget(GroupFuse, 1, 0);
|
||||||
|
/***************************************************************/
|
||||||
|
|
||||||
|
/* Initialisation */
|
||||||
|
myBooleanGUI = theBooleanGUI;
|
||||||
|
Init();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ~BooleanGUI_FuseDlg()
|
||||||
|
// purpose : Destroys the object and frees any allocated resources
|
||||||
|
//=================================================================================
|
||||||
|
BooleanGUI_FuseDlg::~BooleanGUI_FuseDlg()
|
||||||
|
{
|
||||||
|
/* no need to delete child widgets, Qt does it all for us */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : Init()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_FuseDlg::Init()
|
||||||
|
{
|
||||||
|
/* init variables */
|
||||||
|
myEditCurrentArgument = GroupFuse->LineEdit1;
|
||||||
|
|
||||||
|
myShape1.Nullify();
|
||||||
|
myShape2.Nullify();
|
||||||
|
myOkShape1 = myOkShape2 = false;
|
||||||
|
|
||||||
|
/* signals and slots connections */
|
||||||
|
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||||
|
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||||
|
|
||||||
|
connect(GroupFuse->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
|
connect(GroupFuse->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
|
|
||||||
|
connect(GroupFuse->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
connect(GroupFuse->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
|
||||||
|
/* displays Dialog */
|
||||||
|
GroupFuse->show();
|
||||||
|
this->show();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnOk()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_FuseDlg::ClickOnOk()
|
||||||
|
{
|
||||||
|
this->ClickOnApply();
|
||||||
|
ClickOnCancel();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnApply()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_FuseDlg::ClickOnApply()
|
||||||
|
{
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
||||||
|
|
||||||
|
if(myOkShape1 && myOkShape2)
|
||||||
|
myBooleanGUI->MakeBooleanAndDisplay(myGeomShape1 ,myGeomShape2, 3);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SelectionIntoArgument()
|
||||||
|
// purpose : Called when selection has changed
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_FuseDlg::SelectionIntoArgument()
|
||||||
|
{
|
||||||
|
myEditCurrentArgument->setText("");
|
||||||
|
QString aString = "";
|
||||||
|
|
||||||
|
int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString);
|
||||||
|
if(nbSel != 1) {
|
||||||
|
if(myEditCurrentArgument == GroupFuse->LineEdit1)
|
||||||
|
myOkShape1 = false;
|
||||||
|
else if( myEditCurrentArgument == GroupFuse->LineEdit2)
|
||||||
|
myOkShape2 = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* nbSel == 1 */
|
||||||
|
TopoDS_Shape S;
|
||||||
|
Standard_Boolean testResult;
|
||||||
|
Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
|
||||||
|
|
||||||
|
if(!myGeomGUI->GetTopoFromSelection(mySelection, S))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(myEditCurrentArgument == GroupFuse->LineEdit1) {
|
||||||
|
myGeomShape1 = myGeomGUI->ConvertIOinGEOMShape(IO, testResult);
|
||||||
|
if(!testResult)
|
||||||
|
return;
|
||||||
|
myShape1 = S;
|
||||||
|
GroupFuse->LineEdit1->setText(aString);
|
||||||
|
myOkShape1 = true;
|
||||||
|
}
|
||||||
|
else if(myEditCurrentArgument == GroupFuse->LineEdit2) {
|
||||||
|
myGeomShape2 = myGeomGUI->ConvertIOinGEOMShape(IO, testResult);
|
||||||
|
if(!testResult)
|
||||||
|
return;
|
||||||
|
myShape2 = S;
|
||||||
|
GroupFuse->LineEdit2->setText(aString);
|
||||||
|
myOkShape2 = true;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SetEditCurrentArgument()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_FuseDlg::SetEditCurrentArgument()
|
||||||
|
{
|
||||||
|
QPushButton* send = (QPushButton*)sender();
|
||||||
|
|
||||||
|
if(send == GroupFuse->PushButton1) {
|
||||||
|
GroupFuse->LineEdit1->setFocus();
|
||||||
|
myEditCurrentArgument = GroupFuse->LineEdit1;
|
||||||
|
}
|
||||||
|
else if(send == GroupFuse->PushButton2) {
|
||||||
|
GroupFuse->LineEdit2->setFocus();
|
||||||
|
myEditCurrentArgument = GroupFuse->LineEdit2;
|
||||||
|
}
|
||||||
|
SelectionIntoArgument();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : LineEditReturnPressed()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_FuseDlg::LineEditReturnPressed()
|
||||||
|
{
|
||||||
|
QLineEdit* send = (QLineEdit*)sender();
|
||||||
|
if(send == GroupFuse->LineEdit1)
|
||||||
|
myEditCurrentArgument = GroupFuse->LineEdit1;
|
||||||
|
else if(send == GroupFuse->LineEdit2)
|
||||||
|
myEditCurrentArgument = GroupFuse->LineEdit2;
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ActivateThisDialog()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_FuseDlg::ActivateThisDialog()
|
||||||
|
{
|
||||||
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : enterEvent()
|
||||||
|
// purpose : when mouse enter onto the QWidget
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_FuseDlg::enterEvent(QEvent* e)
|
||||||
|
{
|
||||||
|
if(GroupConstructors->isEnabled())
|
||||||
|
return;
|
||||||
|
this->ActivateThisDialog();
|
||||||
|
return;
|
||||||
|
}
|
76
src/BooleanGUI/BooleanGUI_FuseDlg.h
Normal file
76
src/BooleanGUI/BooleanGUI_FuseDlg.h
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
// 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 : BooleanGUI_FuseDlg.h
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
#ifndef DIALOGBOX_FUSE_H
|
||||||
|
#define DIALOGBOX_FUSE_H
|
||||||
|
|
||||||
|
#include "GEOMBase_Skeleton.h"
|
||||||
|
#include "DlgRef_2Sel_QTD.h"
|
||||||
|
|
||||||
|
#include "BooleanGUI.h"
|
||||||
|
|
||||||
|
#include <BRepAlgoAPI_Fuse.hxx>
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BooleanGUI_FuseDlg
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
class BooleanGUI_FuseDlg : public GEOMBase_Skeleton
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
BooleanGUI_FuseDlg(QWidget* parent = 0, const char* name = 0, BooleanGUI* theBooleanGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
|
||||||
|
~BooleanGUI_FuseDlg();
|
||||||
|
|
||||||
|
private:
|
||||||
|
void Init();
|
||||||
|
void enterEvent(QEvent* e);
|
||||||
|
|
||||||
|
BooleanGUI* myBooleanGUI;
|
||||||
|
|
||||||
|
TopoDS_Shape myShape1; /* topology used to fuse */
|
||||||
|
TopoDS_Shape myShape2; /* topology used to fuse */
|
||||||
|
GEOM::GEOM_Shape_var myGeomShape1; /* is myShape1 */
|
||||||
|
GEOM::GEOM_Shape_var myGeomShape2; /* is myShape2 */
|
||||||
|
bool myOkShape1; /* to check when arguments are defined */
|
||||||
|
bool myOkShape2;
|
||||||
|
|
||||||
|
DlgRef_2Sel_QTD* GroupFuse;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void ClickOnOk();
|
||||||
|
void ClickOnApply();
|
||||||
|
void SetEditCurrentArgument();
|
||||||
|
void SelectionIntoArgument();
|
||||||
|
void LineEditReturnPressed();
|
||||||
|
void ActivateThisDialog();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DIALOGBOX_FUSE_H
|
249
src/BooleanGUI/BooleanGUI_SectionDlg.cxx
Normal file
249
src/BooleanGUI/BooleanGUI_SectionDlg.cxx
Normal file
@ -0,0 +1,249 @@
|
|||||||
|
// 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 : BooleanGUI_SectionDlg.cxx
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
#include "BooleanGUI_SectionDlg.h"
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BooleanGUI_SectionDlg()
|
||||||
|
// purpose : Constructs a BooleanGUI_SectionDlg which is a child of 'parent', with the
|
||||||
|
// name 'name' and widget flags set to 'f'.
|
||||||
|
// The dialog will by default be modeless, unless you set 'modal' to
|
||||||
|
// TRUE to construct a modal dialog.
|
||||||
|
//=================================================================================
|
||||||
|
BooleanGUI_SectionDlg::BooleanGUI_SectionDlg(QWidget* parent, const char* name, BooleanGUI* theBooleanGUI, 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_SECTION")));
|
||||||
|
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||||
|
|
||||||
|
setCaption(tr("GEOM_SECTION_TITLE"));
|
||||||
|
|
||||||
|
/***************************************************************/
|
||||||
|
GroupConstructors->setTitle(tr("GEOM_SECTION"));
|
||||||
|
RadioButton1->setPixmap(image0);
|
||||||
|
RadioButton2->close(TRUE);
|
||||||
|
RadioButton3->close(TRUE);
|
||||||
|
|
||||||
|
GroupSection = new DlgRef_2Sel_QTD(this, "GroupSection");
|
||||||
|
GroupSection->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
|
||||||
|
GroupSection->TextLabel1->setText(tr("GEOM_OBJECT_I").arg("1"));
|
||||||
|
GroupSection->TextLabel2->setText(tr("GEOM_OBJECT_I").arg("2"));
|
||||||
|
GroupSection->PushButton1->setPixmap(image1);
|
||||||
|
GroupSection->PushButton2->setPixmap(image1);
|
||||||
|
|
||||||
|
Layout1->addWidget(GroupSection, 1, 0);
|
||||||
|
/***************************************************************/
|
||||||
|
|
||||||
|
/* Initialisation */
|
||||||
|
myBooleanGUI = theBooleanGUI;
|
||||||
|
Init();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ~BooleanGUI_SectionDlg()
|
||||||
|
// purpose : Destroys the object and frees any allocated resources
|
||||||
|
//=================================================================================
|
||||||
|
BooleanGUI_SectionDlg::~BooleanGUI_SectionDlg()
|
||||||
|
{
|
||||||
|
/* no need to delete child widgets, Qt does it all for us */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : Init()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_SectionDlg::Init()
|
||||||
|
{
|
||||||
|
/* init variables */
|
||||||
|
myEditCurrentArgument = GroupSection->LineEdit1;
|
||||||
|
|
||||||
|
myShape1.Nullify();
|
||||||
|
myShape2.Nullify();
|
||||||
|
myOkShape1 = myOkShape2 = false;
|
||||||
|
|
||||||
|
/* signals and slots connections */
|
||||||
|
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||||
|
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||||
|
|
||||||
|
connect(GroupSection->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
|
connect(GroupSection->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
|
|
||||||
|
connect(GroupSection->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
connect(GroupSection->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
|
||||||
|
/* displays Dialog */
|
||||||
|
GroupSection->show();
|
||||||
|
this->show();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnOk()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_SectionDlg::ClickOnOk()
|
||||||
|
{
|
||||||
|
this->ClickOnApply();
|
||||||
|
ClickOnCancel();
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnApply()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_SectionDlg::ClickOnApply()
|
||||||
|
{
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
||||||
|
|
||||||
|
if(myOkShape1 && myOkShape2)
|
||||||
|
myBooleanGUI->MakeBooleanAndDisplay(myGeomShape1 ,myGeomShape2, 4);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SelectionIntoArgument()
|
||||||
|
// purpose : Called when selection has changed
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_SectionDlg::SelectionIntoArgument()
|
||||||
|
{
|
||||||
|
myEditCurrentArgument->setText("");
|
||||||
|
QString aString = "";
|
||||||
|
|
||||||
|
int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString);
|
||||||
|
if(nbSel != 1) {
|
||||||
|
if(myEditCurrentArgument == GroupSection->LineEdit1)
|
||||||
|
myOkShape1 = false;
|
||||||
|
else if( myEditCurrentArgument == GroupSection->LineEdit2)
|
||||||
|
myOkShape2 = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* nbSel == 1 */
|
||||||
|
TopoDS_Shape S;
|
||||||
|
Standard_Boolean testResult;
|
||||||
|
Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
|
||||||
|
|
||||||
|
if(!myGeomGUI->GetTopoFromSelection(mySelection, S))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(myEditCurrentArgument == GroupSection->LineEdit1) {
|
||||||
|
myGeomShape1 = myGeomGUI->ConvertIOinGEOMShape(IO, testResult);
|
||||||
|
if(!testResult)
|
||||||
|
return;
|
||||||
|
myShape1 = S;
|
||||||
|
GroupSection->LineEdit1->setText(aString);
|
||||||
|
myOkShape1 = true;
|
||||||
|
}
|
||||||
|
else if(myEditCurrentArgument == GroupSection->LineEdit2) {
|
||||||
|
myGeomShape2 = myGeomGUI->ConvertIOinGEOMShape(IO, testResult);
|
||||||
|
if(!testResult)
|
||||||
|
return;
|
||||||
|
myShape2 = S;
|
||||||
|
GroupSection->LineEdit2->setText(aString);
|
||||||
|
myOkShape2 = true;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SetEditCurrentArgument()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_SectionDlg::SetEditCurrentArgument()
|
||||||
|
{
|
||||||
|
QPushButton* send = (QPushButton*)sender();
|
||||||
|
|
||||||
|
if(send == GroupSection->PushButton1) {
|
||||||
|
GroupSection->LineEdit1->setFocus();
|
||||||
|
myEditCurrentArgument = GroupSection->LineEdit1;
|
||||||
|
}
|
||||||
|
else if(send == GroupSection->PushButton2) {
|
||||||
|
GroupSection->LineEdit2->setFocus();
|
||||||
|
myEditCurrentArgument = GroupSection->LineEdit2;
|
||||||
|
}
|
||||||
|
SelectionIntoArgument();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : LineEditReturnPressed()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_SectionDlg::LineEditReturnPressed()
|
||||||
|
{
|
||||||
|
QLineEdit* send = (QLineEdit*)sender();
|
||||||
|
if(send == GroupSection->LineEdit1)
|
||||||
|
myEditCurrentArgument = GroupSection->LineEdit1;
|
||||||
|
else if(send == GroupSection->LineEdit2)
|
||||||
|
myEditCurrentArgument = GroupSection->LineEdit2;
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ActivateThisDialog()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_SectionDlg::ActivateThisDialog()
|
||||||
|
{
|
||||||
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : enterEvent()
|
||||||
|
// purpose : when mouse enter onto the QWidget
|
||||||
|
//=================================================================================
|
||||||
|
void BooleanGUI_SectionDlg::enterEvent(QEvent * e)
|
||||||
|
{
|
||||||
|
if(GroupConstructors->isEnabled())
|
||||||
|
return;
|
||||||
|
this->ActivateThisDialog();
|
||||||
|
return;
|
||||||
|
}
|
76
src/BooleanGUI/BooleanGUI_SectionDlg.h
Normal file
76
src/BooleanGUI/BooleanGUI_SectionDlg.h
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
// 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 : BooleanGUI_SectionDlg.h
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#ifndef DIALOGBOX_SECTION_H
|
||||||
|
#define DIALOGBOX_SECTION_H
|
||||||
|
|
||||||
|
#include "GEOMBase_Skeleton.h"
|
||||||
|
#include "DlgRef_2Sel_QTD.h"
|
||||||
|
|
||||||
|
#include "BooleanGUI.h"
|
||||||
|
|
||||||
|
#include <BRepAlgoAPI_Section.hxx>
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BooleanGUI_SectionDlg
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
class BooleanGUI_SectionDlg : public GEOMBase_Skeleton
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
BooleanGUI_SectionDlg(QWidget* parent = 0, const char* name = 0, BooleanGUI* theBooleanGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
|
||||||
|
~BooleanGUI_SectionDlg();
|
||||||
|
|
||||||
|
private:
|
||||||
|
void Init();
|
||||||
|
void enterEvent(QEvent* e);
|
||||||
|
|
||||||
|
BooleanGUI* myBooleanGUI;
|
||||||
|
|
||||||
|
TopoDS_Shape myShape1; /* topology used to fuse */
|
||||||
|
TopoDS_Shape myShape2; /* topology used to fuse */
|
||||||
|
GEOM::GEOM_Shape_var myGeomShape1; /* is myShape1 */
|
||||||
|
GEOM::GEOM_Shape_var myGeomShape2; /* is myShape2 */
|
||||||
|
bool myOkShape1; /* to check when arguments are defined */
|
||||||
|
bool myOkShape2;
|
||||||
|
|
||||||
|
DlgRef_2Sel_QTD* GroupSection;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void ClickOnOk();
|
||||||
|
void ClickOnApply();
|
||||||
|
void SetEditCurrentArgument();
|
||||||
|
void SelectionIntoArgument();
|
||||||
|
void LineEditReturnPressed();
|
||||||
|
void ActivateThisDialog();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DIALOGBOX_SECTION_H
|
73
src/BooleanGUI/Makefile.in
Normal file
73
src/BooleanGUI/Makefile.in
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
# GEOM BOOLEANGUI :
|
||||||
|
#
|
||||||
|
# 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 : Makefile.in
|
||||||
|
# Author : Damien COQUERET (OCC)
|
||||||
|
# Module : GEOM
|
||||||
|
# $Header:
|
||||||
|
|
||||||
|
top_srcdir=@top_srcdir@
|
||||||
|
top_builddir=../..
|
||||||
|
srcdir=@srcdir@
|
||||||
|
VPATH=.:@srcdir@:@top_srcdir@/idl
|
||||||
|
|
||||||
|
|
||||||
|
@COMMENCE@
|
||||||
|
|
||||||
|
# header files
|
||||||
|
EXPORT_HEADERS= BooleanGUI.h
|
||||||
|
|
||||||
|
# Libraries targets
|
||||||
|
LIB = libBooleanGUI.la
|
||||||
|
|
||||||
|
LIB_SRC = BooleanGUI.cxx \
|
||||||
|
BooleanGUI_FuseDlg.cxx \
|
||||||
|
BooleanGUI_CommonDlg.cxx \
|
||||||
|
BooleanGUI_CutDlg.cxx \
|
||||||
|
BooleanGUI_SectionDlg.cxx
|
||||||
|
|
||||||
|
LIB_MOC = \
|
||||||
|
BooleanGUI.h \
|
||||||
|
BooleanGUI_FuseDlg.h \
|
||||||
|
BooleanGUI_CommonDlg.h \
|
||||||
|
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_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 += -lOCCViewer -lVTKViewer -lSalomeObject -lSalomeGUI -lGEOMClient -lGEOMObject -lGEOMFiltersSelection -lDlgRef -lGEOMBase $(OCC_KERNEL_LIBS) $(OCC_MODELER_LIBS) -L${KERNEL_ROOT_DIR}/lib/salome
|
||||||
|
|
||||||
|
@CONCLUDE@
|
680
src/BuildGUI/BuildGUI.cxx
Normal file
680
src/BuildGUI/BuildGUI.cxx
Normal file
@ -0,0 +1,680 @@
|
|||||||
|
// 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 : BooleanGUI.cxx
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
#include "BuildGUI.h"
|
||||||
|
|
||||||
|
#include "OCCViewer_Viewer3d.h"
|
||||||
|
#include "VTKViewer_ViewFrame.h"
|
||||||
|
#include "QAD_RightFrame.h"
|
||||||
|
#include "GEOM_AssemblyBuilder.h"
|
||||||
|
#include "SALOMEGUI_ImportOperation.h"
|
||||||
|
|
||||||
|
#include <TopExp_Explorer.hxx>
|
||||||
|
#include <TopoDS_Compound.hxx>
|
||||||
|
#include <BRep_Builder.hxx>
|
||||||
|
|
||||||
|
#include "BuildGUI_SubShapeDlg.h" // Method SUBSHAPE
|
||||||
|
#include "BuildGUI_EdgeDlg.h" // Method EDGE
|
||||||
|
#include "BuildGUI_WireDlg.h" // Method WIRE
|
||||||
|
#include "BuildGUI_FaceDlg.h" // Method FACE
|
||||||
|
#include "BuildGUI_ShellDlg.h" // Method SHELL
|
||||||
|
#include "BuildGUI_SolidDlg.h" // Method SOLID
|
||||||
|
#include "BuildGUI_CompoundDlg.h" // Method COMPOUND
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
// function : BuildGUI()
|
||||||
|
// purpose : Constructor
|
||||||
|
//=======================================================================
|
||||||
|
BuildGUI::BuildGUI() :
|
||||||
|
QObject()
|
||||||
|
{
|
||||||
|
myGeomGUI = GEOMBase_Context::GetGeomGUI();
|
||||||
|
Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM");
|
||||||
|
myGeom = GEOM::GEOM_Gen::_narrow(comp);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
// function : ~BuildGUI()
|
||||||
|
// purpose : Destructor
|
||||||
|
//=======================================================================
|
||||||
|
BuildGUI::~BuildGUI()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
// function : OnGUIEvent()
|
||||||
|
// purpose :
|
||||||
|
//=======================================================================
|
||||||
|
bool BuildGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
||||||
|
{
|
||||||
|
myGeomGUI->EmitSignalDeactivateDialog();
|
||||||
|
SALOME_Selection* Sel = SALOME_Selection::Selection(myGeomGUI->GetActiveStudy()->getSelection());
|
||||||
|
|
||||||
|
switch (theCommandID)
|
||||||
|
{
|
||||||
|
case 303: // EXPLODE : use ic
|
||||||
|
{
|
||||||
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
|
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
|
BuildGUI_SubShapeDlg *aDlg = new BuildGUI_SubShapeDlg(parent, "", this, Sel, ic);
|
||||||
|
break ;
|
||||||
|
}
|
||||||
|
case 304: // GEOM::EDGE
|
||||||
|
{
|
||||||
|
BuildGUI_EdgeDlg *aDlg = new BuildGUI_EdgeDlg(parent, "", this, Sel);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 305: // GEOM::WIRE
|
||||||
|
{
|
||||||
|
BuildGUI_WireDlg *aDlg = new BuildGUI_WireDlg(parent, "", this, Sel);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 306: // GEOM::FACE
|
||||||
|
{
|
||||||
|
BuildGUI_FaceDlg *aDlg = new BuildGUI_FaceDlg(parent, "", this, Sel);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 315: // GEOM::SHELL
|
||||||
|
{
|
||||||
|
BuildGUI_ShellDlg *aDlg = new BuildGUI_ShellDlg(parent, "", this, Sel);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 316: // GEOM::SOLID
|
||||||
|
{
|
||||||
|
BuildGUI_SolidDlg *aDlg = new BuildGUI_SolidDlg(parent, "", this, Sel);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 308: // GEOM::COMPOUND
|
||||||
|
{
|
||||||
|
BuildGUI_CompoundDlg *aDlg = new BuildGUI_CompoundDlg(parent, "", this, Sel);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
parent->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=====================================================================================
|
||||||
|
// function : MakeLinearEdgeAndDisplay()
|
||||||
|
// purpose :
|
||||||
|
//=====================================================================================
|
||||||
|
void BuildGUI::MakeLinearEdgeAndDisplay(const gp_Pnt P1, const gp_Pnt P2)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
GEOM::PointStruct ps1 = myGeom->MakePointStruct(P1.X(), P1.Y(), P1.Z());
|
||||||
|
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"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
result->NameType(tr("GEOM_EDGE"));
|
||||||
|
if(myGeomGUI->Display(result))
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
|
}
|
||||||
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
|
QtCatchCorbaException(S_ex);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=====================================================================================
|
||||||
|
// function : MakeWireAndDisplay()
|
||||||
|
// purpose :
|
||||||
|
//=====================================================================================
|
||||||
|
void BuildGUI::MakeWireAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
GEOM::GEOM_Shape_var result = myGeom->MakeWire(listShapesIOR);
|
||||||
|
if(result->_is_nil()) {
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
result->NameType(tr("GEOM_WIRE"));
|
||||||
|
if(myGeomGUI->Display(result))
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
|
}
|
||||||
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
|
QtCatchCorbaException(S_ex);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=====================================================================================
|
||||||
|
// function : MakeFaceAndDisplay()
|
||||||
|
// purpose :
|
||||||
|
//=====================================================================================
|
||||||
|
void BuildGUI::MakeFaceAndDisplay(GEOM::GEOM_Shape_ptr aWire, const Standard_Boolean wantPlanar)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
GEOM::GEOM_Shape_var result = myGeom->MakeFace(aWire, wantPlanar);
|
||||||
|
if(result->_is_nil()) {
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (wantPlanar)
|
||||||
|
result->NameType(tr("GEOM_PLANE"));
|
||||||
|
else
|
||||||
|
result->NameType(tr("GEOM_FACE"));
|
||||||
|
if(myGeomGUI->Display(result))
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
|
}
|
||||||
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
|
QtCatchCorbaException(S_ex);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=====================================================================================
|
||||||
|
// function : MakeShellAndDisplay()
|
||||||
|
// purpose :
|
||||||
|
//=====================================================================================
|
||||||
|
void BuildGUI::MakeShellAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
GEOM::GEOM_Shape_var result = myGeom->MakeShell(listShapesIOR);
|
||||||
|
if(result->_is_nil()) {
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
result->NameType(tr("GEOM_SHELL"));
|
||||||
|
if(myGeomGUI->Display(result))
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
|
}
|
||||||
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
|
QtCatchCorbaException(S_ex);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=====================================================================================
|
||||||
|
// function : MakeSolidAndDisplay()
|
||||||
|
// purpose :
|
||||||
|
//=====================================================================================
|
||||||
|
void BuildGUI::MakeSolidAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
GEOM::GEOM_Shape_var result = myGeom->MakeSolid(listShapesIOR);
|
||||||
|
if(result->_is_nil()) {
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
result->NameType(tr("GEOM_SOLID"));
|
||||||
|
if(myGeomGUI->Display(result))
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
|
}
|
||||||
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
|
QtCatchCorbaException(S_ex);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=====================================================================================
|
||||||
|
// function : MakeCompoundAndDisplay()
|
||||||
|
// purpose :
|
||||||
|
//=====================================================================================
|
||||||
|
void BuildGUI::MakeCompoundAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
GEOM::GEOM_Shape_var result = myGeom->MakeCompound(listShapesIOR);
|
||||||
|
if(result->_is_nil()) {
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
result->NameType(tr("GEOM_COMPOUND"));
|
||||||
|
if(myGeomGUI->Display(result))
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE"));
|
||||||
|
}
|
||||||
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
|
QtCatchCorbaException(S_ex);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=====================================================================================
|
||||||
|
// function : OnSubShapeGetAll()
|
||||||
|
// purpose : Explode a shape in all sub shapes with a SubShapeType
|
||||||
|
//=====================================================================================
|
||||||
|
bool BuildGUI::OnSubShapeGetAll(const TopoDS_Shape& ShapeTopo, const char* ShapeTopoIOR, const int SubShapeType)
|
||||||
|
{
|
||||||
|
SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
|
||||||
|
SALOMEDS::SObject_var theObj = aStudy->FindObjectIOR(ShapeTopoIOR);
|
||||||
|
if(theObj->_is_nil()) {
|
||||||
|
myGeomGUI->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::GenericAttribute_var anAttr;
|
||||||
|
SALOMEDS::AttributeName_var aName;
|
||||||
|
SALOMEDS::AttributeIOR_var anIOR;
|
||||||
|
SALOMEDS::AttributePixMap_var aPixmap;
|
||||||
|
|
||||||
|
/* We create a sub object for each sub shape as attribute of the main object */
|
||||||
|
/* Each sub object contains list (length=1) containing its index in the main shape */
|
||||||
|
GEOM::GEOM_Shape_var aShape = myGeom->GetIORFromString(ShapeTopoIOR);
|
||||||
|
GEOM::GEOM_Gen::ListOfGeomShapes_var listGeomShapes = new GEOM::GEOM_Gen::ListOfGeomShapes;
|
||||||
|
GEOM::GEOM_Shape_var aResult;
|
||||||
|
|
||||||
|
try {
|
||||||
|
listGeomShapes = myGeom->SubShapeAll(aShape, SubShapeType);
|
||||||
|
if(listGeomShapes->length() < 1) {
|
||||||
|
myGeomGUI->GetDesktop()->putInfo (tr("GEOM_PRP_ABORT"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(const SALOME::SALOME_Exception& S_ex) {
|
||||||
|
QtCatchCorbaException(S_ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* open transaction */
|
||||||
|
QAD_Operation* op = new SALOMEGUI_ImportOperation(myGeomGUI->GetActiveStudy());
|
||||||
|
op->start();
|
||||||
|
|
||||||
|
TopoDS_Shape mainTopo = myGeomGUI->GetShapeReader().GetShape(myGeom, aShape);
|
||||||
|
TopoDS_Shape mainShape;
|
||||||
|
bool main = false;
|
||||||
|
while(!main) {
|
||||||
|
if(aShape->IsMainShape()) {
|
||||||
|
mainShape = myGeomGUI->GetShapeReader().GetShape(myGeom, aShape);
|
||||||
|
main = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
aShape = myGeom->GetIORFromString(aShape->MainName());
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Loop on each sub shape created */
|
||||||
|
/* int i = 1 ; /* index for the nameType */
|
||||||
|
for(int j=0; j<listGeomShapes->length(); j++) {
|
||||||
|
/* Get each sub shape extracted CORBA and OCC */
|
||||||
|
aResult = listGeomShapes[j] ;
|
||||||
|
TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, aResult);
|
||||||
|
|
||||||
|
if (S.IsNull()) {
|
||||||
|
myGeomGUI->GetDesktop()->putInfo (tr("GEOM_PRP_ABORT"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Set the nameType of sub shape */
|
||||||
|
char* nameG = (char *)malloc(20);
|
||||||
|
Standard_CString Type;
|
||||||
|
if(myGeomGUI->GetShapeTypeString(S, Type)) {
|
||||||
|
aResult->NameType(Type);
|
||||||
|
sprintf(nameG, "%s_%d", Type, myGeomGUI->GetIndex(S, mainShape, SubShapeType));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
aResult->NameType(tr("GEOM_SHAPE"));
|
||||||
|
sprintf(nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->GetNbGeom()++);
|
||||||
|
}
|
||||||
|
SALOMEDS::SObject_var SO = aStudy->FindObjectIOR(aResult->Name());
|
||||||
|
|
||||||
|
bool allreadyexist = false;
|
||||||
|
|
||||||
|
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
|
||||||
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
|
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
|
|
||||||
|
Handle(GEOM_AISShape) result = new GEOM_AISShape(S, nameG);
|
||||||
|
Handle(GEOM_InteractiveObject) IO = new GEOM_InteractiveObject(aResult->Name(), myGeomGUI->GetFatherior(), "GEOM");
|
||||||
|
|
||||||
|
MESSAGE ("SO->_is_nil() " << SO->_is_nil())
|
||||||
|
|
||||||
|
if(SO->_is_nil()) {
|
||||||
|
SALOMEDS::SObject_var newObj = aStudyBuilder->NewObject(theObj);
|
||||||
|
anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeName");
|
||||||
|
aName = SALOMEDS::AttributeName::_narrow(anAttr);
|
||||||
|
aName->SetValue(nameG);
|
||||||
|
anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeIOR");
|
||||||
|
anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
|
||||||
|
anIOR->SetValue(aResult->Name());
|
||||||
|
|
||||||
|
anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributePixMap");
|
||||||
|
aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
|
||||||
|
MESSAGE( " Type " << S.ShapeType() )
|
||||||
|
if ( S.ShapeType() == TopAbs_COMPOUND ) {
|
||||||
|
aPixmap->SetPixMap( "ICON_OBJBROWSER_COMPOUND" );
|
||||||
|
} else if ( S.ShapeType() == TopAbs_COMPSOLID ) {
|
||||||
|
aPixmap->SetPixMap( "ICON_OBJBROWSER_COMPSOLID" );
|
||||||
|
} else if ( S.ShapeType() == TopAbs_SOLID ) {
|
||||||
|
aPixmap->SetPixMap( "ICON_OBJBROWSER_SOLID" );
|
||||||
|
} else if ( S.ShapeType() == TopAbs_SHELL ) {
|
||||||
|
aPixmap->SetPixMap( "ICON_OBJBROWSER_SHELL" );
|
||||||
|
} else if ( S.ShapeType() == TopAbs_FACE ) {
|
||||||
|
aPixmap->SetPixMap( "ICON_OBJBROWSER_FACE" );
|
||||||
|
} else if ( S.ShapeType() == TopAbs_WIRE ) {
|
||||||
|
aPixmap->SetPixMap( "ICON_OBJBROWSER_WIRE" );
|
||||||
|
} else if ( S.ShapeType() == TopAbs_EDGE ) {
|
||||||
|
aPixmap->SetPixMap( "ICON_OBJBROWSER_EDGE" );
|
||||||
|
} else if ( S.ShapeType() == TopAbs_VERTEX ) {
|
||||||
|
aPixmap->SetPixMap( "ICON_OBJBROWSER_VERTEX" );
|
||||||
|
}
|
||||||
|
|
||||||
|
MESSAGE ( " aPixmap->GetPixMap " << aPixmap->GetPixMap() )
|
||||||
|
|
||||||
|
SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(fatherSF);
|
||||||
|
aStudyBuilder->Addreference(newObj1, newObj);
|
||||||
|
IO->setEntry(newObj->GetID());
|
||||||
|
|
||||||
|
aResult->StudyShapeId( newObj->GetID() );
|
||||||
|
} else {
|
||||||
|
allreadyexist = true;
|
||||||
|
if ( !myGeomGUI->SObjectExist(theObj, aResult->Name()) ) {
|
||||||
|
SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(theObj);
|
||||||
|
aStudyBuilder->Addreference(newObj1, SO);
|
||||||
|
IO->setEntry(SO->GetID());
|
||||||
|
aResult->StudyShapeId( SO->GetID() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
result->setIO( IO );
|
||||||
|
result->setName( nameG );
|
||||||
|
if ( !allreadyexist )
|
||||||
|
ic->Display(result);
|
||||||
|
|
||||||
|
} else if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK ) {
|
||||||
|
VTKViewer_RenderWindowInteractor* myRenderInter= ((VTKViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
|
||||||
|
|
||||||
|
int themode = myRenderInter->GetDisplayMode();
|
||||||
|
vtkRenderer *theRenderer = ((VTKViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRenderer();
|
||||||
|
vtkRenderWindow *renWin = theRenderer->GetRenderWindow();
|
||||||
|
|
||||||
|
Handle(GEOM_InteractiveObject) IO = new GEOM_InteractiveObject(aResult->Name(), myGeomGUI->GetFatherior(),"GEOM");
|
||||||
|
|
||||||
|
if ( SO->_is_nil() ) {
|
||||||
|
SALOMEDS::SObject_var newObj = aStudyBuilder->NewObject( theObj );
|
||||||
|
anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeIOR");
|
||||||
|
anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
|
||||||
|
anIOR->SetValue(aResult->Name());
|
||||||
|
anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeName");
|
||||||
|
aName = SALOMEDS::AttributeName::_narrow(anAttr);
|
||||||
|
aName->SetValue(nameG);
|
||||||
|
|
||||||
|
anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributePixMap");
|
||||||
|
aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
|
||||||
|
if ( S.ShapeType() == TopAbs_COMPOUND ) {
|
||||||
|
aPixmap->SetPixMap( "ICON_OBJBROWSER_COMPOUND" );
|
||||||
|
} else if ( S.ShapeType() == TopAbs_COMPSOLID ) {
|
||||||
|
aPixmap->SetPixMap( "ICON_OBJBROWSER_COMPSOLID" );
|
||||||
|
} else if ( S.ShapeType() == TopAbs_SOLID ) {
|
||||||
|
aPixmap->SetPixMap( "ICON_OBJBROWSER_SOLID" );
|
||||||
|
} else if ( S.ShapeType() == TopAbs_SHELL ) {
|
||||||
|
aPixmap->SetPixMap( "ICON_OBJBROWSER_SHELL" );
|
||||||
|
} else if ( S.ShapeType() == TopAbs_FACE ) {
|
||||||
|
aPixmap->SetPixMap( "ICON_OBJBROWSER_FACE" );
|
||||||
|
} else if ( S.ShapeType() == TopAbs_WIRE ) {
|
||||||
|
aPixmap->SetPixMap( "ICON_OBJBROWSER_WIRE" );
|
||||||
|
} else if ( S.ShapeType() == TopAbs_EDGE ) {
|
||||||
|
aPixmap->SetPixMap( "ICON_OBJBROWSER_EDGE" );
|
||||||
|
} else if ( S.ShapeType() == TopAbs_VERTEX ) {
|
||||||
|
aPixmap->SetPixMap( "ICON_OBJBROWSER_VERTEX" );
|
||||||
|
}
|
||||||
|
|
||||||
|
SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(fatherSF);
|
||||||
|
aStudyBuilder->Addreference(newObj1, newObj);
|
||||||
|
IO->setEntry(newObj->GetID());
|
||||||
|
} else {
|
||||||
|
allreadyexist = true;
|
||||||
|
if ( !myGeomGUI->SObjectExist(theObj, aResult->Name()) ) {
|
||||||
|
SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(theObj);
|
||||||
|
aStudyBuilder->Addreference(newObj1, SO);
|
||||||
|
IO->setEntry(SO->GetID());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !allreadyexist ) {
|
||||||
|
vtkActorCollection* theActors =
|
||||||
|
GEOM_AssemblyBuilder::BuildActors(S,0,themode,Standard_True);
|
||||||
|
theActors->InitTraversal();
|
||||||
|
vtkActor* anActor = (vtkActor*)theActors->GetNextActor();
|
||||||
|
while(!(anActor==NULL)) {
|
||||||
|
GEOM_Actor* GActor = GEOM_Actor::SafeDownCast( anActor );
|
||||||
|
GActor->setIO( IO );
|
||||||
|
GActor->setName( nameG );
|
||||||
|
theRenderer->AddActor(GActor);
|
||||||
|
renWin->Render();
|
||||||
|
anActor = (vtkActor*)theActors->GetNextActor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* commit transaction */
|
||||||
|
op->finish();
|
||||||
|
|
||||||
|
myGeomGUI->GetActiveStudy()->updateObjBrowser();
|
||||||
|
myGeomGUI->GetDesktop()->putInfo (tr("GEOM_PRP_READY"));
|
||||||
|
return true ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=====================================================================================
|
||||||
|
// function : OnSubShapeGetSelected()
|
||||||
|
// purpose :
|
||||||
|
//=====================================================================================
|
||||||
|
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 ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
SALOMEDS::Study_var aStudy = myGeomGUI->GetActiveStudy()->getStudyDocument();
|
||||||
|
SALOMEDS::SObject_var theObj = aStudy->FindObjectIOR( ShapeTopoIOR );
|
||||||
|
if ( theObj->_is_nil() ) {
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
|
||||||
|
return false ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
|
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
|
||||||
|
|
||||||
|
if( myUseLocalContext == false ) {
|
||||||
|
/* local context is from DialogBox */
|
||||||
|
MESSAGE("Error : No local context opened for sub shapes method" << endl ) ;
|
||||||
|
return false ;
|
||||||
|
}
|
||||||
|
|
||||||
|
GEOM::GEOM_Shape_var aShape = myGeom->GetIORFromString( ShapeTopoIOR );
|
||||||
|
TopoDS_Shape mainTopo = myGeomGUI->GetShapeReader().GetShape(myGeom, aShape);
|
||||||
|
|
||||||
|
TopoDS_Shape mainShape;
|
||||||
|
bool main = false;
|
||||||
|
while ( !main ) {
|
||||||
|
if ( aShape->IsMainShape() ) {
|
||||||
|
mainShape = myGeomGUI->GetShapeReader().GetShape(myGeom, aShape);
|
||||||
|
main = true;
|
||||||
|
} else
|
||||||
|
aShape = myGeom->GetIORFromString( aShape->MainName() );
|
||||||
|
}
|
||||||
|
|
||||||
|
GEOM::GEOM_Shape::ListOfSubShapeID_var ListOfID = new GEOM::GEOM_Shape::ListOfSubShapeID;
|
||||||
|
ic->InitSelected();
|
||||||
|
int nbSelected = ic->NbSelected();
|
||||||
|
ListOfID->length(nbSelected);
|
||||||
|
|
||||||
|
TopoDS_Compound compound;
|
||||||
|
ic->InitSelected(); /* to init again */
|
||||||
|
BRep_Builder B;
|
||||||
|
B.MakeCompound( compound );
|
||||||
|
|
||||||
|
int i = 0;
|
||||||
|
/* We create a unique compound containing all the sub shapes selected by user as attribute of the main shape */
|
||||||
|
/* the compound is homogenous by selection */
|
||||||
|
while(ic->MoreSelected()) {
|
||||||
|
int index = myGeomGUI->GetIndex( ic->SelectedShape(), mainShape, SubShapeType );
|
||||||
|
ListOfID[i] = index ;
|
||||||
|
B.Add( compound, ic->SelectedShape() );
|
||||||
|
i++;
|
||||||
|
ic->NextSelected();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Test if user has selected sub shapes */
|
||||||
|
if( ListOfID->length() < 1 )
|
||||||
|
return false ;
|
||||||
|
|
||||||
|
GEOM::GEOM_Shape_var aResult ;
|
||||||
|
try {
|
||||||
|
aResult = myGeom->SubShape( aShape, SubShapeType, ListOfID );
|
||||||
|
}
|
||||||
|
catch (const SALOME::SALOME_Exception& S_ex) {
|
||||||
|
QtCatchCorbaException(S_ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* local context from DialogBox */
|
||||||
|
ic->CloseLocalContext(aLocalContextId) ;
|
||||||
|
myUseLocalContext = false ;
|
||||||
|
|
||||||
|
char* nameG = (char *)malloc(20);
|
||||||
|
Standard_CString Type;
|
||||||
|
|
||||||
|
Handle(GEOM_AISShape) result;
|
||||||
|
Handle(GEOM_InteractiveObject) IO ;
|
||||||
|
|
||||||
|
// if ( !myGeomGUI->SObjectExist(theObj, aResult->Name()) ) {
|
||||||
|
if ( nbSelected == 1 ) {
|
||||||
|
TopExp_Explorer Exp ( compound, TopAbs_ShapeEnum(SubShapeType) );
|
||||||
|
if ( Exp.More() ) {
|
||||||
|
if ( myGeomGUI->GetShapeTypeString(Exp.Current(),Type) ) {
|
||||||
|
aResult->NameType( Type );
|
||||||
|
sprintf (nameG, "%s_%d", Type, myGeomGUI->GetIndex( Exp.Current(), mainTopo, SubShapeType ) );
|
||||||
|
} else {
|
||||||
|
aResult->NameType( tr("GEOM_SHAPE") );
|
||||||
|
sprintf (nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->GetNbGeom()++ );
|
||||||
|
}
|
||||||
|
result = new GEOM_AISShape( Exp.Current(), nameG );
|
||||||
|
IO = new GEOM_InteractiveObject(aResult->Name(), myGeomGUI->GetFatherior(), "GEOM");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if ( myGeomGUI->GetShapeTypeString(compound,Type) ) {
|
||||||
|
aResult->NameType( Type );
|
||||||
|
sprintf (nameG, "%s_%d", Type, myGeomGUI->GetNbGeom()++ );
|
||||||
|
} else {
|
||||||
|
aResult->NameType( tr("GEOM_SHAPE") );
|
||||||
|
sprintf (nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->GetNbGeom()++ );
|
||||||
|
}
|
||||||
|
result = new GEOM_AISShape( compound, nameG );
|
||||||
|
IO = new GEOM_InteractiveObject(aResult->Name(), myGeomGUI->GetFatherior(), "GEOM");
|
||||||
|
}
|
||||||
|
|
||||||
|
SALOMEDS::SObject_var SO = aStudy->FindObjectIOR( aResult->Name() );
|
||||||
|
|
||||||
|
/* open transaction */
|
||||||
|
QAD_Operation* op = new SALOMEGUI_ImportOperation( myGeomGUI->GetActiveStudy() );
|
||||||
|
op->start();
|
||||||
|
|
||||||
|
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
|
||||||
|
SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->entry());
|
||||||
|
SALOMEDS::GenericAttribute_var anAttr;
|
||||||
|
SALOMEDS::AttributeName_var aName;
|
||||||
|
SALOMEDS::AttributeIOR_var anIOR;
|
||||||
|
SALOMEDS::AttributePixMap_var aPixmap;
|
||||||
|
|
||||||
|
bool allreadyexist = false;
|
||||||
|
|
||||||
|
if ( SO->_is_nil() ) {
|
||||||
|
SALOMEDS::SObject_var newObj = aStudyBuilder->NewObject( theObj );
|
||||||
|
anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeIOR");
|
||||||
|
anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
|
||||||
|
anIOR->SetValue(aResult->Name());
|
||||||
|
anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeName");
|
||||||
|
aName = SALOMEDS::AttributeName::_narrow(anAttr);
|
||||||
|
aName->SetValue(result->getName());
|
||||||
|
|
||||||
|
anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributePixMap");
|
||||||
|
aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
|
||||||
|
if ( result->Shape().ShapeType() == TopAbs_COMPOUND ) {
|
||||||
|
aPixmap->SetPixMap( "ICON_OBJBROWSER_COMPOUND" );
|
||||||
|
} else if ( result->Shape().ShapeType() == TopAbs_COMPSOLID ) {
|
||||||
|
aPixmap->SetPixMap( "ICON_OBJBROWSER_COMPSOLID" );
|
||||||
|
} else if ( result->Shape().ShapeType() == TopAbs_SOLID ) {
|
||||||
|
aPixmap->SetPixMap( "ICON_OBJBROWSER_SOLID" );
|
||||||
|
} else if ( result->Shape().ShapeType() == TopAbs_SHELL ) {
|
||||||
|
aPixmap->SetPixMap( "ICON_OBJBROWSER_SHELL" );
|
||||||
|
} else if ( result->Shape().ShapeType() == TopAbs_FACE ) {
|
||||||
|
aPixmap->SetPixMap( "ICON_OBJBROWSER_FACE" );
|
||||||
|
} else if ( result->Shape().ShapeType() == TopAbs_WIRE ) {
|
||||||
|
aPixmap->SetPixMap( "ICON_OBJBROWSER_WIRE" );
|
||||||
|
} else if ( result->Shape().ShapeType() == TopAbs_EDGE ) {
|
||||||
|
aPixmap->SetPixMap( "ICON_OBJBROWSER_EDGE" );
|
||||||
|
} else if ( result->Shape().ShapeType() == TopAbs_VERTEX ) {
|
||||||
|
aPixmap->SetPixMap( "ICON_OBJBROWSER_VERTEX" );
|
||||||
|
}
|
||||||
|
|
||||||
|
SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(fatherSF);
|
||||||
|
aStudyBuilder->Addreference(newObj1, newObj);
|
||||||
|
|
||||||
|
IO->setEntry(newObj->GetID());
|
||||||
|
aResult->StudyShapeId(newObj->GetID());
|
||||||
|
} else {
|
||||||
|
allreadyexist = true;
|
||||||
|
if ( !myGeomGUI->SObjectExist(theObj, aResult->Name()) ) {
|
||||||
|
SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(theObj);
|
||||||
|
aStudyBuilder->Addreference(newObj1, SO);
|
||||||
|
|
||||||
|
IO->setEntry(SO->GetID());
|
||||||
|
aResult->StudyShapeId(SO->GetID());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* commit transaction */
|
||||||
|
op->finish();
|
||||||
|
|
||||||
|
result->setIO( IO );
|
||||||
|
result->setName( nameG );
|
||||||
|
|
||||||
|
if ( !allreadyexist )
|
||||||
|
ic->Display(result);
|
||||||
|
|
||||||
|
GEOMBase_Display* myDisplayGUI = new GEOMBase_Display();
|
||||||
|
myDisplayGUI->OnDisplayAll(true);
|
||||||
|
|
||||||
|
myGeomGUI->GetActiveStudy()->updateObjBrowser();
|
||||||
|
myGeomGUI->GetDesktop()->putInfo (tr("GEOM_PRP_READY"));
|
||||||
|
return true;
|
||||||
|
}
|
66
src/BuildGUI/BuildGUI.h
Normal file
66
src/BuildGUI/BuildGUI.h
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
// 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 : BuildGUI.h
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#ifndef BUILDGUI_H
|
||||||
|
#define BUILDGUI_H
|
||||||
|
|
||||||
|
#include "GEOMBase_Display.h"
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BuildGUI
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
class BuildGUI : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT /* for QT compatibility */
|
||||||
|
|
||||||
|
public :
|
||||||
|
BuildGUI();
|
||||||
|
~BuildGUI();
|
||||||
|
|
||||||
|
bool OnGUIEvent(int theCommandID, QAD_Desktop* parent);
|
||||||
|
|
||||||
|
void MakeLinearEdgeAndDisplay(const gp_Pnt P1, const gp_Pnt P2);
|
||||||
|
void MakeWireAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR);
|
||||||
|
void MakeFaceAndDisplay(GEOM::GEOM_Shape_ptr aWire, const Standard_Boolean wantPlanar);
|
||||||
|
void MakeShellAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR);
|
||||||
|
void MakeSolidAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR);
|
||||||
|
void MakeCompoundAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR);
|
||||||
|
|
||||||
|
/* Methods for sub shapes explode */
|
||||||
|
bool OnSubShapeGetAll(const TopoDS_Shape& ShapeTopo, const char* ShapeTopoIOR, const int SubShapeType);
|
||||||
|
bool OnSubShapeGetSelected(const TopoDS_Shape& ShapeTopo, const char* ShapeTopoIOR, const int SubShapeType,
|
||||||
|
Standard_Integer& aLocalContextId, bool& myUseLocalContext);
|
||||||
|
|
||||||
|
private:
|
||||||
|
GEOMBase_Context* myGeomGUI;
|
||||||
|
GEOM::GEOM_Gen_var myGeom; /* Current Geom Component */
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
370
src/BuildGUI/BuildGUI_CompoundDlg.cxx
Normal file
370
src/BuildGUI/BuildGUI_CompoundDlg.cxx
Normal file
@ -0,0 +1,370 @@
|
|||||||
|
// 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 : BuildGUI_CompoundDlg.cxx
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
#include "BuildGUI_CompoundDlg.h"
|
||||||
|
|
||||||
|
#include <qbuttongroup.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <qlineedit.h>
|
||||||
|
#include <qpushbutton.h>
|
||||||
|
#include <qradiobutton.h>
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qtooltip.h>
|
||||||
|
#include <qwhatsthis.h>
|
||||||
|
#include <qimage.h>
|
||||||
|
#include <qpixmap.h>
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BuildGUI_CompoundDlg()
|
||||||
|
// purpose : Constructs a BuildGUI_CompoundDlg which is a child of 'parent', with the
|
||||||
|
// name 'name' and widget flags set to 'f'.
|
||||||
|
// The dialog will by default be modeless, unless you set 'modal' to
|
||||||
|
// TRUE to construct a modal dialog.
|
||||||
|
//=================================================================================
|
||||||
|
BuildGUI_CompoundDlg::BuildGUI_CompoundDlg(QWidget* parent, const char* name, BuildGUI* theBuildGUI, SALOME_Selection* Sel, bool modal, WFlags fl)
|
||||||
|
: QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
|
||||||
|
{
|
||||||
|
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_BUILD_COMPOUND")));
|
||||||
|
QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT")));
|
||||||
|
if ( !name )
|
||||||
|
setName( "BuildGUI_CompoundDlg" );
|
||||||
|
resize( 303, 175 );
|
||||||
|
setCaption( tr( "GEOM_COMPOUND_TITLE" ) );
|
||||||
|
setSizeGripEnabled( TRUE );
|
||||||
|
BuildGUI_CompoundDlgLayout = new QGridLayout( this );
|
||||||
|
BuildGUI_CompoundDlgLayout->setSpacing( 6 );
|
||||||
|
BuildGUI_CompoundDlgLayout->setMargin( 11 );
|
||||||
|
|
||||||
|
/***************************************************************/
|
||||||
|
GroupConstructors = new QButtonGroup( this, "GroupConstructors" );
|
||||||
|
GroupConstructors->setTitle( tr( "GEOM_COMPOUND" ) );
|
||||||
|
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( image1 );
|
||||||
|
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 );
|
||||||
|
BuildGUI_CompoundDlgLayout->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 );
|
||||||
|
BuildGUI_CompoundDlgLayout->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 );
|
||||||
|
TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" );
|
||||||
|
TextLabelC1A1->setText( tr( "GEOM_OBJECTS" ) );
|
||||||
|
TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) );
|
||||||
|
TextLabelC1A1->setFrameShape( QLabel::NoFrame );
|
||||||
|
TextLabelC1A1->setFrameShadow( QLabel::Plain );
|
||||||
|
GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 );
|
||||||
|
SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" );
|
||||||
|
SelectButtonC1A1->setText( tr( "" ) );
|
||||||
|
SelectButtonC1A1->setPixmap( image0 );
|
||||||
|
SelectButtonC1A1->setToggleButton( FALSE );
|
||||||
|
GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 );
|
||||||
|
LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" );
|
||||||
|
GroupC1Layout->addWidget( LineEditC1A1, 0, 2 );
|
||||||
|
BuildGUI_CompoundDlgLayout->addWidget( GroupC1, 1, 0 );
|
||||||
|
/***************************************************************/
|
||||||
|
myBuildGUI = theBuildGUI;
|
||||||
|
Init(Sel) ; /* Initialisations */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ~BuildGUI_CompoundDlg()
|
||||||
|
// purpose : Destroys the object and frees any allocated resources
|
||||||
|
//=================================================================================
|
||||||
|
BuildGUI_CompoundDlg::~BuildGUI_CompoundDlg()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : Init()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_CompoundDlg::Init( SALOME_Selection* Sel )
|
||||||
|
{
|
||||||
|
|
||||||
|
GroupC1->show();
|
||||||
|
myConstructorId = 0 ;
|
||||||
|
Constructor1->setChecked( TRUE );
|
||||||
|
myEditCurrentArgument = LineEditC1A1 ;
|
||||||
|
mySelection = Sel;
|
||||||
|
this->myOkListShapes = false ;
|
||||||
|
myGeomGUI = GEOMBase_Context::GetGeomGUI() ;
|
||||||
|
myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ;
|
||||||
|
|
||||||
|
// TODO : previous selection into argument ?
|
||||||
|
|
||||||
|
/* Filter definitions */
|
||||||
|
Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM");
|
||||||
|
myGeom = GEOM::GEOM_Gen::_narrow(comp);
|
||||||
|
|
||||||
|
/* signals and slots connections */
|
||||||
|
connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
|
||||||
|
connect( buttonApply, SIGNAL( clicked() ), this, SLOT(ClickOnApply() ) );
|
||||||
|
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ;
|
||||||
|
connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) );
|
||||||
|
|
||||||
|
connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
|
||||||
|
connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ;
|
||||||
|
/* 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 ;
|
||||||
|
myGeomGUI->DefineDlgPosition( this, x, y ) ;
|
||||||
|
this->move( x, y ) ;
|
||||||
|
this->show() ; /* displays Dialog */
|
||||||
|
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ConstructorsClicked()
|
||||||
|
// purpose : Radio button management
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_CompoundDlg::ConstructorsClicked(int constructorId)
|
||||||
|
{
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnOk()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_CompoundDlg::ClickOnOk()
|
||||||
|
{
|
||||||
|
this->ClickOnApply() ;
|
||||||
|
this->ClickOnCancel() ;
|
||||||
|
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnApply()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_CompoundDlg::ClickOnApply()
|
||||||
|
{
|
||||||
|
switch(myConstructorId)
|
||||||
|
{
|
||||||
|
case 0 :
|
||||||
|
{
|
||||||
|
if(myOkListShapes) {
|
||||||
|
myBuildGUI->MakeCompoundAndDisplay( myListShapes ) ;
|
||||||
|
}
|
||||||
|
break ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// accept();
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnCancel()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_CompoundDlg::ClickOnCancel()
|
||||||
|
{
|
||||||
|
disconnect( mySelection, 0, this, 0 );
|
||||||
|
myGeomGUI->ResetState() ;
|
||||||
|
reject() ;
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SelectionIntoArgument()
|
||||||
|
// purpose : Called when selection as changed or other case
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_CompoundDlg::SelectionIntoArgument()
|
||||||
|
{
|
||||||
|
/* All this for first constructor */
|
||||||
|
// if(myEditCurrentArgument == LineEditC1A1 )
|
||||||
|
|
||||||
|
myOkListShapes = false;
|
||||||
|
myEditCurrentArgument->setText("") ;
|
||||||
|
QString aString = ""; /* name of selection */
|
||||||
|
|
||||||
|
int nbSel = mySelection->IObjectCount() ;
|
||||||
|
if ( nbSel == 0 )
|
||||||
|
return;
|
||||||
|
aString = tr( "%1_objects" ).arg( nbSel );
|
||||||
|
|
||||||
|
myGeomGUI->ConvertListOfIOInListOfIOR(mySelection->StoredIObjects(), myListShapes) ;
|
||||||
|
myEditCurrentArgument->setText(aString) ;
|
||||||
|
myOkListShapes = true ;
|
||||||
|
/* no simulation */
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SetEditCurrentArgument()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_CompoundDlg::SetEditCurrentArgument()
|
||||||
|
{
|
||||||
|
QPushButton* send = (QPushButton*)sender();
|
||||||
|
switch (myConstructorId)
|
||||||
|
{
|
||||||
|
case 0: /* default constructor */
|
||||||
|
{
|
||||||
|
if(send == SelectButtonC1A1) {
|
||||||
|
LineEditC1A1->setFocus() ;
|
||||||
|
myEditCurrentArgument = LineEditC1A1;
|
||||||
|
}
|
||||||
|
SelectionIntoArgument() ;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : LineEditReturnPressed()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_CompoundDlg::LineEditReturnPressed()
|
||||||
|
{
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : DeactivateActiveDialog()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_CompoundDlg::DeactivateActiveDialog()
|
||||||
|
{
|
||||||
|
if ( GroupConstructors->isEnabled() ) {
|
||||||
|
disconnect( mySelection, 0, this, 0 );
|
||||||
|
GroupConstructors->setEnabled(false) ;
|
||||||
|
GroupC1->setEnabled(false) ;
|
||||||
|
GroupButtons->setEnabled(false) ;
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ActivateThisDialog()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_CompoundDlg::ActivateThisDialog()
|
||||||
|
{
|
||||||
|
/* Emit a signal to deactivate the active dialog */
|
||||||
|
myGeomGUI->EmitSignalDeactivateDialog() ;
|
||||||
|
GroupConstructors->setEnabled(true) ;
|
||||||
|
GroupC1->setEnabled(true) ;
|
||||||
|
GroupButtons->setEnabled(true) ;
|
||||||
|
connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : enterEvent()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_CompoundDlg::enterEvent(QEvent* e)
|
||||||
|
{
|
||||||
|
if ( GroupConstructors->isEnabled() )
|
||||||
|
return ;
|
||||||
|
ActivateThisDialog() ;
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : closeEvent()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_CompoundDlg::closeEvent( QCloseEvent* e )
|
||||||
|
{
|
||||||
|
/* same than click on cancel button */
|
||||||
|
this->ClickOnCancel() ;
|
||||||
|
return ;
|
||||||
|
}
|
104
src/BuildGUI/BuildGUI_CompoundDlg.h
Normal file
104
src/BuildGUI/BuildGUI_CompoundDlg.h
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
// 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 : GEOMBase_Context*_CompoundDlg.h
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
#ifndef DIALOGBOX_COMPOUND_H
|
||||||
|
#define DIALOGBOX_COMPOUND_H
|
||||||
|
|
||||||
|
#include "BuildGUI.h"
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qdialog.h>
|
||||||
|
|
||||||
|
class QVBoxLayout;
|
||||||
|
class QHBoxLayout;
|
||||||
|
class QGridLayout;
|
||||||
|
class QButtonGroup;
|
||||||
|
class QGroupBox;
|
||||||
|
class QLabel;
|
||||||
|
class QLineEdit;
|
||||||
|
class QPushButton;
|
||||||
|
class QRadioButton;
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BuildGUI_CompoundDlg
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
class BuildGUI_CompoundDlg : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
BuildGUI_CompoundDlg(QWidget* parent = 0, const char* name = 0, BuildGUI* theBuildGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
|
||||||
|
~BuildGUI_CompoundDlg();
|
||||||
|
|
||||||
|
private:
|
||||||
|
BuildGUI* myBuildGUI;
|
||||||
|
void Init( SALOME_Selection* Sel ) ;
|
||||||
|
void closeEvent( QCloseEvent* e ) ;
|
||||||
|
void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */
|
||||||
|
|
||||||
|
GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */
|
||||||
|
GEOMBase_Context* myGeomGUI ; /* Current GeomGUI object */
|
||||||
|
SALOME_Selection* mySelection ; /* User shape selection */
|
||||||
|
GEOM::GEOM_Gen::ListOfIOR myListShapes ;
|
||||||
|
bool myOkListShapes ; /* to check when arguments is defined */
|
||||||
|
int myConstructorId ; /* Current constructor id = radio button id */
|
||||||
|
QLineEdit* myEditCurrentArgument; /* Current LineEdit */
|
||||||
|
|
||||||
|
QButtonGroup* GroupConstructors;
|
||||||
|
QRadioButton* Constructor1;
|
||||||
|
QGroupBox* GroupButtons;
|
||||||
|
QPushButton* buttonOk;
|
||||||
|
QPushButton* buttonCancel;
|
||||||
|
QPushButton* buttonApply;
|
||||||
|
QGroupBox* GroupC1;
|
||||||
|
QLabel* TextLabelC1A1;
|
||||||
|
QPushButton* SelectButtonC1A1;
|
||||||
|
QLineEdit* LineEditC1A1;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
|
||||||
|
void ConstructorsClicked(int constructorId);
|
||||||
|
void ClickOnOk();
|
||||||
|
void ClickOnCancel();
|
||||||
|
void ClickOnApply();
|
||||||
|
void SetEditCurrentArgument() ;
|
||||||
|
void LineEditReturnPressed() ;
|
||||||
|
void SelectionIntoArgument() ;
|
||||||
|
void DeactivateActiveDialog() ;
|
||||||
|
void ActivateThisDialog() ;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QGridLayout* BuildGUI_CompoundDlgLayout;
|
||||||
|
QGridLayout* GroupConstructorsLayout;
|
||||||
|
QGridLayout* GroupButtonsLayout;
|
||||||
|
QGridLayout* GroupC1Layout;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DIALOGBOX_COMPOUND_H
|
457
src/BuildGUI/BuildGUI_EdgeDlg.cxx
Normal file
457
src/BuildGUI/BuildGUI_EdgeDlg.cxx
Normal file
@ -0,0 +1,457 @@
|
|||||||
|
// 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 : BuildGUI_EdgeDlg.cxx
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
#include "BuildGUI_EdgeDlg.h"
|
||||||
|
|
||||||
|
#include <qbuttongroup.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <qlineedit.h>
|
||||||
|
#include <qpushbutton.h>
|
||||||
|
#include <qradiobutton.h>
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qtooltip.h>
|
||||||
|
#include <qwhatsthis.h>
|
||||||
|
#include <qimage.h>
|
||||||
|
#include <qpixmap.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BuildGUI_EdgeDlg()
|
||||||
|
// purpose : Constructs a BuildGUI_EdgeDlg which is a child of 'parent', with the
|
||||||
|
// name 'name' and widget flags set to 'f'.
|
||||||
|
// The dialog will by default be modeless, unless you set 'modal' to
|
||||||
|
// TRUE to construct a modal dialog.
|
||||||
|
//=================================================================================
|
||||||
|
BuildGUI_EdgeDlg::BuildGUI_EdgeDlg(QWidget* parent, const char* name, BuildGUI* theBuildGUI, SALOME_Selection* Sel, bool modal, WFlags fl)
|
||||||
|
: QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
|
||||||
|
{
|
||||||
|
QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_BUILD_EDGE")));
|
||||||
|
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT")));
|
||||||
|
|
||||||
|
if ( !name )
|
||||||
|
setName( "BuildGUI_EdgeDlg" );
|
||||||
|
resize( 303, 225 );
|
||||||
|
setCaption( tr( "GEOM_EDGE_TITLE" ) );
|
||||||
|
setSizeGripEnabled( TRUE );
|
||||||
|
BuildGUI_EdgeDlgLayout = new QGridLayout( this );
|
||||||
|
BuildGUI_EdgeDlgLayout->setSpacing( 6 );
|
||||||
|
BuildGUI_EdgeDlgLayout->setMargin( 11 );
|
||||||
|
|
||||||
|
/***************************************************************/
|
||||||
|
GroupConstructors = new QButtonGroup( this, "GroupConstructors" );
|
||||||
|
GroupConstructors->setTitle( tr( "GEOM_EDGE" ) );
|
||||||
|
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 );
|
||||||
|
BuildGUI_EdgeDlgLayout->addWidget( GroupConstructors, 0, 0 );
|
||||||
|
|
||||||
|
/***************************************************************/
|
||||||
|
GroupC1 = new QGroupBox( this, "GroupC1" );
|
||||||
|
GroupC1->setTitle( tr( "GEOM_POINTS" ) );
|
||||||
|
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 );
|
||||||
|
SelectButtonC1A2 = new QPushButton( GroupC1, "SelectButtonC1A2" );
|
||||||
|
SelectButtonC1A2->setText( tr( "" ) );
|
||||||
|
SelectButtonC1A2->setPixmap( image1 );
|
||||||
|
GroupC1Layout->addWidget( SelectButtonC1A2, 1, 1 );
|
||||||
|
LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" );
|
||||||
|
GroupC1Layout->addWidget( LineEditC1A1, 0, 2 );
|
||||||
|
LineEditC1A2 = new QLineEdit( GroupC1, "LineEditC1A2" );
|
||||||
|
GroupC1Layout->addWidget( LineEditC1A2, 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_POINT_I" ).arg("1") );
|
||||||
|
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_POINT_I" ).arg("2") );
|
||||||
|
TextLabelC1A2->setMinimumSize( QSize( 50, 0 ) );
|
||||||
|
GroupC1Layout->addWidget( TextLabelC1A2, 1, 0 );
|
||||||
|
BuildGUI_EdgeDlgLayout->addWidget( GroupC1, 1, 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 );
|
||||||
|
BuildGUI_EdgeDlgLayout->addWidget( GroupButtons, 2, 0 );
|
||||||
|
/***************************************************************/
|
||||||
|
myBuildGUI = theBuildGUI;
|
||||||
|
Init(Sel) ; /* Initialisations */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ~BuildGUI_EdgeDlg()
|
||||||
|
// purpose : Destroys the object and frees any allocated resources
|
||||||
|
//=================================================================================
|
||||||
|
BuildGUI_EdgeDlg::~BuildGUI_EdgeDlg()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : Init()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_EdgeDlg::Init( SALOME_Selection* Sel )
|
||||||
|
{
|
||||||
|
|
||||||
|
GroupC1->show();
|
||||||
|
// GroupC2->hide();
|
||||||
|
// GroupC3->hide();
|
||||||
|
myConstructorId = 0 ;
|
||||||
|
Constructor1->setChecked( TRUE );
|
||||||
|
myEditCurrentArgument = LineEditC1A1 ;
|
||||||
|
mySelection = Sel;
|
||||||
|
myGeomGUI = GEOMBase_Context::GetGeomGUI() ;
|
||||||
|
myPoint1.SetCoord( 0.0, 0.0, 0.0 );
|
||||||
|
myPoint2.SetCoord( 0.0, 0.0, 0.0 );
|
||||||
|
myOkPoint1 = myOkPoint2 = false ;
|
||||||
|
mySimulationTopoDs.Nullify() ;
|
||||||
|
myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ;
|
||||||
|
|
||||||
|
// TODO : previous selection into argument ?
|
||||||
|
|
||||||
|
/* Filters definition */
|
||||||
|
Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM");
|
||||||
|
myGeom = GEOM::GEOM_Gen::_narrow(comp);
|
||||||
|
myVertexFilter = new GEOM_ShapeTypeFilter( TopAbs_VERTEX, myGeom );
|
||||||
|
mySelection->AddFilter(myVertexFilter) ; /* first filter used */
|
||||||
|
|
||||||
|
/* 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( SelectButtonC1A2, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
|
||||||
|
|
||||||
|
connect( LineEditC1A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ;
|
||||||
|
connect( LineEditC1A2, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ;
|
||||||
|
|
||||||
|
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 ;
|
||||||
|
myGeomGUI->DefineDlgPosition( this, x, y ) ;
|
||||||
|
this->move( x, y ) ;
|
||||||
|
this->show() ; /* displays Dialog */
|
||||||
|
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ConstructorsClicked()
|
||||||
|
// purpose : Radio button management
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_EdgeDlg::ConstructorsClicked(int constructorId)
|
||||||
|
{
|
||||||
|
switch (constructorId)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnOk()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_EdgeDlg::ClickOnOk()
|
||||||
|
{
|
||||||
|
this->ClickOnApply() ;
|
||||||
|
this->ClickOnCancel() ;
|
||||||
|
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnApply()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_EdgeDlg::ClickOnApply()
|
||||||
|
{
|
||||||
|
myGeomGUI->EraseSimulationShape() ;
|
||||||
|
mySimulationTopoDs.Nullify() ;
|
||||||
|
myGeomGUI->GetDesktop()->putInfo( tr("") ) ;
|
||||||
|
switch(myConstructorId)
|
||||||
|
{
|
||||||
|
case 0 :
|
||||||
|
{
|
||||||
|
if(myOkPoint1 && myOkPoint2)
|
||||||
|
myBuildGUI->MakeLinearEdgeAndDisplay( myPoint1, myPoint2 ) ;
|
||||||
|
break ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// accept();
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnCancel()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_EdgeDlg::ClickOnCancel()
|
||||||
|
{
|
||||||
|
mySelection->ClearFilters() ;
|
||||||
|
myGeomGUI->EraseSimulationShape() ;
|
||||||
|
mySimulationTopoDs.Nullify() ;
|
||||||
|
disconnect( mySelection, 0, this, 0 );
|
||||||
|
myGeomGUI->ResetState() ;
|
||||||
|
reject() ;
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SelectionIntoArgument()
|
||||||
|
// purpose : Called when selection as changed or other case
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_EdgeDlg::SelectionIntoArgument()
|
||||||
|
{
|
||||||
|
myEditCurrentArgument->setText("") ;
|
||||||
|
myGeomGUI->EraseSimulationShape() ;
|
||||||
|
mySimulationTopoDs.Nullify() ;
|
||||||
|
|
||||||
|
QString aString = ""; /* name of future selection */
|
||||||
|
|
||||||
|
int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ;
|
||||||
|
if ( nbSel != 1 ) {
|
||||||
|
if ( myEditCurrentArgument == LineEditC1A1 ) {
|
||||||
|
myOkPoint1 = false ;
|
||||||
|
}
|
||||||
|
else if ( myEditCurrentArgument == LineEditC1A2 ) {
|
||||||
|
myOkPoint2 = false ;
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
// nbSel == 1 !
|
||||||
|
TopoDS_Shape S;
|
||||||
|
if( !myGeomGUI->GetTopoFromSelection(mySelection, S) )
|
||||||
|
return ;
|
||||||
|
|
||||||
|
if ( myConstructorId == 0 && myEditCurrentArgument == LineEditC1A1 && myGeomGUI->VertexToPoint(S, myPoint1) ) {
|
||||||
|
myEditCurrentArgument->setText(aString) ;
|
||||||
|
myOkPoint1 = true ;
|
||||||
|
}
|
||||||
|
else if ( myConstructorId == 0 && myEditCurrentArgument == LineEditC1A2 && myGeomGUI->VertexToPoint(S, myPoint2) ) {
|
||||||
|
myEditCurrentArgument->setText(aString) ;
|
||||||
|
myOkPoint2 = true ;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( myOkPoint1 && myOkPoint2 && myPoint1.Distance(myPoint2) > Precision::Confusion() ) {
|
||||||
|
mySimulationTopoDs = BRepBuilderAPI_MakeEdge( myPoint1, myPoint2 ).Shape();
|
||||||
|
myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ;
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : LineEditReturnPressed()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_EdgeDlg::LineEditReturnPressed()
|
||||||
|
{
|
||||||
|
QLineEdit* send = (QLineEdit*)sender();
|
||||||
|
if( send == LineEditC1A1 )
|
||||||
|
myEditCurrentArgument = LineEditC1A1 ;
|
||||||
|
else if ( send == LineEditC1A2 )
|
||||||
|
myEditCurrentArgument = LineEditC1A2 ;
|
||||||
|
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( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) {
|
||||||
|
myEditCurrentArgument->setText( objectUserName ) ;
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SetEditCurrentArgument()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_EdgeDlg::SetEditCurrentArgument()
|
||||||
|
{
|
||||||
|
QPushButton* send = (QPushButton*)sender();
|
||||||
|
mySelection->ClearFilters() ;
|
||||||
|
switch (myConstructorId)
|
||||||
|
{
|
||||||
|
case 0: /* default constructor */
|
||||||
|
{
|
||||||
|
if(send == SelectButtonC1A1) {
|
||||||
|
LineEditC1A1->setFocus() ;
|
||||||
|
myEditCurrentArgument = LineEditC1A1;
|
||||||
|
}
|
||||||
|
else if(send == SelectButtonC1A2) {
|
||||||
|
LineEditC1A2->setFocus() ;
|
||||||
|
myEditCurrentArgument = LineEditC1A2;
|
||||||
|
}
|
||||||
|
mySelection->AddFilter(myVertexFilter) ;
|
||||||
|
SelectionIntoArgument() ;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : DeactivateActiveDialog()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_EdgeDlg::DeactivateActiveDialog()
|
||||||
|
{
|
||||||
|
if ( GroupConstructors->isEnabled() ) {
|
||||||
|
|
||||||
|
GroupConstructors->setEnabled(false) ;
|
||||||
|
GroupC1->setEnabled(false) ;
|
||||||
|
// TODO other constructors
|
||||||
|
//
|
||||||
|
GroupButtons->setEnabled(false) ;
|
||||||
|
disconnect( mySelection, 0, this, 0 );
|
||||||
|
myGeomGUI->EraseSimulationShape() ;
|
||||||
|
mySelection->ClearFilters() ;
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ActivateThisDialog()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_EdgeDlg::ActivateThisDialog()
|
||||||
|
{
|
||||||
|
/* Emit a signal to deactivate the active dialog */
|
||||||
|
myGeomGUI->EmitSignalDeactivateDialog() ;
|
||||||
|
GroupConstructors->setEnabled(true) ;
|
||||||
|
GroupC1->setEnabled(true) ;
|
||||||
|
GroupButtons->setEnabled(true) ;
|
||||||
|
|
||||||
|
connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
||||||
|
if( !mySimulationTopoDs.IsNull() )
|
||||||
|
myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ;
|
||||||
|
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : enterEvent()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_EdgeDlg::enterEvent(QEvent* e)
|
||||||
|
{
|
||||||
|
if ( GroupConstructors->isEnabled() )
|
||||||
|
return ;
|
||||||
|
ActivateThisDialog() ;
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : closeEvent()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_EdgeDlg::closeEvent( QCloseEvent* e )
|
||||||
|
{
|
||||||
|
/* same than click on cancel button */
|
||||||
|
this->ClickOnCancel() ;
|
||||||
|
return ;
|
||||||
|
}
|
114
src/BuildGUI/BuildGUI_EdgeDlg.h
Normal file
114
src/BuildGUI/BuildGUI_EdgeDlg.h
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
// 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 : BuildGUI_EdgeDlg.h
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
#ifndef DIALOGBOX_EDGE_H
|
||||||
|
#define DIALOGBOX_EDGE_H
|
||||||
|
|
||||||
|
#include "BuildGUI.h"
|
||||||
|
|
||||||
|
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qdialog.h>
|
||||||
|
|
||||||
|
class QVBoxLayout;
|
||||||
|
class QHBoxLayout;
|
||||||
|
class QGridLayout;
|
||||||
|
class QButtonGroup;
|
||||||
|
class QGroupBox;
|
||||||
|
class QLabel;
|
||||||
|
class QLineEdit;
|
||||||
|
class QPushButton;
|
||||||
|
class QRadioButton;
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BuildGUI_EdgeDlg
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
class BuildGUI_EdgeDlg : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
BuildGUI_EdgeDlg(QWidget* parent = 0, const char* name = 0, BuildGUI* theBuildGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
|
||||||
|
~BuildGUI_EdgeDlg();
|
||||||
|
|
||||||
|
private :
|
||||||
|
BuildGUI* myBuildGUI;
|
||||||
|
GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */
|
||||||
|
GEOMBase_Context* myGeomGUI ; /* Current GeomGUI object */
|
||||||
|
TopoDS_Shape mySimulationTopoDs; /* Shape used for simulation display */
|
||||||
|
SALOME_Selection* mySelection ; /* User shape selection */
|
||||||
|
gp_Pnt myPoint1 ; /* Points containing the vector */
|
||||||
|
gp_Pnt myPoint2 ;
|
||||||
|
|
||||||
|
bool myOkPoint1 ; /* true when myPoint is defined */
|
||||||
|
bool myOkPoint2 ;
|
||||||
|
QLineEdit* myEditCurrentArgument; /* Current LineEdit */
|
||||||
|
int myConstructorId ; /* Current constructor id = radio button id */
|
||||||
|
Handle(GEOM_ShapeTypeFilter) myVertexFilter; /* Filter selection */
|
||||||
|
|
||||||
|
void closeEvent( QCloseEvent* e ) ;
|
||||||
|
void enterEvent( QEvent* e);
|
||||||
|
void Init( SALOME_Selection* Sel ) ;
|
||||||
|
|
||||||
|
QButtonGroup* GroupConstructors;
|
||||||
|
QRadioButton* Constructor1;
|
||||||
|
QGroupBox* GroupC1;
|
||||||
|
QPushButton* SelectButtonC1A2;
|
||||||
|
QLineEdit* LineEditC1A1;
|
||||||
|
QLineEdit* LineEditC1A2;
|
||||||
|
QPushButton* SelectButtonC1A1;
|
||||||
|
QLabel* TextLabelC1A1;
|
||||||
|
QLabel* TextLabelC1A2;
|
||||||
|
QGroupBox* GroupButtons;
|
||||||
|
QPushButton* buttonOk;
|
||||||
|
QPushButton* buttonCancel;
|
||||||
|
QPushButton* buttonApply;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
|
||||||
|
void ConstructorsClicked(int constructorId);
|
||||||
|
void ClickOnOk();
|
||||||
|
void ClickOnCancel();
|
||||||
|
void ClickOnApply();
|
||||||
|
void SetEditCurrentArgument() ;
|
||||||
|
void LineEditReturnPressed() ;
|
||||||
|
void SelectionIntoArgument() ;
|
||||||
|
void DeactivateActiveDialog() ;
|
||||||
|
void ActivateThisDialog() ;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QGridLayout* BuildGUI_EdgeDlgLayout;
|
||||||
|
QGridLayout* GroupConstructorsLayout;
|
||||||
|
QGridLayout* GroupC1Layout;
|
||||||
|
QGridLayout* GroupButtonsLayout;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DIALOGBOX_EDGE_H
|
415
src/BuildGUI/BuildGUI_FaceDlg.cxx
Normal file
415
src/BuildGUI/BuildGUI_FaceDlg.cxx
Normal file
@ -0,0 +1,415 @@
|
|||||||
|
// 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 : BuildGUI_FaceDlg.cxx
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
#include "BuildGUI_FaceDlg.h"
|
||||||
|
|
||||||
|
#include <qbuttongroup.h>
|
||||||
|
#include <qcheckbox.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <qlineedit.h>
|
||||||
|
#include <qpushbutton.h>
|
||||||
|
#include <qradiobutton.h>
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qtooltip.h>
|
||||||
|
#include <qwhatsthis.h>
|
||||||
|
#include <qimage.h>
|
||||||
|
#include <qpixmap.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BuildGUI_FaceDlg()
|
||||||
|
// purpose : Constructs a BuildGUI_FaceDlg which is a child of 'parent', with the
|
||||||
|
// name 'name' and widget flags set to 'f'.
|
||||||
|
// The dialog will by default be modeless, unless you set 'modal' to
|
||||||
|
// TRUE to construct a modal dialog.
|
||||||
|
//=================================================================================
|
||||||
|
BuildGUI_FaceDlg::BuildGUI_FaceDlg(QWidget* parent, const char* name, BuildGUI* theBuildGUI, SALOME_Selection* Sel, bool modal, WFlags fl)
|
||||||
|
: QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
|
||||||
|
{
|
||||||
|
QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_BUILD_FACE")));
|
||||||
|
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT")));
|
||||||
|
|
||||||
|
if ( !name )
|
||||||
|
setName( "BuildGUI_FaceDlg" );
|
||||||
|
resize( 303, 208 );
|
||||||
|
setCaption( tr( "GEOM_FACE_TITLE" ) );
|
||||||
|
setSizeGripEnabled( TRUE );
|
||||||
|
BuildGUI_FaceDlgLayout = new QGridLayout( this );
|
||||||
|
BuildGUI_FaceDlgLayout->setSpacing( 6 );
|
||||||
|
BuildGUI_FaceDlgLayout->setMargin( 11 );
|
||||||
|
|
||||||
|
/***************************************************************/
|
||||||
|
GroupConstructors = new QButtonGroup( this, "GroupConstructors" );
|
||||||
|
GroupConstructors->setTitle( tr( "GEOM_FACE" ) );
|
||||||
|
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 );
|
||||||
|
BuildGUI_FaceDlgLayout->addWidget( GroupConstructors, 0, 0 );
|
||||||
|
|
||||||
|
/***************************************************************/
|
||||||
|
GroupC1 = new QGroupBox( this, "GroupC1" );
|
||||||
|
GroupC1->setTitle( tr( "GEOM_FACE_FFW" ) );
|
||||||
|
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 );
|
||||||
|
TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" );
|
||||||
|
TextLabelC1A1->setText( tr( "GEOM_WIRE" ) );
|
||||||
|
TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) );
|
||||||
|
TextLabelC1A1->setFrameShape( QLabel::NoFrame );
|
||||||
|
TextLabelC1A1->setFrameShadow( QLabel::Plain );
|
||||||
|
GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 );
|
||||||
|
SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" );
|
||||||
|
SelectButtonC1A1->setText( tr( "" ) );
|
||||||
|
SelectButtonC1A1->setPixmap( image1 );
|
||||||
|
SelectButtonC1A1->setToggleButton( FALSE );
|
||||||
|
GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 );
|
||||||
|
LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" );
|
||||||
|
GroupC1Layout->addWidget( LineEditC1A1, 0, 2 );
|
||||||
|
CheckBox1 = new QCheckBox( GroupC1, "CheckBox1" );
|
||||||
|
CheckBox1->setText( tr( "GEOM_FACE_OPT" ) );
|
||||||
|
CheckBox1->setChecked( TRUE );
|
||||||
|
GroupC1Layout->addWidget( CheckBox1, 1, 2);
|
||||||
|
BuildGUI_FaceDlgLayout->addWidget( GroupC1, 1, 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 );
|
||||||
|
BuildGUI_FaceDlgLayout->addWidget( GroupButtons, 2, 0 );
|
||||||
|
myBuildGUI = theBuildGUI;
|
||||||
|
Init(Sel) ; /* Initialisations */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ~BuildGUI_FaceDlg()
|
||||||
|
// purpose : Destroys the object and frees any allocated resources
|
||||||
|
//=================================================================================
|
||||||
|
BuildGUI_FaceDlg::~BuildGUI_FaceDlg()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : Init()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_FaceDlg::Init( SALOME_Selection* Sel )
|
||||||
|
{
|
||||||
|
|
||||||
|
GroupC1->show();
|
||||||
|
myConstructorId = 0 ;
|
||||||
|
Constructor1->setChecked( TRUE );
|
||||||
|
CheckBox1->setChecked( TRUE );
|
||||||
|
|
||||||
|
myEditCurrentArgument = LineEditC1A1 ;
|
||||||
|
mySelection = Sel;
|
||||||
|
this->myOkShape = false ;
|
||||||
|
myGeomGUI = GEOMBase_Context::GetGeomGUI() ;
|
||||||
|
myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ;
|
||||||
|
|
||||||
|
// TODO previous selection into argument ?
|
||||||
|
|
||||||
|
/* Filter definitions */
|
||||||
|
Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM");
|
||||||
|
myGeom = GEOM::GEOM_Gen::_narrow(comp);
|
||||||
|
myWireFilter = new GEOM_ShapeTypeFilter( TopAbs_WIRE, myGeom );
|
||||||
|
mySelection->AddFilter(myWireFilter) ; /* first filter used */
|
||||||
|
|
||||||
|
/* 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( LineEditC1A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ;
|
||||||
|
|
||||||
|
connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
|
||||||
|
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 ;
|
||||||
|
myGeomGUI->DefineDlgPosition( this, x, y ) ;
|
||||||
|
this->move( x, y ) ;
|
||||||
|
this->show() ; /* displays Dialog */
|
||||||
|
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ConstructorsClicked()
|
||||||
|
// purpose : Radio button management
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_FaceDlg::ConstructorsClicked(int constructorId)
|
||||||
|
{
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnOk()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_FaceDlg::ClickOnOk()
|
||||||
|
{
|
||||||
|
this->ClickOnApply() ;
|
||||||
|
this->ClickOnCancel() ;
|
||||||
|
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnApply()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_FaceDlg::ClickOnApply()
|
||||||
|
{
|
||||||
|
myGeomGUI->GetDesktop()->putInfo( tr("") ) ;
|
||||||
|
switch(myConstructorId)
|
||||||
|
{
|
||||||
|
case 0 :
|
||||||
|
{
|
||||||
|
if(myOkShape) {
|
||||||
|
myBuildGUI->MakeFaceAndDisplay(this->myGeomShape, this->CheckBox1->isChecked() ) ;
|
||||||
|
}
|
||||||
|
break ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// accept();
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnCancel()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_FaceDlg::ClickOnCancel()
|
||||||
|
{
|
||||||
|
mySelection->ClearFilters() ;
|
||||||
|
myGeomGUI->ResetState() ;
|
||||||
|
disconnect( mySelection, 0, this, 0 );
|
||||||
|
reject() ;
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SelectionIntoArgument()
|
||||||
|
// purpose : Called when selection as changed or other case
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_FaceDlg::SelectionIntoArgument()
|
||||||
|
{
|
||||||
|
/* All this for first constructor */
|
||||||
|
// if(myEditCurrentArgument == LineEditC1A1 )
|
||||||
|
|
||||||
|
myOkShape = false;
|
||||||
|
myEditCurrentArgument->setText("") ;
|
||||||
|
QString aString = ""; /* future the name of selection */
|
||||||
|
|
||||||
|
int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ;
|
||||||
|
if ( nbSel != 1 )
|
||||||
|
return ;
|
||||||
|
|
||||||
|
// nbSel == 1 !
|
||||||
|
Standard_Boolean testResult ;
|
||||||
|
Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ;
|
||||||
|
if( !myGeomGUI->GetTopoFromSelection(this->mySelection, this->myShape) )
|
||||||
|
return ;
|
||||||
|
|
||||||
|
myGeomShape = myGeomGUI->ConvertIOinGEOMShape(IO, testResult) ;
|
||||||
|
if( !testResult )
|
||||||
|
return ;
|
||||||
|
|
||||||
|
myEditCurrentArgument->setText(aString) ;
|
||||||
|
this->myOkShape = true ;
|
||||||
|
|
||||||
|
/* no simulation */
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SetEditCurrentArgument()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_FaceDlg::SetEditCurrentArgument()
|
||||||
|
{
|
||||||
|
QPushButton* send = (QPushButton*)sender();
|
||||||
|
mySelection->ClearFilters() ;
|
||||||
|
|
||||||
|
switch (myConstructorId)
|
||||||
|
{
|
||||||
|
case 0: /* default constructor */
|
||||||
|
{
|
||||||
|
if(send == SelectButtonC1A1) {
|
||||||
|
LineEditC1A1->setFocus() ;
|
||||||
|
myEditCurrentArgument = LineEditC1A1;
|
||||||
|
mySelection->AddFilter(myWireFilter) ;
|
||||||
|
}
|
||||||
|
SelectionIntoArgument() ;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : LineEditReturnPressed()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_FaceDlg::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( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) {
|
||||||
|
myEditCurrentArgument->setText( objectUserName ) ;
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : DeactivateActiveDialog()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_FaceDlg::DeactivateActiveDialog()
|
||||||
|
{
|
||||||
|
if ( GroupConstructors->isEnabled() ) {
|
||||||
|
disconnect( mySelection, 0, this, 0 );
|
||||||
|
mySelection->ClearFilters() ;
|
||||||
|
GroupConstructors->setEnabled(false) ;
|
||||||
|
GroupC1->setEnabled(false) ;
|
||||||
|
GroupButtons->setEnabled(false) ;
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ActivateThisDialog()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_FaceDlg::ActivateThisDialog()
|
||||||
|
{
|
||||||
|
/* Emit a signal to deactivate the active dialog */
|
||||||
|
myGeomGUI->EmitSignalDeactivateDialog() ;
|
||||||
|
GroupConstructors->setEnabled(true) ;
|
||||||
|
GroupC1->setEnabled(true) ;
|
||||||
|
GroupButtons->setEnabled(true) ;
|
||||||
|
connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : enterEvent()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_FaceDlg::enterEvent(QEvent* e)
|
||||||
|
{
|
||||||
|
if ( GroupConstructors->isEnabled() )
|
||||||
|
return ;
|
||||||
|
ActivateThisDialog() ;
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : closeEvent()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_FaceDlg::closeEvent( QCloseEvent* e )
|
||||||
|
{
|
||||||
|
/* same than click on cancel button */
|
||||||
|
this->ClickOnCancel() ;
|
||||||
|
return ;
|
||||||
|
}
|
110
src/BuildGUI/BuildGUI_FaceDlg.h
Normal file
110
src/BuildGUI/BuildGUI_FaceDlg.h
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
// 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 : BuildGUI_FaceDlg.h
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
#ifndef DIALOGBOX_FACE_H
|
||||||
|
#define DIALOGBOX_FACE_H
|
||||||
|
|
||||||
|
#include "BuildGUI.h"
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qdialog.h>
|
||||||
|
|
||||||
|
class QVBoxLayout;
|
||||||
|
class QHBoxLayout;
|
||||||
|
class QGridLayout;
|
||||||
|
class QButtonGroup;
|
||||||
|
class QCheckBox;
|
||||||
|
class QGroupBox;
|
||||||
|
class QLabel;
|
||||||
|
class QLineEdit;
|
||||||
|
class QPushButton;
|
||||||
|
class QRadioButton;
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BuildGUI_FaceDlg
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
class BuildGUI_FaceDlg : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
BuildGUI_FaceDlg( QWidget* parent = 0, const char* name = 0, BuildGUI* theBuildGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
|
||||||
|
~BuildGUI_FaceDlg();
|
||||||
|
|
||||||
|
private:
|
||||||
|
BuildGUI* myBuildGUI;
|
||||||
|
void Init( SALOME_Selection* Sel ) ;
|
||||||
|
void closeEvent( QCloseEvent* e ) ;
|
||||||
|
void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */
|
||||||
|
|
||||||
|
GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */
|
||||||
|
GEOMBase_Context* myGeomGUI ; /* Current GeomGUI object */
|
||||||
|
SALOME_Selection* mySelection ; /* User shape selection */
|
||||||
|
|
||||||
|
TopoDS_Shape myShape ; /* topology used to fuse */
|
||||||
|
GEOM::GEOM_Shape_var myGeomShape ; /* is myShape */
|
||||||
|
bool myOkShape ; /* to check when arguments is defined */
|
||||||
|
|
||||||
|
int myConstructorId ; /* Current constructor id = radio button id */
|
||||||
|
QLineEdit* myEditCurrentArgument; /* Current LineEdit */
|
||||||
|
Handle(GEOM_ShapeTypeFilter) myWireFilter; /* Filter selection */
|
||||||
|
|
||||||
|
QButtonGroup* GroupConstructors;
|
||||||
|
QRadioButton* Constructor1;
|
||||||
|
QGroupBox* GroupC1;
|
||||||
|
QLabel* TextLabelC1A1;
|
||||||
|
QPushButton* SelectButtonC1A1;
|
||||||
|
QLineEdit* LineEditC1A1;
|
||||||
|
QCheckBox* CheckBox1;
|
||||||
|
QGroupBox* GroupButtons;
|
||||||
|
QPushButton* buttonOk;
|
||||||
|
QPushButton* buttonCancel;
|
||||||
|
QPushButton* buttonApply;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
|
||||||
|
void ConstructorsClicked(int constructorId);
|
||||||
|
void ClickOnOk();
|
||||||
|
void ClickOnCancel();
|
||||||
|
void ClickOnApply();
|
||||||
|
void SetEditCurrentArgument() ;
|
||||||
|
void SelectionIntoArgument() ;
|
||||||
|
void LineEditReturnPressed() ;
|
||||||
|
void DeactivateActiveDialog() ;
|
||||||
|
void ActivateThisDialog() ;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QGridLayout* BuildGUI_FaceDlgLayout;
|
||||||
|
QGridLayout* GroupConstructorsLayout;
|
||||||
|
QGridLayout* GroupC1Layout;
|
||||||
|
QGridLayout* GroupButtonsLayout;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DIALOGBOX_FACE_H
|
201
src/BuildGUI/BuildGUI_ShellDlg.cxx
Normal file
201
src/BuildGUI/BuildGUI_ShellDlg.cxx
Normal file
@ -0,0 +1,201 @@
|
|||||||
|
// 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 : BuildGUI_ShellDlg.cxx
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
#include "BuildGUI_ShellDlg.h"
|
||||||
|
|
||||||
|
#include "BuildGUI.h"
|
||||||
|
#include "QAD_Desktop.h"
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BuildGUI_ShellDlg()
|
||||||
|
// purpose : Constructs a BuildGUI_ShellDlg which is a child of 'parent', with the
|
||||||
|
// name 'name' and widget flags set to 'f'.
|
||||||
|
// The dialog will by default be modeless, unless you set 'modal' to
|
||||||
|
// TRUE to construct a modal dialog.
|
||||||
|
//=================================================================================
|
||||||
|
BuildGUI_ShellDlg::BuildGUI_ShellDlg(QWidget* parent, const char* name, BuildGUI* theBuildGUI, 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_BUILD_SHELL")));
|
||||||
|
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM", tr("ICON_SELECT")));
|
||||||
|
|
||||||
|
setCaption(tr("GEOM_SHELL_TITLE"));
|
||||||
|
|
||||||
|
/***************************************************************/
|
||||||
|
GroupConstructors->setTitle(tr("GEOM_SHELL"));
|
||||||
|
RadioButton1->setPixmap(image0);
|
||||||
|
RadioButton2->close(TRUE);
|
||||||
|
RadioButton3->close(TRUE);
|
||||||
|
|
||||||
|
GroupShell = new DlgRef_1Sel_QTD(this, "GroupShell");
|
||||||
|
GroupShell->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
|
||||||
|
GroupShell->TextLabel1->setText(tr("GEOM_OBJECTS"));
|
||||||
|
GroupShell->PushButton1->setPixmap(image1);
|
||||||
|
|
||||||
|
Layout1->addWidget(GroupShell, 1, 0);
|
||||||
|
/***************************************************************/
|
||||||
|
|
||||||
|
/* Initialisations */
|
||||||
|
myBuildGUI = theBuildGUI;
|
||||||
|
Init();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ~BuildGUI_ShellDlg()
|
||||||
|
// purpose : Destroys the object and frees any allocated resources
|
||||||
|
//=================================================================================
|
||||||
|
BuildGUI_ShellDlg::~BuildGUI_ShellDlg()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : Init()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_ShellDlg::Init()
|
||||||
|
{
|
||||||
|
/* init variables */
|
||||||
|
myEditCurrentArgument = GroupShell->LineEdit1;
|
||||||
|
myOkListShapes = false;
|
||||||
|
|
||||||
|
myFaceFilter = new GEOM_FaceFilter(StdSelect_Plane, myGeom);
|
||||||
|
/* Filter for the next selection */
|
||||||
|
mySelection->AddFilter(myFaceFilter) ;
|
||||||
|
|
||||||
|
/* signals and slots connections */
|
||||||
|
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||||
|
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||||
|
|
||||||
|
connect(GroupShell->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
|
||||||
|
/* displays Dialog */
|
||||||
|
GroupShell->show();
|
||||||
|
this->show();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnOk()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_ShellDlg::ClickOnOk()
|
||||||
|
{
|
||||||
|
this->ClickOnApply();
|
||||||
|
ClickOnCancel();
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnApply()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_ShellDlg::ClickOnApply()
|
||||||
|
{
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
||||||
|
|
||||||
|
if(myOkListShapes)
|
||||||
|
myBuildGUI->MakeShellAndDisplay(myListShapes);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SelectionIntoArgument()
|
||||||
|
// purpose : Called when selection as changed or other case
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_ShellDlg::SelectionIntoArgument()
|
||||||
|
{
|
||||||
|
myEditCurrentArgument->setText("");
|
||||||
|
QString aString = "";
|
||||||
|
|
||||||
|
myOkListShapes = false;
|
||||||
|
int nbSel = mySelection->IObjectCount();
|
||||||
|
if(nbSel == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
aString = tr("%1_objects").arg(nbSel);
|
||||||
|
|
||||||
|
myGeomGUI->ConvertListOfIOInListOfIOR(mySelection->StoredIObjects(), myListShapes);
|
||||||
|
myEditCurrentArgument->setText(aString);
|
||||||
|
myOkListShapes = true;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SetEditCurrentArgument()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_ShellDlg::SetEditCurrentArgument()
|
||||||
|
{
|
||||||
|
QPushButton* send = (QPushButton*)sender();
|
||||||
|
mySelection->ClearFilters() ;
|
||||||
|
|
||||||
|
if(send == GroupShell->PushButton1) {
|
||||||
|
GroupShell->LineEdit1->setFocus();
|
||||||
|
myEditCurrentArgument = GroupShell->LineEdit1;
|
||||||
|
mySelection->AddFilter(myFaceFilter);
|
||||||
|
}
|
||||||
|
SelectionIntoArgument();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ActivateThisDialog()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_ShellDlg::ActivateThisDialog()
|
||||||
|
{
|
||||||
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : enterEvent()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_ShellDlg::enterEvent(QEvent* e)
|
||||||
|
{
|
||||||
|
if(GroupConstructors->isEnabled())
|
||||||
|
return;
|
||||||
|
this->ActivateThisDialog();
|
||||||
|
return;
|
||||||
|
}
|
73
src/BuildGUI/BuildGUI_ShellDlg.h
Normal file
73
src/BuildGUI/BuildGUI_ShellDlg.h
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
// 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 : BuildGUI_ShellDlg.h
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#ifndef DIALOGBOX_SHELL_H
|
||||||
|
#define DIALOGBOX_SHELL_H
|
||||||
|
|
||||||
|
#include "GEOMBase_Skeleton.h"
|
||||||
|
#include "DlgRef_1Sel_QTD.h"
|
||||||
|
|
||||||
|
#include "BuildGUI.h"
|
||||||
|
|
||||||
|
#include "GEOM_FaceFilter.hxx"
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BuildGUI_ShellDlg
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
class BuildGUI_ShellDlg : public GEOMBase_Skeleton
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
BuildGUI_ShellDlg(QWidget* parent = 0, const char* name = 0, BuildGUI* theBuildGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
|
||||||
|
~BuildGUI_ShellDlg();
|
||||||
|
|
||||||
|
private:
|
||||||
|
void Init();
|
||||||
|
void enterEvent(QEvent * e);
|
||||||
|
|
||||||
|
BuildGUI* myBuildGUI;
|
||||||
|
|
||||||
|
Handle(GEOM_FaceFilter) myFaceFilter; /* Filters selection */
|
||||||
|
GEOM::GEOM_Gen::ListOfIOR myListShapes;
|
||||||
|
bool myOkListShapes; /* to check when arguments is defined */
|
||||||
|
|
||||||
|
DlgRef_1Sel_QTD* GroupShell;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void ClickOnOk();
|
||||||
|
void ClickOnApply();
|
||||||
|
void SetEditCurrentArgument();
|
||||||
|
void LineEditReturnPressed();
|
||||||
|
void SelectionIntoArgument();
|
||||||
|
void ActivateThisDialog();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DIALOGBOX_SHELL_H
|
201
src/BuildGUI/BuildGUI_SolidDlg.cxx
Normal file
201
src/BuildGUI/BuildGUI_SolidDlg.cxx
Normal file
@ -0,0 +1,201 @@
|
|||||||
|
// 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 : BuildGUI_SolidDlg.cxx
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
#include "BuildGUI_SolidDlg.h"
|
||||||
|
|
||||||
|
#include "BuildGUI.h"
|
||||||
|
#include "QAD_Desktop.h"
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BuildGUI_SolidDlg()
|
||||||
|
// purpose : Constructs a BuildGUI_SolidDlg which is a child of 'parent', with the
|
||||||
|
// name 'name' and widget flags set to 'f'.
|
||||||
|
// The dialog will by default be modeless, unless you set 'modal' to
|
||||||
|
// TRUE to construct a modal dialog.
|
||||||
|
//=================================================================================
|
||||||
|
BuildGUI_SolidDlg::BuildGUI_SolidDlg(QWidget* parent, const char* name, BuildGUI* theBuildGUI, 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_BUILD_SOLID")));
|
||||||
|
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM", tr("ICON_SELECT")));
|
||||||
|
|
||||||
|
setCaption(tr("GEOM_SOLID_TITLE"));
|
||||||
|
|
||||||
|
/***************************************************************/
|
||||||
|
GroupConstructors->setTitle(tr("GEOM_SOLID"));
|
||||||
|
RadioButton1->setPixmap(image0);
|
||||||
|
RadioButton2->close(TRUE);
|
||||||
|
RadioButton3->close(TRUE);
|
||||||
|
|
||||||
|
GroupSolid = new DlgRef_1Sel_QTD(this, "GroupSolid");
|
||||||
|
GroupSolid->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
|
||||||
|
GroupSolid->TextLabel1->setText(tr("GEOM_OBJECTS"));
|
||||||
|
GroupSolid->PushButton1->setPixmap(image1);
|
||||||
|
|
||||||
|
Layout1->addWidget(GroupSolid, 1, 0);
|
||||||
|
/***************************************************************/
|
||||||
|
|
||||||
|
/* Initialisations */
|
||||||
|
myBuildGUI = theBuildGUI;
|
||||||
|
Init();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ~BuildGUI_SolidDlg()
|
||||||
|
// purpose : Destroys the object and frees any allocated resources
|
||||||
|
//=================================================================================
|
||||||
|
BuildGUI_SolidDlg::~BuildGUI_SolidDlg()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : Init()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_SolidDlg::Init()
|
||||||
|
{
|
||||||
|
/* init variables */
|
||||||
|
myEditCurrentArgument = GroupSolid->LineEdit1;
|
||||||
|
myOkListShapes = false;
|
||||||
|
|
||||||
|
myShellFilter = new GEOM_ShapeTypeFilter(TopAbs_SHELL, myGeom);
|
||||||
|
/* filter for next selection */
|
||||||
|
mySelection->AddFilter(myShellFilter);
|
||||||
|
|
||||||
|
/* signals and slots connections */
|
||||||
|
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||||
|
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||||
|
|
||||||
|
connect(GroupSolid->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
|
||||||
|
/* displays Dialog */
|
||||||
|
GroupSolid->show();
|
||||||
|
this->show();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnOk()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_SolidDlg::ClickOnOk()
|
||||||
|
{
|
||||||
|
this->ClickOnApply();
|
||||||
|
ClickOnCancel();
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnApply()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_SolidDlg::ClickOnApply()
|
||||||
|
{
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr(""));
|
||||||
|
|
||||||
|
if(myOkListShapes)
|
||||||
|
myBuildGUI->MakeSolidAndDisplay(myListShapes);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SelectionIntoArgument()
|
||||||
|
// purpose : Called when selection as changed or other case
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_SolidDlg::SelectionIntoArgument()
|
||||||
|
{
|
||||||
|
myEditCurrentArgument->setText("");
|
||||||
|
QString aString = "";
|
||||||
|
|
||||||
|
myOkListShapes = false;
|
||||||
|
int nbSel = mySelection->IObjectCount();
|
||||||
|
if (nbSel == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
aString = tr("%1_objects").arg(nbSel);
|
||||||
|
|
||||||
|
myGeomGUI->ConvertListOfIOInListOfIOR(mySelection->StoredIObjects(), myListShapes);
|
||||||
|
myEditCurrentArgument->setText(aString);
|
||||||
|
myOkListShapes = true;
|
||||||
|
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SetEditCurrentArgument()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_SolidDlg::SetEditCurrentArgument()
|
||||||
|
{
|
||||||
|
QPushButton* send = (QPushButton*)sender();
|
||||||
|
mySelection->ClearFilters() ;
|
||||||
|
|
||||||
|
if(send == GroupSolid->PushButton1) {
|
||||||
|
GroupSolid->LineEdit1->setFocus();
|
||||||
|
myEditCurrentArgument = GroupSolid->LineEdit1;
|
||||||
|
mySelection->AddFilter(myShellFilter);
|
||||||
|
}
|
||||||
|
SelectionIntoArgument();
|
||||||
|
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ActivateThisDialog()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_SolidDlg::ActivateThisDialog()
|
||||||
|
{
|
||||||
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
|
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : enterEvent()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_SolidDlg::enterEvent(QEvent* e)
|
||||||
|
{
|
||||||
|
if (GroupConstructors->isEnabled())
|
||||||
|
return;
|
||||||
|
this->ActivateThisDialog();
|
||||||
|
return;
|
||||||
|
}
|
71
src/BuildGUI/BuildGUI_SolidDlg.h
Normal file
71
src/BuildGUI/BuildGUI_SolidDlg.h
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
// 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 : BuildGUI_SolidDlg.h
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#ifndef DIALOGBOX_SOLID_H
|
||||||
|
#define DIALOGBOX_SOLID_H
|
||||||
|
|
||||||
|
#include "GEOMBase_Skeleton.h"
|
||||||
|
#include "DlgRef_1Sel_QTD.h"
|
||||||
|
|
||||||
|
#include "BuildGUI.h"
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BuildGUI_SolidDlg
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
class BuildGUI_SolidDlg : public GEOMBase_Skeleton
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
BuildGUI_SolidDlg(QWidget* parent = 0, const char* name = 0, BuildGUI* theBuildGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
|
||||||
|
~BuildGUI_SolidDlg();
|
||||||
|
|
||||||
|
private:
|
||||||
|
void Init();
|
||||||
|
void enterEvent(QEvent * e);
|
||||||
|
|
||||||
|
BuildGUI* myBuildGUI;
|
||||||
|
|
||||||
|
Handle(GEOM_ShapeTypeFilter) myShellFilter; /* filter for selection */
|
||||||
|
GEOM::GEOM_Gen::ListOfIOR myListShapes;
|
||||||
|
bool myOkListShapes; /* to check when arguments is defined */
|
||||||
|
|
||||||
|
DlgRef_1Sel_QTD* GroupSolid;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void ClickOnOk();
|
||||||
|
void ClickOnApply();
|
||||||
|
void SetEditCurrentArgument();
|
||||||
|
void LineEditReturnPressed();
|
||||||
|
void SelectionIntoArgument();
|
||||||
|
void ActivateThisDialog();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DIALOGBOX_SOLID_H
|
741
src/BuildGUI/BuildGUI_SubShapeDlg.cxx
Normal file
741
src/BuildGUI/BuildGUI_SubShapeDlg.cxx
Normal file
@ -0,0 +1,741 @@
|
|||||||
|
// 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 : BuildGUI_SubShapeDlg.cxx
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
#include "BuildGUI_SubShapeDlg.h"
|
||||||
|
|
||||||
|
#include "QAD_RightFrame.h"
|
||||||
|
#include "OCCViewer_Viewer3d.h"
|
||||||
|
|
||||||
|
#include <TopExp_Explorer.hxx>
|
||||||
|
|
||||||
|
#include <qbuttongroup.h>
|
||||||
|
#include <qcheckbox.h>
|
||||||
|
#include <qcombobox.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 <qmessagebox.h>
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BuildGUI_SubShapeDlg()
|
||||||
|
// purpose : Constructs a BuildGUI_SubShapeDlg which is a child of 'parent', with the
|
||||||
|
// name 'name' and widget flags set to 'f'.
|
||||||
|
// The dialog will by default be modeless, unless you set 'modal' to
|
||||||
|
// TRUE to construct a modal dialog.
|
||||||
|
//=================================================================================
|
||||||
|
BuildGUI_SubShapeDlg::BuildGUI_SubShapeDlg(QWidget* parent, const char* name, BuildGUI* theBuildGUI, SALOME_Selection* Sel, Handle(AIS_InteractiveContext) ic, bool modal, WFlags fl)
|
||||||
|
: QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
|
||||||
|
{
|
||||||
|
QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_SUBSHAPE")));
|
||||||
|
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT")));
|
||||||
|
|
||||||
|
if ( !name )
|
||||||
|
setName( "BuildGUI_SUBSHAPE" );
|
||||||
|
resize( 303, 239 );
|
||||||
|
setCaption( tr( "GEOM_SUBSHAPE_TITLE" ) );
|
||||||
|
setSizeGripEnabled( TRUE );
|
||||||
|
BuildGUI_SubShapeDlgLayout = new QGridLayout( this );
|
||||||
|
BuildGUI_SubShapeDlgLayout->setSpacing( 6 );
|
||||||
|
BuildGUI_SubShapeDlgLayout->setMargin( 11 );
|
||||||
|
|
||||||
|
/***************************************************************/
|
||||||
|
GroupConstructors = new QButtonGroup( this, "GroupConstructors" );
|
||||||
|
GroupConstructors->setTitle( tr( "GEOM_SUB_SHAPE" ) );
|
||||||
|
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 );
|
||||||
|
BuildGUI_SubShapeDlgLayout->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 );
|
||||||
|
BuildGUI_SubShapeDlgLayout->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 );
|
||||||
|
TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" );
|
||||||
|
TextLabelC1A1->setText( tr( "GEOM_MAIN_OBJECT" ) );
|
||||||
|
TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) );
|
||||||
|
TextLabelC1A1->setFrameShape( QLabel::NoFrame );
|
||||||
|
TextLabelC1A1->setFrameShadow( QLabel::Plain );
|
||||||
|
GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 );
|
||||||
|
TextLabelComboBox1 = new QLabel( GroupC1, "TextLabelComboBox1" );
|
||||||
|
TextLabelComboBox1->setText( tr( "GEOM_SUBSHAPE_TYPE" ) );
|
||||||
|
GroupC1Layout->addMultiCellWidget( TextLabelComboBox1, 1, 1, 0, 1 );
|
||||||
|
ComboBox1 = new QComboBox( FALSE, GroupC1, "ComboBox1" );
|
||||||
|
ComboBox1->setMaxCount( 100 );
|
||||||
|
GroupC1Layout->addMultiCellWidget( ComboBox1, 1, 1, 2, 3 );
|
||||||
|
CheckBox1 = new QCheckBox( GroupC1, "CheckBox1" );
|
||||||
|
CheckBox1->setText( tr( "GEOM_SUBSHAPE_SELECT" ) );
|
||||||
|
CheckBox1->setChecked( FALSE );
|
||||||
|
GroupC1Layout->addMultiCellWidget( CheckBox1, 2, 2, 0, 1 );
|
||||||
|
LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" );
|
||||||
|
GroupC1Layout->addMultiCellWidget( LineEditC1A1, 0, 0, 2, 3 );
|
||||||
|
SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" );
|
||||||
|
SelectButtonC1A1->setText( tr( "" ) );
|
||||||
|
SelectButtonC1A1->setPixmap( image1 );
|
||||||
|
SelectButtonC1A1->setToggleButton( FALSE );
|
||||||
|
SelectButtonC1A1->setMaximumSize( QSize( 28, 32767 ) );
|
||||||
|
GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 );
|
||||||
|
BuildGUI_SubShapeDlgLayout->addWidget( GroupC1, 1, 0 );
|
||||||
|
/***************************************************************/
|
||||||
|
myBuildGUI = theBuildGUI;
|
||||||
|
/* Initialisations */
|
||||||
|
Init(Sel, ic) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ~BuildGUI_SubShapeDlg()
|
||||||
|
// purpose : Destroys the object and frees any allocated resources
|
||||||
|
//=================================================================================
|
||||||
|
BuildGUI_SubShapeDlg::~BuildGUI_SubShapeDlg()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : Init()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_SubShapeDlg::Init( SALOME_Selection* Sel, Handle (AIS_InteractiveContext) ic )
|
||||||
|
{
|
||||||
|
|
||||||
|
GroupC1->show();
|
||||||
|
myConstructorId = 0 ;
|
||||||
|
Constructor1->setChecked( TRUE );
|
||||||
|
myEditCurrentArgument = LineEditC1A1 ;
|
||||||
|
mySelection = Sel;
|
||||||
|
myShape.Nullify() ;
|
||||||
|
|
||||||
|
myIC = ic ;
|
||||||
|
myUseLocalContext = false ;
|
||||||
|
myLocalContextId = -1;
|
||||||
|
myAbort = false ;
|
||||||
|
myOkShape = false ;
|
||||||
|
myGeomGUI = GEOMBase_Context::GetGeomGUI() ;
|
||||||
|
|
||||||
|
/* type for sub shape selection */
|
||||||
|
ComboBox1->insertItem("Compound");
|
||||||
|
ComboBox1->insertItem("Compsolid");
|
||||||
|
ComboBox1->insertItem("Solid");
|
||||||
|
ComboBox1->insertItem("Shell");
|
||||||
|
ComboBox1->insertItem("Face");
|
||||||
|
ComboBox1->insertItem("Wire");
|
||||||
|
ComboBox1->insertItem("Edge");
|
||||||
|
ComboBox1->insertItem("Vertex");
|
||||||
|
ComboBox1->insertItem("Shape");
|
||||||
|
|
||||||
|
myWithShape = true;
|
||||||
|
myShapeType = ComboBox1->currentItem();
|
||||||
|
|
||||||
|
/* Select sub shapes mode not checked */
|
||||||
|
CheckBox1->setChecked( FALSE );
|
||||||
|
myOkSelectSubMode = CheckBox1->isChecked();
|
||||||
|
|
||||||
|
// TODO : previous selection into argument ?
|
||||||
|
|
||||||
|
/* Filter definitions */
|
||||||
|
Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM");
|
||||||
|
myGeom = GEOM::GEOM_Gen::_narrow(comp);
|
||||||
|
|
||||||
|
/* signals and slots connections */
|
||||||
|
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) ), this, SLOT( ConstructorsClicked(int) ) );
|
||||||
|
|
||||||
|
connect( SelectButtonC1A1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
|
||||||
|
connect( CheckBox1, SIGNAL (stateChanged(int) ), this, SLOT( AllOrNotAll() ) ) ;
|
||||||
|
|
||||||
|
connect( LineEditC1A1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ;
|
||||||
|
|
||||||
|
connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
||||||
|
connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) );
|
||||||
|
connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) );
|
||||||
|
|
||||||
|
connect( ComboBox1, SIGNAL( activated(int) ), this, SLOT( ComboTextChanged() ) );
|
||||||
|
|
||||||
|
/* Move widget on the botton right corner of main widget */
|
||||||
|
int x, y ;
|
||||||
|
myGeomGUI->DefineDlgPosition( this, x, y ) ;
|
||||||
|
this->move( x, y ) ;
|
||||||
|
this->show() ; /* display Dialog */
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ConstructorsClicked()
|
||||||
|
// purpose : Radio button management
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_SubShapeDlg::ConstructorsClicked(int constructorId)
|
||||||
|
{
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnOk()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_SubShapeDlg::ClickOnOk()
|
||||||
|
{
|
||||||
|
this->ClickOnApply() ;
|
||||||
|
|
||||||
|
/* User has aborted or not operation of explode all with many sub shapes */
|
||||||
|
if( this->myAbort == false )
|
||||||
|
this->ClickOnCancel() ;
|
||||||
|
else
|
||||||
|
this->myAbort = false ;
|
||||||
|
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnApply()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_SubShapeDlg::ClickOnApply()
|
||||||
|
{
|
||||||
|
myGeomGUI->GetDesktop()->putInfo( tr("") ) ;
|
||||||
|
bool testResult = false ;
|
||||||
|
|
||||||
|
this->myAbort = false ; /* Not aborted by default */
|
||||||
|
|
||||||
|
switch(myConstructorId)
|
||||||
|
{
|
||||||
|
case 0 :
|
||||||
|
{
|
||||||
|
/* Explode all sub shapes */
|
||||||
|
if( myOkShape && !myOkSelectSubMode ) {
|
||||||
|
|
||||||
|
/* More than 30 subshapes : ask confirmation */
|
||||||
|
unsigned int nb = NumberOfSubShapes( myShape, myShapeType ) ;
|
||||||
|
if( nb > 30 ) {
|
||||||
|
const QString caption = tr("GEOM_CONFIRM") ;
|
||||||
|
const QString text = tr("GEOM_CONFIRM_INFO").arg(nb) ;
|
||||||
|
const QString button0 = tr("GEOM_BUT_EXPLODE") ;
|
||||||
|
const QString button1 = tr("GEOM_BUT_CANCEL") ;
|
||||||
|
|
||||||
|
if( QMessageBox::warning( this, caption, text, button0, button1 ) == 0 )
|
||||||
|
testResult = myBuildGUI->OnSubShapeGetAll( myShape, myShapeIOR, myShapeType ) ;
|
||||||
|
else
|
||||||
|
this->myAbort = true ; /* aborted */
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
testResult = myBuildGUI->OnSubShapeGetAll( myShape, myShapeIOR, myShapeType ) ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* explode only selected sub shapes */
|
||||||
|
else if( myOkShape && myOkSelectSubMode ) {
|
||||||
|
testResult = myBuildGUI->OnSubShapeGetSelected( myShape, myShapeIOR, myShapeType, myLocalContextId, myUseLocalContext ) ;
|
||||||
|
}
|
||||||
|
if( !testResult ) {
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_ABORT")) ;
|
||||||
|
this->myAbort = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_DONE")) ;
|
||||||
|
}
|
||||||
|
/* Reset all arguments and local context to allow user a new selection ...*/
|
||||||
|
this->ResetStateOfDialog() ;
|
||||||
|
break ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnCancel()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_SubShapeDlg::ClickOnCancel()
|
||||||
|
{
|
||||||
|
disconnect( mySelection, 0, this, 0 );
|
||||||
|
myGeomGUI->ResetState() ;
|
||||||
|
|
||||||
|
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) ;
|
||||||
|
|
||||||
|
GEOMBase_Display* myDisplayGUI = new GEOMBase_Display();
|
||||||
|
myDisplayGUI->OnDisplayAll(true) ;
|
||||||
|
this->myUseLocalContext = false ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
reject() ;
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SelectionIntoArgument()
|
||||||
|
// purpose : Called when selection as changed or other case
|
||||||
|
// : used only by SelectButtonC1A1 (LineEditC1A1)
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_SubShapeDlg::SelectionIntoArgument()
|
||||||
|
{
|
||||||
|
|
||||||
|
/* Reset all arguments and local context when selection as changed */
|
||||||
|
this->ResetStateOfDialog() ;
|
||||||
|
|
||||||
|
QString aString = ""; /* future name of selection */
|
||||||
|
|
||||||
|
int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ;
|
||||||
|
|
||||||
|
if ( nbSel != 1 ) {
|
||||||
|
LineEditC1A1->setText("") ;
|
||||||
|
myOkShape = false;
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* nbSel == 1 */
|
||||||
|
TopoDS_Shape S ;
|
||||||
|
Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject() ;
|
||||||
|
|
||||||
|
if( !myGeomGUI->GetTopoFromSelection(mySelection, S) )
|
||||||
|
return ;
|
||||||
|
|
||||||
|
if( !IO->hasEntry() ) {
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY")) ;
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !S.IsNull() && S.ShapeType() != TopAbs_VERTEX )
|
||||||
|
{
|
||||||
|
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 ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SALOMEDS::Study_var aStudy = myGeomGUI->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"))
|
||||||
|
{
|
||||||
|
anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
|
||||||
|
myShapeIOR = anIOR->Value();
|
||||||
|
myOkShape = true ;
|
||||||
|
myShape = S ;
|
||||||
|
LineEditC1A1->setText(aString) ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int SelectedShapeType = ComboBox1->currentItem();
|
||||||
|
int count = ComboBox1->count();
|
||||||
|
if ( myWithShape ) count = count - 1;
|
||||||
|
|
||||||
|
int i = 0;
|
||||||
|
while ( i <= myShape.ShapeType() ) {
|
||||||
|
ComboBox1->removeItem(0);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (myShape.ShapeType()==TopAbs_COMPOUND)
|
||||||
|
{
|
||||||
|
if (myWithShape == false) {
|
||||||
|
ComboBox1->insertItem("Shape");
|
||||||
|
myWithShape = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (myWithShape == true) {
|
||||||
|
ComboBox1->removeItem( ComboBox1->count() -1 );
|
||||||
|
myWithShape = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int count1 = ComboBox1->count();
|
||||||
|
if ( myWithShape ) count1 = count1 - 1;
|
||||||
|
|
||||||
|
if ( SelectedShapeType > myShape.ShapeType() ) {
|
||||||
|
if ( SelectedShapeType == 8 ) {
|
||||||
|
if ( myShape.ShapeType() != TopAbs_COMPOUND ) {
|
||||||
|
ComboBox1->setCurrentItem(0);
|
||||||
|
myShapeType = 8 - count1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ComboBox1->setCurrentItem( count1 - count + SelectedShapeType );
|
||||||
|
myShapeType = 8 - count1 + ComboBox1->currentItem();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ComboBox1->setCurrentItem(0);
|
||||||
|
myShapeType = 8 - count1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SetEditCurrentArgument()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_SubShapeDlg::SetEditCurrentArgument()
|
||||||
|
{
|
||||||
|
QPushButton* send = (QPushButton*)sender();
|
||||||
|
switch (myConstructorId)
|
||||||
|
{
|
||||||
|
case 0: /* default constructor */
|
||||||
|
{
|
||||||
|
if(send == SelectButtonC1A1) {
|
||||||
|
LineEditC1A1->setFocus() ;
|
||||||
|
myEditCurrentArgument = LineEditC1A1;
|
||||||
|
SelectionIntoArgument() ;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : LineEditReturnPressed()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_SubShapeDlg::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( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) {
|
||||||
|
myEditCurrentArgument->setText( objectUserName ) ;
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : DeactivateActiveDialog()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_SubShapeDlg::DeactivateActiveDialog()
|
||||||
|
{
|
||||||
|
/* Check if active */
|
||||||
|
if ( GroupConstructors->isEnabled() ) {
|
||||||
|
|
||||||
|
this->ResetStateOfDialog() ;
|
||||||
|
|
||||||
|
disconnect( mySelection, 0, this, 0 );
|
||||||
|
GroupConstructors->setEnabled(false) ;
|
||||||
|
GroupC1->setEnabled(false) ;
|
||||||
|
GroupButtons->setEnabled(false) ;
|
||||||
|
myGeomGUI->ResetState() ;
|
||||||
|
myGeomGUI->SetActiveDialogBox(0) ;
|
||||||
|
GEOMBase_Display* myDisplayGUI = new GEOMBase_Display();
|
||||||
|
myDisplayGUI->OnDisplayAll(true) ;
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ActivateThisDialog()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_SubShapeDlg::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 ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : enterEvent()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_SubShapeDlg::enterEvent(QEvent* e)
|
||||||
|
{
|
||||||
|
if ( GroupConstructors->isEnabled() )
|
||||||
|
return ;
|
||||||
|
ActivateThisDialog() ;
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : closeEvent()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_SubShapeDlg::closeEvent( QCloseEvent* e )
|
||||||
|
{
|
||||||
|
/* same than click on cancel button */
|
||||||
|
this->ClickOnCancel() ;
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : AllOrNotAll()
|
||||||
|
// purpose : Allow user selection of all or only selected sub shapes
|
||||||
|
// : Called when 'CheckBox1' state change
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_SubShapeDlg::AllOrNotAll()
|
||||||
|
{
|
||||||
|
|
||||||
|
/* No sub shape selection if main shape not selected */
|
||||||
|
if( !this->myOkShape ) {
|
||||||
|
ResetStateOfDialog() ;
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SELECT_FIRST")) ;
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (myShapeType ==TopAbs_SHAPE && myShape.ShapeType()==TopAbs_COMPOUND)
|
||||||
|
{
|
||||||
|
/* Select sub shapes mode not checked */
|
||||||
|
myOkSelectSubMode = false ;
|
||||||
|
CheckBox1->setChecked( FALSE );
|
||||||
|
//no meaning to allow user selection for type = shape
|
||||||
|
//TODO - add another message
|
||||||
|
//myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SELECT_FIRST")) ;
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
myOkSelectSubMode = CheckBox1->isChecked() ;
|
||||||
|
|
||||||
|
if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) {
|
||||||
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
|
myIC = v3d->getAISContext();
|
||||||
|
if( this->myUseLocalContext ) {
|
||||||
|
myIC->CloseLocalContext(myLocalContextId) ;
|
||||||
|
this->myUseLocalContext = false ;
|
||||||
|
GEOMBase_Display* myDisplayGUI = new GEOMBase_Display();
|
||||||
|
myDisplayGUI->OnDisplayAll(true) ;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_NOT_FOR_VTK_VIEWER") ) ;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( myOkShape && myOkSelectSubMode ) {
|
||||||
|
/* local context is defined into the method */
|
||||||
|
myGeomGUI->PrepareSubShapeSelection( this->myShapeType, this->myLocalContextId ) ;
|
||||||
|
myUseLocalContext = true ;
|
||||||
|
myGeomGUI->GetDesktop()->putInfo(tr("GEOM_PRP_SELECT_FACE")) ;
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ResetStateOfDialog()
|
||||||
|
// purpose : Completely reset the state of method including local context
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_SubShapeDlg::ResetStateOfDialog()
|
||||||
|
{
|
||||||
|
/* To leave current selection if explode all as been aborted by user */
|
||||||
|
if( this->myAbort == true ) {
|
||||||
|
this->myOkShape = false ;
|
||||||
|
this->myEditCurrentArgument->setText("") ;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
; /* nothing to do : keep selection argument */
|
||||||
|
}
|
||||||
|
|
||||||
|
int SelectedShapeType = ComboBox1->currentItem();
|
||||||
|
int count = ComboBox1->count();
|
||||||
|
if ( myWithShape ) count = count - 1;
|
||||||
|
/* type for sub shape selection */
|
||||||
|
ComboBox1->clear();
|
||||||
|
ComboBox1->insertItem("Compound");
|
||||||
|
ComboBox1->insertItem("Compsolid");
|
||||||
|
ComboBox1->insertItem("Solid");
|
||||||
|
ComboBox1->insertItem("Shell");
|
||||||
|
ComboBox1->insertItem("Face");
|
||||||
|
ComboBox1->insertItem("Wire");
|
||||||
|
ComboBox1->insertItem("Edge");
|
||||||
|
ComboBox1->insertItem("Vertex");
|
||||||
|
ComboBox1->insertItem("Shape");
|
||||||
|
this->myWithShape=true;
|
||||||
|
ComboBox1->setCurrentItem( 8 - count + SelectedShapeType );
|
||||||
|
|
||||||
|
|
||||||
|
/* unpress buttons : due to abort box*/
|
||||||
|
this->buttonApply->setDown(FALSE) ;
|
||||||
|
this->buttonOk->setDown(FALSE) ;
|
||||||
|
|
||||||
|
/* Select sub shapes mode not checked */
|
||||||
|
this->myOkSelectSubMode = false ;
|
||||||
|
this->CheckBox1->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();
|
||||||
|
myIC = v3d->getAISContext();
|
||||||
|
if( this->myUseLocalContext ) {
|
||||||
|
myIC->CloseLocalContext(this->myLocalContextId) ;
|
||||||
|
this->myUseLocalContext = false ;
|
||||||
|
GEOMBase_Display* myDisplayGUI = new GEOMBase_Display();
|
||||||
|
myDisplayGUI->OnDisplayAll(true) ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ComboTextChanged()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_SubShapeDlg::ComboTextChanged()
|
||||||
|
{
|
||||||
|
if ( myOkShape )
|
||||||
|
this->myShapeType = ComboBox1->currentItem() + myShape.ShapeType() + 1;
|
||||||
|
else
|
||||||
|
this->myShapeType = ComboBox1->currentItem();
|
||||||
|
|
||||||
|
/* Select sub shapes mode not checked */
|
||||||
|
CheckBox1->setChecked( FALSE );
|
||||||
|
myOkSelectSubMode = FALSE ;
|
||||||
|
|
||||||
|
if ( myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC ) {
|
||||||
|
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
|
||||||
|
myIC = v3d->getAISContext();
|
||||||
|
if( this->myUseLocalContext ) {
|
||||||
|
myIC->CloseLocalContext(myLocalContextId) ;
|
||||||
|
this->myUseLocalContext = false ;
|
||||||
|
GEOMBase_Display* myDisplayGUI = new GEOMBase_Display();
|
||||||
|
myDisplayGUI->OnDisplayAll(true) ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : NumberOfSubShapes()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
unsigned int BuildGUI_SubShapeDlg::NumberOfSubShapes( const TopoDS_Shape& S, const int shapeType )
|
||||||
|
{
|
||||||
|
if( S.IsNull() )
|
||||||
|
return 0 ;
|
||||||
|
|
||||||
|
unsigned int index = 0 ;
|
||||||
|
TopExp_Explorer Exp( S, TopAbs_ShapeEnum(shapeType) );
|
||||||
|
TopTools_MapOfShape M;
|
||||||
|
while ( Exp.More() ) {
|
||||||
|
if ( M.Add(Exp.Current()) )
|
||||||
|
index++;
|
||||||
|
Exp.Next();
|
||||||
|
}
|
||||||
|
M.Clear() ;
|
||||||
|
return index ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
131
src/BuildGUI/BuildGUI_SubShapeDlg.h
Normal file
131
src/BuildGUI/BuildGUI_SubShapeDlg.h
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
// 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 : BuildGUI_SubShapeDlg.h
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
#ifndef DIALOGBOX_SUBSHAPE_H
|
||||||
|
#define DIALOGBOX_SUBSHAPE_H
|
||||||
|
|
||||||
|
#include "BuildGUI.h"
|
||||||
|
|
||||||
|
#include <AIS_InteractiveContext.hxx>
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qdialog.h>
|
||||||
|
|
||||||
|
class QVBoxLayout;
|
||||||
|
class QHBoxLayout;
|
||||||
|
class QGridLayout;
|
||||||
|
class QButtonGroup;
|
||||||
|
class QCheckBox;
|
||||||
|
class QComboBox;
|
||||||
|
class QGroupBox;
|
||||||
|
class QLabel;
|
||||||
|
class QLineEdit;
|
||||||
|
class QPushButton;
|
||||||
|
class QRadioButton;
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BuildGUI_SubShapeDlg
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
class BuildGUI_SubShapeDlg : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
BuildGUI_SubShapeDlg(QWidget* parent = 0, const char* name = 0, BuildGUI* theBuildGUI = 0, SALOME_Selection* Sel = 0, Handle(AIS_InteractiveContext) ic = 0, bool modal = FALSE, WFlags fl = 0);
|
||||||
|
~BuildGUI_SubShapeDlg();
|
||||||
|
|
||||||
|
private :
|
||||||
|
BuildGUI* myBuildGUI;
|
||||||
|
void Init( SALOME_Selection* Sel, Handle (AIS_InteractiveContext) ic ) ;
|
||||||
|
void closeEvent( QCloseEvent* e ) ;
|
||||||
|
void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */
|
||||||
|
void ResetStateOfDialog() ;
|
||||||
|
|
||||||
|
unsigned int NumberOfSubShapes( const TopoDS_Shape& S, const int shapeType ) ;
|
||||||
|
|
||||||
|
|
||||||
|
/* 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 */
|
||||||
|
|
||||||
|
GEOM::GEOM_Gen_var myGeom ; /* Current Geom object */
|
||||||
|
GEOMBase_Context* myGeomGUI ; /* Current GeomGUI object */
|
||||||
|
SALOME_Selection* mySelection ; /* User shape selection */
|
||||||
|
|
||||||
|
TopoDS_Shape myShape ;
|
||||||
|
char* myShapeIOR ;
|
||||||
|
bool myOkShape ;
|
||||||
|
int myShapeType ; /* define a type of topology mode of sub selection */
|
||||||
|
|
||||||
|
bool myWithShape ; /* check if Shape item exists */
|
||||||
|
|
||||||
|
bool myOkSelectSubMode ; /* true = sub mode selection activated */
|
||||||
|
QLineEdit* myEditCurrentArgument; /* Current LineEdit */
|
||||||
|
int myConstructorId ; /* Current constructor id = radio button id */
|
||||||
|
bool myAbort ; /* Indicate if sub Shape All has been aborted by user */
|
||||||
|
|
||||||
|
QButtonGroup* GroupConstructors;
|
||||||
|
QRadioButton* Constructor1;
|
||||||
|
QGroupBox* GroupButtons;
|
||||||
|
QPushButton* buttonOk;
|
||||||
|
QPushButton* buttonCancel;
|
||||||
|
QPushButton* buttonApply;
|
||||||
|
QGroupBox* GroupC1;
|
||||||
|
QPushButton* SelectButtonC1A1;
|
||||||
|
QLineEdit* LineEditC1A1;
|
||||||
|
QLabel* TextLabelC1A1;
|
||||||
|
QLabel* TextLabelComboBox1;
|
||||||
|
QComboBox* ComboBox1;
|
||||||
|
|
||||||
|
QCheckBox* CheckBox1;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
|
||||||
|
void ConstructorsClicked(int constructorId);
|
||||||
|
void ClickOnOk();
|
||||||
|
void ClickOnCancel();
|
||||||
|
void ClickOnApply();
|
||||||
|
void LineEditReturnPressed() ;
|
||||||
|
void SetEditCurrentArgument() ;
|
||||||
|
void SelectionIntoArgument() ;
|
||||||
|
void DeactivateActiveDialog() ;
|
||||||
|
void ActivateThisDialog() ;
|
||||||
|
void AllOrNotAll() ;
|
||||||
|
void ComboTextChanged() ;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QGridLayout* BuildGUI_SubShapeDlgLayout;
|
||||||
|
QGridLayout* GroupConstructorsLayout;
|
||||||
|
QGridLayout* GroupButtonsLayout;
|
||||||
|
QGridLayout* GroupC1Layout;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DIALOGBOX_SUBSHAPE_H
|
370
src/BuildGUI/BuildGUI_WireDlg.cxx
Normal file
370
src/BuildGUI/BuildGUI_WireDlg.cxx
Normal file
@ -0,0 +1,370 @@
|
|||||||
|
// 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 : BuildGUI_WireDlg.cxx
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
#include "BuildGUI_WireDlg.h"
|
||||||
|
|
||||||
|
#include <qbuttongroup.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <qlineedit.h>
|
||||||
|
#include <qpushbutton.h>
|
||||||
|
#include <qradiobutton.h>
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qtooltip.h>
|
||||||
|
#include <qwhatsthis.h>
|
||||||
|
#include <qimage.h>
|
||||||
|
#include <qpixmap.h>
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BuildGUI_WireDlg()
|
||||||
|
// purpose : Constructs a BuildGUI_WireDlg which is a child of 'parent', with the
|
||||||
|
// name 'name' and widget flags set to 'f'.
|
||||||
|
// The dialog will by default be modeless, unless you set 'modal' to
|
||||||
|
// TRUE to construct a modal dialog.
|
||||||
|
//=================================================================================
|
||||||
|
BuildGUI_WireDlg::BuildGUI_WireDlg(QWidget* parent, const char* name, BuildGUI* theBuildGUI, SALOME_Selection* Sel, bool modal, WFlags fl)
|
||||||
|
: QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
|
||||||
|
{
|
||||||
|
QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_BUILD_WIRE")));
|
||||||
|
QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT")));
|
||||||
|
|
||||||
|
if ( !name )
|
||||||
|
setName( "BuildGUI_WireDlg" );
|
||||||
|
resize( 303, 185 );
|
||||||
|
setCaption( tr( "GEOM_WIRE_TITLE" ) );
|
||||||
|
setSizeGripEnabled( TRUE );
|
||||||
|
BuildGUI_WireDlgLayout = new QGridLayout( this );
|
||||||
|
BuildGUI_WireDlgLayout->setSpacing( 6 );
|
||||||
|
BuildGUI_WireDlgLayout->setMargin( 11 );
|
||||||
|
|
||||||
|
/***************************************************************/
|
||||||
|
GroupConstructors = new QButtonGroup( this, "GroupConstructors" );
|
||||||
|
GroupConstructors->setTitle( tr( "GEOM_WIRE" ) );
|
||||||
|
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 );
|
||||||
|
BuildGUI_WireDlgLayout->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 );
|
||||||
|
BuildGUI_WireDlgLayout->addWidget( GroupButtons, 2, 0 );
|
||||||
|
|
||||||
|
/***************************************************************/
|
||||||
|
GroupC1 = new QGroupBox( this, "GroupC1" );
|
||||||
|
GroupC1->setTitle( tr( "GEOM_WIRE_CONNECT" ) );
|
||||||
|
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 );
|
||||||
|
TextLabelC1A1 = new QLabel( GroupC1, "TextLabelC1A1" );
|
||||||
|
TextLabelC1A1->setText( tr( "GEOM_OBJECTS" ) );
|
||||||
|
TextLabelC1A1->setMinimumSize( QSize( 50, 0 ) );
|
||||||
|
TextLabelC1A1->setFrameShape( QLabel::NoFrame );
|
||||||
|
TextLabelC1A1->setFrameShadow( QLabel::Plain );
|
||||||
|
GroupC1Layout->addWidget( TextLabelC1A1, 0, 0 );
|
||||||
|
SelectButtonC1A1 = new QPushButton( GroupC1, "SelectButtonC1A1" );
|
||||||
|
SelectButtonC1A1->setText( tr( "" ) );
|
||||||
|
SelectButtonC1A1->setPixmap( image1 );
|
||||||
|
SelectButtonC1A1->setToggleButton( FALSE );
|
||||||
|
GroupC1Layout->addWidget( SelectButtonC1A1, 0, 1 );
|
||||||
|
LineEditC1A1 = new QLineEdit( GroupC1, "LineEditC1A1" );
|
||||||
|
GroupC1Layout->addWidget( LineEditC1A1, 0, 2 );
|
||||||
|
BuildGUI_WireDlgLayout->addWidget( GroupC1, 1, 0 );
|
||||||
|
myBuildGUI = theBuildGUI;
|
||||||
|
Init(Sel) ; /* Initialisations */
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ~BuildGUI_WireDlg()
|
||||||
|
// purpose : Destroys the object and frees any allocated resources
|
||||||
|
//=================================================================================
|
||||||
|
BuildGUI_WireDlg::~BuildGUI_WireDlg()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : Init()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_WireDlg::Init( SALOME_Selection* Sel )
|
||||||
|
{
|
||||||
|
|
||||||
|
GroupC1->show();
|
||||||
|
myConstructorId = 0 ;
|
||||||
|
Constructor1->setChecked( TRUE );
|
||||||
|
myEditCurrentArgument = LineEditC1A1 ;
|
||||||
|
mySelection = Sel;
|
||||||
|
this->myOkListShapes = false ;
|
||||||
|
myGeomGUI = GEOMBase_Context::GetGeomGUI() ;
|
||||||
|
myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ;
|
||||||
|
|
||||||
|
// TODO : previous selection into argument
|
||||||
|
|
||||||
|
/* Filter definitions */
|
||||||
|
Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM");
|
||||||
|
myGeom = GEOM::GEOM_Gen::_narrow(comp);
|
||||||
|
|
||||||
|
/* signals and slots connections */
|
||||||
|
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( 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 ;
|
||||||
|
myGeomGUI->DefineDlgPosition( this, x, y ) ;
|
||||||
|
this->move( x, y ) ;
|
||||||
|
this->show() ; /* displays Dialog */
|
||||||
|
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ConstructorsClicked()
|
||||||
|
// purpose : Radio button management
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_WireDlg::ConstructorsClicked(int constructorId)
|
||||||
|
{
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnApply()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_WireDlg::ClickOnApply()
|
||||||
|
{
|
||||||
|
switch(myConstructorId)
|
||||||
|
{
|
||||||
|
case 0 :
|
||||||
|
{
|
||||||
|
if(myOkListShapes) {
|
||||||
|
myBuildGUI->MakeWireAndDisplay( myListShapes ) ;
|
||||||
|
}
|
||||||
|
break ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// accept();
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnOk()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_WireDlg::ClickOnOk()
|
||||||
|
{
|
||||||
|
this->ClickOnApply() ;
|
||||||
|
this->ClickOnCancel() ;
|
||||||
|
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ClickOnCancel()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_WireDlg::ClickOnCancel()
|
||||||
|
{
|
||||||
|
myGeomGUI->ResetState() ;
|
||||||
|
reject() ;
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SelectionIntoArgument()
|
||||||
|
// purpose : Called when selection as changed or other case
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_WireDlg::SelectionIntoArgument()
|
||||||
|
{
|
||||||
|
/* All this for first constructor */
|
||||||
|
// if(myEditCurrentArgument == LineEditC1A1 )
|
||||||
|
|
||||||
|
myEditCurrentArgument->setText("") ;
|
||||||
|
myOkListShapes = false;
|
||||||
|
QString aString = ""; /* Future name of selection */
|
||||||
|
|
||||||
|
int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ;
|
||||||
|
if(nbSel < 1)
|
||||||
|
return ;
|
||||||
|
|
||||||
|
myGeomGUI->ConvertListOfIOInListOfIOR(mySelection->StoredIObjects(), myListShapes) ;
|
||||||
|
myEditCurrentArgument->setText(aString) ;
|
||||||
|
myOkListShapes = true ;
|
||||||
|
/* no simulation */
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : SetEditCurrentArgument()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_WireDlg::SetEditCurrentArgument()
|
||||||
|
{
|
||||||
|
QPushButton* send = (QPushButton*)sender();
|
||||||
|
switch (myConstructorId)
|
||||||
|
{
|
||||||
|
case 0: /* default constructor */
|
||||||
|
{
|
||||||
|
if(send == SelectButtonC1A1) {
|
||||||
|
LineEditC1A1->setFocus() ;
|
||||||
|
myEditCurrentArgument = LineEditC1A1;
|
||||||
|
}
|
||||||
|
SelectionIntoArgument() ;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : LineEditReturnPressed()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_WireDlg::LineEditReturnPressed()
|
||||||
|
{
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : DeactivateActiveDialog()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_WireDlg::DeactivateActiveDialog()
|
||||||
|
{
|
||||||
|
if ( GroupConstructors->isEnabled() ) {
|
||||||
|
GroupConstructors->setEnabled(false) ;
|
||||||
|
GroupC1->setEnabled(false) ;
|
||||||
|
GroupButtons->setEnabled(false) ;
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : ActivateThisDialog()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_WireDlg::ActivateThisDialog()
|
||||||
|
{
|
||||||
|
/* Emit a signal to deactivate the active dialog */
|
||||||
|
myGeomGUI->EmitSignalDeactivateDialog() ;
|
||||||
|
GroupConstructors->setEnabled(true) ;
|
||||||
|
GroupC1->setEnabled(true) ;
|
||||||
|
GroupButtons->setEnabled(true) ;
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : enterEvent()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_WireDlg::enterEvent(QEvent* e)
|
||||||
|
{
|
||||||
|
if ( GroupConstructors->isEnabled() )
|
||||||
|
return ;
|
||||||
|
ActivateThisDialog() ;
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : closeEvent()
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
void BuildGUI_WireDlg::closeEvent( QCloseEvent* e )
|
||||||
|
{
|
||||||
|
/* same than click on cancel button */
|
||||||
|
this->ClickOnCancel() ;
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
104
src/BuildGUI/BuildGUI_WireDlg.h
Normal file
104
src/BuildGUI/BuildGUI_WireDlg.h
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
// 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 : BuildGUI_WireDlg.h
|
||||||
|
// Author : Lucien PIGNOLONI
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header$
|
||||||
|
|
||||||
|
#ifndef DIALOGBOX_WIRE_H
|
||||||
|
#define DIALOGBOX_WIRE_H
|
||||||
|
|
||||||
|
#include "BuildGUI.h"
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qdialog.h>
|
||||||
|
|
||||||
|
class QVBoxLayout;
|
||||||
|
class QHBoxLayout;
|
||||||
|
class QGridLayout;
|
||||||
|
class QButtonGroup;
|
||||||
|
class QGroupBox;
|
||||||
|
class QLabel;
|
||||||
|
class QLineEdit;
|
||||||
|
class QPushButton;
|
||||||
|
class QRadioButton;
|
||||||
|
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// class : BuildGUI_WireDlg
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
class BuildGUI_WireDlg : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
BuildGUI_WireDlg( QWidget* parent = 0, const char* name = 0, BuildGUI* theBuildGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
|
||||||
|
~BuildGUI_WireDlg();
|
||||||
|
|
||||||
|
private:
|
||||||
|
BuildGUI* myBuildGUI;
|
||||||
|
void Init( SALOME_Selection* Sel ) ;
|
||||||
|
void closeEvent( QCloseEvent* e ) ;
|
||||||
|
void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */
|
||||||
|
|
||||||
|
GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */
|
||||||
|
GEOMBase_Context* myGeomGUI ; /* Current GeomGUI object */
|
||||||
|
SALOME_Selection* mySelection ; /* User shape selection */
|
||||||
|
GEOM::GEOM_Gen::ListOfIOR myListShapes ;
|
||||||
|
bool myOkListShapes ; /* to check when arguments is defined */
|
||||||
|
int myConstructorId ; /* Current constructor id = radio button id */
|
||||||
|
QLineEdit* myEditCurrentArgument; /* Current LineEdit */
|
||||||
|
|
||||||
|
QButtonGroup* GroupConstructors;
|
||||||
|
QRadioButton* Constructor1;
|
||||||
|
QGroupBox* GroupButtons;
|
||||||
|
QPushButton* buttonOk;
|
||||||
|
QPushButton* buttonCancel;
|
||||||
|
QPushButton* buttonApply;
|
||||||
|
QGroupBox* GroupC1;
|
||||||
|
QLabel* TextLabelC1A1;
|
||||||
|
QPushButton* SelectButtonC1A1;
|
||||||
|
QLineEdit* LineEditC1A1;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
|
||||||
|
void ConstructorsClicked(int constructorId);
|
||||||
|
void ClickOnOk();
|
||||||
|
void ClickOnCancel();
|
||||||
|
void ClickOnApply();
|
||||||
|
void SetEditCurrentArgument() ;
|
||||||
|
void LineEditReturnPressed() ;
|
||||||
|
void SelectionIntoArgument() ;
|
||||||
|
void DeactivateActiveDialog() ;
|
||||||
|
void ActivateThisDialog() ;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QGridLayout* BuildGUI_WireDlgLayout;
|
||||||
|
QGridLayout* GroupConstructorsLayout;
|
||||||
|
QGridLayout* GroupButtonsLayout;
|
||||||
|
QGridLayout* GroupC1Layout;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DIALOGBOX_WIRE_H
|
79
src/BuildGUI/Makefile.in
Normal file
79
src/BuildGUI/Makefile.in
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
# GEOM BUILDGUI :
|
||||||
|
#
|
||||||
|
# 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 : Makefile.in
|
||||||
|
# Author : Damien COQUERET (OCC)
|
||||||
|
# Module : GEOM
|
||||||
|
# $Header:
|
||||||
|
|
||||||
|
top_srcdir=@top_srcdir@
|
||||||
|
top_builddir=../..
|
||||||
|
srcdir=@srcdir@
|
||||||
|
VPATH=.:@srcdir@:@top_srcdir@/idl
|
||||||
|
|
||||||
|
|
||||||
|
@COMMENCE@
|
||||||
|
|
||||||
|
# header files
|
||||||
|
EXPORT_HEADERS= BuildGUI.h
|
||||||
|
|
||||||
|
# Libraries targets
|
||||||
|
LIB = libBuildGUI.la
|
||||||
|
|
||||||
|
LIB_SRC = BuildGUI.cxx \
|
||||||
|
BuildGUI_SubShapeDlg.cxx \
|
||||||
|
BuildGUI_EdgeDlg.cxx \
|
||||||
|
BuildGUI_WireDlg.cxx \
|
||||||
|
BuildGUI_FaceDlg.cxx \
|
||||||
|
BuildGUI_ShellDlg.cxx \
|
||||||
|
BuildGUI_SolidDlg.cxx \
|
||||||
|
BuildGUI_CompoundDlg.cxx
|
||||||
|
|
||||||
|
LIB_MOC = \
|
||||||
|
BuildGUI.h \
|
||||||
|
BuildGUI_SubShapeDlg.h \
|
||||||
|
BuildGUI_EdgeDlg.h \
|
||||||
|
BuildGUI_WireDlg.h \
|
||||||
|
BuildGUI_FaceDlg.h \
|
||||||
|
BuildGUI_ShellDlg.h \
|
||||||
|
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_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 += -lOCCViewer -lVTKViewer -lSalomeObject -lSalomeGUI -lGEOMClient -lGEOMObject -lGEOMFiltersSelection -lDlgRef -lGEOMBase $(OCC_KERNEL_LIBS) $(OCC_MODELER_LIBS) -L${KERNEL_ROOT_DIR}/lib/salome
|
||||||
|
|
||||||
|
@CONCLUDE@
|
54
src/DlgRef/DlgRef_1Sel1Spin.cxx
Normal file
54
src/DlgRef/DlgRef_1Sel1Spin.cxx
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
|
//
|
||||||
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// File : DlgRef_1Sel1Spin.cxx
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#include "DlgRef_1Sel1Spin.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_1Sel1Spin::DlgRef_1Sel1Spin(QWidget* parent, const char* name, WFlags fl)
|
||||||
|
:DlgRef_1Sel1Spin_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_1Sel1Spin::~DlgRef_1Sel1Spin()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
47
src/DlgRef/DlgRef_1Sel1Spin.h
Normal file
47
src/DlgRef/DlgRef_1Sel1Spin.h
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
|
//
|
||||||
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// File : DlgRef_1Sel1Spin.h
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#ifndef DLGREF_1SEL1SPIN_H
|
||||||
|
#define DLGREF_1SEL1SPIN_H
|
||||||
|
|
||||||
|
#include "DlgRef_1Sel1Spin_QTD.h"
|
||||||
|
#include "DlgRef_SpinBox.h"
|
||||||
|
|
||||||
|
class DlgRef_1Sel1Spin : public DlgRef_1Sel1Spin_QTD
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_1Sel1Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||||
|
~DlgRef_1Sel1Spin();
|
||||||
|
|
||||||
|
DlgRef_SpinBox* SpinBox_DX;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_1SEL1SPIN_H
|
89
src/DlgRef/DlgRef_1Sel1Spin_QTD.cxx
Normal file
89
src/DlgRef/DlgRef_1Sel1Spin_QTD.cxx
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form implementation generated from reading ui file 'DlgRef_1Sel1Spin_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: mar sep 23 16:05:08 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#include "DlgRef_1Sel1Spin_QTD.h"
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <qlineedit.h>
|
||||||
|
#include <qpushbutton.h>
|
||||||
|
#include <qspinbox.h>
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qtooltip.h>
|
||||||
|
#include <qwhatsthis.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_1Sel1Spin_QTD which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'.
|
||||||
|
*/
|
||||||
|
DlgRef_1Sel1Spin_QTD::DlgRef_1Sel1Spin_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||||
|
: QWidget( parent, name, fl )
|
||||||
|
{
|
||||||
|
if ( !name )
|
||||||
|
setName( "DlgRef_1Sel1Spin_QTD" );
|
||||||
|
resize( 129, 87 );
|
||||||
|
setCaption( trUtf8( "DlgRef_1Sel1Spin_QTD" ) );
|
||||||
|
DlgRef_1Sel1Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_1Sel1Spin_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");
|
||||||
|
|
||||||
|
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 );
|
||||||
|
|
||||||
|
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 );
|
||||||
|
|
||||||
|
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
|
||||||
|
|
||||||
|
Layout1->addWidget( LineEdit1, 0, 2 );
|
||||||
|
|
||||||
|
Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
|
||||||
|
|
||||||
|
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 );
|
||||||
|
|
||||||
|
SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
|
||||||
|
SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( SpinBox1, 0, 1 );
|
||||||
|
|
||||||
|
Layout1->addMultiCellLayout( Layout2, 1, 1, 0, 2 );
|
||||||
|
QSpacerItem* spacer = new QSpacerItem( 0, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||||
|
Layout1->addItem( spacer, 2, 2 );
|
||||||
|
|
||||||
|
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||||
|
|
||||||
|
DlgRef_1Sel1Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
DlgRef_1Sel1Spin_QTD::~DlgRef_1Sel1Spin_QTD()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
46
src/DlgRef/DlgRef_1Sel1Spin_QTD.h
Normal file
46
src/DlgRef/DlgRef_1Sel1Spin_QTD.h
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form interface generated from reading ui file 'DlgRef_1Sel1Spin_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: mar sep 23 16:05:08 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#ifndef DLGREF_1SEL1SPIN_QTD_H
|
||||||
|
#define DLGREF_1SEL1SPIN_QTD_H
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qwidget.h>
|
||||||
|
class QVBoxLayout;
|
||||||
|
class QHBoxLayout;
|
||||||
|
class QGridLayout;
|
||||||
|
class QGroupBox;
|
||||||
|
class QLabel;
|
||||||
|
class QLineEdit;
|
||||||
|
class QPushButton;
|
||||||
|
class QSpinBox;
|
||||||
|
|
||||||
|
class DlgRef_1Sel1Spin_QTD : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_1Sel1Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||||
|
~DlgRef_1Sel1Spin_QTD();
|
||||||
|
|
||||||
|
QGroupBox* GroupBox1;
|
||||||
|
QPushButton* PushButton1;
|
||||||
|
QLabel* TextLabel1;
|
||||||
|
QLineEdit* LineEdit1;
|
||||||
|
QLabel* TextLabel2;
|
||||||
|
QSpinBox* SpinBox1;
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QGridLayout* DlgRef_1Sel1Spin_QTDLayout;
|
||||||
|
QGridLayout* GroupBox1Layout;
|
||||||
|
QGridLayout* Layout1;
|
||||||
|
QGridLayout* Layout2;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_1SEL1SPIN_QTD_H
|
60
src/DlgRef/DlgRef_1Sel2Spin.cxx
Normal file
60
src/DlgRef/DlgRef_1Sel2Spin.cxx
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
// 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_1Sel2Spin.cxx
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#include "DlgRef_1Sel2Spin.h"
|
||||||
|
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qspinbox.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_1Sel2Spin which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'
|
||||||
|
*/
|
||||||
|
DlgRef_1Sel2Spin::DlgRef_1Sel2Spin(QWidget* parent, const char* name, WFlags fl)
|
||||||
|
:DlgRef_1Sel2Spin_QTD(parent, name, fl)
|
||||||
|
{
|
||||||
|
SpinBox1->close(TRUE);
|
||||||
|
SpinBox2->close(TRUE);
|
||||||
|
|
||||||
|
SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
|
||||||
|
Layout2->addWidget(SpinBox_DX, 0, 1);
|
||||||
|
|
||||||
|
SpinBox_DY = new DlgRef_SpinBox( GroupBox1, "SpinBox_DY");
|
||||||
|
Layout2->addWidget(SpinBox_DY, 1, 1);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
DlgRef_1Sel2Spin::~DlgRef_1Sel2Spin()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
48
src/DlgRef/DlgRef_1Sel2Spin.h
Normal file
48
src/DlgRef/DlgRef_1Sel2Spin.h
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
// 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_1Sel2Spin.h
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#ifndef DLGREF_1SEL2SPIN_H
|
||||||
|
#define DLGREF_1SEL2SPIN_H
|
||||||
|
|
||||||
|
#include "DlgRef_1Sel2Spin_QTD.h"
|
||||||
|
#include "DlgRef_SpinBox.h"
|
||||||
|
|
||||||
|
class DlgRef_1Sel2Spin : public DlgRef_1Sel2Spin_QTD
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_1Sel2Spin(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
|
||||||
|
~DlgRef_1Sel2Spin();
|
||||||
|
|
||||||
|
DlgRef_SpinBox* SpinBox_DX;
|
||||||
|
DlgRef_SpinBox* SpinBox_DY;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_1SEL2SPIN_H
|
100
src/DlgRef/DlgRef_1Sel2Spin_QTD.cxx
Normal file
100
src/DlgRef/DlgRef_1Sel2Spin_QTD.cxx
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form implementation generated from reading ui file 'DlgRef_1Sel2Spin_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: jeu oct 2 11:08:05 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#include "DlgRef_1Sel2Spin_QTD.h"
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <qlineedit.h>
|
||||||
|
#include <qpushbutton.h>
|
||||||
|
#include <qspinbox.h>
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qtooltip.h>
|
||||||
|
#include <qwhatsthis.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_1Sel2Spin_QTD which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'.
|
||||||
|
*/
|
||||||
|
DlgRef_1Sel2Spin_QTD::DlgRef_1Sel2Spin_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||||
|
: QWidget( parent, name, fl )
|
||||||
|
{
|
||||||
|
if ( !name )
|
||||||
|
setName( "DlgRef_1Sel2Spin_QTD" );
|
||||||
|
resize( 129, 115 );
|
||||||
|
setCaption( trUtf8( "DlgRef_1Sel2Spin_QTD" ) );
|
||||||
|
DlgRef_1Sel2Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_1Sel2Spin_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");
|
||||||
|
|
||||||
|
Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
|
||||||
|
|
||||||
|
TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
|
||||||
|
TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel3->setText( trUtf8( "TL3" ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( TextLabel3, 1, 0 );
|
||||||
|
|
||||||
|
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 );
|
||||||
|
|
||||||
|
SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" );
|
||||||
|
SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( SpinBox2, 1, 1 );
|
||||||
|
|
||||||
|
Layout1->addMultiCellLayout( Layout2, 1, 1, 0, 2 );
|
||||||
|
|
||||||
|
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
|
||||||
|
|
||||||
|
Layout1->addWidget( LineEdit1, 0, 2 );
|
||||||
|
QSpacerItem* spacer = new QSpacerItem( 0, 30, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||||
|
Layout1->addItem( spacer, 2, 2 );
|
||||||
|
|
||||||
|
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 );
|
||||||
|
|
||||||
|
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 );
|
||||||
|
|
||||||
|
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||||
|
|
||||||
|
DlgRef_1Sel2Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
DlgRef_1Sel2Spin_QTD::~DlgRef_1Sel2Spin_QTD()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
48
src/DlgRef/DlgRef_1Sel2Spin_QTD.h
Normal file
48
src/DlgRef/DlgRef_1Sel2Spin_QTD.h
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form interface generated from reading ui file 'DlgRef_1Sel2Spin_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: jeu oct 2 11:08:05 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#ifndef DLGREF_1SEL2SPIN_QTD_H
|
||||||
|
#define DLGREF_1SEL2SPIN_QTD_H
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qwidget.h>
|
||||||
|
class QVBoxLayout;
|
||||||
|
class QHBoxLayout;
|
||||||
|
class QGridLayout;
|
||||||
|
class QGroupBox;
|
||||||
|
class QLabel;
|
||||||
|
class QLineEdit;
|
||||||
|
class QPushButton;
|
||||||
|
class QSpinBox;
|
||||||
|
|
||||||
|
class DlgRef_1Sel2Spin_QTD : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_1Sel2Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||||
|
~DlgRef_1Sel2Spin_QTD();
|
||||||
|
|
||||||
|
QGroupBox* GroupBox1;
|
||||||
|
QLabel* TextLabel3;
|
||||||
|
QSpinBox* SpinBox1;
|
||||||
|
QLabel* TextLabel2;
|
||||||
|
QSpinBox* SpinBox2;
|
||||||
|
QLineEdit* LineEdit1;
|
||||||
|
QPushButton* PushButton1;
|
||||||
|
QLabel* TextLabel1;
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QGridLayout* DlgRef_1Sel2Spin_QTDLayout;
|
||||||
|
QGridLayout* GroupBox1Layout;
|
||||||
|
QGridLayout* Layout1;
|
||||||
|
QGridLayout* Layout2;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_1SEL2SPIN_QTD_H
|
63
src/DlgRef/DlgRef_1Sel3Spin.cxx
Normal file
63
src/DlgRef/DlgRef_1Sel3Spin.cxx
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
// 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_1Sel3Spin.cxx
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#include "DlgRef_1Sel3Spin.h"
|
||||||
|
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qspinbox.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_1Sel3Spin which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'
|
||||||
|
*/
|
||||||
|
DlgRef_1Sel3Spin::DlgRef_1Sel3Spin(QWidget* parent, const char* name, WFlags fl)
|
||||||
|
:DlgRef_1Sel3Spin_QTD(parent, name, fl)
|
||||||
|
{
|
||||||
|
SpinBox1->close(TRUE);
|
||||||
|
SpinBox2->close(TRUE);
|
||||||
|
SpinBox3->close(TRUE);
|
||||||
|
|
||||||
|
SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
|
||||||
|
Layout2->addWidget(SpinBox_DX, 0, 1);
|
||||||
|
|
||||||
|
SpinBox_DY = new DlgRef_SpinBox( GroupBox1, "SpinBox_DY");
|
||||||
|
Layout2->addWidget(SpinBox_DY, 0, 3);
|
||||||
|
|
||||||
|
SpinBox_DZ = new DlgRef_SpinBox( GroupBox1, "SpinBox_DZ");
|
||||||
|
Layout2->addWidget(SpinBox_DZ, 0, 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
DlgRef_1Sel3Spin::~DlgRef_1Sel3Spin()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
49
src/DlgRef/DlgRef_1Sel3Spin.h
Normal file
49
src/DlgRef/DlgRef_1Sel3Spin.h
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
// 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_1Sel3Spin.h
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#ifndef DLGREF_1SEL3SPIN_H
|
||||||
|
#define DLGREF_1SEL3SPIN_H
|
||||||
|
|
||||||
|
#include "DlgRef_1Sel3Spin_QTD.h"
|
||||||
|
#include "DlgRef_SpinBox.h"
|
||||||
|
|
||||||
|
class DlgRef_1Sel3Spin : public DlgRef_1Sel3Spin_QTD
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_1Sel3Spin(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
|
||||||
|
~DlgRef_1Sel3Spin();
|
||||||
|
|
||||||
|
DlgRef_SpinBox* SpinBox_DX;
|
||||||
|
DlgRef_SpinBox* SpinBox_DY;
|
||||||
|
DlgRef_SpinBox* SpinBox_DZ;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_1SEL3SPIN_H
|
111
src/DlgRef/DlgRef_1Sel3Spin_QTD.cxx
Normal file
111
src/DlgRef/DlgRef_1Sel3Spin_QTD.cxx
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form implementation generated from reading ui file 'DlgRef_1Sel3Spin_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: mer oct 1 16:53:03 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#include "DlgRef_1Sel3Spin_QTD.h"
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <qlineedit.h>
|
||||||
|
#include <qpushbutton.h>
|
||||||
|
#include <qspinbox.h>
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qtooltip.h>
|
||||||
|
#include <qwhatsthis.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_1Sel3Spin_QTD which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'.
|
||||||
|
*/
|
||||||
|
DlgRef_1Sel3Spin_QTD::DlgRef_1Sel3Spin_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||||
|
: QWidget( parent, name, fl )
|
||||||
|
{
|
||||||
|
if ( !name )
|
||||||
|
setName( "DlgRef_1Sel3Spin_QTD" );
|
||||||
|
resize( 232, 87 );
|
||||||
|
setCaption( trUtf8( "DlgRef_1Sel3Spin_QTD" ) );
|
||||||
|
DlgRef_1Sel3Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_1Sel3Spin_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");
|
||||||
|
|
||||||
|
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, 207, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||||
|
Layout1->addItem( spacer, 2, 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 );
|
||||||
|
|
||||||
|
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
|
||||||
|
|
||||||
|
Layout1->addWidget( LineEdit1, 0, 2 );
|
||||||
|
|
||||||
|
Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
|
||||||
|
|
||||||
|
TextLabel4 = new QLabel( GroupBox1, "TextLabel4" );
|
||||||
|
TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel4->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel4->setText( trUtf8( "TL4" ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( TextLabel4, 0, 5 );
|
||||||
|
|
||||||
|
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, 1 );
|
||||||
|
|
||||||
|
TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
|
||||||
|
TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel3->setText( trUtf8( "TL3" ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( TextLabel3, 0, 3 );
|
||||||
|
|
||||||
|
SpinBox3 = new QSpinBox( GroupBox1, "SpinBox3" );
|
||||||
|
SpinBox3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox3->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( SpinBox3, 0, 6 );
|
||||||
|
|
||||||
|
SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
|
||||||
|
SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( SpinBox1, 0, 2 );
|
||||||
|
|
||||||
|
SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" );
|
||||||
|
SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( SpinBox2, 0, 4 );
|
||||||
|
|
||||||
|
Layout1->addMultiCellLayout( Layout2, 1, 1, 0, 2 );
|
||||||
|
|
||||||
|
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||||
|
|
||||||
|
DlgRef_1Sel3Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
DlgRef_1Sel3Spin_QTD::~DlgRef_1Sel3Spin_QTD()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
50
src/DlgRef/DlgRef_1Sel3Spin_QTD.h
Normal file
50
src/DlgRef/DlgRef_1Sel3Spin_QTD.h
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form interface generated from reading ui file 'DlgRef_1Sel3Spin_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: mer oct 1 16:53:02 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#ifndef DLGREF_1SEL3SPIN_QTD_H
|
||||||
|
#define DLGREF_1SEL3SPIN_QTD_H
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qwidget.h>
|
||||||
|
class QVBoxLayout;
|
||||||
|
class QHBoxLayout;
|
||||||
|
class QGridLayout;
|
||||||
|
class QGroupBox;
|
||||||
|
class QLabel;
|
||||||
|
class QLineEdit;
|
||||||
|
class QPushButton;
|
||||||
|
class QSpinBox;
|
||||||
|
|
||||||
|
class DlgRef_1Sel3Spin_QTD : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_1Sel3Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||||
|
~DlgRef_1Sel3Spin_QTD();
|
||||||
|
|
||||||
|
QGroupBox* GroupBox1;
|
||||||
|
QPushButton* PushButton1;
|
||||||
|
QLabel* TextLabel1;
|
||||||
|
QLineEdit* LineEdit1;
|
||||||
|
QLabel* TextLabel4;
|
||||||
|
QLabel* TextLabel2;
|
||||||
|
QLabel* TextLabel3;
|
||||||
|
QSpinBox* SpinBox3;
|
||||||
|
QSpinBox* SpinBox1;
|
||||||
|
QSpinBox* SpinBox2;
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QGridLayout* DlgRef_1Sel3Spin_QTDLayout;
|
||||||
|
QGridLayout* GroupBox1Layout;
|
||||||
|
QGridLayout* Layout1;
|
||||||
|
QGridLayout* Layout2;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_1SEL3SPIN_QTD_H
|
67
src/DlgRef/DlgRef_1Sel4Spin.cxx
Normal file
67
src/DlgRef/DlgRef_1Sel4Spin.cxx
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
// 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_1Sel4Spin.cxx
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#include "DlgRef_1Sel4Spin.h"
|
||||||
|
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qspinbox.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_1Sel4Spin which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'
|
||||||
|
*/
|
||||||
|
DlgRef_1Sel4Spin::DlgRef_1Sel4Spin(QWidget* parent, const char* name, WFlags fl)
|
||||||
|
:DlgRef_1Sel4Spin_QTD(parent, name, fl)
|
||||||
|
{
|
||||||
|
SpinBox1->close(TRUE);
|
||||||
|
SpinBox2->close(TRUE);
|
||||||
|
SpinBox3->close(TRUE);
|
||||||
|
SpinBox4->close(TRUE);
|
||||||
|
|
||||||
|
SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
|
||||||
|
Layout3->addWidget(SpinBox_DX, 0, 2);
|
||||||
|
|
||||||
|
SpinBox_DY = new DlgRef_SpinBox( GroupBox1, "SpinBox_DY");
|
||||||
|
Layout3->addWidget(SpinBox_DY, 0, 4);
|
||||||
|
|
||||||
|
SpinBox_DZ = new DlgRef_SpinBox( GroupBox1, "SpinBox_DZ");
|
||||||
|
Layout3->addWidget(SpinBox_DZ, 0, 6);
|
||||||
|
|
||||||
|
SpinBox_S = new DlgRef_SpinBox( GroupBox1, "SpinBox_S");
|
||||||
|
Layout4->addWidget(SpinBox_S, 0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
DlgRef_1Sel4Spin::~DlgRef_1Sel4Spin()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
51
src/DlgRef/DlgRef_1Sel4Spin.h
Normal file
51
src/DlgRef/DlgRef_1Sel4Spin.h
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
// 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_1Sel4Spin.h
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#ifndef DLGREF_1SEL4SPIN_H
|
||||||
|
#define DLGREF_1SEL4SPIN_H
|
||||||
|
|
||||||
|
#include "DlgRef_1Sel4Spin_QTD.h"
|
||||||
|
#include "DlgRef_SpinBox.h"
|
||||||
|
|
||||||
|
class DlgRef_1Sel4Spin : public DlgRef_1Sel4Spin_QTD
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_1Sel4Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||||
|
~DlgRef_1Sel4Spin();
|
||||||
|
|
||||||
|
DlgRef_SpinBox* SpinBox_DX;
|
||||||
|
DlgRef_SpinBox* SpinBox_DY;
|
||||||
|
DlgRef_SpinBox* SpinBox_DZ;
|
||||||
|
|
||||||
|
DlgRef_SpinBox* SpinBox_S;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_1SEL4SPIN_H
|
132
src/DlgRef/DlgRef_1Sel4Spin_QTD.cxx
Normal file
132
src/DlgRef/DlgRef_1Sel4Spin_QTD.cxx
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form implementation generated from reading ui file 'DlgRef_1Sel4Spin_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: mar sep 23 16:05:09 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#include "DlgRef_1Sel4Spin_QTD.h"
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <qlineedit.h>
|
||||||
|
#include <qpushbutton.h>
|
||||||
|
#include <qspinbox.h>
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qtooltip.h>
|
||||||
|
#include <qwhatsthis.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_1Sel4Spin_QTD which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'.
|
||||||
|
*/
|
||||||
|
DlgRef_1Sel4Spin_QTD::DlgRef_1Sel4Spin_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||||
|
: QWidget( parent, name, fl )
|
||||||
|
{
|
||||||
|
if ( !name )
|
||||||
|
setName( "DlgRef_1Sel4Spin_QTD" );
|
||||||
|
resize( 284, 119 );
|
||||||
|
setCaption( trUtf8( "DlgRef_1Sel4Spin_QTD" ) );
|
||||||
|
DlgRef_1Sel4Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_1Sel4Spin_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");
|
||||||
|
|
||||||
|
Layout3 = new QGridLayout( 0, 1, 1, 0, 6, "Layout3");
|
||||||
|
|
||||||
|
TextLabel5 = new QLabel( GroupBox1, "TextLabel5" );
|
||||||
|
TextLabel5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel5->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel5->setText( trUtf8( "TL5" ) );
|
||||||
|
|
||||||
|
Layout3->addWidget( TextLabel5, 0, 5 );
|
||||||
|
|
||||||
|
TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
|
||||||
|
TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel3->setText( trUtf8( "TL3" ) );
|
||||||
|
|
||||||
|
Layout3->addWidget( TextLabel3, 0, 1 );
|
||||||
|
|
||||||
|
TextLabel4 = new QLabel( GroupBox1, "TextLabel4" );
|
||||||
|
TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel4->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel4->setText( trUtf8( "TL4" ) );
|
||||||
|
|
||||||
|
Layout3->addWidget( TextLabel4, 0, 3 );
|
||||||
|
|
||||||
|
SpinBox3 = new QSpinBox( GroupBox1, "SpinBox3" );
|
||||||
|
SpinBox3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox3->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout3->addWidget( SpinBox3, 0, 6 );
|
||||||
|
|
||||||
|
SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
|
||||||
|
SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout3->addWidget( SpinBox1, 0, 2 );
|
||||||
|
|
||||||
|
TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
|
||||||
|
TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel2->setText( trUtf8( "TL2" ) );
|
||||||
|
|
||||||
|
Layout3->addWidget( TextLabel2, 0, 0 );
|
||||||
|
|
||||||
|
SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" );
|
||||||
|
SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout3->addWidget( SpinBox2, 0, 4 );
|
||||||
|
|
||||||
|
Layout1->addLayout( Layout3, 1, 0 );
|
||||||
|
QSpacerItem* spacer = new QSpacerItem( 0, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||||
|
Layout1->addItem( spacer, 3, 0 );
|
||||||
|
|
||||||
|
Layout4 = new QGridLayout( 0, 1, 1, 0, 6, "Layout4");
|
||||||
|
|
||||||
|
TextLabel6 = new QLabel( GroupBox1, "TextLabel6" );
|
||||||
|
TextLabel6->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel6->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel6->setText( trUtf8( "TL6" ) );
|
||||||
|
|
||||||
|
Layout4->addWidget( TextLabel6, 0, 0 );
|
||||||
|
|
||||||
|
SpinBox4 = new QSpinBox( GroupBox1, "SpinBox4" );
|
||||||
|
|
||||||
|
Layout4->addWidget( SpinBox4, 0, 1 );
|
||||||
|
|
||||||
|
Layout1->addLayout( Layout4, 2, 0 );
|
||||||
|
|
||||||
|
Layout2 = new QHBoxLayout( 0, 0, 6, "Layout2");
|
||||||
|
|
||||||
|
TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
|
||||||
|
TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel1->setText( trUtf8( "TL1" ) );
|
||||||
|
Layout2->addWidget( TextLabel1 );
|
||||||
|
|
||||||
|
PushButton1 = new QPushButton( GroupBox1, "PushButton1" );
|
||||||
|
PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
PushButton1->setText( trUtf8( "" ) );
|
||||||
|
Layout2->addWidget( PushButton1 );
|
||||||
|
|
||||||
|
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
|
||||||
|
Layout2->addWidget( LineEdit1 );
|
||||||
|
|
||||||
|
Layout1->addLayout( Layout2, 0, 0 );
|
||||||
|
|
||||||
|
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||||
|
|
||||||
|
DlgRef_1Sel4Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
DlgRef_1Sel4Spin_QTD::~DlgRef_1Sel4Spin_QTD()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
55
src/DlgRef/DlgRef_1Sel4Spin_QTD.h
Normal file
55
src/DlgRef/DlgRef_1Sel4Spin_QTD.h
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form interface generated from reading ui file 'DlgRef_1Sel4Spin_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: mar sep 23 16:05:09 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#ifndef DLGREF_1SEL4SPIN_QTD_H
|
||||||
|
#define DLGREF_1SEL4SPIN_QTD_H
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qwidget.h>
|
||||||
|
class QVBoxLayout;
|
||||||
|
class QHBoxLayout;
|
||||||
|
class QGridLayout;
|
||||||
|
class QGroupBox;
|
||||||
|
class QLabel;
|
||||||
|
class QLineEdit;
|
||||||
|
class QPushButton;
|
||||||
|
class QSpinBox;
|
||||||
|
|
||||||
|
class DlgRef_1Sel4Spin_QTD : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_1Sel4Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||||
|
~DlgRef_1Sel4Spin_QTD();
|
||||||
|
|
||||||
|
QGroupBox* GroupBox1;
|
||||||
|
QLabel* TextLabel5;
|
||||||
|
QLabel* TextLabel3;
|
||||||
|
QLabel* TextLabel4;
|
||||||
|
QSpinBox* SpinBox3;
|
||||||
|
QSpinBox* SpinBox1;
|
||||||
|
QLabel* TextLabel2;
|
||||||
|
QSpinBox* SpinBox2;
|
||||||
|
QLabel* TextLabel6;
|
||||||
|
QSpinBox* SpinBox4;
|
||||||
|
QLabel* TextLabel1;
|
||||||
|
QPushButton* PushButton1;
|
||||||
|
QLineEdit* LineEdit1;
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QGridLayout* DlgRef_1Sel4Spin_QTDLayout;
|
||||||
|
QGridLayout* GroupBox1Layout;
|
||||||
|
QGridLayout* Layout1;
|
||||||
|
QGridLayout* Layout3;
|
||||||
|
QGridLayout* Layout4;
|
||||||
|
QHBoxLayout* Layout2;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_1SEL4SPIN_QTD_H
|
71
src/DlgRef/DlgRef_1Sel5Spin.cxx
Normal file
71
src/DlgRef/DlgRef_1Sel5Spin.cxx
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
// 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_1Sel5Spin.cxx
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#include "DlgRef_1Sel5Spin.h"
|
||||||
|
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qspinbox.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_1Sel5Spin which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'
|
||||||
|
*/
|
||||||
|
DlgRef_1Sel5Spin::DlgRef_1Sel5Spin(QWidget* parent, const char* name, WFlags fl)
|
||||||
|
:DlgRef_1Sel5Spin_QTD(parent, name, fl)
|
||||||
|
{
|
||||||
|
SpinBox1->close(TRUE);
|
||||||
|
SpinBox2->close(TRUE);
|
||||||
|
SpinBox3->close(TRUE);
|
||||||
|
SpinBox4->close(TRUE);
|
||||||
|
SpinBox5->close(TRUE);
|
||||||
|
|
||||||
|
SpinBox_1 = new DlgRef_SpinBox(GroupBox1, "SpinBox_1");
|
||||||
|
Layout2->addWidget(SpinBox_1, 0, 1);
|
||||||
|
|
||||||
|
SpinBox_2 = new DlgRef_SpinBox(GroupBox1, "SpinBox_2");
|
||||||
|
Layout2->addWidget(SpinBox_2, 0, 3);
|
||||||
|
|
||||||
|
SpinBox_3 = new DlgRef_SpinBox(GroupBox1, "SpinBox_3");
|
||||||
|
Layout2->addWidget(SpinBox_3, 0, 5);
|
||||||
|
|
||||||
|
SpinBox_4 = new DlgRef_SpinBox(GroupBox1, "SpinBox_4");
|
||||||
|
Layout2->addWidget(SpinBox_4, 1, 1);
|
||||||
|
|
||||||
|
SpinBox_5 = new DlgRef_SpinBox(GroupBox1, "SpinBox_5");
|
||||||
|
Layout2->addWidget(SpinBox_5, 1, 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
DlgRef_1Sel5Spin::~DlgRef_1Sel5Spin()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
51
src/DlgRef/DlgRef_1Sel5Spin.h
Normal file
51
src/DlgRef/DlgRef_1Sel5Spin.h
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
// 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_1Sel5Spin.h
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#ifndef DLGREF_1SEL5SPIN_H
|
||||||
|
#define DLGREF_1SEL5SPIN_H
|
||||||
|
|
||||||
|
#include "DlgRef_1Sel5Spin_QTD.h"
|
||||||
|
#include "DlgRef_SpinBox.h"
|
||||||
|
|
||||||
|
class DlgRef_1Sel5Spin : public DlgRef_1Sel5Spin_QTD
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_1Sel5Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||||
|
~DlgRef_1Sel5Spin();
|
||||||
|
|
||||||
|
DlgRef_SpinBox* SpinBox_1;
|
||||||
|
DlgRef_SpinBox* SpinBox_2;
|
||||||
|
DlgRef_SpinBox* SpinBox_3;
|
||||||
|
DlgRef_SpinBox* SpinBox_4;
|
||||||
|
DlgRef_SpinBox* SpinBox_5;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_1SEL5SPIN_H
|
133
src/DlgRef/DlgRef_1Sel5Spin_QTD.cxx
Normal file
133
src/DlgRef/DlgRef_1Sel5Spin_QTD.cxx
Normal file
@ -0,0 +1,133 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form implementation generated from reading ui file 'DlgRef_1Sel5Spin_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: jeu oct 2 10:50:22 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#include "DlgRef_1Sel5Spin_QTD.h"
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <qlineedit.h>
|
||||||
|
#include <qpushbutton.h>
|
||||||
|
#include <qspinbox.h>
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qtooltip.h>
|
||||||
|
#include <qwhatsthis.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_1Sel5Spin_QTD which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'.
|
||||||
|
*/
|
||||||
|
DlgRef_1Sel5Spin_QTD::DlgRef_1Sel5Spin_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||||
|
: QWidget( parent, name, fl )
|
||||||
|
{
|
||||||
|
if ( !name )
|
||||||
|
setName( "DlgRef_1Sel5Spin_QTD" );
|
||||||
|
resize( 232, 115 );
|
||||||
|
setCaption( trUtf8( "DlgRef_1Sel5Spin_QTD" ) );
|
||||||
|
DlgRef_1Sel5Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_1Sel5Spin_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");
|
||||||
|
|
||||||
|
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 );
|
||||||
|
|
||||||
|
Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
|
||||||
|
|
||||||
|
TextLabel6 = new QLabel( GroupBox1, "TextLabel6" );
|
||||||
|
TextLabel6->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel6->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel6->setText( trUtf8( "TL6" ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( TextLabel6, 1, 2 );
|
||||||
|
|
||||||
|
SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
|
||||||
|
SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( SpinBox1, 0, 1 );
|
||||||
|
|
||||||
|
SpinBox4 = new QSpinBox( GroupBox1, "SpinBox4" );
|
||||||
|
SpinBox4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox4->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( SpinBox4, 1, 1 );
|
||||||
|
|
||||||
|
TextLabel5 = new QLabel( GroupBox1, "TextLabel5" );
|
||||||
|
TextLabel5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel5->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel5->setText( trUtf8( "TL5" ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( TextLabel5, 1, 0 );
|
||||||
|
|
||||||
|
SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" );
|
||||||
|
SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( SpinBox2, 0, 3 );
|
||||||
|
|
||||||
|
SpinBox5 = new QSpinBox( GroupBox1, "SpinBox5" );
|
||||||
|
SpinBox5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox5->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( SpinBox5, 1, 3 );
|
||||||
|
|
||||||
|
SpinBox3 = new QSpinBox( GroupBox1, "SpinBox3" );
|
||||||
|
SpinBox3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox3->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( SpinBox3, 0, 5 );
|
||||||
|
|
||||||
|
TextLabel4 = new QLabel( GroupBox1, "TextLabel4" );
|
||||||
|
TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel4->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel4->setText( trUtf8( "TL4" ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( TextLabel4, 0, 4 );
|
||||||
|
|
||||||
|
TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
|
||||||
|
TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel3->setText( trUtf8( "TL3" ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( TextLabel3, 0, 2 );
|
||||||
|
|
||||||
|
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 );
|
||||||
|
|
||||||
|
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, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||||
|
Layout1->addItem( spacer, 2, 2 );
|
||||||
|
|
||||||
|
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||||
|
|
||||||
|
DlgRef_1Sel5Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
DlgRef_1Sel5Spin_QTD::~DlgRef_1Sel5Spin_QTD()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
54
src/DlgRef/DlgRef_1Sel5Spin_QTD.h
Normal file
54
src/DlgRef/DlgRef_1Sel5Spin_QTD.h
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form interface generated from reading ui file 'DlgRef_1Sel5Spin_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: jeu oct 2 10:50:22 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#ifndef DLGREF_1SEL5SPIN_QTD_H
|
||||||
|
#define DLGREF_1SEL5SPIN_QTD_H
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qwidget.h>
|
||||||
|
class QVBoxLayout;
|
||||||
|
class QHBoxLayout;
|
||||||
|
class QGridLayout;
|
||||||
|
class QGroupBox;
|
||||||
|
class QLabel;
|
||||||
|
class QLineEdit;
|
||||||
|
class QPushButton;
|
||||||
|
class QSpinBox;
|
||||||
|
|
||||||
|
class DlgRef_1Sel5Spin_QTD : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_1Sel5Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||||
|
~DlgRef_1Sel5Spin_QTD();
|
||||||
|
|
||||||
|
QGroupBox* GroupBox1;
|
||||||
|
QLabel* TextLabel1;
|
||||||
|
QLabel* TextLabel6;
|
||||||
|
QSpinBox* SpinBox1;
|
||||||
|
QSpinBox* SpinBox4;
|
||||||
|
QLabel* TextLabel5;
|
||||||
|
QSpinBox* SpinBox2;
|
||||||
|
QSpinBox* SpinBox5;
|
||||||
|
QSpinBox* SpinBox3;
|
||||||
|
QLabel* TextLabel4;
|
||||||
|
QLabel* TextLabel3;
|
||||||
|
QLabel* TextLabel2;
|
||||||
|
QLineEdit* LineEdit1;
|
||||||
|
QPushButton* PushButton1;
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QGridLayout* DlgRef_1Sel5Spin_QTDLayout;
|
||||||
|
QGridLayout* GroupBox1Layout;
|
||||||
|
QGridLayout* Layout1;
|
||||||
|
QGridLayout* Layout2;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_1SEL5SPIN_QTD_H
|
74
src/DlgRef/DlgRef_1Sel_QTD.cxx
Normal file
74
src/DlgRef/DlgRef_1Sel_QTD.cxx
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form implementation generated from reading ui file 'DlgRef_1Sel_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: lun sep 22 17:38:06 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#include "DlgRef_1Sel_QTD.h"
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <qlineedit.h>
|
||||||
|
#include <qpushbutton.h>
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qtooltip.h>
|
||||||
|
#include <qwhatsthis.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_1Sel_QTD which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'.
|
||||||
|
*/
|
||||||
|
DlgRef_1Sel_QTD::DlgRef_1Sel_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||||
|
: QWidget( parent, name, fl )
|
||||||
|
{
|
||||||
|
if ( !name )
|
||||||
|
setName( "DlgRef_1Sel_QTD" );
|
||||||
|
resize( 129, 57 );
|
||||||
|
setCaption( trUtf8( "DlgRef_1Sel_QTD" ) );
|
||||||
|
DlgRef_1Sel_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_1Sel_QTDLayout");
|
||||||
|
|
||||||
|
GroupBox1 = new QGroupBox( this, "GroupBox1" );
|
||||||
|
GroupBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupBox1->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
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");
|
||||||
|
|
||||||
|
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, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||||
|
Layout1->addItem( spacer, 1, 2 );
|
||||||
|
|
||||||
|
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
|
||||||
|
|
||||||
|
Layout1->addWidget( LineEdit1, 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 );
|
||||||
|
|
||||||
|
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||||
|
|
||||||
|
DlgRef_1Sel_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
DlgRef_1Sel_QTD::~DlgRef_1Sel_QTD()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
42
src/DlgRef/DlgRef_1Sel_QTD.h
Normal file
42
src/DlgRef/DlgRef_1Sel_QTD.h
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form interface generated from reading ui file 'DlgRef_1Sel_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: lun sep 22 17:38:05 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#ifndef DLGREF_1SEL_QTD_H
|
||||||
|
#define DLGREF_1SEL_QTD_H
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qwidget.h>
|
||||||
|
class QVBoxLayout;
|
||||||
|
class QHBoxLayout;
|
||||||
|
class QGridLayout;
|
||||||
|
class QGroupBox;
|
||||||
|
class QLabel;
|
||||||
|
class QLineEdit;
|
||||||
|
class QPushButton;
|
||||||
|
|
||||||
|
class DlgRef_1Sel_QTD : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_1Sel_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||||
|
~DlgRef_1Sel_QTD();
|
||||||
|
|
||||||
|
QGroupBox* GroupBox1;
|
||||||
|
QPushButton* PushButton1;
|
||||||
|
QLineEdit* LineEdit1;
|
||||||
|
QLabel* TextLabel1;
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QGridLayout* DlgRef_1Sel_QTDLayout;
|
||||||
|
QGridLayout* GroupBox1Layout;
|
||||||
|
QGridLayout* Layout1;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_1SEL_QTD_H
|
56
src/DlgRef/DlgRef_1Spin.cxx
Normal file
56
src/DlgRef/DlgRef_1Spin.cxx
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
// 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_1Spin.cxx
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#include "DlgRef_1Spin.h"
|
||||||
|
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qspinbox.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_1Spin which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'
|
||||||
|
*/
|
||||||
|
DlgRef_1Spin::DlgRef_1Spin(QWidget* parent, const char* name, WFlags fl)
|
||||||
|
:DlgRef_1Spin_QTD(parent, name, fl)
|
||||||
|
{
|
||||||
|
SpinBox1->close(TRUE);
|
||||||
|
|
||||||
|
SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
|
||||||
|
Layout1->addWidget(SpinBox_DX, 0, 1);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
DlgRef_1Spin::~DlgRef_1Spin()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
47
src/DlgRef/DlgRef_1Spin.h
Normal file
47
src/DlgRef/DlgRef_1Spin.h
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
|
//
|
||||||
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// File : DlgRef_1Spin.h
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#ifndef DLGREF_1SPIN_H
|
||||||
|
#define DLGREF_1SPIN_H
|
||||||
|
|
||||||
|
#include "DlgRef_1Spin_QTD.h"
|
||||||
|
#include "DlgRef_SpinBox.h"
|
||||||
|
|
||||||
|
class DlgRef_1Spin : public DlgRef_1Spin_QTD
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_1Spin(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
|
||||||
|
~DlgRef_1Spin();
|
||||||
|
|
||||||
|
DlgRef_SpinBox* SpinBox_DX;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_1SPIN_H
|
68
src/DlgRef/DlgRef_1Spin_QTD.cxx
Normal file
68
src/DlgRef/DlgRef_1Spin_QTD.cxx
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form implementation generated from reading ui file 'DlgRef_1Spin_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: jeu sep 25 12:22:29 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#include "DlgRef_1Spin_QTD.h"
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <qpushbutton.h>
|
||||||
|
#include <qspinbox.h>
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qtooltip.h>
|
||||||
|
#include <qwhatsthis.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_1Spin_QTD which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'.
|
||||||
|
*/
|
||||||
|
DlgRef_1Spin_QTD::DlgRef_1Spin_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||||
|
: QWidget( parent, name, fl )
|
||||||
|
{
|
||||||
|
if ( !name )
|
||||||
|
setName( "DlgRef_1Spin_QTD" );
|
||||||
|
resize( 124, 55 );
|
||||||
|
setCaption( trUtf8( "DlgRef_1Spin_QTD" ) );
|
||||||
|
DlgRef_1Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_1Spin_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, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||||
|
Layout1->addItem( spacer, 3, 1 );
|
||||||
|
|
||||||
|
SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
|
||||||
|
SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( SpinBox1, 0, 1 );
|
||||||
|
|
||||||
|
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 );
|
||||||
|
|
||||||
|
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||||
|
|
||||||
|
DlgRef_1Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
DlgRef_1Spin_QTD::~DlgRef_1Spin_QTD()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
40
src/DlgRef/DlgRef_1Spin_QTD.h
Normal file
40
src/DlgRef/DlgRef_1Spin_QTD.h
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form interface generated from reading ui file 'DlgRef_1Spin_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: jeu sep 25 12:22:29 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#ifndef DLGREF_1SPIN_QTD_H
|
||||||
|
#define DLGREF_1SPIN_QTD_H
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qwidget.h>
|
||||||
|
class QVBoxLayout;
|
||||||
|
class QHBoxLayout;
|
||||||
|
class QGridLayout;
|
||||||
|
class QGroupBox;
|
||||||
|
class QLabel;
|
||||||
|
class QSpinBox;
|
||||||
|
|
||||||
|
class DlgRef_1Spin_QTD : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_1Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||||
|
~DlgRef_1Spin_QTD();
|
||||||
|
|
||||||
|
QGroupBox* GroupBox1;
|
||||||
|
QSpinBox* SpinBox1;
|
||||||
|
QLabel* TextLabel1;
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QGridLayout* DlgRef_1Spin_QTDLayout;
|
||||||
|
QGridLayout* GroupBox1Layout;
|
||||||
|
QGridLayout* Layout1;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_1SPIN_QTD_H
|
54
src/DlgRef/DlgRef_2Sel1Spin.cxx
Normal file
54
src/DlgRef/DlgRef_2Sel1Spin.cxx
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
|
//
|
||||||
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// File : DlgRef_2Sel1Spin.cxx
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#include "DlgRef_2Sel1Spin.h"
|
||||||
|
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qspinbox.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_2Sel1Spin which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'
|
||||||
|
*/
|
||||||
|
DlgRef_2Sel1Spin::DlgRef_2Sel1Spin(QWidget* parent, const char* name, WFlags fl)
|
||||||
|
:DlgRef_2Sel1Spin_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_2Sel1Spin::~DlgRef_2Sel1Spin()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
47
src/DlgRef/DlgRef_2Sel1Spin.h
Normal file
47
src/DlgRef/DlgRef_2Sel1Spin.h
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
|
//
|
||||||
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// File : DlgRef_2Sel1Spin.h
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#ifndef DLGREF_2SEL1SPIN_H
|
||||||
|
#define DLGREF_2SEL1SPIN_H
|
||||||
|
|
||||||
|
#include "DlgRef_2Sel1Spin_QTD.h"
|
||||||
|
#include "DlgRef_SpinBox.h"
|
||||||
|
|
||||||
|
class DlgRef_2Sel1Spin : public DlgRef_2Sel1Spin_QTD
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_2Sel1Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||||
|
~DlgRef_2Sel1Spin();
|
||||||
|
|
||||||
|
DlgRef_SpinBox* SpinBox_DX;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_2SEL1SPIN_H
|
54
src/DlgRef/DlgRef_2Sel1Spin1Check.cxx
Normal file
54
src/DlgRef/DlgRef_2Sel1Spin1Check.cxx
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
|
//
|
||||||
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// File : DlgRef_2Sel1Spin1Check.cxx
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#include "DlgRef_2Sel1Spin1Check.h"
|
||||||
|
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qspinbox.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_2Sel1Spin which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'
|
||||||
|
*/
|
||||||
|
DlgRef_2Sel1Spin1Check::DlgRef_2Sel1Spin1Check(QWidget* parent, const char* name, WFlags fl)
|
||||||
|
:DlgRef_2Sel1Spin1Check_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_2Sel1Spin1Check::~DlgRef_2Sel1Spin1Check()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
47
src/DlgRef/DlgRef_2Sel1Spin1Check.h
Normal file
47
src/DlgRef/DlgRef_2Sel1Spin1Check.h
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
|
//
|
||||||
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// File : DlgRef_2Sel1Spin1Check.h
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#ifndef DLGREF_2SEL1SPIN1CHECK_H
|
||||||
|
#define DLGREF_2SEL1SPIN1CHECK_H
|
||||||
|
|
||||||
|
#include "DlgRef_2Sel1Spin1Check_QTD.h"
|
||||||
|
#include "DlgRef_SpinBox.h"
|
||||||
|
|
||||||
|
class DlgRef_2Sel1Spin1Check : public DlgRef_2Sel1Spin1Check_QTD
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_2Sel1Spin1Check(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
|
||||||
|
~DlgRef_2Sel1Spin1Check();
|
||||||
|
|
||||||
|
DlgRef_SpinBox* SpinBox_DX;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_2SEL1SPIN1CHECK_H
|
111
src/DlgRef/DlgRef_2Sel1Spin1Check_QTD.cxx
Normal file
111
src/DlgRef/DlgRef_2Sel1Spin1Check_QTD.cxx
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form implementation generated from reading ui file 'DlgRef_2Sel1Spin1Check_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: mer oct 1 16:20:02 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#include "DlgRef_2Sel1Spin1Check_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_2Sel1Spin1Check_QTD which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'.
|
||||||
|
*/
|
||||||
|
DlgRef_2Sel1Spin1Check_QTD::DlgRef_2Sel1Spin1Check_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||||
|
: QWidget( parent, name, fl )
|
||||||
|
{
|
||||||
|
if ( !name )
|
||||||
|
setName( "DlgRef_2Sel1Spin1Check_QTD" );
|
||||||
|
resize( 129, 117 );
|
||||||
|
setCaption( trUtf8( "DlgRef_2Sel1Spin1Check_QTD" ) );
|
||||||
|
DlgRef_2Sel1Spin1Check_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_2Sel1Spin1Check_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");
|
||||||
|
|
||||||
|
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
|
||||||
|
|
||||||
|
Layout1->addWidget( LineEdit1, 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 );
|
||||||
|
|
||||||
|
TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
|
||||||
|
TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel2->setText( trUtf8( "TL2" ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( TextLabel2, 1, 0 );
|
||||||
|
|
||||||
|
LineEdit2 = new QLineEdit( GroupBox1, "LineEdit2" );
|
||||||
|
|
||||||
|
Layout1->addWidget( LineEdit2, 1, 2 );
|
||||||
|
|
||||||
|
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, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||||
|
Layout1->addItem( spacer, 3, 2 );
|
||||||
|
|
||||||
|
PushButton2 = new QPushButton( GroupBox1, "PushButton2" );
|
||||||
|
PushButton2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton2->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
PushButton2->setText( trUtf8( "" ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( PushButton2, 1, 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 );
|
||||||
|
|
||||||
|
CheckButton1 = new QRadioButton( GroupBox1, "CheckButton1" );
|
||||||
|
CheckButton1->setText( trUtf8( "" ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( CheckButton1, 0, 2 );
|
||||||
|
|
||||||
|
TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
|
||||||
|
TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel3->setText( trUtf8( "TL3" ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( TextLabel3, 0, 0 );
|
||||||
|
|
||||||
|
Layout1->addMultiCellLayout( Layout2, 2, 2, 0, 2 );
|
||||||
|
|
||||||
|
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||||
|
|
||||||
|
DlgRef_2Sel1Spin1Check_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
DlgRef_2Sel1Spin1Check_QTD::~DlgRef_2Sel1Spin1Check_QTD()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
51
src/DlgRef/DlgRef_2Sel1Spin1Check_QTD.h
Normal file
51
src/DlgRef/DlgRef_2Sel1Spin1Check_QTD.h
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form interface generated from reading ui file 'DlgRef_2Sel1Spin1Check_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: mer oct 1 16:20:02 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#ifndef DLGREF_2SEL1SPIN1CHECK_QTD_H
|
||||||
|
#define DLGREF_2SEL1SPIN1CHECK_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_2Sel1Spin1Check_QTD : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_2Sel1Spin1Check_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||||
|
~DlgRef_2Sel1Spin1Check_QTD();
|
||||||
|
|
||||||
|
QGroupBox* GroupBox1;
|
||||||
|
QLineEdit* LineEdit1;
|
||||||
|
QLabel* TextLabel1;
|
||||||
|
QLabel* TextLabel2;
|
||||||
|
QLineEdit* LineEdit2;
|
||||||
|
QPushButton* PushButton1;
|
||||||
|
QPushButton* PushButton2;
|
||||||
|
QSpinBox* SpinBox1;
|
||||||
|
QRadioButton* CheckButton1;
|
||||||
|
QLabel* TextLabel3;
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QGridLayout* DlgRef_2Sel1Spin1Check_QTDLayout;
|
||||||
|
QGridLayout* GroupBox1Layout;
|
||||||
|
QGridLayout* Layout1;
|
||||||
|
QGridLayout* Layout2;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_2SEL1SPIN1CHECK_QTD_H
|
105
src/DlgRef/DlgRef_2Sel1Spin_QTD.cxx
Normal file
105
src/DlgRef/DlgRef_2Sel1Spin_QTD.cxx
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form implementation generated from reading ui file 'DlgRef_2Sel1Spin_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: mar sep 23 16:05:09 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#include "DlgRef_2Sel1Spin_QTD.h"
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <qlineedit.h>
|
||||||
|
#include <qpushbutton.h>
|
||||||
|
#include <qspinbox.h>
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qtooltip.h>
|
||||||
|
#include <qwhatsthis.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_2Sel1Spin_QTD which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'.
|
||||||
|
*/
|
||||||
|
DlgRef_2Sel1Spin_QTD::DlgRef_2Sel1Spin_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||||
|
: QWidget( parent, name, fl )
|
||||||
|
{
|
||||||
|
if ( !name )
|
||||||
|
setName( "DlgRef_2Sel1Spin_QTD" );
|
||||||
|
resize( 129, 117 );
|
||||||
|
setCaption( trUtf8( "DlgRef_2Sel1Spin_QTD" ) );
|
||||||
|
DlgRef_2Sel1Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_2Sel1Spin_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");
|
||||||
|
|
||||||
|
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
|
||||||
|
|
||||||
|
Layout1->addWidget( LineEdit1, 0, 2 );
|
||||||
|
|
||||||
|
PushButton2 = new QPushButton( GroupBox1, "PushButton2" );
|
||||||
|
PushButton2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton2->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
PushButton2->setText( trUtf8( "" ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( PushButton2, 1, 1 );
|
||||||
|
|
||||||
|
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 );
|
||||||
|
|
||||||
|
LineEdit2 = new QLineEdit( GroupBox1, "LineEdit2" );
|
||||||
|
|
||||||
|
Layout1->addWidget( LineEdit2, 1, 2 );
|
||||||
|
|
||||||
|
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 );
|
||||||
|
|
||||||
|
TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
|
||||||
|
TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel2->setText( trUtf8( "TL2" ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( TextLabel2, 1, 0 );
|
||||||
|
|
||||||
|
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 );
|
||||||
|
|
||||||
|
TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
|
||||||
|
TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel3->setText( trUtf8( "TL3" ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( TextLabel3, 0, 0 );
|
||||||
|
|
||||||
|
Layout1->addMultiCellLayout( Layout2, 2, 2, 0, 2 );
|
||||||
|
QSpacerItem* spacer = new QSpacerItem( 0, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||||
|
Layout1->addItem( spacer, 3, 2 );
|
||||||
|
|
||||||
|
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||||
|
|
||||||
|
DlgRef_2Sel1Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
DlgRef_2Sel1Spin_QTD::~DlgRef_2Sel1Spin_QTD()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
49
src/DlgRef/DlgRef_2Sel1Spin_QTD.h
Normal file
49
src/DlgRef/DlgRef_2Sel1Spin_QTD.h
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form interface generated from reading ui file 'DlgRef_2Sel1Spin_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: mar sep 23 16:05:09 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#ifndef DLGREF_2SEL1SPIN_QTD_H
|
||||||
|
#define DLGREF_2SEL1SPIN_QTD_H
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qwidget.h>
|
||||||
|
class QVBoxLayout;
|
||||||
|
class QHBoxLayout;
|
||||||
|
class QGridLayout;
|
||||||
|
class QGroupBox;
|
||||||
|
class QLabel;
|
||||||
|
class QLineEdit;
|
||||||
|
class QPushButton;
|
||||||
|
class QSpinBox;
|
||||||
|
|
||||||
|
class DlgRef_2Sel1Spin_QTD : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_2Sel1Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||||
|
~DlgRef_2Sel1Spin_QTD();
|
||||||
|
|
||||||
|
QGroupBox* GroupBox1;
|
||||||
|
QLineEdit* LineEdit1;
|
||||||
|
QPushButton* PushButton2;
|
||||||
|
QLabel* TextLabel1;
|
||||||
|
QLineEdit* LineEdit2;
|
||||||
|
QPushButton* PushButton1;
|
||||||
|
QLabel* TextLabel2;
|
||||||
|
QSpinBox* SpinBox1;
|
||||||
|
QLabel* TextLabel3;
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QGridLayout* DlgRef_2Sel1Spin_QTDLayout;
|
||||||
|
QGridLayout* GroupBox1Layout;
|
||||||
|
QGridLayout* Layout1;
|
||||||
|
QGridLayout* Layout2;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_2SEL1SPIN_QTD_H
|
57
src/DlgRef/DlgRef_2Sel2Spin.cxx
Normal file
57
src/DlgRef/DlgRef_2Sel2Spin.cxx
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
// 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_2Sel2Spin.cxx
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#include "DlgRef_2Sel2Spin.h"
|
||||||
|
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qspinbox.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_2Sel1Spin which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'
|
||||||
|
*/
|
||||||
|
DlgRef_2Sel2Spin::DlgRef_2Sel2Spin(QWidget* parent, const char* name, WFlags fl)
|
||||||
|
:DlgRef_2Sel2Spin_QTD(parent, name, fl)
|
||||||
|
{
|
||||||
|
SpinBox1->close(TRUE);
|
||||||
|
SpinBox2->close(TRUE);
|
||||||
|
SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
|
||||||
|
Layout2->addWidget(SpinBox_DX, 0, 1);
|
||||||
|
SpinBox_DY = new DlgRef_SpinBox(GroupBox1, "SpinBox_DY");
|
||||||
|
Layout2->addWidget(SpinBox_DY, 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
DlgRef_2Sel2Spin::~DlgRef_2Sel2Spin()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
48
src/DlgRef/DlgRef_2Sel2Spin.h
Normal file
48
src/DlgRef/DlgRef_2Sel2Spin.h
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
// 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_2Sel2Spin.h
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#ifndef DLGREF_2SEL2SPIN_H
|
||||||
|
#define DLGREF_2SEL2SPIN_H
|
||||||
|
|
||||||
|
#include "DlgRef_2Sel2Spin_QTD.h"
|
||||||
|
#include "DlgRef_SpinBox.h"
|
||||||
|
|
||||||
|
class DlgRef_2Sel2Spin : public DlgRef_2Sel2Spin_QTD
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_2Sel2Spin(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
|
||||||
|
~DlgRef_2Sel2Spin();
|
||||||
|
|
||||||
|
DlgRef_SpinBox* SpinBox_DX;
|
||||||
|
DlgRef_SpinBox* SpinBox_DY;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_2SEL2SPIN_H
|
116
src/DlgRef/DlgRef_2Sel2Spin_QTD.cxx
Normal file
116
src/DlgRef/DlgRef_2Sel2Spin_QTD.cxx
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form implementation generated from reading ui file 'DlgRef_2Sel2Spin_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: jeu sep 25 12:10:29 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#include "DlgRef_2Sel2Spin_QTD.h"
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <qlineedit.h>
|
||||||
|
#include <qpushbutton.h>
|
||||||
|
#include <qspinbox.h>
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qtooltip.h>
|
||||||
|
#include <qwhatsthis.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_2Sel2Spin_QTD which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'.
|
||||||
|
*/
|
||||||
|
DlgRef_2Sel2Spin_QTD::DlgRef_2Sel2Spin_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||||
|
: QWidget( parent, name, fl )
|
||||||
|
{
|
||||||
|
if ( !name )
|
||||||
|
setName( "DlgRef_2Sel2Spin_QTD" );
|
||||||
|
resize( 129, 145 );
|
||||||
|
setCaption( trUtf8( "DlgRef_2Sel2Spin_QTD" ) );
|
||||||
|
DlgRef_2Sel2Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_2Sel2Spin_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");
|
||||||
|
|
||||||
|
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
|
||||||
|
|
||||||
|
Layout1->addWidget( LineEdit1, 0, 2 );
|
||||||
|
|
||||||
|
Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
|
||||||
|
|
||||||
|
SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" );
|
||||||
|
SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( SpinBox2, 1, 1 );
|
||||||
|
|
||||||
|
TextLabel4 = new QLabel( GroupBox1, "TextLabel4" );
|
||||||
|
TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel4->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel4->setText( trUtf8( "TL4" ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( TextLabel4, 1, 0 );
|
||||||
|
|
||||||
|
TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
|
||||||
|
TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel3->setText( trUtf8( "TL3" ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( TextLabel3, 0, 0 );
|
||||||
|
|
||||||
|
SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
|
||||||
|
SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( SpinBox1, 0, 1 );
|
||||||
|
|
||||||
|
Layout1->addMultiCellLayout( Layout2, 2, 2, 0, 2 );
|
||||||
|
|
||||||
|
PushButton2 = new QPushButton( GroupBox1, "PushButton2" );
|
||||||
|
PushButton2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton2->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
PushButton2->setText( trUtf8( "" ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( PushButton2, 1, 1 );
|
||||||
|
|
||||||
|
TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
|
||||||
|
TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel2->setText( trUtf8( "TL2" ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( TextLabel2, 1, 0 );
|
||||||
|
QSpacerItem* spacer = new QSpacerItem( 0, 20, 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 );
|
||||||
|
|
||||||
|
LineEdit2 = new QLineEdit( GroupBox1, "LineEdit2" );
|
||||||
|
|
||||||
|
Layout1->addWidget( LineEdit2, 1, 2 );
|
||||||
|
|
||||||
|
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||||
|
|
||||||
|
DlgRef_2Sel2Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
DlgRef_2Sel2Spin_QTD::~DlgRef_2Sel2Spin_QTD()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
51
src/DlgRef/DlgRef_2Sel2Spin_QTD.h
Normal file
51
src/DlgRef/DlgRef_2Sel2Spin_QTD.h
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form interface generated from reading ui file 'DlgRef_2Sel2Spin_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: jeu sep 25 12:10:29 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#ifndef DLGREF_2SEL2SPIN_QTD_H
|
||||||
|
#define DLGREF_2SEL2SPIN_QTD_H
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qwidget.h>
|
||||||
|
class QVBoxLayout;
|
||||||
|
class QHBoxLayout;
|
||||||
|
class QGridLayout;
|
||||||
|
class QGroupBox;
|
||||||
|
class QLabel;
|
||||||
|
class QLineEdit;
|
||||||
|
class QPushButton;
|
||||||
|
class QSpinBox;
|
||||||
|
|
||||||
|
class DlgRef_2Sel2Spin_QTD : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_2Sel2Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||||
|
~DlgRef_2Sel2Spin_QTD();
|
||||||
|
|
||||||
|
QGroupBox* GroupBox1;
|
||||||
|
QLineEdit* LineEdit1;
|
||||||
|
QSpinBox* SpinBox2;
|
||||||
|
QLabel* TextLabel4;
|
||||||
|
QLabel* TextLabel3;
|
||||||
|
QSpinBox* SpinBox1;
|
||||||
|
QPushButton* PushButton2;
|
||||||
|
QLabel* TextLabel2;
|
||||||
|
QLabel* TextLabel1;
|
||||||
|
QPushButton* PushButton1;
|
||||||
|
QLineEdit* LineEdit2;
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QGridLayout* DlgRef_2Sel2Spin_QTDLayout;
|
||||||
|
QGridLayout* GroupBox1Layout;
|
||||||
|
QGridLayout* Layout1;
|
||||||
|
QGridLayout* Layout2;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_2SEL2SPIN_QTD_H
|
60
src/DlgRef/DlgRef_2Sel3Spin.cxx
Normal file
60
src/DlgRef/DlgRef_2Sel3Spin.cxx
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
// 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_2Sel3Spin.cxx
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#include "DlgRef_2Sel3Spin.h"
|
||||||
|
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qspinbox.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_2Sel1Spin which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'
|
||||||
|
*/
|
||||||
|
DlgRef_2Sel3Spin::DlgRef_2Sel3Spin(QWidget* parent, const char* name, WFlags fl)
|
||||||
|
:DlgRef_2Sel3Spin_QTD(parent, name, fl)
|
||||||
|
{
|
||||||
|
SpinBox1->close(TRUE);
|
||||||
|
SpinBox2->close(TRUE);
|
||||||
|
SpinBox3->close(TRUE);
|
||||||
|
SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
|
||||||
|
Layout2->addWidget(SpinBox_DX, 0, 1);
|
||||||
|
SpinBox_DY = new DlgRef_SpinBox(GroupBox1, "SpinBox_DY");
|
||||||
|
Layout2->addWidget(SpinBox_DY, 1, 1);
|
||||||
|
SpinBox_DZ = new DlgRef_SpinBox(GroupBox1, "SpinBox_DZ");
|
||||||
|
Layout2->addWidget(SpinBox_DZ, 2, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
DlgRef_2Sel3Spin::~DlgRef_2Sel3Spin()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
49
src/DlgRef/DlgRef_2Sel3Spin.h
Normal file
49
src/DlgRef/DlgRef_2Sel3Spin.h
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
// 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_2Sel3Spin.h
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#ifndef DLGREF_2SEL3SPIN_H
|
||||||
|
#define DLGREF_2SEL3SPIN_H
|
||||||
|
|
||||||
|
#include "DlgRef_2Sel3Spin_QTD.h"
|
||||||
|
#include "DlgRef_SpinBox.h"
|
||||||
|
|
||||||
|
class DlgRef_2Sel3Spin : public DlgRef_2Sel3Spin_QTD
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_2Sel3Spin(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
|
||||||
|
~DlgRef_2Sel3Spin();
|
||||||
|
|
||||||
|
DlgRef_SpinBox* SpinBox_DX;
|
||||||
|
DlgRef_SpinBox* SpinBox_DY;
|
||||||
|
DlgRef_SpinBox* SpinBox_DZ;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_2SEL3SPIN_H
|
127
src/DlgRef/DlgRef_2Sel3Spin_QTD.cxx
Normal file
127
src/DlgRef/DlgRef_2Sel3Spin_QTD.cxx
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form implementation generated from reading ui file 'DlgRef_2Sel3Spin_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: jeu sep 25 16:18:43 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#include "DlgRef_2Sel3Spin_QTD.h"
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <qlineedit.h>
|
||||||
|
#include <qpushbutton.h>
|
||||||
|
#include <qspinbox.h>
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qtooltip.h>
|
||||||
|
#include <qwhatsthis.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_2Sel3Spin_QTD which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'.
|
||||||
|
*/
|
||||||
|
DlgRef_2Sel3Spin_QTD::DlgRef_2Sel3Spin_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||||
|
: QWidget( parent, name, fl )
|
||||||
|
{
|
||||||
|
if ( !name )
|
||||||
|
setName( "DlgRef_2Sel3Spin_QTD" );
|
||||||
|
resize( 129, 173 );
|
||||||
|
setCaption( trUtf8( "DlgRef_2Sel3Spin_QTD" ) );
|
||||||
|
DlgRef_2Sel3Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_2Sel3Spin_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");
|
||||||
|
|
||||||
|
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
|
||||||
|
|
||||||
|
Layout1->addWidget( LineEdit1, 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 );
|
||||||
|
|
||||||
|
TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
|
||||||
|
TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel2->setText( trUtf8( "TL2" ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( TextLabel2, 1, 0 );
|
||||||
|
|
||||||
|
Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
|
||||||
|
|
||||||
|
TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
|
||||||
|
TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel3->setText( trUtf8( "TL3" ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( TextLabel3, 0, 0 );
|
||||||
|
|
||||||
|
SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" );
|
||||||
|
SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( SpinBox2, 1, 1 );
|
||||||
|
|
||||||
|
TextLabel4 = new QLabel( GroupBox1, "TextLabel4" );
|
||||||
|
TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel4->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel4->setText( trUtf8( "TL4" ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( TextLabel4, 1, 0 );
|
||||||
|
|
||||||
|
TextLabel5 = new QLabel( GroupBox1, "TextLabel5" );
|
||||||
|
TextLabel5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel5->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel5->setText( trUtf8( "TL4" ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( TextLabel5, 2, 0 );
|
||||||
|
|
||||||
|
SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
|
||||||
|
SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( SpinBox1, 0, 1 );
|
||||||
|
|
||||||
|
SpinBox3 = new QSpinBox( GroupBox1, "SpinBox3" );
|
||||||
|
SpinBox3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox3->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout2->addWidget( SpinBox3, 2, 1 );
|
||||||
|
|
||||||
|
Layout1->addMultiCellLayout( Layout2, 2, 2, 0, 2 );
|
||||||
|
|
||||||
|
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, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||||
|
Layout1->addItem( spacer, 3, 2 );
|
||||||
|
|
||||||
|
LineEdit2 = new QLineEdit( GroupBox1, "LineEdit2" );
|
||||||
|
|
||||||
|
Layout1->addWidget( LineEdit2, 1, 2 );
|
||||||
|
|
||||||
|
PushButton2 = new QPushButton( GroupBox1, "PushButton2" );
|
||||||
|
PushButton2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton2->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
PushButton2->setText( trUtf8( "" ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( PushButton2, 1, 1 );
|
||||||
|
|
||||||
|
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||||
|
|
||||||
|
DlgRef_2Sel3Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
DlgRef_2Sel3Spin_QTD::~DlgRef_2Sel3Spin_QTD()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
53
src/DlgRef/DlgRef_2Sel3Spin_QTD.h
Normal file
53
src/DlgRef/DlgRef_2Sel3Spin_QTD.h
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form interface generated from reading ui file 'DlgRef_2Sel3Spin_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: jeu sep 25 16:18:43 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#ifndef DLGREF_2SEL3SPIN_QTD_H
|
||||||
|
#define DLGREF_2SEL3SPIN_QTD_H
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qwidget.h>
|
||||||
|
class QVBoxLayout;
|
||||||
|
class QHBoxLayout;
|
||||||
|
class QGridLayout;
|
||||||
|
class QGroupBox;
|
||||||
|
class QLabel;
|
||||||
|
class QLineEdit;
|
||||||
|
class QPushButton;
|
||||||
|
class QSpinBox;
|
||||||
|
|
||||||
|
class DlgRef_2Sel3Spin_QTD : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_2Sel3Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||||
|
~DlgRef_2Sel3Spin_QTD();
|
||||||
|
|
||||||
|
QGroupBox* GroupBox1;
|
||||||
|
QLineEdit* LineEdit1;
|
||||||
|
QLabel* TextLabel1;
|
||||||
|
QLabel* TextLabel2;
|
||||||
|
QLabel* TextLabel3;
|
||||||
|
QSpinBox* SpinBox2;
|
||||||
|
QLabel* TextLabel4;
|
||||||
|
QLabel* TextLabel5;
|
||||||
|
QSpinBox* SpinBox1;
|
||||||
|
QSpinBox* SpinBox3;
|
||||||
|
QPushButton* PushButton1;
|
||||||
|
QLineEdit* LineEdit2;
|
||||||
|
QPushButton* PushButton2;
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QGridLayout* DlgRef_2Sel3Spin_QTDLayout;
|
||||||
|
QGridLayout* GroupBox1Layout;
|
||||||
|
QGridLayout* Layout1;
|
||||||
|
QGridLayout* Layout2;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_2SEL3SPIN_QTD_H
|
90
src/DlgRef/DlgRef_2Sel_QTD.cxx
Normal file
90
src/DlgRef/DlgRef_2Sel_QTD.cxx
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form implementation generated from reading ui file 'DlgRef_2Sel_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: mar sep 23 16:05:09 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#include "DlgRef_2Sel_QTD.h"
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <qlineedit.h>
|
||||||
|
#include <qpushbutton.h>
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qtooltip.h>
|
||||||
|
#include <qwhatsthis.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_2Sel_QTD which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'.
|
||||||
|
*/
|
||||||
|
DlgRef_2Sel_QTD::DlgRef_2Sel_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||||
|
: QWidget( parent, name, fl )
|
||||||
|
{
|
||||||
|
if ( !name )
|
||||||
|
setName( "DlgRef_2Sel_QTD" );
|
||||||
|
resize( 129, 87 );
|
||||||
|
setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0, sizePolicy().hasHeightForWidth() ) );
|
||||||
|
setCaption( trUtf8( "DlgRef_2Sel_QTD" ) );
|
||||||
|
DlgRef_2Sel_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_2Sel_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");
|
||||||
|
|
||||||
|
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, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||||
|
Layout1->addItem( spacer, 2, 2 );
|
||||||
|
|
||||||
|
LineEdit2 = new QLineEdit( GroupBox1, "LineEdit2" );
|
||||||
|
|
||||||
|
Layout1->addWidget( LineEdit2, 1, 2 );
|
||||||
|
|
||||||
|
PushButton2 = new QPushButton( GroupBox1, "PushButton2" );
|
||||||
|
PushButton2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton2->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
PushButton2->setText( trUtf8( "" ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( PushButton2, 1, 1 );
|
||||||
|
|
||||||
|
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 );
|
||||||
|
|
||||||
|
TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
|
||||||
|
TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel2->setText( trUtf8( "TL2" ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( TextLabel2, 1, 0 );
|
||||||
|
|
||||||
|
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
|
||||||
|
|
||||||
|
Layout1->addWidget( LineEdit1, 0, 2 );
|
||||||
|
|
||||||
|
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||||
|
|
||||||
|
DlgRef_2Sel_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
DlgRef_2Sel_QTD::~DlgRef_2Sel_QTD()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
45
src/DlgRef/DlgRef_2Sel_QTD.h
Normal file
45
src/DlgRef/DlgRef_2Sel_QTD.h
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form interface generated from reading ui file 'DlgRef_2Sel_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: mar sep 23 16:05:09 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#ifndef DLGREF_2SEL_QTD_H
|
||||||
|
#define DLGREF_2SEL_QTD_H
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qwidget.h>
|
||||||
|
class QVBoxLayout;
|
||||||
|
class QHBoxLayout;
|
||||||
|
class QGridLayout;
|
||||||
|
class QGroupBox;
|
||||||
|
class QLabel;
|
||||||
|
class QLineEdit;
|
||||||
|
class QPushButton;
|
||||||
|
|
||||||
|
class DlgRef_2Sel_QTD : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_2Sel_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||||
|
~DlgRef_2Sel_QTD();
|
||||||
|
|
||||||
|
QGroupBox* GroupBox1;
|
||||||
|
QPushButton* PushButton1;
|
||||||
|
QLineEdit* LineEdit2;
|
||||||
|
QPushButton* PushButton2;
|
||||||
|
QLabel* TextLabel1;
|
||||||
|
QLabel* TextLabel2;
|
||||||
|
QLineEdit* LineEdit1;
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QGridLayout* DlgRef_2Sel_QTDLayout;
|
||||||
|
QGridLayout* GroupBox1Layout;
|
||||||
|
QGridLayout* Layout1;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_2SEL_QTD_H
|
60
src/DlgRef/DlgRef_2Spin.cxx
Normal file
60
src/DlgRef/DlgRef_2Spin.cxx
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
// 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_2Spin.cxx
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#include "DlgRef_2Spin.h"
|
||||||
|
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qspinbox.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_2Spin which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'
|
||||||
|
*/
|
||||||
|
DlgRef_2Spin::DlgRef_2Spin(QWidget* parent, const char* name, WFlags fl)
|
||||||
|
:DlgRef_2Spin_QTD(parent, name, fl)
|
||||||
|
{
|
||||||
|
SpinBox1->close(TRUE);
|
||||||
|
SpinBox2->close(TRUE);
|
||||||
|
|
||||||
|
SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
|
||||||
|
Layout1->addWidget(SpinBox_DX, 0, 1);
|
||||||
|
|
||||||
|
SpinBox_DY = new DlgRef_SpinBox(GroupBox1, "SpinBox_DY");
|
||||||
|
Layout1->addWidget(SpinBox_DY, 1, 1);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
DlgRef_2Spin::~DlgRef_2Spin()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
48
src/DlgRef/DlgRef_2Spin.h
Normal file
48
src/DlgRef/DlgRef_2Spin.h
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
// 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_2Spin.h
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#ifndef DLGREF_2SPIN_H
|
||||||
|
#define DLGREF_2SPIN_H
|
||||||
|
|
||||||
|
#include "DlgRef_2Spin_QTD.h"
|
||||||
|
#include "DlgRef_SpinBox.h"
|
||||||
|
|
||||||
|
class DlgRef_2Spin : public DlgRef_2Spin_QTD
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_2Spin(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
|
||||||
|
~DlgRef_2Spin();
|
||||||
|
|
||||||
|
DlgRef_SpinBox* SpinBox_DX;
|
||||||
|
DlgRef_SpinBox* SpinBox_DY;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_2SPIN_H
|
79
src/DlgRef/DlgRef_2Spin_QTD.cxx
Normal file
79
src/DlgRef/DlgRef_2Spin_QTD.cxx
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form implementation generated from reading ui file 'DlgRef_2Spin_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: jeu sep 25 12:10:30 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#include "DlgRef_2Spin_QTD.h"
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <qpushbutton.h>
|
||||||
|
#include <qspinbox.h>
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qtooltip.h>
|
||||||
|
#include <qwhatsthis.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_2Spin_QTD which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'.
|
||||||
|
*/
|
||||||
|
DlgRef_2Spin_QTD::DlgRef_2Spin_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||||
|
: QWidget( parent, name, fl )
|
||||||
|
{
|
||||||
|
if ( !name )
|
||||||
|
setName( "DlgRef_2Spin_QTD" );
|
||||||
|
resize( 124, 83 );
|
||||||
|
setCaption( trUtf8( "DlgRef_2Spin_QTD" ) );
|
||||||
|
DlgRef_2Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_2Spin_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");
|
||||||
|
|
||||||
|
SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" );
|
||||||
|
SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( SpinBox2, 1, 1 );
|
||||||
|
QSpacerItem* spacer = new QSpacerItem( 0, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||||
|
Layout1->addItem( spacer, 3, 1 );
|
||||||
|
|
||||||
|
SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
|
||||||
|
SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( SpinBox1, 0, 1 );
|
||||||
|
|
||||||
|
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 );
|
||||||
|
|
||||||
|
TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
|
||||||
|
TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel2->setText( trUtf8( "TL2" ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( TextLabel2, 1, 0 );
|
||||||
|
|
||||||
|
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||||
|
|
||||||
|
DlgRef_2Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
DlgRef_2Spin_QTD::~DlgRef_2Spin_QTD()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
42
src/DlgRef/DlgRef_2Spin_QTD.h
Normal file
42
src/DlgRef/DlgRef_2Spin_QTD.h
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form interface generated from reading ui file 'DlgRef_2Spin_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: jeu sep 25 12:10:30 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#ifndef DLGREF_2SPIN_QTD_H
|
||||||
|
#define DLGREF_2SPIN_QTD_H
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qwidget.h>
|
||||||
|
class QVBoxLayout;
|
||||||
|
class QHBoxLayout;
|
||||||
|
class QGridLayout;
|
||||||
|
class QGroupBox;
|
||||||
|
class QLabel;
|
||||||
|
class QSpinBox;
|
||||||
|
|
||||||
|
class DlgRef_2Spin_QTD : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_2Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||||
|
~DlgRef_2Spin_QTD();
|
||||||
|
|
||||||
|
QGroupBox* GroupBox1;
|
||||||
|
QSpinBox* SpinBox2;
|
||||||
|
QSpinBox* SpinBox1;
|
||||||
|
QLabel* TextLabel1;
|
||||||
|
QLabel* TextLabel2;
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QGridLayout* DlgRef_2Spin_QTDLayout;
|
||||||
|
QGridLayout* GroupBox1Layout;
|
||||||
|
QGridLayout* Layout1;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_2SPIN_QTD_H
|
106
src/DlgRef/DlgRef_3Sel_QTD.cxx
Normal file
106
src/DlgRef/DlgRef_3Sel_QTD.cxx
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form implementation generated from reading ui file 'DlgRef_3Sel_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: lun sep 29 11:05:21 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#include "DlgRef_3Sel_QTD.h"
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <qlineedit.h>
|
||||||
|
#include <qpushbutton.h>
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qtooltip.h>
|
||||||
|
#include <qwhatsthis.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_3Sel_QTD which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'.
|
||||||
|
*/
|
||||||
|
DlgRef_3Sel_QTD::DlgRef_3Sel_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||||
|
: QWidget( parent, name, fl )
|
||||||
|
{
|
||||||
|
if ( !name )
|
||||||
|
setName( "DlgRef_3Sel_QTD" );
|
||||||
|
resize( 129, 117 );
|
||||||
|
setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0, sizePolicy().hasHeightForWidth() ) );
|
||||||
|
setCaption( trUtf8( "DlgRef_3Sel_QTD" ) );
|
||||||
|
DlgRef_3Sel_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_3Sel_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");
|
||||||
|
|
||||||
|
LineEdit3 = new QLineEdit( GroupBox1, "LineEdit3" );
|
||||||
|
|
||||||
|
Layout1->addWidget( LineEdit3, 2, 2 );
|
||||||
|
|
||||||
|
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 );
|
||||||
|
|
||||||
|
LineEdit2 = new QLineEdit( GroupBox1, "LineEdit2" );
|
||||||
|
|
||||||
|
Layout1->addWidget( LineEdit2, 1, 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 );
|
||||||
|
|
||||||
|
TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
|
||||||
|
TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel3->setText( trUtf8( "TL3" ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( TextLabel3, 2, 0 );
|
||||||
|
|
||||||
|
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
|
||||||
|
|
||||||
|
Layout1->addWidget( LineEdit1, 0, 2 );
|
||||||
|
QSpacerItem* spacer = new QSpacerItem( 0, 159, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||||
|
Layout1->addItem( spacer, 3, 2 );
|
||||||
|
|
||||||
|
TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
|
||||||
|
TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel2->setText( trUtf8( "TL2" ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( TextLabel2, 1, 0 );
|
||||||
|
|
||||||
|
PushButton3 = new QPushButton( GroupBox1, "PushButton3" );
|
||||||
|
PushButton3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton3->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
PushButton3->setText( trUtf8( "" ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( PushButton3, 2, 1 );
|
||||||
|
|
||||||
|
PushButton2 = new QPushButton( GroupBox1, "PushButton2" );
|
||||||
|
PushButton2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton2->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
PushButton2->setText( trUtf8( "" ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( PushButton2, 1, 1 );
|
||||||
|
|
||||||
|
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||||
|
|
||||||
|
DlgRef_3Sel_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
DlgRef_3Sel_QTD::~DlgRef_3Sel_QTD()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
48
src/DlgRef/DlgRef_3Sel_QTD.h
Normal file
48
src/DlgRef/DlgRef_3Sel_QTD.h
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form interface generated from reading ui file 'DlgRef_3Sel_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: lun sep 29 11:05:21 2003
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#ifndef DLGREF_3SEL_QTD_H
|
||||||
|
#define DLGREF_3SEL_QTD_H
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qwidget.h>
|
||||||
|
class QVBoxLayout;
|
||||||
|
class QHBoxLayout;
|
||||||
|
class QGridLayout;
|
||||||
|
class QGroupBox;
|
||||||
|
class QLabel;
|
||||||
|
class QLineEdit;
|
||||||
|
class QPushButton;
|
||||||
|
|
||||||
|
class DlgRef_3Sel_QTD : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_3Sel_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||||
|
~DlgRef_3Sel_QTD();
|
||||||
|
|
||||||
|
QGroupBox* GroupBox1;
|
||||||
|
QLineEdit* LineEdit3;
|
||||||
|
QPushButton* PushButton1;
|
||||||
|
QLineEdit* LineEdit2;
|
||||||
|
QLabel* TextLabel1;
|
||||||
|
QLabel* TextLabel3;
|
||||||
|
QLineEdit* LineEdit1;
|
||||||
|
QLabel* TextLabel2;
|
||||||
|
QPushButton* PushButton3;
|
||||||
|
QPushButton* PushButton2;
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QGridLayout* DlgRef_3Sel_QTDLayout;
|
||||||
|
QGridLayout* GroupBox1Layout;
|
||||||
|
QGridLayout* Layout1;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_3SEL_QTD_H
|
63
src/DlgRef/DlgRef_3Spin.cxx
Normal file
63
src/DlgRef/DlgRef_3Spin.cxx
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
// 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_3Spin.cxx
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#include "DlgRef_3Spin.h"
|
||||||
|
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qspinbox.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_3Spin which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'
|
||||||
|
*/
|
||||||
|
DlgRef_3Spin::DlgRef_3Spin(QWidget* parent, const char* name, WFlags fl)
|
||||||
|
:DlgRef_3Spin_QTD(parent, name, fl)
|
||||||
|
{
|
||||||
|
SpinBox1->close(TRUE);
|
||||||
|
SpinBox2->close(TRUE);
|
||||||
|
SpinBox3->close(TRUE);
|
||||||
|
|
||||||
|
SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
|
||||||
|
Layout1->addWidget(SpinBox_DX, 0, 1);
|
||||||
|
|
||||||
|
SpinBox_DY = new DlgRef_SpinBox(GroupBox1, "SpinBox_DY");
|
||||||
|
Layout1->addWidget(SpinBox_DY, 1, 1);
|
||||||
|
|
||||||
|
SpinBox_DZ = new DlgRef_SpinBox(GroupBox1, "SpinBox_DZ");
|
||||||
|
Layout1->addWidget(SpinBox_DZ, 2, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
DlgRef_3Spin::~DlgRef_3Spin()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
49
src/DlgRef/DlgRef_3Spin.h
Normal file
49
src/DlgRef/DlgRef_3Spin.h
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
// 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_3Spin.h
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#ifndef DLGREF_3SPIN_H
|
||||||
|
#define DLGREF_3SPIN_H
|
||||||
|
|
||||||
|
#include "DlgRef_3Spin_QTD.h"
|
||||||
|
#include "DlgRef_SpinBox.h"
|
||||||
|
|
||||||
|
class DlgRef_3Spin : public DlgRef_3Spin_QTD
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_3Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||||
|
~DlgRef_3Spin();
|
||||||
|
|
||||||
|
DlgRef_SpinBox* SpinBox_DX;
|
||||||
|
DlgRef_SpinBox* SpinBox_DY;
|
||||||
|
DlgRef_SpinBox* SpinBox_DZ;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_3SPIN_H
|
63
src/DlgRef/DlgRef_3Spin1Check.cxx
Normal file
63
src/DlgRef/DlgRef_3Spin1Check.cxx
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
// 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_3Spin1Check.cxx
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#include "DlgRef_3Spin1Check.h"
|
||||||
|
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qspinbox.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_3Spin which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'
|
||||||
|
*/
|
||||||
|
DlgRef_3Spin1Check::DlgRef_3Spin1Check(QWidget* parent, const char* name, WFlags fl)
|
||||||
|
:DlgRef_3Spin1Check_QTD(parent, name, fl)
|
||||||
|
{
|
||||||
|
SpinBox1->close(TRUE);
|
||||||
|
SpinBox2->close(TRUE);
|
||||||
|
SpinBox3->close(TRUE);
|
||||||
|
|
||||||
|
SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
|
||||||
|
Layout1->addWidget(SpinBox_DX, 0, 1);
|
||||||
|
|
||||||
|
SpinBox_DY = new DlgRef_SpinBox(GroupBox1, "SpinBox_DY");
|
||||||
|
Layout1->addWidget(SpinBox_DY, 1, 1);
|
||||||
|
|
||||||
|
SpinBox_DZ = new DlgRef_SpinBox(GroupBox1, "SpinBox_DZ");
|
||||||
|
Layout1->addWidget(SpinBox_DZ, 2, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
DlgRef_3Spin1Check::~DlgRef_3Spin1Check()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user