DCQ : Merge PAL + Debug

This commit is contained in:
dcq 2004-04-05 09:15:16 +00:00
parent 10f156c322
commit d89a4ce016
49 changed files with 341 additions and 371 deletions

View File

@ -137,6 +137,7 @@ void BasicGUI_ArcDlg::ClickOnOk()
//=================================================================================
void BasicGUI_ArcDlg::ClickOnApply()
{
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;

View File

@ -147,6 +147,7 @@ void BasicGUI_CircleDlg::ClickOnOk()
//=================================================================================
void BasicGUI_CircleDlg::ClickOnApply()
{
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;

View File

@ -153,6 +153,7 @@ void BasicGUI_EllipseDlg::ClickOnOk()
//=================================================================================
void BasicGUI_EllipseDlg::ClickOnApply()
{
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;

View File

@ -135,6 +135,7 @@ void BasicGUI_LineDlg::ClickOnOk()
//=================================================================================
void BasicGUI_LineDlg::ClickOnApply()
{
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;

View File

@ -273,6 +273,7 @@ void BasicGUI_PlaneDlg::ClickOnOk()
//=================================================================================
void BasicGUI_PlaneDlg::ClickOnApply()
{
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;

View File

@ -259,6 +259,7 @@ void BasicGUI_PointDlg::ClickOnOk()
//=================================================================================
void BasicGUI_PointDlg::ClickOnApply()
{
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if(mySimulationTopoDs.IsNull())
return;

View File

@ -237,6 +237,7 @@ void BasicGUI_VectorDlg::ClickOnOk()
//=================================================================================
void BasicGUI_VectorDlg::ClickOnApply()
{
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;

View File

@ -127,6 +127,7 @@ void BasicGUI_WorkingPlaneDlg::ClickOnOk()
//=================================================================================
void BasicGUI_WorkingPlaneDlg::ClickOnApply()
{
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if(myOkPlane)
myBasicGUI->MakeWorkingPlane(myLoc, myDir);

View File

@ -52,8 +52,8 @@ BooleanGUI_CutDlg::BooleanGUI_CutDlg(QWidget* parent, const char* name, BooleanG
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->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
GroupCut->TextLabel2->setText(tr("GEOM_TOOL_OBJECT"));
GroupCut->PushButton1->setPixmap(image1);
GroupCut->PushButton2->setPixmap(image1);

View File

@ -52,7 +52,7 @@ BuildGUI_FaceDlg::BuildGUI_FaceDlg(QWidget* parent, const char* name, BuildGUI*
GroupPoints = new DlgRef_1Sel1Check_QTD(this, "GroupPoints");
GroupPoints->GroupBox1->setTitle(tr("GEOM_FACE_FFW"));
GroupPoints->TextLabel1->setText(tr("GEOM_WIRE"));
GroupPoints->TextLabel1->setText(tr("GEOM_WIRES"));
GroupPoints->CheckButton1->setText(tr("GEOM_FACE_OPT"));
GroupPoints->PushButton1->setPixmap(image1);

View File

@ -87,7 +87,7 @@ void BuildGUI_ShellDlg::Init()
myEditCurrentArgument = GroupShell->LineEdit1;
myOkListShapes = false;
myFaceFilter = new GEOM_FaceFilter(StdSelect_Plane, myGeom);
myFaceFilter = new GEOM_ShapeTypeFilter(TopAbs_FACE, myGeom);
/* Filter for the next selection */
mySelection->AddFilter(myFaceFilter) ;
@ -163,10 +163,8 @@ void BuildGUI_ShellDlg::SelectionIntoArgument()
//=================================================================================
void BuildGUI_ShellDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
mySelection->ClearFilters() ;
mySelection->ClearFilters();
GroupShell->LineEdit1->setFocus();
myEditCurrentArgument = GroupShell->LineEdit1;
mySelection->AddFilter(myFaceFilter);
this->SelectionIntoArgument();
return;

View File

@ -34,7 +34,7 @@
#include "BuildGUI.h"
#include "GEOM_FaceFilter.hxx"
#include "GEOM_ShapeTypeFilter.hxx"
//=================================================================================
// class : BuildGUI_ShellDlg
@ -54,7 +54,7 @@ private:
BuildGUI* myBuildGUI;
Handle(GEOM_FaceFilter) myFaceFilter; /* Filters selection */
Handle(GEOM_ShapeTypeFilter) myFaceFilter; /* Filters selection */
GEOM::GEOM_Gen::ListOfIOR myListShapes;
bool myOkListShapes; /* to check when arguments is defined */
@ -64,7 +64,6 @@ private slots:
void ClickOnOk();
void ClickOnApply();
void SetEditCurrentArgument();
void LineEditReturnPressed();
void SelectionIntoArgument();
void ActivateThisDialog();

View File

@ -579,7 +579,7 @@ bool EntityGUI::OnSubShapeGetAll(const TopoDS_Shape& ShapeTopo, const char* Shap
}
else {
aResult->NameType(tr("GEOM_SHAPE"));
sprintf(nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->GetNbGeom()++);
sprintf(nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->myNbGeom++);
}
SALOMEDS::SObject_var SO = aStudy->FindObjectIOR(aResult->Name());
@ -814,7 +814,7 @@ bool EntityGUI::OnSubShapeGetSelected(const TopoDS_Shape& ShapeTopo, const char*
}
else {
aResult->NameType(tr("GEOM_SHAPE"));
sprintf (nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->GetNbGeom()++);
sprintf (nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->myNbGeom++);
}
result = new GEOM_AISShape(Exp.Current(), nameG);
IO = new GEOM_InteractiveObject(aResult->Name(), myGeomGUI->GetFatherior(), "GEOM");
@ -823,10 +823,10 @@ bool EntityGUI::OnSubShapeGetSelected(const TopoDS_Shape& ShapeTopo, const char*
else {
if ( myGeomBase->GetShapeTypeString(compound,Type)) {
aResult->NameType(Type);
sprintf (nameG, "%s_%d", Type, myGeomGUI->GetNbGeom()++);
sprintf (nameG, "%s_%d", Type, myGeomGUI->myNbGeom++);
} else {
aResult->NameType(tr("GEOM_SHAPE"));
sprintf (nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->GetNbGeom()++);
sprintf (nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->myNbGeom++);
}
result = new GEOM_AISShape(compound, nameG);
IO = new GEOM_InteractiveObject(aResult->Name(), myGeomGUI->GetFatherior(), "GEOM");

View File

@ -614,7 +614,7 @@ CORBA::Boolean GEOM_Gen_i::CanCopy(SALOMEDS::SObject_ptr theObject) {
//============================================================================
SALOMEDS::TMPFile* GEOM_Gen_i::CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID) {
// Declare a sequence of the byte to store the copied object
SALOMEDS::TMPFile_var aStreamFile;
SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile;
// Try to get GEOM_Shape object by given SObject
SALOMEDS::GenericAttribute_var anAttr;
@ -911,7 +911,15 @@ void GEOM_Gen_i::InsertInLabelMoreArguments(TopoDS_Shape main_topo,
//=================================================================================
CORBA::Short GEOM_Gen_i::NbLabels()
{
return TDF_Tool::NbLabels( myCurrentOCAFDoc->Main() );
TDF_ChildIterator ChildIterator(myCurrentOCAFDoc->Main());
unsigned int i = 1;
while (ChildIterator.More()) {
i++;
ChildIterator.Next();
}
return i;
// return TDF_Tool::NbLabels( myCurrentOCAFDoc->Main() );
}
@ -2334,7 +2342,6 @@ GEOM::GEOM_Gen::ListOfGeomShapes* GEOM_Gen_i::SubShapesAll(GEOM::GEOM_Shape_ptr
return listOfGeomShapes._retn() ;
}
//=================================================================================
// function : MakeBoolean()
// purpose : Boolean operation according to the type 'operation'
@ -2348,7 +2355,7 @@ GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeBoolean(GEOM::GEOM_Shape_ptr shape1,
TopoDS_Shape shape ;
TopoDS_Shape aShape1 ;
TopoDS_Shape aShape2 ;
try {
aShape1 = GetTopoShape(shape1) ;
aShape2 = GetTopoShape(shape2) ;
@ -3598,6 +3605,7 @@ GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeVertex(CORBA::Double x,
if (tds.IsNull()) {
THROW_SALOME_CORBA_EXCEPTION("Make Vertex/Point aborted", SALOME::BAD_PARAM);
}
tds.Infinite(true);
result = CreateObject(tds) ;
const char *entry = InsertInLabel(tds, result->Name(), myCurrentOCAFDoc) ;
result->ShapeId(entry);
@ -3814,6 +3822,7 @@ GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeLine(const GEOM::PointStruct& pstruct,
THROW_SALOME_CORBA_EXCEPTION("Make Line aborted : null shape", SALOME::BAD_PARAM);
}
else {
tds.Infinite(true);
result = CreateObject(tds) ;
const char *entry = InsertInLabel(tds, result->Name(), myCurrentOCAFDoc) ;
result->ShapeId(entry);

View File

@ -506,11 +506,11 @@ bool GEOMBase::Display(GEOM::GEOM_Shape_ptr aShape, Standard_CString name)
Standard_CString type;
GetShapeTypeString(shape,type);
aShape->NameType(type);
nameG += TCollection_AsciiString(type) + TCollection_AsciiString("_") + TCollection_AsciiString(myGeomGUI->GetNbGeom()++) + TCollection_AsciiString("\0");
nameG += TCollection_AsciiString(type) + TCollection_AsciiString("_") + TCollection_AsciiString(myGeomGUI->myNbGeom++) + TCollection_AsciiString("\0");
}
else
nameG += TCollection_AsciiString(aShape->NameType()) + TCollection_AsciiString("_") + TCollection_AsciiString(myGeomGUI->GetNbGeom()++) + TCollection_AsciiString("\0");
}
nameG += TCollection_AsciiString(aShape->NameType()) + TCollection_AsciiString("_") + TCollection_AsciiString(myGeomGUI->myNbGeom++) + TCollection_AsciiString("\0");
}
else
nameG = TCollection_AsciiString(name);

View File

@ -84,6 +84,12 @@ GEOMContext* GEOMContext::GetOrCreateGeomGUI(QAD_Desktop* desktop)
GeomGUI->myNbGeom = GeomGUI->myComponentGeom->NbLabels();
}
/* GetCurrentStudy */
int studyId = desktop->getActiveStudy()->getStudyId();
GeomGUI->myComponentGeom->GetCurrentStudy(studyId);
//GeomGUI->myNbGeom = GeomGUI->myComponentGeom->NbLabels();
return GeomGUI;
}

View File

@ -49,12 +49,13 @@ public :
private :
QDialog* myActiveDialogBox; /* Unique active dialog box */
int myNbGeom; /* Unique name for a geom entity */
GEOM_Client myShapeReader;
Standard_CString myFatherior;
Sketch mySketcher;
public :
int myNbGeom; /* Unique name for a geom entity */
static GEOMContext* GetOrCreateGeomGUI(QAD_Desktop* desktop);
static GEOMContext* GetGeomGUI();

View File

@ -662,6 +662,10 @@ msgstr "Vertex"
msgid "GEOM_WIRE"
msgstr "Wire"
#Wire(s)
msgid "GEOM_WIRES"
msgstr "Wire(s)"
#Parameter
msgid "GEOM_PARAMETER"
msgstr "Parameter :"
@ -937,6 +941,10 @@ msgstr "Keep Object"
msgid "GEOM_PARTITION_ORIENTATION"
msgstr "Change Orientation"
#: GeometryGUI_PartitionDlg.cxx:45
msgid "SUPPRESS_RESULT"
msgstr "Suppress Result"
#: GeometryGUI_PipeDlg.cxx:47
msgid "GEOM_PIPE_TITLE"
msgstr "Pipe Construction"
@ -1299,3 +1307,10 @@ msgstr "Values"
msgid "GEOM_SKETCHER_TYPE"
msgstr "Type"
msgid "GEOM_FILLET_ABORT"
msgstr "Fillet can't be computed with radius %1"
msgid "GEOM_CHAMFER_ABORT"
msgstr "Chamfer can't be computed with %1 and %2"

View File

@ -49,7 +49,7 @@ msgstr "&Exploser"
#: GeometryGUI.cxx:563
msgid "GEOM_INF_LOADED"
msgstr "Le fichier %1 est chargé."
msgstr "Le fichier %1 est chargé."
#
#==============================================================================
@ -57,15 +57,15 @@ msgstr "Le fichier %1 est charg
#: GeometryGUI.cxx:3069
msgid "GEOM_PRP_COMMAND"
msgstr "Pas de commande associée à l'id = %1."
msgstr "Pas de commande associée à l'id = %1."
#: GeometryGUI.cxx:4977
msgid "GEOM_PRP_ABORT"
msgstr "L'opération a echoué"
msgstr "L'opération a echoué"
#: GeometryGUI.cxx:5058
msgid "GEOM_PRP_DONE"
msgstr "Opération effectuée"
msgstr "Opération effectuée"
#: GeometryGUI.cxx:3717
msgid "GEOM_PRP_LOADING"
@ -73,11 +73,11 @@ msgstr "Chargement de %1 ..."
#: GeometryGUI.cxx:1412
msgid "GEOM_PRP_NULLSHAPE"
msgstr "Erreur, objet inconsistant ou inapproprié !"
msgstr "Erreur, objet inconsistant ou inapproprié !"
#: GeometryGUI.cxx:5072
msgid "GEOM_PRP_READY"
msgstr "Prêt..."
msgstr "Prêt..."
#: GeometryGUI.cxx:1690
msgid "GEOM_PRP_SELECT_SUBSHAPES"
@ -127,11 +127,11 @@ msgstr "Angle :"
#: GeometryGUI.cxx:3941
msgid "GEOM_MEN_COMPONENT"
msgstr "Géometrie"
msgstr "Géometrie"
#: GeometryGUI.cxx:4389
msgid "GEOM_MEN_ENTER_ANGLE"
msgstr "Saisir un angle en degrés"
msgstr "Saisir un angle en degrés"
#: GeometryGUI.cxx:3758
msgid "GEOM_MEN_EXPORT"
@ -250,7 +250,7 @@ msgstr "Objet %1"
#Object and result
msgid "GEOM_OBJECT_RESULT"
msgstr "Objet Et Résultat"
msgstr "Objet Et Résultat"
#Point
msgid "GEOM_POINT"
@ -310,7 +310,7 @@ msgstr "poids"
#Coordinates
msgid "GEOM_COORDINATES"
msgstr "Coordonnées"
msgstr "Coordonnées"
#Coor.
msgid "GEOM_COOR"
@ -362,11 +362,11 @@ msgstr "Base"
#Water Density
msgid "GEOM_WATER_DENSITY"
msgstr "Densité de l'eau :"
msgstr "Densité de l'eau :"
#Meshing Deflection
msgid "GEOM_MESHING_DEFLECTION"
msgstr "Déflection Du Maillage :"
msgstr "Déflection Du Maillage :"
#Dimensions
msgid "GEOM_DIMENSIONS"
@ -374,11 +374,11 @@ msgstr "Dimensions"
#Precision
msgid "GEOM_PRECISION"
msgstr "Précision :"
msgstr "Précision :"
#Selection
msgid "GEOM_SELECTION"
msgstr "Sélection"
msgstr "Sélection"
#Nb. Times
msgid "GEOM_NB_TIMES"
@ -414,7 +414,7 @@ msgstr "Partition"
#Tolerance
msgid "GEOM_TOLERANCE"
msgstr "Tolérance"
msgstr "Tolérance"
#Orientation
msgid "GEOM_ORIENTATION"
@ -426,7 +426,7 @@ msgstr "Pipe"
#Revolution
msgid "GEOM_REVOLUTION"
msgstr "Révolution"
msgstr "Révolution"
#Rotation
msgid "GEOM_ROTATION"
@ -434,7 +434,7 @@ msgstr "Rotation"
#Archimede
msgid "GEOM_ARCHIMEDE"
msgstr "Archimède"
msgstr "Archimède"
#Common
msgid "GEOM_COMMON"
@ -594,7 +594,7 @@ msgstr "Solide"
#Sphere
msgid "GEOM_SPHERE"
msgstr "Sphère"
msgstr "Sphère"
#Conical Face
msgid "GEOM_SURFCONE"
@ -606,7 +606,7 @@ msgstr "Face Cylindrique"
#Spherical Face
msgid "GEOM_SURFSPHERE"
msgstr "Face Sphèrique"
msgstr "Face Sphèrique"
#Toroidal Face
msgid "GEOM_SURFTORUS"
@ -638,7 +638,7 @@ msgstr "Wire"
#Parameter
msgid "GEOM_PARAMETER"
msgstr "Paramètre :"
msgstr "Paramètre :"
#
@ -691,7 +691,7 @@ msgstr "D2 :"
#: GeometryGUI.cxx
msgid "GEOM_STEP_TITLE"
msgstr "Increment par défaut lors des constructions"
msgstr "Increment par défaut lors des constructions"
#: GeometryGUI_ArcDlg.cxx:45
msgid "GEOM_ARC_TITLE"
@ -699,7 +699,7 @@ msgstr "Construction d'un Arc"
#: GeometryGUI_ArchimedeDlg.cxx:55
msgid "GEOM_ARCHIMEDE_TITLE"
msgstr "Construction d'Archimède"
msgstr "Construction d'Archimède"
#: GeometryGUI_BndBoxDlg.cxx:59
msgid "GEOM_BNDBOX_TITLE"
@ -739,7 +739,7 @@ msgstr "Construction d'un Cercle"
#: GeometryGUI_CenterMassDlg.cxx:77
msgid "GEOM_CMASS_TITLE"
msgstr "Centre De Gravité"
msgstr "Centre De Gravité"
msgid "GEOM_PLANE_SIZE"
msgstr "Taille du plan :"
@ -750,7 +750,7 @@ msgstr "BOOLEEN : Jonction De Deux Objets"
#: GeometryGUI_CompoundDlg.cxx:44
msgid "GEOM_COMPOUND_TITLE"
msgstr "Création d'un Compound"
msgstr "Création d'un Compound"
#: GeometryGUI_ConeDlg.cxx:49
msgid "GEOM_CONE_TITLE"
@ -782,27 +782,27 @@ msgstr "Objets Et Resultats"
#: GeometryGUI_EdgeDlg.cxx:47
msgid "GEOM_EDGE_TITLE"
msgstr "Création d'un Edge"
msgstr "Création d'un Edge"
#: GeometryGUI_FilletDlg.cxx:58
msgid "GEOM_FILLET_TITLE"
msgstr "Construction d'un Congé"
msgstr "Construction d'un Congé"
#: GeometryGUI_FilletDlg.cxx:58
msgid "GEOM_FILLET_ALL"
msgstr "Congé sur toute la Shape"
msgstr "Congé sur toute la Shape"
#: GeometryGUI_FilletDlg.cxx:58
msgid "GEOM_FILLET_EDGES"
msgstr "Congé sur Edges de la Shape"
msgstr "Congé sur Edges de la Shape"
#: GeometryGUI_FilletDlg.cxx:58
msgid "GEOM_FILLET_FACES"
msgstr "Congé sur Faces de la Shape"
msgstr "Congé sur Faces de la Shape"
#: GeometryGUI_FaceDlg.cxx:49
msgid "GEOM_FACE_TITLE"
msgstr "Création d'une Face"
msgstr "Création d'une Face"
#: GeometryGUI_FaceDlg.cxx:78
msgid "GEOM_FACE_FFW"
@ -810,7 +810,7 @@ msgstr "Face a partir d'un wire"
#: GeometryGUI_FaceDlg.cxx:103
msgid "GEOM_FACE_OPT"
msgstr "Création d'une Face plane"
msgstr "Création d'une Face plane"
#: GeometryGUI_FillingDlg.cxx:53
msgid "GEOM_FILLING_TITLE"
@ -912,6 +912,10 @@ msgstr "Objet garde"
msgid "GEOM_PARTITION_ORIENTATION"
msgstr "Change l'orientation"
#: GeometryGUI_PartitionDlg.cxx:45
msgid "SUPPRESS_RESULT"
msgstr "Suppress Result"
#: GeometryGUI_PipeDlg.cxx:47
msgid "GEOM_PIPE_TITLE"
msgstr "Construction d'une Pipe"
@ -1115,7 +1119,7 @@ msgid "GEOM_MULTIROTATION_DOUBLE"
msgstr "Multi Rotation Double"
msgid "GEOM_PARAM_POINT"
msgstr "Point paramétrique"
msgstr "Point paramétrique"
#
#==============================================================================
@ -1127,4 +1131,11 @@ msgstr "Filaire"
#: GeometryGUI.cxx:4613
msgid "GEOM_MEN_SHADING"
msgstr "Ombré"
msgstr "Ombré"
msgid "GEOM_FILLET_ABORT"
msgstr "Le congé ne peut-être realisé avec un rayon de %1 "
msgid "GEOM_CHAMFER_ABORT"
msgstr "Le chanfrein ne peut-être realisé avec %1 et %2 "

View File

@ -507,6 +507,7 @@ void GeometryGUI::activeStudyChanged(QAD_Desktop* parent)
if(GeomGUI != 0) {
QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
GeomGUI->myNbGeom = GeomGUI->myComponentGeom->NbLabels();
if(GeomGUI->myState == 2) {
Mb->setItemEnabled(405, false);//SKETCHER
GeomGUI->GetSketcher().Clear();

View File

@ -163,7 +163,7 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
}
else {
Quantity_Color Default = Quantity_Color();
color = QColor ((int)Default.Red() * 255.0, (int)Default.Green()* 255.0, (int)Default.Blue() * 255.0);
color = QColor ((int)( Default.Red() * 255.0 ), (int)( Default.Green() * 255.0 ), (int)( Default.Blue() * 255.0 ) );
}
QColor c = QColorDialog::getColor(color, QAD_Application::getDesktop());
@ -372,7 +372,7 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
Quantity_Color CSFColor;
Shape->Color(CSFColor);
QColor c = QColorDialog::getColor(QColor(CSFColor.Red() * 255.0, CSFColor.Green()* 255.0, CSFColor.Blue() * 255.0), QAD_Application::getDesktop());
QColor c = QColorDialog::getColor(QColor((int)(CSFColor.Red() * 255.0), (int)(CSFColor.Green() * 255.0), (int)(CSFColor.Blue() * 255.0)), QAD_Application::getDesktop());
if(c.isValid()) {
CSFColor = Quantity_Color (c.red()/255., c.green()/255., c.blue()/255., Quantity_TOC_RGB);
@ -478,13 +478,50 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
while(useSubItems?anIter->More():!anAttr->_is_nil()) {
if(!obj->FindAttribute(anAttr, "AttributeIOR") &&
obj->FindAttribute(anAttr, "AttributePersistentRef")) {
// load
Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer","GEOM");
if (!CORBA::is_nil(comp)) {
SALOMEDS::Driver_var driver = SALOMEDS::Driver::_narrow(comp);
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
aStudyBuilder->LoadWith(aStudy->FindComponent("GEOM"),driver);
}
SALOMEDS::SComponent_var FComp = obj->GetFatherComponent();
if (!CORBA::is_nil(FComp)) {
if (FComp->FindAttribute(anAttr, "AttributeName")) {
SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
QString compName = parent->getComponentName(aName->Value());
// parent->loadComponentData(parent->getComponentName(aName->Value()));
Engines::Component_var comp ;
if ( compName.compare("SUPERV") == 0 ) {
comp = parent->getEngine( "SuperVisionContainer", compName) ;
}
else {
comp = parent->getEngine( "FactoryServer", compName);
if ( comp->_is_nil() )
comp = parent->getEngine( "FactoryServerPy", compName);
}
if (!CORBA::is_nil(comp)) {
SALOMEDS::Driver_var driver = SALOMEDS::Driver::_narrow(comp);
if (!CORBA::is_nil(driver)) {
SALOMEDS::StudyBuilder_var B = aStudy->NewBuilder();
if (!CORBA::is_nil(B)) {
B->LoadWith(FComp,driver);
} else {
return false;
}
} else {
MESSAGE("loadComponentData(): Driver is null");
return false;
}
} else {
MESSAGE("loadComponentData(): Engine is null");
return false;
}
// // load
// Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer","GEOM");
// if (!CORBA::is_nil(comp)) {
// SALOMEDS::Driver_var driver = SALOMEDS::Driver::_narrow(comp);
// SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
// SALOMEDS::SComponent_var SC = aStudy->FindComponent("GEOM");
// if (!CORBA::is_nil(SC))
// aStudyBuilder->LoadWith(SC,driver);
}
}
else {
MESSAGE("Component is null");
}
@ -752,7 +789,7 @@ bool GEOMToolsGUI::Import(int aState)
// if (aLocked) return false;
father->ComponentIOR(myGeomGUI->GetFatherior());
QString nameShape = QAD_Tools::getFileNameFromPath(file,false) + QString("_%1").arg(myGeomGUI->GetNbGeom()++);
QString nameShape = QAD_Tools::getFileNameFromPath(file,false) + QString("_%1").arg(myGeomGUI->myNbGeom++);
if(myGeomBase->Display(aShape, strdup(nameShape.latin1()))) {
QAD_Application::getDesktop()->getActiveStudy()->setMessage( tr("GEOM_INF_LOADED").arg(QAD_Tools::getFileNameFromPath( file )) );

View File

@ -152,6 +152,12 @@ def MakeCircle(p1,d1,radius):
anObj._set_Name(ior)
return anObj
def MakeEllipse(p1,d1,radiusMaj,radiusMin):
anObj = geom.MakeEllipse(p1,d1,radiusMaj, radiusMin)
ior = orb.object_to_string(anObj)
anObj._set_Name(ior)
return anObj
def MakePlane(p1,d1,trimsize):
anObj = geom.MakePlane(p1,d1,trimsize)
ior = orb.object_to_string(anObj)

View File

@ -178,6 +178,12 @@ def MakeCircle(p1,d1,radius):
anObj._set_Name(ior)
return anObj
def MakeEllipse(p1,d1,radiusMaj,radiusMin):
anObj = geom.MakeEllipse(p1,d1,radiusMaj, radiusMin)
ior = orb.object_to_string(anObj)
anObj._set_Name(ior)
return anObj
def MakePlane(p1,d1,trimsize):
anObj = geom.MakePlane(p1,d1,trimsize)
ior = salome.orb.object_to_string(anObj)

View File

@ -172,6 +172,7 @@ void GenerationGUI_FillingDlg::ClickOnOk()
//=================================================================================
void GenerationGUI_FillingDlg::ClickOnApply()
{
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;

View File

@ -187,7 +187,7 @@ void GenerationGUI_PipeDlg::SelectionIntoArgument()
}
else if(myEditCurrentArgument == GroupPoints->LineEdit2) {
myOkShape2 = false;
if(S.ShapeType() != TopAbs_COMPSOLID && S.ShapeType() != TopAbs_COMPOUND && S.ShapeType() != TopAbs_SOLID && S.ShapeType() != TopAbs_SHAPE && S.ShapeType() != TopAbs_VERTEX) {
if(S.ShapeType() == TopAbs_WIRE || S.ShapeType() == TopAbs_EDGE ) {
myGeomShape2 = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
if(!testResult)
return;

View File

@ -146,6 +146,7 @@ void GenerationGUI_PrismDlg::ClickOnOk()
//=================================================================================
void GenerationGUI_PrismDlg::ClickOnApply()
{
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;

View File

@ -145,6 +145,7 @@ void GenerationGUI_RevolDlg::ClickOnOk()
//=================================================================================
void GenerationGUI_RevolDlg::ClickOnApply()
{
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;

View File

@ -37,6 +37,8 @@ using namespace std;
#include <qtextedit.h>
#include <BRep_Tool.hxx>
//=================================================================================
// class : MeasureGUI_WhatisDlg()
// purpose : Constructs a MeasureGUI_WhatisDlg which is a child of 'parent', with the
@ -211,8 +213,15 @@ void MeasureGUI_WhatisDlg::CalculateWhatis(const TopoDS_Shape& S)
return;
TCollection_AsciiString Astr;
Astr = Astr + " Number of shapes in " + strdup(SelectedName.latin1()) + " : \n";
if ( S.ShapeType() == TopAbs_EDGE ) {
if( BRep_Tool::Degenerated(TopoDS::Edge(S)) ) {
Astr = Astr + " " + strdup(SelectedName.latin1()) + " is a degenerated edge \n";
}
}
Astr = Astr + " Number of shapes in " + strdup(SelectedName.latin1()) + " : \n";
try {
int iType, nbTypes [TopAbs_SHAPE];
for(iType = 0; iType < TopAbs_SHAPE; ++iType)

View File

@ -152,6 +152,7 @@ void OperationGUI_ArchimedeDlg::ClickOnOk()
//=================================================================================
void OperationGUI_ArchimedeDlg::ClickOnApply()
{
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if(myOkIO)
myOperationGUI->Archimede(myIO, myWeight, myWaterDensity, myMeshingDeflection);

View File

@ -30,6 +30,7 @@ using namespace std;
#include "OperationGUI_ChamferDlg.h"
#include "DisplayGUI.h"
#include "QAD_MessageBox.h"
#include <AIS_InteractiveContext.hxx>
#include <BRepFilletAPI_MakeChamfer.hxx>
@ -38,6 +39,9 @@ using namespace std;
#include <TopExp.hxx>
#include <Precision.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
//=================================================================================
// class : OperationGUI_ChamferDlg()
// purpose : Constructs a OperationGUI_ChamferDlg which is a child of 'parent', with the
@ -68,23 +72,7 @@ OperationGUI_ChamferDlg::OperationGUI_ChamferDlg(QWidget* parent, const char* na
Group1->TextLabel3->setText(tr("GEOM_D2"));
Group1->PushButton1->setPixmap(image3);
Group2 = new DlgRef_1Sel2Spin(this, "Group2");
Group2->GroupBox1->setTitle(tr("GEOM_CHAMFER_EDGES"));
Group2->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
Group2->TextLabel2->setText(tr("GEOM_D1"));
Group2->TextLabel3->setText(tr("GEOM_D2"));
Group2->PushButton1->setPixmap(image3);
Group3 = new DlgRef_1Sel2Spin(this, "Group3");
Group3->GroupBox1->setTitle(tr("GEOM_CHAMFER_FACES"));
Group3->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
Group3->TextLabel2->setText(tr("GEOM_D1"));
Group3->TextLabel3->setText(tr("GEOM_D2"));
Group3->PushButton1->setPixmap(image3);
Layout1->addWidget(Group1, 1, 0);
Layout1->addWidget(Group2, 1, 0);
Layout1->addWidget(Group3, 1, 0);
/***************************************************************/
/* Initialisations */
@ -123,18 +111,10 @@ void OperationGUI_ChamferDlg::Init(Handle (AIS_InteractiveContext) ic)
double SpecificStep = 10.0;
/* min, max, step and decimals for spin boxes */
Group1->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
Group2->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
Group3->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
Group1->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
Group2->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
Group3->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
Group1->SpinBox_DX->SetValue(myD1);
Group2->SpinBox_DX->SetValue(myD1);
Group3->SpinBox_DX->SetValue(myD1);
Group1->SpinBox_DY->SetValue(myD2);
Group2->SpinBox_DY->SetValue(myD2);
Group3->SpinBox_DY->SetValue(myD2);
/* signals and slots connections */
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
@ -146,32 +126,16 @@ void OperationGUI_ChamferDlg::Init(Handle (AIS_InteractiveContext) ic)
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
connect(Group1->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(Group2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(Group3->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(Group1->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(Group2->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(Group3->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(Group1->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
connect(Group2->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
connect(Group3->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
connect(Group1->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
connect(Group2->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
connect(Group3->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group1->SpinBox_DX, SLOT(SetStep(double)));
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group2->SpinBox_DX, SLOT(SetStep(double)));
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group3->SpinBox_DX, SLOT(SetStep(double)));
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group1->SpinBox_DY, SLOT(SetStep(double)));
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group2->SpinBox_DY, SLOT(SetStep(double)));
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group3->SpinBox_DY, SLOT(SetStep(double)));
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* displays Dialog */
Group2->hide();
Group3->hide();
Group1->show();
this->show();
@ -200,52 +164,33 @@ void OperationGUI_ChamferDlg::ConstructorsClicked(int constructorId)
myUseLocalContext = false;
}
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() != VIEW_OCC) {
myConstructorId = constructorId = 0; //No subshape selection if viewer is not OCC
RadioButton1->setChecked(TRUE);
}
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
Group1->LineEdit1->setText("");
Group1->SpinBox_DX->SetValue(myD1);
Group1->SpinBox_DY->SetValue(myD2);
switch (constructorId)
{
case 0: /* Chamfer All */
{
Group2->hide();
Group3->hide();
resize(0, 0);
Group1->show();
myEditCurrentArgument = Group1->LineEdit1;
Group1->LineEdit1->setText("");
Group1->GroupBox1->setTitle(tr("GEOM_CHAMFER_ALL"));
myShapeType = -1;
Group1->SpinBox_DX->SetValue(myD1);
Group1->SpinBox_DY->SetValue(myD2);
break;
}
case 1: /* Chamfer edges */
{
Group1->hide();
Group3->hide();
resize(0, 0);
Group2->show();
myEditCurrentArgument = Group2->LineEdit1;
Group2->LineEdit1->setText("");
Group1->GroupBox1->setTitle(tr("GEOM_CHAMFER_EDGES"));
myShapeType = 6;
Group2->SpinBox_DX->SetValue(myD1);
Group2->SpinBox_DY->SetValue(myD2);
break;
}
case 2: /* Chamfer Faces */
{
Group1->hide();
Group2->hide();
resize(0, 0);
Group3->show();
myEditCurrentArgument = Group3->LineEdit1;
Group3->LineEdit1->setText("");
Group1->GroupBox1->setTitle(tr("GEOM_CHAMFER_FACES"));
myShapeType = 4;
Group3->SpinBox_DX->SetValue(myD1);
Group3->SpinBox_DY->SetValue(myD2);
break;
}
}
@ -271,6 +216,7 @@ void OperationGUI_ChamferDlg::ClickOnOk()
//=================================================================================
void OperationGUI_ChamferDlg::ClickOnApply()
{
buttonApply->setFocus();
QApplication::setOverrideCursor(Qt::waitCursor);
QAD_Application::getDesktop()->putInfo(tr(""));
myGeomBase->EraseSimulationShape();
@ -372,7 +318,7 @@ void OperationGUI_ChamferDlg::SelectionIntoArgument()
}
}
}
if(myConstructorId == 0)
if(myOkShape && QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myConstructorId == 0)
this->MakePreview();
}
@ -388,27 +334,6 @@ void OperationGUI_ChamferDlg::SelectionIntoArgument()
}
//=================================================================================
// function : LineEditReturnPressed()
// purpose :
//=================================================================================
void OperationGUI_ChamferDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
if(send == Group1->LineEdit1)
myEditCurrentArgument = Group1->LineEdit1;
else if (send == Group2->LineEdit1)
myEditCurrentArgument = Group2->LineEdit1;
else if (send == Group3->LineEdit1)
myEditCurrentArgument = Group3->LineEdit1;
else
return;
GEOMBase_Skeleton::LineEditReturnPressed();
return;
}
//=================================================================================
// function : SetEditCurrentArgument()
// purpose :
@ -417,18 +342,9 @@ void OperationGUI_ChamferDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
if(send == Group1->PushButton1) {
if(send == Group1->PushButton1)
Group1->LineEdit1->setFocus();
myEditCurrentArgument = Group1->LineEdit1;
}
else if(send == Group2->PushButton1) {
Group2->LineEdit1->setFocus();
myEditCurrentArgument = Group2->LineEdit1;
}
else if(send == Group3->PushButton1) {
Group3->LineEdit1->setFocus();
myEditCurrentArgument = Group3->LineEdit1;
}
this->SelectionIntoArgument();
return;
}
@ -489,24 +405,20 @@ void OperationGUI_ChamferDlg::closeEvent(QCloseEvent* e)
// function : ValueChangedInSpinBox()
// purpose :
//=================================================================================
void OperationGUI_ChamferDlg::ValueChangedInSpinBox( double newValue )
void OperationGUI_ChamferDlg::ValueChangedInSpinBox(double newValue)
{
myGeomBase->EraseSimulationShape();
mySimulationTopoDs.Nullify();
QObject* send = (QObject*)sender();
if(send == Group1->SpinBox_DX || send == Group2->SpinBox_DX || send == Group3->SpinBox_DX) { /* D1 */
if(send == Group1->SpinBox_DX) /* D1 */
myD1 = newValue;
if(myConstructorId == 0)
this->MakePreview();
return ;
}
else if(send == Group1->SpinBox_DY || send == Group2->SpinBox_DY || send == Group3->SpinBox_DY) { /* D2 */
else if(send == Group1->SpinBox_DY) /* D2 */
myD2 = newValue;
if(myConstructorId == 0)
this->MakePreview();
return;
}
if(myOkShape && QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myConstructorId == 0)
this->MakePreview();
return;
}
@ -539,48 +451,44 @@ void OperationGUI_ChamferDlg::ResetStateOfDialog()
void OperationGUI_ChamferDlg::MakePreview()
{
QApplication::setOverrideCursor(Qt::waitCursor);
if(!myOkShape) {
QApplication::restoreOverrideCursor();
return;
}
GEOM::GEOM_Shape::ListOfSubShapeID_var ListOfID = new GEOM::GEOM_Shape::ListOfSubShapeID;
ListOfID->length(0);
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
SALOMEDS::SObject_var theObj = aStudy->FindObjectIOR(myShapeIOR);
if(theObj->_is_nil()) {
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
QApplication::restoreOverrideCursor();
return;
}
TopoDS_Shape tds;
try {
if(myD1 <= Precision::Confusion() || myD2 <= Precision::Confusion()) {
QApplication::restoreOverrideCursor();
return;
BRepFilletAPI_MakeChamfer MC(myShape);
switch(myConstructorId)
{
case 0: /* Chamfer All */
{
TopTools_IndexedDataMapOfShapeListOfShape M;
TopExp::MapShapesAndAncestors(myShape, TopAbs_EDGE, TopAbs_FACE, M);
for(int i = 1; i <= M.Extent(); i++) {
TopoDS_Edge E = TopoDS::Edge(M.FindKey(i));
TopoDS_Face F = TopoDS::Face(M.FindFromIndex(i).First());
if(!BRepTools::IsReallyClosed(E, F) && !BRep_Tool::Degenerated(E))
MC.Add(myD1, myD2, E, F);
}
tds = MC.Shape();
break;
}
// case 1: /* Chamfer edges */
// case 2: /* Chamfer Faces */
}
if(!tds.IsNull()) {
mySimulationTopoDs = tds;
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
}
GEOM::GEOM_Shape_var aShape = myGeom->GetIORFromString(myShapeIOR);
GEOM::GEOM_Shape_var result = myGeom->MakeChamfer(aShape, myD1, myD2, myShapeType, ListOfID);
if(result->_is_nil()) {
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
QApplication::restoreOverrideCursor();
return;
}
TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, result);
mySimulationTopoDs = S;
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
}
catch(Standard_Failure) {
MESSAGE("Exception catched in MakePreview");
QApplication::restoreOverrideCursor();
return;
QAD_MessageBox::warn1 (QAD_Application::getDesktop(), tr("GEOM_WRN_WARNING"), tr("GEOM_CHAMFER_ABORT").arg(myD1).arg(myD2), tr("GEOM_BUT_OK"));
QApplication::setOverrideCursor(Qt::waitCursor);
myGeomBase->EraseSimulationShape();
mySimulationTopoDs.Nullify();
Group1->SpinBox_DX->SetValue(5.0);
Group1->SpinBox_DY->SetValue(5.0);
}
QApplication::restoreOverrideCursor();
return;
}

View File

@ -72,8 +72,6 @@ private :
double myD2;
DlgRef_1Sel2Spin* Group1;
DlgRef_1Sel2Spin* Group2;
DlgRef_1Sel2Spin* Group3;
private slots:
void ClickOnOk();
@ -81,7 +79,6 @@ private slots:
void ClickOnCancel();
void ActivateThisDialog();
void DeactivateActiveDialog();
void LineEditReturnPressed();
void SelectionIntoArgument();
void SetEditCurrentArgument();
void ValueChangedInSpinBox(double newValue);

View File

@ -30,12 +30,16 @@ using namespace std;
#include "OperationGUI_FilletDlg.h"
#include "DisplayGUI.h"
#include "QAD_MessageBox.h"
#include <AIS_InteractiveContext.hxx>
#include <TopExp_Explorer.hxx>
#include <BRepFilletAPI_MakeFillet.hxx>
#include <Precision.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
//=================================================================================
// class : OperationGUI_FilletDlg()
// purpose : Constructs a OperationGUI_FilletDlg which is a child of 'parent', with the
@ -65,21 +69,7 @@ OperationGUI_FilletDlg::OperationGUI_FilletDlg(QWidget* parent, const char* name
Group1->TextLabel2->setText(tr("GEOM_RADIUS"));
Group1->PushButton1->setPixmap(image3);
Group2 = new DlgRef_1Sel1Spin(this, "Group2");
Group2->GroupBox1->setTitle(tr("GEOM_FILLET_EDGES"));
Group2->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
Group2->TextLabel2->setText(tr("GEOM_RADIUS"));
Group2->PushButton1->setPixmap(image3);
Group3 = new DlgRef_1Sel1Spin(this, "Group3");
Group3->GroupBox1->setTitle(tr("GEOM_FILLET_FACES"));
Group3->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
Group3->TextLabel2->setText(tr("GEOM_RADIUS"));
Group3->PushButton1->setPixmap(image3);
Layout1->addWidget(Group1, 1, 0);
Layout1->addWidget(Group2, 1, 0);
Layout1->addWidget(Group3, 1, 0);
/***************************************************************/
/* Initialisations */
@ -117,12 +107,7 @@ void OperationGUI_FilletDlg::Init(Handle(AIS_InteractiveContext) ic)
double SpecificStep = 10.0;
/* min, max, step and decimals for spin boxes */
Group1->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
Group2->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
Group3->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
Group1->SpinBox_DX->SetValue(myRadius);
Group2->SpinBox_DX->SetValue(myRadius);
Group3->SpinBox_DX->SetValue(myRadius);
/* signals and slots connections */
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
@ -134,26 +119,14 @@ void OperationGUI_FilletDlg::Init(Handle(AIS_InteractiveContext) ic)
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
connect(Group1->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(Group2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(Group3->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(Group1->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(Group2->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(Group3->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(Group1->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
connect(Group2->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
connect(Group3->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group1->SpinBox_DX, SLOT(SetStep(double)));
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group2->SpinBox_DX, SLOT(SetStep(double)));
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group3->SpinBox_DX, SLOT(SetStep(double)));
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* displays Dialog */
Group2->hide();
Group3->hide();
Group1->show();
this->show();
@ -181,49 +154,32 @@ void OperationGUI_FilletDlg::ConstructorsClicked(int constructorId)
myUseLocalContext = false;
}
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() != VIEW_OCC) {
myConstructorId = constructorId = 0; //No subshape selection if viewer is not OCC
RadioButton1->setChecked(TRUE);
}
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
Group1->LineEdit1->setText("");
Group1->SpinBox_DX->SetValue(myRadius);
switch (constructorId)
{
case 0: /* Fillet All */
{
Group2->hide();
Group3->hide();
resize(0, 0);
Group1->show();
myEditCurrentArgument = Group1->LineEdit1;
Group1->LineEdit1->setText("");
Group1->GroupBox1->setTitle(tr("GEOM_FILLET_ALL"));
myShapeType = -1;
Group1->SpinBox_DX->SetValue(myRadius);
break;
}
case 1: /* Fillet edges */
{
Group1->hide();
Group3->hide();
resize(0, 0);
Group2->show();
myEditCurrentArgument = Group2->LineEdit1;
Group2->LineEdit1->setText("");
Group1->GroupBox1->setTitle(tr("GEOM_FILLET_EDGES"));
myShapeType = 6;
Group2->SpinBox_DX->SetValue(myRadius);
break;
}
case 2: /* Fillet Faces */
{
Group1->hide();
Group2->hide();
resize(0, 0);
Group3->show();
myEditCurrentArgument = Group3->LineEdit1;
Group3->LineEdit1->setText("");
Group1->GroupBox1->setTitle(tr("GEOM_FILLET_FACES"));
myShapeType = 4;
Group3->SpinBox_DX->SetValue(myRadius);
break;
}
}
@ -249,6 +205,7 @@ void OperationGUI_FilletDlg::ClickOnOk()
//=================================================================================
void OperationGUI_FilletDlg::ClickOnApply()
{
buttonApply->setFocus();
QApplication::setOverrideCursor(Qt::waitCursor);
QAD_Application::getDesktop()->putInfo(tr(""));
myGeomBase->EraseSimulationShape();
@ -348,7 +305,7 @@ void OperationGUI_FilletDlg::SelectionIntoArgument()
}
}
}
if(myConstructorId == 0)
if(myOkShape && QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myConstructorId == 0)
this->MakePreview();
}
else
@ -363,27 +320,6 @@ void OperationGUI_FilletDlg::SelectionIntoArgument()
}
//=================================================================================
// function : LineEditReturnPressed()
// purpose :
//=================================================================================
void OperationGUI_FilletDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
if(send == Group1->LineEdit1)
myEditCurrentArgument = Group1->LineEdit1;
else if (send == Group2->LineEdit1)
myEditCurrentArgument = Group2->LineEdit1;
else if (send == Group3->LineEdit1)
myEditCurrentArgument = Group3->LineEdit1;
else
return;
GEOMBase_Skeleton::LineEditReturnPressed();
return;
}
//=================================================================================
// function : SetEditCurrentArgument()
// purpose :
@ -392,18 +328,9 @@ void OperationGUI_FilletDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
if(send == Group1->PushButton1) {
if(send == Group1->PushButton1)
Group1->LineEdit1->setFocus();
myEditCurrentArgument = Group1->LineEdit1;
}
else if(send == Group2->PushButton1) {
Group2->LineEdit1->setFocus();
myEditCurrentArgument = Group2->LineEdit1;
}
else if(send == Group3->PushButton1) {
Group3->LineEdit1->setFocus();
myEditCurrentArgument = Group3->LineEdit1;
}
this->SelectionIntoArgument();
return;
}
@ -492,7 +419,7 @@ void OperationGUI_FilletDlg::ValueChangedInSpinBox(double newValue)
myRadius = newValue;
if(myConstructorId == 0)
if(myOkShape && QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myConstructorId == 0)
this->MakePreview();
return;
}
@ -505,46 +432,57 @@ void OperationGUI_FilletDlg::ValueChangedInSpinBox(double newValue)
void OperationGUI_FilletDlg::MakePreview()
{
QApplication::setOverrideCursor(Qt::waitCursor);
TopoDS_Shape tds;
if(!myOkShape) {
QApplication::restoreOverrideCursor();
return;
}
GEOM::GEOM_Shape::ListOfSubShapeID_var ListOfID = new GEOM::GEOM_Shape::ListOfSubShapeID;
ListOfID->length(0);
SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
SALOMEDS::SObject_var theObj = aStudy->FindObjectIOR(myShapeIOR);
if(theObj->_is_nil()) {
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
QApplication::restoreOverrideCursor();
return;
}
try {
if(myRadius <= Precision::Confusion()) {
QApplication::restoreOverrideCursor();
return;
}
BRepFilletAPI_MakeFillet fill(myShape);
switch(myConstructorId)
{
case 0: /* Fillet All */
{
TopExp_Explorer Exp(myShape, TopAbs_EDGE);
for(Exp; Exp.More(); Exp.Next()) {
TopoDS_Edge E = TopoDS::Edge(Exp.Current());
fill.Add(E);
}
for(int i = 1; i <= fill.NbContours(); i++) {
try {
//fill.SetRadius(myRadius,i,i);
fill.SetRadius(myRadius,i);
}
catch(Standard_Failure) {
QApplication::restoreOverrideCursor();
QAD_MessageBox::warn1 (QAD_Application::getDesktop(), tr("GEOM_WRN_WARNING"), tr("GEOM_FILLET_ABORT").arg(myRadius), tr("GEOM_BUT_OK"));
QApplication::setOverrideCursor(Qt::waitCursor);
myGeomBase->EraseSimulationShape();
mySimulationTopoDs.Nullify();
Group1->SpinBox_DX->SetValue(5.0);
QApplication::restoreOverrideCursor();
return;
}
}
tds = fill.Shape();
break;
}
// case 1: /* Fillet edges */
// case 2: /* Fillet Faces */
}
GEOM::GEOM_Shape_var aShape = myGeom->GetIORFromString(myShapeIOR);
GEOM::GEOM_Shape_var result = myGeom->MakeFillet(aShape, myRadius, myShapeType, ListOfID);
if(result->_is_nil()) {
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
QApplication::restoreOverrideCursor();
return;
if(!tds.IsNull()) {
mySimulationTopoDs = tds;
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
}
TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, result);
mySimulationTopoDs = S;
myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
}
}
catch(Standard_Failure) {
MESSAGE("Exception catched in MakePreview");
QApplication::restoreOverrideCursor();
return;
QAD_MessageBox::warn1 (QAD_Application::getDesktop(), tr("GEOM_WRN_WARNING"), tr("GEOM_FILLET_ABORT").arg(myRadius), tr("GEOM_BUT_OK"));
QApplication::setOverrideCursor(Qt::waitCursor);
myGeomBase->EraseSimulationShape();
mySimulationTopoDs.Nullify();
Group1->SpinBox_DX->SetValue(5.0);
}
QApplication::restoreOverrideCursor();
return;
}

View File

@ -71,8 +71,6 @@ private :
double myRadius;
DlgRef_1Sel1Spin* Group1;
DlgRef_1Sel1Spin* Group2;
DlgRef_1Sel1Spin* Group3;
private slots:
void ClickOnOk();
@ -80,7 +78,6 @@ private slots:
void ClickOnCancel();
void ActivateThisDialog();
void DeactivateActiveDialog();
void LineEditReturnPressed();
void SelectionIntoArgument();
void SetEditCurrentArgument();
void ValueChangedInSpinBox(double newValue);

View File

@ -216,14 +216,17 @@ void PrimitiveGUI::MakeConeAndDisplay(const gp_Pnt BasePoint, const gp_Dir aDir,
const double Radius1, const double Radius2, const double aHeight)
{
try {
if((Radius1 <= Precision::Confusion() && Radius2 <= Precision::Confusion()) || aHeight <= Precision::Confusion())
double myRadius2 = Radius2;
if(myRadius2 < Precision::Confusion())
myRadius2 = Precision::Confusion();
if(Radius1 <= Precision::Confusion() || aHeight <= Precision::Confusion())
return;
GEOM::PointStruct pstruct = myGeom->MakePointStruct(BasePoint.X(), BasePoint.Y(), BasePoint.Z());
GEOM::PointStruct d = myGeom->MakePointStruct(aDir.X(), aDir.Y(), aDir.Z());
GEOM::DirStruct dstruct = myGeom->MakeDirection(d);
GEOM::GEOM_Shape_var result = myGeom->MakeCone(pstruct, dstruct, Radius1, Radius2, aHeight);
GEOM::GEOM_Shape_var result = myGeom->MakeCone(pstruct, dstruct, Radius1, myRadius2, aHeight);
if(result->_is_nil()) {
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
return;

View File

@ -221,6 +221,7 @@ void PrimitiveGUI_BoxDlg::ClickOnOk()
//=================================================================================
void PrimitiveGUI_BoxDlg::ClickOnApply()
{
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;

View File

@ -120,11 +120,11 @@ void PrimitiveGUI_ConeDlg::Init()
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->RangeStepAndValidator(0.000, 999.999, step, 3);
GroupPoints->SpinBox_DY->RangeStepAndValidator(0.000, 999.999, step, 3);
GroupPoints->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3);
GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3);
GroupDimensions->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, step, 3);
GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.000, 999.999, step, 3);
GroupDimensions->SpinBox_DY->RangeStepAndValidator(0.000, 999.999, step, 3);
GroupDimensions->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3);
GroupPoints->SpinBox_DX->SetValue(myRadius1);
@ -247,6 +247,7 @@ void PrimitiveGUI_ConeDlg::ClickOnOk()
//=================================================================================
void PrimitiveGUI_ConeDlg::ClickOnApply()
{
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;

View File

@ -234,6 +234,7 @@ void PrimitiveGUI_CylinderDlg::ClickOnOk()
//=================================================================================
void PrimitiveGUI_CylinderDlg::ClickOnApply()
{
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;

View File

@ -205,6 +205,7 @@ void PrimitiveGUI_SphereDlg::ClickOnOk()
//=================================================================================
void PrimitiveGUI_SphereDlg::ClickOnApply()
{
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if(mySimulationTopoDs.IsNull())
return;

View File

@ -102,7 +102,6 @@ void PrimitiveGUI_TorusDlg::Init()
myRadius1 = 300.0;
myRadius2 = 100.0;
myOkRadius1 = myOkRadius2 = true;
myOkPoint1 = myOkDir = false;
myEdgeFilter = new GEOM_EdgeFilter(StdSelect_Line, myGeom);
@ -167,7 +166,6 @@ void PrimitiveGUI_TorusDlg::ConstructorsClicked(int constructorId)
mySelection->ClearFilters();
myGeomBase->EraseSimulationShape();
disconnect(mySelection, 0, this, 0);
myOkRadius1 = myOkRadius2 = true;
myRadius1 = 300.0;
myRadius2 = 100.0;
@ -230,13 +228,14 @@ void PrimitiveGUI_TorusDlg::ClickOnOk()
//=================================================================================
void PrimitiveGUI_TorusDlg::ClickOnApply()
{
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
myGeomBase->EraseSimulationShape();
mySimulationTopoDs.Nullify();
if(myOkPoint1 && myOkDir && myOkRadius1 && myOkRadius2 )
if(myOkPoint1 && myOkDir)
myPrimitiveGUI->MakeTorusAndDisplay(myPoint1, myDir, myRadius1, myRadius2);
return ;
}
@ -278,7 +277,7 @@ void PrimitiveGUI_TorusDlg::SelectionIntoArgument()
myOkDir = true;
}
if(myOkPoint1 && myOkDir && myOkRadius1 && myOkRadius2)
if(myOkPoint1 && myOkDir)
MakeTorusSimulationAndDisplay();
return;
}
@ -374,15 +373,23 @@ void PrimitiveGUI_TorusDlg::ValueChangedInSpinBox(double newValue)
QObject* send = (QObject*)sender();
if(send == GroupPoints->SpinBox_DX || send == GroupDimensions->SpinBox_DX) {
myRadius1 = newValue;
myOkRadius1 = true;
if(newValue > myRadius2)
myRadius1 = newValue;
else {
GroupPoints->SpinBox_DX->SetValue(myRadius1);
GroupDimensions->SpinBox_DX->SetValue(myRadius1);
}
}
else if(send == GroupPoints->SpinBox_DY || send == GroupDimensions->SpinBox_DY) {
myRadius2 = newValue;
myOkRadius2 = true;
if(newValue < myRadius1)
myRadius2 = newValue;
else {
GroupPoints->SpinBox_DY->SetValue(myRadius2);
GroupDimensions->SpinBox_DY->SetValue(myRadius2);
}
}
if(myOkPoint1 && myOkDir && myOkRadius1 && myOkRadius2)
if(myOkPoint1 && myOkDir)
MakeTorusSimulationAndDisplay();
return;
}

View File

@ -72,8 +72,6 @@ private:
Standard_Real myRadius1;
Standard_Real myRadius2;
bool myOkRadius1;
bool myOkRadius2;
DlgRef_2Sel2Spin* GroupPoints;
DlgRef_2Spin* GroupDimensions;

View File

@ -311,11 +311,11 @@ bool RepairGUI::OnSuppressFaces(const TopoDS_Shape& ShapeTopo, const char* Shape
Standard_CString Type;
if(myGeomBase->GetShapeTypeString(S, Type)) {
aShellOrFace->NameType(Type);
sprintf (nameG, "%s_%d", Type, myGeomGUI->GetNbGeom()++);
sprintf (nameG, "%s_%d", Type, myGeomGUI->myNbGeom++);
}
else {
aShellOrFace->NameType(tr("GEOM_SHAPE"));
sprintf (nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->GetNbGeom()++);
sprintf (nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->myNbGeom++);
}
/* Display with name */

View File

@ -140,6 +140,7 @@ void RepairGUI_OrientationDlg::ClickOnOk()
//=================================================================================
void RepairGUI_OrientationDlg::ClickOnApply()
{
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;

View File

@ -134,6 +134,7 @@ void RepairGUI_SewingDlg::ClickOnOk()
//=================================================================================
void RepairGUI_SewingDlg::ClickOnApply()
{
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if(myOkListShapes)
myRepairGUI->MakeSewingAndDisplay(myListShapes, myPrecision);

View File

@ -131,6 +131,7 @@ void TransformationGUI_MirrorDlg::ClickOnOk()
//=================================================================================
void TransformationGUI_MirrorDlg::ClickOnApply()
{
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;

View File

@ -258,6 +258,7 @@ void TransformationGUI_MultiRotationDlg::ClickOnOk()
//=================================================================================
void TransformationGUI_MultiRotationDlg::ClickOnApply()
{
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
@ -429,13 +430,13 @@ void TransformationGUI_MultiRotationDlg::ValueChangedInSpinBox(double newValue)
QObject* send = (QObject*)sender();
if(send == GroupPoints->SpinBox_DX || send == GroupDimensions->SpinBox_DY1)
myNbTimes1 = newValue;
myNbTimes1 = (int)newValue;
else if(send == GroupDimensions->SpinBox_DX1)
myAng = newValue;
else if(send == GroupDimensions->SpinBox_DX2)
myStep = newValue;
else if(send == GroupDimensions->SpinBox_DY2)
myNbTimes2 = newValue;
myNbTimes2 = (int)newValue;
if(myOkBase && myOkDir)
this->MakeMultiRotationSimulationAndDisplay();

View File

@ -269,6 +269,7 @@ void TransformationGUI_MultiTranslationDlg::ClickOnOk()
//=================================================================================
void TransformationGUI_MultiTranslationDlg::ClickOnApply()
{
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
@ -488,7 +489,7 @@ void TransformationGUI_MultiTranslationDlg::ValueChangedInSpinBox(double newValu
if(send == GroupPoints->SpinBox_DX)
myStep1 = newValue;
else if(send == GroupPoints->SpinBox_DY)
myNbTimes1 = newValue;
myNbTimes1 = (int)newValue;
if(myOkBase && myOkDir1)
this->MakeMultiTranslationSimulationAndDisplay();
break;
@ -498,11 +499,11 @@ void TransformationGUI_MultiTranslationDlg::ValueChangedInSpinBox(double newValu
if(send == GroupDimensions->SpinBox_DX1)
myStep1 = newValue;
else if(send == GroupDimensions->SpinBox_DY1)
myNbTimes1 = newValue;
myNbTimes1 = (int)newValue;
else if(send == GroupDimensions->SpinBox_DX2)
myStep2 = newValue;
else if(send == GroupDimensions->SpinBox_DY2)
myNbTimes2 = newValue;
myNbTimes2 = (int)newValue;
if(myOkBase && myOkDir1 && myOkDir2)
this->MakeMultiTranslationSimulationAndDisplay();
break;

View File

@ -142,6 +142,7 @@ void TransformationGUI_RotationDlg::ClickOnOk()
//=================================================================================
void TransformationGUI_RotationDlg::ClickOnApply()
{
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;

View File

@ -140,6 +140,7 @@ void TransformationGUI_ScaleDlg::ClickOnOk()
//=================================================================================
void TransformationGUI_ScaleDlg::ClickOnApply()
{
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;

View File

@ -148,6 +148,7 @@ void TransformationGUI_TranslationDlg::ClickOnOk()
//=================================================================================
void TransformationGUI_TranslationDlg::ClickOnApply()
{
buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;