mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-12-24 16:30:35 +05:00
Join modifications from V3_2_0_maintainance (V3_2_6pre4 - T32x_16Aug2007_16h00m)
This commit is contained in:
parent
6731d267fd
commit
156546ac91
@ -14,6 +14,7 @@
|
||||
|
||||
ORIG_DIR=`pwd`
|
||||
CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
|
||||
GEOM_WITH_GUI="yes"
|
||||
|
||||
########################################################################
|
||||
# Test if the KERNEL_ROOT_DIR is set correctly
|
||||
@ -28,16 +29,36 @@ fi
|
||||
# echo "failed : KERNEL_SRC variable is not correct !"
|
||||
# exit
|
||||
#fi
|
||||
|
||||
for option
|
||||
do
|
||||
case $option in
|
||||
-with-ihm | --with-ihm)
|
||||
GEOM_WITH_GUI="yes"
|
||||
break;;
|
||||
-without-ihm | --without-ihm | -with-ihm=no | --with-ihm=no)
|
||||
GEOM_WITH_GUI="no"
|
||||
break;;
|
||||
esac
|
||||
done
|
||||
|
||||
########################################################################
|
||||
# Test if the GUI_ROOT_DIR is set correctly
|
||||
if test ! -d "${GUI_ROOT_DIR}"; then
|
||||
echo "failed : GUI_ROOT_DIR variable is not correct !"
|
||||
exit
|
||||
if test ${GEOM_WITH_GUI} = yes; then
|
||||
if test ! -d "${GUI_ROOT_DIR}"; then
|
||||
echo "failed : GUI_ROOT_DIR variable is not correct !"
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
|
||||
cd ${CONF_DIR}
|
||||
ABS_CONF_DIR=`pwd`
|
||||
|
||||
#######################################################################
|
||||
# Update configure.ac script: to set NETGENPLUGIN_WITH_GUI variable
|
||||
sed -e s/GEOM_WITH_GUI=[a-z]*/GEOM_WITH_GUI=${GEOM_WITH_GUI}/g configure.ac > configure.tmp
|
||||
mv -f configure.tmp configure.ac
|
||||
|
||||
mkdir -p salome_adm/unix/config_files
|
||||
#cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files/* salome_adm/unix/config_files
|
||||
#cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/pythonbe.py salome_adm/unix
|
||||
@ -64,9 +85,14 @@ cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/SALOMEconfig.h.in salome_adm/unix
|
||||
# autom4te.cache (directory)
|
||||
echo "====================================================== aclocal"
|
||||
|
||||
aclocal -I adm_local/unix/config_files \
|
||||
-I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
|
||||
-I ${GUI_ROOT_DIR}/adm_local/unix/config_files || exit 1
|
||||
if test ${GEOM_WITH_GUI} = yes; then
|
||||
aclocal -I adm_local/unix/config_files \
|
||||
-I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
|
||||
-I ${GUI_ROOT_DIR}/adm_local/unix/config_files || exit 1
|
||||
else
|
||||
aclocal -I adm_local/unix/config_files \
|
||||
-I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files || exit 1
|
||||
fi
|
||||
|
||||
# ____________________________________________________________________
|
||||
# libtoolize creates some configuration files (ltmain.sh,
|
||||
|
91
configure.ac
91
configure.ac
@ -213,21 +213,6 @@ corba=make_$ORB
|
||||
CORBA=adm_local/unix/$corba
|
||||
|
||||
fi
|
||||
echo
|
||||
echo ---------------------------------------------
|
||||
echo testing openGL
|
||||
echo ---------------------------------------------
|
||||
echo
|
||||
|
||||
CHECK_OPENGL
|
||||
|
||||
echo
|
||||
echo ---------------------------------------------
|
||||
echo testing QT
|
||||
echo ---------------------------------------------
|
||||
echo
|
||||
|
||||
CHECK_QT
|
||||
|
||||
echo
|
||||
echo ---------------------------------------------
|
||||
@ -237,13 +222,56 @@ echo
|
||||
|
||||
CHECK_MSG2QM
|
||||
|
||||
echo
|
||||
echo ---------------------------------------------
|
||||
echo testing VTK
|
||||
echo ---------------------------------------------
|
||||
echo
|
||||
|
||||
CHECK_VTK
|
||||
GEOM_WITH_GUI=yes
|
||||
|
||||
AM_CONDITIONAL(GEOM_ENABLE_GUI, [test "${GEOM_WITH_GUI}" = "yes"])
|
||||
|
||||
if test "${GEOM_WITH_GUI}" = "yes"; then
|
||||
echo
|
||||
echo ---------------------------------------------
|
||||
echo testing openGL
|
||||
echo ---------------------------------------------
|
||||
echo
|
||||
|
||||
CHECK_OPENGL
|
||||
|
||||
echo
|
||||
echo ---------------------------------------------
|
||||
echo testing QT
|
||||
echo ---------------------------------------------
|
||||
echo
|
||||
|
||||
CHECK_QT
|
||||
|
||||
echo
|
||||
echo ---------------------------------------------
|
||||
echo testing VTK
|
||||
echo ---------------------------------------------
|
||||
echo
|
||||
|
||||
CHECK_VTK
|
||||
|
||||
echo
|
||||
echo ---------------------------------------------
|
||||
echo Testing GUI
|
||||
echo ---------------------------------------------
|
||||
echo
|
||||
|
||||
CHECK_SALOME_GUI
|
||||
|
||||
echo
|
||||
echo ---------------------------------------------
|
||||
echo Testing full GUI
|
||||
echo ---------------------------------------------
|
||||
echo
|
||||
|
||||
CHECK_CORBA_IN_GUI
|
||||
if test "x${CORBA_IN_GUI}" != "xyes"; then
|
||||
echo "failed : For configure GEOM module necessary full GUI !"
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
|
||||
echo
|
||||
echo ---------------------------------------------
|
||||
@ -277,26 +305,6 @@ echo
|
||||
|
||||
CHECK_HTML_GENERATORS
|
||||
|
||||
echo
|
||||
echo ---------------------------------------------
|
||||
echo Testing GUI
|
||||
echo ---------------------------------------------
|
||||
echo
|
||||
|
||||
CHECK_SALOME_GUI
|
||||
|
||||
echo
|
||||
echo ---------------------------------------------
|
||||
echo Testing full GUI
|
||||
echo ---------------------------------------------
|
||||
echo
|
||||
|
||||
CHECK_CORBA_IN_GUI
|
||||
if test "x${CORBA_IN_GUI}" != "xyes"; then
|
||||
echo "failed : For configure GEOM module necessary full GUI !"
|
||||
exit
|
||||
fi
|
||||
|
||||
echo
|
||||
echo ---------------------------------------------
|
||||
echo Testing Kernel
|
||||
@ -387,6 +395,7 @@ AC_OUTPUT([ \
|
||||
./src/GEOM_I/Makefile \
|
||||
./src/GEOM_I_Superv/Makefile \
|
||||
./src/GEOM_SWIG/Makefile \
|
||||
./src/GEOM_SWIG_WITHIHM/Makefile \
|
||||
./src/GenerationGUI/Makefile \
|
||||
./src/GroupGUI/Makefile \
|
||||
./src/IGESExport/Makefile \
|
||||
|
@ -896,7 +896,7 @@ module GEOM
|
||||
* \param theSeqSubBases - list of corresponding subshapes of section shapes.
|
||||
* \param theLocations - list of locations on the path corresponding
|
||||
* specified list of the Bases shapes. Number of locations
|
||||
* should be equal to number of bases or list of locations can be empty.
|
||||
* should be equal to number of bases.
|
||||
* \param thePath - Path shape to extrude the base shape along it.
|
||||
* \param theWithContact - the mode defining that the section is translated to be in
|
||||
* contact with the spine.
|
||||
@ -985,9 +985,10 @@ module GEOM
|
||||
* Replace coincident faces in theShape by one face.
|
||||
* \param theShape Initial shape.
|
||||
* \param theTolerance Maximum distance between faces, which can be considered as coincident.
|
||||
* \param doKeepNonSolids If FALSE, only solids will present in the result, otherwise all initial shapes.
|
||||
* \return New GEOM_Object, containing a copy of theShape without coincident faces.
|
||||
*/
|
||||
GEOM_Object MakeGlueFaces (in GEOM_Object theShape, in double theTolerance);
|
||||
GEOM_Object MakeGlueFaces (in GEOM_Object theShape, in double theTolerance, in boolean doKeepNonSolids);
|
||||
|
||||
/*!
|
||||
* Find coincident faces in theShape for possible gluing.
|
||||
@ -1003,10 +1004,11 @@ module GEOM
|
||||
* \param theShape Initial shape.
|
||||
* \param theTolerance Maximum distance between faces, which can be considered as coincident.
|
||||
* \param theFaces List of faces for gluing.
|
||||
* \param doKeepNonSolids If FALSE, only solids will present in the result, otherwise all initial shapes.
|
||||
* \return New GEOM_Object, containing a copy of theShape without some faces.
|
||||
*/
|
||||
GEOM_Object MakeGlueFacesByList (in GEOM_Object theShape, in double theTolerance,
|
||||
in ListOfGO theFaces);
|
||||
in ListOfGO theFaces, in boolean doKeepNonSolids);
|
||||
|
||||
/*!
|
||||
* Explode a shape on subshapes of a given type.
|
||||
@ -1309,7 +1311,7 @@ module GEOM
|
||||
in shape_state theState);
|
||||
|
||||
/*!
|
||||
* Get sub-shape(s) of theShapeWhere, which are
|
||||
* Get sub-shape(s) of \a theShapeWhere, which are
|
||||
* coincident with \a theShapeWhat or could be a part of it.
|
||||
* \param theShapeWhere Shape to find sub-shapes of.
|
||||
* \param theShapeWhat Shape, specifying what to find.
|
||||
@ -1318,6 +1320,23 @@ module GEOM
|
||||
GEOM_Object GetInPlace (in GEOM_Object theShapeWhere,
|
||||
in GEOM_Object theShapeWhat);
|
||||
|
||||
/*!
|
||||
* Get sub-shape(s) of \a theShapeWhere, which are
|
||||
* coincident with \a theShapeWhat or could be a part of it.
|
||||
*
|
||||
* Implementation of this method is based on a saved history of an operation,
|
||||
* produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
|
||||
* arguments (an argument shape or a sub-shape of an argument shape).
|
||||
* The operation could be the Partition or one of boolean operations,
|
||||
* performed on simple shapes (not on compounds).
|
||||
*
|
||||
* \param theShapeWhere Shape to find sub-shapes of.
|
||||
* \param theShapeWhat Shape, specifying what to find.
|
||||
* \return Group of all found sub-shapes or a single found sub-shape.
|
||||
*/
|
||||
GEOM_Object GetInPlaceByHistory (in GEOM_Object theShapeWhere,
|
||||
in GEOM_Object theShapeWhat);
|
||||
|
||||
/*!
|
||||
* Get sub-shape of theShapeWhere, which are
|
||||
* coincident with \a theShapeWhat that can either SOLID, FACE, EDGE or VERTEX.
|
||||
@ -1690,6 +1709,10 @@ module GEOM
|
||||
* \note Each compound from ListShapes and ListTools will be exploded in order
|
||||
* to avoid possible intersection between shapes from this compound.
|
||||
* \param theLimit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
|
||||
# \param KeepNonlimitShapes: if this parameter == 0 - only shapes with
|
||||
# type <= Limit are kept in the result,
|
||||
# else - shapes with type > Limit are kept
|
||||
# also (if they exist)
|
||||
*
|
||||
* After implementation new version of PartitionAlgo (October 2006)
|
||||
* other parameters are ignored by current functionality. They are kept
|
||||
@ -1710,7 +1733,8 @@ module GEOM
|
||||
in ListOfGO theRemoveInside,
|
||||
in short theLimit,
|
||||
in boolean theRemoveWebs,
|
||||
in ListOfLong theMaterials);
|
||||
in ListOfLong theMaterials,
|
||||
in short theKeepNonlimitShapes);
|
||||
|
||||
/*!
|
||||
* Perform partition operation.
|
||||
@ -1731,7 +1755,8 @@ module GEOM
|
||||
in ListOfGO theRemoveInside,
|
||||
in short theLimit,
|
||||
in boolean theRemoveWebs,
|
||||
in ListOfLong theMaterials);
|
||||
in ListOfLong theMaterials,
|
||||
in short theKeepNonlimitShapes);
|
||||
|
||||
/*!
|
||||
* Perform partition of the Shape with the Plane
|
||||
|
@ -198,7 +198,8 @@ module GEOM
|
||||
in GEOM_List theRemoveInside,
|
||||
in short theLimit,
|
||||
in boolean theRemoveWebs,
|
||||
in GEOM_List theMaterials) ;
|
||||
in GEOM_List theMaterials,
|
||||
in short theKeepNonlimitShapes);
|
||||
GEOM_Object MakeHalfPartition (in GEOM_Object theShape,
|
||||
in GEOM_Object thePlane) ;
|
||||
|
||||
@ -312,12 +313,14 @@ module GEOM
|
||||
GEOM_Object MakeSolidShells (in GEOM_List theShells) ;
|
||||
GEOM_Object MakeCompound (in GEOM_List theShapes) ;
|
||||
GEOM_Object MakeGlueFaces (in GEOM_Object theShape,
|
||||
in double theTolerance);
|
||||
in double theTolerance,
|
||||
in boolean doKeepNonSolids);
|
||||
GEOM_List GetGlueFaces (in GEOM_Object theShape,
|
||||
in double theTolerance);
|
||||
GEOM_Object MakeGlueFacesByList (in GEOM_Object theShape,
|
||||
in double theTolerance,
|
||||
in ListOfGO theFaces);
|
||||
in ListOfGO theFaces,
|
||||
in boolean doKeepNonSolids);
|
||||
GEOM_List MakeExplode (in GEOM_Object theShape,
|
||||
in long theShapeType,
|
||||
in boolean isSorted) ;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -17,7 +17,7 @@
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
//
|
||||
//
|
||||
@ -35,17 +35,10 @@
|
||||
|
||||
#include <qlabel.h>
|
||||
|
||||
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||
#include <GC_MakeArcOfCircle.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
#include "GEOMImpl_Types.hxx"
|
||||
|
||||
#include "utilities.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
//=================================================================================
|
||||
// class : BasicGUI_ArcDlg()
|
||||
// purpose : Constructs a BasicGUI_ArcDlg which is a child of 'parent', with the
|
||||
@ -58,9 +51,10 @@ BasicGUI_ArcDlg::BasicGUI_ArcDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
|
||||
: GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize |
|
||||
WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
|
||||
{
|
||||
QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_ARC")));
|
||||
QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_ARC_CENTER")));
|
||||
QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||
SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
|
||||
QPixmap image0(aResMgr->loadPixmap("GEOM",tr("ICON_DLG_ARC")));
|
||||
QPixmap image1(aResMgr->loadPixmap("GEOM",tr("ICON_DLG_ARC_CENTER")));
|
||||
QPixmap image2(aResMgr->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||
|
||||
setCaption(tr("GEOM_ARC_TITLE"));
|
||||
|
||||
@ -98,11 +92,12 @@ BasicGUI_ArcDlg::BasicGUI_ArcDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
|
||||
Group3Pnts2->PushButton1->setPixmap(image2);
|
||||
Group3Pnts2->PushButton2->setPixmap(image2);
|
||||
Group3Pnts2->PushButton3->setPixmap(image2);
|
||||
|
||||
|
||||
Group3Pnts2->radioButton4->setText(tr("GEOM_REVERSE"));
|
||||
|
||||
Layout1->addWidget( Group3Pnts, 2, 0 );
|
||||
Layout1->addWidget( Group3Pnts2, 2, 0 );
|
||||
/***************************************************************/
|
||||
|
||||
setHelpFileName("arc.htm");
|
||||
|
||||
@ -126,13 +121,7 @@ BasicGUI_ArcDlg::~BasicGUI_ArcDlg()
|
||||
void BasicGUI_ArcDlg::Init()
|
||||
{
|
||||
/* init variables */
|
||||
// myGeomGUI->SetState( 0 );
|
||||
globalSelection( GEOM_POINT );
|
||||
|
||||
myConstructorId = -1;
|
||||
myEditCurrentArgument = Group3Pnts->LineEdit1;
|
||||
myEditCurrentArgument->setFocus();
|
||||
|
||||
myPoint1 = myPoint2 = myPoint3 = GEOM::GEOM_Object::_nil();
|
||||
Group3Pnts2->radioButton4->setChecked(FALSE);
|
||||
|
||||
@ -140,9 +129,9 @@ void BasicGUI_ArcDlg::Init()
|
||||
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
|
||||
connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
|
||||
connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
|
||||
|
||||
|
||||
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
|
||||
|
||||
|
||||
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||
|
||||
@ -153,7 +142,7 @@ void BasicGUI_ArcDlg::Init()
|
||||
connect(Group3Pnts->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
connect(Group3Pnts->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
connect(Group3Pnts->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
|
||||
|
||||
connect(Group3Pnts2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
connect(Group3Pnts2->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
connect(Group3Pnts2->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
@ -161,19 +150,72 @@ void BasicGUI_ArcDlg::Init()
|
||||
connect(Group3Pnts2->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
connect(Group3Pnts2->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
connect(Group3Pnts2->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
|
||||
|
||||
connect(Group3Pnts2->radioButton4, SIGNAL(stateChanged(int)), this, SLOT(ReverseSense(int)));
|
||||
|
||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
|
||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
|
||||
initName( tr( "GEOM_ARC" ));
|
||||
|
||||
|
||||
initName( tr( "GEOM_ARC" ));
|
||||
ConstructorsClicked( 0 );
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ConstructorsClicked()
|
||||
// purpose : Radio button management
|
||||
//=================================================================================
|
||||
void BasicGUI_ArcDlg::ConstructorsClicked (int constructorId)
|
||||
{
|
||||
disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
|
||||
|
||||
switch (constructorId)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
globalSelection( GEOM_POINT );
|
||||
|
||||
Group3Pnts->show();
|
||||
resize(0, 0);
|
||||
Group3Pnts2->hide();
|
||||
|
||||
Group3Pnts->LineEdit1->setText(Group3Pnts2->LineEdit1->text());
|
||||
Group3Pnts->LineEdit2->setText(Group3Pnts2->LineEdit2->text());
|
||||
Group3Pnts->LineEdit3->setText(Group3Pnts2->LineEdit3->text());
|
||||
|
||||
myEditCurrentArgument = Group3Pnts->LineEdit1;
|
||||
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
globalSelection( GEOM_POINT );
|
||||
|
||||
Group3Pnts->hide();
|
||||
resize(0, 0);
|
||||
Group3Pnts2->show();
|
||||
|
||||
Group3Pnts2->LineEdit1->setText(Group3Pnts->LineEdit1->text());
|
||||
Group3Pnts2->LineEdit2->setText(Group3Pnts->LineEdit2->text());
|
||||
Group3Pnts2->LineEdit3->setText(Group3Pnts->LineEdit3->text());
|
||||
|
||||
myEditCurrentArgument = Group3Pnts2->LineEdit1;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
myEditCurrentArgument->setFocus();
|
||||
connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
|
||||
this, SLOT(SelectionIntoArgument()));
|
||||
|
||||
if (CORBA::is_nil(myPoint1))
|
||||
SelectionIntoArgument();
|
||||
|
||||
displayPreview();
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnOk()
|
||||
// purpose :
|
||||
@ -184,15 +226,6 @@ void BasicGUI_ArcDlg::ClickOnOk()
|
||||
ClickOnCancel();
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnCancel()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_ArcDlg::ClickOnCancel()
|
||||
{
|
||||
GEOMBase_Skeleton::ClickOnCancel();
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnApply()
|
||||
// purpose :
|
||||
@ -203,19 +236,6 @@ bool BasicGUI_ArcDlg::ClickOnApply()
|
||||
return false;
|
||||
|
||||
initName();
|
||||
|
||||
// reset
|
||||
myPoint1 = myPoint2 = myPoint3 = GEOM::GEOM_Object::_nil();
|
||||
Group3Pnts->LineEdit1->setText( "" );
|
||||
Group3Pnts->LineEdit2->setText( "" );
|
||||
Group3Pnts->LineEdit3->setText( "" );
|
||||
Group3Pnts2->LineEdit1->setText( "" );
|
||||
Group3Pnts2->LineEdit2->setText( "" );
|
||||
Group3Pnts2->LineEdit3->setText( "" );
|
||||
if (getConstructorId() == 0) myEditCurrentArgument = Group3Pnts->LineEdit1;
|
||||
if (getConstructorId() == 1) myEditCurrentArgument = Group3Pnts2->LineEdit1;
|
||||
|
||||
ConstructorsClicked( getConstructorId() );
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -228,21 +248,23 @@ void BasicGUI_ArcDlg::SelectionIntoArgument()
|
||||
{
|
||||
if ((getConstructorId() != 0) && (getConstructorId() != 1))
|
||||
return;
|
||||
|
||||
|
||||
myEditCurrentArgument->setText("");
|
||||
if ( IObjectCount() != 1 ){
|
||||
|
||||
if ( IObjectCount() != 1 )
|
||||
{
|
||||
switch (getConstructorId())
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) myPoint1 = GEOM::GEOM_Object::_nil();
|
||||
else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 ) myPoint2 = GEOM::GEOM_Object::_nil();
|
||||
else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 ) myPoint3 = GEOM::GEOM_Object::_nil();
|
||||
return;
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) myPoint1 = GEOM::GEOM_Object::_nil();
|
||||
else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 ) myPoint2 = GEOM::GEOM_Object::_nil();
|
||||
else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 ) myPoint3 = GEOM::GEOM_Object::_nil();
|
||||
return;
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
if ( myEditCurrentArgument == Group3Pnts2->LineEdit1 ) myPoint1 = GEOM::GEOM_Object::_nil();
|
||||
else if ( myEditCurrentArgument == Group3Pnts2->LineEdit2 ) myPoint2 = GEOM::GEOM_Object::_nil();
|
||||
else if ( myEditCurrentArgument == Group3Pnts2->LineEdit3 ) myPoint3 = GEOM::GEOM_Object::_nil();
|
||||
@ -250,7 +272,8 @@ void BasicGUI_ArcDlg::SelectionIntoArgument()
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// nbSel == 1
|
||||
Standard_Boolean aRes = Standard_False;
|
||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
|
||||
@ -281,6 +304,22 @@ void BasicGUI_ArcDlg::SelectionIntoArgument()
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : LineEditReturnPressed()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_ArcDlg::LineEditReturnPressed()
|
||||
{
|
||||
QLineEdit* send = (QLineEdit*)sender();
|
||||
if (send == Group3Pnts->LineEdit1 || send == Group3Pnts->LineEdit2 || send == Group3Pnts->LineEdit3 ||
|
||||
send == Group3Pnts2->LineEdit1 || send == Group3Pnts2->LineEdit2 || send == Group3Pnts2->LineEdit3)
|
||||
{
|
||||
myEditCurrentArgument = send;
|
||||
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : SetEditCurrentArgument()
|
||||
// purpose :
|
||||
@ -310,22 +349,6 @@ void BasicGUI_ArcDlg::SetEditCurrentArgument()
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : LineEditReturnPressed()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_ArcDlg::LineEditReturnPressed()
|
||||
{
|
||||
QLineEdit* send = (QLineEdit*)sender();
|
||||
if ( send == Group3Pnts->LineEdit1 || send == Group3Pnts->LineEdit2 || send == Group3Pnts->LineEdit3 ||
|
||||
send == Group3Pnts2->LineEdit1 || send == Group3Pnts2->LineEdit2 || send == Group3Pnts2->LineEdit3 )
|
||||
{
|
||||
myEditCurrentArgument = send;
|
||||
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ActivateThisDialog()
|
||||
// purpose :
|
||||
@ -333,33 +356,13 @@ void BasicGUI_ArcDlg::LineEditReturnPressed()
|
||||
void BasicGUI_ArcDlg::ActivateThisDialog()
|
||||
{
|
||||
GEOMBase_Skeleton::ActivateThisDialog();
|
||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
|
||||
|
||||
connect(myGeomGUI->getApp()->selectionMgr(),
|
||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
|
||||
// myGeomGUI->SetState( 0 );
|
||||
globalSelection( GEOM_POINT );
|
||||
|
||||
myEditCurrentArgument = Group3Pnts->LineEdit1;
|
||||
myEditCurrentArgument->setFocus();
|
||||
|
||||
Group3Pnts->LineEdit1->setText( "" );
|
||||
Group3Pnts->LineEdit2->setText( "" );
|
||||
Group3Pnts->LineEdit3->setText( "" );
|
||||
myPoint1 = myPoint2 = myPoint3 = GEOM::GEOM_Object::_nil();
|
||||
|
||||
ConstructorsClicked( getConstructorId() );
|
||||
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : DeactivateActiveDialog()
|
||||
// purpose : public slot to deactivate if active
|
||||
//=================================================================================
|
||||
void BasicGUI_ArcDlg::DeactivateActiveDialog()
|
||||
{
|
||||
// myGeomGUI->SetState( -1 );
|
||||
GEOMBase_Skeleton::DeactivateActiveDialog();
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : enterEvent()
|
||||
@ -367,10 +370,11 @@ void BasicGUI_ArcDlg::DeactivateActiveDialog()
|
||||
//=================================================================================
|
||||
void BasicGUI_ArcDlg::enterEvent(QEvent* e)
|
||||
{
|
||||
if ( !GroupConstructors->isEnabled() )
|
||||
if (!GroupConstructors->isEnabled())
|
||||
ActivateThisDialog();
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : createOperation
|
||||
// purpose :
|
||||
@ -410,73 +414,35 @@ bool BasicGUI_ArcDlg::execute( ObjectList& objects )
|
||||
|
||||
switch (getConstructorId())
|
||||
{
|
||||
case 0:
|
||||
case 0:
|
||||
{
|
||||
if ( !CORBA::is_nil(myPoint1) && !CORBA::is_nil(myPoint2) &&!CORBA::is_nil(myPoint3) )
|
||||
{
|
||||
if ( !CORBA::is_nil(myPoint1) && !CORBA::is_nil(myPoint2) &&!CORBA::is_nil(myPoint3) ){
|
||||
anObj = GEOM::GEOM_ICurvesOperations::_narrow(getOperation())->MakeArc(myPoint1, myPoint2, myPoint3);
|
||||
res = true;
|
||||
}
|
||||
break;
|
||||
anObj = GEOM::GEOM_ICurvesOperations::_narrow(getOperation())->
|
||||
MakeArc(myPoint1, myPoint2, myPoint3);
|
||||
res = true;
|
||||
}
|
||||
case 1:
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
bool Sense;
|
||||
(Group3Pnts2->radioButton4->isChecked()) ? Sense=true : Sense = false;
|
||||
if ( !CORBA::is_nil(myPoint1) && !CORBA::is_nil(myPoint2) &&!CORBA::is_nil(myPoint3) ){
|
||||
anObj = GEOM::GEOM_ICurvesOperations::_narrow(getOperation())->MakeArcCenter(myPoint1, myPoint2, myPoint3,Sense);
|
||||
res = true;
|
||||
}
|
||||
break;
|
||||
bool Sense;
|
||||
(Group3Pnts2->radioButton4->isChecked()) ? Sense = true : Sense = false;
|
||||
if ( !CORBA::is_nil(myPoint1) && !CORBA::is_nil(myPoint2) &&!CORBA::is_nil(myPoint3) )
|
||||
{
|
||||
anObj = GEOM::GEOM_ICurvesOperations::_narrow(getOperation())->
|
||||
MakeArcCenter(myPoint1, myPoint2, myPoint3, Sense);
|
||||
res = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( !anObj->_is_nil() ){
|
||||
if ( !anObj->_is_nil() )
|
||||
objects.push_back( anObj._retn() );
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : closeEvent
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_ArcDlg::closeEvent( QCloseEvent* e )
|
||||
{
|
||||
GEOMBase_Skeleton::closeEvent( e );
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : ConstructorsClicked()
|
||||
// purpose : Radio button management
|
||||
//=================================================================================
|
||||
void BasicGUI_ArcDlg::ConstructorsClicked( int constructorId )
|
||||
{
|
||||
|
||||
disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
|
||||
|
||||
switch (constructorId)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
Group3Pnts->show();
|
||||
resize(0, 0);
|
||||
Group3Pnts2->hide();
|
||||
|
||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
Group3Pnts->hide();
|
||||
resize(0, 0);
|
||||
Group3Pnts2->show();
|
||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
displayPreview();
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : ReverseSense()
|
||||
// purpose : Orientation of the arc
|
||||
|
@ -17,7 +17,7 @@
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
//
|
||||
//
|
||||
@ -28,7 +28,7 @@
|
||||
#ifndef DIALOGBOX_ARC_H
|
||||
#define DIALOGBOX_ARC_H
|
||||
|
||||
#include "GEOM_BasicGUI.hxx"
|
||||
#include "GEOM_BasicGUI.hxx"
|
||||
|
||||
#include "GEOMBase_Skeleton.h"
|
||||
#include "DlgRef_3Sel_QTD.h"
|
||||
@ -53,12 +53,10 @@ protected:
|
||||
virtual bool isValid( QString& );
|
||||
virtual bool execute( ObjectList& objects );
|
||||
|
||||
virtual void closeEvent( QCloseEvent* e );
|
||||
|
||||
private :
|
||||
private:
|
||||
void Init();
|
||||
void enterEvent(QEvent* e);
|
||||
int myConstructorId;
|
||||
|
||||
GEOM::GEOM_Object_var myPoint1, myPoint2, myPoint3;
|
||||
|
||||
DlgRef_3Sel_QTD* Group3Pnts;
|
||||
@ -66,12 +64,10 @@ private :
|
||||
|
||||
private slots:
|
||||
void ClickOnOk();
|
||||
void ClickOnCancel();
|
||||
bool ClickOnApply();
|
||||
|
||||
|
||||
void ActivateThisDialog();
|
||||
void DeactivateActiveDialog();
|
||||
void ConstructorsClicked( int );
|
||||
void ConstructorsClicked(int);
|
||||
void LineEditReturnPressed();
|
||||
void SelectionIntoArgument();
|
||||
void SetEditCurrentArgument();
|
||||
|
@ -125,7 +125,7 @@ void BasicGUI_CircleDlg::Init()
|
||||
double aStep = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
|
||||
|
||||
/* min, max, step and decimals for spin boxes & initial values */
|
||||
GroupPntVecR->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, 3);
|
||||
GroupPntVecR->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, DBL_DIGITS_DISPLAY);
|
||||
GroupPntVecR->SpinBox_DX->SetValue( 100 );
|
||||
|
||||
/* signals and slots connections */
|
||||
|
@ -114,8 +114,8 @@ void BasicGUI_EllipseDlg::Init()
|
||||
double aMajorR( 200. ), aMinorR( 100. );
|
||||
|
||||
/* min, max, step and decimals for spin boxes & initial values */
|
||||
GroupPoints->SpinBox_DX->RangeStepAndValidator( 0.001, COORD_MAX, step, 3 );
|
||||
GroupPoints->SpinBox_DY->RangeStepAndValidator( 0.001, COORD_MAX, step, 3 );
|
||||
GroupPoints->SpinBox_DX->RangeStepAndValidator( 0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY );
|
||||
GroupPoints->SpinBox_DY->RangeStepAndValidator( 0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY );
|
||||
GroupPoints->SpinBox_DX->SetValue( aMajorR );
|
||||
GroupPoints->SpinBox_DY->SetValue( aMinorR );
|
||||
|
||||
|
@ -176,7 +176,7 @@ void BasicGUI_MarkerDlg::Init()
|
||||
|
||||
for ( DataMap::iterator anIter = myData.begin(); anIter != myData.end(); ++anIter )
|
||||
{
|
||||
anIter.data()->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, 3 );
|
||||
anIter.data()->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY );
|
||||
connect( anIter.data(), SIGNAL( valueChanged( double ) ),
|
||||
this, SLOT( onValueChanged( double ) ) );
|
||||
}
|
||||
|
@ -138,11 +138,11 @@ void BasicGUI_PlaneDlg::Init()
|
||||
double aTrimSize = 2000.0;
|
||||
|
||||
/* min, max, step and decimals for spin boxes */
|
||||
GroupPntDir->SpinBox_DX->RangeStepAndValidator( 0.001, COORD_MAX, aStep, 3 );
|
||||
GroupPntDir->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, DBL_DIGITS_DISPLAY);
|
||||
GroupPntDir->SpinBox_DX->SetValue( aTrimSize );
|
||||
Group3Pnts->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, 3);
|
||||
Group3Pnts->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, DBL_DIGITS_DISPLAY);
|
||||
Group3Pnts->SpinBox_DX->SetValue( aTrimSize );
|
||||
GroupFace->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, 3);
|
||||
GroupFace->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, DBL_DIGITS_DISPLAY);
|
||||
GroupFace->SpinBox_DX->SetValue( aTrimSize );
|
||||
|
||||
/* signals and slots connections */
|
||||
|
@ -157,22 +157,22 @@ void BasicGUI_PointDlg::Init()
|
||||
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
|
||||
|
||||
/* min, max, step and decimals for spin boxes */
|
||||
GroupXYZ->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
||||
GroupXYZ->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
||||
GroupXYZ->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
||||
GroupXYZ->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
|
||||
GroupXYZ->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
|
||||
GroupXYZ->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
|
||||
GroupXYZ->SpinBox_DX->SetValue(0.0);
|
||||
GroupXYZ->SpinBox_DY->SetValue(0.0);
|
||||
GroupXYZ->SpinBox_DZ->SetValue(0.0);
|
||||
|
||||
GroupRefPoint->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
||||
GroupRefPoint->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
||||
GroupRefPoint->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
||||
GroupRefPoint->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
|
||||
GroupRefPoint->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
|
||||
GroupRefPoint->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
|
||||
GroupRefPoint->SpinBox_DX->SetValue(0.0);
|
||||
GroupRefPoint->SpinBox_DY->SetValue(0.0);
|
||||
GroupRefPoint->SpinBox_DZ->SetValue(0.0);
|
||||
|
||||
step = 0.1;
|
||||
GroupOnCurve->SpinBox_DX->RangeStepAndValidator(0., 1., step, 3);
|
||||
GroupOnCurve->SpinBox_DX->RangeStepAndValidator(0., 1., step, DBL_DIGITS_DISPLAY);
|
||||
GroupOnCurve->SpinBox_DX->SetValue( 0.5 );
|
||||
|
||||
/* signals and slots connections */
|
||||
|
@ -118,9 +118,9 @@ void BasicGUI_VectorDlg::Init()
|
||||
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
|
||||
|
||||
/* min, max, step and decimals for spin boxes */
|
||||
GroupDimensions->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
||||
GroupDimensions->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
||||
GroupDimensions->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
||||
GroupDimensions->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
|
||||
GroupDimensions->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
|
||||
GroupDimensions->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
|
||||
|
||||
double dx( 0. ), dy( 0. ), dz( 200. );
|
||||
GroupDimensions->SpinBox_DX->SetValue( dx );
|
||||
|
130
src/DlgRef/DlgRef_2Sel1List1Check_QTD.cxx
Normal file
130
src/DlgRef/DlgRef_2Sel1List1Check_QTD.cxx
Normal file
@ -0,0 +1,130 @@
|
||||
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
/****************************************************************************
|
||||
** Form implementation generated from reading ui file 'DlgRef_4Sel1List_QTD.ui'
|
||||
**
|
||||
** Created: lun oct 31 17:21:04 2006
|
||||
** by: The User Interface Compiler (uic)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
****************************************************************************/
|
||||
#include "DlgRef_2Sel1List1Check_QTD.h"
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qcombobox.h>
|
||||
#include <qgroupbox.h>
|
||||
#include <qlabel.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qlayout.h>
|
||||
#include <qtooltip.h>
|
||||
#include <qwhatsthis.h>
|
||||
#include <qradiobutton.h>
|
||||
|
||||
/*
|
||||
* Constructs a DlgRef_2Sel1List_QTD which is a child of 'parent', with the
|
||||
* name 'name' and widget flags set to 'f'.
|
||||
*/
|
||||
DlgRef_2Sel1List1Check_QTD::DlgRef_2Sel1List1Check_QTD( QWidget* parent,
|
||||
const char* name,
|
||||
WFlags fl )
|
||||
: QWidget( parent, name, fl )
|
||||
{
|
||||
if ( !name )
|
||||
setName( "DlgRef_2Sel1List1Check_QTD" );
|
||||
resize( 129, 175 );
|
||||
setCaption( trUtf8( "DlgRef_2Sel1List1Check_QTD" ) );
|
||||
DlgRef_2Sel1List1Check_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_2Sel1List1Check_QTDLayout");
|
||||
|
||||
GroupBox1 = new QGroupBox( this, "GroupBox1" );
|
||||
GroupBox1->setTitle( trUtf8( "" ) );
|
||||
GroupBox1->setColumnLayout(0, Qt::Vertical );
|
||||
GroupBox1->layout()->setSpacing( 6 );
|
||||
GroupBox1->layout()->setMargin( 11 );
|
||||
GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
|
||||
GroupBox1Layout->setAlignment( Qt::AlignTop );
|
||||
|
||||
Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
|
||||
|
||||
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( 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" );
|
||||
|
||||
Layout1->addWidget( LineEdit1, 0, 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 );
|
||||
|
||||
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" );
|
||||
|
||||
Layout1->addWidget( LineEdit2, 1, 2 );
|
||||
|
||||
|
||||
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() ) );
|
||||
|
||||
Layout1->addWidget( ComboBox1, 2, 2 );
|
||||
|
||||
radioButton4 = new QRadioButton( GroupBox1, "radioButton4" );
|
||||
GroupBox1Layout->addMultiCellWidget( radioButton4, 3, 3, 0, 1 );
|
||||
|
||||
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||
|
||||
DlgRef_2Sel1List1Check_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||
|
||||
QSpacerItem* spacer = new QSpacerItem( 0, 80, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||
Layout1->addItem( spacer, 5, 2 );
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Destroys the object and frees any allocated resources
|
||||
*/
|
||||
DlgRef_2Sel1List1Check_QTD::~DlgRef_2Sel1List1Check_QTD()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
69
src/DlgRef/DlgRef_2Sel1List1Check_QTD.h
Normal file
69
src/DlgRef/DlgRef_2Sel1List1Check_QTD.h
Normal file
@ -0,0 +1,69 @@
|
||||
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
/****************************************************************************
|
||||
** Form interface generated from reading ui file 'DlgRef_2Sel1List_QTD.ui'
|
||||
**
|
||||
** Created: lun oct 31 17:21:03 2006
|
||||
** by: The User Interface Compiler (uic)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
****************************************************************************/
|
||||
#ifndef DLGREF_2SEL1LIST_QTD_H
|
||||
#define DLGREF_2SEL1LIST_QTD_H
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qwidget.h>
|
||||
class QVBoxLayout;
|
||||
class QHBoxLayout;
|
||||
class QGridLayout;
|
||||
class QComboBox;
|
||||
class QGroupBox;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QPushButton;
|
||||
class QRadioButton;
|
||||
|
||||
class DlgRef_2Sel1List1Check_QTD : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgRef_2Sel1List1Check_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||
~DlgRef_2Sel1List1Check_QTD();
|
||||
|
||||
QGroupBox* GroupBox1;
|
||||
QLineEdit* LineEdit2;
|
||||
QPushButton* PushButton1;
|
||||
QPushButton* PushButton2;
|
||||
QLabel* TextLabel1;
|
||||
QLineEdit* LineEdit1;
|
||||
QLabel* TextLabel2;
|
||||
QComboBox* ComboBox1;
|
||||
QLabel* TextLabel3;
|
||||
QRadioButton* radioButton4;
|
||||
|
||||
|
||||
protected:
|
||||
QGridLayout* DlgRef_2Sel1List1Check_QTDLayout;
|
||||
QGridLayout* GroupBox1Layout;
|
||||
QGridLayout* Layout1;
|
||||
};
|
||||
|
||||
#endif // DLGREF_2SEL1LIST1CHECK_QTD_H
|
@ -20,7 +20,7 @@
|
||||
/****************************************************************************
|
||||
** Form implementation generated from reading ui file 'DlgRef_Skeleton_QTD.ui'
|
||||
**
|
||||
** Created: Fri Mar 17 11:18:06 2006
|
||||
** Created: Tue Mar 13 14:40:34 2007
|
||||
** by: The User Interface Compiler ($Id$)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
@ -57,11 +57,6 @@ DlgRef_Skeleton_QTD::DlgRef_Skeleton_QTD( QWidget* parent, const char* name, boo
|
||||
|
||||
Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
|
||||
|
||||
GroupMedium = new QGroupBox( this, "GroupMedium" );
|
||||
GroupMedium->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupMedium->sizePolicy().hasHeightForWidth() ) );
|
||||
|
||||
Layout1->addWidget( GroupMedium, 2, 0 );
|
||||
|
||||
GroupButtons = new QGroupBox( this, "GroupButtons" );
|
||||
GroupButtons->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, GroupButtons->sizePolicy().hasHeightForWidth() ) );
|
||||
GroupButtons->setColumnLayout(0, Qt::Vertical );
|
||||
@ -155,19 +150,5 @@ DlgRef_Skeleton_QTD::~DlgRef_Skeleton_QTD()
|
||||
*/
|
||||
void DlgRef_Skeleton_QTD::languageChange()
|
||||
{
|
||||
setCaption( tr( "DlgRef_Skeleton_QTD" ) );
|
||||
GroupMedium->setTitle( QString::null );
|
||||
GroupButtons->setTitle( QString::null );
|
||||
buttonOk->setText( tr( "&Ok" ) );
|
||||
buttonApply->setText( tr( "&Apply" ) );
|
||||
buttonCancel->setText( tr( "&Cancel" ) );
|
||||
buttonHelp->setText( tr( "&Help" ) );
|
||||
GroupConstructors->setTitle( QString::null );
|
||||
RadioButton1->setText( QString::null );
|
||||
RadioButton2->setText( QString::null );
|
||||
RadioButton3->setText( QString::null );
|
||||
RadioButton4->setText( QString::null );
|
||||
GroupBoxName->setTitle( tr( "Result name" ) );
|
||||
NameLabel->setText( tr( "Name" ) );
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
/****************************************************************************
|
||||
** Form interface generated from reading ui file 'DlgRef_Skeleton_QTD.ui'
|
||||
**
|
||||
** Created: Fri Mar 17 11:18:06 2006
|
||||
** Created: Tue Mar 13 14:40:29 2007
|
||||
** by: The User Interface Compiler ($Id$)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
@ -53,7 +53,6 @@ public:
|
||||
DlgRef_Skeleton_QTD( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
|
||||
~DlgRef_Skeleton_QTD();
|
||||
|
||||
QGroupBox* GroupMedium;
|
||||
QGroupBox* GroupButtons;
|
||||
QPushButton* buttonOk;
|
||||
QPushButton* buttonApply;
|
||||
|
@ -102,3 +102,28 @@ void DlgRef_SpinBox::RangeStepAndValidator(double min, double max,double step,
|
||||
setLineStep(step);
|
||||
((QDoubleValidator*)validator())->setRange(min, max, decimals);
|
||||
}
|
||||
|
||||
QString DlgRef_SpinBox::PrintDoubleValue (double theValue, int thePrecision)
|
||||
{
|
||||
QString aRes;
|
||||
aRes.setNum(theValue, 'g', thePrecision);
|
||||
|
||||
// remove trailing zeroes
|
||||
QString delim( "." );
|
||||
|
||||
int idx = aRes.findRev( delim );
|
||||
if ( idx == -1 )
|
||||
return aRes;
|
||||
|
||||
QString iPart = aRes.left( idx );
|
||||
QString fPart = aRes.mid( idx + 1 );
|
||||
|
||||
while ( !fPart.isEmpty() && fPart.at( fPart.length() - 1 ) == '0' )
|
||||
fPart.remove( fPart.length() - 1, 1 );
|
||||
|
||||
aRes = iPart;
|
||||
if ( !fPart.isEmpty() )
|
||||
aRes += delim + fPart;
|
||||
|
||||
return aRes;
|
||||
}
|
||||
|
@ -36,6 +36,7 @@
|
||||
#define COORD_MIN -1e+15
|
||||
#define COORD_MAX +1e+15
|
||||
#define MAX_NUMBER 100000
|
||||
#define DBL_DIGITS_DISPLAY 16
|
||||
|
||||
//=================================================================================
|
||||
// class : DlgRef_SpinBox
|
||||
@ -54,10 +55,11 @@ public :
|
||||
void SetValue(double v);
|
||||
double GetValue();
|
||||
QString GetString();
|
||||
|
||||
static QString PrintDoubleValue (double theValue, int Precision = DBL_DIGITS_DISPLAY);
|
||||
|
||||
public slots:
|
||||
void SetStep(double newStep);
|
||||
|
||||
};
|
||||
|
||||
#endif // GEOMSPINBOX_H
|
||||
|
@ -56,6 +56,7 @@ dist_libDlgRef_la_SOURCES = \
|
||||
DlgRef_3Sel4Spin2Check_QTD.cxx \
|
||||
DlgRef_4Sel1List_QTD.cxx \
|
||||
DlgRef_2Sel1List_QTD.cxx \
|
||||
DlgRef_2Sel1List1Check_QTD.cxx \
|
||||
DlgRef_1List1Spin1Btn_QTD.cxx \
|
||||
DlgRef_4Sel1List1Check_QTD.cxx \
|
||||
DlgRef_1Spin_QTD.cxx \
|
||||
@ -112,6 +113,7 @@ MOC_FILES = \
|
||||
DlgRef_3Sel4Spin2Check_QTD_moc.cxx \
|
||||
DlgRef_4Sel1List_QTD_moc.cxx \
|
||||
DlgRef_2Sel1List_QTD_moc.cxx \
|
||||
DlgRef_2Sel1List1Check_QTD_moc.cxx \
|
||||
DlgRef_1List1Spin1Btn_QTD_moc.cxx \
|
||||
DlgRef_4Sel1List1Check_QTD_moc.cxx \
|
||||
DlgRef_1Spin_QTD_moc.cxx \
|
||||
@ -170,6 +172,7 @@ salomeinclude_HEADERS = \
|
||||
DlgRef_3Sel4Spin2Check_QTD.h \
|
||||
DlgRef_4Sel1List_QTD.h \
|
||||
DlgRef_2Sel1List_QTD.h \
|
||||
DlgRef_2Sel1List1Check_QTD.h \
|
||||
DlgRef_1List1Spin1Btn_QTD.h \
|
||||
DlgRef_4Sel1List1Check_QTD.h \
|
||||
DlgRef_1Spin_QTD.h \
|
||||
|
@ -20,9 +20,6 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="caption">
|
||||
<string>DlgRef_Skeleton_QTD</string>
|
||||
</property>
|
||||
<property name="sizeGripEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
@ -50,22 +47,6 @@
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<widget class="QGroupBox" row="2" column="0">
|
||||
<property name="name">
|
||||
<cstring>GroupMedium</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>7</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QGroupBox" row="3" column="0">
|
||||
<property name="name">
|
||||
<cstring>GroupButtons</cstring>
|
||||
@ -78,9 +59,6 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string></string>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
@ -109,17 +87,11 @@
|
||||
<property name="name">
|
||||
<cstring>buttonOk</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Ok</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>buttonApply</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Apply</string>
|
||||
</property>
|
||||
</widget>
|
||||
<spacer>
|
||||
<property name="name">
|
||||
@ -142,17 +114,11 @@
|
||||
<property name="name">
|
||||
<cstring>buttonCancel</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>buttonHelp</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Help</string>
|
||||
</property>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
@ -170,9 +136,6 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string></string>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
@ -201,33 +164,21 @@
|
||||
<property name="name">
|
||||
<cstring>RadioButton1</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton">
|
||||
<property name="name">
|
||||
<cstring>RadioButton2</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton">
|
||||
<property name="name">
|
||||
<cstring>RadioButton3</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton">
|
||||
<property name="name">
|
||||
<cstring>RadioButton4</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string></string>
|
||||
</property>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
@ -237,9 +188,6 @@
|
||||
<property name="name">
|
||||
<cstring>GroupBoxName</cstring>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Result name</string>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
@ -273,9 +221,6 @@
|
||||
<property name="name">
|
||||
<cstring>NameLabel</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
|
@ -20,7 +20,7 @@
|
||||
/****************************************************************************
|
||||
** Form implementation generated from reading ui file 'EntityGUI_Skeleton_QTD.ui'
|
||||
**
|
||||
** Created: Fri Mar 17 15:47:14 2006
|
||||
** Created: Tue Mar 13 14:04:48 2007
|
||||
** by: The User Interface Compiler ($Id$)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
@ -30,9 +30,9 @@
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qgroupbox.h>
|
||||
#include <qbuttongroup.h>
|
||||
#include <qradiobutton.h>
|
||||
#include <qgroupbox.h>
|
||||
#include <qlayout.h>
|
||||
#include <qtooltip.h>
|
||||
#include <qwhatsthis.h>
|
||||
@ -54,11 +54,6 @@ EntityGUI_Skeleton_QTD::EntityGUI_Skeleton_QTD( QWidget* parent, const char* nam
|
||||
|
||||
Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
|
||||
|
||||
GroupVal = new QGroupBox( this, "GroupVal" );
|
||||
GroupVal->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupVal->sizePolicy().hasHeightForWidth() ) );
|
||||
|
||||
Layout1->addWidget( GroupVal, 2, 0 );
|
||||
|
||||
GroupConstructors = new QButtonGroup( this, "GroupConstructors" );
|
||||
GroupConstructors->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, GroupConstructors->sizePolicy().hasHeightForWidth() ) );
|
||||
GroupConstructors->setColumnLayout(0, Qt::Vertical );
|
||||
@ -111,26 +106,6 @@ EntityGUI_Skeleton_QTD::EntityGUI_Skeleton_QTD( QWidget* parent, const char* nam
|
||||
|
||||
Layout5->addMultiCellWidget( GroupDest1, 0, 0, 0, 1 );
|
||||
|
||||
GroupDest2 = new QButtonGroup( GroupDest, "GroupDest2" );
|
||||
GroupDest2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupDest2->sizePolicy().hasHeightForWidth() ) );
|
||||
GroupDest2->setColumnLayout(0, Qt::Vertical );
|
||||
GroupDest2->layout()->setSpacing( 6 );
|
||||
GroupDest2->layout()->setMargin( 11 );
|
||||
GroupDest2Layout = new QGridLayout( GroupDest2->layout() );
|
||||
GroupDest2Layout->setAlignment( Qt::AlignTop );
|
||||
|
||||
Layout5->addWidget( GroupDest2, 1, 0 );
|
||||
|
||||
GroupDest3 = new QButtonGroup( GroupDest, "GroupDest3" );
|
||||
GroupDest3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupDest3->sizePolicy().hasHeightForWidth() ) );
|
||||
GroupDest3->setColumnLayout(0, Qt::Vertical );
|
||||
GroupDest3->layout()->setSpacing( 6 );
|
||||
GroupDest3->layout()->setMargin( 11 );
|
||||
GroupDest3Layout = new QGridLayout( GroupDest3->layout() );
|
||||
GroupDest3Layout->setAlignment( Qt::AlignTop );
|
||||
|
||||
Layout5->addWidget( GroupDest3, 1, 1 );
|
||||
|
||||
GroupDestLayout->addLayout( Layout5, 0, 0 );
|
||||
|
||||
Layout1->addWidget( GroupDest, 1, 0 );
|
||||
@ -190,21 +165,5 @@ EntityGUI_Skeleton_QTD::~EntityGUI_Skeleton_QTD()
|
||||
*/
|
||||
void EntityGUI_Skeleton_QTD::languageChange()
|
||||
{
|
||||
setCaption( tr( "EntityGUI_Skeleton_QTD" ) );
|
||||
GroupVal->setTitle( QString::null );
|
||||
GroupConstructors->setTitle( tr( "Element Type" ) );
|
||||
RadioButton1->setText( tr( "Segment" ) );
|
||||
RadioButton2->setText( tr( "Arc" ) );
|
||||
GroupDest->setTitle( tr( "Destination" ) );
|
||||
GroupDest1->setTitle( tr( "Type" ) );
|
||||
RB_Dest2->setText( tr( "Direction" ) );
|
||||
RB_Dest1->setText( tr( "Point" ) );
|
||||
GroupDest2->setTitle( QString::null );
|
||||
GroupDest3->setTitle( QString::null );
|
||||
GroupButtons->setTitle( QString::null );
|
||||
buttonEnd->setText( tr( "End Sketch" ) );
|
||||
buttonClose->setText( tr( "Close Sketch" ) );
|
||||
buttonCancel->setText( tr( "&Cancel" ) );
|
||||
buttonHelp->setText( tr( "&Help" ) );
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
/****************************************************************************
|
||||
** Form interface generated from reading ui file 'EntityGUI_Skeleton_QTD.ui'
|
||||
**
|
||||
** Created: Fri Mar 17 15:47:13 2006
|
||||
** Created: Tue Mar 13 14:04:42 2007
|
||||
** by: The User Interface Compiler ($Id$)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
@ -38,9 +38,9 @@ class QVBoxLayout;
|
||||
class QHBoxLayout;
|
||||
class QGridLayout;
|
||||
class QSpacerItem;
|
||||
class QGroupBox;
|
||||
class QButtonGroup;
|
||||
class QRadioButton;
|
||||
class QGroupBox;
|
||||
class QPushButton;
|
||||
|
||||
class GEOM_ENTITYGUI_EXPORT EntityGUI_Skeleton_QTD : public QDialog
|
||||
@ -51,7 +51,6 @@ public:
|
||||
EntityGUI_Skeleton_QTD( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
|
||||
~EntityGUI_Skeleton_QTD();
|
||||
|
||||
QGroupBox* GroupVal;
|
||||
QButtonGroup* GroupConstructors;
|
||||
QRadioButton* RadioButton1;
|
||||
QRadioButton* RadioButton2;
|
||||
@ -59,8 +58,6 @@ public:
|
||||
QButtonGroup* GroupDest1;
|
||||
QRadioButton* RB_Dest2;
|
||||
QRadioButton* RB_Dest1;
|
||||
QButtonGroup* GroupDest2;
|
||||
QButtonGroup* GroupDest3;
|
||||
QGroupBox* GroupButtons;
|
||||
QPushButton* buttonEnd;
|
||||
QPushButton* buttonClose;
|
||||
@ -76,8 +73,6 @@ protected:
|
||||
QGridLayout* Layout5;
|
||||
QGridLayout* GroupDest1Layout;
|
||||
QGridLayout* Layout4;
|
||||
QGridLayout* GroupDest2Layout;
|
||||
QGridLayout* GroupDest3Layout;
|
||||
QHBoxLayout* GroupButtonsLayout;
|
||||
QHBoxLayout* Layout3;
|
||||
QSpacerItem* Spacer1;
|
||||
|
@ -82,10 +82,6 @@ EntityGUI_SketcherDlg::EntityGUI_SketcherDlg(GeometryGUI* GUI, QWidget* parent,
|
||||
buttonClose->setText(tr("GEOM_BUT_CLOSE_SKETCH"));
|
||||
buttonHelp->setText(tr("GEOM_BUT_HELP"));
|
||||
|
||||
GroupVal->close(TRUE);
|
||||
GroupDest2->close(TRUE);
|
||||
GroupDest3->close(TRUE);
|
||||
|
||||
QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||
QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_UNDO")));
|
||||
QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_REDO")));
|
||||
@ -253,7 +249,6 @@ EntityGUI_SketcherDlg::EntityGUI_SketcherDlg(GeometryGUI* GUI, QWidget* parent,
|
||||
Init();
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ~EntityGUI_SketcherDlg()
|
||||
// purpose : Destroys the object and frees any allocated resources
|
||||
@ -263,7 +258,6 @@ EntityGUI_SketcherDlg::~EntityGUI_SketcherDlg()
|
||||
myGeometryGUI->SetActiveDialogBox( 0 );
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : eventFilter()
|
||||
// purpose : event filter for spin-boxes to provide Apply action on Return pressed
|
||||
@ -295,6 +289,16 @@ bool EntityGUI_SketcherDlg::eventFilter (QObject* object, QEvent* event)
|
||||
}
|
||||
}
|
||||
|
||||
if (event->type() == QEvent::KeyRelease) {
|
||||
// NPAL16010 (Sketcher Apply non available if only one line is modified)
|
||||
// To have Apply active as soon as value text changed
|
||||
QString s = ((QtxDblSpinBox*) object)->text();
|
||||
bool ok;
|
||||
double newVal = s.toDouble( &ok );
|
||||
if ( ok )
|
||||
ValueChangedInSpinBox( newVal );
|
||||
}
|
||||
|
||||
return EntityGUI_Skeleton_QTD::eventFilter(object, event);
|
||||
}
|
||||
|
||||
@ -324,16 +328,16 @@ void EntityGUI_SketcherDlg::Init()
|
||||
double step = SUIT_Session::session()->resourceMgr()->doubleValue( "Geometry", "SettingsGeomStep", 100.0 );
|
||||
|
||||
/* min, max, step and decimals for spin boxes */
|
||||
Group1Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
||||
Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
||||
Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
||||
Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
||||
Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
||||
Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
||||
Group4Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, 3);
|
||||
Group4Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, 3);
|
||||
Group4Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
||||
Group4Spin->SpinBox_DS->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3);
|
||||
Group1Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
|
||||
Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
|
||||
Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
|
||||
Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
|
||||
Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
|
||||
Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
|
||||
Group4Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, DBL_DIGITS_DISPLAY);
|
||||
Group4Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, DBL_DIGITS_DISPLAY);
|
||||
Group4Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
|
||||
Group4Spin->SpinBox_DS->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., DBL_DIGITS_DISPLAY);
|
||||
|
||||
/* displays Dialog */
|
||||
GroupConstructors->setEnabled(false);
|
||||
@ -434,8 +438,8 @@ void EntityGUI_SketcherDlg::PointClicked(int constructorId)
|
||||
if ( constructorId == 1 )
|
||||
{ // XY
|
||||
mySketchType = PT_ABS;
|
||||
Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
||||
Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
||||
Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
|
||||
Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
|
||||
Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_X2"));
|
||||
Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_Y2"));
|
||||
myX = 0.0;
|
||||
@ -450,8 +454,8 @@ void EntityGUI_SketcherDlg::PointClicked(int constructorId)
|
||||
else if ( constructorId == 0 )
|
||||
{ // DXDY
|
||||
mySketchType = PT_RELATIVE;
|
||||
Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
||||
Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
||||
Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
|
||||
Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
|
||||
Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_DX2"));
|
||||
Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_DY2"));
|
||||
myDX = 0.0;
|
||||
@ -508,8 +512,8 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId)
|
||||
myLength = 100.0;
|
||||
if ( myConstructorDirId == 2 )
|
||||
{ // Angle
|
||||
Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3);
|
||||
Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
||||
Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., DBL_DIGITS_DISPLAY);
|
||||
Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
|
||||
Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_ANGLE2"));
|
||||
Group2Spin->SpinBox_DX->SetValue(myAngle);
|
||||
Group2Spin->buttonApply->setFocus();
|
||||
@ -584,9 +588,9 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId)
|
||||
}
|
||||
else if ( myConstructorDirId == 3 )
|
||||
{ // DXDY
|
||||
Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, 3);
|
||||
Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, 3);
|
||||
Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
||||
Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, DBL_DIGITS_DISPLAY);
|
||||
Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, DBL_DIGITS_DISPLAY);
|
||||
Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
|
||||
Group3Spin->TextLabel1->setText(tr("GEOM_SKETCHER_VX2"));
|
||||
Group3Spin->TextLabel2->setText(tr("GEOM_SKETCHER_VY2"));
|
||||
myDX = 0.0;
|
||||
@ -622,54 +626,54 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId)
|
||||
{ // Angle
|
||||
if ( constructorId == 2 )
|
||||
{ // Length
|
||||
mySketchType = DIR_ANGLE_LENGTH;
|
||||
Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3);
|
||||
Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
||||
Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3);
|
||||
Group3Spin->TextLabel1->setText(tr("GEOM_SKETCHER_ANGLE2"));
|
||||
Group3Spin->TextLabel2->setText(tr("GEOM_SKETCHER_RADIUS2"));
|
||||
Group3Spin->TextLabel3->setText(tr("GEOM_SKETCHER_ANGLE2"));
|
||||
Group3Spin->SpinBox_DX->SetValue(myAngle);
|
||||
myRadius = 100.0;
|
||||
Group3Spin->SpinBox_DY->SetValue(myRadius);
|
||||
myLength = 30.0;
|
||||
Group3Spin->SpinBox_DZ->SetValue(myLength);
|
||||
Group3Spin->show();
|
||||
Group3Spin->buttonApply->setFocus();
|
||||
mySketchType = DIR_ANGLE_LENGTH;
|
||||
Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., DBL_DIGITS_DISPLAY);
|
||||
Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
|
||||
Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., DBL_DIGITS_DISPLAY);
|
||||
Group3Spin->TextLabel1->setText(tr("GEOM_SKETCHER_ANGLE2"));
|
||||
Group3Spin->TextLabel2->setText(tr("GEOM_SKETCHER_RADIUS2"));
|
||||
Group3Spin->TextLabel3->setText(tr("GEOM_SKETCHER_ANGLE2"));
|
||||
Group3Spin->SpinBox_DX->SetValue(myAngle);
|
||||
myRadius = 100.0;
|
||||
Group3Spin->SpinBox_DY->SetValue(myRadius);
|
||||
myLength = 30.0;
|
||||
Group3Spin->SpinBox_DZ->SetValue(myLength);
|
||||
Group3Spin->show();
|
||||
Group3Spin->buttonApply->setFocus();
|
||||
}
|
||||
}
|
||||
else if ( myConstructorDirId == 0 )
|
||||
{ // Perpendicular
|
||||
if ( constructorId == 2 )
|
||||
{ // Length
|
||||
mySketchType = DIR_PER_LENGTH;
|
||||
Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
||||
Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3);
|
||||
Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_RADIUS2"));
|
||||
Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_ANGLE2"));
|
||||
myRadius = 100.0;
|
||||
Group2Spin->SpinBox_DX->SetValue(myRadius);
|
||||
myLength = 30.0;
|
||||
Group2Spin->SpinBox_DY->SetValue(myLength);
|
||||
Group2Spin->show();
|
||||
Group2Spin->buttonApply->setFocus();
|
||||
mySketchType = DIR_PER_LENGTH;
|
||||
Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
|
||||
Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., DBL_DIGITS_DISPLAY);
|
||||
Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_RADIUS2"));
|
||||
Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_ANGLE2"));
|
||||
myRadius = 100.0;
|
||||
Group2Spin->SpinBox_DX->SetValue(myRadius);
|
||||
myLength = 30.0;
|
||||
Group2Spin->SpinBox_DY->SetValue(myLength);
|
||||
Group2Spin->show();
|
||||
Group2Spin->buttonApply->setFocus();
|
||||
}
|
||||
}
|
||||
else if ( myConstructorDirId == 1 )
|
||||
{ // Tangent
|
||||
if ( constructorId == 2 )
|
||||
{ // Length
|
||||
mySketchType = DIR_TAN_LENGTH;
|
||||
Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
||||
Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3);
|
||||
Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_RADIUS2"));
|
||||
Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_ANGLE2"));
|
||||
myRadius = 100.0;
|
||||
Group2Spin->SpinBox_DX->SetValue(myRadius);
|
||||
myLength = 30.0;
|
||||
Group2Spin->SpinBox_DY->SetValue(myLength);
|
||||
Group2Spin->show();
|
||||
Group2Spin->buttonApply->setFocus();
|
||||
mySketchType = DIR_TAN_LENGTH;
|
||||
Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
|
||||
Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., DBL_DIGITS_DISPLAY);
|
||||
Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_RADIUS2"));
|
||||
Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_ANGLE2"));
|
||||
myRadius = 100.0;
|
||||
Group2Spin->SpinBox_DX->SetValue(myRadius);
|
||||
myLength = 30.0;
|
||||
Group2Spin->SpinBox_DY->SetValue(myLength);
|
||||
Group2Spin->show();
|
||||
Group2Spin->buttonApply->setFocus();
|
||||
}
|
||||
}
|
||||
else if ( myConstructorDirId == 3 )
|
||||
@ -738,7 +742,18 @@ void EntityGUI_SketcherDlg::ClickOnEnd()
|
||||
myCommand.append( ":WW" );
|
||||
}
|
||||
else
|
||||
{
|
||||
// PAL16008 (Sketcher Validation should be equal to Apply&Close)
|
||||
if (Group1Spin->buttonApply->isEnabled() && Group1Spin->isVisible() ||
|
||||
Group2Spin->buttonApply->isEnabled() && Group2Spin->isVisible() ||
|
||||
Group3Spin->buttonApply->isEnabled() && Group3Spin->isVisible() ||
|
||||
Group4Spin->buttonApply->isEnabled() && Group4Spin->isVisible() ||
|
||||
Group1Sel ->buttonApply->isEnabled() && Group1Sel->isVisible() )
|
||||
{
|
||||
ClickOnApply();
|
||||
}
|
||||
myIsAllAdded = true;
|
||||
}
|
||||
|
||||
if( myCommand.size() > 2 )
|
||||
if( !onAccept() )
|
||||
@ -753,7 +768,8 @@ void EntityGUI_SketcherDlg::ClickOnEnd()
|
||||
//=================================================================================
|
||||
bool EntityGUI_SketcherDlg::ClickOnApply()
|
||||
{
|
||||
((QPushButton*)sender())->setFocus(); // to update value of currently edited spin-box (PAL11948)
|
||||
if (sender() && sender()->inherits("QPushButton"))
|
||||
((QPushButton*)sender())->setFocus(); // to update value of currently edited spin-box (PAL11948)
|
||||
|
||||
myCommand.append( GetNewCommand() );
|
||||
mySketchState = NEXT_POINT;
|
||||
@ -1091,6 +1107,68 @@ void EntityGUI_SketcherDlg::ValueChangedInSpinBox(double newValue)
|
||||
vz = Group4Spin->SpinBox_DZ->GetValue();
|
||||
vs = newValue;
|
||||
}
|
||||
// NPAL16010 (Sketcher Apply non available if only one line is modified)
|
||||
// if ValueChangedInSpinBox() called from eventFilter()
|
||||
else if ( Group1Spin->SpinBox_DX->hasFocus() )
|
||||
{
|
||||
vx = newValue;
|
||||
}
|
||||
else if ( Group2Spin->SpinBox_DX ->hasFocus() )
|
||||
{
|
||||
vx = newValue;
|
||||
vy = Group2Spin->SpinBox_DY->GetValue();
|
||||
}
|
||||
else if ( Group2Spin->SpinBox_DY->hasFocus() )
|
||||
{
|
||||
vx = Group2Spin->SpinBox_DX->GetValue();
|
||||
vy = newValue;
|
||||
}
|
||||
else if ( Group3Spin->SpinBox_DX->hasFocus() )
|
||||
{
|
||||
vx = newValue;
|
||||
vy = Group3Spin->SpinBox_DY->GetValue();
|
||||
vz = Group3Spin->SpinBox_DZ->GetValue();
|
||||
}
|
||||
else if ( Group3Spin->SpinBox_DY->hasFocus() )
|
||||
{
|
||||
vx = Group3Spin->SpinBox_DX->GetValue();
|
||||
vy = newValue;
|
||||
vz = Group3Spin->SpinBox_DZ->GetValue();
|
||||
}
|
||||
else if ( Group3Spin->SpinBox_DZ->hasFocus() )
|
||||
{
|
||||
vx = Group3Spin->SpinBox_DX->GetValue();
|
||||
vy = Group3Spin->SpinBox_DY->GetValue();
|
||||
vz = newValue;
|
||||
}
|
||||
else if ( Group4Spin->SpinBox_DX->hasFocus() )
|
||||
{
|
||||
vx = newValue;
|
||||
vy = Group4Spin->SpinBox_DY->GetValue();
|
||||
vz = Group4Spin->SpinBox_DZ->GetValue();
|
||||
vs = Group4Spin->SpinBox_DS->GetValue();
|
||||
}
|
||||
else if ( Group4Spin->SpinBox_DY->hasFocus() )
|
||||
{
|
||||
vx = Group4Spin->SpinBox_DX->GetValue();
|
||||
vy = newValue;
|
||||
vz = Group4Spin->SpinBox_DZ->GetValue();
|
||||
vs = Group4Spin->SpinBox_DS->GetValue();
|
||||
}
|
||||
else if ( Group4Spin->SpinBox_DZ->hasFocus() )
|
||||
{
|
||||
vx = Group4Spin->SpinBox_DX->GetValue();
|
||||
vy = Group4Spin->SpinBox_DY->GetValue();
|
||||
vz = newValue;
|
||||
vs = Group4Spin->SpinBox_DS->GetValue();
|
||||
}
|
||||
else if ( Group4Spin->SpinBox_DS->hasFocus() )
|
||||
{
|
||||
vx = Group4Spin->SpinBox_DX->GetValue();
|
||||
vy = Group4Spin->SpinBox_DY->GetValue();
|
||||
vz = Group4Spin->SpinBox_DZ->GetValue();
|
||||
vs = newValue;
|
||||
}
|
||||
|
||||
if ( myConstructorId == 0 )
|
||||
{ // SEGMENT
|
||||
|
@ -20,9 +20,6 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="caption">
|
||||
<string>EntityGUI_Skeleton_QTD</string>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
@ -47,22 +44,6 @@
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<widget class="QGroupBox" row="2" column="0">
|
||||
<property name="name">
|
||||
<cstring>GroupVal</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>7</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QButtonGroup" row="0" column="0">
|
||||
<property name="name">
|
||||
<cstring>GroupConstructors</cstring>
|
||||
@ -75,9 +56,6 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Element Type</string>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
@ -106,17 +84,11 @@
|
||||
<property name="name">
|
||||
<cstring>RadioButton1</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Segment</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton">
|
||||
<property name="name">
|
||||
<cstring>RadioButton2</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Arc</string>
|
||||
</property>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
@ -134,9 +106,6 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Destination</string>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
@ -173,9 +142,6 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Type</string>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
@ -204,76 +170,16 @@
|
||||
<property name="name">
|
||||
<cstring>RB_Dest2</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Direction</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" row="0" column="0">
|
||||
<property name="name">
|
||||
<cstring>RB_Dest1</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Point</string>
|
||||
</property>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
<widget class="QButtonGroup" row="1" column="0">
|
||||
<property name="name">
|
||||
<cstring>GroupDest2</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>7</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string></string>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>11</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
</grid>
|
||||
</widget>
|
||||
<widget class="QButtonGroup" row="1" column="1">
|
||||
<property name="name">
|
||||
<cstring>GroupDest3</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>7</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string></string>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>11</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
</grid>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
</grid>
|
||||
@ -290,9 +196,6 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string></string>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
@ -321,17 +224,11 @@
|
||||
<property name="name">
|
||||
<cstring>buttonEnd</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>End Sketch</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>buttonClose</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Close Sketch</string>
|
||||
</property>
|
||||
</widget>
|
||||
<spacer>
|
||||
<property name="name">
|
||||
@ -354,17 +251,11 @@
|
||||
<property name="name">
|
||||
<cstring>buttonCancel</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>buttonHelp</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Help</string>
|
||||
</property>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
|
@ -95,19 +95,31 @@ Handle(GEOM_Object) GEOM_Object::GetObject(TDF_Label& theLabel)
|
||||
Handle(GEOM_Object) GEOM_Object::GetReferencedObject(TDF_Label& theLabel)
|
||||
{
|
||||
Handle(TDF_Reference) aRef;
|
||||
if (!theLabel.FindAttribute(TDF_Reference::GetID(), aRef)) return NULL;
|
||||
if (!theLabel.FindAttribute(TDF_Reference::GetID(), aRef)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(aRef.IsNull() || aRef->Get().IsNull()) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
// Get TreeNode of a referenced function
|
||||
Handle(TDataStd_TreeNode) aT, aFather;
|
||||
if (!TDataStd_TreeNode::Find(aRef->Get(), aT)) return NULL;
|
||||
if (!TDataStd_TreeNode::Find(aRef->Get(), aT)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
// Get TreeNode of Object of the referenced function
|
||||
aFather = aT->Father();
|
||||
if (aFather.IsNull()) return NULL;
|
||||
if (aFather.IsNull()) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Get label of the referenced object
|
||||
TDF_Label aLabel = aFather->Label();
|
||||
|
||||
|
||||
|
||||
return GEOM_Object::GetObject(aLabel);
|
||||
}
|
||||
@ -395,8 +407,10 @@ Handle(TColStd_HSequenceOfTransient) GEOM_Object::GetAllDependency()
|
||||
Standard_Integer aLength = aSeq.Length();
|
||||
if(aLength > 0) {
|
||||
anArray = new TColStd_HSequenceOfTransient;
|
||||
for(Standard_Integer j =1; j<=aLength; j++)
|
||||
anArray->Append(GetReferencedObject(aSeq(j)));
|
||||
for(Standard_Integer j =1; j<=aLength; j++) {
|
||||
Handle(GEOM_Object) aRefObj = GetReferencedObject(aSeq(j));
|
||||
if(!aRefObj.IsNull()) anArray->Append(aRefObj);
|
||||
}
|
||||
}
|
||||
|
||||
return anArray;
|
||||
|
@ -43,19 +43,12 @@ namespace GEOM
|
||||
TCollection_AsciiString aDescr;
|
||||
if ( myAppend )
|
||||
aDescr = myFunction->GetDescription() + "\n\t";
|
||||
aDescr += (char *)myStream.str().c_str();
|
||||
std::string aString = myStream.str();
|
||||
aDescr += (char *)aString.c_str();
|
||||
myFunction->SetDescription( aDescr );
|
||||
}
|
||||
}
|
||||
|
||||
// TPythonDump::operator TCollection_AsciiString () const
|
||||
// {
|
||||
// if (myCounter == 1) {
|
||||
// return TCollection_AsciiString ((char *)myStream.str().c_str());
|
||||
// }
|
||||
// return TCollection_AsciiString ();
|
||||
// }
|
||||
|
||||
TPythonDump& TPythonDump::operator<< (long int theArg)
|
||||
{
|
||||
myStream<<theArg;
|
||||
|
@ -37,8 +37,8 @@ uses
|
||||
MapOfShape from TopTools,
|
||||
Image from BRepAlgo,
|
||||
|
||||
DSFiller from NMTTools,
|
||||
PDSFiller from NMTTools
|
||||
PaveFiller from NMTTools,
|
||||
PPaveFiller from NMTTools
|
||||
|
||||
--raises
|
||||
|
||||
@ -54,8 +54,8 @@ is
|
||||
is redefined;
|
||||
|
||||
PerformWithFiller(me:out;
|
||||
theDSF: DSFiller from NMTTools)
|
||||
---Purpose: Performs calculations using prepared DSFiller
|
||||
theDSF: PaveFiller from NMTTools)
|
||||
---Purpose: Performs calculations using prepared PaveFiller
|
||||
-- object theDSF
|
||||
is virtual;
|
||||
|
||||
@ -99,13 +99,12 @@ is
|
||||
--
|
||||
-- protected methods
|
||||
--
|
||||
--
|
||||
PerformInternal(me:out;
|
||||
theDSF: DSFiller from NMTTools)
|
||||
theDSF: PaveFiller from NMTTools)
|
||||
---Purpose: Performs calculations using prepared DSFiller
|
||||
-- object theDSF
|
||||
is protected;
|
||||
--
|
||||
is virtual protected;
|
||||
|
||||
PrepareHistory (me:out)
|
||||
---Purpose: Prepare information for history support
|
||||
is redefined protected;
|
||||
@ -234,7 +233,7 @@ is
|
||||
-- =====================================================
|
||||
|
||||
fields
|
||||
myDSFiller : PDSFiller from NMTTools is protected;
|
||||
myPaveFiller : PPaveFiller from NMTTools is protected;
|
||||
myShapes : ListOfShape from TopTools is protected;
|
||||
-- Common usage
|
||||
myNbTypes : Integer from Standard is protected;
|
||||
@ -248,7 +247,7 @@ fields
|
||||
mySameDomainShapes: IndexedDataMapOfShapeShape from TopTools is protected;
|
||||
-- solids
|
||||
myDraftSolids : IndexedDataMapOfShapeShape from TopTools is protected;
|
||||
myEntryPoint : Integer from Standard is protected;
|
||||
myEntryPoint : Integer from Standard is protected;
|
||||
--
|
||||
end Builder;
|
||||
|
||||
|
@ -38,9 +38,8 @@
|
||||
|
||||
#include <BOP_CorrectTolerances.hxx>
|
||||
|
||||
#include <NMTTools_DSFiller.hxx>
|
||||
|
||||
#include <BRepLib.hxx>
|
||||
#include <NMTTools_PaveFiller.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
@ -51,7 +50,7 @@
|
||||
GEOMAlgo_BuilderShape()
|
||||
{
|
||||
myNbTypes=9;
|
||||
myDSFiller=NULL;
|
||||
myPaveFiller=NULL;
|
||||
myEntryPoint=0; // Entry point through PerformWithFiller ()
|
||||
}
|
||||
//=======================================================================
|
||||
@ -61,9 +60,9 @@
|
||||
GEOMAlgo_Builder::~GEOMAlgo_Builder()
|
||||
{
|
||||
if (myEntryPoint==1) {
|
||||
if (myDSFiller) {
|
||||
delete myDSFiller;
|
||||
myDSFiller=NULL;
|
||||
if (myPaveFiller) {
|
||||
delete myPaveFiller;
|
||||
myPaveFiller=NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -260,23 +259,19 @@
|
||||
aBB.Add(aCS, aS);
|
||||
}
|
||||
//
|
||||
if (myDSFiller) {
|
||||
delete myDSFiller;
|
||||
myDSFiller=NULL;
|
||||
}
|
||||
NMTTools_DSFiller* pDSF=new NMTTools_DSFiller;
|
||||
NMTTools_PaveFiller* pPF=new NMTTools_PaveFiller;
|
||||
//
|
||||
pDSF->SetCompositeShape(aCS);
|
||||
pDSF->Perform();
|
||||
pPF->SetCompositeShape(aCS);
|
||||
pPF->Perform();
|
||||
//
|
||||
myEntryPoint=1;
|
||||
PerformInternal(*pDSF);
|
||||
PerformInternal(*pPF);
|
||||
}
|
||||
//=======================================================================
|
||||
//function : PerformWithFiller
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Builder::PerformWithFiller(const NMTTools_DSFiller& theDSF)
|
||||
void GEOMAlgo_Builder::PerformWithFiller(const NMTTools_PaveFiller& theDSF)
|
||||
{
|
||||
myEntryPoint=0;
|
||||
//
|
||||
@ -286,18 +281,18 @@
|
||||
//function : PerformInternal
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Builder::PerformInternal(const NMTTools_DSFiller& theDSF)
|
||||
void GEOMAlgo_Builder::PerformInternal(const NMTTools_PaveFiller& pPF)
|
||||
{
|
||||
myErrorStatus=0;
|
||||
//
|
||||
Standard_Boolean bIsDone;
|
||||
//
|
||||
// 0. myDSFiller
|
||||
myDSFiller=(NMTTools_DSFiller *)&theDSF;
|
||||
// 0. myPaveFiller
|
||||
myPaveFiller=(NMTTools_PaveFiller *)&pPF;
|
||||
//
|
||||
bIsDone=myDSFiller->IsDone();
|
||||
bIsDone=myPaveFiller->IsDone();
|
||||
if (!bIsDone) {
|
||||
myErrorStatus=2; // DSFiller is failed
|
||||
myErrorStatus=2; // PaveFiller is failed
|
||||
return;
|
||||
}
|
||||
//
|
||||
@ -406,6 +401,6 @@
|
||||
//
|
||||
// 0 - Ok
|
||||
// 1 - The object is just initialized
|
||||
// 2 - DSFiller is failed
|
||||
// 2 - PaveFiller is failed
|
||||
// 10 - No shapes to process
|
||||
// 30 - SolidBuilder failed
|
||||
|
@ -20,8 +20,8 @@
|
||||
#ifndef _GEOMAlgo_Builder_HeaderFile
|
||||
#define _GEOMAlgo_Builder_HeaderFile
|
||||
|
||||
#ifndef _NMTTools_PDSFiller_HeaderFile
|
||||
#include <NMTTools_PDSFiller.hxx>
|
||||
#ifndef _NMTTools_PPaveFiller_HeaderFile
|
||||
#include <NMTTools_PPaveFiller.hxx>
|
||||
#endif
|
||||
#ifndef _TopTools_ListOfShape_HeaderFile
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
@ -50,7 +50,7 @@
|
||||
#ifndef _TopAbs_ShapeEnum_HeaderFile
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
#endif
|
||||
class NMTTools_DSFiller;
|
||||
class NMTTools_PaveFiller;
|
||||
class TopoDS_Shape;
|
||||
class TopTools_ListOfShape;
|
||||
class BRepAlgo_Image;
|
||||
@ -90,9 +90,9 @@ Standard_EXPORT virtual ~GEOMAlgo_Builder();
|
||||
//! Performs calculations <br>
|
||||
Standard_EXPORT virtual void Perform() ;
|
||||
|
||||
//! Performs calculations using prepared DSFiller <br>
|
||||
//! Performs calculations using prepared PaveFiller <br>
|
||||
//! object theDSF <br>
|
||||
Standard_EXPORT virtual void PerformWithFiller(const NMTTools_DSFiller& theDSF) ;
|
||||
Standard_EXPORT virtual void PerformWithFiller(const NMTTools_PaveFiller& theDSF) ;
|
||||
|
||||
//! Adds argument theShape of the operation <br>
|
||||
Standard_EXPORT virtual void AddShape(const TopoDS_Shape& theShape) ;
|
||||
@ -139,7 +139,7 @@ protected:
|
||||
|
||||
//! Performs calculations using prepared DSFiller <br>
|
||||
//! object theDSF <br>
|
||||
Standard_EXPORT void PerformInternal(const NMTTools_DSFiller& theDSF) ;
|
||||
Standard_EXPORT virtual void PerformInternal(const NMTTools_PaveFiller& theDSF) ;
|
||||
|
||||
//! Prepare information for history support <br>
|
||||
Standard_EXPORT virtual void PrepareHistory() ;
|
||||
@ -214,7 +214,7 @@ Standard_EXPORT void BuildDraftSolid(const TopoDS_Shape& theSolid,TopoDS_Shape
|
||||
|
||||
// Fields PROTECTED
|
||||
//
|
||||
NMTTools_PDSFiller myDSFiller;
|
||||
NMTTools_PPaveFiller myPaveFiller;
|
||||
TopTools_ListOfShape myShapes;
|
||||
Standard_Integer myNbTypes;
|
||||
TopTools_MapOfShape myMapFence;
|
||||
|
@ -17,8 +17,8 @@
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
|
||||
#ifndef _NMTTools_DSFiller_HeaderFile
|
||||
#include <NMTTools_DSFiller.hxx>
|
||||
#ifndef _NMTTools_PaveFiller_HeaderFile
|
||||
#include <NMTTools_PaveFiller.hxx>
|
||||
#endif
|
||||
#ifndef _TopoDS_Shape_HeaderFile
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <GEOMAlgo_Builder.hxx>
|
||||
|
||||
#include <NMTDS_ShapesDataStructure.hxx>
|
||||
#include <NMTTools_DSFiller.hxx>
|
||||
//#include <NMTTools_DSFiller.hxx>
|
||||
#include <NMTTools_PaveFiller.hxx>
|
||||
#include <IntTools_Context.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
@ -47,7 +47,6 @@
|
||||
//
|
||||
#include <NMTDS_ShapesDataStructure.hxx>
|
||||
//
|
||||
#include <NMTTools_DSFiller.hxx>
|
||||
#include <NMTTools_PaveFiller.hxx>
|
||||
#include <NMTTools_CommonBlockPool.hxx>
|
||||
#include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
|
||||
@ -78,8 +77,8 @@ static
|
||||
{
|
||||
myErrorStatus=0;
|
||||
//
|
||||
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
|
||||
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
|
||||
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
|
||||
NMTTools_PaveFiller* pPF=myPaveFiller;
|
||||
//
|
||||
Standard_Integer i, aNb, iV;
|
||||
//
|
||||
@ -94,7 +93,6 @@ static
|
||||
myImages.Bind(aV, aVSD);
|
||||
//
|
||||
mySameDomainShapes.Add(aV, aVSD);
|
||||
//
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -108,8 +106,8 @@ static
|
||||
{
|
||||
myErrorStatus=0;
|
||||
//
|
||||
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
|
||||
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
|
||||
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
|
||||
NMTTools_PaveFiller* pPF=myPaveFiller;
|
||||
const BOPTools_SplitShapesPool& aSSP=pPF->SplitShapesPool();
|
||||
NMTTools_CommonBlockPool& aCBP=pPF->ChangeCommonBlockPool();
|
||||
IntTools_Context& aCtx=pPF->ChangeContext();
|
||||
@ -218,8 +216,8 @@ static
|
||||
TopTools_MapOfShape aMS;
|
||||
TopTools_MapIteratorOfMapOfShape aItS;
|
||||
//
|
||||
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
|
||||
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
|
||||
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
|
||||
NMTTools_PaveFiller* pPF=myPaveFiller;
|
||||
IntTools_Context& aCtx= pPF->ChangeContext();
|
||||
//
|
||||
aNbS=aDS.NumberOfShapesOfTheObject();
|
||||
|
@ -54,7 +54,6 @@
|
||||
#include <BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger.hxx>
|
||||
#include <BOPTools_ListOfPaveBlock.hxx>
|
||||
#include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
|
||||
#include <BOPTools_InterferencePool.hxx>
|
||||
#include <BOPTools_CArray1OfSSInterference.hxx>
|
||||
#include <BOPTools_SSInterference.hxx>
|
||||
#include <BOPTools_SequenceOfCurves.hxx>
|
||||
@ -68,7 +67,6 @@
|
||||
#include <BOPTools_CArray1OfESInterference.hxx>
|
||||
|
||||
#include <NMTDS_ShapesDataStructure.hxx>
|
||||
#include <NMTTools_DSFiller.hxx>
|
||||
#include <NMTTools_PaveFiller.hxx>
|
||||
#include <NMTTools_ListOfCoupleOfShape.hxx>
|
||||
#include <NMTTools_Tools.hxx>
|
||||
@ -83,6 +81,7 @@
|
||||
#include <GEOMAlgo_Tools3D.hxx>
|
||||
#include <GEOMAlgo_WireEdgeSet.hxx>
|
||||
#include <GEOMAlgo_BuilderFace.hxx>
|
||||
#include <NMTDS_InterfPool.hxx>
|
||||
|
||||
static
|
||||
void UpdateCandidates(const Standard_Integer ,
|
||||
@ -109,9 +108,9 @@ static
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Builder::FillIn2DParts()
|
||||
{
|
||||
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
|
||||
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
|
||||
BOPTools_InterferencePool* pIP=(BOPTools_InterferencePool*)&myDSFiller->InterfPool();
|
||||
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
|
||||
NMTTools_PaveFiller* pPF=myPaveFiller;
|
||||
NMTDS_InterfPool* pIP=pPF->IP();
|
||||
BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences();
|
||||
NMTTools_CommonBlockPool& aCBP=pPF->ChangeCommonBlockPool();
|
||||
//
|
||||
@ -193,9 +192,9 @@ static
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Builder::BuildSplitFaces()
|
||||
{
|
||||
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
|
||||
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
|
||||
BOPTools_InterferencePool* pIP=(BOPTools_InterferencePool*)&myDSFiller->InterfPool();
|
||||
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
|
||||
NMTTools_PaveFiller* pPF=myPaveFiller;
|
||||
NMTDS_InterfPool* pIP=pPF->IP();
|
||||
BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences();
|
||||
IntTools_Context& aCtx= pPF->ChangeContext();
|
||||
//
|
||||
@ -388,9 +387,9 @@ static
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Builder::FillSameDomainFaces()
|
||||
{
|
||||
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
|
||||
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
|
||||
BOPTools_InterferencePool* pIP=(BOPTools_InterferencePool*)&myDSFiller->InterfPool();
|
||||
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
|
||||
NMTTools_PaveFiller* pPF=myPaveFiller;
|
||||
NMTDS_InterfPool* pIP=pPF->IP();
|
||||
BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences();
|
||||
IntTools_Context& aCtx= pPF->ChangeContext();
|
||||
//
|
||||
@ -513,7 +512,7 @@ static
|
||||
TopTools_ListOfShape aLFx;
|
||||
TopTools_ListIteratorOfListOfShape aIt;
|
||||
//
|
||||
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
|
||||
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
|
||||
//
|
||||
aNb=aDS.NumberOfShapesOfTheObject();
|
||||
for (i=1; i<=aNb; ++i) {
|
||||
@ -557,9 +556,9 @@ static
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Builder::FillInternalVertices()
|
||||
{
|
||||
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
|
||||
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
|
||||
BOPTools_InterferencePool* pIP=(BOPTools_InterferencePool*)&myDSFiller->InterfPool();
|
||||
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
|
||||
NMTTools_PaveFiller* pPF=myPaveFiller;
|
||||
NMTDS_InterfPool* pIP=pPF->IP();
|
||||
IntTools_Context& aCtx= pPF->ChangeContext();
|
||||
//
|
||||
BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences();
|
||||
|
@ -56,7 +56,6 @@
|
||||
#include <IntTools_Context.hxx>
|
||||
|
||||
#include <NMTDS_ShapesDataStructure.hxx>
|
||||
#include <NMTTools_DSFiller.hxx>
|
||||
#include <NMTTools_PaveFiller.hxx>
|
||||
|
||||
#include <GEOMAlgo_Tools3D.hxx>
|
||||
@ -93,8 +92,8 @@ static
|
||||
{
|
||||
myErrorStatus=0;
|
||||
//
|
||||
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
|
||||
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
|
||||
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
|
||||
NMTTools_PaveFiller* pPF=myPaveFiller;
|
||||
IntTools_Context& aCtx= pPF->ChangeContext();
|
||||
//
|
||||
Standard_Boolean bToReverse;
|
||||
@ -186,8 +185,8 @@ static
|
||||
{
|
||||
myErrorStatus=0;
|
||||
//
|
||||
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
|
||||
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
|
||||
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
|
||||
NMTTools_PaveFiller* pPF=myPaveFiller;
|
||||
IntTools_Context& aCtx= pPF->ChangeContext();
|
||||
//
|
||||
Standard_Boolean bIsIN, bHasImage;
|
||||
@ -416,8 +415,8 @@ static
|
||||
{
|
||||
myErrorStatus=0;
|
||||
//
|
||||
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
|
||||
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
|
||||
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
|
||||
NMTTools_PaveFiller* pPF=myPaveFiller;
|
||||
IntTools_Context& aCtx= pPF->ChangeContext();
|
||||
//
|
||||
Standard_Integer i, aNbS, iErr;
|
||||
@ -589,8 +588,8 @@ static
|
||||
{
|
||||
myErrorStatus=0;
|
||||
//
|
||||
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
|
||||
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
|
||||
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
|
||||
NMTTools_PaveFiller* pPF=myPaveFiller;
|
||||
IntTools_Context& aCtx= pPF->ChangeContext();
|
||||
//
|
||||
//Standard_Boolean bHasImage;
|
||||
|
@ -35,7 +35,6 @@
|
||||
#include <NMTDS_ShapesDataStructure.hxx>
|
||||
|
||||
#include <NMTTools_PaveFiller.hxx>
|
||||
#include <NMTTools_DSFiller.hxx>
|
||||
|
||||
#include <GEOMAlgo_Tools3D.hxx>
|
||||
|
||||
@ -49,8 +48,8 @@ static
|
||||
//=======================================================================
|
||||
const TopTools_ListOfShape& GEOMAlgo_Builder::Generated(const TopoDS_Shape& theS)
|
||||
{
|
||||
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
|
||||
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
|
||||
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
|
||||
NMTTools_PaveFiller* pPF=myPaveFiller;
|
||||
IntTools_Context& aCtx=pPF->ChangeContext();
|
||||
//
|
||||
Standard_Boolean bHasImage, bToReverse;
|
||||
@ -104,8 +103,8 @@ static
|
||||
//=======================================================================
|
||||
const TopTools_ListOfShape& GEOMAlgo_Builder::Modified(const TopoDS_Shape& theS)
|
||||
{
|
||||
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
|
||||
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
|
||||
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
|
||||
NMTTools_PaveFiller* pPF=myPaveFiller;
|
||||
IntTools_Context& aCtx=pPF->ChangeContext();
|
||||
//
|
||||
Standard_Boolean bHasImage, bToReverse;
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include <Poly_Triangle.hxx>
|
||||
#include <Poly_PolygonOnTriangulation.hxx>
|
||||
#include <Poly_Triangulation.hxx>
|
||||
#include <Poly_Polygon3D.hxx>
|
||||
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
@ -688,19 +689,32 @@ void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Edge& aE,
|
||||
aLP.Clear();
|
||||
BRep_Tool::PolygonOnTriangulation(aE, aPTE, aTRE, aLoc);
|
||||
if (aTRE.IsNull() || aPTE.IsNull()) {
|
||||
myErrorStatus=20; // no triangulation found
|
||||
return;
|
||||
Handle(Poly_Polygon3D) aPE = BRep_Tool::Polygon3D(aE, aLoc);
|
||||
if (aPE.IsNull()) {
|
||||
myErrorStatus=20; // no triangulation found
|
||||
return;
|
||||
}
|
||||
const gp_Trsf& aTrsf=aLoc.Transformation();
|
||||
const TColgp_Array1OfPnt& aNodes=aPE->Nodes();
|
||||
//
|
||||
aNbNodes=aPE->NbNodes();
|
||||
Standard_Integer low = aNodes.Lower(), up = aNodes.Upper();
|
||||
for (j=low+1; j<up; ++j) {
|
||||
aP=aNodes(j).Transformed(aTrsf);
|
||||
aLP.Append(aP);
|
||||
}
|
||||
}
|
||||
//
|
||||
const gp_Trsf& aTrsf=aLoc.Transformation();
|
||||
const TColgp_Array1OfPnt& aNodes=aTRE->Nodes();
|
||||
//
|
||||
aNbNodes=aPTE->NbNodes();
|
||||
const TColStd_Array1OfInteger& aInds=aPTE->Nodes();
|
||||
for (j=2; j<aNbNodes; ++j) {
|
||||
aIndex=aInds(j);
|
||||
aP=aNodes(aIndex).Transformed(aTrsf);
|
||||
aLP.Append(aP);
|
||||
else {
|
||||
const gp_Trsf& aTrsf=aLoc.Transformation();
|
||||
const TColgp_Array1OfPnt& aNodes=aTRE->Nodes();
|
||||
//
|
||||
aNbNodes=aPTE->NbNodes();
|
||||
const TColStd_Array1OfInteger& aInds=aPTE->Nodes();
|
||||
for (j=2; j<aNbNodes; ++j) {
|
||||
aIndex=aInds(j);
|
||||
aP=aNodes(aIndex).Transformed(aTrsf);
|
||||
aLP.Append(aP);
|
||||
}
|
||||
}
|
||||
//
|
||||
aNb=aLP.Extent();
|
||||
@ -708,7 +722,6 @@ void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Edge& aE,
|
||||
// try to fill it yourself
|
||||
InnerPoints(aE, myNbPntsMin, aLP);
|
||||
aNb=aLP.Extent();
|
||||
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include <Poly_Triangle.hxx>
|
||||
#include <Poly_PolygonOnTriangulation.hxx>
|
||||
#include <Poly_Triangulation.hxx>
|
||||
#include <Poly_Polygon3D.hxx>
|
||||
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
@ -748,19 +749,32 @@
|
||||
aLP.Clear();
|
||||
BRep_Tool::PolygonOnTriangulation(aE, aPTE, aTRE, aLoc);
|
||||
if (aTRE.IsNull() || aPTE.IsNull()) {
|
||||
myErrorStatus=20; // no triangulation found
|
||||
return;
|
||||
Handle(Poly_Polygon3D) aPE = BRep_Tool::Polygon3D(aE, aLoc);
|
||||
if (aPE.IsNull()) {
|
||||
myErrorStatus=20; // no triangulation found
|
||||
return;
|
||||
}
|
||||
const gp_Trsf& aTrsf=aLoc.Transformation();
|
||||
const TColgp_Array1OfPnt& aNodes=aPE->Nodes();
|
||||
//
|
||||
aNbNodes=aPE->NbNodes();
|
||||
Standard_Integer low = aNodes.Lower(), up = aNodes.Upper();
|
||||
for (j=low+1; j<up; ++j) {
|
||||
aP=aNodes(j).Transformed(aTrsf);
|
||||
aLP.Append(aP);
|
||||
}
|
||||
}
|
||||
//
|
||||
const gp_Trsf& aTrsf=aLoc.Transformation();
|
||||
const TColgp_Array1OfPnt& aNodes=aTRE->Nodes();
|
||||
//
|
||||
aNbNodes=aPTE->NbNodes();
|
||||
const TColStd_Array1OfInteger& aInds=aPTE->Nodes();
|
||||
for (j=2; j<aNbNodes; ++j) {
|
||||
aIndex=aInds(j);
|
||||
aP=aNodes(aIndex).Transformed(aTrsf);
|
||||
aLP.Append(aP);
|
||||
else {
|
||||
const gp_Trsf& aTrsf=aLoc.Transformation();
|
||||
const TColgp_Array1OfPnt& aNodes=aTRE->Nodes();
|
||||
//
|
||||
aNbNodes=aPTE->NbNodes();
|
||||
const TColStd_Array1OfInteger& aInds=aPTE->Nodes();
|
||||
for (j=2; j<aNbNodes; ++j) {
|
||||
aIndex=aInds(j);
|
||||
aP=aNodes(aIndex).Transformed(aTrsf);
|
||||
aLP.Append(aP);
|
||||
}
|
||||
}
|
||||
//
|
||||
aNb=aLP.Extent();
|
||||
@ -768,7 +782,6 @@
|
||||
// try to fill it yourself
|
||||
InnerPoints(aE, myNbPntsMin, aLP);
|
||||
aNb=aLP.Extent();
|
||||
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
@ -818,4 +831,3 @@
|
||||
// 30- can not obtain the line from the link
|
||||
// 40- point can not be classified
|
||||
// 41- invalid data for classifier
|
||||
|
||||
|
@ -102,6 +102,7 @@ GEOMAlgo_Gluer::GEOMAlgo_Gluer()
|
||||
myTolerance=0.0001;
|
||||
myTol=myTolerance;
|
||||
myCheckGeometry=Standard_True;
|
||||
myKeepNonSolids=Standard_False;
|
||||
myNbAlone=0;
|
||||
}
|
||||
//=======================================================================
|
||||
@ -128,6 +129,14 @@ Standard_Boolean GEOMAlgo_Gluer::CheckGeometry() const
|
||||
return myCheckGeometry;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : SetKeepNonSolids
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Gluer::SetKeepNonSolids(const Standard_Boolean aFlag)
|
||||
{
|
||||
myKeepNonSolids=aFlag;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : AloneShapes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
@ -356,39 +365,45 @@ void GEOMAlgo_Gluer::MakeVertices()
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
//function : MakeSolids
|
||||
//function : MakeSubShapes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Gluer::MakeSolids()
|
||||
void GEOMAlgo_Gluer::MakeSubShapes (const TopoDS_Shape& theShape,
|
||||
TopTools_MapOfShape& theMS,
|
||||
TopoDS_Compound& theResult)
|
||||
{
|
||||
myErrorStatus=0;
|
||||
if (theMS.Contains(theShape))
|
||||
return;
|
||||
//
|
||||
Standard_Integer aNbS;
|
||||
TopAbs_Orientation anOr;
|
||||
TopoDS_Compound aCmp;
|
||||
TopoDS_Solid aNewSolid;
|
||||
TopTools_IndexedMapOfShape aMS;
|
||||
TopExp_Explorer aExpS, aExp;
|
||||
BRep_Builder aBB;
|
||||
//
|
||||
aBB.MakeCompound(aCmp);
|
||||
theMS.Add(theShape);
|
||||
//
|
||||
aNbS=aMS.Extent();
|
||||
aExpS.Init(myShape, TopAbs_SOLID);
|
||||
for (; aExpS.More(); aExpS.Next()) {
|
||||
const TopoDS_Solid& aSolid=TopoDS::Solid(aExpS.Current());
|
||||
if (aMS.Contains(aSolid)) {
|
||||
continue;
|
||||
if (theShape.ShapeType() == TopAbs_COMPOUND ||
|
||||
theShape.ShapeType() == TopAbs_COMPSOLID)
|
||||
{
|
||||
TopoDS_Iterator It (theShape, Standard_True, Standard_True);
|
||||
for (; It.More(); It.Next())
|
||||
{
|
||||
MakeSubShapes(It.Value(), theMS, theResult);
|
||||
}
|
||||
aMS.Add(aSolid);
|
||||
}
|
||||
else if (theShape.ShapeType() == TopAbs_SOLID)
|
||||
{
|
||||
// build a solid
|
||||
TopoDS_Solid aNewSolid;
|
||||
TopExp_Explorer aExpS, aExp;
|
||||
//
|
||||
anOr=aSolid.Orientation();
|
||||
const TopoDS_Solid& aSolid = TopoDS::Solid(theShape);
|
||||
//
|
||||
TopAbs_Orientation anOr = aSolid.Orientation();
|
||||
//
|
||||
aBB.MakeSolid(aNewSolid);
|
||||
aNewSolid.Orientation(anOr);
|
||||
//
|
||||
aExp.Init(aSolid, TopAbs_SHELL);
|
||||
for (; aExp.More(); aExp.Next()) {
|
||||
for (; aExp.More(); aExp.Next())
|
||||
{
|
||||
const TopoDS_Shape& aShell=aExp.Current();
|
||||
const TopoDS_Shape& aShellR=myOrigins.Find(aShell);
|
||||
aBB.Add(aNewSolid, aShellR);
|
||||
@ -400,14 +415,88 @@ void GEOMAlgo_Gluer::MakeSolids()
|
||||
myImages.Bind(aNewSolid, aLS);
|
||||
myOrigins.Bind(aSolid, aNewSolid);
|
||||
//
|
||||
aBB.Add(aCmp, aNewSolid);
|
||||
aBB.Add(theResult, aNewSolid);
|
||||
}
|
||||
else if (theShape.ShapeType() == TopAbs_WIRE)
|
||||
{
|
||||
if (myKeepNonSolids)
|
||||
{
|
||||
// just add image
|
||||
if (!myOrigins.IsBound(theShape))
|
||||
{
|
||||
// build wire
|
||||
const TopoDS_Wire& aW=TopoDS::Wire(theShape);
|
||||
//
|
||||
TopoDS_Wire newWire;
|
||||
aBB.MakeWire(newWire);
|
||||
//
|
||||
TopExp_Explorer aExpE (aW, TopAbs_EDGE);
|
||||
for (; aExpE.More(); aExpE.Next()) {
|
||||
const TopoDS_Edge& aE=TopoDS::Edge(aExpE.Current());
|
||||
TopoDS_Edge aER=TopoDS::Edge(myOrigins.Find(aE));
|
||||
//
|
||||
aER.Orientation(TopAbs_FORWARD);
|
||||
if (!BRep_Tool::Degenerated(aER)) {
|
||||
// build p-curve
|
||||
//if (bIsUPeriodic) {
|
||||
// GEOMAlgo_Tools::RefinePCurveForEdgeOnFace(aER, aFFWD, aUMin, aUMax);
|
||||
//}
|
||||
//BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aER, aFFWD);
|
||||
//
|
||||
// orient image
|
||||
Standard_Boolean bIsToReverse=BOPTools_Tools3D::IsSplitToReverse1(aER, aE, myContext);
|
||||
if (bIsToReverse) {
|
||||
aER.Reverse();
|
||||
}
|
||||
}
|
||||
else {
|
||||
aER.Orientation(aE.Orientation());
|
||||
}
|
||||
//
|
||||
aBB.Add(newWire, aER);
|
||||
}
|
||||
// xf
|
||||
TopTools_ListOfShape aLW;
|
||||
//
|
||||
aLW.Append(aW);
|
||||
myImages.Bind(newWire, aLW);
|
||||
myOrigins.Bind(aW, newWire);
|
||||
}
|
||||
const TopoDS_Shape& aShapeR = myOrigins.Find(theShape);
|
||||
aBB.Add(theResult, aShapeR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (myKeepNonSolids)
|
||||
{
|
||||
// just add image
|
||||
const TopoDS_Shape& aShapeR = myOrigins.Find(theShape);
|
||||
aBB.Add(theResult, aShapeR);
|
||||
}
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
//function : MakeSolids
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Gluer::MakeSolids()
|
||||
{
|
||||
myErrorStatus=0;
|
||||
//
|
||||
BRep_Builder aBB;
|
||||
TopoDS_Compound aCmp;
|
||||
TopTools_MapOfShape aMS;
|
||||
//
|
||||
aBB.MakeCompound(aCmp);
|
||||
//
|
||||
// Add images of all initial sub-shapes in the result.
|
||||
// If myKeepNonSolids==false, add only solids images.
|
||||
MakeSubShapes(myShape, aMS, aCmp);
|
||||
//
|
||||
myResult=aCmp;
|
||||
//
|
||||
aNbS=aMS.Extent();
|
||||
if (aNbS) {
|
||||
Standard_Real aTol=1.e-7;
|
||||
if (aMS.Extent()) {
|
||||
BOP_CorrectTolerances::CorrectCurveOnSurface(myResult);
|
||||
}
|
||||
}
|
||||
|
@ -38,12 +38,18 @@
|
||||
#ifndef _TopTools_ListOfShape_HeaderFile
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#endif
|
||||
#ifndef _TopTools_MapOfShape_HeaderFile
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#endif
|
||||
#ifndef _GEOMAlgo_ShapeAlgo_HeaderFile
|
||||
#include <GEOMAlgo_ShapeAlgo.hxx>
|
||||
#endif
|
||||
#ifndef _TopAbs_ShapeEnum_HeaderFile
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
#endif
|
||||
#ifndef _TopoDS_Compound_HeaderFile
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#endif
|
||||
class TopTools_ListOfShape;
|
||||
class TopoDS_Shape;
|
||||
class TopoDS_Edge;
|
||||
@ -92,6 +98,9 @@ Standard_EXPORT void SetCheckGeometry(const Standard_Boolean aFlag) ;
|
||||
Standard_EXPORT Standard_Boolean CheckGeometry() const;
|
||||
|
||||
|
||||
Standard_EXPORT void SetKeepNonSolids(const Standard_Boolean aFlag) ;
|
||||
|
||||
|
||||
Standard_EXPORT virtual void Perform() ;
|
||||
|
||||
|
||||
@ -143,6 +152,11 @@ Standard_EXPORT void MakeShapes(const TopAbs_ShapeEnum aType) ;
|
||||
Standard_EXPORT void MakeShells() ;
|
||||
|
||||
|
||||
Standard_EXPORT void MakeSubShapes(const TopoDS_Shape& theShape,
|
||||
TopTools_MapOfShape& theMS,
|
||||
TopoDS_Compound& theResult);
|
||||
|
||||
|
||||
Standard_EXPORT void MakeSolids() ;
|
||||
|
||||
|
||||
@ -173,6 +187,7 @@ Standard_EXPORT Standard_Boolean HasNewSubShape(const TopoDS_Shape& aS) const;
|
||||
// Fields PROTECTED
|
||||
//
|
||||
Standard_Boolean myCheckGeometry;
|
||||
Standard_Boolean myKeepNonSolids;
|
||||
Standard_Real myTol;
|
||||
TopTools_DataMapOfShapeListOfShape myImages;
|
||||
TopTools_DataMapOfShapeShape myOrigins;
|
||||
|
@ -317,9 +317,6 @@ static
|
||||
aF=TopoDS::Face(aS);
|
||||
//
|
||||
aNbWires=NbWires(aF);
|
||||
if (aNbWires>1) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
aSurf=BRep_Tool::Surface(aF);
|
||||
GeomAdaptor_Surface aGAS(aSurf);
|
||||
@ -342,6 +339,8 @@ static
|
||||
aInfo.SetLocation(aP0);
|
||||
aInfo.SetPosition(aAx3);
|
||||
//
|
||||
if (aNbWires>1) return;
|
||||
//
|
||||
//aSurf->Bounds(aUMin, aUMax, aVMin, aVMax);
|
||||
BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
|
||||
bInfU1=Precision::IsNegativeInfinite(aUMin);
|
||||
@ -374,6 +373,8 @@ static
|
||||
aInfo.SetPosition(aAx3);
|
||||
aInfo.SetRadius1(aR1);
|
||||
//
|
||||
if (aNbWires>1) return;
|
||||
//
|
||||
aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
|
||||
aInfo.SetKindOfClosed(GEOMAlgo_KC_CLOSED);
|
||||
//
|
||||
@ -394,6 +395,8 @@ static
|
||||
aInfo.SetPosition(aAx3);
|
||||
aInfo.SetRadius1(aR1);
|
||||
//
|
||||
if (aNbWires>1) return;
|
||||
//
|
||||
BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
|
||||
bInfU1=Precision::IsNegativeInfinite(aUMin);
|
||||
bInfU2=Precision::IsPositiveInfinite(aUMax);
|
||||
@ -424,6 +427,8 @@ static
|
||||
aInfo.SetPosition(aAx3);
|
||||
//aInfo.SetRadius1(aR1);
|
||||
//
|
||||
if (aNbWires>1) return;
|
||||
//
|
||||
BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
|
||||
bInfU1=Precision::IsNegativeInfinite(aUMin);
|
||||
bInfU2=Precision::IsPositiveInfinite(aUMax);
|
||||
@ -456,8 +461,10 @@ static
|
||||
aInfo.SetRadius1(aR1);
|
||||
aInfo.SetRadius2(aR2);
|
||||
//
|
||||
if (aNbWires>1) return;
|
||||
//
|
||||
aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
|
||||
|
||||
//
|
||||
FillDetails(aF, aTorus);
|
||||
}
|
||||
}
|
||||
|
@ -63,6 +63,13 @@ is
|
||||
|
||||
Limit(me)
|
||||
returns ShapeEnum from TopAbs;
|
||||
|
||||
SetLimitMode(me:out;
|
||||
aLimitMode:Integer from Standard);
|
||||
|
||||
LimitMode(me)
|
||||
returns Integer from Standard;
|
||||
|
||||
--
|
||||
-- Protected methods
|
||||
--
|
||||
@ -89,5 +96,7 @@ fields
|
||||
myTools : ListOfShape from TopTools is protected;
|
||||
myMapTools : MapOfShape from TopTools is protected;
|
||||
myLimit : ShapeEnum from TopAbs is protected;
|
||||
myLimitMode : Integer from Standard is protected;
|
||||
|
||||
end Splitter;
|
||||
|
||||
|
@ -42,7 +42,10 @@
|
||||
|
||||
#include <BOP_CorrectTolerances.hxx>
|
||||
|
||||
#include <NMTTools_DSFiller.hxx>
|
||||
|
||||
static
|
||||
void TreatCompound(const TopoDS_Shape& aC,
|
||||
TopTools_ListOfShape& aLSX);
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
@ -53,6 +56,7 @@
|
||||
GEOMAlgo_Builder()
|
||||
{
|
||||
myLimit=TopAbs_SHAPE;
|
||||
myLimitMode=0;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : ~
|
||||
@ -112,6 +116,22 @@
|
||||
return myLimit;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : SetLimitMode
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_Splitter::SetLimitMode(const Standard_Integer aMode)
|
||||
{
|
||||
myLimitMode=aMode;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : LimitMode
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer GEOMAlgo_Splitter::LimitMode()const
|
||||
{
|
||||
return myLimitMode;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Clear
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
@ -168,27 +188,137 @@
|
||||
Standard_Integer i, aNbS;
|
||||
BRep_Builder aBB;
|
||||
TopoDS_Compound aC;
|
||||
TopTools_IndexedMapOfShape aM;
|
||||
TopTools_IndexedMapOfShape aMx;
|
||||
//
|
||||
aBB.MakeCompound(aC);
|
||||
//
|
||||
TopExp::MapShapes(myShape, myLimit, aM);
|
||||
aNbS=aM.Extent();
|
||||
TopExp::MapShapes(myShape, myLimit, aMx);
|
||||
aNbS=aMx.Extent();
|
||||
for (i=1; i<=aNbS; ++i) {
|
||||
const TopoDS_Shape& aS=aM(i);
|
||||
const TopoDS_Shape& aS=aMx(i);
|
||||
aBB.Add(aC, aS);
|
||||
}
|
||||
//modified by NIZNHY-PKV Thu Feb 15 17:09:32 2007f
|
||||
if (myLimitMode) {
|
||||
Standard_Integer iType, iLimit, iTypeX;
|
||||
TopAbs_ShapeEnum aType, aTypeX;
|
||||
TopTools_ListOfShape aLSP, aLSX;
|
||||
TopTools_ListIteratorOfListOfShape aIt, aItX, aItIm;
|
||||
TopTools_MapOfShape aM;
|
||||
//
|
||||
iLimit=(Standard_Integer)myLimit;
|
||||
//
|
||||
// 1. Collect the shapes to process aLSP
|
||||
aIt.Initialize(myShapes);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
const TopoDS_Shape& aS=aIt.Value();
|
||||
if (myMapTools.Contains(aS)) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
aType=aS.ShapeType();
|
||||
iType=(Standard_Integer)aType;
|
||||
//
|
||||
if (iType>iLimit) {
|
||||
aLSP.Append(aS);
|
||||
}
|
||||
//
|
||||
else if (aType==TopAbs_COMPOUND) {
|
||||
aLSX.Clear();
|
||||
//
|
||||
TreatCompound(aS, aLSX);
|
||||
//
|
||||
aItX.Initialize(aLSX);
|
||||
for (; aItX.More(); aItX.Next()) {
|
||||
const TopoDS_Shape& aSX=aItX.Value();
|
||||
aTypeX=aSX.ShapeType();
|
||||
iTypeX=(Standard_Integer)aTypeX;
|
||||
//
|
||||
if (iTypeX>iLimit) {
|
||||
aLSP.Append(aSX);
|
||||
}
|
||||
}
|
||||
}
|
||||
}// for (; aIt.More(); aIt.Next()) {
|
||||
//
|
||||
// 2. Add them to aC
|
||||
aIt.Initialize(aLSP);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
const TopoDS_Shape& aS=aIt.Value();
|
||||
if (myImages.HasImage(aS)) {
|
||||
const TopTools_ListOfShape& aLSIm=myImages.Image(aS);
|
||||
aItIm.Initialize(aLSIm);
|
||||
for (; aItIm.More(); aItIm.Next()) {
|
||||
const TopoDS_Shape& aSIm=aItIm.Value();
|
||||
if (aM.Add(aSIm)) {
|
||||
aBB.Add(aC, aSIm);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (aM.Add(aS)) {
|
||||
aBB.Add(aC, aS);
|
||||
}
|
||||
}
|
||||
}
|
||||
}// if (myLimitMode) {
|
||||
//modified by NIZNHY-PKV Thu Feb 15 17:09:34 2007t
|
||||
myShape=aC;
|
||||
}
|
||||
}//if (myLimit!=TopAbs_SHAPE) {
|
||||
//
|
||||
GEOMAlgo_Builder::PostTreat();
|
||||
}
|
||||
//=======================================================================
|
||||
//function : TreatCompound
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void TreatCompound(const TopoDS_Shape& aC1,
|
||||
TopTools_ListOfShape& aLSX)
|
||||
{
|
||||
Standard_Integer aNbC1;
|
||||
TopAbs_ShapeEnum aType;
|
||||
TopTools_ListOfShape aLC, aLC1;
|
||||
TopTools_ListIteratorOfListOfShape aIt, aIt1;
|
||||
TopoDS_Iterator aItC;
|
||||
//
|
||||
aLC.Append (aC1);
|
||||
while(1) {
|
||||
aLC1.Clear();
|
||||
aIt.Initialize(aLC);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
const TopoDS_Shape& aC=aIt.Value(); //C is compound
|
||||
//
|
||||
aItC.Initialize(aC);
|
||||
for (; aItC.More(); aItC.Next()) {
|
||||
const TopoDS_Shape& aS=aItC.Value();
|
||||
aType=aS.ShapeType();
|
||||
if (aType==TopAbs_COMPOUND) {
|
||||
aLC1.Append(aS);
|
||||
}
|
||||
else {
|
||||
aLSX.Append(aS);
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
aNbC1=aLC1.Extent();
|
||||
if (!aNbC1) {
|
||||
break;
|
||||
}
|
||||
//
|
||||
aLC.Clear();
|
||||
aIt.Initialize(aLC1);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
const TopoDS_Shape& aSC=aIt.Value();
|
||||
aLC.Append(aSC);
|
||||
}
|
||||
}// while(1)
|
||||
}
|
||||
//
|
||||
// myErrorStatus
|
||||
//
|
||||
// 0 - Ok
|
||||
// 1 - The object is just initialized
|
||||
// 2 - DSFiller is failed
|
||||
// 2 - PaveFiller is failed
|
||||
// 10 - No shapes to process
|
||||
// 30 - SolidBuilder failed
|
||||
|
@ -29,6 +29,9 @@
|
||||
#ifndef _TopAbs_ShapeEnum_HeaderFile
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Integer_HeaderFile
|
||||
#include <Standard_Integer.hxx>
|
||||
#endif
|
||||
#ifndef _GEOMAlgo_Builder_HeaderFile
|
||||
#include <GEOMAlgo_Builder.hxx>
|
||||
#endif
|
||||
@ -82,6 +85,12 @@ Standard_EXPORT void SetLimit(const TopAbs_ShapeEnum aLimit) ;
|
||||
|
||||
Standard_EXPORT TopAbs_ShapeEnum Limit() const;
|
||||
|
||||
|
||||
Standard_EXPORT void SetLimitMode(const Standard_Integer aLimitMode) ;
|
||||
|
||||
|
||||
Standard_EXPORT Standard_Integer LimitMode() const;
|
||||
|
||||
//! Adds Tool arguments of the operation as <br>
|
||||
//! shapes of upper level of container shape theShape <br>
|
||||
//! ===================================================== <br>
|
||||
@ -108,6 +117,7 @@ Standard_EXPORT virtual void PostTreat() ;
|
||||
TopTools_ListOfShape myTools;
|
||||
TopTools_MapOfShape myMapTools;
|
||||
TopAbs_ShapeEnum myLimit;
|
||||
Standard_Integer myLimitMode;
|
||||
|
||||
|
||||
private:
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include "SUIT_Session.h"
|
||||
#include "SUIT_MessageBox.h"
|
||||
|
||||
#include <qlabel.h>
|
||||
#include <qpushbutton.h>
|
||||
|
||||
using namespace std;
|
||||
@ -57,12 +58,14 @@ GEOMBase_Skeleton::GEOMBase_Skeleton(GeometryGUI* theGeometryGUI, QWidget* paren
|
||||
if (!name)
|
||||
setName("GEOMBase_Skeleton");
|
||||
|
||||
GroupBoxName->setTitle(tr("GEOM_RESULT_NAME_GRP"));
|
||||
NameLabel->setText(tr("GEOM_RESULT_NAME_LBL"));
|
||||
|
||||
buttonCancel->setText(tr("GEOM_BUT_CLOSE"));
|
||||
buttonOk->setText(tr("GEOM_BUT_OK"));
|
||||
buttonApply->setText(tr("GEOM_BUT_APPLY"));
|
||||
buttonHelp->setText(tr("GEOM_BUT_HELP"));
|
||||
|
||||
GroupMedium->close(TRUE);
|
||||
resize(0, 0);
|
||||
|
||||
Init();
|
||||
|
@ -222,7 +222,7 @@ TopoDS_Shape GEOM_Client::GetShape( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Object_p
|
||||
TopExp::MapShapes(aMainShape, anIndices);
|
||||
|
||||
/* Case of only one subshape */
|
||||
if (list->length() == 1) {
|
||||
if (list->length() == 1 && list[0] > 0) {
|
||||
S = anIndices.FindKey(list[0]);
|
||||
}
|
||||
else {
|
||||
|
@ -1189,6 +1189,9 @@ msgstr "\nShading"
|
||||
msgid "GEOM_RECONSTRUCTION_LIMIT"
|
||||
msgstr "Reconstruction Limit"
|
||||
|
||||
msgid "GEOM_KEEP_NONLIMIT_SHAPES"
|
||||
msgstr "Keep nonlimit shapes"
|
||||
|
||||
msgid "GEOM_SUPPRESS_RESULT"
|
||||
msgstr "Suppress Result"
|
||||
|
||||
|
@ -1190,6 +1190,9 @@ msgstr "Ombré"
|
||||
msgid "GEOM_RECONSTRUCTION_LIMIT"
|
||||
msgstr "Limite de Reconstruction"
|
||||
|
||||
msgid "GEOM_KEEP_NONLIMIT_SHAPES"
|
||||
msgstr "Keep nonlimit shapes"
|
||||
|
||||
msgid "GEOM_SUPPRESS_RESULT"
|
||||
msgstr "Supprimer le Resultat"
|
||||
|
||||
|
@ -205,14 +205,14 @@ GEOM::GEOM_Object_ptr GEOMGUI_Selection::getObject( const int index ) const
|
||||
return GEOM::GEOM_Object::_nil();
|
||||
}
|
||||
|
||||
QString GEOMGUI_Selection:: selectionMode() const
|
||||
{
|
||||
QString GEOMGUI_Selection::selectionMode() const
|
||||
{
|
||||
SalomeApp_Application* app = (SalomeApp_Application*)(SUIT_Session::session()->activeApplication());
|
||||
if (app) {
|
||||
GeometryGUI* aGeomGUI = dynamic_cast<GeometryGUI*>( app->module( "Geometry" ) );
|
||||
if(aGeomGUI)
|
||||
switch(aGeomGUI->getLocalSelectionMode())
|
||||
{
|
||||
if (aGeomGUI) {
|
||||
switch (aGeomGUI->getLocalSelectionMode())
|
||||
{
|
||||
case GEOM_POINT : return "VERTEX";
|
||||
case GEOM_EDGE : return "EDGE";
|
||||
case GEOM_WIRE : return "WIRE";
|
||||
@ -222,6 +222,8 @@ QString GEOMGUI_Selection:: selectionMode() const
|
||||
case GEOM_COMPOUND : return "COMPOUND";
|
||||
case GEOM_ALLOBJECTS : return "ALL";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
@ -82,6 +82,7 @@
|
||||
#include <gp_Pln.hxx>
|
||||
#include <TColStd_MapOfInteger.hxx>
|
||||
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
|
||||
// VTK Includes
|
||||
#include <vtkActorCollection.h>
|
||||
@ -525,8 +526,12 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
|
||||
Handle(GEOM_AISShape) AISShape;
|
||||
if (myType == GEOM_VECTOR)
|
||||
AISShape = new GEOM_AISVector (myShape, "");
|
||||
else
|
||||
else {
|
||||
if (myShape.ShapeType() != TopAbs_VERTEX && // fix pb with not displayed points
|
||||
!TopoDS_Iterator(myShape).More())
|
||||
return;// NPAL15983 (Bug when displaying empty groups)
|
||||
AISShape = new GEOM_AISShape (myShape, "");
|
||||
}
|
||||
// Temporary staff: vertex must be infinite for correct visualization
|
||||
AISShape->SetInfiniteState( myShape.Infinite() || myShape.ShapeType() == TopAbs_VERTEX );
|
||||
|
||||
|
@ -1312,6 +1312,9 @@ msgstr "\nShading"
|
||||
msgid "GEOM_RECONSTRUCTION_LIMIT"
|
||||
msgstr "Reconstruction Limit"
|
||||
|
||||
msgid "GEOM_KEEP_NONLIMIT_SHAPES"
|
||||
msgstr "Keep nonlimit shapes"
|
||||
|
||||
msgid "GEOM_SUPPRESS_RESULT"
|
||||
msgstr "Suppress Result"
|
||||
|
||||
@ -2939,6 +2942,12 @@ msgstr "Rename"
|
||||
msgid "NAME_LBL"
|
||||
msgstr "Name: "
|
||||
|
||||
msgid "GEOM_RESULT_NAME_GRP"
|
||||
msgstr "Result name"
|
||||
|
||||
msgid "GEOM_RESULT_NAME_LBL"
|
||||
msgstr "Name"
|
||||
|
||||
msgid "GEOM_ERR_GET_ENGINE"
|
||||
msgstr "Failed to obtain GEOM Engine component. Reload Geometry module and try again."
|
||||
|
||||
|
@ -1238,6 +1238,9 @@ msgstr "Ombré"
|
||||
msgid "GEOM_RECONSTRUCTION_LIMIT"
|
||||
msgstr "Limite de Reconstruction"
|
||||
|
||||
msgid "GEOM_KEEP_NONLIMIT_SHAPES"
|
||||
msgstr "Keep nonlimit shapes"
|
||||
|
||||
msgid "GEOM_SUPPRESS_RESULT"
|
||||
msgstr "Supprimer le Resultat"
|
||||
|
||||
|
@ -35,18 +35,16 @@
|
||||
#include <TopExp.hxx>
|
||||
|
||||
#include <GC_MakeArcOfCircle.hxx>
|
||||
#include <GC_MakeCircle.hxx>
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gce_MakeCirc.hxx>
|
||||
#include <gce_MakePln.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <gp_Circ.hxx>
|
||||
#include <Geom_Circle.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
|
||||
|
||||
#include "utilities.h"
|
||||
|
||||
//=======================================================================
|
||||
//function : GetID
|
||||
//purpose :
|
||||
@ -79,46 +77,54 @@ Standard_Integer GEOMImpl_ArcDriver::Execute(TFunction_Logbook& log) const
|
||||
Standard_Integer aType = aFunction->GetType();
|
||||
|
||||
TopoDS_Shape aShape;
|
||||
if ((aType == CIRC_ARC_THREE_PNT)||(aType == CIRC_ARC_CENTER)) {
|
||||
if ((aType == CIRC_ARC_THREE_PNT) || (aType == CIRC_ARC_CENTER))
|
||||
{
|
||||
Handle(GEOM_Function) aRefPoint1 = aCI.GetPoint1();
|
||||
Handle(GEOM_Function) aRefPoint2 = aCI.GetPoint2();
|
||||
Handle(GEOM_Function) aRefPoint3 = aCI.GetPoint3();
|
||||
|
||||
TopoDS_Shape aShapePnt1 = aRefPoint1->GetValue();
|
||||
TopoDS_Shape aShapePnt2 = aRefPoint2->GetValue();
|
||||
TopoDS_Shape aShapePnt3 = aRefPoint3->GetValue();
|
||||
|
||||
if (aShapePnt1.ShapeType() == TopAbs_VERTEX &&
|
||||
aShapePnt2.ShapeType() == TopAbs_VERTEX &&
|
||||
aShapePnt3.ShapeType() == TopAbs_VERTEX) {
|
||||
aShapePnt3.ShapeType() == TopAbs_VERTEX)
|
||||
{
|
||||
gp_Pnt aP1 = BRep_Tool::Pnt(TopoDS::Vertex(aShapePnt1));
|
||||
gp_Pnt aP2 = BRep_Tool::Pnt(TopoDS::Vertex(aShapePnt2));
|
||||
gp_Pnt aP3 = BRep_Tool::Pnt(TopoDS::Vertex(aShapePnt3));
|
||||
|
||||
if (aP1.Distance(aP2) < gp::Resolution() ||
|
||||
aP1.Distance(aP3) < gp::Resolution() ||
|
||||
aP2.Distance(aP3) < gp::Resolution())
|
||||
Standard_ConstructionError::Raise("Arc creation aborted: coincident points given");
|
||||
|
||||
if (gp_Vec(aP1, aP2).IsParallel(gp_Vec(aP1, aP3), Precision::Angular()))
|
||||
Standard_ConstructionError::Raise("Arc creation aborted: points lay on one line");
|
||||
if (aType == CIRC_ARC_THREE_PNT){
|
||||
GC_MakeArcOfCircle arc(aP1, aP2, aP3);
|
||||
aShape = BRepBuilderAPI_MakeEdge(arc).Edge();
|
||||
|
||||
if (aType == CIRC_ARC_THREE_PNT)
|
||||
{
|
||||
GC_MakeArcOfCircle arc (aP1, aP2, aP3);
|
||||
aShape = BRepBuilderAPI_MakeEdge(arc).Edge();
|
||||
}
|
||||
if (aType == CIRC_ARC_CENTER){
|
||||
Standard_Real Rad = aP1.Distance(aP2);
|
||||
gce_MakeCirc MC(aP1,gce_MakePln(aP1, aP2, aP3).Value(),Rad);
|
||||
else // CIRC_ARC_CENTER
|
||||
{
|
||||
Standard_Boolean sense = aCI.GetSense();
|
||||
if (MC.IsDone()) {
|
||||
const gp_Circ& Circ = MC.Value();
|
||||
Standard_Real Alpha1 = ElCLib::Parameter(Circ,aP2);
|
||||
Standard_Real Alpha2 = ElCLib::Parameter(Circ,aP3);
|
||||
Handle(Geom_Circle) C = new Geom_Circle(Circ);
|
||||
Handle(Geom_TrimmedCurve) TheArc;
|
||||
if (!sense)
|
||||
TheArc= new Geom_TrimmedCurve(C,Alpha1,Alpha2,false);
|
||||
if (sense)
|
||||
TheArc= new Geom_TrimmedCurve(C,Alpha2,Alpha1,false);
|
||||
aShape = BRepBuilderAPI_MakeEdge(TheArc).Edge();
|
||||
}
|
||||
|
||||
Standard_Real aRad = aP1.Distance(aP2);
|
||||
gp_Vec aV1 (aP1, aP2);
|
||||
gp_Vec aV2 (aP1, aP3);
|
||||
gp_Vec aN = aV1 ^ aV2;
|
||||
|
||||
if (sense)
|
||||
aN = -aN;
|
||||
|
||||
GC_MakeCircle circ (aP1, aN, aRad);
|
||||
Handle(Geom_Circle) aGeomCirc = circ.Value();
|
||||
|
||||
GC_MakeArcOfCircle arc (aGeomCirc->Circ(), aP2, aP3, Standard_True);
|
||||
aShape = BRepBuilderAPI_MakeEdge(arc).Edge();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -129,8 +135,7 @@ Standard_Integer GEOMImpl_ArcDriver::Execute(TFunction_Logbook& log) const
|
||||
aFunction->SetValue(aShape);
|
||||
|
||||
log.SetTouched(Label());
|
||||
MESSAGE("Out of building step ...");
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
@ -34,7 +34,8 @@
|
||||
#include <GEOM_Function.hxx>
|
||||
|
||||
#include <ShHealOper_Sewing.hxx>
|
||||
#include <NMTAlgo_Splitter1.hxx>
|
||||
//#include <NMTAlgo_Splitter1.hxx>
|
||||
#include <GEOMAlgo_Gluer.hxx>
|
||||
#include <BlockFix_BlockFixAPI.hxx>
|
||||
|
||||
#include "utilities.h"
|
||||
@ -470,14 +471,21 @@ Standard_Integer GEOMImpl_BlockDriver::Execute(TFunction_Logbook& log) const
|
||||
TopoDS_Shape aCompound = anArgs(1);
|
||||
|
||||
// Glue coincident faces and edges (with Partition algorithm).
|
||||
NMTAlgo_Splitter1 PS;
|
||||
PS.AddShape(aCompound);
|
||||
PS.Compute();
|
||||
PS.SetRemoveWebs(Standard_False);
|
||||
// PS.Build(aCompound.ShapeType());
|
||||
PS.Build(TopAbs_SOLID);
|
||||
//NMTAlgo_Splitter1 PS;
|
||||
//PS.AddShape(aCompound);
|
||||
//PS.Compute();
|
||||
//PS.SetRemoveWebs(Standard_False);
|
||||
// PS.Build(aCompound.ShapeType());
|
||||
//PS.Build(TopAbs_SOLID);
|
||||
//aShape = PS.Shape();
|
||||
|
||||
GEOMAlgo_Gluer aGluer;
|
||||
aGluer.SetShape(aCompound);
|
||||
aGluer.SetCheckGeometry(Standard_True);
|
||||
aGluer.Perform();
|
||||
aShape = aGluer.Result();
|
||||
|
||||
|
||||
aShape = PS.Shape();
|
||||
} else {
|
||||
}
|
||||
|
||||
@ -537,7 +545,7 @@ Standard_Integer GEOMImpl_BlockDriver::Execute(TFunction_Logbook& log) const
|
||||
}
|
||||
|
||||
// 5. Glue Faces
|
||||
aShape = GEOMImpl_GlueDriver::GlueFaces(aComp, Precision::Confusion());
|
||||
aShape = GEOMImpl_GlueDriver::GlueFaces(aComp, Precision::Confusion(), Standard_False);
|
||||
}
|
||||
|
||||
} else if (aType == BLOCK_MULTI_TRANSFORM_1D ||
|
||||
@ -643,7 +651,7 @@ Standard_Integer GEOMImpl_BlockDriver::Execute(TFunction_Logbook& log) const
|
||||
}
|
||||
|
||||
// Glue faces of the multi-block
|
||||
aShape = GEOMImpl_GlueDriver::GlueFaces(aMulti, aTol);
|
||||
aShape = GEOMImpl_GlueDriver::GlueFaces(aMulti, aTol, Standard_False);
|
||||
|
||||
} else { // unknown function type
|
||||
return 0;
|
||||
|
@ -153,6 +153,7 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute(TFunction_Logbook& log) const
|
||||
}
|
||||
|
||||
if (isCompound) {
|
||||
/*
|
||||
TopTools_ListOfShape listShapeC;
|
||||
AddSimpleShapes(C, listShapeC);
|
||||
TopTools_ListIteratorOfListOfShape itSubC (listShapeC);
|
||||
@ -165,6 +166,14 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute(TFunction_Logbook& log) const
|
||||
aShape = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion());
|
||||
else
|
||||
aShape = C;
|
||||
*/
|
||||
|
||||
// As GlueFaces has been improved to keep all kind of shapes
|
||||
TopExp_Explorer anExp (C, TopAbs_VERTEX);
|
||||
if (anExp.More())
|
||||
aShape = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion(), Standard_True);
|
||||
else
|
||||
aShape = C;
|
||||
}
|
||||
}
|
||||
|
||||
@ -215,6 +224,7 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute(TFunction_Logbook& log) const
|
||||
}
|
||||
|
||||
if (isCompound) {
|
||||
/*
|
||||
TopTools_ListOfShape listShapeC;
|
||||
AddSimpleShapes(C, listShapeC);
|
||||
TopTools_ListIteratorOfListOfShape itSubC (listShapeC);
|
||||
@ -227,11 +237,20 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute(TFunction_Logbook& log) const
|
||||
aShape = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion());
|
||||
else
|
||||
aShape = C;
|
||||
*/
|
||||
|
||||
// As GlueFaces has been improved to keep all kind of shapes
|
||||
TopExp_Explorer anExp (C, TopAbs_VERTEX);
|
||||
if (anExp.More())
|
||||
aShape = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion(), Standard_True);
|
||||
else
|
||||
aShape = C;
|
||||
}
|
||||
}
|
||||
|
||||
// perform FUSE operation
|
||||
else if (aType == BOOLEAN_FUSE) {
|
||||
/* Fix for NPAL15379: refused
|
||||
// Check arguments
|
||||
TopTools_ListOfShape listShape1, listShape2;
|
||||
AddSimpleShapes(aShape1, listShape1);
|
||||
@ -305,6 +324,7 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute(TFunction_Logbook& log) const
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// Perform
|
||||
BRepAlgoAPI_Fuse BO (aShape1, aShape2);
|
||||
@ -367,8 +387,16 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute(TFunction_Logbook& log) const
|
||||
}
|
||||
}
|
||||
|
||||
if (isCompound)
|
||||
aShape = C;
|
||||
if (isCompound) {
|
||||
//aShape = C;
|
||||
|
||||
// As GlueFaces has been improved to keep all kind of shapes
|
||||
TopExp_Explorer anExp (C, TopAbs_VERTEX);
|
||||
if (anExp.More())
|
||||
aShape = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion(), Standard_True);
|
||||
else
|
||||
aShape = C;
|
||||
}
|
||||
}
|
||||
|
||||
// UNKNOWN operation
|
||||
|
@ -113,7 +113,10 @@ Standard_Integer GEOMImpl_ExportDriver::Execute(TFunction_Logbook& log) const
|
||||
int res = fp( aShape, aFileName, aFormatName );
|
||||
|
||||
// unload plugin library
|
||||
//UnLoadLib( anExportLib );
|
||||
// commented by enk:
|
||||
// the bug was occured: using ACIS Import/Export plugin
|
||||
// UnLoadLib( anExportLib );
|
||||
|
||||
if ( res )
|
||||
log.SetTouched(Label());
|
||||
|
||||
|
@ -73,6 +73,7 @@ const Standard_GUID& GEOMImpl_GlueDriver::GetID()
|
||||
//=======================================================================
|
||||
TopoDS_Shape GEOMImpl_GlueDriver::GlueFacesWithWarnings (const TopoDS_Shape& theShape,
|
||||
const Standard_Real theTolerance,
|
||||
const Standard_Boolean doKeepNonSolids,
|
||||
TCollection_AsciiString& theWarning) const
|
||||
{
|
||||
Standard_Integer iErr, iWrn;
|
||||
@ -82,6 +83,7 @@ TopoDS_Shape GEOMImpl_GlueDriver::GlueFacesWithWarnings (const TopoDS_Shape& the
|
||||
aGluer.SetShape(theShape);
|
||||
aGluer.SetTolerance(theTolerance);
|
||||
aGluer.SetCheckGeometry(Standard_True);
|
||||
aGluer.SetKeepNonSolids(doKeepNonSolids);
|
||||
|
||||
aGluer.Perform();
|
||||
|
||||
@ -197,7 +199,8 @@ TopoDS_Shape GEOMImpl_GlueDriver::GlueFacesWithWarnings (const TopoDS_Shape& the
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
TopoDS_Shape GEOMImpl_GlueDriver::GlueFaces (const TopoDS_Shape& theShape,
|
||||
const Standard_Real theTolerance)
|
||||
const Standard_Real theTolerance,
|
||||
const Standard_Boolean doKeepNonSolids)
|
||||
{
|
||||
Standard_Integer iErr, iWrn;
|
||||
TopoDS_Shape aRes;
|
||||
@ -206,6 +209,7 @@ TopoDS_Shape GEOMImpl_GlueDriver::GlueFaces (const TopoDS_Shape& theShape,
|
||||
aGluer.SetShape(theShape);
|
||||
aGluer.SetTolerance(theTolerance);
|
||||
aGluer.SetCheckGeometry(Standard_True);
|
||||
aGluer.SetKeepNonSolids(doKeepNonSolids);
|
||||
|
||||
aGluer.Perform();
|
||||
|
||||
@ -261,6 +265,7 @@ TopoDS_Shape GEOMImpl_GlueDriver::GlueFaces (const TopoDS_Shape& theShape,
|
||||
//=======================================================================
|
||||
TopoDS_Shape GEOMImpl_GlueDriver::GlueFacesByList (const TopoDS_Shape& theShape,
|
||||
const Standard_Real theTolerance,
|
||||
const Standard_Boolean doKeepNonSolids,
|
||||
const TopTools_MapOfShape& aFaces)
|
||||
{
|
||||
TopoDS_Shape aRes;
|
||||
@ -272,6 +277,7 @@ TopoDS_Shape GEOMImpl_GlueDriver::GlueFacesByList (const TopoDS_Shape& theShape,
|
||||
|
||||
aGluer.SetShape(theShape);
|
||||
aGluer.SetTolerance(theTolerance);
|
||||
aGluer.SetKeepNonSolids(doKeepNonSolids);
|
||||
aGluer.Perform();
|
||||
Standard_Integer iErr = aGluer.ErrorStatus();
|
||||
if (iErr) return aRes;
|
||||
@ -327,8 +333,10 @@ Standard_Integer GEOMImpl_GlueDriver::Execute(TFunction_Logbook& log) const
|
||||
|
||||
Standard_Real tol3d = aCI.GetTolerance();
|
||||
|
||||
Standard_Boolean aKeepNonSolids = aCI.GetKeepNonSolids();
|
||||
|
||||
if (aType == GLUE_FACES) {
|
||||
aShape = GlueFacesWithWarnings(aShapeBase, tol3d, aWrn);
|
||||
aShape = GlueFacesWithWarnings(aShapeBase, tol3d, aKeepNonSolids, aWrn);
|
||||
}
|
||||
else { // aType == GLUE_FACES_BY_LIST
|
||||
Handle(TColStd_HSequenceOfTransient) SF = aCI.GetFaces();
|
||||
@ -347,7 +355,7 @@ Standard_Integer GEOMImpl_GlueDriver::Execute(TFunction_Logbook& log) const
|
||||
if(!aFaces.Contains(aFace))
|
||||
aFaces.Add(aFace);
|
||||
}
|
||||
aShape = GlueFacesByList(aShapeBase, tol3d, aFaces);
|
||||
aShape = GlueFacesByList(aShapeBase, tol3d, aKeepNonSolids, aFaces);
|
||||
}
|
||||
|
||||
if (aShape.IsNull()) return 0;
|
||||
|
@ -150,14 +150,17 @@ Standard_EXPORT static const Standard_GUID& GetID();
|
||||
Standard_EXPORT ~GEOMImpl_GlueDriver() {};
|
||||
|
||||
Standard_EXPORT static TopoDS_Shape GlueFaces (const TopoDS_Shape& theShape,
|
||||
const Standard_Real theTolerance);
|
||||
const Standard_Real theTolerance,
|
||||
const Standard_Boolean doKeepNonSolids = Standard_True);
|
||||
|
||||
Standard_EXPORT TopoDS_Shape GlueFacesWithWarnings (const TopoDS_Shape& theShape,
|
||||
const Standard_Real theTolerance,
|
||||
const Standard_Boolean doKeepNonSolids,
|
||||
TCollection_AsciiString& theWarning) const;
|
||||
|
||||
Standard_EXPORT static TopoDS_Shape GlueFacesByList (const TopoDS_Shape& theShape,
|
||||
const Standard_Real theTolerance,
|
||||
const Standard_Boolean doKeepNonSolids,
|
||||
const TopTools_MapOfShape& aFaces);
|
||||
|
||||
|
||||
|
@ -148,7 +148,8 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakePartition
|
||||
const Standard_Integer theLimit,
|
||||
const Standard_Boolean theRemoveWebs,
|
||||
const Handle(TColStd_HArray1OfInteger)& theMaterials,
|
||||
const Standard_Boolean thePerformSelfIntersections)
|
||||
const Standard_Integer theKeepNonlimitShapes,
|
||||
const Standard_Boolean thePerformSelfIntersections)
|
||||
{
|
||||
SetErrorCode(KO);
|
||||
|
||||
@ -251,6 +252,7 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakePartition
|
||||
|
||||
// Limit
|
||||
aCI.SetLimit(theLimit);
|
||||
aCI.SetKeepNonlimitShapes(theKeepNonlimitShapes);
|
||||
|
||||
// Materials
|
||||
if (theRemoveWebs) {
|
||||
@ -302,7 +304,7 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakePartition
|
||||
pd << ", " << theMaterials->Value(i);
|
||||
}
|
||||
}
|
||||
pd << "])";
|
||||
pd << "], " << theKeepNonlimitShapes <<")";
|
||||
|
||||
SetErrorCode(OK);
|
||||
return aPartition;
|
||||
|
@ -46,7 +46,8 @@ class GEOMImpl_IBooleanOperations : public GEOM_IOperations {
|
||||
const Standard_Integer theLimit,
|
||||
const Standard_Boolean theRemoveWebs,
|
||||
const Handle(TColStd_HArray1OfInteger)& theMaterials,
|
||||
const Standard_Boolean thePerformSelfIntersections);
|
||||
const Standard_Integer theKeepNonlimitShapes,
|
||||
const Standard_Boolean thePerformSelfIntersections);
|
||||
|
||||
Standard_EXPORT Handle(GEOM_Object) MakeHalfPartition (Handle(GEOM_Object) theShape,
|
||||
Handle(GEOM_Object) thePlane);
|
||||
|
@ -27,6 +27,7 @@
|
||||
#define GLUE_ARG_BASE 1
|
||||
#define GLUE_ARG_TOLER 2
|
||||
#define GLUE_ARG_FACES 3
|
||||
#define GLUE_ARG_KEEPALL 4
|
||||
|
||||
class GEOMImpl_IGlue
|
||||
{
|
||||
@ -50,6 +51,9 @@ class GEOMImpl_IGlue
|
||||
Handle(TColStd_HSequenceOfTransient) GetFaces()
|
||||
{ return _func->GetReferenceList(GLUE_ARG_FACES); }
|
||||
|
||||
void SetKeepNonSolids (Standard_Boolean theFlag) { _func->SetInteger(GLUE_ARG_KEEPALL, theFlag ? 1 : 0); }
|
||||
Standard_Boolean GetKeepNonSolids() { return (_func->GetInteger(GLUE_ARG_KEEPALL) != 0); }
|
||||
|
||||
private:
|
||||
|
||||
Handle(GEOM_Function) _func;
|
||||
|
@ -36,6 +36,8 @@
|
||||
#define PART_ARG_SHAPE 7
|
||||
#define PART_ARG_PLANE 8
|
||||
|
||||
#define PART_ARG_KEEP_NONLIMIT_SHAPES 9
|
||||
|
||||
class GEOMImpl_IPartition
|
||||
{
|
||||
public:
|
||||
@ -44,6 +46,9 @@ class GEOMImpl_IPartition
|
||||
|
||||
void SetLimit(int theLimit) { _func->SetInteger(PART_ARG_LIMIT, theLimit); }
|
||||
|
||||
void SetKeepNonlimitShapes(int theKeepNonlimitShapes)
|
||||
{ _func->SetInteger(PART_ARG_KEEP_NONLIMIT_SHAPES,theKeepNonlimitShapes ); }
|
||||
|
||||
void SetShapes(const Handle(TColStd_HSequenceOfTransient)& theShapes)
|
||||
{ _func->SetReferenceList(PART_ARG_SHAPES, theShapes); }
|
||||
|
||||
@ -62,6 +67,8 @@ class GEOMImpl_IPartition
|
||||
|
||||
int GetLimit() { return _func->GetInteger(PART_ARG_LIMIT); }
|
||||
|
||||
int GetKeepNonlimitShapes() { return _func->GetInteger(PART_ARG_KEEP_NONLIMIT_SHAPES); }
|
||||
|
||||
Handle(TColStd_HSequenceOfTransient) GetShapes() { return _func->GetReferenceList(PART_ARG_SHAPES); }
|
||||
Handle(TColStd_HSequenceOfTransient) GetTools() { return _func->GetReferenceList(PART_ARG_TOOLS); }
|
||||
Handle(TColStd_HSequenceOfTransient) GetKeepIns() { return _func->GetReferenceList(PART_ARG_KEEP_IN); }
|
||||
|
@ -17,6 +17,11 @@
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
// File : GEOMImpl_IShapesOperations.cxx
|
||||
// Created :
|
||||
// Author : modified by Lioka RAZAFINDRAZAKA (CEA) 22/06/2007
|
||||
// Project : SALOME
|
||||
// $Header$
|
||||
|
||||
#include <Standard_Stream.hxx>
|
||||
|
||||
@ -42,7 +47,6 @@
|
||||
#include "GEOMAlgo_FinderShapeOnQuad.hxx"
|
||||
#include "GEOMAlgo_FinderShapeOn2.hxx"
|
||||
#include "GEOMAlgo_ClsfBox.hxx"
|
||||
//#include "GEOMAlgo_ClsfSurf.hxx"
|
||||
#include "GEOMAlgo_Gluer1.hxx"
|
||||
#include "GEOMAlgo_ListIteratorOfListOfCoupleOfShapes.hxx"
|
||||
#include "GEOMAlgo_CoupleOfShapes.hxx"
|
||||
@ -62,6 +66,7 @@
|
||||
#include <BRepExtrema_ExtCF.hxx>
|
||||
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <BRepGProp.hxx>
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
@ -78,6 +83,7 @@
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopLoc_Location.hxx>
|
||||
@ -110,6 +116,16 @@
|
||||
#include <Standard_Failure.hxx>
|
||||
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
|
||||
|
||||
// Includes added for GetInPlace algorithm improvement
|
||||
|
||||
#include <GEOMImpl_MeasureDriver.hxx>
|
||||
#include <GEOMImpl_IMeasure.hxx>
|
||||
#include <BRepBuilderAPI_MakeVertex.hxx>
|
||||
|
||||
#include <BRepClass_FaceClassifier.hxx>
|
||||
#include <BRepClass3d_SolidClassifier.hxx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
* constructor:
|
||||
@ -496,7 +512,8 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeShape
|
||||
//=============================================================================
|
||||
Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeGlueFaces
|
||||
(Handle(GEOM_Object) theShape,
|
||||
const Standard_Real theTolerance)
|
||||
const Standard_Real theTolerance,
|
||||
const Standard_Boolean doKeepNonSolids)
|
||||
{
|
||||
SetErrorCode(KO);
|
||||
|
||||
@ -520,6 +537,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeGlueFaces
|
||||
|
||||
aCI.SetBase(aRefShape);
|
||||
aCI.SetTolerance(theTolerance);
|
||||
aCI.SetKeepNonSolids(doKeepNonSolids);
|
||||
|
||||
//Compute the sub-shape value
|
||||
Standard_Boolean isWarning = Standard_False;
|
||||
@ -635,7 +653,8 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetGlueFaces
|
||||
Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeGlueFacesByList
|
||||
(Handle(GEOM_Object) theShape,
|
||||
const Standard_Real theTolerance,
|
||||
list<Handle(GEOM_Object)> theFaces)
|
||||
list<Handle(GEOM_Object)> theFaces,
|
||||
const Standard_Boolean doKeepNonSolids)
|
||||
{
|
||||
SetErrorCode(KO);
|
||||
|
||||
@ -659,6 +678,8 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeGlueFacesByList
|
||||
|
||||
aCI.SetBase(aRefShape);
|
||||
aCI.SetTolerance(theTolerance);
|
||||
aCI.SetKeepNonSolids(doKeepNonSolids);
|
||||
|
||||
Handle(TColStd_HSequenceOfTransient) aFaces = new TColStd_HSequenceOfTransient;
|
||||
list<Handle(GEOM_Object)>::iterator it = theFaces.begin();
|
||||
for (; it != theFaces.end(); it++) {
|
||||
@ -1420,6 +1441,12 @@ Handle(TColStd_HSequenceOfInteger)
|
||||
TopoDS_Shape aBox = theBox->GetValue();
|
||||
TopoDS_Shape aShape = theShape->GetValue();
|
||||
|
||||
// Check presence of triangulation, build if need
|
||||
if (!CheckTriangulation(aShape)) {
|
||||
SetErrorCode("Cannot build triangulation on the shape");
|
||||
return aSeqOfIDs;
|
||||
}
|
||||
|
||||
// Call algo
|
||||
GEOMAlgo_FinderShapeOn2 aFinder;
|
||||
Standard_Real aTol = 0.0001; // default value
|
||||
@ -1581,8 +1608,10 @@ Handle(TColStd_HSequenceOfInteger)
|
||||
Handle(TColStd_HSequenceOfInteger) aSeqOfIDs;
|
||||
|
||||
// Check presence of triangulation, build if need
|
||||
if (!CheckTriangulation(theShape))
|
||||
if (!CheckTriangulation(theShape)) {
|
||||
SetErrorCode("Cannot build triangulation on the shape");
|
||||
return aSeqOfIDs;
|
||||
}
|
||||
|
||||
// Call algo
|
||||
GEOMAlgo_FinderShapeOn1 aFinder;
|
||||
@ -2201,8 +2230,10 @@ Handle(TColStd_HSequenceOfInteger)
|
||||
Handle(TColStd_HSequenceOfInteger) aSeqOfIDs;
|
||||
|
||||
// Check presence of triangulation, build if need
|
||||
if (!CheckTriangulation(aShape))
|
||||
if (!CheckTriangulation(aShape)) {
|
||||
SetErrorCode("Cannot build triangulation on the shape");
|
||||
return aSeqOfIDs;
|
||||
}
|
||||
|
||||
// Call algo
|
||||
gp_Pnt aPntTL = BRep_Tool::Pnt(TopoDS::Vertex(aTL));
|
||||
@ -2392,7 +2423,7 @@ Handle(TColStd_HSequenceOfInteger)
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
* GetInPlace
|
||||
* GetInPlaceOfShape
|
||||
*/
|
||||
//=============================================================================
|
||||
static bool GetInPlaceOfShape (const Handle(GEOM_Function)& theWhereFunction,
|
||||
@ -2514,7 +2545,182 @@ static bool GetInPlaceOfShape (const Handle(GEOM_Function)& theWhereFunction,
|
||||
return isFound;
|
||||
}
|
||||
|
||||
Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace
|
||||
//=============================================================================
|
||||
/*!
|
||||
* GetShapeProperties
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
void GEOMImpl_IShapesOperations::GetShapeProperties( const TopoDS_Shape aShape, Standard_Real tab[],
|
||||
gp_Pnt & aVertex )
|
||||
{
|
||||
GProp_GProps SProps, VProps;
|
||||
gp_Pnt aCenterMass;
|
||||
TopoDS_Shape aPntShape;
|
||||
Standard_Real aShapeSize;
|
||||
|
||||
BRepGProp::VolumeProperties(aShape, VProps);
|
||||
aCenterMass = VProps.CentreOfMass();
|
||||
aShapeSize = VProps.Mass();
|
||||
if (aShape.ShapeType() == TopAbs_FACE) {
|
||||
BRepGProp::SurfaceProperties(aShape, SProps);
|
||||
aCenterMass = SProps.CentreOfMass();
|
||||
aShapeSize = SProps.Mass();
|
||||
}
|
||||
|
||||
aPntShape = BRepBuilderAPI_MakeVertex(aCenterMass).Shape();
|
||||
aVertex = BRep_Tool::Pnt( TopoDS::Vertex( aPntShape ) );
|
||||
tab[0] = aVertex.X();
|
||||
tab[1] = aVertex.Y();
|
||||
tab[2] = aVertex.Z();
|
||||
tab[3] = aShapeSize;
|
||||
return;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
* GetInPlace
|
||||
*/
|
||||
//=============================================================================
|
||||
Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object) theShapeWhere,
|
||||
Handle(GEOM_Object) theShapeWhat)
|
||||
{
|
||||
SetErrorCode(KO);
|
||||
|
||||
if (theShapeWhere.IsNull() || theShapeWhat.IsNull()) return NULL;
|
||||
|
||||
TopoDS_Shape aWhere = theShapeWhere->GetValue();
|
||||
TopoDS_Shape aWhat = theShapeWhat->GetValue();
|
||||
|
||||
if (aWhere.IsNull() || aWhat.IsNull()) {
|
||||
SetErrorCode("Error: aWhere and aWhat TopoDS_Shape are Null.");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Handle(GEOM_Function) aWhereFunction = theShapeWhere->GetLastFunction();
|
||||
if (aWhereFunction.IsNull()) {
|
||||
SetErrorCode("Error: aWhereFunction is Null.");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
TopTools_IndexedMapOfShape aWhereIndices;
|
||||
TopExp::MapShapes(aWhere, aWhereIndices);
|
||||
|
||||
TColStd_ListOfInteger aModifiedList;
|
||||
Standard_Integer aWhereIndex;
|
||||
Handle(TColStd_HArray1OfInteger) aModifiedArray;
|
||||
Handle(GEOM_Object) aResult;
|
||||
|
||||
bool isFound = false;
|
||||
Standard_Integer iType = TopAbs_SOLID;
|
||||
Standard_Real aWhat_Mass = 0., aWhere_Mass = 0.;
|
||||
Standard_Real tab_aWhat[4], tab_aWhere[4];
|
||||
Standard_Real dl_l = 1e-3;
|
||||
Standard_Real min_l, Tol_1D, Tol_2D, Tol_3D, Tol_Mass;
|
||||
gp_Pnt aPnt, aPnt_aWhat;
|
||||
GProp_GProps aProps;
|
||||
|
||||
// 2D or 3D shapes
|
||||
if ( aWhat.ShapeType() == TopAbs_COMPOUND ||
|
||||
aWhat.ShapeType() == TopAbs_SHELL ||
|
||||
aWhat.ShapeType() == TopAbs_COMPSOLID ) {
|
||||
TopExp_Explorer Exp( aWhat, TopAbs_ShapeEnum( iType ) );
|
||||
if ( ! Exp.More() ) iType = TopAbs_FACE;
|
||||
}
|
||||
else if ( aWhat.ShapeType() == TopAbs_FACE )
|
||||
iType = TopAbs_FACE;
|
||||
|
||||
TopExp_Explorer Exp_aWhat( aWhat, TopAbs_ShapeEnum( iType ) );
|
||||
TopExp_Explorer Exp_aWhere( aWhere, TopAbs_ShapeEnum( iType ) );
|
||||
TopExp_Explorer Exp_Edge( aWhere, TopAbs_EDGE );
|
||||
|
||||
// Find the shortest edge in theShapeWhere shape
|
||||
for ( Standard_Integer nbEdge = 0; Exp_Edge.More(); Exp_Edge.Next(), nbEdge++ ) {
|
||||
BRepGProp::LinearProperties(Exp_Edge.Current(), aProps);
|
||||
if ( ! nbEdge ) min_l = aProps.Mass();
|
||||
if ( aProps.Mass() < min_l ) min_l = aProps.Mass();
|
||||
}
|
||||
|
||||
// Compute tolerances
|
||||
Tol_1D = dl_l * min_l;
|
||||
Tol_2D = dl_l * ( min_l * min_l) * ( 2. + dl_l);
|
||||
Tol_3D = dl_l * ( min_l * min_l * min_l ) * ( 3. + (3 * dl_l) + (dl_l * dl_l) );
|
||||
|
||||
Tol_Mass = Tol_3D;
|
||||
if ( iType == TopAbs_FACE ) Tol_Mass = Tol_2D;
|
||||
|
||||
// Compute the ShapeWhat Mass
|
||||
for ( ; Exp_aWhat.More(); Exp_aWhat.Next() ) {
|
||||
if ( iType == TopAbs_SOLID ) BRepGProp::VolumeProperties(Exp_aWhat.Current(), aProps);
|
||||
else if ( iType == TopAbs_FACE ) BRepGProp::SurfaceProperties(Exp_aWhat.Current(), aProps);
|
||||
aWhat_Mass += aProps.Mass();
|
||||
}
|
||||
|
||||
// Finding the Sub-ShapeWhere
|
||||
for ( Exp_aWhere.ReInit(); Exp_aWhere.More(); Exp_aWhere.Next() ) {
|
||||
GetShapeProperties( Exp_aWhere.Current(), tab_aWhere, aPnt );
|
||||
for ( Exp_aWhat.ReInit(); Exp_aWhat.More(); Exp_aWhat.Next() ) {
|
||||
GetShapeProperties( Exp_aWhat.Current(), tab_aWhat, aPnt_aWhat );
|
||||
if ( fabs(tab_aWhat[3] - tab_aWhere[3]) <= Tol_Mass && aPnt_aWhat.Distance(aPnt) <= Tol_1D )
|
||||
isFound = true;
|
||||
else if ( tab_aWhat[3] - ( tab_aWhere[3] > Tol_Mass) ) {
|
||||
BRepClass3d_SolidClassifier SC_aWhere (Exp_aWhere.Current(), aPnt, Precision::Confusion());
|
||||
BRepClass3d_SolidClassifier SC_aWhat (Exp_aWhat.Current(), aPnt, Precision::Confusion());
|
||||
// Block construction 3D
|
||||
if ( SC_aWhere.State() == TopAbs_IN && SC_aWhat.State() == TopAbs_IN ) isFound = true;
|
||||
// Block construction 2D
|
||||
else if ( SC_aWhere.State() == TopAbs_ON && SC_aWhat.State() == TopAbs_ON ) isFound = true;
|
||||
}
|
||||
if ( isFound ) {
|
||||
aWhereIndex = aWhereIndices.FindIndex(Exp_aWhere.Current());
|
||||
aModifiedList.Append(aWhereIndex);
|
||||
aWhere_Mass += tab_aWhere[3];
|
||||
isFound = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( fabs( aWhat_Mass - aWhere_Mass ) <= Tol_Mass ) break;
|
||||
}
|
||||
|
||||
aModifiedArray = new TColStd_HArray1OfInteger (1, aModifiedList.Extent());
|
||||
TColStd_ListIteratorOfListOfInteger anIterModif (aModifiedList);
|
||||
for (Standard_Integer imod = 1; anIterModif.More(); anIterModif.Next(), imod++)
|
||||
aModifiedArray->SetValue(imod, anIterModif.Value());
|
||||
|
||||
//Add a new object
|
||||
aResult = GetEngine()->AddSubShape(theShapeWhere, aModifiedArray);
|
||||
if (aResult.IsNull()) {
|
||||
SetErrorCode("Error in algorithm: result found, but cannot be returned.");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (aModifiedArray->Length() > 1) {
|
||||
//Set a GROUP type
|
||||
aResult->SetType(GEOM_GROUP);
|
||||
|
||||
//Set a sub shape type
|
||||
TopoDS_Shape aFirstFound = aWhereIndices.FindKey(aModifiedArray->Value(1));
|
||||
TopAbs_ShapeEnum aShapeType = aFirstFound.ShapeType();
|
||||
|
||||
TDF_Label aFreeLabel = aResult->GetFreeLabel();
|
||||
TDataStd_Integer::Set(aFreeLabel, (Standard_Integer)aShapeType);
|
||||
}
|
||||
|
||||
//Make a Python command
|
||||
Handle(GEOM_Function) aFunction = aResult->GetFunction(1);
|
||||
|
||||
GEOM::TPythonDump(aFunction) << aResult << " = geompy.GetInPlace("
|
||||
<< theShapeWhere << ", " << theShapeWhat << ")";
|
||||
|
||||
SetErrorCode(OK);
|
||||
return aResult;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetInPlaceByHistory
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlaceByHistory
|
||||
(Handle(GEOM_Object) theShapeWhere,
|
||||
Handle(GEOM_Object) theShapeWhat)
|
||||
{
|
||||
@ -2645,22 +2851,65 @@ void GEOMImpl_IShapesOperations::SortShapes(TopTools_ListOfShape& SL)
|
||||
SL.Append( aShapes( OrderInd(Index) ));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : CompsolidToCompound
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
TopoDS_Shape GEOMImpl_IShapesOperations::CompsolidToCompound (const TopoDS_Shape& theCompsolid)
|
||||
{
|
||||
if (theCompsolid.ShapeType() != TopAbs_COMPSOLID) {
|
||||
return theCompsolid;
|
||||
}
|
||||
|
||||
TopoDS_Compound aCompound;
|
||||
BRep_Builder B;
|
||||
B.MakeCompound(aCompound);
|
||||
|
||||
TopTools_MapOfShape mapShape;
|
||||
TopoDS_Iterator It (theCompsolid, Standard_True, Standard_True);
|
||||
|
||||
for (; It.More(); It.Next()) {
|
||||
TopoDS_Shape aShape_i = It.Value();
|
||||
if (mapShape.Add(aShape_i)) {
|
||||
B.Add(aCompound, aShape_i);
|
||||
}
|
||||
}
|
||||
|
||||
return aCompound;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : CheckTriangulation
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
bool GEOMImpl_IShapesOperations::CheckTriangulation (const TopoDS_Shape& aShape)
|
||||
{
|
||||
bool isTriangulation = true;
|
||||
|
||||
TopExp_Explorer exp (aShape, TopAbs_FACE);
|
||||
if (!exp.More()) {
|
||||
SetErrorCode("Shape without faces given");
|
||||
return false;
|
||||
if (exp.More())
|
||||
{
|
||||
TopLoc_Location aTopLoc;
|
||||
Handle(Poly_Triangulation) aTRF;
|
||||
aTRF = BRep_Tool::Triangulation(TopoDS::Face(exp.Current()), aTopLoc);
|
||||
if (aTRF.IsNull()) {
|
||||
isTriangulation = false;
|
||||
}
|
||||
}
|
||||
else // no faces, try edges
|
||||
{
|
||||
TopExp_Explorer expe (aShape, TopAbs_EDGE);
|
||||
if (!expe.More()) {
|
||||
return false;
|
||||
}
|
||||
TopLoc_Location aLoc;
|
||||
Handle(Poly_Polygon3D) aPE = BRep_Tool::Polygon3D(TopoDS::Edge(expe.Current()), aLoc);
|
||||
if (aPE.IsNull()) {
|
||||
isTriangulation = false;
|
||||
}
|
||||
}
|
||||
|
||||
TopLoc_Location aTopLoc;
|
||||
Handle(Poly_Triangulation) aTRF;
|
||||
aTRF = BRep_Tool::Triangulation(TopoDS::Face(exp.Current()), aTopLoc);
|
||||
if (aTRF.IsNull()) {
|
||||
if (!isTriangulation) {
|
||||
// calculate deflection
|
||||
Standard_Real aDeviationCoefficient = 0.001;
|
||||
|
||||
@ -2773,6 +3022,7 @@ static bool isSameFace(const TopoDS_Face& theFace1, const TopoDS_Face& theFace2)
|
||||
if(P.Z() > zmaxB2) zmaxB2 = P.Z();
|
||||
}
|
||||
|
||||
|
||||
//Compare the bounding boxes of both faces
|
||||
if(gp_Pnt(xminB1, yminB1, zminB1).Distance(gp_Pnt(xminB2, yminB2, zminB2)) > MAX_TOLERANCE)
|
||||
return false;
|
||||
@ -2780,6 +3030,33 @@ static bool isSameFace(const TopoDS_Face& theFace1, const TopoDS_Face& theFace2)
|
||||
if(gp_Pnt(xmaxB1, ymaxB1, zmaxB1).Distance(gp_Pnt(xmaxB2, ymaxB2, zmaxB2)) > MAX_TOLERANCE)
|
||||
return false;
|
||||
|
||||
Handle(Geom_Surface) S1 = BRep_Tool::Surface(theFace1);
|
||||
Handle(Geom_Surface) S2 = BRep_Tool::Surface(theFace2);
|
||||
|
||||
//Check if there a coincidence of two surfaces at least in two points
|
||||
double U11, U12, V11, V12, U21, U22, V21, V22;
|
||||
BRepTools::UVBounds(theFace1, U11, U12, V11, V12);
|
||||
BRepTools::UVBounds(theFace2, U21, U22, V21, V22);
|
||||
|
||||
double rangeU = U12-U11;
|
||||
double rangeV = V12-V11;
|
||||
double U = U11 + rangeU/3.0;
|
||||
double V = V11 + rangeV/3.0;
|
||||
gp_Pnt P1 = S1->Value(U, V);
|
||||
U = U11+rangeU*2.0/3.0;
|
||||
V = V11+rangeV*2.0/3.0;
|
||||
gp_Pnt P2 = S1->Value(U, V);
|
||||
|
||||
if(!GeomLib_Tool::Parameters(S2, P1, MAX_TOLERANCE, U, V) || U < U21 || U > U22 || V < V21 || V > V22)
|
||||
return false;
|
||||
|
||||
if(P1.Distance(S2->Value(U,V)) > MAX_TOLERANCE) return false;
|
||||
|
||||
if(!GeomLib_Tool::Parameters(S2, P2, MAX_TOLERANCE, U, V) || U < U21 || U > U22 || V < V21 || V > V22)
|
||||
return false;
|
||||
|
||||
if(P2.Distance(S2->Value(U, V)) > MAX_TOLERANCE) return false;
|
||||
|
||||
//Check that each edge of the Face1 has a counterpart in the Face2
|
||||
TopTools_MapOfOrientedShape aMap;
|
||||
TopTools_ListIteratorOfListOfShape LSI1(LS1);
|
||||
@ -2799,36 +3076,6 @@ static bool isSameFace(const TopoDS_Face& theFace1, const TopoDS_Face& theFace2)
|
||||
if(!isFound) return false;
|
||||
}
|
||||
|
||||
Handle(Geom_Surface) S1 = BRep_Tool::Surface(theFace1);
|
||||
Handle(Geom_Surface) S2 = BRep_Tool::Surface(theFace2);
|
||||
if(S1->DynamicType() == S2->DynamicType()) {
|
||||
return true;
|
||||
}
|
||||
else { //Check if there a coincidence of two surfaces at least in two points
|
||||
double U11, U12, V11, V12, U21, U22, V21, V22;
|
||||
BRepTools::UVBounds(theFace1, U11, U12, V11, V12);
|
||||
BRepTools::UVBounds(theFace2, U21, U22, V21, V22);
|
||||
|
||||
double rangeU = U12-U11;
|
||||
double rangeV = V12-V11;
|
||||
double U = U11 + rangeU/3.0;
|
||||
double V = V11 + rangeV/3.0;
|
||||
gp_Pnt P1 = S1->Value(U, V);
|
||||
U = U11+rangeU*2.0/3.0;
|
||||
V = V11+rangeV*2.0/3.0;
|
||||
gp_Pnt P2 = S1->Value(U, V);
|
||||
|
||||
if(!GeomLib_Tool::Parameters(S2, P1, MAX_TOLERANCE, U, V) || U < U21 || U > U22 || V < V21 || V > V22)
|
||||
return false;
|
||||
|
||||
if(P1.Distance(S2->Value(U,V)) > MAX_TOLERANCE) return false;
|
||||
|
||||
if(!GeomLib_Tool::Parameters(S2, P2, MAX_TOLERANCE, U, V) || U < U21 || U > U22 || V < V21 || V > V22)
|
||||
return false;
|
||||
|
||||
if(P2.Distance(S2->Value(U, V)) > MAX_TOLERANCE) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,14 @@
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
//=============================================================================
|
||||
// File : GEOMImpl_IShapesOperations.hxx
|
||||
// Created :
|
||||
// Author : modified by Lioka RAZAFINDRAZAKA (CEA) 22/06/2007
|
||||
// Project : SALOME
|
||||
// Copyright : CEA 2003
|
||||
// $Header$
|
||||
//=============================================================================
|
||||
#ifndef _GEOMImpl_IShapesOperations_HXX_
|
||||
#define _GEOMImpl_IShapesOperations_HXX_
|
||||
|
||||
@ -32,11 +39,14 @@
|
||||
#include <list>
|
||||
#include <Handle_Geom_Surface.hxx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
|
||||
class GEOM_Engine;
|
||||
class Handle(GEOM_Object);
|
||||
class Handle(TColStd_HArray1OfInteger);
|
||||
|
||||
class GEOMImpl_IShapesOperations : public GEOM_IOperations {
|
||||
class GEOMImpl_IShapesOperations : public GEOM_IOperations
|
||||
{
|
||||
public:
|
||||
Standard_EXPORT GEOMImpl_IShapesOperations(GEOM_Engine* theEngine, int theDocID);
|
||||
Standard_EXPORT ~GEOMImpl_IShapesOperations();
|
||||
@ -60,22 +70,24 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations {
|
||||
Standard_EXPORT Handle(GEOM_Object) MakeCompound (list<Handle(GEOM_Object)> theShapes);
|
||||
|
||||
Standard_EXPORT Handle(GEOM_Object) MakeGlueFaces (Handle(GEOM_Object) theShape,
|
||||
const Standard_Real theTolerance);
|
||||
const Standard_Real theTolerance,
|
||||
const Standard_Boolean doKeepNonSolids);
|
||||
|
||||
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetGlueFaces (Handle(GEOM_Object) theShape,
|
||||
const Standard_Real theTolerance);
|
||||
|
||||
Standard_EXPORT Handle(GEOM_Object) MakeGlueFacesByList (Handle(GEOM_Object) theShape,
|
||||
const Standard_Real theTolerance,
|
||||
list<Handle(GEOM_Object)> theFaces);
|
||||
list<Handle(GEOM_Object)> theFaces,
|
||||
const Standard_Boolean doKeepNonSolids);
|
||||
|
||||
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakeExplode (Handle(GEOM_Object) theShape,
|
||||
const Standard_Integer theShapeType,
|
||||
const Standard_Boolean isSorted);
|
||||
const Standard_Integer theShapeType,
|
||||
const Standard_Boolean isSorted);
|
||||
|
||||
Standard_EXPORT Handle(TColStd_HSequenceOfInteger) SubShapeAllIDs (Handle(GEOM_Object) theShape,
|
||||
const Standard_Integer theShapeType,
|
||||
const Standard_Boolean isSorted);
|
||||
const Standard_Integer theShapeType,
|
||||
const Standard_Boolean isSorted);
|
||||
|
||||
Standard_EXPORT Handle(GEOM_Object) GetSubShape (Handle(GEOM_Object) theMainShape,
|
||||
const Standard_Integer theID);
|
||||
@ -112,22 +124,25 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations {
|
||||
const GEOMAlgo_State theState);
|
||||
|
||||
|
||||
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetShapesOnCylinder (const Handle(GEOM_Object)& theShape,
|
||||
const Standard_Integer theShapeType,
|
||||
const Handle(GEOM_Object)& theAxis,
|
||||
const Standard_Real theRadius,
|
||||
const GEOMAlgo_State theState);
|
||||
Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
|
||||
GetShapesOnCylinder (const Handle(GEOM_Object)& theShape,
|
||||
const Standard_Integer theShapeType,
|
||||
const Handle(GEOM_Object)& theAxis,
|
||||
const Standard_Real theRadius,
|
||||
const GEOMAlgo_State theState);
|
||||
|
||||
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetShapesOnSphere (const Handle(GEOM_Object)& theShape,
|
||||
const Standard_Integer theShapeType,
|
||||
const Handle(GEOM_Object)& theCenter,
|
||||
const Standard_Real theRadius,
|
||||
const GEOMAlgo_State theState);
|
||||
Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
|
||||
GetShapesOnSphere (const Handle(GEOM_Object)& theShape,
|
||||
const Standard_Integer theShapeType,
|
||||
const Handle(GEOM_Object)& theCenter,
|
||||
const Standard_Real theRadius,
|
||||
const GEOMAlgo_State theState);
|
||||
|
||||
Standard_EXPORT Handle(TColStd_HSequenceOfInteger) GetShapesOnPlaneIDs (const Handle(GEOM_Object)& theShape,
|
||||
const Standard_Integer theShapeType,
|
||||
const Handle(GEOM_Object)& theAx1,
|
||||
const GEOMAlgo_State theState);
|
||||
Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
|
||||
GetShapesOnPlaneIDs (const Handle(GEOM_Object)& theShape,
|
||||
const Standard_Integer theShapeType,
|
||||
const Handle(GEOM_Object)& theAx1,
|
||||
const GEOMAlgo_State theState);
|
||||
|
||||
Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
|
||||
GetShapesOnPlaneWithLocationIDs (const Handle(GEOM_Object)& theShape,
|
||||
@ -136,17 +151,19 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations {
|
||||
const Handle(GEOM_Object)& thePnt,
|
||||
const GEOMAlgo_State theState);
|
||||
|
||||
Standard_EXPORT Handle(TColStd_HSequenceOfInteger) GetShapesOnCylinderIDs (const Handle(GEOM_Object)& theShape,
|
||||
const Standard_Integer theShapeType,
|
||||
const Handle(GEOM_Object)& theAxis,
|
||||
const Standard_Real theRadius,
|
||||
const GEOMAlgo_State theState);
|
||||
Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
|
||||
GetShapesOnCylinderIDs (const Handle(GEOM_Object)& theShape,
|
||||
const Standard_Integer theShapeType,
|
||||
const Handle(GEOM_Object)& theAxis,
|
||||
const Standard_Real theRadius,
|
||||
const GEOMAlgo_State theState);
|
||||
|
||||
Standard_EXPORT Handle(TColStd_HSequenceOfInteger) GetShapesOnSphereIDs (const Handle(GEOM_Object)& theShape,
|
||||
const Standard_Integer theShapeType,
|
||||
const Handle(GEOM_Object)& theCenter,
|
||||
const Standard_Real theRadius,
|
||||
const GEOMAlgo_State theState);
|
||||
Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
|
||||
GetShapesOnSphereIDs (const Handle(GEOM_Object)& theShape,
|
||||
const Standard_Integer theShapeType,
|
||||
const Handle(GEOM_Object)& theCenter,
|
||||
const Standard_Real theRadius,
|
||||
const GEOMAlgo_State theState);
|
||||
|
||||
/*!
|
||||
* \brief Find subshapes complying with given status about quadrangle
|
||||
@ -198,10 +215,13 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations {
|
||||
Handle(GEOM_Object) theCenter,
|
||||
const Standard_Real theRadius);
|
||||
|
||||
void GetShapeProperties(const TopoDS_Shape aShape, Standard_Real propertiesArray[], gp_Pnt & aPnt);
|
||||
|
||||
Standard_EXPORT Handle(GEOM_Object) GetInPlace (Handle(GEOM_Object) theShapeWhere,
|
||||
Handle(GEOM_Object) theShapeWhat);
|
||||
|
||||
Standard_EXPORT static void SortShapes (TopTools_ListOfShape& SL);
|
||||
Standard_EXPORT Handle(GEOM_Object) GetInPlaceByHistory (Handle(GEOM_Object) theShapeWhere,
|
||||
Handle(GEOM_Object) theShapeWhat);
|
||||
|
||||
/*!
|
||||
* \brief Searches a shape equal to theWhat in the context of theWhere
|
||||
@ -240,6 +260,30 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations {
|
||||
const Standard_Integer theShapeType,
|
||||
GEOMAlgo_State theState);
|
||||
|
||||
public:
|
||||
/*!
|
||||
* \brief Sort shapes in the list by their coordinates.
|
||||
* \param SL The list of shapes to sort.
|
||||
*/
|
||||
Standard_EXPORT static void SortShapes (TopTools_ListOfShape& SL);
|
||||
|
||||
/*!
|
||||
* \brief Convert TopoDS_COMPSOLID to TopoDS_COMPOUND.
|
||||
*
|
||||
* If the argument shape is not of type TopoDS_COMPSOLID, this method returns it as is.
|
||||
*
|
||||
* \param theCompsolid The compsolid to be converted.
|
||||
* \retval TopoDS_Shape Returns the resulting compound.
|
||||
*/
|
||||
Standard_EXPORT static TopoDS_Shape CompsolidToCompound (const TopoDS_Shape& theCompsolid);
|
||||
|
||||
/*!
|
||||
* \brief Build a triangulation on \a theShape if it is absent.
|
||||
* \param theShape The shape to check/build triangulation on.
|
||||
* \retval bool Returns false if the shape has no faces, i.e. impossible to build triangulation.
|
||||
*/
|
||||
Standard_EXPORT static bool CheckTriangulation (const TopoDS_Shape& theShape);
|
||||
|
||||
private:
|
||||
Handle(GEOM_Object) MakeShape (list<Handle(GEOM_Object)> theShapes,
|
||||
const Standard_Integer theObjectType,
|
||||
@ -247,11 +291,9 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations {
|
||||
const TCollection_AsciiString& theMethodName);
|
||||
|
||||
// ----------------------------------------------------
|
||||
// methods common for all GetShapesOnXXX() functions
|
||||
// methods common for all GetShapesOnXXX() functions
|
||||
// ----------------------------------------------------
|
||||
|
||||
bool CheckTriangulation (const TopoDS_Shape& aShape);
|
||||
|
||||
/*!
|
||||
* \brief Checks if theShapeType parameter of GetShapesOnXXX() is OK
|
||||
* \param theShapeType - the shape type to check
|
||||
|
@ -107,7 +107,9 @@ Standard_Integer GEOMImpl_ImportDriver::Execute(TFunction_Logbook& log) const
|
||||
TCollection_AsciiString anError;
|
||||
TopoDS_Shape aShape = fp( aFileName, aFormatName, anError );
|
||||
|
||||
// unload plugin library
|
||||
// unload plugin library
|
||||
// commented by enk:
|
||||
// the bug was occured: using ACIS Import/Export plugin
|
||||
//UnLoadLib( anImportLib ); //This is workaround of BUG OCC13051
|
||||
|
||||
if ( aShape.IsNull() ) {
|
||||
|
@ -206,6 +206,7 @@ Standard_Integer GEOMImpl_PartitionDriver::Execute(TFunction_Logbook& log) const
|
||||
}
|
||||
}
|
||||
|
||||
PS.SetLimitMode(aCI.GetKeepNonlimitShapes());
|
||||
PS.SetLimit( (TopAbs_ShapeEnum)aCI.GetLimit() );
|
||||
PS.Perform();
|
||||
|
||||
|
@ -21,16 +21,30 @@
|
||||
#include <Standard_Stream.hxx>
|
||||
|
||||
#include <GEOMImpl_PipeDriver.hxx>
|
||||
|
||||
#include <GEOMImpl_IShapesOperations.hxx>
|
||||
#include <GEOMImpl_IPipeDiffSect.hxx>
|
||||
#include <GEOMImpl_IPipeShellSect.hxx>
|
||||
#include <GEOMImpl_IPipe.hxx>
|
||||
#include <GEOMImpl_Types.hxx>
|
||||
#include <GEOM_Function.hxx>
|
||||
|
||||
#include <ShapeAnalysis_FreeBounds.hxx>
|
||||
#include <ShapeAnalysis_Edge.hxx>
|
||||
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRepBuilderAPI_MakeWire.hxx>
|
||||
#include <BRepBuilderAPI_Sewing.hxx>
|
||||
#include <BRepCheck_Analyzer.hxx>
|
||||
#include <BRepOffsetAPI_MakePipe.hxx>
|
||||
#include <BRepBuilderAPI_MakeWire.hxx>
|
||||
#include <BRepOffsetAPI_MakePipeShell.hxx>
|
||||
#include <GProp_GProps.hxx>
|
||||
#include <BRepGProp.hxx>
|
||||
|
||||
#include <TopAbs.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
@ -38,32 +52,26 @@
|
||||
#include <TopoDS_Solid.hxx>
|
||||
#include <TopoDS_Shell.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <BRepOffsetAPI_MakePipeShell.hxx>
|
||||
#include <TColStd_HSequenceOfTransient.hxx>
|
||||
#include <GEOMImpl_IPipeDiffSect.hxx>
|
||||
#include <GEOMImpl_IPipeShellSect.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <TopTools_SequenceOfShape.hxx>
|
||||
#include <TopTools_IndexedDataMapOfShapeShape.hxx>
|
||||
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
|
||||
#include <GeomAPI_ProjectPointOnCurve.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
|
||||
#include <TColgp_SequenceOfPnt.hxx>
|
||||
#include <TColStd_HSequenceOfTransient.hxx>
|
||||
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_NullObject.hxx>
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
#include "utilities.h"
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopTools_SequenceOfShape.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <ShapeAnalysis_FreeBounds.hxx>
|
||||
#include <TColgp_SequenceOfPnt.hxx>
|
||||
#include <ShapeAnalysis_Edge.hxx>
|
||||
#include <TopTools_IndexedDataMapOfShapeShape.hxx>
|
||||
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
#include <GeomAPI_ProjectPointOnCurve.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <BRepBuilderAPI_Sewing.hxx>
|
||||
|
||||
//#include <BRepTools.hxx>
|
||||
#include "utilities.h"
|
||||
|
||||
//#include "BRepTools.hxx"
|
||||
|
||||
|
||||
//=======================================================================
|
||||
@ -345,7 +353,6 @@ static void FindNextPairOfFaces(const TopoDS_Shape& aCurFace,
|
||||
}
|
||||
|
||||
FindNextPairOfFaces(F1other, aMapEdgeFaces1, aMapEdgeFaces2, FF, aCI);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -423,6 +430,7 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
|
||||
Standard_ConstructionError::Raise
|
||||
("First location shapes is not coincided with first vertex of aWirePath");
|
||||
}
|
||||
VLocs.ChangeValue(1) = VF;
|
||||
edge = TopoDS::Edge(Edges.Last());
|
||||
tol = BRep_Tool::Tolerance(edge);
|
||||
TopoDS_Vertex VL = sae.LastVertex(edge);
|
||||
@ -432,11 +440,12 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
|
||||
Standard_ConstructionError::Raise
|
||||
("Last location shapes is not coincided with last vertex of aWirePath");
|
||||
}
|
||||
VLocs.ChangeValue(nbLocs) = VL;
|
||||
int jcurr = 2;
|
||||
TopTools_SequenceOfShape tmpEdges;
|
||||
for(i=1; i<=Edges.Length() && jcurr<nbLocs; i++) {
|
||||
TopoDS_Edge E = TopoDS::Edge(Edges.Value(i));
|
||||
tol = BRep_Tool::Tolerance(edge);
|
||||
tol = BRep_Tool::Tolerance(E);
|
||||
TopoDS_Vertex V1 = sae.FirstVertex(E);
|
||||
TopoDS_Vertex V2 = sae.LastVertex(E);
|
||||
gp_Pnt P1 = BRep_Tool::Pnt(V1);
|
||||
@ -450,11 +459,12 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
|
||||
B.Add(W,tmpEdges.Value(j));
|
||||
B.Add(W,E);
|
||||
Wires.Append(W);
|
||||
VLocs.ChangeValue(jcurr) = V2;
|
||||
jcurr++;
|
||||
tmpEdges.Clear();
|
||||
}
|
||||
else {
|
||||
// find distance between E and aLocs(icurr)
|
||||
// find distance between E and aLocs(jcurr)
|
||||
double fp,lp;
|
||||
Handle(Geom_Curve) C = BRep_Tool::Curve(E,fp,lp);
|
||||
GeomAPI_ProjectPointOnCurve PPC (PLocs.Value(jcurr),C);
|
||||
@ -467,7 +477,9 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
|
||||
Handle(Geom_TrimmedCurve) tc1 = new Geom_TrimmedCurve(C,fp,param);
|
||||
Handle(Geom_TrimmedCurve) tc2 = new Geom_TrimmedCurve(C,param,lp);
|
||||
TopoDS_Edge E1,E2;
|
||||
if(PC1.Distance(P1)<tol) {
|
||||
gp_Pnt Pfp;
|
||||
C->D0(fp,Pfp);
|
||||
if(Pfp.Distance(P1)<tol) {
|
||||
B.MakeEdge(E1,tc1,tol);
|
||||
B.Add(E1,V1);
|
||||
TopoDS_Shape tmpV = VLocs.Value(jcurr).Oriented(TopAbs_REVERSED);
|
||||
@ -504,7 +516,7 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
|
||||
Edges.InsertAfter(i,E2);
|
||||
}
|
||||
else {
|
||||
tmpEdges.Append(edge);
|
||||
tmpEdges.Append(E);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -576,6 +588,153 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
|
||||
CreateFewSolids = true;
|
||||
}
|
||||
|
||||
/*
|
||||
// check orientation of sections
|
||||
bool NeedReverse = false;
|
||||
{
|
||||
// first section
|
||||
anExp.Init( aShBase1, TopAbs_FACE );
|
||||
TopoDS_Shape aFace = anExp.Current();
|
||||
TColgp_SequenceOfPnt aPnts;
|
||||
double xc=0, yc=0, zc=0;
|
||||
for ( anExp.Init( aFace, TopAbs_VERTEX ); anExp.More(); anExp.Next() ) {
|
||||
TopoDS_Vertex V = TopoDS::Vertex(anExp.Current());
|
||||
aPnts.Append(BRep_Tool::Pnt(V));
|
||||
xc += aPnts.Last().X();
|
||||
yc += aPnts.Last().Y();
|
||||
zc += aPnts.Last().Z();
|
||||
}
|
||||
gp_Pnt PC( xc/aPnts.Length(), yc/aPnts.Length(), zc/aPnts.Length() );
|
||||
gp_Vec V1(PC,aPnts.Value(1));
|
||||
gp_Vec V2(PC,aPnts.Value(2));
|
||||
gp_Vec VN = V1.Crossed(V2);
|
||||
for(int ip=2; ip<aPnts.Length(); ip++) {
|
||||
V1 = gp_Vec(PC,aPnts.Value(ip));
|
||||
V2 = gp_Vec(PC,aPnts.Value(ip+1));
|
||||
VN.Add(V1.Crossed(V2));
|
||||
}
|
||||
gp_Vec PathNorm;
|
||||
gp_Pnt PLoc = BRep_Tool::Pnt(TopoDS::Vertex(VLocs(i)));
|
||||
TopExp_Explorer WE;
|
||||
for ( WE.Init( WPath, TopAbs_EDGE ); WE.More(); WE.Next() ) {
|
||||
TopoDS_Edge edge = TopoDS::Edge(WE.Current());
|
||||
double tol = BRep_Tool::Tolerance(edge);
|
||||
TopoDS_Vertex VF = sae.FirstVertex(edge);
|
||||
gp_Pnt PF = BRep_Tool::Pnt(VF);
|
||||
if( PF.Distance(PLoc) < tol ) {
|
||||
double fp,lp;
|
||||
Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
|
||||
gp_Pnt P1,P2;
|
||||
C->D0(fp,P1);
|
||||
if( P1.Distance(PLoc) < tol ) {
|
||||
C->D0(fp+(lp-fp)/100,P2);
|
||||
}
|
||||
else {
|
||||
C->D0(lp,P1);
|
||||
C->D0(lp+(fp-lp)/100,P2);
|
||||
}
|
||||
PathNorm = gp_Vec(P1,P2);
|
||||
break;
|
||||
}
|
||||
else {
|
||||
TopoDS_Vertex VL = sae.LastVertex(edge);
|
||||
gp_Pnt PL = BRep_Tool::Pnt(VL);
|
||||
if( PL.Distance(PLoc) < tol ) {
|
||||
double fp,lp;
|
||||
Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
|
||||
gp_Pnt P1,P2;
|
||||
C->D0(fp,P1);
|
||||
if( P1.Distance(PLoc) < tol ) {
|
||||
C->D0(fp+(lp-fp)/100,P2);
|
||||
}
|
||||
else {
|
||||
C->D0(lp,P1);
|
||||
C->D0(lp+(fp-lp)/100,P2);
|
||||
}
|
||||
PathNorm = gp_Vec(P2,P1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
cout<<"VN("<<VN.X()<<","<<VN.Y()<<","<<VN.Z()<<")"<<endl;
|
||||
cout<<"PathNorm("<<PathNorm.X()<<","<<PathNorm.Y()<<","<<PathNorm.Z()<<")"<<endl;
|
||||
if(fabs(VN.Angle(PathNorm))>PI/2.) {
|
||||
NeedReverse = true;
|
||||
aShBase1.Reverse();
|
||||
}
|
||||
}
|
||||
{
|
||||
// second section
|
||||
anExp.Init( aShBase2, TopAbs_FACE );
|
||||
TopoDS_Shape aFace = anExp.Current();
|
||||
TColgp_SequenceOfPnt aPnts;
|
||||
double xc=0, yc=0, zc=0;
|
||||
for ( anExp.Init( aFace, TopAbs_VERTEX ); anExp.More(); anExp.Next() ) {
|
||||
TopoDS_Vertex V = TopoDS::Vertex(anExp.Current());
|
||||
aPnts.Append(BRep_Tool::Pnt(V));
|
||||
xc += aPnts.Last().X();
|
||||
yc += aPnts.Last().Y();
|
||||
zc += aPnts.Last().Z();
|
||||
}
|
||||
gp_Pnt PC( xc/aPnts.Length(), yc/aPnts.Length(), zc/aPnts.Length() );
|
||||
gp_Vec V1(PC,aPnts.Value(1));
|
||||
gp_Vec V2(PC,aPnts.Value(2));
|
||||
gp_Vec VN = V1.Crossed(V2);
|
||||
for(int ip=2; ip<aPnts.Length(); ip++) {
|
||||
V1 = gp_Vec(PC,aPnts.Value(ip));
|
||||
V2 = gp_Vec(PC,aPnts.Value(ip+1));
|
||||
VN.Add(V1.Crossed(V2));
|
||||
}
|
||||
gp_Vec PathNorm;
|
||||
gp_Pnt PLoc = BRep_Tool::Pnt(TopoDS::Vertex(VLocs(i+1)));
|
||||
TopExp_Explorer WE;
|
||||
for ( WE.Init( WPath, TopAbs_EDGE ); WE.More(); WE.Next() ) {
|
||||
TopoDS_Edge edge = TopoDS::Edge(WE.Current());
|
||||
double tol = BRep_Tool::Tolerance(edge);
|
||||
TopoDS_Vertex VF = sae.FirstVertex(edge);
|
||||
gp_Pnt PF = BRep_Tool::Pnt(VF);
|
||||
if( PF.Distance(PLoc) < tol ) {
|
||||
double fp,lp;
|
||||
Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
|
||||
gp_Pnt P1,P2;
|
||||
C->D0(fp,P1);
|
||||
if( P1.Distance(PLoc) < tol ) {
|
||||
C->D0(fp+(lp-fp)/100,P2);
|
||||
}
|
||||
else {
|
||||
C->D0(lp,P1);
|
||||
C->D0(lp+(fp-lp)/100,P2);
|
||||
}
|
||||
PathNorm = gp_Vec(P2,P1);
|
||||
break;
|
||||
}
|
||||
else {
|
||||
TopoDS_Vertex VL = sae.LastVertex(edge);
|
||||
gp_Pnt PL = BRep_Tool::Pnt(VL);
|
||||
if( PL.Distance(PLoc) < tol ) {
|
||||
double fp,lp;
|
||||
Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
|
||||
gp_Pnt P1,P2;
|
||||
C->D0(fp,P1);
|
||||
if( P1.Distance(PLoc) < tol ) {
|
||||
C->D0(fp+(lp-fp)/100,P2);
|
||||
}
|
||||
else {
|
||||
C->D0(lp,P1);
|
||||
C->D0(lp+(fp-lp)/100,P2);
|
||||
}
|
||||
PathNorm = gp_Vec(P2,P1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//cout<<"VN("<<VN.X()<<","<<VN.Y()<<","<<VN.Z()<<")"<<endl;
|
||||
//cout<<"PathNorm("<<PathNorm.X()<<","<<PathNorm.Y()<<","<<PathNorm.Z()<<")"<<endl;
|
||||
if(fabs(VN.Angle(PathNorm))>PI/2.)
|
||||
aShBase2.Reverse();
|
||||
}
|
||||
*/
|
||||
|
||||
if(!CreateFewSolids) {
|
||||
// we can create only one solid
|
||||
TopoDS_Shape aWire1, aWire2;
|
||||
@ -661,6 +820,11 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
|
||||
const TopoDS_Shape aSewShape = aSewing->SewedShape();
|
||||
if( aSewShape.ShapeType() == TopAbs_SHELL ) {
|
||||
aShell = TopoDS::Shell(aSewShape);
|
||||
GProp_GProps aSystem;
|
||||
BRepGProp::VolumeProperties(aShell, aSystem);
|
||||
if(aSystem.Mass()<0) {
|
||||
aShell.Reverse();
|
||||
}
|
||||
if(BRep_Tool::IsClosed(aShell)) {
|
||||
TopoDS_Solid aSolid;
|
||||
B.MakeSolid(aSolid);
|
||||
@ -679,10 +843,12 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
|
||||
else {
|
||||
// main block - creation few solids (for each pair of faces)
|
||||
TopTools_MapOfShape aFaces1,aFaces2;
|
||||
for ( anExp.Init( aShBase1, TopAbs_FACE ); anExp.More(); anExp.Next() )
|
||||
for ( anExp.Init( aShBase1, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
|
||||
aFaces1.Add(anExp.Current());
|
||||
for ( anExp.Init( aShBase2, TopAbs_FACE ); anExp.More(); anExp.Next() )
|
||||
}
|
||||
for ( anExp.Init( aShBase2, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
|
||||
aFaces2.Add(anExp.Current());
|
||||
}
|
||||
// creating map of edge faces
|
||||
TopTools_IndexedDataMapOfShapeListOfShape aMapEdgeFaces1;
|
||||
TopExp::MapShapesAndAncestors(aShBase1, TopAbs_EDGE, TopAbs_FACE, aMapEdgeFaces1);
|
||||
@ -844,7 +1010,6 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
|
||||
|
||||
|
||||
// make pipe for each pair of faces
|
||||
//BRepTools::Write(WPath,"/dn02/users_Linux/skl/work/Bugs/14857/wpath.brep");
|
||||
for(j=1; j<=FF.Extent(); j++) {
|
||||
TopoDS_Shape F1 = FF.FindKey(j);
|
||||
if( F1.ShapeType() != TopAbs_FACE )
|
||||
@ -869,12 +1034,10 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
|
||||
TopoDS_Shape aShape = aBuilder.Shape();
|
||||
TopoDS_Shell aShell;
|
||||
B.MakeShell(aShell);
|
||||
//int nbf=0;
|
||||
for ( anExp.Init( aShape, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
|
||||
//nbf++;
|
||||
//cout<<"nbf="<<nbf<<endl;
|
||||
B.Add(aShell,anExp.Current());
|
||||
}
|
||||
|
||||
B.Add(aShell,F1);
|
||||
B.Add(aShell,F2);
|
||||
// make sewing for this shell
|
||||
@ -890,6 +1053,12 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
|
||||
const TopoDS_Shape aSewShape = aSewing->SewedShape();
|
||||
if( aSewShape.ShapeType() == TopAbs_SHELL ) {
|
||||
aShell = TopoDS::Shell(aSewShape);
|
||||
GProp_GProps aSystem;
|
||||
BRepGProp::VolumeProperties(aShell, aSystem);
|
||||
if(aSystem.Mass()<0) {
|
||||
//cout<<"aSewShape is reversed"<<endl;
|
||||
aShell.Reverse();
|
||||
}
|
||||
if(BRep_Tool::IsClosed(aShell)) {
|
||||
TopoDS_Solid aSolid;
|
||||
B.MakeSolid(aSolid);
|
||||
@ -909,6 +1078,7 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
|
||||
}
|
||||
}
|
||||
|
||||
//BRepTools::Write(aComp,"/dn02/users_Linux/skl/work/Bugs/14857/comp.brep");
|
||||
return aComp;
|
||||
}
|
||||
|
||||
@ -980,7 +1150,7 @@ Standard_Integer GEOMImpl_PipeDriver::Execute(TFunction_Logbook& log) const
|
||||
{
|
||||
GEOMImpl_IPipeDiffSect* aCIDS = (GEOMImpl_IPipeDiffSect*)aCI;
|
||||
//GEOMImpl_IPipeDiffSect* aCIDS = static_cast<GEOMImpl_IPipeDiffSect*>(aCI);
|
||||
BRepOffsetAPI_MakePipeShell aBuilder(aWirePath);
|
||||
//BRepOffsetAPI_MakePipeShell aBuilder(aWirePath);
|
||||
Handle(TColStd_HSequenceOfTransient) aBasesObjs = aCIDS->GetBases ();
|
||||
Handle(TColStd_HSequenceOfTransient) aLocObjs = aCIDS->GetLocations ();
|
||||
Standard_Boolean aWithContact = (aCIDS->GetWithContactMode());
|
||||
@ -1069,6 +1239,116 @@ Standard_Integer GEOMImpl_PipeDriver::Execute(TFunction_Logbook& log) const
|
||||
}
|
||||
|
||||
nbLocs = aSeqLocs.Length();
|
||||
|
||||
// skl 02.05.2007
|
||||
if(nbLocs>0) {
|
||||
// we have to check that each location shape is a vertex from
|
||||
// path and update aSeqLocs if it is needed (and possible)
|
||||
TColgp_SequenceOfPnt PLocs;
|
||||
for(i=1; i<=nbLocs; i++) {
|
||||
TopoDS_Vertex V = TopoDS::Vertex(aSeqLocs.Value(i));
|
||||
PLocs.Append(BRep_Tool::Pnt(V));
|
||||
}
|
||||
TopTools_SequenceOfShape Edges;
|
||||
TopExp_Explorer anExp;
|
||||
for ( anExp.Init( aWirePath, TopAbs_EDGE ); anExp.More(); anExp.Next() ) {
|
||||
Edges.Append(anExp.Current());
|
||||
}
|
||||
int nbEdges = Edges.Length();
|
||||
ShapeAnalysis_Edge sae;
|
||||
TopoDS_Edge edge = TopoDS::Edge(Edges.First());
|
||||
double tol = BRep_Tool::Tolerance(edge);
|
||||
TopoDS_Vertex VF = sae.FirstVertex(edge);
|
||||
gp_Pnt PF = BRep_Tool::Pnt(VF);
|
||||
//cout<<"PF("<<PF.X()<<","<<PF.Y()<<","<<PF.Z()<<")"<<endl;
|
||||
if( PF.Distance(PLocs.First()) > tol ) {
|
||||
if(aCI) delete aCI;
|
||||
Standard_ConstructionError::Raise
|
||||
("First location shapes is not coincided with first vertex of aWirePath");
|
||||
}
|
||||
aSeqLocs.ChangeValue(1) = VF;
|
||||
edge = TopoDS::Edge(Edges.Last());
|
||||
tol = BRep_Tool::Tolerance(edge);
|
||||
TopoDS_Vertex VL = sae.LastVertex(edge);
|
||||
gp_Pnt PL = BRep_Tool::Pnt(VL);
|
||||
if( PL.Distance(PLocs.Last()) > tol ) {
|
||||
if(aCI) delete aCI;
|
||||
Standard_ConstructionError::Raise
|
||||
("Last location shapes is not coincided with last vertex of aWirePath");
|
||||
}
|
||||
aSeqLocs.ChangeValue(nbLocs) = VL;
|
||||
int jcurr = 2;
|
||||
for(i=1; i<=Edges.Length() && jcurr<nbLocs; i++) {
|
||||
TopoDS_Edge E = TopoDS::Edge(Edges.Value(i));
|
||||
tol = BRep_Tool::Tolerance(edge);
|
||||
TopoDS_Vertex V1 = sae.FirstVertex(E);
|
||||
TopoDS_Vertex V2 = sae.LastVertex(E);
|
||||
gp_Pnt P1 = BRep_Tool::Pnt(V1);
|
||||
gp_Pnt P2 = BRep_Tool::Pnt(V2);
|
||||
if( P2.Distance(PLocs.Value(jcurr)) < tol ) {
|
||||
aSeqLocs.ChangeValue(jcurr) = V2;
|
||||
jcurr++;
|
||||
}
|
||||
else {
|
||||
// find distance between E and aLocs(jcurr)
|
||||
double fp,lp;
|
||||
Handle(Geom_Curve) C = BRep_Tool::Curve(E,fp,lp);
|
||||
GeomAPI_ProjectPointOnCurve PPC (PLocs.Value(jcurr),C);
|
||||
if( PPC.NbPoints()>0 &&
|
||||
PLocs.Value(jcurr).Distance(PPC.Point(1)) < tol ) {
|
||||
double param = PPC.Parameter(1);
|
||||
gp_Pnt PC1;
|
||||
C->D0(param,PC1);
|
||||
// split current edge
|
||||
Handle(Geom_TrimmedCurve) tc1 = new Geom_TrimmedCurve(C,fp,param);
|
||||
Handle(Geom_TrimmedCurve) tc2 = new Geom_TrimmedCurve(C,param,lp);
|
||||
TopoDS_Edge E1,E2;
|
||||
BRep_Builder B;
|
||||
gp_Pnt Pfp;
|
||||
C->D0(fp,Pfp);
|
||||
if(Pfp.Distance(P1)<tol) {
|
||||
B.MakeEdge(E1,tc1,tol);
|
||||
B.Add(E1,V1);
|
||||
TopoDS_Shape tmpV = aSeqLocs.Value(jcurr).Oriented(TopAbs_REVERSED);
|
||||
B.Add(E1,TopoDS::Vertex(tmpV));
|
||||
B.MakeEdge(E2,tc2,tol);
|
||||
tmpV = aSeqLocs.Value(jcurr).Oriented(TopAbs_FORWARD);
|
||||
B.Add(E2,TopoDS::Vertex(tmpV));
|
||||
B.Add(E2,V2);
|
||||
}
|
||||
else {
|
||||
B.MakeEdge(E1,tc2,tol);
|
||||
TopoDS_Shape tmpV = aSeqLocs.Value(jcurr).Oriented(TopAbs_FORWARD);
|
||||
B.Add(E1,TopoDS::Vertex(tmpV));
|
||||
B.Add(E1,V1);
|
||||
E1.Reverse();
|
||||
B.MakeEdge(E2,tc1,tol);
|
||||
B.Add(E2,V2);
|
||||
tmpV = aSeqLocs.Value(jcurr).Oriented(TopAbs_REVERSED);
|
||||
B.Add(E2,TopoDS::Vertex(tmpV));
|
||||
E2.Reverse();
|
||||
}
|
||||
jcurr++;
|
||||
Edges.Remove(i);
|
||||
Edges.InsertAfter(i-1,E1);
|
||||
Edges.InsertAfter(i,E2);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(nbEdges<Edges.Length()) {
|
||||
// one of edges was splitted => we have to update WirePath
|
||||
BRep_Builder B;
|
||||
TopoDS_Wire W;
|
||||
B.MakeWire(W);
|
||||
for(i=1; i<=Edges.Length(); i++) {
|
||||
B.Add(W,TopoDS::Edge(Edges.Value(i)));
|
||||
}
|
||||
aWirePath = W;
|
||||
}
|
||||
}
|
||||
|
||||
BRepOffsetAPI_MakePipeShell aBuilder(aWirePath);
|
||||
|
||||
Standard_Integer nbShapes = aSeqBases.Length();
|
||||
Standard_Integer step = nbShapes/nbBases;
|
||||
|
||||
@ -1135,7 +1415,8 @@ Standard_Integer GEOMImpl_PipeDriver::Execute(TFunction_Logbook& log) const
|
||||
Standard_ConstructionError::Raise("Algorithm have produced an invalid shape result");
|
||||
}
|
||||
|
||||
aFunction->SetValue(aShape);
|
||||
TopoDS_Shape aRes = GEOMImpl_IShapesOperations::CompsolidToCompound(aShape);
|
||||
aFunction->SetValue(aRes);
|
||||
|
||||
log.SetTouched(Label());
|
||||
if(aCI) delete aCI;
|
||||
|
@ -21,6 +21,8 @@
|
||||
#include <Standard_Stream.hxx>
|
||||
|
||||
#include <GEOMImpl_PrismDriver.hxx>
|
||||
|
||||
#include <GEOMImpl_IShapesOperations.hxx>
|
||||
#include <GEOMImpl_IPrism.hxx>
|
||||
#include <GEOMImpl_Types.hxx>
|
||||
#include <GEOM_Function.hxx>
|
||||
@ -114,7 +116,8 @@ Standard_Integer GEOMImpl_PrismDriver::Execute(TFunction_Logbook& log) const
|
||||
|
||||
if (aShape.IsNull()) return 0;
|
||||
|
||||
aFunction->SetValue(aShape);
|
||||
TopoDS_Shape aRes = GEOMImpl_IShapesOperations::CompsolidToCompound(aShape);
|
||||
aFunction->SetValue(aRes);
|
||||
|
||||
log.SetTouched(Label());
|
||||
|
||||
|
@ -21,6 +21,8 @@
|
||||
#include <Standard_Stream.hxx>
|
||||
|
||||
#include <GEOMImpl_RevolutionDriver.hxx>
|
||||
|
||||
#include <GEOMImpl_IShapesOperations.hxx>
|
||||
#include <GEOMImpl_IRevolution.hxx>
|
||||
#include <GEOMImpl_Types.hxx>
|
||||
#include <GEOM_Function.hxx>
|
||||
@ -114,11 +116,13 @@ Standard_Integer GEOMImpl_RevolutionDriver::Execute(TFunction_Logbook& log) cons
|
||||
}
|
||||
|
||||
if (aShape.IsNull()) return 0;
|
||||
aFunction->SetValue(aShape);
|
||||
|
||||
log.SetTouched(Label());
|
||||
TopoDS_Shape aRes = GEOMImpl_IShapesOperations::CompsolidToCompound(aShape);
|
||||
aFunction->SetValue(aRes);
|
||||
|
||||
return 1;
|
||||
log.SetTouched(Label());
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
@ -112,7 +112,6 @@ libGEOMimpl_la_CPPFLAGS = \
|
||||
$(KERNEL_CXXFLAGS) \
|
||||
$(BOOST_CPPFLAGS) \
|
||||
-I$(srcdir)/../ShHealOper \
|
||||
-I$(srcdir)/../NMTAlgo \
|
||||
-I$(srcdir)/../NMTTools \
|
||||
-I$(srcdir)/../GEOM \
|
||||
-I$(srcdir)/../GEOMAlgo \
|
||||
@ -122,7 +121,6 @@ libGEOMimpl_la_CPPFLAGS = \
|
||||
|
||||
libGEOMimpl_la_LDFLAGS = \
|
||||
../GEOM/libGEOMbasic.la \
|
||||
../NMTAlgo/libNMTAlgo.la \
|
||||
../GEOMAlgo/libGEOMAlgo.la \
|
||||
../ShHealOper/libShHealOper.la \
|
||||
../ARCHIMEDE/libGEOMArchimede.la \
|
||||
|
@ -78,9 +78,15 @@ static QString getFileName( QWidget* parent,
|
||||
{
|
||||
static QString lastUsedFilter;
|
||||
QStringList filters;
|
||||
for ( FilterMap::const_iterator it = filterMap.begin(); it != filterMap.end(); ++it )
|
||||
QString aBrepFilter;
|
||||
for ( FilterMap::const_iterator it = filterMap.begin(); it != filterMap.end(); ++it ) {
|
||||
filters.push_back( it.key() );
|
||||
|
||||
if (it.key().contains("BREP", false)) {
|
||||
aBrepFilter = it.key();
|
||||
}
|
||||
}
|
||||
|
||||
SUIT_FileDlg* fd = new SUIT_FileDlg( parent, open, true, true );
|
||||
if ( !caption.isEmpty() )
|
||||
fd->setCaption( caption );
|
||||
@ -88,10 +94,15 @@ static QString getFileName( QWidget* parent,
|
||||
if ( !initial.isEmpty() )
|
||||
fd->setSelection( initial );
|
||||
|
||||
fd->setFilters( filters );
|
||||
|
||||
if ( !lastUsedFilter.isEmpty() && filterMap.contains( lastUsedFilter ) )
|
||||
fd->setSelectedFilter( lastUsedFilter );
|
||||
|
||||
fd->setFilters( filters );
|
||||
else {
|
||||
if (!aBrepFilter.isEmpty()) {
|
||||
fd->setSelectedFilter(aBrepFilter);
|
||||
}
|
||||
}
|
||||
|
||||
fd->exec();
|
||||
QString filename = fd->selectedFile();
|
||||
|
@ -99,7 +99,8 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakePartition
|
||||
const GEOM::ListOfGO& theRemoveIns,
|
||||
CORBA::Short theLimit,
|
||||
CORBA::Boolean theRemoveWebs,
|
||||
const GEOM::ListOfLong& theMaterials)
|
||||
const GEOM::ListOfLong& theMaterials,
|
||||
CORBA::Short theKeepNonlimitShapes)
|
||||
{
|
||||
GEOM::GEOM_Object_var aGEOMObject;
|
||||
|
||||
@ -166,6 +167,7 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakePartition
|
||||
Handle(GEOM_Object) anObject =
|
||||
GetOperations()->MakePartition(aShapes, aTools, aKeepIns, aRemIns,
|
||||
theLimit, theRemoveWebs, aMaterials,
|
||||
theKeepNonlimitShapes,
|
||||
/*PerformSelfIntersections*/Standard_True);
|
||||
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||
return aGEOMObject._retn();
|
||||
@ -185,7 +187,8 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakePartitionNonSelfIntersected
|
||||
const GEOM::ListOfGO& theRemoveIns,
|
||||
CORBA::Short theLimit,
|
||||
CORBA::Boolean theRemoveWebs,
|
||||
const GEOM::ListOfLong& theMaterials)
|
||||
const GEOM::ListOfLong& theMaterials,
|
||||
CORBA::Short theKeepNonlimitShapes)
|
||||
{
|
||||
GEOM::GEOM_Object_var aGEOMObject;
|
||||
|
||||
@ -252,6 +255,7 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakePartitionNonSelfIntersected
|
||||
Handle(GEOM_Object) anObject =
|
||||
GetOperations()->MakePartition(aShapes, aTools, aKeepIns, aRemIns,
|
||||
theLimit, theRemoveWebs, aMaterials,
|
||||
theKeepNonlimitShapes,
|
||||
/*PerformSelfIntersections*/Standard_False);
|
||||
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||
return aGEOMObject._retn();
|
||||
|
@ -50,7 +50,8 @@ class GEOM_I_EXPORT GEOM_IBooleanOperations_i :
|
||||
const GEOM::ListOfGO& theRemoveInside,
|
||||
CORBA::Short theLimit,
|
||||
CORBA::Boolean theRemoveWebs,
|
||||
const GEOM::ListOfLong& theMaterials);
|
||||
const GEOM::ListOfLong& theMaterials,
|
||||
CORBA::Short theKeepNonlimitShapes);
|
||||
|
||||
GEOM::GEOM_Object_ptr MakePartitionNonSelfIntersectedShape (const GEOM::ListOfGO& theShapes,
|
||||
const GEOM::ListOfGO& theTools,
|
||||
@ -58,7 +59,8 @@ class GEOM_I_EXPORT GEOM_IBooleanOperations_i :
|
||||
const GEOM::ListOfGO& theRemoveInside,
|
||||
CORBA::Short theLimit,
|
||||
CORBA::Boolean theRemoveWebs,
|
||||
const GEOM::ListOfLong& theMaterials);
|
||||
const GEOM::ListOfLong& theMaterials,
|
||||
CORBA::Short theKeepNonlimitShapes);
|
||||
|
||||
|
||||
GEOM::GEOM_Object_ptr MakeHalfPartition (GEOM::GEOM_Object_ptr theShape,
|
||||
|
@ -328,7 +328,8 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeCompound
|
||||
//=============================================================================
|
||||
GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFaces
|
||||
(GEOM::GEOM_Object_ptr theShape,
|
||||
const CORBA::Double theTolerance)
|
||||
const CORBA::Double theTolerance,
|
||||
const CORBA::Boolean doKeepNonSolids)
|
||||
{
|
||||
GEOM::GEOM_Object_var aGEOMObject;
|
||||
|
||||
@ -345,7 +346,7 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFaces
|
||||
|
||||
//Perform the gluing
|
||||
Handle(GEOM_Object) anObject =
|
||||
GetOperations()->MakeGlueFaces(aShape, theTolerance);
|
||||
GetOperations()->MakeGlueFaces(aShape, theTolerance, doKeepNonSolids);
|
||||
//if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||
// to allow warning
|
||||
if (anObject.IsNull())
|
||||
@ -401,7 +402,8 @@ GEOM::ListOfGO* GEOM_IShapesOperations_i::GetGlueFaces
|
||||
GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFacesByList
|
||||
(GEOM::GEOM_Object_ptr theShape,
|
||||
const CORBA::Double theTolerance,
|
||||
const GEOM::ListOfGO& theFaces)
|
||||
const GEOM::ListOfGO& theFaces,
|
||||
const CORBA::Boolean doKeepNonSolids)
|
||||
{
|
||||
GEOM::GEOM_Object_var aGEOMObject;
|
||||
|
||||
@ -430,7 +432,7 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFacesByList
|
||||
|
||||
//Perform the gluing
|
||||
Handle(GEOM_Object) anObject =
|
||||
GetOperations()->MakeGlueFacesByList(aShape, theTolerance, aFaces);
|
||||
GetOperations()->MakeGlueFacesByList(aShape, theTolerance, aFaces, doKeepNonSolids);
|
||||
//if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||
// to allow warning
|
||||
if (anObject.IsNull())
|
||||
@ -1323,6 +1325,41 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlace
|
||||
return GetObject(anObject);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
* GetInPlaceByHistory
|
||||
*/
|
||||
//=============================================================================
|
||||
GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlaceByHistory
|
||||
(GEOM::GEOM_Object_ptr theShapeWhere,
|
||||
GEOM::GEOM_Object_ptr theShapeWhat)
|
||||
{
|
||||
GEOM::GEOM_Object_var aGEOMObject;
|
||||
|
||||
//Set a not done flag
|
||||
GetOperations()->SetNotDone();
|
||||
|
||||
if (theShapeWhere == NULL ||
|
||||
theShapeWhat == NULL) return aGEOMObject._retn();
|
||||
|
||||
//Get the reference objects
|
||||
Handle(GEOM_Object) aShapeWhere = GetOperations()->GetEngine()->GetObject
|
||||
(theShapeWhere->GetStudyID(), theShapeWhere->GetEntry());
|
||||
Handle(GEOM_Object) aShapeWhat = GetOperations()->GetEngine()->GetObject
|
||||
(theShapeWhat->GetStudyID(), theShapeWhat->GetEntry());
|
||||
|
||||
if (aShapeWhere.IsNull() ||
|
||||
aShapeWhat.IsNull()) return aGEOMObject._retn();
|
||||
|
||||
//Get Shapes in place of aShapeWhat
|
||||
Handle(GEOM_Object) anObject =
|
||||
GetOperations()->GetInPlaceByHistory(aShapeWhere, aShapeWhat);
|
||||
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||
return aGEOMObject._retn();
|
||||
|
||||
return GetObject(anObject);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
* GetSame
|
||||
|
@ -61,14 +61,16 @@ class GEOM_I_EXPORT GEOM_IShapesOperations_i :
|
||||
GEOM::GEOM_Object_ptr MakeCompound (const GEOM::ListOfGO& theShapes);
|
||||
|
||||
GEOM::GEOM_Object_ptr MakeGlueFaces (GEOM::GEOM_Object_ptr theShape,
|
||||
CORBA::Double theTolerance);
|
||||
CORBA::Double theTolerance,
|
||||
const CORBA::Boolean doKeepNonSolids);
|
||||
|
||||
GEOM::ListOfGO* GetGlueFaces (GEOM::GEOM_Object_ptr theShape,
|
||||
CORBA::Double theTolerance);
|
||||
|
||||
GEOM::GEOM_Object_ptr MakeGlueFacesByList (GEOM::GEOM_Object_ptr theShape,
|
||||
CORBA::Double theTolerance,
|
||||
const GEOM::ListOfGO& theFaces);
|
||||
const GEOM::ListOfGO& theFaces,
|
||||
const CORBA::Boolean doKeepNonSolids);
|
||||
|
||||
GEOM::ListOfGO* MakeExplode (GEOM::GEOM_Object_ptr theShape,
|
||||
CORBA::Long theShapeType,
|
||||
@ -175,6 +177,9 @@ class GEOM_I_EXPORT GEOM_IShapesOperations_i :
|
||||
GEOM::GEOM_Object_ptr GetInPlace (GEOM::GEOM_Object_ptr theShapeWhere,
|
||||
GEOM::GEOM_Object_ptr theShapeWhat);
|
||||
|
||||
GEOM::GEOM_Object_ptr GetInPlaceByHistory (GEOM::GEOM_Object_ptr theShapeWhere,
|
||||
GEOM::GEOM_Object_ptr theShapeWhat);
|
||||
|
||||
GEOM::GEOM_Object_ptr GetSame (GEOM::GEOM_Object_ptr theShapeWhere,
|
||||
GEOM::GEOM_Object_ptr theShapeWhat);
|
||||
|
||||
|
@ -1040,7 +1040,8 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePartition (GEOM::GEOM_List_ptr theSha
|
||||
GEOM::GEOM_List_ptr theRemoveInside,
|
||||
CORBA::Short theLimit,
|
||||
CORBA::Boolean theRemoveWebs,
|
||||
GEOM::GEOM_List_ptr theMaterials)
|
||||
GEOM::GEOM_List_ptr theMaterials,
|
||||
CORBA::Short theKeepNonlimitShapes)
|
||||
{
|
||||
beginService( " GEOM_Superv_i::MakePartition" );
|
||||
MESSAGE("GEOM_Superv_i::MakePartition");
|
||||
@ -1056,9 +1057,11 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePartition (GEOM::GEOM_List_ptr theSha
|
||||
dynamic_cast<GEOM_List_i<GEOM::ListOfLong>*>(GetServant(theMaterials, myPOA).in());
|
||||
if (aListImplS && aListImplT && aListImplKI && aListImplRI && aListImplM) {
|
||||
getBoolOp();
|
||||
GEOM::GEOM_Object_ptr anObj = myBoolOp->MakePartition(aListImplS->GetList(), aListImplT->GetList(),
|
||||
aListImplKI->GetList(), aListImplRI->GetList(),
|
||||
theLimit, theRemoveWebs, aListImplM->GetList());
|
||||
GEOM::GEOM_Object_ptr anObj =
|
||||
myBoolOp->MakePartition(aListImplS->GetList(), aListImplT->GetList(),
|
||||
aListImplKI->GetList(), aListImplRI->GetList(),
|
||||
theLimit, theRemoveWebs, aListImplM->GetList(),
|
||||
theKeepNonlimitShapes);
|
||||
endService( " GEOM_Superv_i::MakePartition" );
|
||||
return anObj;
|
||||
}
|
||||
@ -1678,12 +1681,14 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeCompound (GEOM::GEOM_List_ptr theShapes
|
||||
// MakeGlueFaces:
|
||||
//=============================================================================
|
||||
GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeGlueFaces (GEOM::GEOM_Object_ptr theShape,
|
||||
CORBA::Double theTolerance)
|
||||
CORBA::Double theTolerance,
|
||||
CORBA::Boolean doKeepNonSolids)
|
||||
{
|
||||
beginService( " GEOM_Superv_i::MakeGlueFaces" );
|
||||
MESSAGE("GEOM_Superv_i::MakeGlueFaces");
|
||||
getShapesOp();
|
||||
GEOM::GEOM_Object_ptr anObj = myShapesOp->MakeGlueFaces(theShape, theTolerance);
|
||||
GEOM::GEOM_Object_ptr anObj =
|
||||
myShapesOp->MakeGlueFaces(theShape, theTolerance, doKeepNonSolids);
|
||||
endService( " GEOM_Superv_i::MakeGlueFaces" );
|
||||
return anObj;
|
||||
}
|
||||
@ -1709,12 +1714,14 @@ GEOM::GEOM_List_ptr GEOM_Superv_i::GetGlueFaces (GEOM::GEOM_Object_ptr theShape,
|
||||
//=============================================================================
|
||||
GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeGlueFacesByList (GEOM::GEOM_Object_ptr theShape,
|
||||
CORBA::Double theTolerance,
|
||||
const GEOM::ListOfGO& theFaces)
|
||||
const GEOM::ListOfGO& theFaces,
|
||||
CORBA::Boolean doKeepNonSolids)
|
||||
{
|
||||
beginService( " GEOM_Superv_i::MakeGlueFacesByList" );
|
||||
MESSAGE("GEOM_Superv_i::MakeGlueFacesByList");
|
||||
getShapesOp();
|
||||
GEOM::GEOM_Object_ptr anObj = myShapesOp->MakeGlueFacesByList(theShape, theTolerance, theFaces);
|
||||
GEOM::GEOM_Object_ptr anObj =
|
||||
myShapesOp->MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids);
|
||||
endService( " GEOM_Superv_i::MakeGlueFacesByList" );
|
||||
return anObj;
|
||||
}
|
||||
|
@ -258,7 +258,8 @@ public:
|
||||
GEOM::GEOM_List_ptr theRemoveInside,
|
||||
CORBA::Short theLimit,
|
||||
CORBA::Boolean theRemoveWebs,
|
||||
GEOM::GEOM_List_ptr theMaterials);
|
||||
GEOM::GEOM_List_ptr theMaterials,
|
||||
CORBA::Short theKeepNonlimitShapes);
|
||||
GEOM::GEOM_Object_ptr MakeHalfPartition (GEOM::GEOM_Object_ptr theShape,
|
||||
GEOM::GEOM_Object_ptr thePlane);
|
||||
|
||||
@ -378,12 +379,14 @@ public:
|
||||
GEOM::GEOM_Object_ptr MakeSolidShells (GEOM::GEOM_List_ptr theShells);
|
||||
GEOM::GEOM_Object_ptr MakeCompound (GEOM::GEOM_List_ptr theShapes);
|
||||
GEOM::GEOM_Object_ptr MakeGlueFaces (GEOM::GEOM_Object_ptr theShape,
|
||||
CORBA::Double theTolerance);
|
||||
CORBA::Double theTolerance,
|
||||
CORBA::Boolean doKeepNonSolids);
|
||||
GEOM::GEOM_List_ptr GetGlueFaces (GEOM::GEOM_Object_ptr theShape,
|
||||
CORBA::Double theTolerance);
|
||||
GEOM::GEOM_Object_ptr MakeGlueFacesByList (GEOM::GEOM_Object_ptr theShape,
|
||||
CORBA::Double theTolerance,
|
||||
const GEOM::ListOfGO& theFaces);
|
||||
const GEOM::ListOfGO& theFaces,
|
||||
CORBA::Boolean doKeepNonSolids);
|
||||
GEOM::GEOM_List_ptr MakeExplode (GEOM::GEOM_Object_ptr theShape,
|
||||
CORBA::Long theShapeType,
|
||||
CORBA::Boolean isSorted);
|
||||
|
@ -528,24 +528,72 @@ def TestOtherOperations (geompy, math):
|
||||
geompy.UnionIDs(vertices_on_quad, vertices_on_quad_ids)
|
||||
geompy.addToStudy(vertices_on_quad, "Group of vertices on Quadrangle F12")
|
||||
|
||||
# GetInPlace(theShapeWhere, theShapeWhat)
|
||||
# Prepare arguments for GetInPlace and GetInPlaceByHistory
|
||||
box5 = geompy.MakeBoxDXDYDZ(100, 100, 100)
|
||||
box6 = geompy.MakeTranslation(box5, 50, 50, 0)
|
||||
|
||||
geompy.addToStudy(box5, "Box 5")
|
||||
geompy.addToStudy(box6, "Box 6")
|
||||
|
||||
part = geompy.MakePartition([box5], [box6])
|
||||
geompy.addToStudy(part, "Partitioned")
|
||||
|
||||
box5_faces = geompy.SubShapeAll(box5, geompy.ShapeType["FACE"])
|
||||
box6_faces = geompy.SubShapeAll(box6, geompy.ShapeType["FACE"])
|
||||
|
||||
ifa = 1
|
||||
for aface in box5_faces:
|
||||
geompy.addToStudyInFather(box5, aface, "Face" + `ifa`)
|
||||
ifa = ifa + 1
|
||||
|
||||
ifa = 1
|
||||
for aface in box6_faces:
|
||||
geompy.addToStudyInFather(box6, aface, "Face" + `ifa`)
|
||||
ifa = ifa + 1
|
||||
|
||||
# GetInPlace(theShapeWhere, theShapeWhat)
|
||||
ibb = 5
|
||||
box_list = [box5, box6]
|
||||
for abox in box_list:
|
||||
geompy.addToStudy(abox, "Box " + `ibb`)
|
||||
box_faces = geompy.SubShapeAll(abox, geompy.ShapeType["FACE"])
|
||||
faces_list = [box5_faces, box6_faces]
|
||||
for afaces in faces_list:
|
||||
ifa = 1
|
||||
for aface in box_faces:
|
||||
geompy.addToStudyInFather(abox, aface, "Face" + `ifa`)
|
||||
refl_box_face = geompy.GetInPlace(part, aface)
|
||||
if refl_box_face is not None:
|
||||
for aface in afaces:
|
||||
if ibb == 6 and (ifa == 2 or ifa == 4):
|
||||
# use IDL interface directly to avoid error message appearence in Python console
|
||||
refl_box_face = geompy.ShapesOp.GetInPlace(part, aface)
|
||||
if refl_box_face is not None:
|
||||
geompy.addToStudyInFather(part, refl_box_face,
|
||||
"Reflection of face " + `ifa` + " of box " + `ibb`)
|
||||
error = "Result of GetInPlace must be NULL for face " + `ifa` + " of box " + `ibb`
|
||||
raise RuntimeError, error
|
||||
else:
|
||||
# use geompy interface
|
||||
refl_box_face = geompy.GetInPlace(part, aface)
|
||||
geompy.addToStudyInFather(part, refl_box_face,
|
||||
"Reflection of Face " + `ifa` + " of box " + `ibb`)
|
||||
"Reflection of face " + `ifa` + " of box " + `ibb`)
|
||||
ifa = ifa + 1
|
||||
ibb = ibb + 1
|
||||
|
||||
# GetInPlaceByHistory(theShapeWhere, theShapeWhat)
|
||||
part = geompy.MakePartition([box5], [box6])
|
||||
geompy.addToStudy(part, "Partitioned")
|
||||
|
||||
ibb = 5
|
||||
faces_list = [box5_faces, box6_faces]
|
||||
for afaces in faces_list:
|
||||
ifa = 1
|
||||
for aface in afaces:
|
||||
if ibb == 6 and (ifa == 2 or ifa == 4):
|
||||
# use IDL interface directly to avoid error message appearence in Python console
|
||||
refl_box_face = geompy.ShapesOp.GetInPlaceByHistory(part, aface)
|
||||
if refl_box_face is not None:
|
||||
geompy.addToStudyInFather(part, refl_box_face,
|
||||
"Reflection of face " + `ifa` + " of box " + `ibb` + " (by history)")
|
||||
error = "Result of GetInPlaceByHistory must be NULL for face " + `ifa` + " of box " + `ibb`
|
||||
raise RuntimeError, error
|
||||
else:
|
||||
# use geompy interface
|
||||
refl_box_face = geompy.GetInPlaceByHistory(part, aface)
|
||||
geompy.addToStudyInFather(part, refl_box_face,
|
||||
"Reflection of face " + `ifa` + " of box " + `ibb` + " (by history)")
|
||||
ifa = ifa + 1
|
||||
ibb = ibb + 1
|
||||
|
@ -97,7 +97,7 @@ p_tools.append(geompy.MakePlane(geompy.MakeVertex(gx+g_rayonPetit, 0, 0), geompy
|
||||
|
||||
addToStudy(t_boite, "t_boite")
|
||||
|
||||
p_element = geompy.MakePartition([t_boite], p_tools, [], [], 4, 0, [])
|
||||
p_element = geompy.MakePartition([t_boite], p_tools, [], [], 4, 0, [], 0)
|
||||
|
||||
# Compound
|
||||
# --------
|
||||
|
@ -17,7 +17,7 @@
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
#
|
||||
#
|
||||
#
|
||||
@ -32,87 +32,10 @@
|
||||
|
||||
include $(top_srcdir)/adm_local/unix/make_common_starter.am
|
||||
|
||||
# ===============================================================
|
||||
# Swig targets
|
||||
# ===============================================================
|
||||
# (cf. http://www.geocities.com/foetsch/python/swig_linux.htm)
|
||||
#
|
||||
# Step 1: build the wrapping source files with swig
|
||||
#
|
||||
# libSALOME_LifeCycleCORBA.i -- swig --> swig_wrap.cpp
|
||||
# libSALOME_Swig.py
|
||||
#
|
||||
# Step 2: build the dynamic library from cpp built source files and
|
||||
# dependant libraries.
|
||||
#
|
||||
# swig_wrap.cpp -- gcc --> swig_wrap.o |-- link --> _libSALOME_Swig.la
|
||||
# + |
|
||||
# dependant libs |
|
||||
#
|
||||
# The file libSALOME_Swigcmodule.py will be installed in
|
||||
# <prefix>/lib/python<version>/site-package/salome.
|
||||
# The library will be installed in the same place.
|
||||
#
|
||||
|
||||
# this option puts it to dist
|
||||
#BUILT_SOURCES = swig_wrap.cpp
|
||||
|
||||
SWIG_FLAGS = \
|
||||
@SWIG_FLAGS@ \
|
||||
-I$(srcdir) \
|
||||
-I$(srcdir)/../GEOMGUI
|
||||
|
||||
SWIG_SOURCES = libGEOM_Swig.i
|
||||
|
||||
# Libraries targets
|
||||
lib_LTLIBRARIES = libGEOM_Swigcmodule.la
|
||||
|
||||
nodist_pkgpython_DATA = libGEOM_Swig.py
|
||||
libGEOM_Swig.py: swig_wrap.cpp
|
||||
|
||||
libGEOM_Swigcmodule_la_SOURCES = \
|
||||
$(BUILT_SOURCES) \
|
||||
$(SWIG_SOURCES)
|
||||
|
||||
nodist_libGEOM_Swigcmodule_la_SOURCES = swig_wrap.cpp
|
||||
|
||||
#LIB_CLIENT_IDL = SALOMEDS.idl \
|
||||
# SALOMEDS_Attributes.idl \
|
||||
# SALOME_Exception.idl \
|
||||
# GEOM_Gen.idl \
|
||||
# SALOME_Component.idl \
|
||||
# SALOME_GenericObj.idl
|
||||
|
||||
EXPORT_SHAREDPYSCRIPTS=\
|
||||
GEOM_shared_modules.py
|
||||
|
||||
libGEOM_Swigcmodule_la_CPPFLAGS = \
|
||||
$(QT_INCLUDES) \
|
||||
$(PYTHON_INCLUDES) \
|
||||
$(CAS_CPPFLAGS) \
|
||||
$(VTK_INCLUDES) \
|
||||
$(OGL_INCLUDES) \
|
||||
$(KERNEL_CXXFLAGS) \
|
||||
$(GUI_CXXFLAGS) \
|
||||
$(CORBA_CXXFLAGS) \
|
||||
$(CORBA_INCLUDES) \
|
||||
-I$(srcdir)/../GEOMGUI \
|
||||
-I$(top_builddir)/idl \
|
||||
-I$(top_builddir)/salome_adm/unix
|
||||
|
||||
libGEOM_Swigcmodule_la_LDFLAGS = \
|
||||
../GEOMGUI/libGEOM.la
|
||||
|
||||
|
||||
libGEOM_Swigcmodule_la_LIBADD = \
|
||||
$(PYTHON_LIBS)
|
||||
|
||||
swig_wrap.cpp : $(SWIG_SOURCES)
|
||||
$(SWIG) $(SWIG_FLAGS) -o $@ $<
|
||||
|
||||
CLEANFILES = \
|
||||
swig_wrap.cpp
|
||||
|
||||
#
|
||||
# ===============================================================
|
||||
# Files to be installed
|
||||
@ -121,7 +44,6 @@ CLEANFILES = \
|
||||
|
||||
# Scripts to be installed.
|
||||
dist_salomescript_DATA= \
|
||||
libGEOM_Swig.py \
|
||||
geompy.py \
|
||||
geompyDC.py \
|
||||
batchmode_geompy.py \
|
||||
@ -157,9 +79,3 @@ dist_salomescript_DATA= \
|
||||
|
||||
sharedpkgpython_PYTHON = \
|
||||
GEOM_shared_modules.py
|
||||
|
||||
install-exec-hook:\
|
||||
$(libdir)/_libGEOM_Swig.so
|
||||
|
||||
$(libdir)/_libGEOM_Swig.so:
|
||||
( cd $(libdir); ln -sf libGEOM_Swigcmodule.so _libGEOM_Swig.so; )
|
||||
|
@ -699,19 +699,23 @@ def MakeSection(s1, s2):
|
||||
return MakeBoolean(s1, s2, 4)
|
||||
|
||||
def MakePartition(ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
|
||||
Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[]):
|
||||
Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
|
||||
KeepNonlimitShapes=0):
|
||||
anObj = BoolOp.MakePartition(ListShapes, ListTools,
|
||||
ListKeepInside, ListRemoveInside,
|
||||
Limit, RemoveWebs, ListMaterials);
|
||||
Limit, RemoveWebs, ListMaterials,
|
||||
KeepNonlimitShapes);
|
||||
if BoolOp.IsDone() == 0:
|
||||
print "MakePartition : ", BoolOp.GetErrorCode()
|
||||
return anObj
|
||||
|
||||
def Partition(ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
|
||||
Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[]):
|
||||
Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
|
||||
KeepNonlimitShapes=0):
|
||||
anObj = MakePartition(ListShapes, ListTools,
|
||||
ListKeepInside, ListRemoveInside,
|
||||
Limit, RemoveWebs, ListMaterials);
|
||||
Limit, RemoveWebs, ListMaterials,
|
||||
KeepNonlimitShapes);
|
||||
return anObj
|
||||
|
||||
def MakeHalfPartition(theShape, thePlane):
|
||||
|
@ -732,7 +732,9 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
||||
# @param theSeqSubBases - list of corresponding subshapes of section shapes.
|
||||
# @param theLocations - list of locations on the path corresponding
|
||||
# specified list of the Bases shapes. Number of locations
|
||||
# should be equal to number of bases or list of locations can be empty.
|
||||
# should be equal to number of bases. First and last
|
||||
# locations must be coincided with first and last vertexes
|
||||
# of path correspondingly.
|
||||
# @param thePath - Path shape to extrude the base shape along it.
|
||||
# @param theWithContact - the mode defining that the section is translated to be in
|
||||
# contact with the spine.
|
||||
@ -1079,6 +1081,27 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
||||
print "GetInPlace : ", self.ShapesOp.GetErrorCode()
|
||||
return anObj
|
||||
|
||||
## Get sub-shape(s) of \a theShapeWhere, which are
|
||||
# coincident with \a theShapeWhat or could be a part of it.
|
||||
#
|
||||
# Implementation of this method is based on a saved history of an operation,
|
||||
# produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
|
||||
# arguments (an argument shape or a sub-shape of an argument shape).
|
||||
# The operation could be the Partition or one of boolean operations,
|
||||
# performed on simple shapes (not on compounds).
|
||||
#
|
||||
# @param theShapeWhere Shape to find sub-shapes of.
|
||||
# @param theShapeWhat Shape, specifying what to find (must be in the
|
||||
# building history of the ShapeWhere).
|
||||
# @return Group of all found sub-shapes or a single found sub-shape.
|
||||
#
|
||||
# Example: see GEOM_TestOthers.py
|
||||
def GetInPlaceByHistory(theShapeWhere, theShapeWhat):
|
||||
anObj = ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
|
||||
if ShapesOp.IsDone() == 0:
|
||||
print "GetInPlace : ", ShapesOp.GetErrorCode()
|
||||
return anObj
|
||||
|
||||
## Get sub-shape of theShapeWhere, which is
|
||||
# equal to \a theShapeWhat.
|
||||
# @param theShapeWhere Shape to find sub-shape of.
|
||||
@ -1365,11 +1388,13 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
||||
## Replace coincident faces in theShape by one face.
|
||||
# @param theShape Initial shape.
|
||||
# @param theTolerance Maximum distance between faces, which can be considered as coincident.
|
||||
# @param doKeepNonSolids If FALSE, only solids will present in the result,
|
||||
# otherwise all initial shapes.
|
||||
# @return New GEOM_Object, containing a copy of theShape without coincident faces.
|
||||
#
|
||||
# Example: see GEOM_Spanner.py
|
||||
def MakeGlueFaces(self,theShape, theTolerance):
|
||||
anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance)
|
||||
def MakeGlueFaces(theShape, theTolerance, doKeepNonSolids=True):
|
||||
anObj = ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
|
||||
if self.ShapesOp.IsDone() == 0:
|
||||
print "MakeGlueFaces : ", self.ShapesOp.GetErrorCode()
|
||||
return anObj
|
||||
@ -1382,7 +1407,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
||||
# @return ListOfGO.
|
||||
#
|
||||
# Example: see GEOM_Spanner.py
|
||||
def GetGlueFaces(self,theShape, theTolerance):
|
||||
def GetGlueFaces(self, theShape, theTolerance):
|
||||
anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
|
||||
if self.ShapesOp.IsDone() == 0:
|
||||
print "GetGlueFaces : ", self.ShapesOp.GetErrorCode()
|
||||
@ -1395,12 +1420,14 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
||||
# @param theTolerance Maximum distance between faces,
|
||||
# which can be considered as coincident.
|
||||
# @param theFaces List of faces for gluing.
|
||||
# @param doKeepNonSolids If FALSE, only solids will present in the result,
|
||||
# otherwise all initial shapes.
|
||||
# @return New GEOM_Object, containing a copy of theShape
|
||||
# without some faces.
|
||||
#
|
||||
# Example: see GEOM_Spanner.py
|
||||
def MakeGlueFacesByList(self,theShape, theTolerance, theFaces):
|
||||
anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces)
|
||||
def MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids=True):
|
||||
anObj = ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
|
||||
if self.ShapesOp.IsDone() == 0:
|
||||
print "MakeGlueFacesByList : ", self.ShapesOp.GetErrorCode()
|
||||
return anObj
|
||||
@ -1455,6 +1482,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
||||
# in order to avoid possible intersection between shapes from
|
||||
# this compound.
|
||||
# @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
|
||||
# @param KeepNonlimitShapes: if this parameter == 0 - only shapes with
|
||||
# type <= Limit are kept in the result,
|
||||
# else - shapes with type > Limit are kept
|
||||
# also (if they exist)
|
||||
#
|
||||
# After implementation new version of PartitionAlgo (October 2006)
|
||||
# other parameters are ignored by current functionality. They are kept
|
||||
@ -1472,10 +1503,12 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
||||
#
|
||||
# Example: see GEOM_TestAll.py
|
||||
def MakePartition(self,ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
|
||||
Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[]):
|
||||
Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
|
||||
KeepNonlimitShapes=0):
|
||||
anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
|
||||
ListKeepInside, ListRemoveInside,
|
||||
Limit, RemoveWebs, ListMaterials);
|
||||
Limit, RemoveWebs, ListMaterials,
|
||||
KeepNonlimitShapes);
|
||||
if self.BoolOp.IsDone() == 0:
|
||||
print "MakePartition : ", self.BoolOp.GetErrorCode()
|
||||
return anObj
|
||||
@ -1492,11 +1525,14 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
||||
#
|
||||
# @return New GEOM_Object, containing the result shapes.
|
||||
#
|
||||
def MakePartitionNonSelfIntersectedShape(self,ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
|
||||
Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[]):
|
||||
def MakePartitionNonSelfIntersectedShape(ListShapes, ListTools=[],
|
||||
ListKeepInside=[], ListRemoveInside=[],
|
||||
Limit=ShapeType["SHAPE"], RemoveWebs=0,
|
||||
ListMaterials=[], KeepNonlimitShapes=0):
|
||||
anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
|
||||
ListKeepInside, ListRemoveInside,
|
||||
Limit, RemoveWebs, ListMaterials);
|
||||
Limit, RemoveWebs, ListMaterials,
|
||||
KeepNonlimitShapes);
|
||||
if self.BoolOp.IsDone() == 0:
|
||||
print "MakePartitionNonSelfIntersectedShape : ", self.BoolOp.GetErrorCode()
|
||||
return anObj
|
||||
@ -1505,10 +1541,12 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
||||
#
|
||||
# Example: see GEOM_TestOthers.py
|
||||
def Partition(self,ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
|
||||
Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[]):
|
||||
Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
|
||||
KeepNonlimitShapes=0):
|
||||
anObj = self.MakePartition(ListShapes, ListTools,
|
||||
ListKeepInside, ListRemoveInside,
|
||||
Limit, RemoveWebs, ListMaterials);
|
||||
Limit, RemoveWebs, ListMaterials,
|
||||
KeepNonlimitShapes);
|
||||
return anObj
|
||||
|
||||
## Perform partition of the Shape with the Plane
|
||||
|
127
src/GEOM_SWIG_WITHIHM/Makefile.am
Normal file
127
src/GEOM_SWIG_WITHIHM/Makefile.am
Normal file
@ -0,0 +1,127 @@
|
||||
# GEOM GEOM_SWIG : binding of C++ omplementaion with Python
|
||||
#
|
||||
# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
#
|
||||
#
|
||||
#
|
||||
# File : Makefile.in
|
||||
# Author : Nicolas REJNERI, Paul RASCLE
|
||||
# Modified by : Alexander BORODIN (OCN) - autotools usage
|
||||
# Module : GEOM
|
||||
# $Header$
|
||||
|
||||
|
||||
# Libraries targets
|
||||
|
||||
include $(top_srcdir)/adm_local/unix/make_common_starter.am
|
||||
|
||||
# ===============================================================
|
||||
# Swig targets
|
||||
# ===============================================================
|
||||
# (cf. http://www.geocities.com/foetsch/python/swig_linux.htm)
|
||||
#
|
||||
# Step 1: build the wrapping source files with swig
|
||||
#
|
||||
# libSALOME_LifeCycleCORBA.i -- swig --> swig_wrap.cpp
|
||||
# libSALOME_Swig.py
|
||||
#
|
||||
# Step 2: build the dynamic library from cpp built source files and
|
||||
# dependant libraries.
|
||||
#
|
||||
# swig_wrap.cpp -- gcc --> swig_wrap.o |-- link --> _libSALOME_Swig.la
|
||||
# + |
|
||||
# dependant libs |
|
||||
#
|
||||
# The file libSALOME_Swigcmodule.py will be installed in
|
||||
# <prefix>/lib/python<version>/site-package/salome.
|
||||
# The library will be installed in the same place.
|
||||
#
|
||||
|
||||
# this option puts it to dist
|
||||
#BUILT_SOURCES = swig_wrap.cpp
|
||||
|
||||
SWIG_FLAGS = \
|
||||
@SWIG_FLAGS@ \
|
||||
-I$(srcdir) \
|
||||
-I$(srcdir)/../GEOMGUI
|
||||
|
||||
SWIG_SOURCES = libGEOM_Swig.i
|
||||
|
||||
# Libraries targets
|
||||
lib_LTLIBRARIES = libGEOM_Swigcmodule.la
|
||||
|
||||
nodist_pkgpython_DATA = libGEOM_Swig.py
|
||||
libGEOM_Swig.py: swig_wrap.cpp
|
||||
|
||||
libGEOM_Swigcmodule_la_SOURCES = \
|
||||
$(BUILT_SOURCES) \
|
||||
$(SWIG_SOURCES)
|
||||
|
||||
nodist_libGEOM_Swigcmodule_la_SOURCES = swig_wrap.cpp
|
||||
|
||||
#LIB_CLIENT_IDL = SALOMEDS.idl \
|
||||
# SALOMEDS_Attributes.idl \
|
||||
# SALOME_Exception.idl \
|
||||
# GEOM_Gen.idl \
|
||||
# SALOME_Component.idl \
|
||||
# SALOME_GenericObj.idl
|
||||
|
||||
libGEOM_Swigcmodule_la_CPPFLAGS = \
|
||||
$(QT_INCLUDES) \
|
||||
$(PYTHON_INCLUDES) \
|
||||
$(CAS_CPPFLAGS) \
|
||||
$(VTK_INCLUDES) \
|
||||
$(OGL_INCLUDES) \
|
||||
$(KERNEL_CXXFLAGS) \
|
||||
$(GUI_CXXFLAGS) \
|
||||
$(CORBA_CXXFLAGS) \
|
||||
$(CORBA_INCLUDES) \
|
||||
-I$(srcdir)/../GEOMGUI \
|
||||
-I$(top_builddir)/idl \
|
||||
-I$(top_builddir)/salome_adm/unix
|
||||
|
||||
libGEOM_Swigcmodule_la_LDFLAGS = \
|
||||
../GEOMGUI/libGEOM.la
|
||||
|
||||
|
||||
libGEOM_Swigcmodule_la_LIBADD = \
|
||||
$(PYTHON_LIBS)
|
||||
|
||||
swig_wrap.cpp : $(SWIG_SOURCES)
|
||||
$(SWIG) $(SWIG_FLAGS) -o $@ $<
|
||||
|
||||
CLEANFILES = \
|
||||
swig_wrap.cpp
|
||||
|
||||
#
|
||||
# ===============================================================
|
||||
# Files to be installed
|
||||
# ===============================================================
|
||||
#
|
||||
|
||||
# Scripts to be installed.
|
||||
dist_salomescript_DATA= \
|
||||
libGEOM_Swig.py
|
||||
|
||||
install-exec-hook:\
|
||||
$(libdir)/_libGEOM_Swig.so
|
||||
|
||||
$(libdir)/_libGEOM_Swig.so:
|
||||
( cd $(libdir); ln -sf libGEOM_Swigcmodule.so _libGEOM_Swig.so; )
|
@ -17,7 +17,7 @@
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
//
|
||||
//
|
||||
@ -33,31 +33,29 @@
|
||||
#include "SalomeApp_Application.h"
|
||||
#include "LightApp_SelectionMgr.h"
|
||||
|
||||
#include <BRepPrimAPI_MakePrism.hxx>
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
#include "GEOMImpl_Types.hxx"
|
||||
|
||||
#include <qlabel.h>
|
||||
#include <qcheckbox.h>
|
||||
|
||||
#include "GEOMImpl_Types.hxx"
|
||||
|
||||
#include "utilities.h"
|
||||
|
||||
//=================================================================================
|
||||
// class : GenerationGUI_PrismDlg()
|
||||
// purpose : Constructs a GenerationGUI_PrismDlg which is a child of 'parent', with the
|
||||
// purpose : Constructs a GenerationGUI_PrismDlg which is a child of 'parent', with the
|
||||
// name 'name' and widget flags set to 'f'.
|
||||
// The dialog will by default be modeless, unless you set 'modal' to
|
||||
// TRUE to construct a modal dialog.
|
||||
//=================================================================================
|
||||
GenerationGUI_PrismDlg::GenerationGUI_PrismDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
|
||||
const char* name, bool modal, WFlags fl)
|
||||
:GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize |
|
||||
WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
|
||||
: GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize |
|
||||
WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
|
||||
{
|
||||
QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_PRISM")));
|
||||
QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||
QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_PRISM_2P")));
|
||||
SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
|
||||
QPixmap image0(aResMgr->loadPixmap("GEOM", tr("ICON_DLG_PRISM")));
|
||||
QPixmap image1(aResMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
|
||||
QPixmap image2(aResMgr->loadPixmap("GEOM", tr("ICON_DLG_PRISM_2P")));
|
||||
|
||||
setCaption(tr("GEOM_EXTRUSION_TITLE"));
|
||||
|
||||
@ -65,9 +63,10 @@ GenerationGUI_PrismDlg::GenerationGUI_PrismDlg(GeometryGUI* theGeometryGUI, QWid
|
||||
GroupConstructors->setTitle(tr("GEOM_EXTRUSION"));
|
||||
RadioButton1->setPixmap(image0);
|
||||
RadioButton2->setPixmap(image2);
|
||||
//RadioButton2->close(TRUE);
|
||||
RadioButton3->close(TRUE);
|
||||
|
||||
RadioButton1->setChecked(true);
|
||||
|
||||
GroupPoints = new DlgRef_2Sel1Spin2Check(this, "GroupPoints");
|
||||
GroupPoints->CheckButton1->hide();
|
||||
GroupPoints->GroupBox1->setTitle(tr("GEOM_EXTRUSION_BSV"));
|
||||
@ -95,7 +94,6 @@ GenerationGUI_PrismDlg::GenerationGUI_PrismDlg(GeometryGUI* theGeometryGUI, QWid
|
||||
|
||||
setHelpFileName("extrusion.htm");
|
||||
|
||||
/* Initialisations */
|
||||
Init();
|
||||
}
|
||||
|
||||
@ -105,8 +103,8 @@ GenerationGUI_PrismDlg::GenerationGUI_PrismDlg(GeometryGUI* theGeometryGUI, QWid
|
||||
// purpose : Destroys the object and frees any allocated resources
|
||||
//=================================================================================
|
||||
GenerationGUI_PrismDlg::~GenerationGUI_PrismDlg()
|
||||
{
|
||||
/* no need to delete child widgets, Qt does it all for us */
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
||||
|
||||
@ -125,15 +123,15 @@ void GenerationGUI_PrismDlg::Init()
|
||||
GroupPoints2->LineEdit2->setReadOnly( true );
|
||||
GroupPoints2->LineEdit3->setReadOnly( true );
|
||||
|
||||
//myOkBase = myOkVec = false;
|
||||
myPoint1 = myPoint2 = myBase = myVec = GEOM::GEOM_Object::_nil();
|
||||
myOkBase = myOkVec = myOkPnt1 = myOkPnt2 = false;
|
||||
|
||||
|
||||
/* Get setting of step value from file configuration */
|
||||
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
||||
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
|
||||
|
||||
/* min, max, step and decimals for spin boxes & initial values */
|
||||
GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
|
||||
GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
|
||||
GroupPoints->SpinBox_DX->SetValue(100.0);
|
||||
|
||||
/* signals and slots connections */
|
||||
@ -149,9 +147,10 @@ void GenerationGUI_PrismDlg::Init()
|
||||
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
|
||||
connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
|
||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
|
||||
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
|
||||
GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
|
||||
|
||||
connect(GroupPoints->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(onReverse()));
|
||||
connect(GroupPoints->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(onReverse()));
|
||||
|
||||
|
||||
connect(GroupPoints2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
@ -163,12 +162,10 @@ void GenerationGUI_PrismDlg::Init()
|
||||
connect(GroupPoints2->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
|
||||
|
||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
|
||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
|
||||
connect(myGeomGUI->getApp()->selectionMgr(),
|
||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
|
||||
initName(tr("GEOM_EXTRUSION"));
|
||||
|
||||
globalSelection( GEOM_ALLSHAPES );
|
||||
ConstructorsClicked(0);
|
||||
}
|
||||
|
||||
@ -179,52 +176,52 @@ void GenerationGUI_PrismDlg::Init()
|
||||
//=================================================================================
|
||||
void GenerationGUI_PrismDlg::ConstructorsClicked(int constructorId)
|
||||
{
|
||||
disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
|
||||
|
||||
erasePreview();
|
||||
disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
|
||||
|
||||
switch (constructorId)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
globalSelection( GEOM_POINT );
|
||||
globalSelection( GEOM_ALLSHAPES );
|
||||
|
||||
GroupPoints2->hide();
|
||||
resize(0, 0);
|
||||
GroupPoints->show();
|
||||
|
||||
//GroupPoints->LineEdit1->setFocus();
|
||||
//myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
//displayPreview();
|
||||
GroupPoints2->hide();
|
||||
resize(0, 0);
|
||||
GroupPoints->show();
|
||||
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
GroupPoints->LineEdit1->setText("");
|
||||
GroupPoints->LineEdit2->setText("");
|
||||
GroupPoints2->LineEdit1->setText("");
|
||||
GroupPoints2->LineEdit2->setText("");
|
||||
GroupPoints2->LineEdit3->setText("");
|
||||
myPoint1 = myPoint2 = myBase = myVec = GEOM::GEOM_Object::_nil();
|
||||
myOkBase = myOkVec = myOkPnt1 = myOkPnt2 = false;
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
GroupPoints->LineEdit1->setText(GroupPoints2->LineEdit1->text()); // keep base
|
||||
GroupPoints->LineEdit2->setText("");
|
||||
myVec = GEOM::GEOM_Object::_nil();
|
||||
myOkVec = false;
|
||||
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
GroupPoints->hide();
|
||||
resize(0, 0);
|
||||
GroupPoints2->show();
|
||||
|
||||
myEditCurrentArgument = GroupPoints2->LineEdit1;
|
||||
GroupPoints2->LineEdit1->setText("");
|
||||
GroupPoints2->LineEdit2->setText("");
|
||||
GroupPoints2->LineEdit3->setText("");
|
||||
myPoint1 = myPoint2 = myBase = myVec = GEOM::GEOM_Object::_nil();
|
||||
myOkBase = myOkVec = myOkPnt1 = myOkPnt2 = false;
|
||||
GroupPoints->LineEdit1->setText("");
|
||||
GroupPoints->LineEdit2->setText("");
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
displayPreview();
|
||||
case 1:
|
||||
{
|
||||
globalSelection( GEOM_ALLSHAPES );
|
||||
|
||||
GroupPoints->hide();
|
||||
resize(0, 0);
|
||||
GroupPoints2->show();
|
||||
|
||||
myEditCurrentArgument = GroupPoints2->LineEdit1;
|
||||
GroupPoints2->LineEdit1->setText(GroupPoints->LineEdit1->text()); // keep base
|
||||
GroupPoints2->LineEdit2->setText("");
|
||||
GroupPoints2->LineEdit3->setText("");
|
||||
myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil();
|
||||
myOkPnt1 = myOkPnt2 = false;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
myEditCurrentArgument->setFocus();
|
||||
connect(myGeomGUI->getApp()->selectionMgr(),
|
||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
|
||||
if (!myOkBase)
|
||||
SelectionIntoArgument();
|
||||
}
|
||||
|
||||
|
||||
@ -262,8 +259,8 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument()
|
||||
erasePreview();
|
||||
myEditCurrentArgument->setText("");
|
||||
|
||||
if ( getConstructorId()==0 ) {
|
||||
|
||||
if (getConstructorId() == 0)
|
||||
{
|
||||
if (IObjectCount() != 1) {
|
||||
if (myEditCurrentArgument == GroupPoints->LineEdit1)
|
||||
myOkBase = false;
|
||||
@ -288,13 +285,11 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument()
|
||||
myVec = aSelectedObject;
|
||||
myOkVec = true;
|
||||
}
|
||||
myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
|
||||
|
||||
displayPreview();
|
||||
myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject));
|
||||
}
|
||||
|
||||
else { // getConstructorId()==1 - extrusion using 2 points
|
||||
|
||||
else // getConstructorId()==1 - extrusion using 2 points
|
||||
{
|
||||
if (IObjectCount() != 1) {
|
||||
if (myEditCurrentArgument == GroupPoints2->LineEdit1)
|
||||
myOkBase = false;
|
||||
@ -330,9 +325,28 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument()
|
||||
myOkPnt2 = true;
|
||||
}
|
||||
|
||||
myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
|
||||
myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject));
|
||||
}
|
||||
|
||||
displayPreview();
|
||||
displayPreview();
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : LineEditReturnPressed()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void GenerationGUI_PrismDlg::LineEditReturnPressed()
|
||||
{
|
||||
QLineEdit* send = (QLineEdit*)sender();
|
||||
if (send == GroupPoints->LineEdit1 ||
|
||||
send == GroupPoints->LineEdit2 ||
|
||||
send == GroupPoints2->LineEdit1 ||
|
||||
send == GroupPoints2->LineEdit2 ||
|
||||
send == GroupPoints2->LineEdit3 )
|
||||
{
|
||||
myEditCurrentArgument = send;
|
||||
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||
}
|
||||
}
|
||||
|
||||
@ -344,64 +358,38 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument()
|
||||
void GenerationGUI_PrismDlg::SetEditCurrentArgument()
|
||||
{
|
||||
QPushButton* send = (QPushButton*)sender();
|
||||
globalSelection( GEOM_ALLSHAPES );
|
||||
|
||||
if(send == GroupPoints->PushButton1) {
|
||||
if (send == GroupPoints->PushButton1) {
|
||||
GroupPoints->LineEdit1->setFocus();
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
globalSelection( GEOM_ALLSHAPES );
|
||||
}
|
||||
else if(send == GroupPoints->PushButton2) {
|
||||
else if (send == GroupPoints->PushButton2) {
|
||||
GroupPoints->LineEdit2->setFocus();
|
||||
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||
globalSelection( GEOM_LINE );
|
||||
}
|
||||
else if(send == GroupPoints2->PushButton1) {
|
||||
else if (send == GroupPoints2->PushButton1) {
|
||||
GroupPoints2->LineEdit1->setFocus();
|
||||
myEditCurrentArgument = GroupPoints2->LineEdit1;
|
||||
globalSelection( GEOM_ALLSHAPES );
|
||||
}
|
||||
else if(send == GroupPoints2->PushButton2) {
|
||||
else if (send == GroupPoints2->PushButton2) {
|
||||
GroupPoints2->LineEdit2->setFocus();
|
||||
myEditCurrentArgument = GroupPoints2->LineEdit2;
|
||||
globalSelection( GEOM_POINT );
|
||||
}
|
||||
else if(send == GroupPoints2->PushButton3) {
|
||||
else if (send == GroupPoints2->PushButton3) {
|
||||
GroupPoints2->LineEdit3->setFocus();
|
||||
myEditCurrentArgument = GroupPoints2->LineEdit3;
|
||||
globalSelection( GEOM_POINT );
|
||||
}
|
||||
|
||||
myEditCurrentArgument->setFocus();
|
||||
SelectionIntoArgument();
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : LineEditReturnPressed()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void GenerationGUI_PrismDlg::LineEditReturnPressed()
|
||||
{
|
||||
QLineEdit* send = (QLineEdit*)sender();
|
||||
if(send == GroupPoints->LineEdit1 ||
|
||||
send == GroupPoints->LineEdit2 ||
|
||||
send == GroupPoints2->LineEdit1 ||
|
||||
send == GroupPoints2->LineEdit2 ||
|
||||
send == GroupPoints2->LineEdit3 )
|
||||
{
|
||||
myEditCurrentArgument = send;
|
||||
GEOMBase_Skeleton::LineEditReturnPressed();
|
||||
}
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : enterEvent()
|
||||
// purpose : when mouse enter onto the QWidget
|
||||
//=================================================================================
|
||||
void GenerationGUI_PrismDlg::enterEvent(QEvent * e)
|
||||
{
|
||||
if ( !GroupConstructors->isEnabled() )
|
||||
ActivateThisDialog();
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ActivateThisDialog()
|
||||
// purpose :
|
||||
@ -409,16 +397,25 @@ void GenerationGUI_PrismDlg::enterEvent(QEvent * e)
|
||||
void GenerationGUI_PrismDlg::ActivateThisDialog()
|
||||
{
|
||||
GEOMBase_Skeleton::ActivateThisDialog();
|
||||
globalSelection( GEOM_ALLSHAPES );
|
||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
|
||||
|
||||
connect(myGeomGUI->getApp()->selectionMgr(),
|
||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
//GroupPoints->LineEdit1->setFocus();
|
||||
//myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
//displayPreview();
|
||||
|
||||
ConstructorsClicked( getConstructorId() );
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : enterEvent()
|
||||
// purpose : when mouse enter onto the QWidget
|
||||
//=================================================================================
|
||||
void GenerationGUI_PrismDlg::enterEvent(QEvent * e)
|
||||
{
|
||||
if (!GroupConstructors->isEnabled())
|
||||
ActivateThisDialog();
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ValueChangedInSpinBox()
|
||||
// purpose :
|
||||
@ -453,7 +450,12 @@ GEOM::GEOM_IOperations_ptr GenerationGUI_PrismDlg::createOperation()
|
||||
//=================================================================================
|
||||
bool GenerationGUI_PrismDlg::isValid( QString& )
|
||||
{
|
||||
return myOkBase && ( myOkVec || (myOkPnt1 && myOkPnt2) );
|
||||
if (getConstructorId() == 0)
|
||||
// by vector and height
|
||||
return (myOkBase && myOkVec);
|
||||
|
||||
// by two points
|
||||
return (myOkBase && myOkPnt1 && myOkPnt2);
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
@ -464,15 +466,15 @@ bool GenerationGUI_PrismDlg::execute( ObjectList& objects )
|
||||
{
|
||||
GEOM::GEOM_Object_var anObj;
|
||||
|
||||
switch ( getConstructorId() )
|
||||
switch ( getConstructorId() )
|
||||
{
|
||||
case 0 :
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
|
||||
MakePrismVecH(myBase, myVec, getHeight());
|
||||
break;
|
||||
}
|
||||
case 1 :
|
||||
case 1:
|
||||
{
|
||||
anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
|
||||
MakePrismTwoPnt(myBase, myPoint1, myPoint2);
|
||||
|
@ -17,7 +17,7 @@
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
//
|
||||
//
|
||||
@ -53,15 +53,15 @@ protected:
|
||||
virtual bool isValid( QString& msg );
|
||||
virtual bool execute( ObjectList& objects );
|
||||
|
||||
private :
|
||||
private:
|
||||
void Init();
|
||||
void enterEvent(QEvent* e);
|
||||
double getHeight() const;
|
||||
|
||||
|
||||
GEOM::GEOM_Object_var myBase; /* Base shape */
|
||||
GEOM::GEOM_Object_var myVec; /* Vector, defining the direction */
|
||||
GEOM::GEOM_Object_var myPoint1, myPoint2; /* Points for extrusion */
|
||||
|
||||
GEOM::GEOM_Object_var myPoint1, myPoint2; /* Points for extrusion */
|
||||
|
||||
bool myOkBase;
|
||||
bool myOkVec;
|
||||
bool myOkPnt1;
|
||||
@ -73,11 +73,12 @@ private :
|
||||
private slots:
|
||||
void ClickOnOk();
|
||||
bool ClickOnApply();
|
||||
|
||||
void ActivateThisDialog();
|
||||
void ConstructorsClicked(int);
|
||||
void LineEditReturnPressed();
|
||||
void SelectionIntoArgument();
|
||||
void SetEditCurrentArgument();
|
||||
void ConstructorsClicked(int);
|
||||
void ValueChangedInSpinBox();
|
||||
void onReverse();
|
||||
};
|
||||
|
@ -114,7 +114,7 @@ void GenerationGUI_RevolDlg::Init()
|
||||
|
||||
double SpecificStep = 5;
|
||||
/* min, max, step and decimals for spin boxes & initial values */
|
||||
GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep, 3);
|
||||
GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep, DBL_DIGITS_DISPLAY);
|
||||
GroupPoints->SpinBox_DX->SetValue(45.0);
|
||||
|
||||
/* signals and slots connections */
|
||||
|
@ -32,6 +32,7 @@
|
||||
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
|
||||
class QGroupBox;
|
||||
class QLineEdit;
|
||||
class QListBox;
|
||||
|
||||
@ -89,6 +90,7 @@ private:
|
||||
GEOM::GEOM_Object_var myMainObj;
|
||||
GEOM::GEOM_Object_var myGroup;
|
||||
|
||||
QGroupBox* GroupMedium;
|
||||
QPushButton* mySelBtn;
|
||||
QLineEdit* myMainName;
|
||||
QPushButton* mySelSubBtn;
|
||||
|
@ -25,4 +25,8 @@
|
||||
# Module : GEOM
|
||||
# $Header$
|
||||
|
||||
SUBDIRS = OBJECT ARCHIMEDE NMTDS NMTTools NMTAlgo GEOMAlgo SKETCHER GEOM BREPExport BREPImport IGESExport IGESImport STEPExport STEPImport STLExport ShHealOper GEOMImpl GEOM_I GEOMClient DlgRef GEOMFiltersSelection GEOMGUI GEOMBase GEOMToolsGUI DisplayGUI BasicGUI PrimitiveGUI GenerationGUI EntityGUI BuildGUI BooleanGUI TransformationGUI OperationGUI RepairGUI MeasureGUI GroupGUI BlocksGUI GEOM_I_Superv GEOM_SWIG
|
||||
SUBDIRS = ARCHIMEDE NMTDS NMTTools GEOMAlgo SKETCHER GEOM BREPExport BREPImport IGESExport IGESImport STEPExport STEPImport STLExport ShHealOper GEOMImpl GEOM_I GEOMClient GEOM_I_Superv GEOM_SWIG
|
||||
|
||||
if GEOM_ENABLE_GUI
|
||||
SUBDIRS+= OBJECT DlgRef GEOMFiltersSelection GEOMGUI GEOMBase GEOMToolsGUI DisplayGUI BasicGUI PrimitiveGUI GenerationGUI EntityGUI BuildGUI BooleanGUI TransformationGUI OperationGUI RepairGUI MeasureGUI GroupGUI BlocksGUI GEOM_SWIG_WITHIHM
|
||||
endif
|
||||
|
@ -17,7 +17,7 @@
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
//
|
||||
//
|
||||
@ -29,6 +29,8 @@
|
||||
#include "MeasureGUI_CenterMassDlg.h"
|
||||
#include "MeasureGUI_1Sel3LineEdit_QTD.h"
|
||||
|
||||
#include "DlgRef_SpinBox.h"
|
||||
|
||||
#include "utilities.h"
|
||||
#include "SUIT_Session.h"
|
||||
#include "SalomeApp_Application.h"
|
||||
@ -245,9 +247,9 @@ void MeasureGUI_CenterMassDlg::processObject()
|
||||
getParameters( x, y, z );
|
||||
|
||||
myGrp->LineEdit1->setText( GEOMBase::GetName( myObj ) );
|
||||
myGrp->LineEdit2->setText( QString( "%1" ).arg( x ) );
|
||||
myGrp->LineEdit3->setText( QString( "%1" ).arg( y ) );
|
||||
myGrp->LineEdit4->setText( QString( "%1" ).arg( z ) );
|
||||
myGrp->LineEdit2->setText( DlgRef_SpinBox::PrintDoubleValue( x ) );
|
||||
myGrp->LineEdit3->setText( DlgRef_SpinBox::PrintDoubleValue( y ) );
|
||||
myGrp->LineEdit4->setText( DlgRef_SpinBox::PrintDoubleValue( z ) );
|
||||
|
||||
displayPreview();
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
//
|
||||
//
|
||||
@ -30,6 +30,7 @@
|
||||
#include "MeasureGUI_2Sel1LineEdit_QTD.h"
|
||||
#include "GEOMBase.h"
|
||||
#include "GEOM_Displayer.h"
|
||||
#include "DlgRef_SpinBox.h"
|
||||
|
||||
#include "SUIT_Session.h"
|
||||
#include "SUIT_ViewWindow.h"
|
||||
@ -118,14 +119,13 @@ void MeasureGUI_DistanceDlg::Init()
|
||||
mySelEdit = myGrp->LineEdit1;
|
||||
mySelBtn2 = myGrp->PushButton2;
|
||||
mySelEdit2 = myGrp->LineEdit2;
|
||||
|
||||
|
||||
myEditCurrentArgument = mySelEdit;
|
||||
|
||||
connect( mySelEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
|
||||
connect( mySelBtn2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
|
||||
|
||||
MeasureGUI_Skeleton::Init();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -163,7 +163,7 @@ void MeasureGUI_DistanceDlg::processObject()
|
||||
double aDist = 0.;
|
||||
if ( getParameters( aDist, aPnt1, aPnt2 ) )
|
||||
{
|
||||
myGrp->LineEdit3->setText( QString( "%1" ).arg( aDist ) );
|
||||
myGrp->LineEdit3->setText( DlgRef_SpinBox::PrintDoubleValue( aDist ) );
|
||||
redisplayPreview();
|
||||
}
|
||||
else
|
||||
@ -171,7 +171,6 @@ void MeasureGUI_DistanceDlg::processObject()
|
||||
myGrp->LineEdit3->setText( "" );
|
||||
erasePreview();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
@ -256,12 +255,14 @@ SALOME_Prs* MeasureGUI_DistanceDlg::buildPrs()
|
||||
{
|
||||
double aDist = 0.;
|
||||
gp_Pnt aPnt1( 0, 0, 0 ), aPnt2( 0, 0, 0 );
|
||||
|
||||
if ( myObj->_is_nil() || myObj2->_is_nil() || !getParameters( aDist, aPnt1, aPnt2 ) ||
|
||||
SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager()->getType()
|
||||
!= OCCViewer_Viewer::Type() )
|
||||
|
||||
SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
|
||||
|
||||
if ( myObj->_is_nil() || myObj2->_is_nil() ||
|
||||
!getParameters( aDist, aPnt1, aPnt2 ) ||
|
||||
vw->getViewManager()->getType() != OCCViewer_Viewer::Type() )
|
||||
return 0;
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
if( aDist <= 1.e-9 )
|
||||
@ -282,7 +283,6 @@ SALOME_Prs* MeasureGUI_DistanceDlg::buildPrs()
|
||||
( aPnt1.Y() + aPnt2.Y() ) / 2,
|
||||
( aPnt1.Z() + aPnt2.Z() ) / 2 + 100 );
|
||||
|
||||
|
||||
gp_Vec va( aPnt3, aPnt1 );
|
||||
gp_Vec vb( aPnt3, aPnt2 );
|
||||
|
||||
@ -291,18 +291,15 @@ SALOME_Prs* MeasureGUI_DistanceDlg::buildPrs()
|
||||
aPnt3.SetY( ( aPnt1.Y() + aPnt2.Y() ) / 2 + 100 );
|
||||
aPnt3.SetZ( ( aPnt1.Z() + aPnt2.Z() ) / 2 );
|
||||
}
|
||||
|
||||
|
||||
gce_MakePln gce_MP( aPnt1, aPnt2, aPnt3 );
|
||||
Handle( Geom_Plane ) P = new Geom_Plane( gce_MP.Value() );
|
||||
|
||||
Handle( AIS_LengthDimension ) anIO = new AIS_LengthDimension(
|
||||
aVert1, aVert2, P, aDist, TCollection_ExtendedString( (Standard_CString)aLabel.latin1() ) );
|
||||
Handle( AIS_LengthDimension ) anIO = new AIS_LengthDimension
|
||||
(aVert1, aVert2, P, aDist, TCollection_ExtendedString((Standard_CString)aLabel.latin1()));
|
||||
|
||||
SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
|
||||
SOCC_Prs* aPrs = dynamic_cast<SOCC_Prs*>( ((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs( 0 ) );
|
||||
|
||||
//QAD_ViewFrame* vf = GEOM_Displayer::GetActiveView();
|
||||
//OCCViewer_Prs* aPrs = dynamic_cast<OCCViewer_Prs*>( vf->CreatePrs( 0 ) );
|
||||
SOCC_Prs* aPrs =
|
||||
dynamic_cast<SOCC_Prs*>( ((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs( 0 ) );
|
||||
|
||||
if ( aPrs )
|
||||
aPrs->AddObject( anIO );
|
||||
@ -324,17 +321,3 @@ bool MeasureGUI_DistanceDlg::isValid( QString& msg )
|
||||
{
|
||||
return MeasureGUI_Skeleton::isValid( msg ) && !myObj2->_is_nil();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
//
|
||||
//
|
||||
@ -203,4 +203,3 @@ bool MeasureGUI_InertiaDlg::getParameters( gp_Mat& I,
|
||||
return getOperation()->IsDone();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
//
|
||||
//
|
||||
@ -181,24 +181,3 @@ bool MeasureGUI_MaxToleranceDlg::getParameters( double& theMinFaceToler,
|
||||
return getOperation()->IsDone();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -29,7 +29,10 @@
|
||||
#include "MeasureGUI_PointDlg.h"
|
||||
#include "GEOMBase.h"
|
||||
|
||||
#include "DlgRef_SpinBox.h"
|
||||
|
||||
#include "utilities.h"
|
||||
|
||||
#include "SUIT_Session.h"
|
||||
#include "SalomeApp_Application.h"
|
||||
#include "LightApp_SelectionMgr.h"
|
||||
@ -58,14 +61,13 @@
|
||||
//=================================================================================
|
||||
// class : MeasureGUI_PointDlg()
|
||||
// purpose : Constructs a MeasureGUI_PointDlg which is a child of 'parent'
|
||||
//
|
||||
//=================================================================================
|
||||
MeasureGUI_PointDlg::MeasureGUI_PointDlg( GeometryGUI* GUI, QWidget* parent )
|
||||
: MeasureGUI_Skeleton( GUI, parent, "MeasureGUI_PointDlg" )
|
||||
{
|
||||
QPixmap iconPnt( SUIT_Session::session()->resourceMgr()->loadPixmap(
|
||||
"GEOM",tr( "ICON_DLG_POINT" ) ) );
|
||||
|
||||
|
||||
QPixmap iconSelect( SUIT_Session::session()->resourceMgr()->loadPixmap(
|
||||
"GEOM",tr( "ICON_SELECT" ) ) );
|
||||
|
||||
@ -75,7 +77,7 @@ MeasureGUI_PointDlg::MeasureGUI_PointDlg( GeometryGUI* GUI, QWidget* parent )
|
||||
RadioButton1->setPixmap( iconPnt );
|
||||
|
||||
QGroupBox* aGrp = new QGroupBox( 2, Qt::Horizontal, tr( "COORDINATES" ), this );
|
||||
|
||||
|
||||
new QLabel( tr( "POINT" ), aGrp );
|
||||
QFrame* aFrame = new QFrame( aGrp );
|
||||
mySelBtn = new QPushButton( aFrame );
|
||||
@ -108,7 +110,7 @@ MeasureGUI_PointDlg::MeasureGUI_PointDlg( GeometryGUI* GUI, QWidget* parent )
|
||||
//=================================================================================
|
||||
// function : ~MeasureGUI_PointDlg()
|
||||
// purpose : Destroys the object and frees any allocated resources
|
||||
//======================myX->setReadOnly( true );===========================================================
|
||||
//=================================================================================
|
||||
MeasureGUI_PointDlg::~MeasureGUI_PointDlg()
|
||||
{
|
||||
}
|
||||
@ -178,7 +180,7 @@ void MeasureGUI_PointDlg::SelectionIntoArgument()
|
||||
|
||||
TopTools_IndexedMapOfShape aShapes;
|
||||
TopExp::MapShapes( aShape, aShapes );
|
||||
|
||||
|
||||
if ( aShape != aShapes( i ) )
|
||||
aName += QString( ":%1" ).arg( i );
|
||||
|
||||
@ -189,9 +191,9 @@ void MeasureGUI_PointDlg::SelectionIntoArgument()
|
||||
{
|
||||
gp_Pnt aPnt = BRep_Tool::Pnt( aPoint );
|
||||
mySelEdit->setText( aName );
|
||||
myX->setText( QString( "%1" ).arg( aPnt.X() ) );
|
||||
myY->setText( QString( "%1" ).arg( aPnt.Y() ) );
|
||||
myZ->setText( QString( "%1" ).arg( aPnt.Z() ) );
|
||||
myX->setText(DlgRef_SpinBox::PrintDoubleValue(aPnt.X()));
|
||||
myY->setText(DlgRef_SpinBox::PrintDoubleValue(aPnt.Y()));
|
||||
myZ->setText(DlgRef_SpinBox::PrintDoubleValue(aPnt.Z()));
|
||||
}
|
||||
}
|
||||
catch( ... )
|
||||
@ -203,23 +205,3 @@ void MeasureGUI_PointDlg::SelectionIntoArgument()
|
||||
myZ->setText( "" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "GEOM_Displayer.h"
|
||||
#include "GEOMImpl_Types.hxx"
|
||||
#include "GEOMBase.h"
|
||||
#include "DlgRef_SpinBox.h"
|
||||
|
||||
#include "SalomeApp_Tools.h"
|
||||
#include "utilities.h"
|
||||
@ -148,9 +149,9 @@ void MeasureGUI_PropertiesDlg::processObject()
|
||||
}
|
||||
else
|
||||
{
|
||||
myGrp->LineEdit2->setText( QString( "%1" ).arg( aLength ) );
|
||||
myGrp->LineEdit3->setText( QString( "%1" ).arg( anArea ) );
|
||||
myGrp->LineEdit4->setText( QString( "%1" ).arg( aVolume ) );
|
||||
myGrp->LineEdit2->setText( DlgRef_SpinBox::PrintDoubleValue( aLength ) );
|
||||
myGrp->LineEdit3->setText( DlgRef_SpinBox::PrintDoubleValue( anArea ) );
|
||||
myGrp->LineEdit4->setText( DlgRef_SpinBox::PrintDoubleValue( aVolume ) );
|
||||
}
|
||||
}
|
||||
|
||||
@ -200,24 +201,3 @@ SALOME_Prs* MeasureGUI_PropertiesDlg::buildPrs()
|
||||
return getDisplayer()->BuildPrs( aResult );
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -61,12 +61,11 @@ MeasureGUI_Skeleton::MeasureGUI_Skeleton( GeometryGUI* GUI,
|
||||
GEOMBase_Helper( dynamic_cast<SUIT_Desktop*>( parent ) ),
|
||||
myGeomGUI( GUI )
|
||||
{
|
||||
|
||||
mySelBtn = 0;
|
||||
mySelEdit = 0;
|
||||
myDisplayer = 0;
|
||||
myHelpFileName = "";
|
||||
|
||||
|
||||
if ( !name )
|
||||
setName( "MeasureGUI_Skeleton" );
|
||||
|
||||
@ -75,7 +74,6 @@ MeasureGUI_Skeleton::MeasureGUI_Skeleton( GeometryGUI* GUI,
|
||||
|
||||
buttonClose->setAutoDefault( false );
|
||||
|
||||
GroupMedium->close( TRUE );
|
||||
resize( 350, 0 );
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
/****************************************************************************
|
||||
** Form implementation generated from reading ui file 'MeasureGUI_Skeleton_QTD.ui'
|
||||
**
|
||||
** Created: Tue Mar 21 10:10:08 2006
|
||||
** Created: Tue Mar 13 14:20:24 2007
|
||||
** by: The User Interface Compiler ($Id$)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
@ -96,11 +96,6 @@ MeasureGUI_Skeleton_QTD::MeasureGUI_Skeleton_QTD( QWidget* parent, const char* n
|
||||
|
||||
Layout1->addWidget( GroupConstructors, 0, 0 );
|
||||
|
||||
GroupMedium = new QGroupBox( this, "GroupMedium" );
|
||||
GroupMedium->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupMedium->sizePolicy().hasHeightForWidth() ) );
|
||||
|
||||
Layout1->addWidget( GroupMedium, 1, 0 );
|
||||
|
||||
MeasureGUI_Skeleton_QTDLayout->addLayout( Layout1, 0, 0 );
|
||||
languageChange();
|
||||
resize( QSize(228, 266).expandedTo(minimumSizeHint()) );
|
||||
@ -121,12 +116,5 @@ MeasureGUI_Skeleton_QTD::~MeasureGUI_Skeleton_QTD()
|
||||
*/
|
||||
void MeasureGUI_Skeleton_QTD::languageChange()
|
||||
{
|
||||
setCaption( tr( "MeasureGUI_Skeleton_QTD" ) );
|
||||
GroupButtons->setTitle( QString::null );
|
||||
buttonClose->setText( tr( "&Close" ) );
|
||||
buttonHelp->setText( tr( "&Help" ) );
|
||||
GroupConstructors->setTitle( QString::null );
|
||||
RadioButton1->setText( QString::null );
|
||||
GroupMedium->setTitle( QString::null );
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
/****************************************************************************
|
||||
** Form interface generated from reading ui file 'MeasureGUI_Skeleton_QTD.ui'
|
||||
**
|
||||
** Created: Tue Mar 21 10:10:08 2006
|
||||
** Created: Tue Mar 13 14:20:20 2007
|
||||
** by: The User Interface Compiler ($Id$)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
@ -56,7 +56,6 @@ public:
|
||||
QPushButton* buttonHelp;
|
||||
QButtonGroup* GroupConstructors;
|
||||
QRadioButton* RadioButton1;
|
||||
QGroupBox* GroupMedium;
|
||||
|
||||
protected:
|
||||
QGridLayout* MeasureGUI_Skeleton_QTDLayout;
|
||||
|
@ -20,9 +20,6 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="caption">
|
||||
<string>MeasureGUI_Skeleton_QTD</string>
|
||||
</property>
|
||||
<property name="sizeGripEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
@ -62,9 +59,6 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string></string>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
@ -110,17 +104,11 @@
|
||||
<property name="name">
|
||||
<cstring>buttonClose</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Close</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" row="0" column="2">
|
||||
<property name="name">
|
||||
<cstring>buttonHelp</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Help</string>
|
||||
</property>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
@ -138,9 +126,6 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string></string>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
@ -169,30 +154,11 @@
|
||||
<property name="name">
|
||||
<cstring>RadioButton1</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string></string>
|
||||
</property>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
<widget class="QGroupBox" row="1" column="0">
|
||||
<property name="name">
|
||||
<cstring>GroupMedium</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>7</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string></string>
|
||||
</property>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
</grid>
|
||||
|
@ -0,0 +1,72 @@
|
||||
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
|
||||
#ifndef _Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
|
||||
#define _Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
|
||||
|
||||
#ifndef _Standard_Macro_HeaderFile
|
||||
#include <Standard_Macro.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef _Handle_TCollection_MapNode_HeaderFile
|
||||
#include <Handle_TCollection_MapNode.hxx>
|
||||
#endif
|
||||
|
||||
class Standard_Transient;
|
||||
class Handle_Standard_Type;
|
||||
class Handle(TCollection_MapNode);
|
||||
class NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger;
|
||||
Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger);
|
||||
|
||||
class Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger) : public Handle(TCollection_MapNode) {
|
||||
public:
|
||||
Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)():Handle(TCollection_MapNode)() {}
|
||||
Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)(const Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)& aHandle) : Handle(TCollection_MapNode)(aHandle)
|
||||
{
|
||||
}
|
||||
|
||||
Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)(const NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem)
|
||||
{
|
||||
}
|
||||
|
||||
Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)& operator=(const Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)& aHandle)
|
||||
{
|
||||
Assign(aHandle.Access());
|
||||
return *this;
|
||||
}
|
||||
|
||||
Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)& operator=(const NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger* anItem)
|
||||
{
|
||||
Assign((Standard_Transient *)anItem);
|
||||
return *this;
|
||||
}
|
||||
|
||||
NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger* operator->() const
|
||||
{
|
||||
return (NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger *)ControlAccess();
|
||||
}
|
||||
|
||||
// Standard_EXPORT ~Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)();
|
||||
|
||||
Standard_EXPORT static const Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger) DownCast(const Handle(Standard_Transient)& AnObject);
|
||||
};
|
||||
#endif
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user