-This is the version 1.4.0 of GEOM
+This is the version 1.4.1 of GEOM
Compatible with :
- - KERNEL 1.4.0
+ - KERNEL 1.4.1
@COMMENCE@
-SUBDIRS = idl src
+SUBDIRS = idl src doc
RESOURCES_FILES = \
GEOM_en.xml \
GEOM_fr.xml \
+GEOM.config \
GEOMCatalog.xml \
GEOMDS_Resources \
arc.png \
# test if SALOMEconfig.h has changed (contents)
salome_adm/unix/SALOMEconfig.ref: salome_adm/unix/SALOMEconfig.h
@if ! [ -a $@ ]; then \
- cp -p $< $@; \
+ cp -p -f $< $@; \
fi; \
if ! cmp $< $@; then \
- cp -p $< $@; \
+ cp -p -f $< $@; \
fi; \
include/salome/sstream: salome_adm/unix/sstream
install-include: $(include_list)
$(INSTALL) -d $(includedir)
- @for f in X $(include_list); do \
- if test $$f != X; then \
- ($(INSTALL_DATA) $$f $(includedir)/. || exit 1); \
- fi; \
+ @for f in X $(include_list); do \
+ if test $$f != X; then \
+ ($(INSTALL_DATA) -p $$f $(includedir)/. || exit 1); \
+ fi; \
done
# install script in $(bindir) :
OMNIORB_IDL = @OMNIORB_IDL@
OMNIORB_IDLCXXFLAGS = @OMNIORB_IDLCXXFLAGS@
-OMNIORB_IDLPYFLAGS = @OMNIORB_IDLPYFLAGS@ -I$(top_srcdir)/idl -I$(top_builddir)/idl -I$(KERNEL_ROOT_DIR)/idl/salome
+OMNIORB_IDLPYFLAGS = @OMNIORB_IDLPYFLAGS@ -I$(top_srcdir)/idl -I$(KERNEL_ROOT_DIR)/idl/salome
OMNIORB_IDL_CLN_H = @OMNIORB_IDL_CLN_H@
OMNIORB_IDL_CLN_CXX = @OMNIORB_IDL_CLN_CXX@
CORBA_LIBS = @CORBA_LIBS@
CORBA_CXXFLAGS = @CORBA_CXXFLAGS@
-IDLCXXFLAGS = -bcxx @IDLCXXFLAGS@ -I$(top_srcdir)/idl -I$(top_builddir)/idl -I$(KERNEL_ROOT_DIR)/idl/salome
+IDLCXXFLAGS = -bcxx @IDLCXXFLAGS@ -I$(top_srcdir)/idl -I$(KERNEL_ROOT_DIR)/idl/salome
IDLPYFLAGS = @IDLPYFLAGS@
IDL = @IDL@
sharedpydir=@libdir@/python$(PYTHON_VERSION)/site-packages/salome/shared_modules
incmakedir=${prefix}/salome_adm/unix
-docdir=$(datadir)/doc
+docdir=${prefix}/doc/salome
#
# begin of package rules
#
-.PHONY: all lib bin inc resources data doc tests install uninstall dep depend depend_idl cleandep mostlyclean clean distclean
+.PHONY: all lib bin inc resources data docs tests install uninstall dep depend depend_idl cleandep mostlyclean clean distclean
.SUFFIXES: .cxx .cc .c .f .o .lo .idl .py .i .ui .po .qm
-THIS IS SALOME - GEOM VERSION: 1.4.0
+THIS IS SALOME - GEOM VERSION: 1.4.1
# Created from configure.in.base
#
+
AC_INIT(src)
AC_CONFIG_AUX_DIR(${KERNEL_ROOT_DIR}/salome_adm/unix/config_files)
AC_CANONICAL_HOST
fi
# make other build directories
-for rep in salome_adm adm_local doc bin/salome include/salome lib/salome share/salome/resources share/salome/doc idl
+for rep in salome_adm adm_local doc bin/salome include/salome lib/salome share/salome/resources idl
do
# if test ! -d $rep ; then
# eval mkdir $rep
dnl excluding .in files (treated in AC-OUTPUT below) and CVS
dnl directory
-cd bin
+mkdir -p bin/salome
+cd bin/salome
+
for i in $ROOT_SRCDIR/bin/*
do
local_bin=`echo $i | sed -e "s,$ROOT_SRCDIR,.,"`
case "$local_bin" in
*.in | *~) ;;
- ./bin/CVS) ;;
- *) ln -fs $i; echo $local_bin ;;
+ ./bin/CVS | ./bin/salome) ;;
+ *) /usr/bin/install -C $i .; echo $local_bin ;;
esac
done
cd $ROOT_BUILDDIR
srcdir=@srcdir@
VPATH=.:@srcdir@
-SUBDIRS=html
+SUBDIRS= salome
-doc:
+@COMMENCE@
+
+docs:
@@SETX@; for d in $(SUBDIRS); do \
(cd $$d && $(MAKE) $@) || exit 1; \
done
@@SETX@; for d in $(SUBDIRS); do \
(cd $$d && $(MAKE) $@) || exit 1; \
done
+
+uninstall:
+ @@SETX@; for d in $(SUBDIRS); do \
+ (cd $$d && $(MAKE) $@) || exit 1; \
+ done
// the generator engine
GEOM_Gen Engine();
+ // Get the TopoDS_Shape, for colocated case only
+ long getShape();
};
};
#endif
top_srcdir=@top_srcdir@
top_builddir=..
srcdir=@srcdir@
-VPATH=.:$(srcdir):${KERNEL_ROOT_DIR}/idl/salome
+VPATH=.:${KERNEL_ROOT_DIR}/idl/salome
@COMMENCE@
PY_CLIENT_IDL = $(IDL_FILES)
# we copy all idl file in $(top_builddir)/idl
-inc: $(IDL_FILES:%=$(top_builddir)/idl/%)
+inc: $(top_builddir)/idl/salome $(IDL_FILES:%=$(top_builddir)/idl/salome/%)
-$(IDL_FILES:%=$(top_builddir)/idl/%):$(top_builddir)/idl/%:%
+$(top_builddir)/idl/salome:
+ mkdir $@
+
+$(IDL_FILES:%=$(top_builddir)/idl/salome/%):$(IDL_FILES:%=$(top_srcdir)/idl/%)
# $(CP) $< $@
- cp -f $< $@
+ cp -f $^ $(top_builddir)/idl/salome
lib: pyidl
$(PYTHON_BUILD_SITE):
$(INSTALL) -d $@
-$(PYTHON_BUILD_SITE)/%_idl.py: %.idl
+$(PYTHON_BUILD_SITE)/%_idl.py: $(top_builddir)/idl/salome/%.idl
$(OMNIORB_IDL) $(OMNIORB_IDLPYFLAGS) -C$(PYTHON_BUILD_SITE) $<
install: install-pyidl install-idl
# create directory $(idldir) and copy idl files into it
-install-idl: $(IDL_FILES)
+install-idl: $(IDL_FILES:%=$(top_builddir)/idl/salome/%)
$(INSTALL) -d $(idldir)
$(INSTALL_DATA) $^ $(idldir)
-install-pyidl: $(IDL_FILES)
+install-pyidl: $(IDL_FILES:%=$(top_builddir)/idl/salome/%)
$(INSTALL) -d $(PYTHON_SITE_INSTALL)
@for file in $^ dummy; do \
if [ $$file != "dummy" ]; then \
distclean:
-$(RM) *.py
- -$(RM) $(IDL_FILES:%=$(top_builddir)/idl/%)
+ -$(RM) $(IDL_FILES:%=$(top_builddir)/idl/salome/%)
-$(RM) Makefile
min = Zmin;
max = Zmax;
}
+
//=================================================================================
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);
Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
- LineEdit2 = new QLineEdit( GroupBox1, "LineEdit2" );
-
- Layout1->addWidget( LineEdit2, 1, 2 );
-
- PushButton4 = new QPushButton( GroupBox1, "PushButton4" );
- PushButton4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton4->sizePolicy().hasHeightForWidth() ) );
- PushButton4->setText( trUtf8( "" ) );
+ TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
+ TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
+ TextLabel1->setText( trUtf8( "TL1" ) );
- Layout1->addWidget( PushButton4, 4, 1 );
+ Layout1->addWidget( TextLabel1, 0, 0 );
PushButton1 = new QPushButton( GroupBox1, "PushButton1" );
PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) );
PushButton1->setText( trUtf8( "" ) );
Layout1->addWidget( PushButton1, 0, 1 );
+
+ LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
- LineEdit4 = new QLineEdit( GroupBox1, "LineEdit4" );
-
- Layout1->addWidget( LineEdit4, 4, 2 );
+ Layout1->addWidget( LineEdit1, 0, 2 );
+
- PushButton3 = new QPushButton( GroupBox1, "PushButton3" );
- PushButton3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton3->sizePolicy().hasHeightForWidth() ) );
- PushButton3->setText( trUtf8( "" ) );
+ TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
+ TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
+ TextLabel2->setText( trUtf8( "TL2" ) );
- Layout1->addWidget( PushButton3, 3, 1 );
+ Layout1->addWidget( TextLabel2, 1, 0 );
PushButton2 = new QPushButton( GroupBox1, "PushButton2" );
PushButton2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton2->sizePolicy().hasHeightForWidth() ) );
PushButton2->setText( trUtf8( "" ) );
Layout1->addWidget( PushButton2, 1, 1 );
+
+ LineEdit2 = new QLineEdit( GroupBox1, "LineEdit2" );
- TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
- TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
- TextLabel1->setText( trUtf8( "TL1" ) );
+ Layout1->addWidget( LineEdit2, 1, 2 );
- Layout1->addWidget( TextLabel1, 0, 0 );
+
+ TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
+ TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
+ TextLabel3->setText( trUtf8( "TL3" ) );
+
+ Layout1->addMultiCellWidget( TextLabel3, 2, 2, 0, 1 );
+
+ ComboBox1 = new QComboBox( FALSE, GroupBox1, "ComboBox1" );
+ ComboBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, ComboBox1->sizePolicy().hasHeightForWidth() ) );
- TextLabel4 = new QLabel( GroupBox1, "TextLabel4" );
+ Layout1->addWidget( ComboBox1, 2, 2 );
+
+
+ GroupBox1Layout->addLayout( Layout1, 0, 0 );
+
+ DlgRef_4Sel1List_QTDLayout->addWidget( GroupBox1, 0, 0 );
+
+
+ GroupBox2 = new QGroupBox( this, "GroupBox2" );
+ GroupBox2->setTitle( trUtf8( "" ) );
+ GroupBox2->setColumnLayout(0, Qt::Vertical );
+ GroupBox2->layout()->setSpacing( 6 );
+ GroupBox2->layout()->setMargin( 11 );
+ GroupBox2Layout = new QGridLayout( GroupBox2->layout() );
+ GroupBox2Layout->setAlignment( Qt::AlignTop );
+
+ Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
+
+ TextLabel4 = new QLabel( GroupBox2, "TextLabel4" );
TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel4->sizePolicy().hasHeightForWidth() ) );
TextLabel4->setText( trUtf8( "TL4" ) );
-
- Layout1->addWidget( TextLabel4, 3, 0 );
+
+ Layout2->addWidget( TextLabel4, 0, 0 );
QSpacerItem* spacer = new QSpacerItem( 0, 80, QSizePolicy::Minimum, QSizePolicy::Expanding );
Layout1->addItem( spacer, 5, 2 );
- LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
-
- Layout1->addWidget( LineEdit1, 0, 2 );
+ PushButton3 = new QPushButton( GroupBox2, "PushButton3" );
+ PushButton3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton3->sizePolicy().hasHeightForWidth() ) );
+ PushButton3->setText( trUtf8( "" ) );
- TextLabel5 = new QLabel( GroupBox1, "TextLabel5" );
- TextLabel5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel5->sizePolicy().hasHeightForWidth() ) );
- TextLabel5->setText( trUtf8( "TL5" ) );
+ Layout2->addWidget( PushButton3, 0, 1 );
- Layout1->addWidget( TextLabel5, 4, 0 );
+ LineEdit3 = new QLineEdit( GroupBox2, "LineEdit3" );
- LineEdit3 = new QLineEdit( GroupBox1, "LineEdit3" );
+ Layout2->addWidget( LineEdit3, 0, 2 );
- Layout1->addWidget( LineEdit3, 3, 2 );
- TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
- TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
- TextLabel2->setText( trUtf8( "TL2" ) );
-
- Layout1->addWidget( TextLabel2, 1, 0 );
+ TextLabel5 = new QLabel( GroupBox2, "TextLabel5" );
+ TextLabel5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel5->sizePolicy().hasHeightForWidth() ) );
+ TextLabel5->setText( trUtf8( "TL5" ) );
- ComboBox1 = new QComboBox( FALSE, GroupBox1, "ComboBox1" );
- ComboBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, ComboBox1->sizePolicy().hasHeightForWidth() ) );
+ Layout2->addWidget( TextLabel5, 1, 0 );
- Layout1->addWidget( ComboBox1, 2, 2 );
+ PushButton4 = new QPushButton( GroupBox2, "PushButton4" );
+ PushButton4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton4->sizePolicy().hasHeightForWidth() ) );
+ PushButton4->setText( trUtf8( "" ) );
- TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
- TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
- TextLabel3->setText( trUtf8( "TL3" ) );
+ Layout2->addWidget( PushButton4, 1, 1 );
- Layout1->addMultiCellWidget( TextLabel3, 2, 2, 0, 1 );
+ LineEdit4 = new QLineEdit( GroupBox2, "LineEdit4" );
- GroupBox1Layout->addLayout( Layout1, 0, 0 );
+ Layout2->addWidget( LineEdit4, 1, 2 );
- DlgRef_4Sel1List_QTDLayout->addWidget( GroupBox1, 0, 0 );
+ GroupBox2Layout->addLayout( Layout2, 0, 0 );
+
+ DlgRef_4Sel1List_QTDLayout->addWidget( GroupBox2, 1, 0 );
}
/*
~DlgRef_4Sel1List_QTD();
QGroupBox* GroupBox1;
+ QGroupBox* GroupBox2;
QLineEdit* LineEdit2;
QPushButton* PushButton4;
QPushButton* PushButton1;
protected:
QGridLayout* DlgRef_4Sel1List_QTDLayout;
QGridLayout* GroupBox1Layout;
+ QGridLayout* GroupBox2Layout;
QGridLayout* Layout1;
+ QGridLayout* Layout2;
};
#endif // DLGREF_4SEL1LIST_QTD_H
}
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");
#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
+#include "Utils_ExceptHandlers.hxx"
+
Standard_EXPORT static Standard_Boolean IsValid(const TopoDS_Shape& S) {
#if OCC_VERSION_MAJOR >= 5
return BRepAlgo::IsValid(S);
CORBA::Object_ptr theObject,
const char* theName) throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
SALOMEDS::SObject_var aResultSO;
if(CORBA::is_nil(theObject)) return aResultSO;
//============================================================================
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() );
}
TopoDS_Shape& aCompoundOfShells )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
BRepTools_Quilt Glue;
aCompoundOfShells.Nullify() ;
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape::ListOfSubShapeID_var ListOfID = new GEOM::GEOM_Shape::ListOfSubShapeID;
ListOfID->length(0) ;
if( subShell.IsNull() || subShell.ShapeType() != TopAbs_SHELL ) {
const GEOM::GEOM_Shape::ListOfSubShapeID& ListOfID )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Gen::ListOfGeomShapes_var listOfGeomShapes = new GEOM::GEOM_Gen::ListOfGeomShapes;
listOfGeomShapes->length(0) ;
TopTools_MapOfShape& MSwireEndEdges )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
TopTools_MapOfShape MS ;
TopTools_SequenceOfShape SU ;
FreeEdgesFromMapOfFace(MSfaces, MS) ; /* MS = free edges of MSfaces */
const GEOM::GEOM_Shape::ListOfSubShapeID& ListIdWires )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result;
if( ListIdWires.length() < 1 )
const GEOM::GEOM_Shape::ListOfSubShapeID& ListIdEndFace )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result;
TopoDS_Face aFace ;
TopoDS_Wire aWire ;
TopoDS_Shape& resultTds )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
BRep_Builder B;
TopExp_Explorer exp ;
TopoDS_Face newFace ;
TopoDS_Shape& resultTds )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
BRep_Builder B;
TopExp_Explorer exp ;
TopoDS_Face newFace ;
const GEOM::GEOM_Shape::ListOfSubShapeID& ListOfID)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
return SubShapesOne(shape, (TopAbs_ShapeEnum) ShapeType, ListOfID);
}
const GEOM::GEOM_Shape::ListOfSubShapeID& ListOfID)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
return SubShapesOne(shape, (TopAbs_ShapeEnum) ShapeType, ListOfID, Standard_True);
}
const Standard_Boolean Sort)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result;
TopoDS_Shape mainShape;
TopoDS_Shape mainTopo = GetTopoShape(shape);
CORBA::Short ShapeType)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
return SubShapesAll(shape, (TopAbs_ShapeEnum) ShapeType);
}
CORBA::Short ShapeType)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
return SubShapesAll(shape, (TopAbs_ShapeEnum) ShapeType, Standard_True);
}
throw (SALOME::SALOME_Exception)
{
/* List of sub shapes returned */
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Gen::ListOfGeomShapes_var listOfGeomShapes = new GEOM::GEOM_Gen::ListOfGeomShapes;
listOfGeomShapes->length(0) ;
return listOfGeomShapes._retn() ;
}
-
//=================================================================================
// function : MakeBoolean()
// purpose : Boolean operation according to the type 'operation'
CORBA::Long operation)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result;
TopoDS_Shape shape ;
TopoDS_Shape aShape1 ;
TopoDS_Shape aShape2 ;
-
+
try {
aShape1 = GetTopoShape(shape1) ;
aShape2 = GetTopoShape(shape2) ;
GEOM::GEOM_Shape_ptr shape2)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result;
TopoDS_Shape aShape1 = GetTopoShape(shape1) ;
TopoDS_Shape aShape2 = GetTopoShape(shape2) ;
CORBA::Double vy,
CORBA::Double vz)
{
+ int a = 1; int b = 0; int c; c=a/b;
GEOM::AxisStruct A ;
A.x = x ; A.y = y ; A.z = z ;
A.vx = vx ; A.vy = vy ; A.vz = vz ;
CORBA::Double z2)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
gp_Pnt P1(x1,y1,z1);
gp_Pnt P2(x2,y2,z2);
GEOM::GEOM_Shape_var result ;
CORBA::Double height)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result;
TopoDS_Shape tds ;
gp_Pnt p(pstruct.x, pstruct.y, pstruct.z) ;
CORBA::Double radius)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
try {
CORBA::Double minor_radius )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result;
TopoDS_Shape tds ;
gp_Pnt p(pstruct.x, pstruct.y, pstruct.z) ;
CORBA::Double height)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result;
TopoDS_Shape tds ;
gp_Pnt p(pstruct.x, pstruct.y, pstruct.z) ;
GEOM::GEOM_Shape_ptr GEOM_Gen_i::ImportIGES(const char* filename)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
//VRV: OCC 4.0 migration
IGESControl_Reader aReader;
THROW_SALOME_CORBA_EXCEPTION("Error in reading import file", SALOME::BAD_PARAM); }
MESSAGE("ImportIGES : all Geometry Transfer" << endl ) ;
- aReader.Clear();
- aReader.TransferRoots(false);
+ //OCC 5.1.2 porting
+// aReader.Clear();
+// aReader.TransferRoots(false);
+ aReader.ClearShapes();
+ aReader.TransferRoots();
MESSAGE("ImportIGES : count of shapes produced = " << aReader.NbShapes() << endl );
TopoDS_Shape shape = aReader.OneShape();
GEOM::GEOM_Shape_ptr GEOM_Gen_i::ImportSTEP(const char* filename)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
//VRV: OCC 4.0 migration
STEPControl_Reader aReader;
const CORBA::Short Limit)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var aResult;
TopoDS_Shape tds ;
//MESSAGE ("In Partition");
CORBA::Short nbiter)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Face tds ;
TopoDS_Shape aShape = GetTopoShape(myShape) ;
// appliquer BRepTools_SameParameter au compshell
// (rendre parametres 2D des edges identiques aux parametres 3D)
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
TopoDS_Shape aShape = GetTopoShape(myShape) ;
CORBA::Double precision )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
BRepOffsetAPI_Sewing aMethod ;
CORBA::Double precision )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds, S ;
BRepOffsetAPI_Sewing aMethod ;
GEOM::GEOM_Shape_ptr GEOM_Gen_i::OrientationChange(GEOM::GEOM_Shape_ptr aShape)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
BRep_Builder aBuilder;
GEOM::GEOM_Shape_ptr GEOM_Gen_i::ImportBREP(const char* filename)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
TopoDS_Shape tds ;
GEOM::GEOM_Shape_var result ;
CORBA::Double trimsize)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
CORBA::Double z)
throw (SALOME::SALOME_Exception)
{
-
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
gp_Pnt P(x,y,z);
TopoDS_Shape tds = BRepBuilderAPI_MakeVertex(P).Shape();
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);
CORBA::Boolean wantplanarface )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape aShape;
TopoDS_Shape tds;
GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeShell( const GEOM::GEOM_Gen::ListOfIOR& ListShapes )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
BRepTools_Quilt Glue;
TopoDS_Shape C;
GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeSolid( const GEOM::GEOM_Gen::ListOfIOR& ListShapes )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
Standard_Integer ish = 0;
TopoDS_Compound Res;
const GEOM::DirStruct& dstruct)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
gp_Pnt P1(pstruct.x, pstruct.y, pstruct.z);
gp_Pnt P2(dstruct.PS.x, dstruct.PS.y, dstruct.PS.z) ;
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);
const GEOM::PointStruct& pstruct2)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
CORBA::Double radius)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result;
TopoDS_Shape tds ;
CORBA::Double radius_minor )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result;
TopoDS_Shape tds ;
const GEOM::PointStruct& pEnd)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result;
try {
gp_Pnt pI(pInit.x, pInit.y, pInit.z) ;
CORBA::Double z)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape aShape = GetTopoShape(myShape) ;
if( aShape.IsNull() ) {
CORBA::Short nbtimes )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
CORBA::Short nbtimes2 )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
CORBA::Short nbtimes)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
TopoDS_Shape aShape = GetTopoShape(myShape) ;
CORBA::Short nbtimes2 )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
TopoDS_Shape aShape = GetTopoShape(myShape) ;
GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeCopy( GEOM::GEOM_Shape_ptr Shape)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
TopoDS_Shape aShape = GetTopoShape(Shape) ;
GEOM::GEOM_Shape_ptr shapePlane)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
TopoDS_Shape aShape = GetTopoShape(myShape) ;
CORBA::Double angle)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
TopoDS_Shape aShape = GetTopoShape(myShape) ;
CORBA::Double factor)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
TopoDS_Shape aShape = GetTopoShape(myShape) ;
GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeCompound( const GEOM::GEOM_Gen::ListOfIOR& ListShapes )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Compound C;
BRep_Builder aBuilder;
const GEOM::PointStruct& pstruct2)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeWire( const GEOM::GEOM_Gen::ListOfIOR& ListShapes )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
BRepBuilderAPI_MakeWire MW ;
TopoDS_Shape tds, Shape ;
double angle)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
TopoDS_Shape aShape = GetTopoShape(myShape) ;
GEOM::GEOM_Shape_ptr baseShape )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
TopoDS_Wire aWire ;
const GEOM::PointStruct& P2 )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
TopoDS_Shape aShape = GetTopoShape(myShape) ;
GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeCDG(GEOM::GEOM_Shape_ptr aShape)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
TopoDS_Shape shape = GetTopoShape(aShape) ;
CORBA::Double aMeshingDeflection)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result;
double cste = -1;
const GEOM::GEOM_Shape::ListOfSubShapeID& ListOfID )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result;
TopoDS_Shape tds ;
fill.Add(E);
}
for (int i = 1;i<=fill.NbContours();i++) {
- fill.SetRadius(radius,i);
+ fill.SetRadius(radius,i,i);
}
tds = fill.Shape();
}
}
for (int i = 1;i<=fill.NbContours();i++) {
- fill.SetRadius(radius,i);
+ fill.SetRadius(radius,i,i);
}
tds = fill.Shape();
}
const GEOM::GEOM_Shape::ListOfSubShapeID& ListOfID )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result;
TopoDS_Shape tds ;
CORBA::Boolean GEOM_Gen_i::CheckShape(GEOM::GEOM_Shape_ptr shape)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
TopoDS_Shape S = GetTopoShape(shape) ;
if( S.IsNull() ) {
THROW_SALOME_CORBA_EXCEPTION("Shape is null", SALOME::BAD_PARAM);
CORBA::Double delta1, CORBA::Double delta2, CORBA::Double delta3)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
CORBA::Double delta)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
TopoDS_Shape aShape = GetTopoShape(shape) ;
void GEOM_Gen_i::ExportIGES(const char* filename,GEOM::GEOM_Shape_ptr theShape)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
if (theShape->_is_nil())
{
THROW_SALOME_CORBA_EXCEPTION("Export IGES aborted", SALOME::BAD_PARAM);
void GEOM_Gen_i::ExportBREP(const char* filename,GEOM::GEOM_Shape_ptr theShape)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
if (theShape->_is_nil())
{
THROW_SALOME_CORBA_EXCEPTION("Export BRep aborted", SALOME::BAD_PARAM);
void GEOM_Gen_i::ExportSTEP(const char* filename,GEOM::GEOM_Shape_ptr theShape)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
if (theShape->_is_nil())
{
THROW_SALOME_CORBA_EXCEPTION("Export STEP aborted", SALOME::BAD_PARAM);
{
return _engine;
}
+
+//=======================================================================
+//function : getShape
+//purpose : return the TopoDS_Shape when client and servant are colocated, be careful
+//=======================================================================
+
+long GEOM_Shape_i::getShape() {
+ return((long)(&_geom));
+}
GEOM::GEOM_Shape::TMPFile* GetShapeStream();
GEOM::GEOM_Gen_ptr Engine();
+
+ long getShape();
};
#endif
needDisplay = true;
SALOMEDS::SObject_var obj = ActiveStudy->getStudyDocument()->FindObjectID(anIObject->getEntry());
if(!obj->_is_nil()) {
+ if (strcmp(obj->GetFatherComponent()->GetName(), "GEOM")) continue;
GEOM::GEOM_Shape_var aShape;
if(obj->FindAttribute(aTmpAttr, "AttributeIOR")) {
char *str = SALOMEDS::AttributeIOR::_narrow(aTmpAttr)->Value();
SALOMEDS::SObject_var obj = ActiveStudy->getStudyDocument()->FindObjectID(anIObject->getEntry());
if(!obj->_is_nil()) {
+ if (strcmp(obj->GetFatherComponent()->GetName(), "GEOM")) continue;
GEOM::GEOM_Shape_var aShape;
if(obj->FindAttribute(aTmpAttr, "AttributeIOR")) {
char *str = SALOMEDS::AttributeIOR::_narrow(aTmpAttr)->Value();
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);
#include <TopTools_ListOfShape.hxx>
+#include <unistd.h>
+
+#define HST_CLIENT_LEN 256
+
//=======================================================================
// function : Load()
// purpose :
//=======================================================================
-static TopoDS_Shape Load( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Shape_ptr aShape )
+TopoDS_Shape GEOM_Client::Load( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Shape_ptr aShape )
{
- TopoDS_Shape S;
- /* get sequence of bytes of resulting brep shape from GEOM server */
- GEOM::GEOM_Shape::TMPFile_var SeqFile = aShape->GetShapeStream();
- int sizebuf = SeqFile->length();
- char* buf;
- buf = (char*) &SeqFile[0];
- istrstream streamBrep(buf,sizebuf);
- BRep_Builder aBuilder;
- BRepTools::Read(S, streamBrep, aBuilder);
- return S;
+ char hst_client[HST_CLIENT_LEN];
+ gethostname(hst_client, HST_CLIENT_LEN);
+
+ Engines::Container_var ctn_server = geom->GetContainerRef();
+ long pid_server = ctn_server->getPID();
+
+ if ( (pid_client==pid_server) && (strcmp(hst_client, ctn_server->getHostName())==0) ) {
+ TopoDS_Shape* S = (TopoDS_Shape*)(aShape->getShape());
+ return(*S);
+ } else {
+ /* get sequence of bytes of resulting brep shape from GEOM server */
+ TopoDS_Shape S;
+ GEOM::GEOM_Shape::TMPFile_var SeqFile = aShape->GetShapeStream();
+ int sizebuf = SeqFile->length();
+ char* buf;
+ buf = (char*) &SeqFile[0];
+ istrstream streamBrep(buf,sizebuf);
+ BRep_Builder aBuilder;
+ BRepTools::Read(S, streamBrep, aBuilder);
+ return(S);
+ };
}
//=======================================================================
// function : Create()
-// purpose :
+// purpose : Create in client not in a container
//=======================================================================
GEOM_Client::GEOM_Client()
{
+ pid_client = (-1);
}
+//=======================================================================
+// function : Create()
+// purpose :
+//=======================================================================
+GEOM_Client::GEOM_Client(Engines::Container_ptr client)
+{
+ pid_client = client->getPID();
+}
//=======================================================================
// function : Find()
TopoDS_Shape GEOM_Client::GetShape( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Shape_ptr aShape )
{
-
+
TopoDS_Shape S;
TCollection_AsciiString IOR(aShape->Name());
Standard_Integer anIndex = Find(IOR, S);
// Methods PUBLIC
//
Standard_EXPORT GEOM_Client();
+ Standard_EXPORT GEOM_Client(Engines::Container_ptr client);
Standard_EXPORT Standard_Integer Find( const TCollection_AsciiString& ShapeIOR, TopoDS_Shape& S ) ;
Standard_EXPORT void Bind( const TCollection_AsciiString& ShapeIOR, const TopoDS_Shape& S ) ;
Standard_EXPORT TopoDS_Shape GetShape( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Shape_ptr aShape );
Standard_EXPORT void RemoveShapeFromBuffer( const TCollection_AsciiString& shapeIOR ) ;
Standard_EXPORT void ClearClientBuffer() ;
Standard_EXPORT unsigned int BufferLength() ;
+ TopoDS_Shape Load( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Shape_ptr aShape);
private:
// Fields PRIVATE
//
TColStd_SequenceOfAsciiString myIORs ;
TopTools_SequenceOfShape myShapes ;
+ long pid_client;
};
/* GetCurrentStudy */
int studyId = desktop->getActiveStudy()->getStudyId();
GeomGUI->myComponentGeom->GetCurrentStudy(studyId);
+
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_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 "
+
// Module : GEOM
// $Header$
-using namespace std;
#include "GeometryGUI.h"
// Open CASCADE Includes
#include "OCCViewer_Viewer3d.h"
#include "OCCViewer_ViewPort3d.h"
#include "VTKViewer_ViewFrame.h"
+#include "VTKViewer_InteractorStyleSALOME.h"
#include "SALOME_Selection.h"
+using namespace std;
+
/* The object itself created in the static method 'GetOrCreateGEOMBase()' */
static GEOMContext* GeomGUI = 0;
return false;
}
+static void UpdateVtkSelection(QAD_Desktop* parent)
+{
+ if (!parent->getActiveStudy()) return;
+
+ QList<QAD_StudyFrame> aFrameList = parent->getActiveStudy()->getStudyFrames();
+
+ for (QAD_StudyFrame* aStudyFrame = aFrameList.first(); aStudyFrame; aStudyFrame = aFrameList.next()) {
+ if (aStudyFrame->getTypeView() == VIEW_VTK) {
+ QAD_ViewFrame* aViewFrame = aStudyFrame->getRightFrame()->getViewFrame();
+ VTKViewer_ViewFrame* aVtkViewFrame = dynamic_cast<VTKViewer_ViewFrame*>(aViewFrame);
+ if (!aVtkViewFrame) continue;
+ VTKViewer_RenderWindowInteractor* anInteractor = aVtkViewFrame->getRWInteractor();
+ if (anInteractor) {
+ anInteractor->SetSelectionProp();
+ anInteractor->SetSelectionTolerance();
+ VTKViewer_InteractorStyleSALOME* aStyle = anInteractor->GetInteractorStyleSALOME();
+ if (aStyle) {
+ aStyle->setPreselectionProp();
+ }
+ }
+ }
+ }
+}
+
//=================================================================================
// function : SetSettings()
Mb->setItemEnabled(413, ViewOCC);// ShadingColor Settings
Mb->setItemEnabled(414, ViewOCC);// Isos Settings
+ // PAL5356: update VTK selection
+ ::UpdateVtkSelection(parent);
+
return true;
}
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();
GeomGUI->EmitSignalCloseAllDialogs();
GeomGUI = 0;
}
+
+ // PAL5356: update VTK selection
+ ::UpdateVtkSelection(parent);
+
return;
}
buffer[0] = (int)VIEW_OCC;
if (--bufferSize) buffer[1] = (int)VIEW_VTK;
}
+
+ void deactivate()
+ {
+ if ( GeomGUI )
+ GeomGUI->EmitSignalCloseAllDialogs();
+ }
}
{
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
break;
-
+
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
}
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 )) );
//=================================================================================
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
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()));
switch (constructorId)
{
//=================================================================================
void OperationGUI_ChamferDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QApplication::setOverrideCursor(Qt::waitCursor);
QAD_Application::getDesktop()->putInfo(tr(""));
myGeomBase->EraseSimulationShape();
//=================================================================================
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;
- }
-
- try {
- if(myD1 <= Precision::Confusion() || myD2 <= Precision::Confusion()) {
- QApplication::restoreOverrideCursor();
- return;
+ QApplication::setOverrideCursor( Qt::waitCursor );
+ TopoDS_Shape tds ;
+ try
+ {
+ 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"));
+ }
+ catch(Standard_Failure)
+ {
+ QAD_MessageBox::warn1 (QAD_Application::getDesktop(), tr("GEOM_WRN_WARNING"), tr("GEOM_CHAMFER_ABORT").arg(myD1).arg(myD2), tr("GEOM_BUT_OK"));
+ Group1->SpinBox_DX->SetValue(5.0);
+ Group1->SpinBox_DY->SetValue(5.0);
+ myGeomBase->EraseSimulationShape() ;
+ mySimulationTopoDs.Nullify() ;
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;
- }
QApplication::restoreOverrideCursor();
- return;
-
}
#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
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()));
switch (constructorId)
{
//=================================================================================
void OperationGUI_FilletDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QApplication::setOverrideCursor(Qt::waitCursor);
QAD_Application::getDesktop()->putInfo(tr(""));
myGeomBase->EraseSimulationShape();
//=================================================================================
void OperationGUI_FilletDlg::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;
- }
-
- try {
- if(myRadius <= Precision::Confusion()) {
- QApplication::restoreOverrideCursor();
- return;
- }
-
- 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::setOverrideCursor( Qt::waitCursor );
+ TopoDS_Shape tds ;
+ try
+ {
+ 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);
+ }
+ catch(Standard_Failure)
+ {
+ QAD_MessageBox::warn1 (QAD_Application::getDesktop(), tr("GEOM_WRN_WARNING"), tr("GEOM_FILLET_ABORT").arg(myRadius), tr("GEOM_BUT_OK"));
+ Group1->SpinBox_DX->SetValue(5.0);
+ myGeomBase->EraseSimulationShape() ;
+ mySimulationTopoDs.Nullify() ;
+ QApplication::restoreOverrideCursor();
+ return;
+ }
+ }
+ tds = fill.Shape();
+ break;
+ }
+ // case 1: /* Fillet edges */
+ // case 2: /* Fillet Faces */
+ }
+ if (!tds.IsNull())
+ {
+ mySimulationTopoDs = tds;
+ myGeomBase->DisplaySimulationShape( mySimulationTopoDs ) ;
+ }
+ }
+ catch(Standard_Failure)
+ {
+ QAD_MessageBox::warn1 (QAD_Application::getDesktop(), tr("GEOM_WRN_WARNING"), tr("GEOM_FILLET_ABORT").arg(myRadius), tr("GEOM_BUT_OK"));
+ Group1->SpinBox_DX->SetValue(5.0);
+ myGeomBase->EraseSimulationShape() ;
+ mySimulationTopoDs.Nullify() ;
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;
- }
QApplication::restoreOverrideCursor();
- return;
}
GroupPoints = new DlgRef_4Sel1List_QTD(this, "GroupPoints");
GroupPoints->GroupBox1->setTitle(tr("GEOM_PARTITION"));
+ GroupPoints->GroupBox2->setTitle(tr("SUPPRESS_RESULT"));
GroupPoints->TextLabel1->setText(tr("GEOM_OBJECTS"));
GroupPoints->TextLabel2->setText(tr("GEOM_TOOL_OBJECT"));
GroupPoints->TextLabel3->setText(tr("GEOM_RECONSTRUCTION_LIMIT"));
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;
//=================================================================================
void PrimitiveGUI_TorusDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
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;