Correction compilation on Linux

This commit is contained in:
abd 2008-04-28 06:22:25 +00:00
parent d35ff88856
commit e330735a02
20 changed files with 156 additions and 52 deletions

View File

@ -107,19 +107,26 @@ GENERATE_RTF = NO
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration options related to the dot tool # Configuration options related to the dot tool
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES #CLASS_DIAGRAMS = YES
CLASS_DIAGRAMS = NO
HIDE_UNDOC_RELATIONS = NO HIDE_UNDOC_RELATIONS = NO
HAVE_DOT = YES #HAVE_DOT = YES
CLASS_GRAPH = YES HAVE_DOT = NO
#CLASS_GRAPH = YES
CLASS_GRAPH = NO
COLLABORATION_GRAPH = NO COLLABORATION_GRAPH = NO
GROUP_GRAPHS = NO GROUP_GRAPHS = NO
UML_LOOK = NO UML_LOOK = NO
TEMPLATE_RELATIONS = YES #TEMPLATE_RELATIONS = YES
INCLUDE_GRAPH = YES #INCLUDE_GRAPH = YES
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = NO
INCLUDED_BY_GRAPH = NO INCLUDED_BY_GRAPH = NO
CALL_GRAPH = NO CALL_GRAPH = NO
GRAPHICAL_HIERARCHY = YES #GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES #DIRECTORY_GRAPH = YES
GRAPHICAL_HIERARCHY = NO
DIRECTORY_GRAPH = NO
DOT_IMAGE_FORMAT = jpg DOT_IMAGE_FORMAT = jpg
DOT_PATH = DOT_PATH =
DOTFILE_DIRS = DOTFILE_DIRS =

View File

@ -27,10 +27,25 @@ EXTRA_DIST+=GEOM
doxygen=@DOXYGEN@ doxygen=@DOXYGEN@
# Below command replaces "geompyDC" by "geompy" except cases
# "sgeompyDC", "1geompyDC" and "egeompyDC" (these sequences
# can be found in file names and must not be replaces):
#
# sed 's/\([^s1e]\)geompyDC\|^geompyDC/\1geompy/g' $${filen} > ./tmp;
#
usr_docs: usr_docs:
cd ./GEOM; \ cd ./GEOM; \
echo "Processing geompyDC.py file: "; \ echo "Processing geompyDC.py file: "; \
$(doxygen) ./doxyfile_py; \ $(doxygen) ./doxyfile_py; \
cd ./geompy_doc; \
filesl=`find .`; \
for filen in $${filesl}; do \
sed 's/\([^s1e]\)geompyDC\|^geompyDC/\1geompy/g' $${filen} > ./tmp1; \
sed 's/geompy\.geompy/geompy/g' ./tmp1 > ./tmp; \
rm -f tmp1; \
mv -f tmp $${filen}; \
done; \
cd ..; \
echo "Running doxygen in directory: "`pwd`; \ echo "Running doxygen in directory: "`pwd`; \
$(doxygen) ./doxyfile; $(doxygen) ./doxyfile;
@ -53,4 +68,4 @@ docguidir=$(docdir)/gui/GEOM
nodist_docgui_DATA= GEOM/doxyfile nodist_docgui_DATA= GEOM/doxyfile
nodist_docgui_DATA+= GEOM/doxyfile_py nodist_docgui_DATA+= GEOM/doxyfile_py
EXTRA_DIST+= GEOM/doxyfile.in EXTRA_DIST+= GEOM/doxyfile.in
EXTRA_DIST+= GEOM/doxyfile_py.in EXTRA_DIST+= GEOM/doxyfile_py.in

View File

@ -892,11 +892,11 @@ module GEOM
/*! /*!
* Create a filling from the given compound of contours. * Create a filling from the given compound of contours.
* \param theMinDeg a minimal degree * \param theMinDeg a minimal degree of BSpline surface to create
* \param theMaxDeg a maximal degree * \param theMaxDeg a maximal degree of BSpline surface to create
* \param theTol2D a 2d tolerance * \param theTol2D a 2d tolerance to be reached
* \param theTol3D a 3d tolerance * \param theTol3D a 3d tolerance to be reached
* \param theNbIter a number of iteration * \param theNbIter a number of iteration of approximation algorithm
* \return New GEOM_Object, containing the created filling surface. * \return New GEOM_Object, containing the created filling surface.
*/ */
GEOM_Object MakeFilling (in GEOM_Object theShape, GEOM_Object MakeFilling (in GEOM_Object theShape,

View File

@ -148,6 +148,16 @@ void BooleanGUI_Dialog::Init()
initName( GroupConstructors->title() ); initName( GroupConstructors->title() );
setTabOrder (RadioButton1, ResultName );
setTabOrder (ResultName, myGroup->PushButton1);
setTabOrder (myGroup->PushButton1, myGroup->PushButton2);
setTabOrder (myGroup->PushButton2, buttonOk);
setTabOrder (buttonOk, buttonApply);
setTabOrder (buttonApply, buttonCancel);
setTabOrder (buttonCancel, buttonHelp);
RadioButton1->setFocus();
globalSelection( GEOM_ALLSHAPES ); globalSelection( GEOM_ALLSHAPES );
} }
@ -273,6 +283,12 @@ GEOM::GEOM_IOperations_ptr BooleanGUI_Dialog::createOperation()
//================================================================================= //=================================================================================
bool BooleanGUI_Dialog::isValid( QString& msg ) bool BooleanGUI_Dialog::isValid( QString& msg )
{ {
Handle(SALOME_InteractiveObject) IO = firstIObject();
Standard_Boolean testResult;
GEOM::GEOM_Object_var anObject = GEOMBase::ConvertIOinGEOMObject( IO, testResult );
if ( !testResult || anObject->_is_nil() )
return false;
return !CORBA::is_nil( myObject1 ) && !CORBA::is_nil( myObject2 ); return !CORBA::is_nil( myObject1 ) && !CORBA::is_nil( myObject2 );
} }

View File

@ -117,7 +117,6 @@ GEOM_Engine::GEOM_Engine()
_OCAFApp = new GEOM_Application(); _OCAFApp = new GEOM_Application();
_UndoLimit = 10; _UndoLimit = 10;
//_lastObjectTag = 0;
} }
/*! /*!
@ -397,20 +396,22 @@ bool GEOM_Engine::Load(int theDocID, char* theFileName)
//============================================================================= //=============================================================================
void GEOM_Engine::Close(int theDocID) void GEOM_Engine::Close(int theDocID)
{ {
if(_mapIDDocument.IsBound(theDocID)) { if (_mapIDDocument.IsBound(theDocID)) {
Handle(TDocStd_Document) aDoc = Handle(TDocStd_Document)::DownCast(_mapIDDocument(theDocID)); Handle(TDocStd_Document) aDoc = Handle(TDocStd_Document)::DownCast(_mapIDDocument(theDocID));
//Remove all GEOM Objects associated to the given document //Remove all GEOM Objects associated to the given document
TColStd_SequenceOfAsciiString aSeq; TColStd_SequenceOfAsciiString aSeq;
GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient It(_objects); GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient It (_objects);
for(; It.More(); It.Next()) { for (; It.More(); It.Next()) {
TCollection_AsciiString anObjID(It.Key()); TCollection_AsciiString anObjID (It.Key());
Standard_Integer anID = ExtractDocID(anObjID); Standard_Integer anID = ExtractDocID(anObjID);
if(theDocID == anID) aSeq.Append(It.Key()); if (theDocID == anID) aSeq.Append(It.Key());
} }
for(Standard_Integer i=1; i<=aSeq.Length(); i++) _objects.UnBind(aSeq.Value(i)); for (Standard_Integer i=1; i<=aSeq.Length(); i++) _objects.UnBind(aSeq.Value(i));
_mapIDDocument.UnBind(theDocID); _lastCleared.Nullify();
_mapIDDocument.UnBind(theDocID);
_OCAFApp->Close(aDoc); _OCAFApp->Close(aDoc);
aDoc.Nullify(); aDoc.Nullify();
} }
@ -571,7 +572,7 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID,
// Make script to publish in study // Make script to publish in study
if ( isPublished ) if ( isPublished )
{ {
map< int, string > anEntryToCommandMap; // sort publishing commands by object entry std::map< int, std::string > anEntryToCommandMap; // sort publishing commands by object entry
for (anEntryToNameIt.Initialize( theObjectNames ); for (anEntryToNameIt.Initialize( theObjectNames );
anEntryToNameIt.More(); anEntryToNameIt.More();
anEntryToNameIt.Next()) anEntryToNameIt.Next())
@ -604,11 +605,11 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID,
// bind a command to the last digit of the entry // bind a command to the last digit of the entry
int tag = int tag =
aEntry.SubString( aEntry.SearchFromEnd(":")+1, aEntry.Length() ).IntegerValue(); aEntry.SubString( aEntry.SearchFromEnd(":")+1, aEntry.Length() ).IntegerValue();
anEntryToCommandMap.insert( make_pair( tag, aCommand.ToCString() )); anEntryToCommandMap.insert( std::make_pair( tag, aCommand.ToCString() ));
} }
// add publishing commands to the script // add publishing commands to the script
map< int, string >::iterator anEntryToCommand = anEntryToCommandMap.begin(); std::map< int, std::string >::iterator anEntryToCommand = anEntryToCommandMap.begin();
for ( ; anEntryToCommand != anEntryToCommandMap.end(); ++anEntryToCommand ) { for ( ; anEntryToCommand != anEntryToCommandMap.end(); ++anEntryToCommand ) {
anUpdatedScript += (char*)anEntryToCommand->second.c_str(); anUpdatedScript += (char*)anEntryToCommand->second.c_str();
} }

View File

@ -26,6 +26,8 @@
// Module : GEOM // Module : GEOM
// $Header$ // $Header$
using namespace std;
#include <Standard_Stream.hxx> #include <Standard_Stream.hxx>
#include <Standard_Stream.hxx> #include <Standard_Stream.hxx>

View File

@ -29,6 +29,8 @@
#if !defined (__GEOM_DISPLAYER_H) #if !defined (__GEOM_DISPLAYER_H)
#define __GEOM_DISPLAYER_H #define __GEOM_DISPLAYER_H
using namespace std;
#include "GEOM_GEOMGUI.hxx" #include "GEOM_GEOMGUI.hxx"
#include "SALOME_Prs.h" #include "SALOME_Prs.h"

View File

@ -21,6 +21,8 @@
#pragma warning( disable:4786 ) #pragma warning( disable:4786 )
#endif #endif
using namespace std;
#include <Standard_Stream.hxx> #include <Standard_Stream.hxx>
#include <GEOMImpl_IBlocksOperations.hxx> #include <GEOMImpl_IBlocksOperations.hxx>

View File

@ -21,6 +21,8 @@
#ifndef _GEOMImpl_IBlocksOperations_HXX_ #ifndef _GEOMImpl_IBlocksOperations_HXX_
#define _GEOMImpl_IBlocksOperations_HXX_ #define _GEOMImpl_IBlocksOperations_HXX_
using namespace std;
#include "GEOM_IOperations.hxx" #include "GEOM_IOperations.hxx"
#include <TopTools_ListOfShape.hxx> #include <TopTools_ListOfShape.hxx>

View File

@ -17,10 +17,15 @@
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
#ifdef WNT #ifdef WNT
#pragma warning( disable:4786 ) #pragma warning( disable:4786 )
#endif #endif
using namespace std;
#include <Standard_Stream.hxx> #include <Standard_Stream.hxx>
#include <GEOMImpl_IHealingOperations.hxx> #include <GEOMImpl_IHealingOperations.hxx>

View File

@ -18,6 +18,8 @@
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
using namespace std;
#ifndef _GEOMImpl_IHealingOperations_HXX_ #ifndef _GEOMImpl_IHealingOperations_HXX_
#define _GEOMImpl_IHealingOperations_HXX_ #define _GEOMImpl_IHealingOperations_HXX_

View File

@ -17,6 +17,9 @@
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
using namespace std;
#include <Standard_Stream.hxx> #include <Standard_Stream.hxx>
#include <GEOMImpl_ILocalOperations.hxx> #include <GEOMImpl_ILocalOperations.hxx>

View File

@ -21,6 +21,8 @@
#ifndef _GEOMImpl_ILocalOperations_HXX_ #ifndef _GEOMImpl_ILocalOperations_HXX_
#define _GEOMImpl_ILocalOperations_HXX_ #define _GEOMImpl_ILocalOperations_HXX_
using namespace std;
#include "Utils_SALOME_Exception.hxx" #include "Utils_SALOME_Exception.hxx"
#include "GEOM_IOperations.hxx" #include "GEOM_IOperations.hxx"
#include "GEOM_Engine.hxx" #include "GEOM_Engine.hxx"

View File

@ -23,6 +23,8 @@
// Project : SALOME // Project : SALOME
// $Header$ // $Header$
using namespace std;
#include <Standard_Stream.hxx> #include <Standard_Stream.hxx>
#include "GEOMImpl_IShapesOperations.hxx" #include "GEOMImpl_IShapesOperations.hxx"
@ -640,7 +642,7 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetGlueFaces
Handle(GEOM_Function) aFunction = theShape->GetLastFunction(); Handle(GEOM_Function) aFunction = theShape->GetLastFunction();
GEOM::TPythonDump pd (aFunction, /*append=*/true); GEOM::TPythonDump pd (aFunction, /*append=*/true);
pd << "[" << anAsciiList.ToCString(); pd << "[" << anAsciiList.ToCString();
pd << "] = geompy.GetGlueFaces" << theShape << ", " << theTolerance << ")"; pd << "] = geompy.GetGlueFaces(" << theShape << ", " << theTolerance << ")";
SetErrorCode(OK); SetErrorCode(OK);

View File

@ -28,6 +28,8 @@
#ifndef _GEOMImpl_IShapesOperations_HXX_ #ifndef _GEOMImpl_IShapesOperations_HXX_
#define _GEOMImpl_IShapesOperations_HXX_ #define _GEOMImpl_IShapesOperations_HXX_
using namespace std;
#include "GEOM_IOperations.hxx" #include "GEOM_IOperations.hxx"
#include "GEOMAlgo_State.hxx" #include "GEOMAlgo_State.hxx"

View File

@ -147,7 +147,7 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
aFW->Load(aWire); aFW->Load(aWire);
aFW->FixReorder(); aFW->FixReorder();
if (aFW->StatusReorder(ShapeExtend_FAIL1)) { if (aFW->StatusReorder(ShapeExtend_FAIL1)) {
Standard_ConstructionError::Raise("Wire construction failed: several loops detected"); Standard_ConstructionError::Raise("Wire construction failed: several loops detected");
} else if (aFW->StatusReorder(ShapeExtend_FAIL)) { } else if (aFW->StatusReorder(ShapeExtend_FAIL)) {
Standard_ConstructionError::Raise("Wire construction failed"); Standard_ConstructionError::Raise("Wire construction failed");
@ -155,6 +155,13 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
Standard_ConstructionError::Raise("Wire construction failed: some gaps detected"); Standard_ConstructionError::Raise("Wire construction failed: some gaps detected");
} else { } else {
} }
aFW->ClosedWireMode() = Standard_False;
aFW->FixConnected();
if (aFW->StatusConnected(ShapeExtend_FAIL)) {
Standard_ConstructionError::Raise("Wire construction failed: cannot build connected wire");
}
aShape = aFW->WireAPIMake(); aShape = aFW->WireAPIMake();
} }
} }

View File

@ -96,15 +96,15 @@ void GEOM_Superv_i::setGeomEngine()
{ {
if ( !CORBA::is_nil(myGeomEngine) ) if ( !CORBA::is_nil(myGeomEngine) )
return; return;
// get GEOM_Gen engine
/*
SALOME_LifeCycleCORBA* lcc = new SALOME_LifeCycleCORBA( name_service );
Engines::Component_var comp = lcc->FindOrLoad_Component( "FactoryServer", "GEOM" );
*/
// get GEOM_Gen engine
Engines::Container_var cont=GetContainerRef(); Engines::Container_var cont=GetContainerRef();
cont->load_component_Library("GEOM"); CORBA::String_var container_name=cont->name();
Engines::Component_var comp=cont->create_component_instance("GEOM",0); std::string shortName=container_name.in();
shortName=shortName.substr(12); // substract "/Containers/"
SALOME_LifeCycleCORBA* lcc = new SALOME_LifeCycleCORBA( name_service );
Engines::Component_var comp = lcc->FindOrLoad_Component( shortName.c_str(), "GEOM" );
delete lcc;
myGeomEngine = GEOM::GEOM_Gen::_narrow(comp); myGeomEngine = GEOM::GEOM_Gen::_narrow(comp);
} }

View File

@ -160,7 +160,9 @@ def TestAll (geompy, math):
#Create advanced objects #Create advanced objects
Copy = geompy.MakeCopy(Box) #(GEOM_Object_ptr)->GEOM_Object_ptr Copy = geompy.MakeCopy(Box) #(GEOM_Object_ptr)->GEOM_Object_ptr
Prism = geompy.MakePrismVecH(Face, vz, 100.0) #(2 GEOM_Object_ptr, Double)->GEOM_Object_ptr Prism = geompy.MakePrismVecH(Face, vz, 100.0) #(2 GEOM_Object_ptr, Double)->GEOM_Object_ptr
Prism2Ways = geompy.MakePrismVecH2Ways(Face, vz, 10.0) #(2 GEOM_Object_ptr, Double)->GEOM_Object_ptr
Revolution = geompy.MakeRevolution(Face, vz, angle2) # Revolution = geompy.MakeRevolution(Face, vz, angle2) #
Revolution2Ways = geompy.MakeRevolution(Face, vz, angle1) #
Filling = geompy.MakeFilling(Compound, mindeg, maxdeg, Filling = geompy.MakeFilling(Compound, mindeg, maxdeg,
tol2d, tol3d, nbiter) #(GEOM_Object_ptr, 4 Doubles, Short)->GEOM_Object_ptr tol2d, tol3d, nbiter) #(GEOM_Object_ptr, 4 Doubles, Short)->GEOM_Object_ptr
Pipe = geompy.MakePipe(Wire, Edge) #(2 GEOM_Object_ptr)->GEOM_Object_ptr Pipe = geompy.MakePipe(Wire, Edge) #(2 GEOM_Object_ptr)->GEOM_Object_ptr
@ -304,7 +306,9 @@ def TestAll (geompy, math):
id_Copy = geompy.addToStudy(Copy, "Copy") id_Copy = geompy.addToStudy(Copy, "Copy")
id_Prism = geompy.addToStudy(Prism, "Prism") id_Prism = geompy.addToStudy(Prism, "Prism")
id_Prism2Ways = geompy.addToStudy(Prism2Ways, "Prism2Ways")
id_Revolution = geompy.addToStudy(Revolution, "Revolution") id_Revolution = geompy.addToStudy(Revolution, "Revolution")
id_Revolution2Ways = geompy.addToStudy(Revolution2Ways, "Revolution2Ways")
id_Filling = geompy.addToStudy(Filling, "Filling") id_Filling = geompy.addToStudy(Filling, "Filling")
id_Pipe = geompy.addToStudy(Pipe, "Pipe") id_Pipe = geompy.addToStudy(Pipe, "Pipe")
id_Sewing = geompy.addToStudy(Sewing, "Sewing") id_Sewing = geompy.addToStudy(Sewing, "Sewing")

View File

@ -666,6 +666,20 @@ class geompyDC(GEOM._objref_GEOM_Gen):
anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH) anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
RaiseIfFailed("MakePrismVecH", self.PrimOp) RaiseIfFailed("MakePrismVecH", self.PrimOp)
return anObj return anObj
## Create a shape by extrusion of the base shape along the vector,
# i.e. all the space, transfixed by the base shape during its translation
# along the vector on the given distance in 2 Ways (forward/backward) .
# @param theBase Base shape to be extruded.
# @param theVec Direction of extrusion.
# @param theH Prism dimension along theVec in forward direction.
# @return New GEOM_Object, containing the created prism.
#
# Example: see GEOM_TestAll.py
def MakePrismVecH2Ways(self, theBase, theVec, theH):
anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
return anObj
## Create a shape by extrusion of the base shape along ## Create a shape by extrusion of the base shape along
# the path shape. The path shape can be a wire or an edge. # the path shape. The path shape can be a wire or an edge.
@ -692,6 +706,11 @@ class geompyDC(GEOM._objref_GEOM_Gen):
anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle) anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp) RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
return anObj return anObj
## The Same Revolution but in both ways forward&backward.
def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
return anObj
## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices. ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
# @param theSeqSections - set of specified sections. # @param theSeqSections - set of specified sections.
@ -1371,11 +1390,11 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Create a filling from the given compound of contours. ## Create a filling from the given compound of contours.
# @param theShape the compound of contours # @param theShape the compound of contours
# @param theMinDeg a minimal degree # @param theMinDeg a minimal degree of BSpline surface to create
# @param theMaxDeg a maximal degree # @param theMaxDeg a maximal degree of BSpline surface to create
# @param theTol2D a 2d tolerance # @param theTol2D a 2d tolerance to be reached
# @param theTol3D a 3d tolerance # @param theTol3D a 3d tolerance to be reached
# @param theNbIter a number of iteration # @param theNbIter a number of iteration of approximation algorithm
# @return New GEOM_Object, containing the created filling surface. # @return New GEOM_Object, containing the created filling surface.
# #
# Example: see GEOM_TestAll.py # Example: see GEOM_TestAll.py
@ -1595,7 +1614,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector) anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
RaiseIfFailed("TranslateVectorCopy", self.TrsfOp) RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
return anObj return anObj
## Rotate the given object around the given axis ## Rotate the given object around the given axis
# on the given angle, creating its copy before the rotatation. # on the given angle, creating its copy before the rotatation.
# @param theObject The object to be rotated. # @param theObject The object to be rotated.

View File

@ -174,7 +174,7 @@ void RepairGUI_GlueDlg::Init()
connect( mySubShapesChk, SIGNAL( stateChanged( int ) ), this, SLOT( onSubShapesChk() ) ); connect( mySubShapesChk, SIGNAL( stateChanged( int ) ), this, SLOT( onSubShapesChk() ) );
connect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), connect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()) ); SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()) );
connect(myDetectBtn, SIGNAL(clicked()), this, SLOT(onDetect())); connect(myDetectBtn, SIGNAL(clicked()), this, SLOT(onDetect()));
@ -240,8 +240,8 @@ void RepairGUI_GlueDlg::ConstructorsClicked( int constructorId )
myEditCurrentArgument->setFocus(); myEditCurrentArgument->setFocus();
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
qApp->processEvents(); qApp->processEvents();
updateGeometry(); updateGeometry();
@ -294,8 +294,10 @@ bool RepairGUI_GlueDlg::ClickOnApply()
//================================================================================= //=================================================================================
void RepairGUI_GlueDlg::SelectionIntoArgument() void RepairGUI_GlueDlg::SelectionIntoArgument()
{ {
if ( mySubShapesChk->isChecked() && getConstructorId() == 1 ) if ( mySubShapesChk->isChecked() && getConstructorId() == 1 ) {
updateButtonState();
return; return;
}
erasePreview(); erasePreview();
myEditCurrentArgument->setText(""); myEditCurrentArgument->setText("");
@ -350,7 +352,7 @@ void RepairGUI_GlueDlg::LineEditReturnPressed()
void RepairGUI_GlueDlg::ActivateThisDialog() void RepairGUI_GlueDlg::ActivateThisDialog()
{ {
GEOMBase_Skeleton::ActivateThisDialog(); GEOMBase_Skeleton::ActivateThisDialog();
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
//GroupPoints->LineEdit1->setText(""); //GroupPoints->LineEdit1->setText("");
@ -651,6 +653,8 @@ void RepairGUI_GlueDlg::onDetect()
msg = tr( "THERE_ARE_NO_FACES_FOR_GLUING" ); msg = tr( "THERE_ARE_NO_FACES_FOR_GLUING" );
} }
connect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()) ) ;
SUIT_MessageBox::info1( this, tr( "GEOM_FREE_BOUNDS_TLT" ), msg, "Close" ); SUIT_MessageBox::info1( this, tr( "GEOM_FREE_BOUNDS_TLT" ), msg, "Close" );
updateButtonState(); updateButtonState();
activateSelection(); activateSelection();
@ -667,15 +671,15 @@ void RepairGUI_GlueDlg::activateSelection()
int anId = getConstructorId(); int anId = getConstructorId();
if ( anId == 0 ) // Case of whole gluing if ( anId == 0 ) // Case of whole gluing
{ {
disconnect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), disconnect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()) ) ; SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()) ) ;
globalSelection( GEOM_ALLSHAPES ); globalSelection( GEOM_ALLSHAPES );
if (myObject->_is_nil()) if (myObject->_is_nil())
SelectionIntoArgument(); SelectionIntoArgument();
connect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), connect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()) ) ; SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()) ) ;
} }
else // Second case of gluing else // Second case of gluing
{ {
@ -684,10 +688,13 @@ void RepairGUI_GlueDlg::activateSelection()
else else
{ {
displayPreview( true, false, false, 2/*line width*/, 1/*display mode*/, Quantity_NOC_RED ); displayPreview( true, false, false, 2/*line width*/, 1/*display mode*/, Quantity_NOC_RED );
disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()) ) ;
globalSelection( GEOM_PREVIEW ); globalSelection( GEOM_PREVIEW );
} connect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()) ) ;
}
} }
updateViewer(); updateViewer();
} }
@ -706,9 +713,13 @@ void RepairGUI_GlueDlg::updateButtonState()
} }
else else
{ {
bool wasSelected = false;
SALOME_ListIteratorOfListIO it ( selectedIO() );
if (it.More() > 0)
wasSelected = true;
bool wasDetected = myTmpObjs.size() ? true : false; bool wasDetected = myTmpObjs.size() ? true : false;
buttonOk->setEnabled( hasMainObj && wasDetected ); buttonOk->setEnabled( hasMainObj && wasDetected && wasSelected);
buttonApply->setEnabled( hasMainObj && wasDetected ); buttonApply->setEnabled( hasMainObj && wasDetected && wasSelected);
mySubShapesChk->setEnabled( hasMainObj && wasDetected ); mySubShapesChk->setEnabled( hasMainObj && wasDetected );
myDetectBtn->setEnabled( hasMainObj ); myDetectBtn->setEnabled( hasMainObj );
if ( !hasMainObj || !wasDetected ) if ( !hasMainObj || !wasDetected )