//=================================================================================
void BasicGUI_ArcDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
//=================================================================================
void BasicGUI_CircleDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
//=================================================================================
void BasicGUI_EllipseDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
//=================================================================================
void BasicGUI_LineDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
//=================================================================================
void BasicGUI_PlaneDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
//=================================================================================
void BasicGUI_PointDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if(mySimulationTopoDs.IsNull())
return;
//=================================================================================
void BasicGUI_VectorDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
//=================================================================================
void BasicGUI_WorkingPlaneDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if(myOkPlane)
myBasicGUI->MakeWorkingPlane(myLoc, myDir);
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);
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);
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) ;
//=================================================================================
void BuildGUI_ShellDlg::SetEditCurrentArgument()
{
- QPushButton* send = (QPushButton*)sender();
- mySelection->ClearFilters() ;
+ mySelection->ClearFilters();
GroupShell->LineEdit1->setFocus();
- myEditCurrentArgument = GroupShell->LineEdit1;
mySelection->AddFilter(myFaceFilter);
this->SelectionIntoArgument();
return;
#include "BuildGUI.h"
-#include "GEOM_FaceFilter.hxx"
+#include "GEOM_ShapeTypeFilter.hxx"
//=================================================================================
// class : BuildGUI_ShellDlg
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 */
void ClickOnOk();
void ClickOnApply();
void SetEditCurrentArgument();
- void LineEditReturnPressed();
void SelectionIntoArgument();
void ActivateThisDialog();
}
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());
}
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");
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");
//============================================================================
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;
//=================================================================================
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() );
}
return listOfGeomShapes._retn() ;
}
-
//=================================================================================
// function : MakeBoolean()
// purpose : Boolean operation according to the type 'operation'
TopoDS_Shape shape ;
TopoDS_Shape aShape1 ;
TopoDS_Shape aShape2 ;
-
+
try {
aShape1 = GetTopoShape(shape1) ;
aShape2 = GetTopoShape(shape2) ;
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);
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);
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);
GeomGUI->myNbGeom = GeomGUI->myComponentGeom->NbLabels();
}
+ /* GetCurrentStudy */
+ int studyId = desktop->getActiveStudy()->getStudyId();
+ GeomGUI->myComponentGeom->GetCurrentStudy(studyId);
+
+ //GeomGUI->myNbGeom = GeomGUI->myComponentGeom->NbLabels();
+
return GeomGUI;
}
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();
msgid "GEOM_WIRE"
msgstr "Wire"
+#Wire(s)
+msgid "GEOM_WIRES"
+msgstr "Wire(s)"
+
#Parameter
msgid "GEOM_PARAMETER"
msgstr "Parameter :"
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"
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"
+
#: GeometryGUI.cxx:563
msgid "GEOM_INF_LOADED"
-msgstr "Le fichier %1 est chargé."
+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"
#: 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"
#: 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"
#Object and result
msgid "GEOM_OBJECT_RESULT"
-msgstr "Objet Et Résultat"
+msgstr "Objet Et Résultat"
#Point
msgid "GEOM_POINT"
#Coordinates
msgid "GEOM_COORDINATES"
-msgstr "Coordonnées"
+msgstr "Coordonnées"
#Coor.
msgid "GEOM_COOR"
#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"
#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"
#Tolerance
msgid "GEOM_TOLERANCE"
-msgstr "Tolérance"
+msgstr "Tolérance"
#Orientation
msgid "GEOM_ORIENTATION"
#Revolution
msgid "GEOM_REVOLUTION"
-msgstr "Révolution"
+msgstr "Révolution"
#Rotation
msgid "GEOM_ROTATION"
#Archimede
msgid "GEOM_ARCHIMEDE"
-msgstr "Archimède"
+msgstr "Archimède"
#Common
msgid "GEOM_COMMON"
#Sphere
msgid "GEOM_SPHERE"
-msgstr "Sphère"
+msgstr "Sphère"
#Conical Face
msgid "GEOM_SURFCONE"
#Spherical Face
msgid "GEOM_SURFSPHERE"
-msgstr "Face Sphèrique"
+msgstr "Face Sphèrique"
#Toroidal Face
msgid "GEOM_SURFTORUS"
#Parameter
msgid "GEOM_PARAMETER"
-msgstr "Paramètre :"
+msgstr "Paramètre :"
#
#: 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"
#: 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"
#: GeometryGUI_CenterMassDlg.cxx:77
msgid "GEOM_CMASS_TITLE"
-msgstr "Centre De Gravité"
+msgstr "Centre De Gravité"
msgid "GEOM_PLANE_SIZE"
msgstr "Taille du plan :"
#: 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"
#: 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"
#: 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"
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"
msgstr "Multi Rotation Double"
msgid "GEOM_PARAM_POINT"
-msgstr "Point paramétrique"
+msgstr "Point paramétrique"
#
#==============================================================================
#: 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 "
+
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();
}
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());
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);
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");
}
// 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 )) );
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)
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)
//=================================================================================
void GenerationGUI_FillingDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
}
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;
//=================================================================================
void GenerationGUI_PrismDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
//=================================================================================
void GenerationGUI_RevolDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
#include <qtextedit.h>
+#include <BRep_Tool.hxx>
+
//=================================================================================
// class : MeasureGUI_WhatisDlg()
// purpose : Constructs a MeasureGUI_WhatisDlg which is a child of 'parent', with the
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)
//=================================================================================
void OperationGUI_ArchimedeDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if(myOkIO)
myOperationGUI->Archimede(myIO, myWeight, myWaterDensity, myMeshingDeflection);
#include "OperationGUI_ChamferDlg.h"
#include "DisplayGUI.h"
+#include "QAD_MessageBox.h"
#include <AIS_InteractiveContext.hxx>
#include <BRepFilletAPI_MakeChamfer.hxx>
#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
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 */
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()));
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();
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;
}
}
//=================================================================================
void OperationGUI_ChamferDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QApplication::setOverrideCursor(Qt::waitCursor);
QAD_Application::getDesktop()->putInfo(tr(""));
myGeomBase->EraseSimulationShape();
}
}
}
- if(myConstructorId == 0)
+ if(myOkShape && QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myConstructorId == 0)
this->MakePreview();
}
}
-//=================================================================================
-// 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 :
{
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;
}
// 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;
}
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 */
+ }
- 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;
+ 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_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;
-
}
double myD2;
DlgRef_1Sel2Spin* Group1;
- DlgRef_1Sel2Spin* Group2;
- DlgRef_1Sel2Spin* Group3;
private slots:
void ClickOnOk();
void ClickOnCancel();
void ActivateThisDialog();
void DeactivateActiveDialog();
- void LineEditReturnPressed();
void SelectionIntoArgument();
void SetEditCurrentArgument();
void ValueChangedInSpinBox(double newValue);
#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
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 */
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()));
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();
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;
}
}
//=================================================================================
void OperationGUI_FilletDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QApplication::setOverrideCursor(Qt::waitCursor);
QAD_Application::getDesktop()->putInfo(tr(""));
myGeomBase->EraseSimulationShape();
}
}
}
- if(myConstructorId == 0)
+ if(myOkShape && QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myConstructorId == 0)
this->MakePreview();
}
else
}
-//=================================================================================
-// 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 :
{
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;
}
myRadius = newValue;
- if(myConstructorId == 0)
+ if(myOkShape && QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myConstructorId == 0)
this->MakePreview();
return;
}
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;
}
double myRadius;
DlgRef_1Sel1Spin* Group1;
- DlgRef_1Sel1Spin* Group2;
- DlgRef_1Sel1Spin* Group3;
private slots:
void ClickOnOk();
void ClickOnCancel();
void ActivateThisDialog();
void DeactivateActiveDialog();
- void LineEditReturnPressed();
void SelectionIntoArgument();
void SetEditCurrentArgument();
void ValueChangedInSpinBox(double newValue);
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;
//=================================================================================
void PrimitiveGUI_BoxDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
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);
//=================================================================================
void PrimitiveGUI_ConeDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
//=================================================================================
void PrimitiveGUI_CylinderDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
//=================================================================================
void PrimitiveGUI_SphereDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if(mySimulationTopoDs.IsNull())
return;
myRadius1 = 300.0;
myRadius2 = 100.0;
- myOkRadius1 = myOkRadius2 = true;
myOkPoint1 = myOkDir = false;
myEdgeFilter = new GEOM_EdgeFilter(StdSelect_Line, myGeom);
mySelection->ClearFilters();
myGeomBase->EraseSimulationShape();
disconnect(mySelection, 0, this, 0);
- myOkRadius1 = myOkRadius2 = true;
myRadius1 = 300.0;
myRadius2 = 100.0;
//=================================================================================
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 ;
}
myOkDir = true;
}
- if(myOkPoint1 && myOkDir && myOkRadius1 && myOkRadius2)
+ if(myOkPoint1 && myOkDir)
MakeTorusSimulationAndDisplay();
return;
}
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;
}
Standard_Real myRadius1;
Standard_Real myRadius2;
- bool myOkRadius1;
- bool myOkRadius2;
DlgRef_2Sel2Spin* GroupPoints;
DlgRef_2Spin* GroupDimensions;
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 */
//=================================================================================
void RepairGUI_OrientationDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
//=================================================================================
void RepairGUI_SewingDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if(myOkListShapes)
myRepairGUI->MakeSewingAndDisplay(myListShapes, myPrecision);
//=================================================================================
void TransformationGUI_MirrorDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
//=================================================================================
void TransformationGUI_MultiRotationDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
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();
//=================================================================================
void TransformationGUI_MultiTranslationDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
if(send == GroupPoints->SpinBox_DX)
myStep1 = newValue;
else if(send == GroupPoints->SpinBox_DY)
- myNbTimes1 = newValue;
+ myNbTimes1 = (int)newValue;
if(myOkBase && myOkDir1)
this->MakeMultiTranslationSimulationAndDisplay();
break;
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;
//=================================================================================
void TransformationGUI_RotationDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
//=================================================================================
void TransformationGUI_ScaleDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
//=================================================================================
void TransformationGUI_TranslationDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;