DCQ : Architecture GEOM...

This commit is contained in:
dcq 2003-10-22 12:16:27 +00:00
parent cd1b14bda9
commit 377d97d833
13 changed files with 2352 additions and 2985 deletions

1229
src/GEOMBase/GEOMBase.cxx Normal file

File diff suppressed because it is too large Load Diff

106
src/GEOMBase/GEOMBase.h Normal file
View File

@ -0,0 +1,106 @@
// 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.h
// Author : Damien COQUERET
// Module : GEOM
// $Header:
#ifndef GEOMBASE_H
#define GEOMBASE_H
#include "GEOMContext.h"
#include "SALOME_Selection.h"
#include <V3d_View.hxx>
//=================================================================================
// class : GEOMBase
// purpose :
//=================================================================================
class GEOMBase : public QObject
{
Q_OBJECT /* for QT compatibility */
public :
GEOMBase();
~GEOMBase();
bool AddInStudy(bool selection = false, const Handle(SALOME_InteractiveObject)& anIO = 0);
bool VertexToPoint(const TopoDS_Shape& S, gp_Pnt& P);
bool LinearEdgeExtremities(const TopoDS_Shape& S, gp_Pnt& P1, gp_Pnt& P2);
gp_Pnt ConvertClickToPoint(Standard_Real x, Standard_Real y, Handle(V3d_View) aView);
void GetBipointDxDyDz(gp_Pnt P1, gp_Pnt P2, double& dx, double& dy, double& dz);
/* User dialog 1 parameter returned */
double Parameter(Standard_Boolean& res,
const char* aValue1 = 0, const char* aTitle1 = 0,
const char* aTitle = 0, const double bottom = -1E6,
const double top = +1E6, const int decimals = 6);
bool DefineDlgPosition(QWidget* aDlg, int& x, int& y);
bool SObjectExist(SALOMEDS::SObject_ptr theFatherObject, const char* IOR);
/* Selection and objects management */
TopoDS_Shape GetShapeFromIOR(QString IOR);
bool GetTopoFromSelection(SALOME_Selection *Sel, TopoDS_Shape& tds);
int GetNameOfSelectedIObjects(SALOME_Selection* Sel, QString& aName);
bool GetShapeTypeString(const TopoDS_Shape& aShape, Standard_CString& aTypeString);
GEOM::GEOM_Shape_ptr ConvertIOinGEOMShape(const Handle(SALOME_InteractiveObject)& IO,
Standard_Boolean& testResult);
Handle(GEOM_AISShape) ConvertIOinGEOMAISShape(const Handle(SALOME_InteractiveObject)& IO,
Standard_Boolean& testResult,
bool onlyInActiveView = false);
Handle(GEOM_AISShape) ConvertIORinGEOMAISShape(const char * IOR,
Standard_Boolean& testResult,
bool onlyInActiveView = false);
GEOM_Actor* ConvertIORinGEOMActor(const char * IOR, Standard_Boolean& testResult,
bool onlyInActiveView = false);
void ConvertListOfIOInListOfIOR(const SALOME_ListIO& aList,
GEOM::GEOM_Gen::ListOfIOR& listIOR);
/* Method used by dialog boxes called when used has entered a name of object in a LineEdit */
bool SelectionByNameInDialogs(QWidget* aWidget, const QString& userObjectName, SALOME_Selection *Sel);
int GetIndex(const TopoDS_Shape& subshape, const TopoDS_Shape& shape, int ShapeType);
/* Define a list of indices of sub shapes selected in a local context */
bool GetIndexSubShapeSelected(const TopoDS_Shape& ShapeTopo, const int SubShapeType,
GEOM::GEOM_Shape::ListOfSubShapeID& ListOfID,
Standard_Integer& aLocalContextId, bool& myUseLocalContext);
void SetDisplayedObjectList();
bool Display(GEOM::GEOM_Shape_ptr aShape, Standard_CString name = "");
/* Simulation management */
bool CreateArrowForLinearEdge(const TopoDS_Shape& tds, TopoDS_Shape& ArrowCone);
void DisplaySimulationShape(const TopoDS_Shape& S);
void EraseSimulationShape();
GEOMContext* myGeomGUI;
GEOM::GEOM_Gen_var myGeom; /* Current Geom Component */
};
#endif

View File

@ -0,0 +1,175 @@
// 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_Skeleton.cxx
// Author : Damien COQUERET
// Module : GEOM
// $Header:
using namespace std;
#include "GEOMBase_Skeleton.h"
//=================================================================================
// class : GEOMBase_Skeleton()
// purpose : Constructs a GEOMBase_Skeleton 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.
//=================================================================================
GEOMBase_Skeleton::GEOMBase_Skeleton(QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl)
:DlgRef_Skeleton_QTD(parent, name, modal, fl)
{
if (!name)
setName("GEOMBase_Skeleton");
buttonCancel->setText(tr("GEOM_BUT_CLOSE"));
buttonOk->setText(tr("GEOM_BUT_OK"));
buttonApply->setText(tr("GEOM_BUT_APPLY"));
GroupMedium->close(TRUE);
resize(0, 0);
Init(Sel);
}
//=================================================================================
// function : ~GEOMBase_Skeleton()
// purpose : Destroys the object and frees any allocated resources
//=================================================================================
GEOMBase_Skeleton::~GEOMBase_Skeleton()
{
// no need to delete child widgets, Qt does it all for us
this->destroy(TRUE, TRUE);
}
//=================================================================================
// function : Init()
// purpose :
//=================================================================================
void GEOMBase_Skeleton::Init(SALOME_Selection* Sel)
{
/* init variables */
mySelection = Sel;
mySimulationTopoDs.Nullify();
myGeomBase = new GEOMBase();
myGeomGUI = GEOMContext::GetGeomGUI();
myGeomGUI->SetActiveDialogBox((QDialog*)this);
// Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM");
// myGeom = GEOM::GEOM_Gen::_narrow(comp);
myGeom = myGeomGUI->myComponentGeom;
/* signals and slots connections */
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
/* Move widget on the botton right corner of main widget */
// int x, y;
// myGeomGUI->DefineDlgPosition( this, x, y );
/* displays Dialog */
RadioButton1->setChecked(TRUE);
return;
}
//=================================================================================
// function : ClickOnCancel()
// purpose :
//=================================================================================
void GEOMBase_Skeleton::ClickOnCancel()
{
myGeomBase->EraseSimulationShape();
mySimulationTopoDs.Nullify();
mySelection->ClearFilters();
disconnect(mySelection, 0, this, 0);
myGeomGUI->ResetState();
reject();
return;
}
//=================================================================================
// function : LineEditReturnPressed()
// purpose :
//=================================================================================
void GEOMBase_Skeleton::LineEditReturnPressed()
{
/* User name of object input management */
/* If successfull the selection is changed and signal emitted... */
/* so SelectionIntoArgument() is automatically called. */
const QString objectUserName = myEditCurrentArgument->text();
QWidget* thisWidget = (QWidget*)this;
if(myGeomBase->SelectionByNameInDialogs(thisWidget, objectUserName, mySelection))
myEditCurrentArgument->setText(objectUserName);
return;
}
//=================================================================================
// function : DeactivateActiveDialog()
// purpose :
//=================================================================================
void GEOMBase_Skeleton::DeactivateActiveDialog()
{
this->setEnabled(false);
mySelection->ClearFilters();
disconnect(mySelection, 0, this, 0);
myGeomBase->EraseSimulationShape();
myGeomGUI->SetActiveDialogBox(0);
return;
}
//=================================================================================
// function : ActivateThisDialog()
// purpose :
//=================================================================================
void GEOMBase_Skeleton::ActivateThisDialog()
{
/* Emit a signal to deactivate the active dialog */
myGeomGUI->EmitSignalDeactivateDialog();
this->setEnabled(true);
myGeomGUI->SetActiveDialogBox((QDialog*)this);
return;
}
//=================================================================================
// function : closeEvent()
// purpose :
//=================================================================================
void GEOMBase_Skeleton::closeEvent(QCloseEvent* e)
{
/* same than click on cancel button */
this->ClickOnCancel();
return;
}

View File

@ -0,0 +1,72 @@
// 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_Skeleton.h
// Author : Damine COQUERET
// Module : GEOM
// $Header:
#ifndef GEOMBASE_SKELETON_H
#define GEOMBASE_SKELETON_H
#include "DlgRef_Skeleton_QTD.h"
#include "GEOMBase.h"
#include <qwidget.h>
#include <qgroupbox.h>
#include <qlineedit.h>
#include <qlayout.h>
#include <qradiobutton.h>
#include <qbuttongroup.h>
class GEOMBase_Skeleton : public DlgRef_Skeleton_QTD
{
Q_OBJECT
public:
GEOMBase_Skeleton(QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
~GEOMBase_Skeleton();
private :
void Init(SALOME_Selection* Sel);
protected:
void closeEvent(QCloseEvent* e);
TopoDS_Shape mySimulationTopoDs; /* Shape used for simulation display */
QLineEdit* myEditCurrentArgument; /* Current LineEdit */
SALOME_Selection* mySelection; /* User shape selection */
GEOM::GEOM_Gen_var myGeom; /* Current GeomI object */
GEOMBase* myGeomBase;
GEOMContext* myGeomGUI; /* Current GeomGUI object */
protected slots:
void ClickOnCancel();
void LineEditReturnPressed();
void DeactivateActiveDialog();
void ActivateThisDialog();
};
#endif // GEOMBASE_SKELETON_H

View File

@ -0,0 +1,490 @@
// 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_Sketcher.cxx
// Author : Damien COQUERET
// Module : GEOM
// $Header:
using namespace std;
#include "GEOMBase_Sketcher.h"
#include "QAD_RightFrame.h"
#include "OCCViewer_Viewer3d.h"
#include "SALOMEGUI_QtCatchCorbaException.hxx"
#include <BRepTools_WireExplorer.hxx>
#include <TopoDS_Wire.hxx>
#include <BRep_Tool.hxx>
#include <TopExp.hxx>
#include <Geom_Circle.hxx>
#include <Precision.hxx>
//=======================================================================
// function : GEOMBase_Sketcher()
// purpose : Constructor
//=======================================================================
GEOMBase_Sketcher::GEOMBase_Sketcher() :
QObject()
{
myGeomBase = new GEOMBase();
myGeomGUI = GEOMContext::GetGeomGUI();
// Engines::Component_var comp = myGeomGUI->GetDesktop()->getEngine("FactoryServer", "GEOM");
// myGeom = GEOM::GEOM_Gen::_narrow(comp);
myGeom = myGeomGUI->myComponentGeom;
mySketcher = myGeomGUI->GetSketcher();
}
//=======================================================================
// function : ~GEOMBase_Sketcher()
// purpose : Destructor
//=======================================================================
GEOMBase_Sketcher::~GEOMBase_Sketcher()
{
}
//=======================================================================
// function : OnGUIEvent()
// purpose :
//=======================================================================
bool GEOMBase_Sketcher::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
{
if(myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
return false;
myGeomGUI->EmitSignalDeactivateDialog();
SALOME_Selection* Sel = SALOME_Selection::Selection(myGeomGUI->GetActiveStudy()->getSelection());
QMenuBar* Mb = myGeomGUI->GetDesktop()->getMainMenuBar();
QMenuData* pp;
switch (theCommandID)
{
case 404: // SKETCHER
{
((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->onViewTop(); // DCQ : 28/02/2002
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
mySketcher = Sketch(v3d->getViewer3d());
myGeomGUI->SetState(CURRENT_SKETCH);
QMenuItem* item = Mb->findItem(4061, &pp);
mySketcher.SetParameterVisibility(LENGTH_PARAMETER, pp->isItemChecked(4061));
item = Mb->findItem(4062, &pp);
mySketcher.SetParameterVisibility(ANGLE_PARAMETER, pp->isItemChecked(4062));
item = Mb->findItem(4063, &pp);
mySketcher.SetParameterVisibility(RADIUS_PARAMETER, pp->isItemChecked(4063));
item = Mb->findItem(4064, &pp);
mySketcher.SetParameterVisibility(XVALUE_PARAMETER, pp->isItemChecked(4064));
item = Mb->findItem(4065, &pp);
mySketcher.SetParameterVisibility(YVALUE_PARAMETER, pp->isItemChecked(4065));
mySketcher.SetTransitionStatus(NOCONSTRAINT);
item = Mb->findItem(4052, &pp);
pp->setItemChecked(4052, false);
item = Mb->findItem(4053, &pp);
pp->setItemChecked(4053, false);
break;
}
case 4041: // SKETCH Segment
{
mySketcher.ChangeMode(SEGMENT);
break;
}
case 4042: // SKETCH Arc
{
mySketcher.ChangeMode(ARC_CHORD);
break;
}
case 4043: // SKETCH Set Angle
{
OnSketchSetAngle();
break;
}
case 4044: // SKETCH Set X
{
OnSketchSetx();
break;
}
case 4045: // SKETCH Set Y
{
OnSketchSety();
break;
}
case 4046: // SKETCH Delete
{
OnSketchDelete();
break;
}
case 4047: // SKETCH End
{
OnSketchEnd();
break;
}
case 4048: // SKETCH Close
{
OnSketchClose();
break;
}
case 4051: // sketcher Set Plane
{
//TO DO
break;
}
case 4052: // sketcher TANGENT
{
QMenuItem* item = Mb->findItem(theCommandID, &pp);
pp->setItemChecked(theCommandID, !pp->isItemChecked(theCommandID));
if(pp->isItemChecked(theCommandID) == true)
mySketcher.SetTransitionStatus(TANGENT);
else
mySketcher.SetTransitionStatus(NOCONSTRAINT);
pp->setItemChecked(4053, false);
break;
}
case 4053: // sketcher PERPENDICULAR
{
QMenuItem* item = Mb->findItem(theCommandID, &pp);
pp->setItemChecked(theCommandID,!pp->isItemChecked(theCommandID));
if(pp->isItemChecked(theCommandID) == true)
mySketcher.SetTransitionStatus(PERPENDICULAR);
else
mySketcher.SetTransitionStatus(NOCONSTRAINT);
pp->setItemChecked(4052, false);
break;
}
case 4061: // SKETCH OptionsOnofflengthdimension
{
QMenuItem* item = Mb->findItem(theCommandID, &pp);
pp->setItemChecked(theCommandID, !pp->isItemChecked(theCommandID));
mySketcher.SetParameterVisibility(LENGTH_PARAMETER, pp->isItemChecked(theCommandID));
break;
}
case 4062: // SKETCH OptionsOnoffangledimension
{
QMenuItem* item = Mb->findItem(theCommandID, &pp);
pp->setItemChecked(theCommandID, !pp->isItemChecked(theCommandID));
mySketcher.SetParameterVisibility(ANGLE_PARAMETER, pp->isItemChecked(theCommandID));
break;
}
case 4063: // SKETCH OptionsOnoffradiusdimension
{
QMenuItem* item = Mb->findItem(theCommandID, &pp);
pp->setItemChecked(theCommandID, !pp->isItemChecked(theCommandID));
mySketcher.SetParameterVisibility(RADIUS_PARAMETER, pp->isItemChecked(theCommandID));
break;
}
case 4064: // SKETCH OptionsOnoffxdimension
{
QMenuItem* item = Mb->findItem(theCommandID, &pp);
pp->setItemChecked(theCommandID, !pp->isItemChecked(theCommandID));
mySketcher.SetParameterVisibility(XVALUE_PARAMETER, pp->isItemChecked(theCommandID));
break;
}
case 4065: // SKETCH OptionsOnoffydimension
{
QMenuItem* item = Mb->findItem(theCommandID, &pp);
pp->setItemChecked(theCommandID, !pp->isItemChecked(theCommandID));
mySketcher.SetParameterVisibility(YVALUE_PARAMETER, pp->isItemChecked(theCommandID));
break;
}
default:
{
parent->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
break;
}
}
return true;
}
//=======================================================================
// function : OnSketchSetAngle()
// purpose :
//=======================================================================
void GEOMBase_Sketcher::OnSketchSetAngle()
{
Standard_Real anAngle = mySketcher.GetSegmentAngle()/PI180;
Sketch::fitInResol(anAngle);
Standard_Boolean res = false;
QString Value = QString("%1").arg(anAngle);
anAngle = myGeomBase->Parameter(res, Value, tr("GEOM_MEN_ANGLE"), tr("GEOM_MEN_ENTER_ANGLE"),
-180.0, +180.0, 6) * PI180;
if(res) {
mySketcher.SetSegmentAngle(anAngle);
QMenuBar* Mb = myGeomGUI->GetDesktop()->getMainMenuBar();
QMenuData* pp;
QMenuItem* item = Mb->findItem(4052, &pp);
pp->setItemChecked(4052, false);
item = Mb->findItem(4053, &pp);
pp->setItemChecked(4053, false);
}
return;
}
//=======================================================================
// function : OnSketchSetx()
// purpose :
//=======================================================================
void GEOMBase_Sketcher::OnSketchSetx()
{
Standard_Boolean res = false;
double X = myGeomBase->Parameter(res, "0.", tr("GEOM_MEN_X"), tr("GEOM_MEN_SKETCHER_X"),
2.0 * Precision::Confusion(), 1E6, 6);
if(res)
mySketcher.SetXDimension(X);
QMenuBar* Mb = myGeomGUI->GetDesktop()->getMainMenuBar();
QMenuData* pp;
QMenuItem* item = Mb->findItem(4052, &pp);
pp->setItemChecked(4052, false);
item = Mb->findItem(4053, &pp);
pp->setItemChecked(4053, false);
return;
}
//=======================================================================
// function : OnSketchSety()
// purpose :
//=======================================================================
void GEOMBase_Sketcher::OnSketchSety()
{
Standard_Boolean res = false;
double Y = myGeomBase->Parameter(res, "0.", tr("GEOM_MEN_Y"), tr("GEOM_MEN_SKETCHER_Y"), 2.0 * Precision::Confusion(), 1E6, 6);
if(res)
mySketcher.SetYDimension(Y);
QMenuBar* Mb = myGeomGUI->GetDesktop()->getMainMenuBar();
QMenuData* pp;
QMenuItem* item = Mb->findItem(4052, &pp);
pp->setItemChecked(4052, false);
item = Mb->findItem(4053, &pp);
pp->setItemChecked(4053, false);
return;
}
//=======================================================================
// function : OnSketchDelete()
// purpose :
//=======================================================================
void GEOMBase_Sketcher::OnSketchDelete()
{
if(mySketcher.GetmyEdgesNumber() == 1) {
QMenuBar* Mb = myGeomGUI->GetDesktop()->getMainMenuBar();
QMenuData* pp;
QMenuItem* item = Mb->findItem(406, &pp);
pp->setItemEnabled(406, false); // SKETCH CONTRAINTS
mySketcher.SetTransitionStatus(NOCONSTRAINT);
}
if(mySketcher.Delete())
myGeomGUI->ResetState();
return;
}
//=======================================================================
// function : OnSketchClose()
// purpose :
//=======================================================================
void GEOMBase_Sketcher::OnSketchClose()
{
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
Handle(AIS_InteractiveContext) myContext = v3d->getAISContext();
TopoDS_Wire W = mySketcher.Close();
if(!W.IsNull()) {
GEOM::GEOM_Gen::ListOfIOR_var listShapes = new GEOM::GEOM_Gen::ListOfIOR;
listShapes->length(0);
unsigned int i = 0;
BRepTools_WireExplorer Ex(W);
while(Ex.More()) {
TopoDS_Edge E = Ex.Current();
gp_Pnt pt1, pt2;
pt1 = BRep_Tool::Pnt(TopExp::FirstVertex(E));
pt2 = BRep_Tool::Pnt(TopExp::LastVertex(E));
gp_Pnt CenterPoint;
Handle(Geom_Curve) Curve;
Handle(Geom_Circle) Circle;
gp_Circ Circ;
Standard_Real First,Last;
Curve = BRep_Tool::Curve(E,First,Last);
if(Curve->IsKind(STANDARD_TYPE(Geom_Circle))) {
Circle = Handle(Geom_Circle)::DownCast(Curve); // pointer on geom_circ
Circ = Circle->Circ(); // gp_Circ
Curve->D0((First + Last) / 2., CenterPoint);
GEOM::PointStruct pI = myGeom->MakePointStruct(pt1.X(), pt1.Y(), pt1.Z());
GEOM::PointStruct pC = myGeom->MakePointStruct(CenterPoint.X(), CenterPoint.Y(), CenterPoint.Z());
GEOM::PointStruct pE = myGeom->MakePointStruct(pt2.X(), pt2.Y(), pt2.Z());
GEOM::GEOM_Shape_var arc;
try {
arc = myGeom->MakeArc(pI, pC, pE);
}
catch (const SALOME::SALOME_Exception& S_ex) {
QtCatchCorbaException(S_ex);
}
listShapes->length(i+1);
listShapes[i] = strdup(arc->Name());
i++;
}
else {
GEOM::PointStruct pI = myGeom->MakePointStruct(pt1.X(), pt1.Y(), pt1.Z());
GEOM::PointStruct pE = myGeom->MakePointStruct(pt2.X(), pt2.Y(), pt2.Z());
GEOM::GEOM_Shape_var segment;
try {
segment = myGeom->MakeEdge(pI,pE);
}
catch (const SALOME::SALOME_Exception& S_ex) {
QtCatchCorbaException(S_ex);
}
listShapes->length(i+1);
listShapes[i] = strdup(segment->Name());
i++;
}
Ex.Next();
}
GEOM::GEOM_Shape_var Wire = myGeom->MakeWire(listShapes);
TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, Wire);
Standard_CString type;
myGeomBase->GetShapeTypeString(S,type);
Wire->NameType(type);
if(myGeomBase->Display(Wire))
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
}
myGeomGUI->ResetState();
QMenuBar* Mb = myGeomGUI->GetDesktop()->getMainMenuBar();
QMenuData* pp;
QMenuItem* item = Mb->findItem(406, &pp);
pp->setItemEnabled(406, false); // SKETCH CONTRAINTS
mySketcher.SetTransitionStatus(NOCONSTRAINT);
return;
}
//=======================================================================
// function : OnSketchEnd()
// purpose :
//=======================================================================
void GEOMBase_Sketcher::OnSketchEnd()
{
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)myGeomGUI->GetActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
Handle (AIS_InteractiveContext) myContext = v3d->getAISContext();
TopoDS_Wire W = mySketcher.End();
if(!W.IsNull()) {
GEOM::GEOM_Gen::ListOfIOR_var listShapes = new GEOM::GEOM_Gen::ListOfIOR;
listShapes->length(0);
unsigned int i = 0;
BRepTools_WireExplorer Ex(W);
while(Ex.More()) {
TopoDS_Edge E = TopoDS::Edge(Ex.Current());
gp_Pnt pt1, pt2;
pt1 = BRep_Tool::Pnt(TopExp::FirstVertex(E));
pt2 = BRep_Tool::Pnt(TopExp::LastVertex(E));
gp_Pnt CenterPoint;
Handle(Geom_Curve) Curve;
Handle(Geom_Circle) Circle;
gp_Circ Circ;
Standard_Real First,Last;
Curve = BRep_Tool::Curve(E,First,Last);
if(Curve->IsKind(STANDARD_TYPE(Geom_Circle))) {
Circle = Handle(Geom_Circle)::DownCast(Curve); // pointer on geom_circ
Circ = Circle->Circ(); // gp_Circ
Curve->D0((First + Last) / 2., CenterPoint);
GEOM::PointStruct pI = myGeom->MakePointStruct(pt1.X(), pt1.Y(), pt1.Z());
GEOM::PointStruct pC = myGeom->MakePointStruct(CenterPoint.X(), CenterPoint.Y(), CenterPoint.Z());
GEOM::PointStruct pE = myGeom->MakePointStruct(pt2.X(), pt2.Y(), pt2.Z());
GEOM::GEOM_Shape_var arc;
try {
arc = myGeom->MakeArc(pI, pC, pE);
}
catch (const SALOME::SALOME_Exception& S_ex) {
QtCatchCorbaException(S_ex);
}
listShapes->length(i+1);
listShapes[i] = strdup(arc->Name());
i++;
} else {
GEOM::PointStruct pI = myGeom->MakePointStruct(pt1.X(), pt1.Y(), pt1.Z());
GEOM::PointStruct pE = myGeom->MakePointStruct(pt2.X(), pt2.Y(), pt2.Z());
GEOM::GEOM_Shape_var segment;
try {
segment = myGeom->MakeEdge(pI,pE);
}
catch (const SALOME::SALOME_Exception& S_ex) {
QtCatchCorbaException(S_ex);
}
listShapes->length(i+1);
listShapes[i] = strdup(segment->Name());
i++;
}
Ex.Next();
}
GEOM::GEOM_Shape_var Wire = myGeom->MakeWire(listShapes);
TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, Wire);
Standard_CString type;
myGeomBase->GetShapeTypeString(S,type);
Wire->NameType(type);
if(myGeomBase->Display(Wire))
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
}
myGeomGUI->ResetState();
QMenuBar* Mb = myGeomGUI->GetDesktop()->getMainMenuBar();
QMenuData* pp;
QMenuItem* item = Mb->findItem(406, &pp);
pp->setItemEnabled(406, false); // SKETCH CONTRAINTS
mySketcher.SetTransitionStatus(NOCONSTRAINT);
return;
}

View File

@ -0,0 +1,65 @@
// 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_Sketcher.h
// Author : Damien COQUERET
// Module : GEOM
// $Header:
#ifndef GEOMBASE_SKETCHER_H
#define GEOMBASE_SKETCHER_H
#include "GEOMBase.h"
//=================================================================================
// class : GEOMBase_Sketcher
// purpose :
//=================================================================================
class GEOMBase_Sketcher : public QObject
{
Q_OBJECT /* for QT compatibility */
public :
GEOMBase_Sketcher();
~GEOMBase_Sketcher();
bool OnGUIEvent(int theCommandID, QAD_Desktop* parent);
/* Sketcher management */
void OnSketchSetAngle();
void OnSketchSetx();
void OnSketchSety();
void OnSketchDelete();
void OnSketchClose();
void OnSketchEnd();
private:
GEOMBase* myGeomBase;
GEOMContext* myGeomGUI;
GEOM::GEOM_Gen_var myGeom; /* Current Geom Component */
Sketch mySketcher;
};
#endif

View File

@ -0,0 +1,156 @@
// 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_aParameterDlg.cxx
// Author : Lucien PIGNOLONI
// Module : GEOM
// $Header$
using namespace std;
#include "GEOMBase_aParameterDlg.h"
#include "QAD_SpinBoxDbl.h"
#include "QAD_Tools.h"
#include <stdio.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <qvariant.h>
#include <qvalidator.h>
//======================================================================================
// function : GEOMBase_aParameterDlg()
// purpose : Constructs a GEOMBase_aParametertDlg which is a child of 'parent', with the
// name 'name' and widget flags set to 'f'
//
// avalue1 : is a float or integer used as default value in edit line
// aTitle1 : is the prompt for aValue1
// aTitle : is the title for the user in dialog box
//
// bottom : the minimal value to be entered
// top : the maximum value to be entered
// decimals : number of decimals to be entered
//
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
//
//======================================================================================
GEOMBase_aParameterDlg::GEOMBase_aParameterDlg(const char *aValue1, const char *aTitle1, QWidget* parent, const char* name, bool modal, WFlags fl, const double bottom, const double top, const int decimals)
:QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{
if(!name)
setName( "MyParameterDialog" );
resize(288, 81);
setCaption(name); /* appears on the title bar */
setSizeGripEnabled(TRUE);
QGridLayout* topLayout = new QGridLayout(this);
topLayout->setSpacing(6);
topLayout->setMargin(11);
QGroupBox* mainGrp = new QGroupBox(this, "mainGrp");
mainGrp->setColumnLayout(0, Qt::Vertical);
mainGrp->layout()->setSpacing(0);
mainGrp->layout()->setMargin(0);
QGridLayout* mainGrpLayout = new QGridLayout(mainGrp->layout());
mainGrpLayout->setAlignment(Qt::AlignTop);
mainGrpLayout ->setSpacing(6);
mainGrpLayout->setMargin(11);
topLayout->addWidget(mainGrp, 0, 0);
/* aTitle1 : text prompt on left of edit line */
QLabel* TextLabel1 = new QLabel(mainGrp, "TextLabel1");
TextLabel1->setText(tr(aTitle1));
mainGrpLayout->addWidget(TextLabel1, 0, 0);
mySpinBox = new QAD_SpinBoxDbl(mainGrp, "mySpinBox");
mySpinBox->setPrecision(12);
mySpinBox->setRange(bottom, top);
((QDoubleValidator*)(mySpinBox->validator()))->setRange(bottom, top, decimals);
mySpinBox->setValue(QString(aValue1).toDouble());
mainGrpLayout->addWidget(mySpinBox, 0, 1);
QGroupBox* btnGrp = new QGroupBox(this, "btnGrp");
btnGrp->setColumnLayout(0, Qt::Vertical);
btnGrp->layout()->setSpacing(0);
btnGrp->layout()->setMargin(0);
QGridLayout* btnGrpLayout = new QGridLayout(btnGrp->layout());
btnGrpLayout->setAlignment(Qt::AlignTop);
btnGrpLayout->setSpacing(6);
btnGrpLayout->setMargin(11);
topLayout->addWidget(btnGrp, 1, 0);
/* Ok button */
myButtonOk = new QPushButton(btnGrp, "buttonOk");
myButtonOk->setText(tr("GEOM_BUT_OK"));
myButtonOk->setAutoDefault(TRUE);
myButtonOk->setDefault(TRUE);
btnGrpLayout->addWidget(myButtonOk, 0, 0);
btnGrpLayout->addItem(new QSpacerItem(5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1);
/* Cancel button */
myButtonCancel = new QPushButton(btnGrp, "buttonCancel");
myButtonCancel->setText(tr("GEOM_BUT_CANCEL"));
myButtonCancel->setAutoDefault(TRUE);
btnGrpLayout->addWidget(myButtonCancel, 0, 2);
/* signals and slots connections */
connect(myButtonOk, SIGNAL(clicked()), this, SLOT(accept()));
connect(myButtonCancel, SIGNAL(clicked()), this, SLOT(reject()));
/* Move widget on the botton right corner of main widget */
QAD_Tools::centerWidget(this, parent);
}
//======================================================================================
// function : ~GEOMBase_aParameterDlg() destructor
// purpose : Destroys the object and frees any allocated resources
//======================================================================================
GEOMBase_aParameterDlg::~GEOMBase_aParameterDlg()
{
// no need to delete child widgets, Qt does it all for us
}
//======================================================================================
// function : GEOMBase_aParameterDlg::setValue
// purpose : sets value
//======================================================================================
void GEOMBase_aParameterDlg::setValue(double val)
{
mySpinBox->setValue(val);
}
//======================================================================================
// function : GEOMBase_aParameterDlg::getValue
// purpose : gets value
//======================================================================================
double GEOMBase_aParameterDlg::getValue()
{
return mySpinBox->value();
}

View File

@ -0,0 +1,59 @@
// 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_aParameterDlg.h
// Author : Lucien PIGNOLONI
// Module : GEOM
// $Header$
#ifndef GEOMBase_aParameterDLG_H
#define GEOMBase_aParameterDLG_H
#include <qdialog.h>
class QPushButton;
class QAD_SpinBoxDbl;
//=================================================================================
// class : GEOMBase_aParameterDlg
// purpose :
//=================================================================================
class GEOMBase_aParameterDlg : public QDialog
{
Q_OBJECT
public:
GEOMBase_aParameterDlg(const char* aValue1 = "25", const char* aTitle1 = "Value :", QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0, const double bottom = -1E6, const double top = +1E6, const int decimals = 6);
~GEOMBase_aParameterDlg();
void setValue(double val);
double getValue();
private:
QPushButton* myButtonOk;
QPushButton* myButtonCancel;
QAD_SpinBoxDbl* mySpinBox;
};
#endif // GEOMBase_aParameterDlg.h

View File

@ -1,196 +0,0 @@
//
// 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 : GEOMContext.cxx
// Author : Damien COQUERET
// Module : GEOM
// $Header:
using namespace std;
#include "GEOMContext.h"
#include "QAD_Tools.h"
/* The object itself created in the static method 'GetOrCreateGEOMBase()' */
static GEOMContext* GeomGUI = 0;
//=======================================================================
// function : GEOMContext()
// purpose : Constructor
//=======================================================================
GEOMContext::GEOMContext() :
QObject()
{
mySettings_AddInStudy = false;
mySettings_Copy = false;
myFatherior = "";
}
//=======================================================================
// function : ~GEOMContext()
// purpose : Destructor
//=======================================================================
GEOMContext::~GEOMContext()
{
}
//=======================================================================
// function : GetGEOMContext() static
// purpose : Returns current 'GeomGUI' a static pointer
//=======================================================================
GEOMContext* GEOMContext::GetGeomGUI()
{
return GeomGUI;
}
//=======================================================================
// function : GetOrCreateGEOMBase()
// purpose : Gets or create an object 'GEOMBase' with initialisations
// : Returns 'GeomGUI' as a pointer
//=======================================================================
GEOMContext* GEOMContext::GetOrCreateGeomGUI(QAD_Desktop* desktop)
{
if(GeomGUI == 0) {
GeomGUI = new GEOMContext();
GeomGUI->myDesktop = desktop;
GeomGUI->myActiveStudy = desktop->getActiveStudy();
Engines::Component_var comp = desktop->getEngine("FactoryServer", "GEOM");
GeomGUI->myComponentGeom = GEOM::GEOM_Gen::_narrow(comp);
GeomGUI->myState = -1;
GeomGUI->myActiveDialogBox = 0;
GeomGUI->myGUILibrary = OSD_SharedLibrary();
GeomGUI->mySimulationShape = new AIS_Shape(TopoDS_Shape());
GeomGUI->myShadingColor = Quantity_Color(Quantity_NOC_GOLDENROD);
/* GetCurrentStudy */
int studyId = GeomGUI->myActiveStudy->getStudyId();
GeomGUI->myComponentGeom->GetCurrentStudy(studyId);
GeomGUI->myNbGeom = GeomGUI->myComponentGeom->NbLabels();
}
else {
/* study may have changed */
GeomGUI->myActiveStudy = desktop->getActiveStudy();
}
return GeomGUI;
}
//=======================================================================
// function : LoadLibrary()
// purpose :
//=======================================================================
bool GEOMContext::LoadLibrary(QString GUILibrary)
{
QCString libs;
QFileInfo fileInfo;
QString GUILib, fileString, dir;
if(libs = getenv("LD_LIBRARY_PATH")) {
QStringList dirList = QStringList::split(":", libs, false); // skip empty entries
for(int i = dirList.count()-1; i >= 0; i--) {
dir = dirList[i];
fileString = QAD_Tools::addSlash(dir) + GUILibrary;
fileInfo.setFile(fileString);
if(fileInfo.exists()) {
GUILib = fileInfo.fileName();
break;
}
}
}
myGUILibrary.SetName(TCollection_AsciiString((char*)GUILib.latin1()).ToCString());
bool res = myGUILibrary.DlOpen(OSD_RTLD_LAZY);
if(!res)
cout<<"Can't open library : "<<myGUILibrary.DlError()<<endl;
return res;
}
//=======================================================================
// function : SetState()
// purpose : Sets myState = aState a private field indicating which methode is active
//=======================================================================
void GEOMContext::SetState(int aState)
{
myState = aState;
return;
}
//=======================================================================
// function : ResetState()
// purpose : Sets myState = -1 a private field indicating which methode is active
//=======================================================================
void GEOMContext::ResetState()
{
myState = -1;
return;
}
//=======================================================================
// function : SetActiveDialogBox()
// purpose :
//=======================================================================
void GEOMContext::SetActiveDialogBox(QDialog* aDlg)
{
myActiveDialogBox = (QDialog*)aDlg;
return;
}
//=======================================================================
// function : EmitSignalDeactivateDialog()
// purpose : Emit a signal to deactivate the active dialog Box
//=======================================================================
void GEOMContext::EmitSignalDeactivateDialog()
{
emit SignalDeactivateActiveDialog();
return;
}
//=======================================================================
// function : EmitSignalCloseAllDialogs()
// purpose : Emit a signal to deactivate all non modal dialogs box
//=======================================================================
void GEOMContext::EmitSignalCloseAllDialogs()
{
emit SignalCloseAllDialogs();
return;
}
//=======================================================================
// function : EmitSignalDefaultStepValueChanged()
// purpose :
//=======================================================================
void GEOMContext::EmitSignalDefaultStepValueChanged(double newVal)
{
emit SignalDefaultStepValueChanged(newVal);
return;
}

View File

@ -1,131 +0,0 @@
// GEOMCONTEXT
//
// 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 : GEOMContext.h
// Author : Damien COQUERET
// Module : GEOM
// $Header:
#ifndef GEOMCONTEXT_H
#define GEOMCONTEXT_H
// SALOME Includes
#include "QAD_Desktop.h"
#include "GEOM_Client.hxx"
#include "GEOM_AISShape.hxx"
#include "GEOM_InteractiveObject.hxx"
#include "GEOM_Actor.h"
#include "GEOM_Sketcher.h"
// Open CASCADE Includes
#include <Quantity_Color.hxx>
#include <AIS_ListOfInteractive.hxx>
#include <OSD_SharedLibrary.hxx>
// QT Includes
#include <qapplication.h>
// IDL Headers
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(GEOM_Gen)
#include CORBA_SERVER_HEADER(SALOMEDS)
#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
enum {POINT_METHOD, CURRENT_SKETCH};
//=================================================================================
// class : GEOMContext
// purpose :
//=================================================================================
class GEOMContext : public QObject
{
Q_OBJECT /* for QT compatibility */
public :
GEOMContext();
~GEOMContext();
private :
QAD_Desktop* myDesktop;
QAD_Study* myActiveStudy;
QDialog* myActiveDialogBox; /* Unique active dialog box */
int myNbGeom; /* Unique name for a geom entity */
int myState; /* Identify a method */
GEOM_Client myShapeReader;
Standard_CString myFatherior;
AIS_ListOfInteractive myListDisplayedObject;
Quantity_Color myShadingColor;
Handle(AIS_Shape) mySimulationShape; /* AIS shape used only during topo/geom simulations */
Sketch mySketcher;
bool mySettings_AddInStudy;
bool mySettings_Copy;
public :
static GEOMContext* GetOrCreateGeomGUI(QAD_Desktop* desktop);
static GEOMContext* GetGeomGUI();
OSD_SharedLibrary myGUILibrary;
GEOM::GEOM_Gen_var myComponentGeom;
//GEOM::GEOM_Gen_var* GetComponentGeom(){return myComponentGeom;};
QAD_Desktop* GetDesktop(){return myDesktop;};
QAD_Study* GetActiveStudy(){return myActiveStudy;};
QDialog* GetActiveDialogBox(){return myActiveDialogBox ;}; /* Returns the active DialogBox */
int& GetNbGeom(){return myNbGeom;};
int& GetState(){return myState;};
GEOM_Client& GetShapeReader(){return myShapeReader;};
Standard_CString& GetFatherior(){return myFatherior;};
AIS_ListOfInteractive& GetListDisplayedObject(){return myListDisplayedObject;};
Quantity_Color& GetShadingColor(){return myShadingColor;};
Handle(AIS_Shape) GetSimulationShape(){return mySimulationShape;};
Sketch& GetSketcher(){return mySketcher;};
bool& GetSettings_AddInStudy(){return mySettings_AddInStudy;};
bool& GetSettings_Copy(){return mySettings_Copy;};
bool LoadLibrary(QString GUILibrary);
void SetState(int aState);
void ResetState(); /* Sets myState = -1 a private field to indicate wich method is active */
void SetActiveDialogBox(QDialog* aDlg); /* Sets 'myActiveDialogBox' a pointer to the active Dialog Box */
/* Non modal dialog boxes magement */
void EmitSignalDeactivateDialog();
void EmitSignalCloseAllDialogs();
void EmitSignalDefaultStepValueChanged(double newVal);
signals :
void SignalDeactivateActiveDialog();
void SignalCloseAllDialogs();
void SignalDefaultStepValueChanged(double newVal);
};
#endif

View File

@ -1,349 +0,0 @@
# This is a Qt message file in .po format. Each msgid starts with
# a scope. This scope should *NOT* be translated - eg. translating
# from French to English, "Foo::Bar" would be translated to "Pub",
# not "Foo::Pub".
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"POT-Creation-Date: 2001-06-14 09:11:49 PM CEST\n"
"PO-Revision-Date: 2003-09-22 16:39+0200\n"
"Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
#Select
msgid "ICON_SELECT"
msgstr "select1.png"
#: QAD_ObjectBrowser.cxx:140
msgid "ICON_OBJBROWSER_Geometry"
msgstr "geometry.png"
#: QAD_ObjectBrowser.cxx:140
msgid "ICON_OBJBROWSER_COMPOUND"
msgstr "tree_compound.png"
#: QAD_ObjectBrowser.cxx:140
msgid "ICON_OBJBROWSER_COMPSOLID"
msgstr "tree_compsolid.png"
#: QAD_ObjectBrowser.cxx:140
msgid "ICON_OBJBROWSER_EDGE"
msgstr "tree_edge.png"
#: QAD_ObjectBrowser.cxx:140
msgid "ICON_OBJBROWSER_FACE"
msgstr "tree_face.png"
#: QAD_ObjectBrowser.cxx:140
msgid "ICON_OBJBROWSER_SHAPE"
msgstr "tree_shape.png"
#: QAD_ObjectBrowser.cxx:140
msgid "ICON_OBJBROWSER_SHELL"
msgstr "tree_shell.png"
#: QAD_ObjectBrowser.cxx:140
msgid "ICON_OBJBROWSER_SOLID"
msgstr "tree_solid.png"
#: QAD_ObjectBrowser.cxx:140
msgid "ICON_OBJBROWSER_VERTEX"
msgstr "tree_vertex.png"
#: QAD_ObjectBrowser.cxx:140
msgid "ICON_OBJBROWSER_WIRE"
msgstr "tree_wire.png"
#BoxDlg
msgid "ICON_DLG_BOX_2P"
msgstr "box2points.png"
#BoxDlg
msgid "ICON_DLG_BOX_DXYZ"
msgstr "boxdxyz.png"
#CylinderDlg
msgid "ICON_DLG_CYLINDER_PV"
msgstr "cylinderpointvector.png"
#CylinderDlg
msgid "ICON_DLG_CYLINDER_DXYZ"
msgstr "cylinderdxyz.png"
#SphereDlg
msgid "ICON_DLG_SPHERE_P"
msgstr "spherepoint.png"
#SphereDlg
msgid "ICON_DLG_SPHERE_DXYZ"
msgstr "spheredxyz.png"
#torusDlg
msgid "ICON_DLG_TORUS_PV"
msgstr "toruspointvector.png"
#ConeDlg
msgid "ICON_DLG_CONE_PV"
msgstr "conepointvector.png"
#torusDlg
msgid "ICON_DLG_TORUS_DXYZ"
msgstr "torusdxyz.png"
#ConeDlg
msgid "ICON_DLG_CONE_DXYZ"
msgstr "conedxyz.png"
#LineDlg
msgid "ICON_DLG_LINE_2P"
msgstr "line2points.png"
#LineDlg
msgid "ICON_DLG_LINE_EDGE"
msgstr "lineedge.png"
#LineDlg
msgid "ICON_DLG_LINE_PV"
msgstr "linepointvector.png"
#CircleDlg
msgid "ICON_DLG_CIRCLE_PV"
msgstr "circlepointvector.png"
#VectorDlg
msgid "ICON_DLG_VECTOR_2P"
msgstr "vector2points.png"
#vectorDlg
msgid "ICON_DLG_VECTOR_DXYZ"
msgstr "vectordxyz.png"
#PlaneDlg
msgid "ICON_DLG_PLANE_DXYZ"
msgstr "planedxyz.png"
#PlaneDlg
msgid "ICON_DLG_PLANE_FACE"
msgstr "planeface.png"
#PlaneDlg
msgid "ICON_DLG_PLANE_PV"
msgstr "planepointvector.png"
#WorkingPlaneDlg
msgid "ICON_DLG_WPLANE_FACE"
msgstr "planeworkingface.png"
#PointDlg
msgid "ICON_DLG_POINT"
msgstr "point2.png"
#PoinDlg
msgid "ICON_DLG_POINT_EDGE"
msgstr "pointonedge.png"
#ArcDlg
msgid "ICON_DLG_ARC"
msgstr "arc.png"
#ArchimedeDlg
msgid "ICON_DLG_ARCHIMEDE"
msgstr "archimede.png"
#PartitionDlg
msgid "ICON_DLG_PARTITION"
msgstr "partition.png"
#PartitionDlg
msgid "ICON_DLG_PARTITION_KEEP_FACES"
msgstr "partitionkeep.png"
#CenterMassDlg
msgid "ICON_DLG_CENTERMASS"
msgstr "centergravity.png"
#BoundingBoxDlg
msgid "ICON_DLG_BOUNDING_BOX"
msgstr "bounding.png"
#CommonDlg
msgid "ICON_DLG_COMMON"
msgstr "common.png"
#CompoundDlg
msgid "ICON_DLG_BUILD_COMPOUND"
msgstr "build_compound.png"
#CutDlg
msgid "ICON_DLG_CUT"
msgstr "cut.png"
#EdgeDlg
msgid "ICON_DLG_BUILD_EDGE"
msgstr "build_edge.png"
#FaceDlg
msgid "ICON_DLG_BUILD_FACE"
msgstr "build_face.png"
#ShellDlg
msgid "ICON_DLG_BUILD_SHELL"
msgstr "build_shell.png"
#SolidDlg
msgid "ICON_DLG_BUILD_SOLID"
msgstr "build_solid.png"
#WireDlg
msgid "ICON_DLG_BUILD_WIRE"
msgstr "build_wire.png"
#FillingDlg
msgid "ICON_DLG_FILLING"
msgstr "filling.png"
#FuseDlg
msgid "ICON_DLG_FUSE"
msgstr "fuse.png"
#InertiaDlg
msgid "ICON_DLG_INERTIA"
msgstr "axisinertia.png"
#ToleranceDlg
msgid "ICON_DLG_TOLERANCE"
msgstr "tolerance.png"
#BasicPropertiesDlg
msgid "ICON_DLG_BASICPROPERTIES"
msgstr "basicproperties.png"
#WhatisDlg
msgid "ICON_DLG_WHATIS"
msgstr "whatis.png"
#MinDistDlg
msgid "ICON_DLG_MINDIST"
msgstr "mindist.png"
#MirrorDlg
msgid "ICON_DLG_MIRROR"
msgstr "mirrorPlane.png"
#TranslationDlg
msgid "ICON_DLG_TRANSLATION"
msgstr "translation.png"
#RotationDlg
msgid "ICON_DLG_ROTATION"
msgstr "rotate.png"
#ScaleDlg
msgid "ICON_DLG_SCALE"
msgstr "scale.png"
#OrientationDlg
msgid "ICON_DLG_ORIENTATION"
msgstr "orientation.png"
#SewingDlg
msgid "ICON_DLG_SEWING"
msgstr "sewing.png"
#PipeDlg
msgid "ICON_DLG_PIPE"
msgstr "pipe.png"
#PrismDlg
msgid "ICON_DLG_PRISM"
msgstr "prism.png"
#RevolutionDlg
msgid "ICON_DLG_REVOL"
msgstr "revol.png"
#SectionDlg
msgid "ICON_DLG_SECTION"
msgstr "section.png"
#SubShapeDlg
msgid "ICON_DLG_SUBSHAPE"
msgstr "subshape.png"
#FilletDlg
msgid "ICON_DLG_FILLET"
msgstr "fillet.png"
#ChamferDlg
msgid "ICON_DLG_CHAMFER"
msgstr "chamfer.png"
#FilletDlg
msgid "ICON_DLG_FILLET_ALL"
msgstr "filletall.png"
#ChamferDlg
msgid "ICON_DLG_CHAMFER_ALL"
msgstr "chamferall.png"
#FilletDlg
msgid "ICON_DLG_FILLET_EDGE"
msgstr "filletedge.png"
#ChamferDlg
msgid "ICON_DLG_CHAMFER_EDGE"
msgstr "chamferedge.png"
#FilletDlg
msgid "ICON_DLG_FILLET_FACE"
msgstr "filletface.png"
#ChamferDlg
msgid "ICON_DLG_CHAMFER_FACE"
msgstr "chamferface.png"
#ChamferDlg
msgid "ICON_DLG_CHECKSHAPE"
msgstr "check.png"
#SupressFaceDlg
msgid "ICON_DLG_SUPRESS_FACE"
msgstr "supressface.png"
#SupressHoleDlg
msgid "ICON_DLG_SUPRESS_HOLE"
msgstr "supresshole.png"
#SupressHoleDlg
msgid "ICON_DLG_SUPRESS_HOLE_FACE_SHELL"
msgstr "supressHolesOnFaceShell.png"
#MultiTranslationDlg
msgid "ICON_DLG_MULTITRANSLATION_SIMPLE"
msgstr "multitranslationsimple.png"
#MultiTranslationDlg
msgid "ICON_DLG_MULTITRANSLATION"
msgstr "multitranslation.png"
#MultiTranslationDlg
msgid "ICON_DLG_MULTITRANSLATION_DOUBLE"
msgstr "multitranslationdouble.png"
#MultiRotationDlg
msgid "ICON_DLG_MULTIROTATION_SIMPLE"
msgstr "multirotationsimple.png"
#MultiRotationDlg
msgid "ICON_DLG_MULTIROTATION"
msgstr "multirotation.png"
#MultiRotationDlg
msgid "ICON_DLG_MULTIROTATION_DOUBLE"
msgstr "multirotationdouble.png"
#EllipseDlg
msgid "ICON_DLG_ELLIPSE_PV"
msgstr "ellipsepointvector.png"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff