mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-26 16:20:33 +05:00
Mantis issue 0021865: Adding tangency in Spline creation + Small repackaging
This commit is contained in:
parent
7b0b9c2532
commit
4e75612208
@ -499,12 +499,14 @@ AC_OUTPUT([ \
|
||||
src/DlgRef/Makefile \
|
||||
src/EntityGUI/Makefile \
|
||||
src/GEOM/Makefile \
|
||||
src/BlockFix/Makefile \
|
||||
src/GEOMAlgo/Makefile \
|
||||
src/GEOMBase/Makefile \
|
||||
src/GEOMClient/Makefile \
|
||||
src/GEOMFiltersSelection/Makefile \
|
||||
src/Material/Makefile \
|
||||
src/GEOMGUI/Makefile \
|
||||
src/GEOMUtils/Makefile \
|
||||
src/GEOMImpl/Makefile \
|
||||
src/GEOMToolsGUI/Makefile \
|
||||
src/GEOM_I/Makefile \
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 31 KiB |
@ -70,10 +70,15 @@ closed edge.</li>
|
||||
<li> If <b>Reorder vertices taking into account distances</b> is
|
||||
checked, the interpolation algorithm does not follow the order of
|
||||
vertices but searches for the closest vertex.</li>
|
||||
<li><b>Tangents</b> are two vectors, defining direction of curve at
|
||||
its ends. Both or none vectors must be set. This option available only
|
||||
if two above check boxes are not checked.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
\n <b>TUI Command:</b>
|
||||
<em>geompy.MakeInterpol(ListOfShapes,isClosed,doReordering)</em>
|
||||
<em>geompy.MakeInterpolWithTangents(ListOfShapes,Vector1,Vector2)</em>
|
||||
|
||||
<b>Analytical Definition</b>
|
||||
|
||||
|
@ -2804,6 +2804,17 @@ module GEOM
|
||||
in boolean theIsClosed,
|
||||
in boolean theDoReordering);
|
||||
|
||||
/*!
|
||||
* \brief Create B-Spline curve on the set of points.
|
||||
* \param thePoints Sequence of points for the B-Spline curve.
|
||||
* \param theFirstVec Vector object, defining the curve direction at its first point.
|
||||
* \param theLastVec Vector object, defining the curve direction at its last point.
|
||||
* \return New GEOM_Object, containing the created B-Spline curve.
|
||||
*/
|
||||
GEOM_Object MakeSplineInterpolWithTangents (in ListOfGO thePoints,
|
||||
in GEOM_Object theFirstVec,
|
||||
in GEOM_Object theLastVec);
|
||||
|
||||
/*!
|
||||
* \brief Creates a curve using the parametric definition of the basic points.
|
||||
* \param thexExpr parametric equation of the coordinates X.
|
||||
|
@ -280,7 +280,6 @@ void BasicGUI_CircleDlg::ConstructorsClicked( int constructorId )
|
||||
qApp->processEvents();
|
||||
updateGeometry();
|
||||
resize( minimumSizeHint() );
|
||||
SelectionIntoArgument();
|
||||
|
||||
myEditCurrentArgument->setFocus();
|
||||
globalSelection(); // close local contexts, if any
|
||||
@ -289,7 +288,7 @@ void BasicGUI_CircleDlg::ConstructorsClicked( int constructorId )
|
||||
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged() ),
|
||||
this, SLOT( SelectionIntoArgument() ) );
|
||||
|
||||
displayPreview(true);
|
||||
SelectionIntoArgument();
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
|
@ -18,7 +18,6 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
// GEOM GEOMGUI : GUI for Geometry component
|
||||
// File : BasicGUI_CurveDlg.cxx
|
||||
@ -59,66 +58,101 @@ BasicGUI_CurveDlg::BasicGUI_CurveDlg( GeometryGUI* theGeometryGUI, QWidget* pare
|
||||
bool modal, Qt::WindowFlags fl )
|
||||
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
|
||||
{
|
||||
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_POLYLINE" ) ) );
|
||||
QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_SPLINE" ) ) );
|
||||
QPixmap image3( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_BEZIER" ) ) );
|
||||
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
|
||||
QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_POLYLINE")));
|
||||
QPixmap image2 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_SPLINE")));
|
||||
QPixmap image3 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_BEZIER")));
|
||||
QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT")));
|
||||
|
||||
setWindowTitle( tr( "GEOM_CURVE_TITLE" ) );
|
||||
setWindowTitle(tr("GEOM_CURVE_TITLE"));
|
||||
|
||||
/***************************************************************/
|
||||
mainFrame()->RadioButton1->setIcon( image0 );
|
||||
mainFrame()->RadioButton2->setIcon( image3 );
|
||||
mainFrame()->RadioButton3->setIcon( image2 );
|
||||
mainFrame()->RadioButton1->setIcon(image0);
|
||||
mainFrame()->RadioButton2->setIcon(image3);
|
||||
mainFrame()->RadioButton3->setIcon(image2);
|
||||
|
||||
QGroupBox* creationModeCroup = new QGroupBox(this);
|
||||
QButtonGroup* bg = new QButtonGroup(this);
|
||||
// Creation mode
|
||||
QGroupBox* creationModeGroup = new QGroupBox (this);
|
||||
QButtonGroup* bg = new QButtonGroup (this);
|
||||
|
||||
creationModeCroup->setTitle( tr( "GEOM_CURVE_CRMODE" ) );
|
||||
QHBoxLayout * creationModeLayout = new QHBoxLayout(creationModeCroup);
|
||||
myBySelectionBtn = new QRadioButton( tr( "GEOM_CURVE_SELECTION" ) ,creationModeCroup );
|
||||
myAnaliticalBtn = new QRadioButton( tr( "GEOM_CURVE_ANALITICAL" ) ,creationModeCroup );
|
||||
creationModeGroup->setTitle(tr("GEOM_CURVE_CRMODE"));
|
||||
QHBoxLayout * creationModeLayout = new QHBoxLayout (creationModeGroup);
|
||||
myBySelectionBtn = new QRadioButton (tr("GEOM_CURVE_SELECTION") ,creationModeGroup);
|
||||
myAnaliticalBtn = new QRadioButton (tr("GEOM_CURVE_ANALITICAL") ,creationModeGroup);
|
||||
|
||||
bg->addButton(myBySelectionBtn);
|
||||
bg->addButton(myAnaliticalBtn);
|
||||
|
||||
|
||||
creationModeLayout->addWidget(myBySelectionBtn);
|
||||
creationModeLayout->addWidget(myAnaliticalBtn);
|
||||
|
||||
GroupPoints = new DlgRef_1Sel3Check( centralWidget() );
|
||||
// Points and flags
|
||||
myGroupPoints = new DlgRef_1Sel3Check (centralWidget());
|
||||
|
||||
GroupPoints->GroupBox1->setTitle( tr( "GEOM_NODES" ) );
|
||||
GroupPoints->TextLabel1->setText( tr( "GEOM_POINTS" ) );
|
||||
GroupPoints->PushButton1->setIcon( image1 );
|
||||
GroupPoints->PushButton1->setDown( true );
|
||||
myGroupPoints->GroupBox1->setTitle(tr("GEOM_NODES"));
|
||||
myGroupPoints->TextLabel1->setText(tr("GEOM_POINTS"));
|
||||
myGroupPoints->PushButton1->setIcon(image1);
|
||||
myGroupPoints->PushButton1->setDown(true);
|
||||
|
||||
GroupPoints->LineEdit1->setReadOnly( true );
|
||||
myGroupPoints->LineEdit1->setReadOnly( true );
|
||||
|
||||
GroupPoints->CheckButton1->setText( tr( "GEOM_IS_CLOSED" ) );
|
||||
GroupPoints->CheckButton1->setChecked(false);
|
||||
//GroupPoints->CheckButton1->hide();
|
||||
myGroupPoints->CheckButton1->setText( tr( "GEOM_IS_CLOSED" ) );
|
||||
myGroupPoints->CheckButton1->setChecked(false);
|
||||
//myGroupPoints->CheckButton1->hide();
|
||||
|
||||
GroupPoints->CheckButton2->setText( tr( "GEOM_IS_REORDER" ) );
|
||||
GroupPoints->CheckButton2->setChecked(false);
|
||||
GroupPoints->CheckButton2->hide();
|
||||
myGroupPoints->CheckButton2->setText( tr( "GEOM_IS_REORDER" ) );
|
||||
myGroupPoints->CheckButton2->setChecked(false);
|
||||
myGroupPoints->CheckButton2->hide();
|
||||
|
||||
GroupPoints->CheckButton3->hide();
|
||||
myGroupPoints->CheckButton3->hide();
|
||||
|
||||
myParams = new BasicGUI_ParamCurveWidget( centralWidget() );
|
||||
// Parametrical mode
|
||||
myGroupParams = new BasicGUI_ParamCurveWidget( centralWidget() );
|
||||
|
||||
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
|
||||
layout->setMargin( 0 ); layout->setSpacing( 6 );
|
||||
layout->addWidget( creationModeCroup );
|
||||
layout->addWidget( GroupPoints );
|
||||
layout->addWidget( myParams );
|
||||
// Tangents (only for Interpolation constructor and only not closed and no reordering)
|
||||
myGroupTangents = new QGroupBox (this);
|
||||
myGroupTangents->setCheckable(true);
|
||||
myGroupTangents->setChecked(false);
|
||||
myGroupTangents->setTitle(tr("GEOM_INTERPOL_TANGENTS"));
|
||||
|
||||
QGridLayout* tangentsLayout = new QGridLayout (myGroupTangents);
|
||||
|
||||
myPushBtnV1 = new QPushButton (myGroupTangents);
|
||||
myPushBtnV2 = new QPushButton (myGroupTangents);
|
||||
myPushBtnV1->setIcon(image1);
|
||||
myPushBtnV2->setIcon(image1);
|
||||
|
||||
myLineEditV1 = new QLineEdit (myGroupTangents);
|
||||
myLineEditV2 = new QLineEdit (myGroupTangents);
|
||||
myLineEditV1->setReadOnly(true);
|
||||
myLineEditV2->setReadOnly(true);
|
||||
|
||||
QLabel* aTextLabelV1 = new QLabel (myGroupTangents);
|
||||
QLabel* aTextLabelV2 = new QLabel (myGroupTangents);
|
||||
aTextLabelV1->setText(tr("GEOM_INTERPOL_FIRST_VEC"));
|
||||
aTextLabelV2->setText(tr("GEOM_INTERPOL_LAST_VEC"));
|
||||
|
||||
tangentsLayout->addWidget(aTextLabelV1, 0, 0);
|
||||
tangentsLayout->addWidget(myPushBtnV1 , 0, 1);
|
||||
tangentsLayout->addWidget(myLineEditV1, 0, 2);
|
||||
tangentsLayout->addWidget(aTextLabelV2, 1, 0);
|
||||
tangentsLayout->addWidget(myPushBtnV2 , 1, 1);
|
||||
tangentsLayout->addWidget(myLineEditV2, 1, 2);
|
||||
|
||||
// Layout
|
||||
QVBoxLayout* layout = new QVBoxLayout (centralWidget());
|
||||
layout->setMargin(0);
|
||||
layout->setSpacing(6);
|
||||
layout->addWidget(creationModeGroup);
|
||||
layout->addWidget(myGroupPoints);
|
||||
layout->addWidget(myGroupParams);
|
||||
layout->addWidget(myGroupTangents);
|
||||
/***************************************************************/
|
||||
|
||||
setHelpFileName( "create_curve_page.html" );
|
||||
setHelpFileName("create_curve_page.html");
|
||||
|
||||
Init();
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ~BasicGUI_CurveDlg()
|
||||
// purpose : Destroys the object and frees any allocated resources
|
||||
@ -127,7 +161,6 @@ BasicGUI_CurveDlg::~BasicGUI_CurveDlg()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : Init()
|
||||
// purpose :
|
||||
@ -135,13 +168,6 @@ BasicGUI_CurveDlg::~BasicGUI_CurveDlg()
|
||||
void BasicGUI_CurveDlg::Init()
|
||||
{
|
||||
/* init variables */
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
|
||||
myPoints.clear();
|
||||
|
||||
globalSelection(); // close local contexts, if any
|
||||
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
|
||||
|
||||
showOnlyPreviewControl();
|
||||
myBySelectionBtn->setChecked(true);
|
||||
|
||||
@ -152,87 +178,94 @@ void BasicGUI_CurveDlg::Init()
|
||||
double aMax( 100. ), aMin( 0.0 );
|
||||
|
||||
/* min, max, step and decimals for spin boxes & initial values */
|
||||
initSpinBox( myParams->myPMin, COORD_MIN, COORD_MAX, step, "length_precision" );
|
||||
initSpinBox( myParams->myPMax, COORD_MIN, COORD_MAX, step, "length_precision" );
|
||||
myParams->myPStep->setValue( 10 );
|
||||
myParams->myPStep->setMaximum( 999 );
|
||||
myParams->myPStep->setSingleStep( 10 );
|
||||
myParams->myPMin->setValue( aMin );
|
||||
myParams->myPMax->setValue( aMax );
|
||||
myParams->myPStep->setValue( step );
|
||||
myParams->myXExpr->setText("t");
|
||||
myParams->myYExpr->setText("t");
|
||||
myParams->myZExpr->setText("t");
|
||||
|
||||
myParams->hide();
|
||||
initSpinBox( myGroupParams->myPMin, COORD_MIN, COORD_MAX, step, "length_precision" );
|
||||
initSpinBox( myGroupParams->myPMax, COORD_MIN, COORD_MAX, step, "length_precision" );
|
||||
myGroupParams->myPStep->setValue( 10 );
|
||||
myGroupParams->myPStep->setMaximum( 999 );
|
||||
myGroupParams->myPStep->setSingleStep( 10 );
|
||||
myGroupParams->myPMin->setValue( aMin );
|
||||
myGroupParams->myPMax->setValue( aMax );
|
||||
myGroupParams->myPStep->setValue( step );
|
||||
myGroupParams->myXExpr->setText("t");
|
||||
myGroupParams->myYExpr->setText("t");
|
||||
myGroupParams->myZExpr->setText("t");
|
||||
|
||||
myGroupParams->hide();
|
||||
|
||||
/* signals and slots connections */
|
||||
connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog( ) ) );
|
||||
connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) );
|
||||
connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
|
||||
connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
|
||||
|
||||
connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
|
||||
connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
|
||||
connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||
connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||
|
||||
connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
|
||||
connect(this, SIGNAL(constructorsClicked(int)), this, SLOT(ConstructorsClicked(int)));
|
||||
|
||||
connect( GroupPoints->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
|
||||
connect(myGroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
connect(myPushBtnV1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
connect(myPushBtnV2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||
|
||||
connect( GroupPoints->CheckButton1, SIGNAL( toggled(bool) ), this, SLOT( CheckButtonToggled() ) );
|
||||
connect( GroupPoints->CheckButton2, SIGNAL( toggled(bool) ), this, SLOT( CheckButtonToggled() ) );
|
||||
connect(myGroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(CheckButtonToggled()));
|
||||
connect(myGroupPoints->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(CheckButtonToggled()));
|
||||
|
||||
connect( myGeomGUI->getApp()->selectionMgr(),
|
||||
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
||||
connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
|
||||
this, SLOT(SelectionIntoArgument()));
|
||||
|
||||
connect( myBySelectionBtn, SIGNAL( clicked() ), this, SLOT( CreationModeChanged() ) );
|
||||
connect( myAnaliticalBtn, SIGNAL( clicked() ), this, SLOT( CreationModeChanged() ) );
|
||||
connect(myBySelectionBtn, SIGNAL(clicked()), this, SLOT(CreationModeChanged()));
|
||||
connect(myAnaliticalBtn, SIGNAL(clicked()), this, SLOT(CreationModeChanged()));
|
||||
|
||||
connect(myParams->myPMin, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||
connect(myParams->myPMax, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||
connect(myParams->myPStep, SIGNAL(valueChanged(int)), this, SLOT(ValueChangedInSpinBox(int)));
|
||||
connect(myGroupParams->myPMin, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||
connect(myGroupParams->myPMax, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
|
||||
connect(myGroupParams->myPStep, SIGNAL(valueChanged(int)), this, SLOT(ValueChangedInSpinBox(int)));
|
||||
|
||||
connect(myParams->myXExpr, SIGNAL(editingFinished()), this, SLOT(OnEditingFinished()));
|
||||
connect(myParams->myYExpr, SIGNAL(editingFinished()), this, SLOT(OnEditingFinished()));
|
||||
connect(myParams->myZExpr, SIGNAL(editingFinished()), this, SLOT(OnEditingFinished()));
|
||||
connect(myGroupParams->myXExpr, SIGNAL(editingFinished()), this, SLOT(OnEditingFinished()));
|
||||
connect(myGroupParams->myYExpr, SIGNAL(editingFinished()), this, SLOT(OnEditingFinished()));
|
||||
connect(myGroupParams->myZExpr, SIGNAL(editingFinished()), this, SLOT(OnEditingFinished()));
|
||||
|
||||
initName( tr( "GEOM_CURVE" ) );
|
||||
resize(100,100);
|
||||
ConstructorsClicked( 0 );
|
||||
initName(tr("GEOM_CURVE"));
|
||||
//resize(100, 100);
|
||||
ConstructorsClicked(0);
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : ConstructorsClicked()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_CurveDlg::ConstructorsClicked( int id )
|
||||
void BasicGUI_CurveDlg::ConstructorsClicked (int id)
|
||||
{
|
||||
QString aTitle = tr( id == 0 ? "GEOM_POLYLINE" : id == 1 ? "GEOM_BEZIER" : "GEOM_INTERPOL" );
|
||||
mainFrame()->GroupConstructors->setTitle( aTitle );
|
||||
QString aTitle = tr(id == 0 ? "GEOM_POLYLINE" : id == 1 ? "GEOM_BEZIER" : "GEOM_INTERPOL");
|
||||
mainFrame()->GroupConstructors->setTitle(aTitle);
|
||||
|
||||
if (id == 0) { // polyline (wire)
|
||||
//GroupPoints->CheckButton1->hide();
|
||||
GroupPoints->CheckButton1->setText( tr( "GEOM_BUILD_CLOSED_WIRE" ) );
|
||||
GroupPoints->CheckButton2->hide();
|
||||
myGroupPoints->CheckButton1->setText( tr( "GEOM_BUILD_CLOSED_WIRE" ) );
|
||||
myGroupPoints->CheckButton2->hide();
|
||||
myGroupTangents->hide();
|
||||
}
|
||||
else if (id == 1) { // bezier
|
||||
//GroupPoints->CheckButton1->hide();
|
||||
GroupPoints->CheckButton1->setText( tr( "GEOM_IS_CLOSED" ) );
|
||||
GroupPoints->CheckButton2->hide();
|
||||
myGroupPoints->CheckButton1->setText( tr( "GEOM_IS_CLOSED" ) );
|
||||
myGroupPoints->CheckButton2->hide();
|
||||
myGroupTangents->hide();
|
||||
}
|
||||
else { // b-spline
|
||||
//GroupPoints->CheckButton1->show();
|
||||
GroupPoints->CheckButton1->setText( tr( "GEOM_IS_CLOSED" ) );
|
||||
GroupPoints->CheckButton2->show();
|
||||
myGroupPoints->CheckButton1->setText( tr( "GEOM_IS_CLOSED" ) );
|
||||
myGroupPoints->CheckButton2->show();
|
||||
myGroupTangents->setVisible(myBySelectionBtn->isChecked());
|
||||
}
|
||||
|
||||
myPoints.clear();
|
||||
myVec1.nullify();
|
||||
myVec2.nullify();
|
||||
|
||||
myGroupPoints->LineEdit1->setText("");
|
||||
myLineEditV1->setText("");
|
||||
myLineEditV2->setText("");
|
||||
|
||||
myEditCurrentArgument->setText( "" );
|
||||
qApp->processEvents();
|
||||
updateGeometry();
|
||||
resize( minimumSizeHint() );
|
||||
SelectionIntoArgument();
|
||||
}
|
||||
resize(minimumSizeHint());
|
||||
|
||||
myGroupPoints->PushButton1->click();
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : SetEditCurrentArgument()
|
||||
@ -240,9 +273,28 @@ void BasicGUI_CurveDlg::ConstructorsClicked( int id )
|
||||
//=================================================================================
|
||||
void BasicGUI_CurveDlg::SetEditCurrentArgument()
|
||||
{
|
||||
if ( sender() == GroupPoints->PushButton1 )
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
|
||||
|
||||
globalSelection(); // close local contexts, if any
|
||||
|
||||
if (sender() == myGroupPoints->PushButton1) {
|
||||
myEditCurrentArgument = myGroupPoints->LineEdit1;
|
||||
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
|
||||
}
|
||||
else if (sender() == myPushBtnV1) {
|
||||
myEditCurrentArgument = myLineEditV1;
|
||||
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
|
||||
}
|
||||
else if (sender() == myPushBtnV2) {
|
||||
myEditCurrentArgument = myLineEditV2;
|
||||
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
|
||||
}
|
||||
|
||||
myEditCurrentArgument->setFocus();
|
||||
|
||||
connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
|
||||
this, SLOT(SelectionIntoArgument()));
|
||||
|
||||
SelectionIntoArgument();
|
||||
}
|
||||
|
||||
@ -252,6 +304,11 @@ void BasicGUI_CurveDlg::SetEditCurrentArgument()
|
||||
//=================================================================================
|
||||
void BasicGUI_CurveDlg::CheckButtonToggled()
|
||||
{
|
||||
if (getConstructorId() == 2) { // Interpolation
|
||||
bool disableTangents = (myGroupPoints->CheckButton1->isChecked() ||
|
||||
myGroupPoints->CheckButton2->isChecked());
|
||||
myGroupTangents->setEnabled(!disableTangents);
|
||||
}
|
||||
processPreview();
|
||||
}
|
||||
|
||||
@ -261,8 +318,8 @@ void BasicGUI_CurveDlg::CheckButtonToggled()
|
||||
//=================================================================================
|
||||
void BasicGUI_CurveDlg::ClickOnOk()
|
||||
{
|
||||
setIsApplyAndClose( true );
|
||||
if ( ClickOnApply() )
|
||||
setIsApplyAndClose(true);
|
||||
if (ClickOnApply())
|
||||
ClickOnCancel();
|
||||
}
|
||||
|
||||
@ -272,20 +329,23 @@ void BasicGUI_CurveDlg::ClickOnOk()
|
||||
//=================================================================================
|
||||
bool BasicGUI_CurveDlg::ClickOnApply()
|
||||
{
|
||||
if ( !onAccept() )
|
||||
if (!onAccept())
|
||||
return false;
|
||||
|
||||
initName();
|
||||
globalSelection(); // close local contexts, if any
|
||||
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
|
||||
ConstructorsClicked(getConstructorId());
|
||||
return true;
|
||||
}
|
||||
|
||||
static void synchronize( QList<GEOM::GeomObjPtr>& left, QList<GEOM::GeomObjPtr>& right )
|
||||
//=================================================================================
|
||||
// function : SelectionIntoArgument()
|
||||
// purpose : Called when selection as changed or other case
|
||||
//=================================================================================
|
||||
static void synchronize (QList<GEOM::GeomObjPtr>& left, QList<GEOM::GeomObjPtr>& right)
|
||||
{
|
||||
// 1. remove items from the "left" list that are not in the "right" list
|
||||
QMutableListIterator<GEOM::GeomObjPtr> it1( left );
|
||||
while ( it1.hasNext() ) {
|
||||
QMutableListIterator<GEOM::GeomObjPtr> it1 (left);
|
||||
while (it1.hasNext()) {
|
||||
GEOM::GeomObjPtr o1 = it1.next();
|
||||
bool found = false;
|
||||
QMutableListIterator<GEOM::GeomObjPtr> it2( right );
|
||||
@ -307,22 +367,38 @@ static void synchronize( QList<GEOM::GeomObjPtr>& left, QList<GEOM::GeomObjPtr>&
|
||||
}
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : SelectionIntoArgument()
|
||||
// purpose : Called when selection as changed or other case
|
||||
//=================================================================================
|
||||
void BasicGUI_CurveDlg::SelectionIntoArgument()
|
||||
{
|
||||
QList<GEOM::GeomObjPtr> points = getSelected( TopAbs_VERTEX, -1 );
|
||||
synchronize( myPoints, points );
|
||||
if ( !myPoints.isEmpty() )
|
||||
GroupPoints->LineEdit1->setText( QString::number( myPoints.count() ) + "_" + tr( "GEOM_POINT" ) + tr( "_S_" ) );
|
||||
else
|
||||
GroupPoints->LineEdit1->setText( "" );
|
||||
myEditCurrentArgument->setText("");
|
||||
|
||||
if (myEditCurrentArgument == myGroupPoints->LineEdit1) {
|
||||
QList<GEOM::GeomObjPtr> points = getSelected(TopAbs_VERTEX, -1);
|
||||
synchronize(myPoints, points);
|
||||
if (!myPoints.isEmpty())
|
||||
myGroupPoints->LineEdit1->setText(QString::number(myPoints.count()) + "_" +
|
||||
tr("GEOM_POINT") + tr("_S_"));
|
||||
}
|
||||
else {
|
||||
QList<GEOM::GeomObjPtr> vecs = getSelected(TopAbs_EDGE, -1);
|
||||
if (vecs.count() != 1) {
|
||||
if (myEditCurrentArgument == myLineEditV1) myVec1.nullify();
|
||||
else if (myEditCurrentArgument == myLineEditV2) myVec2.nullify();
|
||||
}
|
||||
else {
|
||||
if (myEditCurrentArgument == myLineEditV1) {
|
||||
myVec1 = vecs.first();
|
||||
}
|
||||
else if (myEditCurrentArgument == myLineEditV2) {
|
||||
myVec2 = vecs.first();
|
||||
}
|
||||
QString aName = GEOMBase::GetName(vecs.first().get());
|
||||
myEditCurrentArgument->setText(aName);
|
||||
}
|
||||
}
|
||||
|
||||
processPreview();
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ActivateThisDialog()
|
||||
// purpose :
|
||||
@ -330,13 +406,11 @@ void BasicGUI_CurveDlg::SelectionIntoArgument()
|
||||
void BasicGUI_CurveDlg::ActivateThisDialog()
|
||||
{
|
||||
GEOMBase_Skeleton::ActivateThisDialog();
|
||||
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
|
||||
this, SLOT( SelectionIntoArgument() ) );
|
||||
|
||||
globalSelection(); // close local contexts, if any
|
||||
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
|
||||
connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
|
||||
this, SLOT(SelectionIntoArgument()));
|
||||
|
||||
ConstructorsClicked( getConstructorId() );
|
||||
ConstructorsClicked(getConstructorId());
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
@ -353,9 +427,9 @@ void BasicGUI_CurveDlg::DeactivateActiveDialog()
|
||||
// function : enterEvent()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_CurveDlg::enterEvent( QEvent* )
|
||||
void BasicGUI_CurveDlg::enterEvent (QEvent*)
|
||||
{
|
||||
if ( !mainFrame()->GroupConstructors->isEnabled() )
|
||||
if (!mainFrame()->GroupConstructors->isEnabled())
|
||||
ActivateThisDialog();
|
||||
}
|
||||
|
||||
@ -365,24 +439,34 @@ void BasicGUI_CurveDlg::enterEvent( QEvent* )
|
||||
//=================================================================================
|
||||
GEOM::GEOM_IOperations_ptr BasicGUI_CurveDlg::createOperation()
|
||||
{
|
||||
return myGeomGUI->GetGeomGen()->GetICurvesOperations( getStudyId() );
|
||||
return myGeomGUI->GetGeomGen()->GetICurvesOperations(getStudyId());
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : isValid
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
bool BasicGUI_CurveDlg::isValid( QString& msg )
|
||||
bool BasicGUI_CurveDlg::isValid (QString& msg)
|
||||
{
|
||||
if( myBySelectionBtn->isChecked() )
|
||||
return myPoints.count() > 1;
|
||||
if (myBySelectionBtn->isChecked()) {
|
||||
bool ok = true;
|
||||
if (getConstructorId() == 2) { // Interpolation
|
||||
bool disableTangents = (myGroupPoints->CheckButton1->isChecked() ||
|
||||
myGroupPoints->CheckButton2->isChecked());
|
||||
if (!disableTangents && myGroupTangents->isChecked()) {
|
||||
ok = (myVec1 && myVec2);
|
||||
if (!ok) msg = tr("GEOM_BOTH_TANGENTS_REQUIRED");
|
||||
}
|
||||
}
|
||||
return ok && myPoints.count() > 1;
|
||||
}
|
||||
else {
|
||||
bool ok = myParams->myPMin->isValid( msg, !IsPreview() ) &&
|
||||
myParams->myPMax->isValid( msg, !IsPreview() ) &&
|
||||
myParams->myPStep->isValid( msg, !IsPreview() );
|
||||
ok &= !myParams->myXExpr->text().isEmpty();
|
||||
ok &= !myParams->myYExpr->text().isEmpty();
|
||||
ok &= !myParams->myZExpr->text().isEmpty();
|
||||
bool ok = myGroupParams->myPMin->isValid( msg, !IsPreview() ) &&
|
||||
myGroupParams->myPMax->isValid( msg, !IsPreview() ) &&
|
||||
myGroupParams->myPStep->isValid( msg, !IsPreview() );
|
||||
ok &= !myGroupParams->myXExpr->text().isEmpty();
|
||||
ok &= !myGroupParams->myYExpr->text().isEmpty();
|
||||
ok &= !myGroupParams->myZExpr->text().isEmpty();
|
||||
return ok;
|
||||
}
|
||||
}
|
||||
@ -391,79 +475,85 @@ bool BasicGUI_CurveDlg::isValid( QString& msg )
|
||||
// function : execute
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
bool BasicGUI_CurveDlg::execute( ObjectList& objects )
|
||||
bool BasicGUI_CurveDlg::execute (ObjectList& objects)
|
||||
{
|
||||
bool res = false;
|
||||
|
||||
GEOM::GEOM_Object_var anObj;
|
||||
|
||||
GEOM::GEOM_ICurvesOperations_var anOper = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() );
|
||||
GEOM::GEOM_ICurvesOperations_var anOper = GEOM::GEOM_ICurvesOperations::_narrow(getOperation());
|
||||
|
||||
GEOM::ListOfGO_var points = new GEOM::ListOfGO();
|
||||
points->length( myPoints.count() );
|
||||
for ( int i = 0; i < myPoints.count(); i++ )
|
||||
points->length(myPoints.count());
|
||||
for (int i = 0; i < myPoints.count(); i++)
|
||||
points[i] = myPoints[i].copy();
|
||||
|
||||
switch ( getConstructorId() ) {
|
||||
switch (getConstructorId()) {
|
||||
case 0 :
|
||||
if( myBySelectionBtn->isChecked() )
|
||||
anObj = anOper->MakePolyline( points.in(), GroupPoints->CheckButton1->isChecked() );
|
||||
if (myBySelectionBtn->isChecked())
|
||||
anObj = anOper->MakePolyline(points.in(), myGroupPoints->CheckButton1->isChecked());
|
||||
else
|
||||
anObj = anOper->MakeCurveParametricNew(qPrintable(myParams->myXExpr->text()),
|
||||
qPrintable(myParams->myYExpr->text()),
|
||||
qPrintable(myParams->myZExpr->text()),
|
||||
myParams->myPMin->value(),
|
||||
myParams->myPMax->value(),
|
||||
myParams->myPStep->value(),
|
||||
GEOM::Polyline);
|
||||
anObj = anOper->MakeCurveParametricNew(qPrintable(myGroupParams->myXExpr->text()),
|
||||
qPrintable(myGroupParams->myYExpr->text()),
|
||||
qPrintable(myGroupParams->myZExpr->text()),
|
||||
myGroupParams->myPMin->value(),
|
||||
myGroupParams->myPMax->value(),
|
||||
myGroupParams->myPStep->value(),
|
||||
GEOM::Polyline);
|
||||
res = true;
|
||||
break;
|
||||
case 1 :
|
||||
if( myBySelectionBtn->isChecked() )
|
||||
anObj = anOper->MakeSplineBezier( points.in(), GroupPoints->CheckButton1->isChecked() );
|
||||
if (myBySelectionBtn->isChecked())
|
||||
anObj = anOper->MakeSplineBezier(points.in(), myGroupPoints->CheckButton1->isChecked());
|
||||
else
|
||||
anObj = anOper->MakeCurveParametricNew(qPrintable(myParams->myXExpr->text()),
|
||||
qPrintable(myParams->myYExpr->text()),
|
||||
qPrintable(myParams->myZExpr->text()),
|
||||
myParams->myPMin->value(),
|
||||
myParams->myPMax->value(),
|
||||
myParams->myPStep->value(),
|
||||
GEOM::Bezier);
|
||||
|
||||
anObj = anOper->MakeCurveParametricNew(qPrintable(myGroupParams->myXExpr->text()),
|
||||
qPrintable(myGroupParams->myYExpr->text()),
|
||||
qPrintable(myGroupParams->myZExpr->text()),
|
||||
myGroupParams->myPMin->value(),
|
||||
myGroupParams->myPMax->value(),
|
||||
myGroupParams->myPStep->value(),
|
||||
GEOM::Bezier);
|
||||
res = true;
|
||||
break;
|
||||
case 2 :
|
||||
if( myBySelectionBtn->isChecked() )
|
||||
anObj = anOper->MakeSplineInterpolation( points.in(), GroupPoints->CheckButton1->isChecked(),
|
||||
GroupPoints->CheckButton2->isChecked() );
|
||||
if (myBySelectionBtn->isChecked()) {
|
||||
bool disableTangents = (myGroupPoints->CheckButton1->isChecked() ||
|
||||
myGroupPoints->CheckButton2->isChecked());
|
||||
if (!disableTangents && myGroupTangents->isChecked()) {
|
||||
anObj = anOper->MakeSplineInterpolWithTangents(points.in(), myVec1.get(), myVec2.get());
|
||||
}
|
||||
else
|
||||
anObj = anOper->MakeSplineInterpolation(points.in(), myGroupPoints->CheckButton1->isChecked(),
|
||||
myGroupPoints->CheckButton2->isChecked());
|
||||
}
|
||||
else
|
||||
anObj = anOper->MakeCurveParametricNew(qPrintable(myParams->myXExpr->text()),
|
||||
qPrintable(myParams->myYExpr->text()),
|
||||
qPrintable(myParams->myZExpr->text()),
|
||||
myParams->myPMin->value(),
|
||||
myParams->myPMax->value(),
|
||||
myParams->myPStep->value(),
|
||||
GEOM::Interpolation);
|
||||
anObj = anOper->MakeCurveParametricNew(qPrintable(myGroupParams->myXExpr->text()),
|
||||
qPrintable(myGroupParams->myYExpr->text()),
|
||||
qPrintable(myGroupParams->myZExpr->text()),
|
||||
myGroupParams->myPMin->value(),
|
||||
myGroupParams->myPMax->value(),
|
||||
myGroupParams->myPStep->value(),
|
||||
GEOM::Interpolation);
|
||||
res = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( !anObj->_is_nil() ) {
|
||||
if(myAnaliticalBtn->isChecked() && !IsPreview()) {
|
||||
if (!anObj->_is_nil()) {
|
||||
if (myAnaliticalBtn->isChecked() && !IsPreview()) {
|
||||
QStringList aParameters;
|
||||
aParameters<<myParams->myPMin->text();
|
||||
aParameters<<myParams->myPMax->text();
|
||||
aParameters<<myParams->myPStep->text();
|
||||
aParameters<<myGroupParams->myPMin->text();
|
||||
aParameters<<myGroupParams->myPMax->text();
|
||||
aParameters<<myGroupParams->myPStep->text();
|
||||
anObj->SetParameters(aParameters.join(":").toLatin1().constData());
|
||||
}
|
||||
objects.push_back( anObj._retn() );
|
||||
objects.push_back(anObj._retn());
|
||||
}
|
||||
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : addSubshapeToStudy
|
||||
// function : addSubshapesToStudy
|
||||
// purpose : virtual method to add new SubObjects if local selection
|
||||
//=================================================================================
|
||||
void BasicGUI_CurveDlg::addSubshapesToStudy()
|
||||
@ -476,19 +566,20 @@ void BasicGUI_CurveDlg::addSubshapesToStudy()
|
||||
// function : CreationModeChanged
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_CurveDlg::CreationModeChanged() {
|
||||
void BasicGUI_CurveDlg::CreationModeChanged()
|
||||
{
|
||||
const QObject* s = sender();
|
||||
GroupPoints->setVisible(myBySelectionBtn == s);
|
||||
myParams->setVisible(myBySelectionBtn != s);
|
||||
|
||||
ConstructorsClicked( getConstructorId() );
|
||||
myGroupPoints->setVisible(myBySelectionBtn == s);
|
||||
myGroupParams->setVisible(myBySelectionBtn != s);
|
||||
|
||||
ConstructorsClicked(getConstructorId());
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : ValueChangedInSpinBox()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_CurveDlg::ValueChangedInSpinBox(double/*theValue*/)
|
||||
void BasicGUI_CurveDlg::ValueChangedInSpinBox (double/*theValue*/)
|
||||
{
|
||||
processPreview();
|
||||
}
|
||||
@ -497,15 +588,16 @@ void BasicGUI_CurveDlg::ValueChangedInSpinBox(double/*theValue*/)
|
||||
// function : ValueChangedInSpinBox()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_CurveDlg::ValueChangedInSpinBox(int/*theValue*/)
|
||||
void BasicGUI_CurveDlg::ValueChangedInSpinBox (int/*theValue*/)
|
||||
{
|
||||
processPreview();
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : ValueChangedInSpinBox()
|
||||
// function : OnEditingFinished()
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BasicGUI_CurveDlg::OnEditingFinished() {
|
||||
void BasicGUI_CurveDlg::OnEditingFinished()
|
||||
{
|
||||
processPreview();
|
||||
}
|
||||
|
@ -18,7 +18,6 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
// GEOM GEOMGUI : GUI for Geometry component
|
||||
// File : BasicGUI_CurveDlg.h
|
||||
@ -34,6 +33,9 @@
|
||||
|
||||
class DlgRef_1Sel3Check;
|
||||
class QRadioButton;
|
||||
class QPushButton;
|
||||
class QLineEdit;
|
||||
class QGroupBox;
|
||||
class BasicGUI_ParamCurveWidget;
|
||||
|
||||
//=================================================================================
|
||||
@ -45,26 +47,34 @@ class BasicGUI_CurveDlg : public GEOMBase_Skeleton
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BasicGUI_CurveDlg( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0 );
|
||||
BasicGUI_CurveDlg (GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0);
|
||||
~BasicGUI_CurveDlg();
|
||||
|
||||
protected:
|
||||
// redefined from GEOMBase_Helper
|
||||
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
||||
virtual bool isValid( QString& );
|
||||
virtual bool execute( ObjectList& );
|
||||
virtual bool isValid (QString&);
|
||||
virtual bool execute (ObjectList&);
|
||||
virtual void addSubshapesToStudy();
|
||||
|
||||
private:
|
||||
void Init();
|
||||
void enterEvent( QEvent* );
|
||||
void enterEvent (QEvent*);
|
||||
|
||||
private:
|
||||
DlgRef_1Sel3Check* GroupPoints;
|
||||
QList<GEOM::GeomObjPtr> myPoints;
|
||||
QRadioButton* myAnaliticalBtn;
|
||||
QRadioButton* myBySelectionBtn;
|
||||
BasicGUI_ParamCurveWidget* myParams;
|
||||
DlgRef_1Sel3Check* myGroupPoints;
|
||||
BasicGUI_ParamCurveWidget* myGroupParams;
|
||||
QGroupBox* myGroupTangents;
|
||||
|
||||
QPushButton* myPushBtnV1;
|
||||
QPushButton* myPushBtnV2;
|
||||
QLineEdit* myLineEditV1;
|
||||
QLineEdit* myLineEditV2;
|
||||
|
||||
QList<GEOM::GeomObjPtr> myPoints;
|
||||
GEOM::GeomObjPtr myVec1, myVec2;
|
||||
|
||||
private slots:
|
||||
void ClickOnOk();
|
||||
@ -73,13 +83,13 @@ private slots:
|
||||
void ActivateThisDialog();
|
||||
void DeactivateActiveDialog();
|
||||
|
||||
void ConstructorsClicked( int );
|
||||
void ConstructorsClicked (int);
|
||||
void CheckButtonToggled();
|
||||
void SelectionIntoArgument();
|
||||
void SetEditCurrentArgument();
|
||||
void CreationModeChanged();
|
||||
void ValueChangedInSpinBox(double/*theValue*/);
|
||||
void ValueChangedInSpinBox(int /*theValue*/);
|
||||
void ValueChangedInSpinBox (double/*theValue*/);
|
||||
void ValueChangedInSpinBox (int /*theValue*/);
|
||||
void OnEditingFinished();
|
||||
};
|
||||
|
||||
|
@ -18,14 +18,11 @@
|
||||
// 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 _BlockFix_HeaderFile
|
||||
#define _BlockFix_HeaderFile
|
||||
|
||||
#ifndef _Standard_Real_HeaderFile
|
||||
#include <Standard_Real.hxx>
|
||||
#endif
|
||||
|
||||
class TopoDS_Shape;
|
||||
class BlockFix_SphereSpaceModifier;
|
||||
@ -35,36 +32,16 @@ class BlockFix_BlockFixAPI;
|
||||
class BlockFix_PeriodicSurfaceModifier;
|
||||
class BlockFix_CheckTool;
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Macro_HeaderFile
|
||||
#include <Standard_Macro.hxx>
|
||||
#endif
|
||||
|
||||
class BlockFix {
|
||||
class BlockFix {
|
||||
|
||||
public:
|
||||
|
||||
void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
|
||||
Standard_EXPORT static TopoDS_Shape RotateSphereSpace(const TopoDS_Shape& S,const Standard_Real Tol);
|
||||
Standard_EXPORT static TopoDS_Shape RefillProblemFaces(const TopoDS_Shape& S);
|
||||
Standard_EXPORT static TopoDS_Shape FixRanges(const TopoDS_Shape& S,const Standard_Real Tol);
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
|
||||
friend class BlockFix_SphereSpaceModifier;
|
||||
@ -76,6 +53,4 @@ friend class BlockFix_CheckTool;
|
||||
|
||||
};
|
||||
|
||||
// other Inline functions and methods (like "C++: function call" methods)
|
||||
|
||||
#endif
|
@ -23,7 +23,7 @@
|
||||
// Created: Tue Dec 7 11:59:05 2004
|
||||
// Author: Pavel DURANDIN
|
||||
|
||||
#include <BlockFix_BlockFixAPI.ixx>
|
||||
#include <BlockFix_BlockFixAPI.hxx>
|
||||
|
||||
#include <BlockFix.hxx>
|
||||
#include <BlockFix_UnionFaces.hxx>
|
||||
@ -35,22 +35,29 @@
|
||||
|
||||
#include <Precision.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_HANDLE(BlockFix_BlockFixAPI, MMgt_TShared);
|
||||
IMPLEMENT_STANDARD_RTTIEXT(BlockFix_BlockFixAPI, MMgt_TShared);
|
||||
|
||||
//=======================================================================
|
||||
//function : ShapeConvert_CanonicAPI
|
||||
//function : BlockFix_BlockFixAPI
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
BlockFix_BlockFixAPI::BlockFix_BlockFixAPI()
|
||||
{
|
||||
myTolerance = Precision::Confusion();
|
||||
myOptimumNbFaces = 6;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ~BlockFix_BlockFixAPI
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BlockFix_BlockFixAPI::~BlockFix_BlockFixAPI() {}
|
||||
|
||||
//=======================================================================
|
||||
//function : Perform
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BlockFix_BlockFixAPI::Perform()
|
||||
{
|
||||
// processing spheres with degenerativities
|
@ -18,15 +18,46 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
#include <BlockFix_BlockFixAPI.hxx>
|
||||
#ifndef _BlockFix_BlockFixAPI_HeaderFile
|
||||
#define _BlockFix_BlockFixAPI_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineHandle.hxx>
|
||||
|
||||
#include <Handle_ShapeBuild_ReShape.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
|
||||
DEFINE_STANDARD_HANDLE(BlockFix_BlockFixAPI, MMgt_TShared);
|
||||
|
||||
class BlockFix_BlockFixAPI : public MMgt_TShared
|
||||
{
|
||||
public:
|
||||
Standard_EXPORT BlockFix_BlockFixAPI();
|
||||
Standard_EXPORT ~BlockFix_BlockFixAPI();
|
||||
|
||||
void SetShape(const TopoDS_Shape& Shape);
|
||||
TopoDS_Shape Shape() const;
|
||||
Handle_ShapeBuild_ReShape& Context();
|
||||
Standard_Real& Tolerance();
|
||||
Standard_Integer& OptimumNbFaces();
|
||||
Standard_EXPORT void Perform();
|
||||
|
||||
DEFINE_STANDARD_RTTI(BlockFix_BlockFixAPI);
|
||||
|
||||
private:
|
||||
Handle_ShapeBuild_ReShape myContext;
|
||||
TopoDS_Shape myShape;
|
||||
Standard_Real myTolerance;
|
||||
Standard_Integer myOptimumNbFaces;
|
||||
};
|
||||
|
||||
//=======================================================================
|
||||
//function : SetShape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void BlockFix_BlockFixAPI::SetShape(const TopoDS_Shape& Shape)
|
||||
{
|
||||
myShape = Shape;
|
||||
@ -36,7 +67,6 @@ inline void BlockFix_BlockFixAPI::SetShape(const TopoDS_Shape& Shape)
|
||||
//function : Shape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline TopoDS_Shape BlockFix_BlockFixAPI::Shape() const
|
||||
{
|
||||
return myShape;
|
||||
@ -46,7 +76,6 @@ inline TopoDS_Shape BlockFix_BlockFixAPI::Shape() const
|
||||
//function : Context
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Handle(ShapeBuild_ReShape)& BlockFix_BlockFixAPI::Context()
|
||||
{
|
||||
return myContext;
|
||||
@ -56,7 +85,6 @@ inline Handle(ShapeBuild_ReShape)& BlockFix_BlockFixAPI::Context()
|
||||
//function : Tolerance
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real& BlockFix_BlockFixAPI::Tolerance()
|
||||
{
|
||||
return myTolerance;
|
||||
@ -66,8 +94,9 @@ inline Standard_Real& BlockFix_BlockFixAPI::Tolerance()
|
||||
//function : OptimumNbFaces
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer& BlockFix_BlockFixAPI::OptimumNbFaces()
|
||||
{
|
||||
return myOptimumNbFaces;
|
||||
}
|
||||
|
||||
#endif
|
@ -18,48 +18,43 @@
|
||||
// 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: BlockFix_CheckTool.cxx
|
||||
// Created: 17.12.04 11:15:25
|
||||
// Author: Sergey KUUL
|
||||
//
|
||||
#include <BlockFix_CheckTool.ixx>
|
||||
|
||||
//#include <BlockFix_UnionEdges.hxx>
|
||||
//#include <BlockFix_UnionFaces.hxx>
|
||||
#include <BlockFix_CheckTool.hxx>
|
||||
|
||||
#include <BRep_Tool.hxx>
|
||||
|
||||
#include <TopExp.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Solid.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : BlockFix_CheckTool()
|
||||
//purpose : Constructor
|
||||
//=======================================================================
|
||||
|
||||
BlockFix_CheckTool::BlockFix_CheckTool( )
|
||||
{
|
||||
myHasCheck = Standard_False;
|
||||
myPossibleBlocks.Clear();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetShape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BlockFix_CheckTool::SetShape(const TopoDS_Shape& aShape)
|
||||
{
|
||||
myHasCheck = Standard_False;
|
||||
@ -67,12 +62,10 @@ void BlockFix_CheckTool::SetShape(const TopoDS_Shape& aShape)
|
||||
myPossibleBlocks.Clear();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Perform
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BlockFix_CheckTool::Perform()
|
||||
{
|
||||
myNbSolids=0;
|
||||
@ -229,23 +222,19 @@ void BlockFix_CheckTool::Perform()
|
||||
myHasCheck = Standard_True;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : NbPossibleBlocks
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer BlockFix_CheckTool::NbPossibleBlocks() const
|
||||
{
|
||||
return myPossibleBlocks.Length();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : PossibleBlock
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
TopoDS_Shape BlockFix_CheckTool::PossibleBlock(const Standard_Integer num) const
|
||||
{
|
||||
TopoDS_Shape res;
|
||||
@ -254,12 +243,10 @@ TopoDS_Shape BlockFix_CheckTool::PossibleBlock(const Standard_Integer num) const
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : DumpCheckResult
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BlockFix_CheckTool::DumpCheckResult(Standard_OStream& S) const
|
||||
{
|
||||
if(!myHasCheck)
|
@ -18,11 +18,42 @@
|
||||
// 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 _TopoDS_Shape_HeaderFile
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#endif
|
||||
#ifndef _BlockFix_CheckTool_HeaderFile
|
||||
#include <BlockFix_CheckTool.hxx>
|
||||
#define _BlockFix_CheckTool_HeaderFile
|
||||
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TopTools_SequenceOfShape.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
|
||||
class TopoDS_Shape;
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Macro.hxx>
|
||||
|
||||
class BlockFix_CheckTool {
|
||||
|
||||
public:
|
||||
Standard_EXPORT BlockFix_CheckTool();
|
||||
Standard_EXPORT void SetShape(const TopoDS_Shape& aShape) ;
|
||||
Standard_EXPORT void Perform() ;
|
||||
Standard_EXPORT Standard_Integer NbPossibleBlocks() const;
|
||||
Standard_EXPORT TopoDS_Shape PossibleBlock(const Standard_Integer num) const;
|
||||
Standard_EXPORT void DumpCheckResult(Standard_OStream& S) const;
|
||||
|
||||
private:
|
||||
TopoDS_Shape myShape;
|
||||
Standard_Boolean myHasCheck;
|
||||
Standard_Integer myNbSolids;
|
||||
Standard_Integer myNbBlocks;
|
||||
TopTools_SequenceOfShape myPossibleBlocks;
|
||||
Standard_Integer myNbDegen;
|
||||
Standard_Integer myNbUF;
|
||||
Standard_Integer myNbUE;
|
||||
Standard_Integer myNbUFUE;
|
||||
Standard_Integer myBadRanges;
|
||||
};
|
||||
|
||||
#endif
|
@ -18,51 +18,71 @@
|
||||
// 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: BlockFix_PeriodicSurfaceModifier.cxx
|
||||
// Created: 15.12.04 10:08:50
|
||||
// Author: Sergey KUUL
|
||||
|
||||
#include <BlockFix_PeriodicSurfaceModifier.ixx>
|
||||
#include <BlockFix_PeriodicSurfaceModifier.hxx>
|
||||
|
||||
#include <ShapeFix_Edge.hxx>
|
||||
|
||||
#include <TopExp.hxx>
|
||||
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
|
||||
#include <TopLoc_Location.hxx>
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
|
||||
#include <BRepTools.hxx>
|
||||
|
||||
#include <Geom_CylindricalSurface.hxx>
|
||||
#include <Geom_SphericalSurface.hxx>
|
||||
#include <ShapeFix_Edge.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
|
||||
#include <Geom2d_Curve.hxx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_HANDLE(BlockFix_PeriodicSurfaceModifier, BRepTools_Modification);
|
||||
IMPLEMENT_STANDARD_RTTIEXT(BlockFix_PeriodicSurfaceModifier, BRepTools_Modification);
|
||||
|
||||
//=======================================================================
|
||||
//function : BlockFix_PeriodicSurfaceModifier()
|
||||
//purpose : Constructor
|
||||
//=======================================================================
|
||||
|
||||
BlockFix_PeriodicSurfaceModifier::BlockFix_PeriodicSurfaceModifier ( )
|
||||
BlockFix_PeriodicSurfaceModifier::BlockFix_PeriodicSurfaceModifier()
|
||||
{
|
||||
myMapOfFaces.Clear();
|
||||
myMapOfSurfaces.Clear();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ~BlockFix_PeriodicSurfaceModifier()
|
||||
//purpose : Destructor
|
||||
//=======================================================================
|
||||
BlockFix_PeriodicSurfaceModifier::~BlockFix_PeriodicSurfaceModifier()
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetTolerance
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BlockFix_PeriodicSurfaceModifier::SetTolerance(const Standard_Real Tol)
|
||||
{
|
||||
myTolerance = Tol;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ModifySurface
|
||||
//purpose : auxilary
|
||||
//=======================================================================
|
||||
|
||||
static Standard_Boolean ModifySurface(const TopoDS_Face& aFace,
|
||||
const Handle(Geom_Surface)& aSurface,
|
||||
Handle(Geom_Surface)& aNewSurface)
|
||||
@ -102,12 +122,10 @@ static Standard_Boolean ModifySurface(const TopoDS_Face& aFace,
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : NewSurface
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean BlockFix_PeriodicSurfaceModifier::NewSurface(const TopoDS_Face& F,
|
||||
Handle(Geom_Surface)& S,
|
||||
TopLoc_Location& L,Standard_Real& Tol,
|
||||
@ -133,12 +151,10 @@ Standard_Boolean BlockFix_PeriodicSurfaceModifier::NewSurface(const TopoDS_Face&
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : NewCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean BlockFix_PeriodicSurfaceModifier::NewCurve(const TopoDS_Edge& /*E*/,
|
||||
Handle(Geom_Curve)& /*C*/,
|
||||
TopLoc_Location& /*L*/,
|
||||
@ -147,12 +163,10 @@ Standard_Boolean BlockFix_PeriodicSurfaceModifier::NewCurve(const TopoDS_Edge& /
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : NewPoint
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean BlockFix_PeriodicSurfaceModifier::NewPoint(const TopoDS_Vertex& /*V*/,
|
||||
gp_Pnt& /*P*/,
|
||||
Standard_Real& /*Tol*/)
|
||||
@ -160,12 +174,10 @@ Standard_Boolean BlockFix_PeriodicSurfaceModifier::NewPoint(const TopoDS_Vertex&
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : NewCurve2d
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean BlockFix_PeriodicSurfaceModifier::NewCurve2d(const TopoDS_Edge& E,
|
||||
const TopoDS_Face& F,
|
||||
const TopoDS_Edge& /*NewE*/,
|
||||
@ -219,12 +231,10 @@ Standard_Boolean BlockFix_PeriodicSurfaceModifier::NewCurve2d(const TopoDS_Edge&
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : NewParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean BlockFix_PeriodicSurfaceModifier::NewParameter(const TopoDS_Vertex& /*V*/,
|
||||
const TopoDS_Edge& /*E*/,
|
||||
Standard_Real& /*P*/,
|
||||
@ -233,12 +243,10 @@ Standard_Boolean BlockFix_PeriodicSurfaceModifier::NewParameter(const TopoDS_Ver
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Continuity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_Shape BlockFix_PeriodicSurfaceModifier::Continuity(const TopoDS_Edge& E,
|
||||
const TopoDS_Face& F1,
|
||||
const TopoDS_Face& F2,
|
||||
@ -248,4 +256,3 @@ GeomAbs_Shape BlockFix_PeriodicSurfaceModifier::Continuity(const TopoDS_Edge& E,
|
||||
{
|
||||
return BRep_Tool::Continuity(E,F1,F2);
|
||||
}
|
||||
|
95
src/BlockFix/BlockFix_PeriodicSurfaceModifier.hxx
Normal file
95
src/BlockFix/BlockFix_PeriodicSurfaceModifier.hxx
Normal file
@ -0,0 +1,95 @@
|
||||
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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 _BlockFix_PeriodicSurfaceModifier_HeaderFile
|
||||
#define _BlockFix_PeriodicSurfaceModifier_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineHandle.hxx>
|
||||
|
||||
#include <BlockFix_PeriodicSurfaceModifier.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
#include <TopTools_DataMapOfShapeInteger.hxx>
|
||||
#include <TColStd_IndexedMapOfTransient.hxx>
|
||||
#include <BRepTools_Modification.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Handle_Geom_Surface.hxx>
|
||||
#include <Handle_Geom_Curve.hxx>
|
||||
#include <Handle_Geom2d_Curve.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
|
||||
class TopoDS_Face;
|
||||
class Geom_Surface;
|
||||
class TopLoc_Location;
|
||||
class TopoDS_Edge;
|
||||
class Geom_Curve;
|
||||
class TopoDS_Vertex;
|
||||
class gp_Pnt;
|
||||
class Geom2d_Curve;
|
||||
|
||||
DEFINE_STANDARD_HANDLE(BlockFix_PeriodicSurfaceModifier, BRepTools_Modification);
|
||||
|
||||
class BlockFix_PeriodicSurfaceModifier : public BRepTools_Modification {
|
||||
|
||||
public:
|
||||
Standard_EXPORT BlockFix_PeriodicSurfaceModifier();
|
||||
Standard_EXPORT ~BlockFix_PeriodicSurfaceModifier();
|
||||
|
||||
Standard_EXPORT void SetTolerance (const Standard_Real Toler) ;
|
||||
Standard_EXPORT Standard_Boolean NewSurface (const TopoDS_Face& F,
|
||||
Handle(Geom_Surface)& S,
|
||||
TopLoc_Location& L,
|
||||
Standard_Real& Tol,
|
||||
Standard_Boolean& RevWires,
|
||||
Standard_Boolean& RevFace);
|
||||
Standard_EXPORT Standard_Boolean NewCurve (const TopoDS_Edge& E,
|
||||
Handle(Geom_Curve)& C,
|
||||
TopLoc_Location& L,
|
||||
Standard_Real& Tol) ;
|
||||
Standard_EXPORT Standard_Boolean NewPoint (const TopoDS_Vertex& V, gp_Pnt& P, Standard_Real& Tol);
|
||||
Standard_EXPORT Standard_Boolean NewCurve2d (const TopoDS_Edge& E,
|
||||
const TopoDS_Face& F,
|
||||
const TopoDS_Edge& NewE,
|
||||
const TopoDS_Face& NewF,
|
||||
Handle(Geom2d_Curve)& C,
|
||||
Standard_Real& Tol);
|
||||
Standard_EXPORT Standard_Boolean NewParameter (const TopoDS_Vertex& V,
|
||||
const TopoDS_Edge& E,
|
||||
Standard_Real& P,
|
||||
Standard_Real& Tol);
|
||||
Standard_EXPORT GeomAbs_Shape Continuity (const TopoDS_Edge& E,
|
||||
const TopoDS_Face& F1,
|
||||
const TopoDS_Face& F2,
|
||||
const TopoDS_Edge& NewE,
|
||||
const TopoDS_Face& NewF1,
|
||||
const TopoDS_Face& NewF2);
|
||||
|
||||
DEFINE_STANDARD_RTTI(BlockFix_PeriodicSurfaceModifier);
|
||||
|
||||
private:
|
||||
Standard_Real myTolerance;
|
||||
TopTools_DataMapOfShapeInteger myMapOfFaces;
|
||||
TColStd_IndexedMapOfTransient myMapOfSurfaces;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
@ -18,60 +18,75 @@
|
||||
// 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: BlockFix.cxx
|
||||
// Created: Tue Dec 7 11:59:05 2004
|
||||
// Author: Pavel DURANDIN
|
||||
|
||||
#include <BlockFix_SphereSpaceModifier.ixx>
|
||||
#include <BlockFix_SphereSpaceModifier.hxx>
|
||||
|
||||
#include <ShapeAnalysis.hxx>
|
||||
|
||||
#include <ShapeFix_Edge.hxx>
|
||||
|
||||
#include <TopExp.hxx>
|
||||
|
||||
#include <TopLoc_Location.hxx>
|
||||
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
|
||||
#include <BRepGProp.hxx>
|
||||
#include <GProp_GProps.hxx>
|
||||
|
||||
#include <Geom_SphericalSurface.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
#include <ShapeAnalysis.hxx>
|
||||
#include <gp_Sphere.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <ShapeFix_Edge.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <GProp_GProps.hxx>
|
||||
#include <BRepGProp.hxx>
|
||||
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
|
||||
#include <Geom2d_Curve.hxx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Sphere.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_HANDLE(BlockFix_SphereSpaceModifier, BRepTools_Modification);
|
||||
IMPLEMENT_STANDARD_RTTIEXT(BlockFix_SphereSpaceModifier, BRepTools_Modification);
|
||||
|
||||
//=======================================================================
|
||||
//function : BlockFix_SphereSpaceModifier
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
BlockFix_SphereSpaceModifier::BlockFix_SphereSpaceModifier()
|
||||
{
|
||||
myMapOfFaces.Clear();
|
||||
myMapOfSpheres.Clear();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ~BlockFix_SphereSpaceModifier
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BlockFix_SphereSpaceModifier::~BlockFix_SphereSpaceModifier() {}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetTolerance
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BlockFix_SphereSpaceModifier::SetTolerance(const Standard_Real Tol)
|
||||
{
|
||||
myTolerance = Tol;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : NewSurface
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
|
||||
static Standard_Boolean ModifySurface(const TopoDS_Face& aFace,
|
||||
const Handle(Geom_Surface)& aSurface,
|
||||
Handle(Geom_Surface)& aNewSurface)
|
||||
@ -132,7 +147,6 @@ static Standard_Boolean ModifySurface(const TopoDS_Face& aFace,
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
|
||||
Standard_Boolean BlockFix_SphereSpaceModifier::NewSurface(const TopoDS_Face& F,
|
||||
Handle(Geom_Surface)& S,
|
||||
TopLoc_Location& L,Standard_Real& Tol,
|
||||
@ -163,7 +177,6 @@ Standard_Boolean BlockFix_SphereSpaceModifier::NewSurface(const TopoDS_Face& F,
|
||||
//function : NewCurve
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean BlockFix_SphereSpaceModifier::NewCurve(const TopoDS_Edge& /*E*/,Handle(Geom_Curve)& /*C*/,
|
||||
TopLoc_Location& /*L*/,Standard_Real& /*Tol*/)
|
||||
{
|
||||
@ -174,7 +187,6 @@ Standard_Boolean BlockFix_SphereSpaceModifier::NewCurve(const TopoDS_Edge& /*E*/
|
||||
//function : NewPoint
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean BlockFix_SphereSpaceModifier::NewPoint(const TopoDS_Vertex& /*V*/,
|
||||
gp_Pnt& /*P*/,
|
||||
Standard_Real& /*Tol*/)
|
||||
@ -186,7 +198,6 @@ Standard_Boolean BlockFix_SphereSpaceModifier::NewPoint(const TopoDS_Vertex& /*V
|
||||
//function : NewCurve2d
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean BlockFix_SphereSpaceModifier::NewCurve2d(const TopoDS_Edge& E,const TopoDS_Face& F,
|
||||
const TopoDS_Edge& /*NewE*/,const TopoDS_Face& /*NewF*/,
|
||||
Handle(Geom2d_Curve)& C,Standard_Real& Tol)
|
||||
@ -249,24 +260,20 @@ Standard_Boolean BlockFix_SphereSpaceModifier::NewCurve2d(const TopoDS_Edge& E,c
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : NewParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean BlockFix_SphereSpaceModifier::NewParameter(const TopoDS_Vertex& /*V*/,const TopoDS_Edge& /*E*/,
|
||||
Standard_Real& /*P*/,Standard_Real& /*Tol*/)
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Continuity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_Shape BlockFix_SphereSpaceModifier::Continuity(const TopoDS_Edge& E,const TopoDS_Face& F1,
|
||||
const TopoDS_Face& F2,const TopoDS_Edge& /*NewE*/,
|
||||
const TopoDS_Face& /*NewF1*/,const TopoDS_Face& /*NewF2*/)
|
82
src/BlockFix/BlockFix_SphereSpaceModifier.hxx
Normal file
82
src/BlockFix/BlockFix_SphereSpaceModifier.hxx
Normal file
@ -0,0 +1,82 @@
|
||||
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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 _BlockFix_SphereSpaceModifier_HeaderFile
|
||||
#define _BlockFix_SphereSpaceModifier_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineHandle.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
#include <TopTools_DataMapOfShapeInteger.hxx>
|
||||
#include <TColStd_IndexedMapOfTransient.hxx>
|
||||
#include <BRepTools_Modification.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Handle_Geom_Surface.hxx>
|
||||
#include <Handle_Geom_Curve.hxx>
|
||||
#include <Handle_Geom2d_Curve.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
|
||||
class TopoDS_Face;
|
||||
class Geom_Surface;
|
||||
class TopLoc_Location;
|
||||
class TopoDS_Edge;
|
||||
class Geom_Curve;
|
||||
class TopoDS_Vertex;
|
||||
class gp_Pnt;
|
||||
class Geom2d_Curve;
|
||||
|
||||
DEFINE_STANDARD_HANDLE(BlockFix_SphereSpaceModifier, BRepTools_Modification);
|
||||
|
||||
class BlockFix_SphereSpaceModifier : public BRepTools_Modification {
|
||||
|
||||
public:
|
||||
Standard_EXPORT BlockFix_SphereSpaceModifier();
|
||||
Standard_EXPORT ~BlockFix_SphereSpaceModifier();
|
||||
|
||||
Standard_EXPORT void SetTolerance (const Standard_Real Toler);
|
||||
Standard_EXPORT Standard_Boolean NewSurface (const TopoDS_Face& F, Handle(Geom_Surface)& S,
|
||||
TopLoc_Location& L, Standard_Real& Tol,
|
||||
Standard_Boolean& RevWires, Standard_Boolean& RevFace);
|
||||
Standard_EXPORT Standard_Boolean NewCurve (const TopoDS_Edge& E, Handle(Geom_Curve)& C,
|
||||
TopLoc_Location& L, Standard_Real& Tol);
|
||||
Standard_EXPORT Standard_Boolean NewPoint (const TopoDS_Vertex& V, gp_Pnt& P, Standard_Real& Tol);
|
||||
Standard_EXPORT Standard_Boolean NewCurve2d (const TopoDS_Edge& E, const TopoDS_Face& F,
|
||||
const TopoDS_Edge& NewE, const TopoDS_Face& NewF,
|
||||
Handle(Geom2d_Curve)& C, Standard_Real& Tol);
|
||||
Standard_EXPORT Standard_Boolean NewParameter (const TopoDS_Vertex& V, const TopoDS_Edge& E,
|
||||
Standard_Real& P, Standard_Real& Tol);
|
||||
Standard_EXPORT GeomAbs_Shape Continuity (const TopoDS_Edge& E,
|
||||
const TopoDS_Face& F1,const TopoDS_Face& F2,
|
||||
const TopoDS_Edge& NewE,
|
||||
const TopoDS_Face& NewF1, const TopoDS_Face& NewF2);
|
||||
Standard_EXPORT Standard_Boolean ForRotation (const TopoDS_Face& F);
|
||||
|
||||
DEFINE_STANDARD_RTTI(BlockFix_SphereSpaceModifier);
|
||||
|
||||
private:
|
||||
Standard_Real myTolerance;
|
||||
TopTools_DataMapOfShapeInteger myMapOfFaces;
|
||||
TColStd_IndexedMapOfTransient myMapOfSpheres;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
@ -23,10 +23,12 @@
|
||||
// Created: 07.12.04 15:27:30
|
||||
// Author: Sergey KUUL
|
||||
|
||||
#include <BlockFix_UnionEdges.ixx>
|
||||
#include <BlockFix_UnionEdges.hxx>
|
||||
|
||||
#include <ShapeAnalysis_Edge.hxx>
|
||||
|
||||
#include <ShapeBuild_ReShape.hxx>
|
||||
|
||||
#include <ShapeFix_Edge.hxx>
|
||||
#include <ShapeFix_Face.hxx>
|
||||
#include <ShapeFix_Shell.hxx>
|
||||
@ -57,6 +59,7 @@
|
||||
#include <TopoDS_Solid.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
#include <Approx_Curve3d.hxx>
|
||||
|
@ -18,14 +18,30 @@
|
||||
// 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 _ShapeBuild_ReShape_HeaderFile
|
||||
#include <ShapeBuild_ReShape.hxx>
|
||||
#endif
|
||||
#ifndef _TopoDS_Shape_HeaderFile
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#endif
|
||||
#ifndef _BlockFix_UnionEdges_HeaderFile
|
||||
#include <BlockFix_UnionEdges.hxx>
|
||||
#define _BlockFix_UnionEdges_HeaderFile
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
|
||||
#include <ShapeBuild_ReShape.hxx>
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Macro.hxx>
|
||||
|
||||
class TopoDS_Shape;
|
||||
|
||||
class BlockFix_UnionEdges {
|
||||
|
||||
public:
|
||||
Standard_EXPORT BlockFix_UnionEdges();
|
||||
|
||||
Standard_EXPORT TopoDS_Shape Perform (const TopoDS_Shape& Shape,const Standard_Real Tol);
|
||||
|
||||
private:
|
||||
Standard_Real myTolerance;
|
||||
Handle_ShapeBuild_ReShape myContext;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
@ -18,13 +18,12 @@
|
||||
// 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: BlockFix_UnionFaces.cxx
|
||||
// Created: Tue Dec 7 17:15:42 2004
|
||||
// Author: Pavel DURANDIN
|
||||
|
||||
#include <BlockFix_UnionFaces.ixx>
|
||||
#include <BlockFix_UnionFaces.hxx>
|
||||
|
||||
#include <Basics_OCCTVersion.hxx>
|
||||
|
||||
@ -73,6 +72,7 @@
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Shell.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
#include <TColGeom_HArray2OfSurface.hxx>
|
||||
|
||||
@ -104,43 +104,37 @@
|
||||
//function : BlockFix_UnionFaces
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
BlockFix_UnionFaces::BlockFix_UnionFaces()
|
||||
: myTolerance(Precision::Confusion()),
|
||||
myOptimumNbFaces(6)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : GetTolerance
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real& BlockFix_UnionFaces::GetTolerance()
|
||||
{
|
||||
return myTolerance;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : GetOptimumNbFaces
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer& BlockFix_UnionFaces::GetOptimumNbFaces()
|
||||
{
|
||||
return myOptimumNbFaces;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : AddOrdinaryEdges
|
||||
//purpose : auxilary
|
||||
// adds edges from the shape to the sequence
|
||||
// seams and equal edges are dropped
|
||||
// Returns true if one of original edges dropped
|
||||
//=======================================================================
|
||||
// adds edges from the shape to the sequence
|
||||
// seams and equal edges are dropped
|
||||
// Returns true if one of original edges dropped
|
||||
static Standard_Boolean AddOrdinaryEdges(TopTools_SequenceOfShape& edges,
|
||||
const TopoDS_Shape aShape,
|
||||
Standard_Integer& anIndex)
|
||||
@ -180,7 +174,6 @@ static Standard_Boolean AddOrdinaryEdges(TopTools_SequenceOfShape& edges,
|
||||
return isDropped;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ClearRts
|
||||
//purpose : auxilary
|
||||
@ -195,12 +188,10 @@ static Handle(Geom_Surface) ClearRts(const Handle(Geom_Surface)& aSurface)
|
||||
return aSurface;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Perform
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
TopoDS_Shape BlockFix_UnionFaces::Perform(const TopoDS_Shape& Shape)
|
||||
{
|
||||
Handle(ShapeBuild_ReShape) myContext = new ShapeBuild_ReShape;
|
||||
@ -519,12 +510,10 @@ TopoDS_Shape BlockFix_UnionFaces::Perform(const TopoDS_Shape& Shape)
|
||||
return aResShape;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsSameDomain
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
bool getCylinder (Handle(Geom_Surface)& theInSurface, gp_Cylinder& theOutCylinder)
|
||||
{
|
||||
bool isCylinder = false;
|
||||
@ -683,12 +672,10 @@ Standard_Boolean BlockFix_UnionFaces::IsSameDomain(const TopoDS_Face& aFace,
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : MovePCurves
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BlockFix_UnionFaces::MovePCurves(TopoDS_Face& aTarget,
|
||||
const TopoDS_Face& aSource) const
|
||||
{
|
@ -18,23 +18,14 @@
|
||||
// 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 _BlockFix_UnionFaces_HeaderFile
|
||||
#define _BlockFix_UnionFaces_HeaderFile
|
||||
|
||||
#ifndef _Standard_Real_HeaderFile
|
||||
#include <Standard_Real.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Boolean_HeaderFile
|
||||
#include <Standard_Boolean.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Macro_HeaderFile
|
||||
#include <Standard_Macro.hxx>
|
||||
#endif
|
||||
|
||||
class TopoDS_Shape;
|
||||
class TopoDS_Face;
|
||||
@ -42,24 +33,9 @@ class TopoDS_Face;
|
||||
class BlockFix_UnionFaces
|
||||
{
|
||||
public:
|
||||
void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
|
||||
// Methods PUBLIC
|
||||
//
|
||||
Standard_EXPORT BlockFix_UnionFaces();
|
||||
|
||||
Standard_EXPORT Standard_Real& GetTolerance();
|
||||
Standard_EXPORT Standard_Real& GetTolerance();
|
||||
|
||||
/* \brief To get/set the OptimumNbFaces parameter
|
||||
*
|
||||
@ -71,18 +47,17 @@ public:
|
||||
* negative - do not perform any unions, regardless the faces quantity.
|
||||
*
|
||||
*/
|
||||
Standard_EXPORT Standard_Integer& GetOptimumNbFaces();
|
||||
Standard_EXPORT Standard_Integer& GetOptimumNbFaces();
|
||||
|
||||
Standard_EXPORT TopoDS_Shape Perform(const TopoDS_Shape& Shape);
|
||||
Standard_EXPORT TopoDS_Shape Perform(const TopoDS_Shape& Shape);
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean IsSameDomain(const TopoDS_Face& aFace,
|
||||
const TopoDS_Face& aChekedFace) const;
|
||||
Standard_EXPORT virtual void MovePCurves(TopoDS_Face& aTarget,
|
||||
const TopoDS_Face& aSource) const;
|
||||
Standard_EXPORT virtual Standard_Boolean IsSameDomain(const TopoDS_Face& aFace,
|
||||
const TopoDS_Face& aChekedFace) const;
|
||||
|
||||
Standard_EXPORT virtual void MovePCurves(TopoDS_Face& aTarget,
|
||||
const TopoDS_Face& aSource) const;
|
||||
|
||||
private:
|
||||
// Fields PRIVATE
|
||||
//
|
||||
Standard_Real myTolerance;
|
||||
Standard_Integer myOptimumNbFaces;
|
||||
};
|
55
src/BlockFix/Makefile.am
Normal file
55
src/BlockFix/Makefile.am
Normal file
@ -0,0 +1,55 @@
|
||||
# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
#
|
||||
# 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
|
||||
|
||||
# GEOM BlockFix : tools for Blocks algorithms
|
||||
# File : Makefile.am
|
||||
# Author : Julia DOROVSKIKH
|
||||
# Module : GEOM
|
||||
|
||||
include $(top_srcdir)/adm_local/unix/make_common_starter.am
|
||||
|
||||
# Libraries targets
|
||||
lib_LTLIBRARIES = libBlockFix.la
|
||||
|
||||
dist_libBlockFix_la_SOURCES = \
|
||||
BlockFix_BlockFixAPI.cxx \
|
||||
BlockFix_CheckTool.cxx \
|
||||
BlockFix.cxx \
|
||||
BlockFix_PeriodicSurfaceModifier.cxx \
|
||||
BlockFix_SphereSpaceModifier.cxx \
|
||||
BlockFix_UnionEdges.cxx \
|
||||
BlockFix_UnionFaces.cxx
|
||||
|
||||
# header files
|
||||
salomeinclude_HEADERS = \
|
||||
BlockFix.hxx \
|
||||
BlockFix_BlockFixAPI.hxx \
|
||||
BlockFix_CheckTool.hxx \
|
||||
BlockFix_PeriodicSurfaceModifier.hxx \
|
||||
BlockFix_SphereSpaceModifier.hxx \
|
||||
BlockFix_UnionEdges.hxx \
|
||||
BlockFix_UnionFaces.hxx
|
||||
|
||||
libBlockFix_la_CPPFLAGS = \
|
||||
$(CAS_CPPFLAGS) \
|
||||
$(KERNEL_CXXFLAGS)
|
||||
|
||||
libBlockFix_la_LDFLAGS = \
|
||||
$(STDLIB) \
|
||||
$(CAS_LDPATH) -lTKBO -lTKShHealing -lTKBool -lTKMesh -lTKOffset \
|
||||
$(KERNEL_LDFLAGS) -lSALOMELocalTrace
|
@ -1,67 +0,0 @@
|
||||
-- Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
--
|
||||
-- Copyright (C) 2003-2007 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: BlockFix.cdl
|
||||
-- Created: Tue Dec 7 11:59:05 2004
|
||||
-- Author: Pavel Durandin
|
||||
--
|
||||
package BlockFix
|
||||
|
||||
uses
|
||||
|
||||
TColStd,
|
||||
gp,
|
||||
Geom,
|
||||
Geom2d,
|
||||
GeomAbs,
|
||||
TopLoc,
|
||||
TopoDS,
|
||||
BRepTools,
|
||||
TopTools,
|
||||
ShapeBuild
|
||||
|
||||
is
|
||||
|
||||
class SphereSpaceModifier;
|
||||
|
||||
class UnionFaces;
|
||||
|
||||
class UnionEdges;
|
||||
|
||||
class BlockFixAPI;
|
||||
---Purpose: API class to perform the fixing of the
|
||||
-- block
|
||||
|
||||
class PeriodicSurfaceModifier;
|
||||
|
||||
class CheckTool;
|
||||
|
||||
RotateSphereSpace (S: Shape from TopoDS; Tol: Real)
|
||||
returns Shape from TopoDS;
|
||||
|
||||
FixRanges (S: Shape from TopoDS; Tol: Real)
|
||||
returns Shape from TopoDS;
|
||||
---Purpose: checking and fixing cases where parametric
|
||||
-- boundaries of face based on periodic surface are not
|
||||
-- contained in the range of this surface.
|
||||
|
||||
end BlockFix;
|
@ -1,27 +0,0 @@
|
||||
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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
|
||||
//
|
||||
|
||||
#include <BlockFix.jxx>
|
||||
|
||||
|
||||
|
||||
|
@ -1,28 +0,0 @@
|
||||
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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 _TopoDS_Shape_HeaderFile
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#endif
|
||||
#ifndef _BlockFix_HeaderFile
|
||||
#include <BlockFix.hxx>
|
||||
#endif
|
@ -1,68 +0,0 @@
|
||||
-- Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
--
|
||||
-- Copyright (C) 2003-2007 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: BlockFix_BlockFixAPI.cdl
|
||||
-- Created: Tue Dec 7 17:56:09 2004
|
||||
-- Author: Pavel Durandin
|
||||
--
|
||||
class BlockFixAPI from BlockFix inherits TShared from MMgt
|
||||
|
||||
---Purpose:
|
||||
|
||||
uses
|
||||
|
||||
Shape from TopoDS,
|
||||
ReShape from ShapeBuild
|
||||
|
||||
is
|
||||
Create returns BlockFixAPI from BlockFix;
|
||||
---Purpose: Empty constructor
|
||||
|
||||
SetShape(me: mutable; Shape: Shape from TopoDS);
|
||||
---Purpose: Sets the shape to be operated on
|
||||
---C++: inline
|
||||
|
||||
Perform(me: mutable);
|
||||
---Purpose:
|
||||
|
||||
Shape(me) returns Shape from TopoDS;
|
||||
---Purpose: Returns resulting shape.
|
||||
---C++: inline
|
||||
|
||||
Context(me:mutable) returns ReShape from ShapeBuild;
|
||||
---Purpose: Returns modifiable context for storing the
|
||||
-- mofifications
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
|
||||
Tolerance (me:mutable) returns Real;
|
||||
---Purpose: Returns modifiable tolerance of recognition
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
|
||||
fields
|
||||
|
||||
myContext : ReShape from ShapeBuild;
|
||||
myShape : Shape from TopoDS;
|
||||
myTolerance : Real from Standard;
|
||||
|
||||
end BlockFixAPI from BlockFix;
|
@ -1,94 +0,0 @@
|
||||
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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 _BlockFix_BlockFixAPI_HeaderFile
|
||||
#define _BlockFix_BlockFixAPI_HeaderFile
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_BlockFix_BlockFixAPI_HeaderFile
|
||||
#include <Handle_BlockFix_BlockFixAPI.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef _Handle_ShapeBuild_ReShape_HeaderFile
|
||||
#include <Handle_ShapeBuild_ReShape.hxx>
|
||||
#endif
|
||||
#ifndef _TopoDS_Shape_HeaderFile
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Real_HeaderFile
|
||||
#include <Standard_Real.hxx>
|
||||
#endif
|
||||
#ifndef _MMgt_TShared_HeaderFile
|
||||
#include <MMgt_TShared.hxx>
|
||||
#endif
|
||||
|
||||
class ShapeBuild_ReShape;
|
||||
class TopoDS_Shape;
|
||||
|
||||
|
||||
class BlockFix_BlockFixAPI : public MMgt_TShared
|
||||
{
|
||||
public:
|
||||
void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
|
||||
// Methods PUBLIC
|
||||
//
|
||||
Standard_EXPORT BlockFix_BlockFixAPI();
|
||||
void SetShape(const TopoDS_Shape& Shape);
|
||||
Standard_EXPORT void Perform();
|
||||
TopoDS_Shape Shape() const;
|
||||
Handle_ShapeBuild_ReShape& Context();
|
||||
Standard_Real& Tolerance();
|
||||
Standard_Integer& OptimumNbFaces();
|
||||
Standard_EXPORT ~BlockFix_BlockFixAPI();
|
||||
|
||||
// Type management
|
||||
//
|
||||
Standard_EXPORT friend Handle_Standard_Type& BlockFix_BlockFixAPI_Type_();
|
||||
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
|
||||
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
|
||||
|
||||
private:
|
||||
// Fields PRIVATE
|
||||
//
|
||||
Handle_ShapeBuild_ReShape myContext;
|
||||
TopoDS_Shape myShape;
|
||||
Standard_Real myTolerance;
|
||||
Standard_Integer myOptimumNbFaces;
|
||||
};
|
||||
|
||||
#include <BlockFix_BlockFixAPI.lxx>
|
||||
|
||||
#endif
|
@ -1,77 +0,0 @@
|
||||
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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
|
||||
//
|
||||
|
||||
#include <BlockFix_BlockFixAPI.jxx>
|
||||
|
||||
#ifndef _Standard_TypeMismatch_HeaderFile
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#endif
|
||||
|
||||
BlockFix_BlockFixAPI::~BlockFix_BlockFixAPI() {}
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT Handle_Standard_Type& BlockFix_BlockFixAPI_Type_()
|
||||
{
|
||||
|
||||
static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared);
|
||||
if ( aType1.IsNull()) aType1 = STANDARD_TYPE(MMgt_TShared);
|
||||
static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient);
|
||||
if ( aType2.IsNull()) aType2 = STANDARD_TYPE(Standard_Transient);
|
||||
|
||||
|
||||
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL};
|
||||
static Handle_Standard_Type _aType = new Standard_Type("BlockFix_BlockFixAPI",
|
||||
sizeof(BlockFix_BlockFixAPI),
|
||||
1,
|
||||
(Standard_Address)_Ancestors,
|
||||
(Standard_Address)NULL);
|
||||
|
||||
return _aType;
|
||||
}
|
||||
|
||||
|
||||
// DownCast method
|
||||
// allow safe downcasting
|
||||
//
|
||||
const Handle(BlockFix_BlockFixAPI) Handle(BlockFix_BlockFixAPI)::DownCast(const Handle(Standard_Transient)& AnObject)
|
||||
{
|
||||
Handle(BlockFix_BlockFixAPI) _anOtherObject;
|
||||
|
||||
if (!AnObject.IsNull()) {
|
||||
if (AnObject->IsKind(STANDARD_TYPE(BlockFix_BlockFixAPI))) {
|
||||
_anOtherObject = Handle(BlockFix_BlockFixAPI)((Handle(BlockFix_BlockFixAPI)&)AnObject);
|
||||
}
|
||||
}
|
||||
|
||||
return _anOtherObject ;
|
||||
}
|
||||
const Handle(Standard_Type)& BlockFix_BlockFixAPI::DynamicType() const
|
||||
{
|
||||
return STANDARD_TYPE(BlockFix_BlockFixAPI) ;
|
||||
}
|
||||
Standard_Boolean BlockFix_BlockFixAPI::IsKind(const Handle(Standard_Type)& AType) const
|
||||
{
|
||||
return (STANDARD_TYPE(BlockFix_BlockFixAPI) == AType || MMgt_TShared::IsKind(AType));
|
||||
}
|
||||
Handle_BlockFix_BlockFixAPI::~Handle_BlockFix_BlockFixAPI() {}
|
||||
|
@ -1,31 +0,0 @@
|
||||
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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 _ShapeBuild_ReShape_HeaderFile
|
||||
#include <ShapeBuild_ReShape.hxx>
|
||||
#endif
|
||||
#ifndef _TopoDS_Shape_HeaderFile
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#endif
|
||||
#ifndef _BlockFix_BlockFixAPI_HeaderFile
|
||||
#include <BlockFix_BlockFixAPI.hxx>
|
||||
#endif
|
@ -1,67 +0,0 @@
|
||||
-- Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
--
|
||||
-- Copyright (C) 2003-2007 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: BlockFix_CheckTool.cdl
|
||||
-- Created: Fri Dec 17 10:36:58 2004
|
||||
-- Author: Sergey KUUL
|
||||
--
|
||||
class CheckTool from BlockFix
|
||||
|
||||
---Purpose:
|
||||
|
||||
uses
|
||||
|
||||
Shape from TopoDS,
|
||||
SequenceOfShape from TopTools
|
||||
|
||||
is
|
||||
|
||||
Create returns CheckTool from BlockFix;
|
||||
---Purpose: Empty constructor
|
||||
|
||||
SetShape(me: in out; aShape: Shape from TopoDS);
|
||||
|
||||
Perform(me: in out);
|
||||
---Purpose:
|
||||
|
||||
NbPossibleBlocks(me) returns Integer;
|
||||
|
||||
PossibleBlock(me; num: Integer) returns Shape from TopoDS;
|
||||
|
||||
DumpCheckResult(me; S : in out OStream);
|
||||
---Purpose: Dumps results of checking
|
||||
|
||||
|
||||
fields
|
||||
|
||||
myShape : Shape from TopoDS;
|
||||
myHasCheck : Boolean;
|
||||
myNbSolids : Integer;
|
||||
myNbBlocks : Integer;
|
||||
myPossibleBlocks : SequenceOfShape from TopTools;
|
||||
myNbDegen : Integer;
|
||||
myNbUF : Integer;
|
||||
myNbUE : Integer;
|
||||
myNbUFUE : Integer;
|
||||
myBadRanges : Integer;
|
||||
|
||||
end CheckTool;
|
@ -1,120 +0,0 @@
|
||||
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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 _BlockFix_CheckTool_HeaderFile
|
||||
#define _BlockFix_CheckTool_HeaderFile
|
||||
|
||||
#ifndef _TopoDS_Shape_HeaderFile
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Boolean_HeaderFile
|
||||
#include <Standard_Boolean.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Integer_HeaderFile
|
||||
#include <Standard_Integer.hxx>
|
||||
#endif
|
||||
#ifndef _TopTools_SequenceOfShape_HeaderFile
|
||||
#include <TopTools_SequenceOfShape.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_OStream_HeaderFile
|
||||
#include <Standard_OStream.hxx>
|
||||
#endif
|
||||
class TopoDS_Shape;
|
||||
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Macro_HeaderFile
|
||||
#include <Standard_Macro.hxx>
|
||||
#endif
|
||||
|
||||
class BlockFix_CheckTool {
|
||||
|
||||
public:
|
||||
|
||||
void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
// Methods PUBLIC
|
||||
//
|
||||
Standard_EXPORT BlockFix_CheckTool();
|
||||
Standard_EXPORT void SetShape(const TopoDS_Shape& aShape) ;
|
||||
Standard_EXPORT void Perform() ;
|
||||
Standard_EXPORT Standard_Integer NbPossibleBlocks() const;
|
||||
Standard_EXPORT TopoDS_Shape PossibleBlock(const Standard_Integer num) const;
|
||||
Standard_EXPORT void DumpCheckResult(Standard_OStream& S) const;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Methods PROTECTED
|
||||
//
|
||||
|
||||
|
||||
// Fields PROTECTED
|
||||
//
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Methods PRIVATE
|
||||
//
|
||||
|
||||
|
||||
// Fields PRIVATE
|
||||
//
|
||||
TopoDS_Shape myShape;
|
||||
Standard_Boolean myHasCheck;
|
||||
Standard_Integer myNbSolids;
|
||||
Standard_Integer myNbBlocks;
|
||||
TopTools_SequenceOfShape myPossibleBlocks;
|
||||
Standard_Integer myNbDegen;
|
||||
Standard_Integer myNbUF;
|
||||
Standard_Integer myNbUE;
|
||||
Standard_Integer myNbUFUE;
|
||||
Standard_Integer myBadRanges;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// other Inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
@ -1,27 +0,0 @@
|
||||
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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
|
||||
//
|
||||
|
||||
#include <BlockFix_CheckTool.jxx>
|
||||
|
||||
|
||||
|
||||
|
@ -1,135 +0,0 @@
|
||||
-- Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
--
|
||||
-- Copyright (C) 2003-2007 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: BlockFix_PeriodicSurfaceModifier.cdl
|
||||
-- Created: Wed Dec 15 10:03:50 2004
|
||||
-- Author: Sergey KUUL
|
||||
--
|
||||
class PeriodicSurfaceModifier from BlockFix inherits Modification from BRepTools
|
||||
|
||||
---Purpose:
|
||||
|
||||
uses
|
||||
Vertex from TopoDS,
|
||||
Edge from TopoDS,
|
||||
Face from TopoDS,
|
||||
Location from TopLoc,
|
||||
Shape from GeomAbs,
|
||||
Pnt from gp,
|
||||
Curve from Geom,
|
||||
Curve from Geom2d,
|
||||
Surface from Geom,
|
||||
IndexedMapOfTransient from TColStd,
|
||||
DataMapOfShapeInteger from TopTools
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable PeriodicSurfaceModifier from BlockFix;
|
||||
|
||||
SetTolerance(me: mutable; Toler: Real);
|
||||
---Purpose: Sets the tolerance for recognition of geometry
|
||||
|
||||
NewSurface(me: mutable; F : Face from TopoDS;
|
||||
S : out Surface from Geom;
|
||||
L : out Location from TopLoc;
|
||||
Tol: out Real from Standard;
|
||||
RevWires : out Boolean from Standard;
|
||||
RevFace : out Boolean from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the face <F> has been
|
||||
-- modified. In this case, <S> is the new geometric
|
||||
-- support of the face, <L> the new location, <Tol>
|
||||
-- the new tolerance. Otherwise, returns
|
||||
-- Standard_False, and <S>, <L>, <Tol> are not
|
||||
-- significant.
|
||||
|
||||
NewCurve(me: mutable; E : Edge from TopoDS;
|
||||
C : out Curve from Geom;
|
||||
L : out Location from TopLoc;
|
||||
Tol: out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the edge <E> has been
|
||||
-- modified. In this case, <C> is the new geometric
|
||||
-- support of the edge, <L> the new location, <Tol>
|
||||
-- the new tolerance. Otherwise, returns
|
||||
-- Standard_False, and <C>, <L>, <Tol> are not
|
||||
-- significant.
|
||||
|
||||
NewPoint(me: mutable; V : Vertex from TopoDS;
|
||||
P : out Pnt from gp;
|
||||
Tol: out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the vertex <V> has been
|
||||
-- modified. In this case, <P> is the new geometric
|
||||
-- support of the vertex, <Tol> the new tolerance.
|
||||
-- Otherwise, returns Standard_False, and <P>, <Tol>
|
||||
-- are not significant.
|
||||
|
||||
NewCurve2d(me: mutable; E : Edge from TopoDS;
|
||||
F : Face from TopoDS;
|
||||
NewE : Edge from TopoDS;
|
||||
NewF : Face from TopoDS;
|
||||
C : out Curve from Geom2d;
|
||||
Tol : out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the edge <E> has a new
|
||||
-- curve on surface on the face <F>.In this case, <C>
|
||||
-- is the new geometric support of the edge, <L> the
|
||||
-- new location, <Tol> the new tolerance.
|
||||
--
|
||||
-- Otherwise, returns Standard_False, and <C>, <L>,
|
||||
-- <Tol> are not significant.
|
||||
--
|
||||
-- <NewE> is the new edge created from <E>. <NewF>
|
||||
-- is the new face created from <F>. They may be usefull.
|
||||
|
||||
NewParameter(me: mutable; V : Vertex from TopoDS;
|
||||
E : Edge from TopoDS;
|
||||
P : out Real from Standard;
|
||||
Tol: out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the Vertex <V> has a new
|
||||
-- parameter on the edge <E>. In this case, <P> is
|
||||
-- the parameter, <Tol> the new tolerance.
|
||||
-- Otherwise, returns Standard_False, and <P>, <Tol>
|
||||
-- are not significant.
|
||||
|
||||
Continuity(me: mutable; E : Edge from TopoDS;
|
||||
F1,F2 : Face from TopoDS;
|
||||
NewE : Edge from TopoDS;
|
||||
NewF1,NewF2: Face from TopoDS)
|
||||
returns Shape from GeomAbs;
|
||||
---Purpose: Returns the continuity of <NewE> between <NewF1>
|
||||
-- and <NewF2>.
|
||||
--
|
||||
-- <NewE> is the new edge created from <E>. <NewF1>
|
||||
-- (resp. <NewF2>) is the new face created from <F1>
|
||||
-- (resp. <F2>).
|
||||
|
||||
|
||||
fields
|
||||
|
||||
myTolerance : Real;
|
||||
myMapOfFaces : DataMapOfShapeInteger from TopTools;
|
||||
myMapOfSurfaces: IndexedMapOfTransient from TColStd;
|
||||
|
||||
end PeriodicSurfaceModifier;
|
@ -1,140 +0,0 @@
|
||||
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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 _BlockFix_PeriodicSurfaceModifier_HeaderFile
|
||||
#define _BlockFix_PeriodicSurfaceModifier_HeaderFile
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_BlockFix_PeriodicSurfaceModifier_HeaderFile
|
||||
#include <Handle_BlockFix_PeriodicSurfaceModifier.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef _Standard_Real_HeaderFile
|
||||
#include <Standard_Real.hxx>
|
||||
#endif
|
||||
#ifndef _TopTools_DataMapOfShapeInteger_HeaderFile
|
||||
#include <TopTools_DataMapOfShapeInteger.hxx>
|
||||
#endif
|
||||
#ifndef _TColStd_IndexedMapOfTransient_HeaderFile
|
||||
#include <TColStd_IndexedMapOfTransient.hxx>
|
||||
#endif
|
||||
#ifndef _BRepTools_Modification_HeaderFile
|
||||
#include <BRepTools_Modification.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Boolean_HeaderFile
|
||||
#include <Standard_Boolean.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_Geom_Surface_HeaderFile
|
||||
#include <Handle_Geom_Surface.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_Geom_Curve_HeaderFile
|
||||
#include <Handle_Geom_Curve.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_Geom2d_Curve_HeaderFile
|
||||
#include <Handle_Geom2d_Curve.hxx>
|
||||
#endif
|
||||
#ifndef _GeomAbs_Shape_HeaderFile
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#endif
|
||||
class TopoDS_Face;
|
||||
class Geom_Surface;
|
||||
class TopLoc_Location;
|
||||
class TopoDS_Edge;
|
||||
class Geom_Curve;
|
||||
class TopoDS_Vertex;
|
||||
class gp_Pnt;
|
||||
class Geom2d_Curve;
|
||||
|
||||
|
||||
class BlockFix_PeriodicSurfaceModifier : public BRepTools_Modification {
|
||||
|
||||
public:
|
||||
|
||||
void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
// Methods PUBLIC
|
||||
//
|
||||
Standard_EXPORT BlockFix_PeriodicSurfaceModifier();
|
||||
Standard_EXPORT void SetTolerance(const Standard_Real Toler) ;
|
||||
Standard_EXPORT Standard_Boolean NewSurface(const TopoDS_Face& F,Handle(Geom_Surface)& S,TopLoc_Location& L,Standard_Real& Tol,Standard_Boolean& RevWires,Standard_Boolean& RevFace) ;
|
||||
Standard_EXPORT Standard_Boolean NewCurve(const TopoDS_Edge& E,Handle(Geom_Curve)& C,TopLoc_Location& L,Standard_Real& Tol) ;
|
||||
Standard_EXPORT Standard_Boolean NewPoint(const TopoDS_Vertex& V,gp_Pnt& P,Standard_Real& Tol) ;
|
||||
Standard_EXPORT Standard_Boolean NewCurve2d(const TopoDS_Edge& E,const TopoDS_Face& F,const TopoDS_Edge& NewE,const TopoDS_Face& NewF,Handle(Geom2d_Curve)& C,Standard_Real& Tol) ;
|
||||
Standard_EXPORT Standard_Boolean NewParameter(const TopoDS_Vertex& V,const TopoDS_Edge& E,Standard_Real& P,Standard_Real& Tol) ;
|
||||
Standard_EXPORT GeomAbs_Shape Continuity(const TopoDS_Edge& E,const TopoDS_Face& F1,const TopoDS_Face& F2,const TopoDS_Edge& NewE,const TopoDS_Face& NewF1,const TopoDS_Face& NewF2) ;
|
||||
Standard_EXPORT ~BlockFix_PeriodicSurfaceModifier();
|
||||
|
||||
|
||||
|
||||
|
||||
// Type management
|
||||
//
|
||||
Standard_EXPORT friend Handle_Standard_Type& BlockFix_PeriodicSurfaceModifier_Type_();
|
||||
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
|
||||
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
|
||||
|
||||
protected:
|
||||
|
||||
// Methods PROTECTED
|
||||
//
|
||||
|
||||
|
||||
// Fields PROTECTED
|
||||
//
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Methods PRIVATE
|
||||
//
|
||||
|
||||
|
||||
// Fields PRIVATE
|
||||
//
|
||||
Standard_Real myTolerance;
|
||||
TopTools_DataMapOfShapeInteger myMapOfFaces;
|
||||
TColStd_IndexedMapOfTransient myMapOfSurfaces;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// other Inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
@ -1,79 +0,0 @@
|
||||
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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
|
||||
//
|
||||
|
||||
#include <BlockFix_PeriodicSurfaceModifier.jxx>
|
||||
|
||||
#ifndef _Standard_TypeMismatch_HeaderFile
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#endif
|
||||
|
||||
BlockFix_PeriodicSurfaceModifier::~BlockFix_PeriodicSurfaceModifier() {}
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT Handle_Standard_Type& BlockFix_PeriodicSurfaceModifier_Type_()
|
||||
{
|
||||
|
||||
static Handle_Standard_Type aType1 = STANDARD_TYPE(BRepTools_Modification);
|
||||
if ( aType1.IsNull()) aType1 = STANDARD_TYPE(BRepTools_Modification);
|
||||
static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
|
||||
if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared);
|
||||
static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
|
||||
if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
|
||||
|
||||
|
||||
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
|
||||
static Handle_Standard_Type _aType = new Standard_Type("BlockFix_PeriodicSurfaceModifier",
|
||||
sizeof(BlockFix_PeriodicSurfaceModifier),
|
||||
1,
|
||||
(Standard_Address)_Ancestors,
|
||||
(Standard_Address)NULL);
|
||||
|
||||
return _aType;
|
||||
}
|
||||
|
||||
|
||||
// DownCast method
|
||||
// allow safe downcasting
|
||||
//
|
||||
const Handle(BlockFix_PeriodicSurfaceModifier) Handle(BlockFix_PeriodicSurfaceModifier)::DownCast(const Handle(Standard_Transient)& AnObject)
|
||||
{
|
||||
Handle(BlockFix_PeriodicSurfaceModifier) _anOtherObject;
|
||||
|
||||
if (!AnObject.IsNull()) {
|
||||
if (AnObject->IsKind(STANDARD_TYPE(BlockFix_PeriodicSurfaceModifier))) {
|
||||
_anOtherObject = Handle(BlockFix_PeriodicSurfaceModifier)((Handle(BlockFix_PeriodicSurfaceModifier)&)AnObject);
|
||||
}
|
||||
}
|
||||
|
||||
return _anOtherObject ;
|
||||
}
|
||||
const Handle(Standard_Type)& BlockFix_PeriodicSurfaceModifier::DynamicType() const
|
||||
{
|
||||
return STANDARD_TYPE(BlockFix_PeriodicSurfaceModifier) ;
|
||||
}
|
||||
Standard_Boolean BlockFix_PeriodicSurfaceModifier::IsKind(const Handle(Standard_Type)& AType) const
|
||||
{
|
||||
return (STANDARD_TYPE(BlockFix_PeriodicSurfaceModifier) == AType || BRepTools_Modification::IsKind(AType));
|
||||
}
|
||||
Handle_BlockFix_PeriodicSurfaceModifier::~Handle_BlockFix_PeriodicSurfaceModifier() {}
|
||||
|
@ -1,49 +0,0 @@
|
||||
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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 _TopoDS_Face_HeaderFile
|
||||
#include <TopoDS_Face.hxx>
|
||||
#endif
|
||||
#ifndef _Geom_Surface_HeaderFile
|
||||
#include <Geom_Surface.hxx>
|
||||
#endif
|
||||
#ifndef _TopLoc_Location_HeaderFile
|
||||
#include <TopLoc_Location.hxx>
|
||||
#endif
|
||||
#ifndef _TopoDS_Edge_HeaderFile
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#endif
|
||||
#ifndef _Geom_Curve_HeaderFile
|
||||
#include <Geom_Curve.hxx>
|
||||
#endif
|
||||
#ifndef _TopoDS_Vertex_HeaderFile
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#endif
|
||||
#ifndef _gp_Pnt_HeaderFile
|
||||
#include <gp_Pnt.hxx>
|
||||
#endif
|
||||
#ifndef _Geom2d_Curve_HeaderFile
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#endif
|
||||
#ifndef _BlockFix_PeriodicSurfaceModifier_HeaderFile
|
||||
#include <BlockFix_PeriodicSurfaceModifier.hxx>
|
||||
#endif
|
@ -1,139 +0,0 @@
|
||||
-- Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
--
|
||||
-- Copyright (C) 2003-2007 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: BlockFix_SphereSpaceModifier.cdl
|
||||
-- Created: Tue Dec 7 12:01:49 2004
|
||||
-- Author: Pavel Durandin
|
||||
--
|
||||
class SphereSpaceModifier from BlockFix inherits Modification from BRepTools
|
||||
|
||||
---Purpose: Rotation of the parametric space of the sphere in order
|
||||
-- to avoid the seam and degenerared edge within it
|
||||
|
||||
uses
|
||||
Vertex from TopoDS,
|
||||
Edge from TopoDS,
|
||||
Face from TopoDS,
|
||||
Location from TopLoc,
|
||||
Shape from GeomAbs,
|
||||
Pnt from gp,
|
||||
Curve from Geom,
|
||||
Curve from Geom2d,
|
||||
Surface from Geom,
|
||||
IndexedMapOfTransient from TColStd,
|
||||
DataMapOfShapeInteger from TopTools
|
||||
|
||||
is
|
||||
|
||||
Create returns mutable SphereSpaceModifier from BlockFix;
|
||||
|
||||
SetTolerance(me: mutable; Toler: Real);
|
||||
---Purpose: Sets the tolerance for recognition of geometry
|
||||
|
||||
NewSurface(me: mutable; F : Face from TopoDS;
|
||||
S : out Surface from Geom;
|
||||
L : out Location from TopLoc;
|
||||
Tol: out Real from Standard;
|
||||
RevWires : out Boolean from Standard;
|
||||
RevFace : out Boolean from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the face <F> has been
|
||||
-- modified. In this case, <S> is the new geometric
|
||||
-- support of the face, <L> the new location, <Tol>
|
||||
-- the new tolerance. Otherwise, returns
|
||||
-- Standard_False, and <S>, <L>, <Tol> are not
|
||||
-- significant.
|
||||
|
||||
NewCurve(me: mutable; E : Edge from TopoDS;
|
||||
C : out Curve from Geom;
|
||||
L : out Location from TopLoc;
|
||||
Tol: out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the edge <E> has been
|
||||
-- modified. In this case, <C> is the new geometric
|
||||
-- support of the edge, <L> the new location, <Tol>
|
||||
-- the new tolerance. Otherwise, returns
|
||||
-- Standard_False, and <C>, <L>, <Tol> are not
|
||||
-- significant.
|
||||
|
||||
NewPoint(me: mutable; V : Vertex from TopoDS;
|
||||
P : out Pnt from gp;
|
||||
Tol: out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the vertex <V> has been
|
||||
-- modified. In this case, <P> is the new geometric
|
||||
-- support of the vertex, <Tol> the new tolerance.
|
||||
-- Otherwise, returns Standard_False, and <P>, <Tol>
|
||||
-- are not significant.
|
||||
|
||||
NewCurve2d(me: mutable; E : Edge from TopoDS;
|
||||
F : Face from TopoDS;
|
||||
NewE : Edge from TopoDS;
|
||||
NewF : Face from TopoDS;
|
||||
C : out Curve from Geom2d;
|
||||
Tol : out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the edge <E> has a new
|
||||
-- curve on surface on the face <F>.In this case, <C>
|
||||
-- is the new geometric support of the edge, <L> the
|
||||
-- new location, <Tol> the new tolerance.
|
||||
--
|
||||
-- Otherwise, returns Standard_False, and <C>, <L>,
|
||||
-- <Tol> are not significant.
|
||||
--
|
||||
-- <NewE> is the new edge created from <E>. <NewF>
|
||||
-- is the new face created from <F>. They may be usefull.
|
||||
|
||||
NewParameter(me: mutable; V : Vertex from TopoDS;
|
||||
E : Edge from TopoDS;
|
||||
P : out Real from Standard;
|
||||
Tol: out Real from Standard)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns Standard_True if the Vertex <V> has a new
|
||||
-- parameter on the edge <E>. In this case, <P> is
|
||||
-- the parameter, <Tol> the new tolerance.
|
||||
-- Otherwise, returns Standard_False, and <P>, <Tol>
|
||||
-- are not significant.
|
||||
|
||||
Continuity(me: mutable; E : Edge from TopoDS;
|
||||
F1,F2 : Face from TopoDS;
|
||||
NewE : Edge from TopoDS;
|
||||
NewF1,NewF2: Face from TopoDS)
|
||||
returns Shape from GeomAbs;
|
||||
---Purpose: Returns the continuity of <NewE> between <NewF1>
|
||||
-- and <NewF2>.
|
||||
--
|
||||
-- <NewE> is the new edge created from <E>. <NewF1>
|
||||
-- (resp. <NewF2>) is the new face created from <F1>
|
||||
-- (resp. <F2>).
|
||||
|
||||
ForRotation(me: mutable; F: Face from TopoDS) returns Boolean;
|
||||
|
||||
fields
|
||||
|
||||
myTolerance : Real;
|
||||
myMapOfFaces : DataMapOfShapeInteger from TopTools;
|
||||
myMapOfSpheres: IndexedMapOfTransient from TColStd;
|
||||
--myMapOfGeom: MapOfShapeTransient from TColStd;
|
||||
|
||||
end SphereSpaceModifier;
|
||||
|
@ -1,141 +0,0 @@
|
||||
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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 _BlockFix_SphereSpaceModifier_HeaderFile
|
||||
#define _BlockFix_SphereSpaceModifier_HeaderFile
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_BlockFix_SphereSpaceModifier_HeaderFile
|
||||
#include <Handle_BlockFix_SphereSpaceModifier.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef _Standard_Real_HeaderFile
|
||||
#include <Standard_Real.hxx>
|
||||
#endif
|
||||
#ifndef _TopTools_DataMapOfShapeInteger_HeaderFile
|
||||
#include <TopTools_DataMapOfShapeInteger.hxx>
|
||||
#endif
|
||||
#ifndef _TColStd_IndexedMapOfTransient_HeaderFile
|
||||
#include <TColStd_IndexedMapOfTransient.hxx>
|
||||
#endif
|
||||
#ifndef _BRepTools_Modification_HeaderFile
|
||||
#include <BRepTools_Modification.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Boolean_HeaderFile
|
||||
#include <Standard_Boolean.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_Geom_Surface_HeaderFile
|
||||
#include <Handle_Geom_Surface.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_Geom_Curve_HeaderFile
|
||||
#include <Handle_Geom_Curve.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_Geom2d_Curve_HeaderFile
|
||||
#include <Handle_Geom2d_Curve.hxx>
|
||||
#endif
|
||||
#ifndef _GeomAbs_Shape_HeaderFile
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#endif
|
||||
class TopoDS_Face;
|
||||
class Geom_Surface;
|
||||
class TopLoc_Location;
|
||||
class TopoDS_Edge;
|
||||
class Geom_Curve;
|
||||
class TopoDS_Vertex;
|
||||
class gp_Pnt;
|
||||
class Geom2d_Curve;
|
||||
|
||||
|
||||
class BlockFix_SphereSpaceModifier : public BRepTools_Modification {
|
||||
|
||||
public:
|
||||
|
||||
void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
// Methods PUBLIC
|
||||
//
|
||||
Standard_EXPORT BlockFix_SphereSpaceModifier();
|
||||
Standard_EXPORT void SetTolerance(const Standard_Real Toler) ;
|
||||
Standard_EXPORT Standard_Boolean NewSurface(const TopoDS_Face& F,Handle(Geom_Surface)& S,TopLoc_Location& L,Standard_Real& Tol,Standard_Boolean& RevWires,Standard_Boolean& RevFace) ;
|
||||
Standard_EXPORT Standard_Boolean NewCurve(const TopoDS_Edge& E,Handle(Geom_Curve)& C,TopLoc_Location& L,Standard_Real& Tol) ;
|
||||
Standard_EXPORT Standard_Boolean NewPoint(const TopoDS_Vertex& V,gp_Pnt& P,Standard_Real& Tol) ;
|
||||
Standard_EXPORT Standard_Boolean NewCurve2d(const TopoDS_Edge& E,const TopoDS_Face& F,const TopoDS_Edge& NewE,const TopoDS_Face& NewF,Handle(Geom2d_Curve)& C,Standard_Real& Tol) ;
|
||||
Standard_EXPORT Standard_Boolean NewParameter(const TopoDS_Vertex& V,const TopoDS_Edge& E,Standard_Real& P,Standard_Real& Tol) ;
|
||||
Standard_EXPORT GeomAbs_Shape Continuity(const TopoDS_Edge& E,const TopoDS_Face& F1,const TopoDS_Face& F2,const TopoDS_Edge& NewE,const TopoDS_Face& NewF1,const TopoDS_Face& NewF2) ;
|
||||
Standard_EXPORT Standard_Boolean ForRotation(const TopoDS_Face& F) ;
|
||||
Standard_EXPORT ~BlockFix_SphereSpaceModifier();
|
||||
|
||||
|
||||
|
||||
|
||||
// Type management
|
||||
//
|
||||
Standard_EXPORT friend Handle_Standard_Type& BlockFix_SphereSpaceModifier_Type_();
|
||||
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
|
||||
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
|
||||
|
||||
protected:
|
||||
|
||||
// Methods PROTECTED
|
||||
//
|
||||
|
||||
|
||||
// Fields PROTECTED
|
||||
//
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Methods PRIVATE
|
||||
//
|
||||
|
||||
|
||||
// Fields PRIVATE
|
||||
//
|
||||
Standard_Real myTolerance;
|
||||
TopTools_DataMapOfShapeInteger myMapOfFaces;
|
||||
TColStd_IndexedMapOfTransient myMapOfSpheres;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// other Inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
@ -1,79 +0,0 @@
|
||||
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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
|
||||
//
|
||||
|
||||
#include <BlockFix_SphereSpaceModifier.jxx>
|
||||
|
||||
#ifndef _Standard_TypeMismatch_HeaderFile
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#endif
|
||||
|
||||
BlockFix_SphereSpaceModifier::~BlockFix_SphereSpaceModifier() {}
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT Handle_Standard_Type& BlockFix_SphereSpaceModifier_Type_()
|
||||
{
|
||||
|
||||
static Handle_Standard_Type aType1 = STANDARD_TYPE(BRepTools_Modification);
|
||||
if ( aType1.IsNull()) aType1 = STANDARD_TYPE(BRepTools_Modification);
|
||||
static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
|
||||
if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared);
|
||||
static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
|
||||
if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
|
||||
|
||||
|
||||
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
|
||||
static Handle_Standard_Type _aType = new Standard_Type("BlockFix_SphereSpaceModifier",
|
||||
sizeof(BlockFix_SphereSpaceModifier),
|
||||
1,
|
||||
(Standard_Address)_Ancestors,
|
||||
(Standard_Address)NULL);
|
||||
|
||||
return _aType;
|
||||
}
|
||||
|
||||
|
||||
// DownCast method
|
||||
// allow safe downcasting
|
||||
//
|
||||
const Handle(BlockFix_SphereSpaceModifier) Handle(BlockFix_SphereSpaceModifier)::DownCast(const Handle(Standard_Transient)& AnObject)
|
||||
{
|
||||
Handle(BlockFix_SphereSpaceModifier) _anOtherObject;
|
||||
|
||||
if (!AnObject.IsNull()) {
|
||||
if (AnObject->IsKind(STANDARD_TYPE(BlockFix_SphereSpaceModifier))) {
|
||||
_anOtherObject = Handle(BlockFix_SphereSpaceModifier)((Handle(BlockFix_SphereSpaceModifier)&)AnObject);
|
||||
}
|
||||
}
|
||||
|
||||
return _anOtherObject ;
|
||||
}
|
||||
const Handle(Standard_Type)& BlockFix_SphereSpaceModifier::DynamicType() const
|
||||
{
|
||||
return STANDARD_TYPE(BlockFix_SphereSpaceModifier) ;
|
||||
}
|
||||
Standard_Boolean BlockFix_SphereSpaceModifier::IsKind(const Handle(Standard_Type)& AType) const
|
||||
{
|
||||
return (STANDARD_TYPE(BlockFix_SphereSpaceModifier) == AType || BRepTools_Modification::IsKind(AType));
|
||||
}
|
||||
Handle_BlockFix_SphereSpaceModifier::~Handle_BlockFix_SphereSpaceModifier() {}
|
||||
|
@ -1,49 +0,0 @@
|
||||
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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 _TopoDS_Face_HeaderFile
|
||||
#include <TopoDS_Face.hxx>
|
||||
#endif
|
||||
#ifndef _Geom_Surface_HeaderFile
|
||||
#include <Geom_Surface.hxx>
|
||||
#endif
|
||||
#ifndef _TopLoc_Location_HeaderFile
|
||||
#include <TopLoc_Location.hxx>
|
||||
#endif
|
||||
#ifndef _TopoDS_Edge_HeaderFile
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#endif
|
||||
#ifndef _Geom_Curve_HeaderFile
|
||||
#include <Geom_Curve.hxx>
|
||||
#endif
|
||||
#ifndef _TopoDS_Vertex_HeaderFile
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#endif
|
||||
#ifndef _gp_Pnt_HeaderFile
|
||||
#include <gp_Pnt.hxx>
|
||||
#endif
|
||||
#ifndef _Geom2d_Curve_HeaderFile
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#endif
|
||||
#ifndef _BlockFix_SphereSpaceModifier_HeaderFile
|
||||
#include <BlockFix_SphereSpaceModifier.hxx>
|
||||
#endif
|
@ -1,49 +0,0 @@
|
||||
-- Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
--
|
||||
-- Copyright (C) 2003-2007 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: BlockFix_UnionEdges.cdl
|
||||
-- Created: Tue Dec 7 15:24:51 2004
|
||||
-- Author: Sergey KUUL
|
||||
--
|
||||
class UnionEdges from BlockFix
|
||||
|
||||
---Purpose:
|
||||
|
||||
uses
|
||||
|
||||
Shape from TopoDS,
|
||||
ReShape from ShapeBuild
|
||||
|
||||
is
|
||||
|
||||
Create returns UnionEdges from BlockFix;
|
||||
|
||||
Perform(me: in out; Shape: Shape from TopoDS;
|
||||
Tol : Real)
|
||||
returns Shape from TopoDS;
|
||||
|
||||
fields
|
||||
|
||||
myTolerance : Real;
|
||||
myContext : ReShape from ShapeBuild;
|
||||
|
||||
end UnionEdges;
|
@ -1,100 +0,0 @@
|
||||
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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 _BlockFix_UnionEdges_HeaderFile
|
||||
#define _BlockFix_UnionEdges_HeaderFile
|
||||
|
||||
#ifndef _Standard_Real_HeaderFile
|
||||
#include <Standard_Real.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_ShapeBuild_ReShape_HeaderFile
|
||||
#include <Handle_ShapeBuild_ReShape.hxx>
|
||||
#endif
|
||||
class ShapeBuild_ReShape;
|
||||
class TopoDS_Shape;
|
||||
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Macro_HeaderFile
|
||||
#include <Standard_Macro.hxx>
|
||||
#endif
|
||||
|
||||
class BlockFix_UnionEdges {
|
||||
|
||||
public:
|
||||
|
||||
void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
// Methods PUBLIC
|
||||
//
|
||||
Standard_EXPORT BlockFix_UnionEdges();
|
||||
Standard_EXPORT TopoDS_Shape Perform(const TopoDS_Shape& Shape,const Standard_Real Tol) ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Methods PROTECTED
|
||||
//
|
||||
|
||||
|
||||
// Fields PROTECTED
|
||||
//
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Methods PRIVATE
|
||||
//
|
||||
|
||||
|
||||
// Fields PRIVATE
|
||||
//
|
||||
Standard_Real myTolerance;
|
||||
Handle_ShapeBuild_ReShape myContext;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// other Inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
@ -1,27 +0,0 @@
|
||||
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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
|
||||
//
|
||||
|
||||
#include <BlockFix_UnionEdges.jxx>
|
||||
|
||||
|
||||
|
||||
|
@ -1,65 +0,0 @@
|
||||
-- Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
--
|
||||
-- Copyright (C) 2003-2007 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: BlockFix_UnionFaces.cdl
|
||||
-- Created: Tue Dec 7 17:15:42 2004
|
||||
-- Author: Pavel Durandin
|
||||
--
|
||||
class UnionFaces from BlockFix
|
||||
|
||||
uses
|
||||
|
||||
Face from TopoDS,
|
||||
Shape from TopoDS
|
||||
|
||||
is
|
||||
|
||||
Create returns UnionFaces from BlockFix;
|
||||
---Purpose: Empty constructor
|
||||
|
||||
GetTolerance(me: in out) returns Real;
|
||||
---Purpose: Returns modifiable tolerance
|
||||
---C++: return&
|
||||
|
||||
Perform (me: in out; Shape: Shape from TopoDS) returns Shape from TopoDS;
|
||||
---Purpose: Performs the unification of the fsces
|
||||
-- whith the same geometry
|
||||
|
||||
IsSameDomain(me; aFace : Face from TopoDS;
|
||||
aChekedFace: Face from TopoDS)
|
||||
returns Boolean is virtual;
|
||||
---Purpose: Returns true is surfaces have same geometrically domain
|
||||
-- with given tolerance
|
||||
|
||||
MovePCurves(me; aTarget: in out Face from TopoDS;
|
||||
aSource: Face from TopoDS)
|
||||
is virtual;
|
||||
---Purpose: Creates pcurves on aTarget face for each edge from
|
||||
-- aSource one.
|
||||
|
||||
fields
|
||||
|
||||
myTolerance: Real;
|
||||
|
||||
end;
|
||||
|
||||
|
@ -1,27 +0,0 @@
|
||||
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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
|
||||
//
|
||||
|
||||
#include <BlockFix_UnionFaces.jxx>
|
||||
|
||||
|
||||
|
||||
|
@ -1,31 +0,0 @@
|
||||
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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 _TopoDS_Shape_HeaderFile
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#endif
|
||||
#ifndef _TopoDS_Face_HeaderFile
|
||||
#include <TopoDS_Face.hxx>
|
||||
#endif
|
||||
#ifndef _BlockFix_UnionFaces_HeaderFile
|
||||
#include <BlockFix_UnionFaces.hxx>
|
||||
#endif
|
@ -140,30 +140,3 @@ GEOMAlgo_IndexedDataMapOfShapeShapeInfo.hxx
|
||||
GEOMAlgo_IndexedDataMapOfShapeState.hxx
|
||||
GEOMAlgo_IndexedDataMapOfIntegerShape.hxx
|
||||
GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,92 +0,0 @@
|
||||
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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_BlockFix_BlockFixAPI_HeaderFile
|
||||
#define _Handle_BlockFix_BlockFixAPI_HeaderFile
|
||||
|
||||
#ifndef _Standard_Macro_HeaderFile
|
||||
#include <Standard_Macro.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef _Handle_MMgt_TShared_HeaderFile
|
||||
#include <Handle_MMgt_TShared.hxx>
|
||||
#endif
|
||||
|
||||
class Standard_Transient;
|
||||
class Handle_Standard_Type;
|
||||
class Handle(MMgt_TShared);
|
||||
class BlockFix_BlockFixAPI;
|
||||
Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(BlockFix_BlockFixAPI);
|
||||
|
||||
class Handle(BlockFix_BlockFixAPI) : public Handle(MMgt_TShared) {
|
||||
public:
|
||||
void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
Handle(BlockFix_BlockFixAPI)():Handle(MMgt_TShared)() {}
|
||||
Handle(BlockFix_BlockFixAPI)(const Handle(BlockFix_BlockFixAPI)& aHandle) : Handle(MMgt_TShared)(aHandle)
|
||||
{
|
||||
}
|
||||
|
||||
Handle(BlockFix_BlockFixAPI)(const BlockFix_BlockFixAPI* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem)
|
||||
{
|
||||
}
|
||||
|
||||
Handle(BlockFix_BlockFixAPI)& operator=(const Handle(BlockFix_BlockFixAPI)& aHandle)
|
||||
{
|
||||
Assign(aHandle.Access());
|
||||
return *this;
|
||||
}
|
||||
|
||||
Handle(BlockFix_BlockFixAPI)& operator=(const BlockFix_BlockFixAPI* anItem)
|
||||
{
|
||||
Assign((Standard_Transient *)anItem);
|
||||
return *this;
|
||||
}
|
||||
|
||||
BlockFix_BlockFixAPI* operator->()
|
||||
{
|
||||
return (BlockFix_BlockFixAPI *)ControlAccess();
|
||||
}
|
||||
|
||||
BlockFix_BlockFixAPI* operator->() const
|
||||
{
|
||||
return (BlockFix_BlockFixAPI *)ControlAccess();
|
||||
}
|
||||
|
||||
Standard_EXPORT ~Handle(BlockFix_BlockFixAPI)();
|
||||
|
||||
Standard_EXPORT static const Handle(BlockFix_BlockFixAPI) DownCast(const Handle(Standard_Transient)& AnObject);
|
||||
};
|
||||
#endif
|
@ -1,92 +0,0 @@
|
||||
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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_BlockFix_PeriodicSurfaceModifier_HeaderFile
|
||||
#define _Handle_BlockFix_PeriodicSurfaceModifier_HeaderFile
|
||||
|
||||
#ifndef _Standard_Macro_HeaderFile
|
||||
#include <Standard_Macro.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef _Handle_BRepTools_Modification_HeaderFile
|
||||
#include <Handle_BRepTools_Modification.hxx>
|
||||
#endif
|
||||
|
||||
class Standard_Transient;
|
||||
class Handle_Standard_Type;
|
||||
class Handle(BRepTools_Modification);
|
||||
class BlockFix_PeriodicSurfaceModifier;
|
||||
Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(BlockFix_PeriodicSurfaceModifier);
|
||||
|
||||
class Handle(BlockFix_PeriodicSurfaceModifier) : public Handle(BRepTools_Modification) {
|
||||
public:
|
||||
void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
Handle(BlockFix_PeriodicSurfaceModifier)():Handle(BRepTools_Modification)() {}
|
||||
Handle(BlockFix_PeriodicSurfaceModifier)(const Handle(BlockFix_PeriodicSurfaceModifier)& aHandle) : Handle(BRepTools_Modification)(aHandle)
|
||||
{
|
||||
}
|
||||
|
||||
Handle(BlockFix_PeriodicSurfaceModifier)(const BlockFix_PeriodicSurfaceModifier* anItem) : Handle(BRepTools_Modification)((BRepTools_Modification *)anItem)
|
||||
{
|
||||
}
|
||||
|
||||
Handle(BlockFix_PeriodicSurfaceModifier)& operator=(const Handle(BlockFix_PeriodicSurfaceModifier)& aHandle)
|
||||
{
|
||||
Assign(aHandle.Access());
|
||||
return *this;
|
||||
}
|
||||
|
||||
Handle(BlockFix_PeriodicSurfaceModifier)& operator=(const BlockFix_PeriodicSurfaceModifier* anItem)
|
||||
{
|
||||
Assign((Standard_Transient *)anItem);
|
||||
return *this;
|
||||
}
|
||||
|
||||
BlockFix_PeriodicSurfaceModifier* operator->()
|
||||
{
|
||||
return (BlockFix_PeriodicSurfaceModifier *)ControlAccess();
|
||||
}
|
||||
|
||||
BlockFix_PeriodicSurfaceModifier* operator->() const
|
||||
{
|
||||
return (BlockFix_PeriodicSurfaceModifier *)ControlAccess();
|
||||
}
|
||||
|
||||
Standard_EXPORT ~Handle(BlockFix_PeriodicSurfaceModifier)();
|
||||
|
||||
Standard_EXPORT static const Handle(BlockFix_PeriodicSurfaceModifier) DownCast(const Handle(Standard_Transient)& AnObject);
|
||||
};
|
||||
#endif
|
@ -1,92 +0,0 @@
|
||||
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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_BlockFix_SphereSpaceModifier_HeaderFile
|
||||
#define _Handle_BlockFix_SphereSpaceModifier_HeaderFile
|
||||
|
||||
#ifndef _Standard_Macro_HeaderFile
|
||||
#include <Standard_Macro.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef _Handle_BRepTools_Modification_HeaderFile
|
||||
#include <Handle_BRepTools_Modification.hxx>
|
||||
#endif
|
||||
|
||||
class Standard_Transient;
|
||||
class Handle_Standard_Type;
|
||||
class Handle(BRepTools_Modification);
|
||||
class BlockFix_SphereSpaceModifier;
|
||||
Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(BlockFix_SphereSpaceModifier);
|
||||
|
||||
class Handle(BlockFix_SphereSpaceModifier) : public Handle(BRepTools_Modification) {
|
||||
public:
|
||||
void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
Handle(BlockFix_SphereSpaceModifier)():Handle(BRepTools_Modification)() {}
|
||||
Handle(BlockFix_SphereSpaceModifier)(const Handle(BlockFix_SphereSpaceModifier)& aHandle) : Handle(BRepTools_Modification)(aHandle)
|
||||
{
|
||||
}
|
||||
|
||||
Handle(BlockFix_SphereSpaceModifier)(const BlockFix_SphereSpaceModifier* anItem) : Handle(BRepTools_Modification)((BRepTools_Modification *)anItem)
|
||||
{
|
||||
}
|
||||
|
||||
Handle(BlockFix_SphereSpaceModifier)& operator=(const Handle(BlockFix_SphereSpaceModifier)& aHandle)
|
||||
{
|
||||
Assign(aHandle.Access());
|
||||
return *this;
|
||||
}
|
||||
|
||||
Handle(BlockFix_SphereSpaceModifier)& operator=(const BlockFix_SphereSpaceModifier* anItem)
|
||||
{
|
||||
Assign((Standard_Transient *)anItem);
|
||||
return *this;
|
||||
}
|
||||
|
||||
BlockFix_SphereSpaceModifier* operator->()
|
||||
{
|
||||
return (BlockFix_SphereSpaceModifier *)ControlAccess();
|
||||
}
|
||||
|
||||
BlockFix_SphereSpaceModifier* operator->() const
|
||||
{
|
||||
return (BlockFix_SphereSpaceModifier *)ControlAccess();
|
||||
}
|
||||
|
||||
Standard_EXPORT ~Handle(BlockFix_SphereSpaceModifier)();
|
||||
|
||||
Standard_EXPORT static const Handle(BlockFix_SphereSpaceModifier) DownCast(const Handle(Standard_Transient)& AnObject);
|
||||
};
|
||||
#endif
|
@ -15,7 +15,6 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
#
|
||||
|
||||
# GEOM GEOMAlgo : tools for Glue Faces algorithm
|
||||
# File : Makefile.am
|
||||
@ -28,13 +27,6 @@ include $(top_srcdir)/adm_local/unix/make_common_starter.am
|
||||
lib_LTLIBRARIES = libGEOMAlgo.la
|
||||
|
||||
dist_libGEOMAlgo_la_SOURCES = \
|
||||
BlockFix_BlockFixAPI.cxx \
|
||||
BlockFix_CheckTool.cxx \
|
||||
BlockFix.cxx \
|
||||
BlockFix_PeriodicSurfaceModifier.cxx \
|
||||
BlockFix_SphereSpaceModifier.cxx \
|
||||
BlockFix_UnionEdges.cxx \
|
||||
BlockFix_UnionFaces.cxx \
|
||||
GEOMAlgo_Algo.cxx \
|
||||
GEOMAlgo_Builder_0.cxx \
|
||||
GEOMAlgo_Builder_1.cxx \
|
||||
@ -96,31 +88,6 @@ dist_libGEOMAlgo_la_SOURCES = \
|
||||
|
||||
# header files
|
||||
salomeinclude_HEADERS = \
|
||||
BlockFix.hxx \
|
||||
BlockFix.ixx \
|
||||
BlockFix.jxx \
|
||||
BlockFix_BlockFixAPI.hxx \
|
||||
BlockFix_BlockFixAPI.ixx \
|
||||
BlockFix_BlockFixAPI.jxx \
|
||||
BlockFix_BlockFixAPI.lxx \
|
||||
BlockFix_CheckTool.hxx \
|
||||
BlockFix_CheckTool.ixx \
|
||||
BlockFix_CheckTool.jxx \
|
||||
BlockFix_PeriodicSurfaceModifier.hxx \
|
||||
BlockFix_PeriodicSurfaceModifier.ixx \
|
||||
BlockFix_PeriodicSurfaceModifier.jxx \
|
||||
BlockFix_SphereSpaceModifier.hxx \
|
||||
BlockFix_SphereSpaceModifier.ixx \
|
||||
BlockFix_SphereSpaceModifier.jxx \
|
||||
BlockFix_UnionEdges.hxx \
|
||||
BlockFix_UnionEdges.ixx \
|
||||
BlockFix_UnionEdges.jxx \
|
||||
BlockFix_UnionFaces.hxx \
|
||||
BlockFix_UnionFaces.ixx \
|
||||
BlockFix_UnionFaces.jxx \
|
||||
Handle_BlockFix_BlockFixAPI.hxx \
|
||||
Handle_BlockFix_SphereSpaceModifier.hxx \
|
||||
Handle_BlockFix_PeriodicSurfaceModifier.hxx \
|
||||
GEOMAlgo_Algo.hxx \
|
||||
GEOMAlgo_BuilderArea.hxx \
|
||||
GEOMAlgo_BuilderFace.hxx \
|
||||
@ -211,15 +178,7 @@ libGEOMAlgo_la_LDFLAGS = \
|
||||
$(KERNEL_LDFLAGS) -lSALOMELocalTrace
|
||||
|
||||
# extra distributed files
|
||||
CDL_FILES = \
|
||||
BlockFix.cdl \
|
||||
BlockFix_BlockFixAPI.cdl \
|
||||
BlockFix_CheckTool.cdl \
|
||||
BlockFix_PeriodicSurfaceModifier.cdl \
|
||||
BlockFix_SphereSpaceModifier.cdl \
|
||||
BlockFix_UnionEdges.cdl \
|
||||
BlockFix_UnionFaces.cdl \
|
||||
GEOMAlgo.cdl
|
||||
CDL_FILES = GEOMAlgo.cdl
|
||||
|
||||
EXTRA_DIST += \
|
||||
$(CDL_FILES) \
|
||||
|
@ -4871,6 +4871,22 @@ be specified in meters).</translation>
|
||||
<source>GEOM_IS_REORDER</source>
|
||||
<translation>Reorder vertices taking into account distances</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>GEOM_INTERPOL_TANGENTS</source>
|
||||
<translation>Tangents</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>GEOM_INTERPOL_FIRST_VEC</source>
|
||||
<translation>First tangent vector</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>GEOM_INTERPOL_LAST_VEC</source>
|
||||
<translation>Last tangent vector</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>GEOM_BOTH_TANGENTS_REQUIRED</source>
|
||||
<translation>Both tangent vectors must be defined</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>GEOM_CURVE_CRMODE</source>
|
||||
<translation>Creation Mode</translation>
|
||||
|
@ -18,17 +18,19 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
#include <Standard_Stream.hxx>
|
||||
|
||||
#include <GEOMImpl_CircleDriver.hxx>
|
||||
|
||||
#include <GEOMImpl_ICircle.hxx>
|
||||
#include <GEOMImpl_Types.hxx>
|
||||
|
||||
#include <GEOM_Function.hxx>
|
||||
|
||||
#include <GEOMUtils.hxx>
|
||||
|
||||
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
@ -48,29 +50,29 @@
|
||||
//=======================================================================
|
||||
//function : GetID
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
//=======================================================================
|
||||
const Standard_GUID& GEOMImpl_CircleDriver::GetID()
|
||||
{
|
||||
static Standard_GUID aCircleDriver("FF1BBB32-5D14-4df2-980B-3A668264EA16");
|
||||
return aCircleDriver;
|
||||
return aCircleDriver;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : GEOMImpl_CircleDriver
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
GEOMImpl_CircleDriver::GEOMImpl_CircleDriver()
|
||||
GEOMImpl_CircleDriver::GEOMImpl_CircleDriver()
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Execute
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
//=======================================================================
|
||||
Standard_Integer GEOMImpl_CircleDriver::Execute(TFunction_Logbook& log) const
|
||||
{
|
||||
if (Label().IsNull()) return 0;
|
||||
if (Label().IsNull()) return 0;
|
||||
Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
|
||||
|
||||
GEOMImpl_ICircle aCI (aFunction);
|
||||
@ -95,20 +97,7 @@ Standard_Integer GEOMImpl_CircleDriver::Execute(TFunction_Logbook& log) const
|
||||
Handle(GEOM_Function) aRefVector = aCI.GetVector();
|
||||
if (!aRefVector.IsNull()) {
|
||||
TopoDS_Shape aShapeVec = aRefVector->GetValue();
|
||||
if (aShapeVec.ShapeType() != TopAbs_EDGE) {
|
||||
Standard_ConstructionError::Raise
|
||||
("Circle creation aborted: invalid vector argument, must be a vector or an edge");
|
||||
}
|
||||
TopoDS_Edge anE = TopoDS::Edge(aShapeVec);
|
||||
TopoDS_Vertex V1, V2;
|
||||
TopExp::Vertices(anE, V1, V2, Standard_True);
|
||||
if (!V1.IsNull() && !V2.IsNull()) {
|
||||
aV = gp_Vec(BRep_Tool::Pnt(V1), BRep_Tool::Pnt(V2));
|
||||
if (aV.Magnitude() < gp::Resolution()) {
|
||||
Standard_ConstructionError::Raise
|
||||
("Circle creation aborted: vector of zero length is given");
|
||||
}
|
||||
}
|
||||
aV = GEOMUtils::GetVector(aShapeVec);
|
||||
}
|
||||
// Axes
|
||||
gp_Ax2 anAxes (aP, aV);
|
||||
@ -163,7 +152,7 @@ Standard_Integer GEOMImpl_CircleDriver::Execute(TFunction_Logbook& log) const
|
||||
//Make Circle
|
||||
gp_Ax2 anAxes (aP1, aDir);
|
||||
gp_Circ aCirc (anAxes, aRadius);
|
||||
aShape = BRepBuilderAPI_MakeEdge(aCirc).Edge();
|
||||
aShape = BRepBuilderAPI_MakeEdge(aCirc).Edge();
|
||||
}
|
||||
}
|
||||
else if (aType == CIRCLE_THREE_PNT) {
|
||||
@ -187,7 +176,7 @@ Standard_Integer GEOMImpl_CircleDriver::Execute(TFunction_Logbook& log) const
|
||||
Standard_ConstructionError::Raise("Circle creation aborted: points lay on one line");
|
||||
Handle(Geom_Circle) aCirc = GC_MakeCircle(aP1, aP2, aP3).Value();
|
||||
aShape = BRepBuilderAPI_MakeEdge(aCirc).Edge();
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
}
|
||||
@ -196,26 +185,26 @@ Standard_Integer GEOMImpl_CircleDriver::Execute(TFunction_Logbook& log) const
|
||||
|
||||
aFunction->SetValue(aShape);
|
||||
|
||||
log.SetTouched(Label());
|
||||
log.SetTouched(Label());
|
||||
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : GEOMImpl_CircleDriver_Type_
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
//=======================================================================
|
||||
Standard_EXPORT Handle_Standard_Type& GEOMImpl_CircleDriver_Type_()
|
||||
{
|
||||
|
||||
static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver);
|
||||
if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver);
|
||||
static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
|
||||
if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared);
|
||||
if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared);
|
||||
static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
|
||||
if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
|
||||
|
||||
|
||||
|
||||
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
|
||||
static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_CircleDriver",
|
||||
@ -230,7 +219,7 @@ Standard_EXPORT Handle_Standard_Type& GEOMImpl_CircleDriver_Type_()
|
||||
//=======================================================================
|
||||
//function : DownCast
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
//=======================================================================
|
||||
const Handle(GEOMImpl_CircleDriver) Handle(GEOMImpl_CircleDriver)::DownCast(const Handle(Standard_Transient)& AnObject)
|
||||
{
|
||||
Handle(GEOMImpl_CircleDriver) _anOtherObject;
|
||||
|
@ -15,16 +15,15 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
#include <Standard_Stream.hxx>
|
||||
|
||||
#include <GEOMImpl_FaceDriver.hxx>
|
||||
|
||||
#include <GEOMImpl_IFace.hxx>
|
||||
#include <GEOMImpl_Types.hxx>
|
||||
|
||||
#include <GEOM_Function.hxx>
|
||||
|
||||
#include <GEOMImpl_IMeasureOperations.hxx>
|
||||
#include <GEOMUtils.hxx>
|
||||
|
||||
#include <BRepBuilderAPI_MakeFace.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
@ -89,7 +88,7 @@ Standard_Integer GEOMImpl_FaceDriver::Execute(TFunction_Logbook& log) const
|
||||
} else if (aRefShape.ShapeType() == TopAbs_FACE) {
|
||||
double aH = aFI.GetH() / 2.0;
|
||||
double aW = aFI.GetW() / 2.0;
|
||||
gp_Ax3 anAx = GEOMImpl_IMeasureOperations::GetPosition(aRefShape);
|
||||
gp_Ax3 anAx = GEOMUtils::GetPosition(aRefShape);
|
||||
gp_Pln aPln (anAx);
|
||||
aShape = BRepBuilderAPI_MakeFace(aPln, -aH, +aH, -aW, +aW).Shape();
|
||||
}
|
||||
|
@ -23,10 +23,12 @@
|
||||
#include <GEOMImpl_Fillet1d.hxx>
|
||||
#include <GEOMImpl_IFillet1d.hxx>
|
||||
#include <GEOMImpl_Types.hxx>
|
||||
#include <GEOMImpl_IShapesOperations.hxx>
|
||||
#include <GEOMImpl_HealingDriver.hxx>
|
||||
|
||||
#include <GEOM_Function.hxx>
|
||||
|
||||
#include <GEOMUtils.hxx>
|
||||
|
||||
#include <ShapeFix_Wire.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
@ -352,7 +354,7 @@ bool GEOMImpl_Fillet1dDriver::MakeFillet(const TopoDS_Wire& aWire,
|
||||
aListOfNewEdge.Append(anEdgeToEdgeMap.Find(anEdge));
|
||||
}
|
||||
|
||||
GEOMImpl_IShapesOperations::SortShapes(aListOfNewEdge);
|
||||
GEOMUtils::SortShapes(aListOfNewEdge);
|
||||
|
||||
BRepBuilderAPI_MakeWire aWireTool;
|
||||
aWireTool.Add(aListOfNewEdge);
|
||||
|
@ -34,7 +34,8 @@
|
||||
#include <GEOMImpl_IBlockTrsf.hxx>
|
||||
#include <GEOMImpl_CopyDriver.hxx>
|
||||
#include <GEOMImpl_Block6Explorer.hxx>
|
||||
#include <GEOMImpl_IShapesOperations.hxx>
|
||||
|
||||
#include <GEOMUtils.hxx>
|
||||
|
||||
#include <GEOM_Function.hxx>
|
||||
#include <GEOM_PythonDump.hxx>
|
||||
@ -3492,13 +3493,13 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IBlocksOperations::Propagate
|
||||
} // while (listPrevEdges.Extent() > 0)
|
||||
|
||||
// Sort shapes in current chain (Mantis issue 21053)
|
||||
GEOMImpl_IShapesOperations::SortShapes(currentChain, Standard_False);
|
||||
GEOMUtils::SortShapes(currentChain, Standard_False);
|
||||
aFirstInChains.Append(currentChain.First());
|
||||
aMapChains.Bind(currentChain.First(), currentChain);
|
||||
}
|
||||
|
||||
// Sort chains (Mantis issue 21053)
|
||||
GEOMImpl_IShapesOperations::SortShapes(aFirstInChains, Standard_False);
|
||||
GEOMUtils::SortShapes(aFirstInChains, Standard_False);
|
||||
|
||||
// Store sorted chains in the document
|
||||
TopTools_ListIteratorOfListOfShape aChainsIt (aFirstInChains);
|
||||
|
@ -736,19 +736,19 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineBezier
|
||||
|
||||
GEOMImpl_ISpline aCI (aFunction);
|
||||
|
||||
int aLen = thePoints.size();
|
||||
aCI.SetLength(aLen);
|
||||
aCI.SetConstructorType(POINT_CONSTRUCTOR);
|
||||
|
||||
int ind = 1;
|
||||
Handle(TColStd_HSequenceOfTransient) aPoints = new TColStd_HSequenceOfTransient;
|
||||
std::list<Handle(GEOM_Object)>::iterator it = thePoints.begin();
|
||||
for (; it != thePoints.end(); it++, ind++) {
|
||||
for (; it != thePoints.end(); it++) {
|
||||
Handle(GEOM_Function) aRefPnt = (*it)->GetLastFunction();
|
||||
|
||||
if (aRefPnt.IsNull()) return NULL;
|
||||
|
||||
aCI.SetPoint(ind, aRefPnt);
|
||||
if (aRefPnt.IsNull()) {
|
||||
SetErrorCode("NULL point for Besier curve");
|
||||
return NULL;
|
||||
}
|
||||
aPoints->Append(aRefPnt);
|
||||
}
|
||||
aCI.SetPoints(aPoints);
|
||||
|
||||
aCI.SetIsClosed(theIsClosed);
|
||||
|
||||
@ -798,7 +798,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineInterpolation
|
||||
//Add a new Spline object
|
||||
Handle(GEOM_Object) aSpline = GetEngine()->AddObject(GetDocID(), GEOM_SPLINE);
|
||||
|
||||
//Add a new Spline function for creation a bezier curve relatively to points set
|
||||
//Add a new Spline function for interpolation type
|
||||
Handle(GEOM_Function) aFunction =
|
||||
aSpline->AddFunction(GEOMImpl_SplineDriver::GetID(), SPLINE_INTERPOLATION);
|
||||
if (aFunction.IsNull()) return NULL;
|
||||
@ -808,19 +808,18 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineInterpolation
|
||||
|
||||
GEOMImpl_ISpline aCI (aFunction);
|
||||
|
||||
int aLen = thePoints.size();
|
||||
aCI.SetConstructorType(POINT_CONSTRUCTOR);
|
||||
aCI.SetLength(aLen);
|
||||
|
||||
int ind = 1;
|
||||
Handle(TColStd_HSequenceOfTransient) aPoints = new TColStd_HSequenceOfTransient;
|
||||
std::list<Handle(GEOM_Object)>::iterator it = thePoints.begin();
|
||||
for (; it != thePoints.end(); it++, ind++) {
|
||||
for (; it != thePoints.end(); it++) {
|
||||
Handle(GEOM_Function) aRefPnt = (*it)->GetLastFunction();
|
||||
|
||||
if (aRefPnt.IsNull()) return NULL;
|
||||
|
||||
aCI.SetPoint(ind, aRefPnt);
|
||||
if (aRefPnt.IsNull()) {
|
||||
return NULL;
|
||||
}
|
||||
aPoints->Append(aRefPnt);
|
||||
}
|
||||
aCI.SetPoints(aPoints);
|
||||
|
||||
aCI.SetIsClosed(theIsClosed);
|
||||
aCI.SetDoReordering(theDoReordering);
|
||||
@ -856,6 +855,85 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineInterpolation
|
||||
return aSpline;
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
* MakeSplineInterpolWithTangents
|
||||
*/
|
||||
//=============================================================================
|
||||
Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineInterpolWithTangents
|
||||
(std::list<Handle(GEOM_Object)> thePoints,
|
||||
Handle(GEOM_Object) theFirstVec,
|
||||
Handle(GEOM_Object) theLastVec)
|
||||
{
|
||||
SetErrorCode(KO);
|
||||
|
||||
//Add a new Spline object
|
||||
Handle(GEOM_Object) aSpline = GetEngine()->AddObject(GetDocID(), GEOM_SPLINE);
|
||||
|
||||
//Add a new Spline function for interpolation type
|
||||
Handle(GEOM_Function) aFunction =
|
||||
aSpline->AddFunction(GEOMImpl_SplineDriver::GetID(), SPLINE_INTERPOL_TANGENTS);
|
||||
if (aFunction.IsNull()) return NULL;
|
||||
|
||||
//Check if the function is set correctly
|
||||
if (aFunction->GetDriverGUID() != GEOMImpl_SplineDriver::GetID()) return NULL;
|
||||
|
||||
GEOMImpl_ISpline aCI (aFunction);
|
||||
|
||||
aCI.SetConstructorType(POINT_CONSTRUCTOR);
|
||||
|
||||
Handle(TColStd_HSequenceOfTransient) aPoints = new TColStd_HSequenceOfTransient;
|
||||
std::list<Handle(GEOM_Object)>::iterator it = thePoints.begin();
|
||||
for (; it != thePoints.end(); it++) {
|
||||
Handle(GEOM_Function) aRefPnt = (*it)->GetLastFunction();
|
||||
if (aRefPnt.IsNull()) {
|
||||
SetErrorCode("NULL point for Interpolation");
|
||||
return NULL;
|
||||
}
|
||||
aPoints->Append(aRefPnt);
|
||||
}
|
||||
aCI.SetPoints(aPoints);
|
||||
|
||||
Handle(GEOM_Function) aVec1 = theFirstVec->GetLastFunction();
|
||||
Handle(GEOM_Function) aVec2 = theLastVec->GetLastFunction();
|
||||
|
||||
if (aVec1.IsNull() || aVec2.IsNull()) return NULL;
|
||||
|
||||
aCI.SetFirstVector(aVec1);
|
||||
aCI.SetLastVector(aVec2);
|
||||
|
||||
//Compute the Spline value
|
||||
try {
|
||||
#if OCC_VERSION_LARGE > 0x06010000
|
||||
OCC_CATCH_SIGNALS;
|
||||
#endif
|
||||
if (!GetSolver()->ComputeFunction(aFunction)) {
|
||||
SetErrorCode("Spline driver failed");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
||||
SetErrorCode(aFail->GetMessageString());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//Make a Python command
|
||||
GEOM::TPythonDump pd (aFunction);
|
||||
pd << aSpline << " = geompy.MakeInterpolWithTangents([";
|
||||
|
||||
it = thePoints.begin();
|
||||
pd << (*it++);
|
||||
while (it != thePoints.end()) {
|
||||
pd << ", " << (*it++);
|
||||
}
|
||||
pd << "], " << theFirstVec << ", " << theLastVec << ")";
|
||||
|
||||
SetErrorCode(OK);
|
||||
return aSpline;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
* MakeCurveParametric
|
||||
@ -864,7 +942,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineInterpolation
|
||||
Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCurveParametric
|
||||
(const char* thexExpr, const char* theyExpr, const char* thezExpr,
|
||||
double theParamMin, double theParamMax, double theParamStep,
|
||||
CurveType theCurveType,
|
||||
CurveType theCurveType,
|
||||
int theParamNbStep, bool theNewMethod)
|
||||
{
|
||||
TCollection_AsciiString aPyScript;
|
||||
@ -958,7 +1036,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCurveParametric
|
||||
coords = PyObject_CallFunction(func,(char*)"(d, d, i)", theParamMin, theParamMax, theParamNbStep );
|
||||
else
|
||||
coords = PyObject_CallFunction(func,(char*)"(d, d, d)", theParamMin, theParamMax, theParamStep );
|
||||
|
||||
|
||||
PyObject* new_stderr = NULL;
|
||||
|
||||
if (coords == NULL){
|
||||
@ -1038,7 +1116,6 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCurveParametric
|
||||
|
||||
GEOMImpl_ISpline aCI (aFunction);
|
||||
|
||||
aCI.SetLength(lsize);
|
||||
aCI.SetConstructorType(COORD_CONSTRUCTOR);
|
||||
aCI.SetIsClosed(false);
|
||||
aCI.SetCoordinates(aCoordsArray);
|
||||
@ -1058,7 +1135,6 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCurveParametric
|
||||
|
||||
GEOMImpl_ISpline aCI (aFunction);
|
||||
aCI.SetConstructorType(COORD_CONSTRUCTOR);
|
||||
aCI.SetLength(lsize);
|
||||
aCI.SetIsClosed(false);
|
||||
aCI.SetDoReordering(false);
|
||||
aCI.SetCoordinates(aCoordsArray);
|
||||
|
@ -32,11 +32,11 @@ class GEOM_Engine;
|
||||
class Handle(GEOM_Object);
|
||||
|
||||
class GEOMImpl_ICurvesOperations : public GEOM_IOperations {
|
||||
|
||||
|
||||
public:
|
||||
|
||||
enum CurveType { Polyline, Bezier, Interpolation };
|
||||
|
||||
|
||||
Standard_EXPORT GEOMImpl_ICurvesOperations(GEOM_Engine* theEngine, int theDocID);
|
||||
Standard_EXPORT ~GEOMImpl_ICurvesOperations();
|
||||
|
||||
@ -57,7 +57,7 @@ class GEOMImpl_ICurvesOperations : public GEOM_IOperations {
|
||||
Standard_EXPORT Handle(GEOM_Object) MakeArc (Handle(GEOM_Object) thePnt1,
|
||||
Handle(GEOM_Object) thePnt2,
|
||||
Handle(GEOM_Object) thePnt3);
|
||||
|
||||
|
||||
Standard_EXPORT Handle(GEOM_Object) MakeArcCenter (Handle(GEOM_Object) thePnt1,
|
||||
Handle(GEOM_Object) thePnt2,
|
||||
Handle(GEOM_Object) thePnt3,
|
||||
@ -77,9 +77,14 @@ class GEOMImpl_ICurvesOperations : public GEOM_IOperations {
|
||||
bool theIsClosed = false,
|
||||
bool theDoReordering = false);
|
||||
|
||||
Standard_EXPORT Handle(GEOM_Object) MakeSplineInterpolWithTangents
|
||||
(std::list<Handle(GEOM_Object)> thePoints,
|
||||
Handle(GEOM_Object) theFirstVec,
|
||||
Handle(GEOM_Object) theLastVec);
|
||||
|
||||
Standard_EXPORT Handle(GEOM_Object) MakeCurveParametric
|
||||
(const char* thexExpr, const char* theyExpr, const char* thezExpr,
|
||||
double theParamMin, double theParamMax, double theParamStep,
|
||||
(const char* thexExpr, const char* theyExpr, const char* thezExpr,
|
||||
double theParamMin, double theParamMax, double theParamStep,
|
||||
CurveType theCurveType, int theParamNbStep=0, bool theNewMethod=false);
|
||||
|
||||
Standard_EXPORT Handle(GEOM_Object) MakeSketcher (const char* theCommand,
|
||||
|
@ -28,6 +28,8 @@
|
||||
#include <GEOMImpl_IMeasure.hxx>
|
||||
#include <GEOMImpl_IShapesOperations.hxx>
|
||||
|
||||
#include <GEOMUtils.hxx>
|
||||
|
||||
#include <GEOMAlgo_ShapeInfo.hxx>
|
||||
#include <GEOMAlgo_ShapeInfoFiller.hxx>
|
||||
|
||||
@ -765,69 +767,6 @@ GEOMImpl_IMeasureOperations::ShapeKind GEOMImpl_IMeasureOperations::KindOfShape
|
||||
return aKind;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
/*! Get LCS, corresponding to the given shape.
|
||||
* Origin of the LCS is situated at the shape's center of mass.
|
||||
* Axes of the LCS are obtained from shape's location or,
|
||||
* if the shape is a planar face, from position of its plane.
|
||||
*/
|
||||
//=============================================================================
|
||||
gp_Ax3 GEOMImpl_IMeasureOperations::GetPosition (const TopoDS_Shape& theShape)
|
||||
{
|
||||
gp_Ax3 aResult;
|
||||
|
||||
if (theShape.IsNull())
|
||||
return aResult;
|
||||
|
||||
// Axes
|
||||
aResult.Transform(theShape.Location().Transformation());
|
||||
if (theShape.ShapeType() == TopAbs_FACE) {
|
||||
Handle(Geom_Surface) aGS = BRep_Tool::Surface(TopoDS::Face(theShape));
|
||||
if (!aGS.IsNull() && aGS->IsKind(STANDARD_TYPE(Geom_Plane))) {
|
||||
Handle(Geom_Plane) aGPlane = Handle(Geom_Plane)::DownCast(aGS);
|
||||
gp_Pln aPln = aGPlane->Pln();
|
||||
aResult = aPln.Position();
|
||||
// In case of reverse orinetation of the face invert the plane normal
|
||||
// (the face's normal does not mathc the plane's normal in this case)
|
||||
if(theShape.Orientation() == TopAbs_REVERSED)
|
||||
{
|
||||
gp_Dir Vx = aResult.XDirection();
|
||||
gp_Dir N = aResult.Direction().Mirrored(Vx);
|
||||
gp_Pnt P = aResult.Location();
|
||||
aResult = gp_Ax3(P, N, Vx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Origin
|
||||
gp_Pnt aPnt;
|
||||
|
||||
TopAbs_ShapeEnum aShType = theShape.ShapeType();
|
||||
|
||||
if (aShType == TopAbs_VERTEX) {
|
||||
aPnt = BRep_Tool::Pnt(TopoDS::Vertex(theShape));
|
||||
}
|
||||
else {
|
||||
if (aShType == TopAbs_COMPOUND) {
|
||||
aShType = GEOMImpl_IShapesOperations::GetTypeOfSimplePart(theShape);
|
||||
}
|
||||
|
||||
GProp_GProps aSystem;
|
||||
if (aShType == TopAbs_EDGE || aShType == TopAbs_WIRE)
|
||||
BRepGProp::LinearProperties(theShape, aSystem);
|
||||
else if (aShType == TopAbs_FACE || aShType == TopAbs_SHELL)
|
||||
BRepGProp::SurfaceProperties(theShape, aSystem);
|
||||
else
|
||||
BRepGProp::VolumeProperties(theShape, aSystem);
|
||||
|
||||
aPnt = aSystem.CentreOfMass();
|
||||
}
|
||||
|
||||
aResult.SetLocation(aPnt);
|
||||
|
||||
return aResult;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
* GetPosition
|
||||
@ -861,7 +800,7 @@ void GEOMImpl_IMeasureOperations::GetPosition
|
||||
OCC_CATCH_SIGNALS;
|
||||
#endif
|
||||
|
||||
gp_Ax3 anAx3 = GetPosition(aShape);
|
||||
gp_Ax3 anAx3 = GEOMUtils::GetPosition(aShape);
|
||||
|
||||
gp_Pnt anOri = anAx3.Location();
|
||||
gp_Dir aDirZ = anAx3.Direction();
|
||||
|
@ -18,7 +18,6 @@
|
||||
// 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 _GEOMImpl_IMeasureOperations_HXX_
|
||||
#define _GEOMImpl_IMeasureOperations_HXX_
|
||||
@ -168,9 +167,6 @@ class GEOMImpl_IMeasureOperations : public GEOM_IOperations {
|
||||
Standard_EXPORT Standard_Real MinSurfaceCurvatureByPoint (Handle(GEOM_Object) theSurf,
|
||||
Handle(GEOM_Object) thePoint);
|
||||
|
||||
public:
|
||||
Standard_EXPORT static gp_Ax3 GetPosition (const TopoDS_Shape& theShape);
|
||||
|
||||
private:
|
||||
void StructuralDump (const BRepCheck_Analyzer& theAna,
|
||||
const TopoDS_Shape& theShape,
|
||||
|
@ -18,15 +18,16 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
//NOTE: This is an intreface to a function for the Pipe creation.
|
||||
//
|
||||
|
||||
#ifndef _GEOMImpl_IPIPEDIFFSECT_HXX_
|
||||
#define _GEOMImpl_IPIPEDIFFSECT_HXX_
|
||||
|
||||
#include "GEOM_Function.hxx"
|
||||
|
||||
#include <TColStd_HSequenceOfTransient.hxx>
|
||||
|
||||
#ifndef _GEOMImpl_IPIPE_HXX_
|
||||
#include "GEOMImpl_IPipe.hxx"
|
||||
#endif
|
||||
|
@ -23,6 +23,8 @@
|
||||
|
||||
#include "GEOM_Function.hxx"
|
||||
|
||||
#include <TColStd_HSequenceOfTransient.hxx>
|
||||
|
||||
class GEOMImpl_IPipePath
|
||||
{
|
||||
public:
|
||||
|
@ -15,10 +15,9 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
//NOTE: This is an intreface to a function for the Pipe creation.
|
||||
//
|
||||
|
||||
#ifndef _GEOMImpl_IPIPESHELLSECT_HXX_
|
||||
#define _GEOMImpl_IPIPESHELLSECT_HXX_
|
||||
|
||||
@ -28,6 +27,8 @@
|
||||
#include "GEOMImpl_IPipeDiffSect.hxx"
|
||||
#endif
|
||||
|
||||
#include <TColStd_HSequenceOfTransient.hxx>
|
||||
|
||||
#define PIPEDS_LIST_SUBBASES 6
|
||||
|
||||
|
||||
|
@ -48,6 +48,8 @@
|
||||
#include "GEOM_ISubShape.hxx"
|
||||
#include "GEOM_PythonDump.hxx"
|
||||
|
||||
#include "GEOMUtils.hxx"
|
||||
|
||||
#include "GEOMAlgo_ClsfBox.hxx"
|
||||
#include "GEOMAlgo_ClsfSolid.hxx"
|
||||
#include "GEOMAlgo_CoupleOfShapes.hxx"
|
||||
@ -141,8 +143,6 @@
|
||||
#include <BRepClass3d_SolidClassifier.hxx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
#define STD_SORT_ALGO 1
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
* constructor:
|
||||
@ -1023,7 +1023,7 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetGlueShapes
|
||||
}
|
||||
|
||||
// for stable order of returned entities
|
||||
GEOMImpl_IShapesOperations::SortShapes(listOnePerSet, Standard_False);
|
||||
GEOMUtils::SortShapes(listOnePerSet, Standard_False);
|
||||
|
||||
TopTools_ListIteratorOfListOfShape aListIt (listOnePerSet);
|
||||
for (; aListIt.More(); aListIt.Next()) {
|
||||
@ -1267,7 +1267,7 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::MakeExplode
|
||||
bool isOldSorting = false;
|
||||
if (theExplodeType == EXPLODE_OLD_INCLUDE_MAIN)
|
||||
isOldSorting = true;
|
||||
SortShapes(listShape, isOldSorting);
|
||||
GEOMUtils::SortShapes(listShape, isOldSorting);
|
||||
}
|
||||
|
||||
TopTools_IndexedMapOfShape anIndices;
|
||||
@ -1391,7 +1391,7 @@ Handle(TColStd_HSequenceOfInteger) GEOMImpl_IShapesOperations::SubShapeAllIDs
|
||||
bool isOldSorting = false;
|
||||
if (theExplodeType == EXPLODE_OLD_INCLUDE_MAIN)
|
||||
isOldSorting = true;
|
||||
SortShapes(listShape, isOldSorting);
|
||||
GEOMUtils::SortShapes(listShape, isOldSorting);
|
||||
}
|
||||
|
||||
TopTools_IndexedMapOfShape anIndices;
|
||||
@ -2217,7 +2217,7 @@ Handle(TColStd_HSequenceOfInteger)
|
||||
TopoDS_Shape aShape = theShape->GetValue();
|
||||
|
||||
// Check presence of triangulation, build if need
|
||||
if (!CheckTriangulation(aShape)) {
|
||||
if (!GEOMUtils::CheckTriangulation(aShape)) {
|
||||
SetErrorCode("Cannot build triangulation on the shape");
|
||||
return aSeqOfIDs;
|
||||
}
|
||||
@ -2384,7 +2384,7 @@ Handle(TColStd_HSequenceOfInteger)
|
||||
TopTools_ListOfShape res;
|
||||
|
||||
// Check presence of triangulation, build if need
|
||||
if (!CheckTriangulation(aShape)) {
|
||||
if (!GEOMUtils::CheckTriangulation(aShape)) {
|
||||
SetErrorCode("Cannot build triangulation on the shape");
|
||||
return aSeqOfIDs;
|
||||
}
|
||||
@ -2604,7 +2604,7 @@ Handle(TColStd_HSequenceOfInteger)
|
||||
Handle(TColStd_HSequenceOfInteger) aSeqOfIDs;
|
||||
|
||||
// Check presence of triangulation, build if need
|
||||
if (!CheckTriangulation(theShape)) {
|
||||
if (!GEOMUtils::CheckTriangulation(theShape)) {
|
||||
SetErrorCode("Cannot build triangulation on the shape");
|
||||
return aSeqOfIDs;
|
||||
}
|
||||
@ -3385,7 +3385,7 @@ Handle(TColStd_HSequenceOfInteger)
|
||||
Handle(TColStd_HSequenceOfInteger) aSeqOfIDs;
|
||||
|
||||
// Check presence of triangulation, build if need
|
||||
if (!CheckTriangulation(aShape)) {
|
||||
if (!GEOMUtils::CheckTriangulation(aShape)) {
|
||||
SetErrorCode("Cannot build triangulation on the shape");
|
||||
return aSeqOfIDs;
|
||||
}
|
||||
@ -3776,28 +3776,6 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
/*!
|
||||
* \brief Return type of shape for explode. In case of compound it will be a type of sub-shape.
|
||||
*/
|
||||
//================================================================================
|
||||
TopAbs_ShapeEnum GEOMImpl_IShapesOperations::GetTypeOfSimplePart (const TopoDS_Shape& theShape)
|
||||
{
|
||||
TopAbs_ShapeEnum aType = theShape.ShapeType();
|
||||
if (aType == TopAbs_VERTEX) return TopAbs_VERTEX;
|
||||
else if (aType == TopAbs_EDGE || aType == TopAbs_WIRE) return TopAbs_EDGE;
|
||||
else if (aType == TopAbs_FACE || aType == TopAbs_SHELL) return TopAbs_FACE;
|
||||
else if (aType == TopAbs_SOLID || aType == TopAbs_COMPSOLID) return TopAbs_SOLID;
|
||||
else if (aType == TopAbs_COMPOUND) {
|
||||
// Only the iType of the first shape in the compound is taken into account
|
||||
TopoDS_Iterator It (theShape, Standard_False, Standard_False);
|
||||
if (It.More()) {
|
||||
return GetTypeOfSimplePart(It.Value());
|
||||
}
|
||||
}
|
||||
return TopAbs_SHAPE;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
* case GetInPlace:
|
||||
@ -3839,7 +3817,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object)
|
||||
GProp_GProps aProps;
|
||||
|
||||
// Find the iType of the aWhat shape
|
||||
iType = GetTypeOfSimplePart(aWhat);
|
||||
iType = GEOMUtils::GetTypeOfSimplePart(aWhat);
|
||||
if (iType == TopAbs_SHAPE) {
|
||||
SetErrorCode("Error: An attempt to extract a shape of not supported type.");
|
||||
return NULL;
|
||||
@ -4041,7 +4019,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlaceOld (Handle(GEOM_Objec
|
||||
return NULL;
|
||||
}
|
||||
*/
|
||||
iType = GetTypeOfSimplePart(aWhat);
|
||||
iType = GEOMUtils::GetTypeOfSimplePart(aWhat);
|
||||
if (iType == TopAbs_SHAPE) {
|
||||
SetErrorCode("Error: An attempt to extract a shape of not supported type.");
|
||||
return NULL;
|
||||
@ -4266,321 +4244,6 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlaceByHistory
|
||||
return aResult;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ShapeToDouble
|
||||
//purpose : used by CompareShapes::operator()
|
||||
//=======================================================================
|
||||
std::pair<double, double> ShapeToDouble (const TopoDS_Shape& S, bool isOldSorting)
|
||||
{
|
||||
// Computing of CentreOfMass
|
||||
gp_Pnt GPoint;
|
||||
double Len;
|
||||
|
||||
if (S.ShapeType() == TopAbs_VERTEX) {
|
||||
GPoint = BRep_Tool::Pnt(TopoDS::Vertex(S));
|
||||
Len = (double)S.Orientation();
|
||||
}
|
||||
else {
|
||||
GProp_GProps GPr;
|
||||
// BEGIN: fix for Mantis issue 0020842
|
||||
if (isOldSorting) {
|
||||
BRepGProp::LinearProperties(S, GPr);
|
||||
}
|
||||
else {
|
||||
if (S.ShapeType() == TopAbs_EDGE || S.ShapeType() == TopAbs_WIRE) {
|
||||
BRepGProp::LinearProperties(S, GPr);
|
||||
}
|
||||
else if (S.ShapeType() == TopAbs_FACE || S.ShapeType() == TopAbs_SHELL) {
|
||||
BRepGProp::SurfaceProperties(S, GPr);
|
||||
}
|
||||
else {
|
||||
BRepGProp::VolumeProperties(S, GPr);
|
||||
}
|
||||
}
|
||||
// END: fix for Mantis issue 0020842
|
||||
GPoint = GPr.CentreOfMass();
|
||||
Len = GPr.Mass();
|
||||
}
|
||||
|
||||
double dMidXYZ = GPoint.X() * 999.0 + GPoint.Y() * 99.0 + GPoint.Z() * 0.9;
|
||||
return std::make_pair(dMidXYZ, Len);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : CompareShapes::operator()
|
||||
//purpose : used by std::sort(), called from SortShapes()
|
||||
//=======================================================================
|
||||
bool GEOMImpl_IShapesOperations::CompareShapes::operator()(const TopoDS_Shape& theShape1,
|
||||
const TopoDS_Shape& theShape2)
|
||||
{
|
||||
if (!myMap.IsBound(theShape1)) {
|
||||
myMap.Bind(theShape1, ShapeToDouble(theShape1, myIsOldSorting));
|
||||
}
|
||||
|
||||
if (!myMap.IsBound(theShape2)) {
|
||||
myMap.Bind(theShape2, ShapeToDouble(theShape2, myIsOldSorting));
|
||||
}
|
||||
|
||||
std::pair<double, double> val1 = myMap.Find(theShape1);
|
||||
std::pair<double, double> val2 = myMap.Find(theShape2);
|
||||
|
||||
double tol = Precision::Confusion();
|
||||
bool exchange = Standard_False;
|
||||
|
||||
double dMidXYZ = val1.first - val2.first;
|
||||
if (dMidXYZ >= tol) {
|
||||
exchange = Standard_True;
|
||||
}
|
||||
else if (Abs(dMidXYZ) < tol) {
|
||||
double dLength = val1.second - val2.second;
|
||||
if (dLength >= tol) {
|
||||
exchange = Standard_True;
|
||||
}
|
||||
else if (Abs(dLength) < tol && theShape1.ShapeType() <= TopAbs_FACE) {
|
||||
// PAL17233
|
||||
// equal values possible on shapes such as two halves of a sphere and
|
||||
// a membrane inside the sphere
|
||||
Bnd_Box box1,box2;
|
||||
BRepBndLib::Add(theShape1, box1);
|
||||
if (!box1.IsVoid()) {
|
||||
BRepBndLib::Add(theShape2, box2);
|
||||
Standard_Real dSquareExtent = box1.SquareExtent() - box2.SquareExtent();
|
||||
if (dSquareExtent >= tol) {
|
||||
exchange = Standard_True;
|
||||
}
|
||||
else if (Abs(dSquareExtent) < tol) {
|
||||
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax, val1, val2;
|
||||
box1.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
|
||||
val1 = (aXmin+aXmax)*999.0 + (aYmin+aYmax)*99.0 + (aZmin+aZmax)*0.9;
|
||||
box2.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
|
||||
val2 = (aXmin+aXmax)*999.0 + (aYmin+aYmax)*99.0 + (aZmin+aZmax)*0.9;
|
||||
if ((val1 - val2) >= tol) {
|
||||
exchange = Standard_True;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//return val1 < val2;
|
||||
return !exchange;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SortShapes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMImpl_IShapesOperations::SortShapes(TopTools_ListOfShape& SL,
|
||||
const Standard_Boolean isOldSorting)
|
||||
{
|
||||
#ifdef STD_SORT_ALGO
|
||||
std::vector<TopoDS_Shape> aShapesVec;
|
||||
aShapesVec.reserve(SL.Extent());
|
||||
|
||||
TopTools_ListIteratorOfListOfShape it (SL);
|
||||
for (; it.More(); it.Next()) {
|
||||
aShapesVec.push_back(it.Value());
|
||||
}
|
||||
SL.Clear();
|
||||
|
||||
CompareShapes shComp (isOldSorting);
|
||||
std::stable_sort(aShapesVec.begin(), aShapesVec.end(), shComp);
|
||||
//std::sort(aShapesVec.begin(), aShapesVec.end(), shComp);
|
||||
|
||||
std::vector<TopoDS_Shape>::const_iterator anIter = aShapesVec.begin();
|
||||
for (; anIter != aShapesVec.end(); ++anIter) {
|
||||
SL.Append(*anIter);
|
||||
}
|
||||
#else
|
||||
// old implementation
|
||||
Standard_Integer MaxShapes = SL.Extent();
|
||||
TopTools_Array1OfShape aShapes (1,MaxShapes);
|
||||
TColStd_Array1OfInteger OrderInd(1,MaxShapes);
|
||||
TColStd_Array1OfReal MidXYZ (1,MaxShapes); //X,Y,Z;
|
||||
TColStd_Array1OfReal Length (1,MaxShapes); //X,Y,Z;
|
||||
|
||||
// Computing of CentreOfMass
|
||||
Standard_Integer Index;
|
||||
GProp_GProps GPr;
|
||||
gp_Pnt GPoint;
|
||||
TopTools_ListIteratorOfListOfShape it(SL);
|
||||
for (Index=1; it.More(); Index++)
|
||||
{
|
||||
TopoDS_Shape S = it.Value();
|
||||
SL.Remove( it ); // == it.Next()
|
||||
aShapes(Index) = S;
|
||||
OrderInd.SetValue (Index, Index);
|
||||
if (S.ShapeType() == TopAbs_VERTEX) {
|
||||
GPoint = BRep_Tool::Pnt( TopoDS::Vertex( S ));
|
||||
Length.SetValue( Index, (Standard_Real) S.Orientation());
|
||||
}
|
||||
else {
|
||||
// BEGIN: fix for Mantis issue 0020842
|
||||
if (isOldSorting) {
|
||||
BRepGProp::LinearProperties (S, GPr);
|
||||
}
|
||||
else {
|
||||
if (S.ShapeType() == TopAbs_EDGE || S.ShapeType() == TopAbs_WIRE) {
|
||||
BRepGProp::LinearProperties (S, GPr);
|
||||
}
|
||||
else if (S.ShapeType() == TopAbs_FACE || S.ShapeType() == TopAbs_SHELL) {
|
||||
BRepGProp::SurfaceProperties(S, GPr);
|
||||
}
|
||||
else {
|
||||
BRepGProp::VolumeProperties(S, GPr);
|
||||
}
|
||||
}
|
||||
// END: fix for Mantis issue 0020842
|
||||
GPoint = GPr.CentreOfMass();
|
||||
Length.SetValue(Index, GPr.Mass());
|
||||
}
|
||||
MidXYZ.SetValue(Index, GPoint.X()*999.0 + GPoint.Y()*99.0 + GPoint.Z()*0.9);
|
||||
//cout << Index << " L: " << Length(Index) << "CG: " << MidXYZ(Index) << endl;
|
||||
}
|
||||
|
||||
// Sorting
|
||||
Standard_Integer aTemp;
|
||||
Standard_Boolean exchange, Sort = Standard_True;
|
||||
Standard_Real tol = Precision::Confusion();
|
||||
while (Sort)
|
||||
{
|
||||
Sort = Standard_False;
|
||||
for (Index=1; Index < MaxShapes; Index++)
|
||||
{
|
||||
exchange = Standard_False;
|
||||
Standard_Real dMidXYZ = MidXYZ(OrderInd(Index)) - MidXYZ(OrderInd(Index+1));
|
||||
Standard_Real dLength = Length(OrderInd(Index)) - Length(OrderInd(Index+1));
|
||||
if ( dMidXYZ >= tol ) {
|
||||
// cout << "MidXYZ: " << MidXYZ(OrderInd(Index))<< " > " <<MidXYZ(OrderInd(Index+1))
|
||||
// << " d: " << dMidXYZ << endl;
|
||||
exchange = Standard_True;
|
||||
}
|
||||
else if ( Abs(dMidXYZ) < tol && dLength >= tol ) {
|
||||
// cout << "Length: " << Length(OrderInd(Index))<< " > " <<Length(OrderInd(Index+1))
|
||||
// << " d: " << dLength << endl;
|
||||
exchange = Standard_True;
|
||||
}
|
||||
else if ( Abs(dMidXYZ) < tol && Abs(dLength) < tol &&
|
||||
aShapes(OrderInd(Index)).ShapeType() <= TopAbs_FACE) {
|
||||
// PAL17233
|
||||
// equal values possible on shapes such as two halves of a sphere and
|
||||
// a membrane inside the sphere
|
||||
Bnd_Box box1,box2;
|
||||
BRepBndLib::Add( aShapes( OrderInd(Index) ), box1 );
|
||||
if ( box1.IsVoid() ) continue;
|
||||
BRepBndLib::Add( aShapes( OrderInd(Index+1) ), box2 );
|
||||
Standard_Real dSquareExtent = box1.SquareExtent() - box2.SquareExtent();
|
||||
if ( dSquareExtent >= tol ) {
|
||||
// cout << "SquareExtent: " << box1.SquareExtent()<<" > "<<box2.SquareExtent() << endl;
|
||||
exchange = Standard_True;
|
||||
}
|
||||
else if ( Abs(dSquareExtent) < tol ) {
|
||||
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax, val1, val2;
|
||||
box1.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
|
||||
val1 = (aXmin+aXmax)*999 + (aYmin+aYmax)*99 + (aZmin+aZmax)*0.9;
|
||||
box2.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
|
||||
val2 = (aXmin+aXmax)*999 + (aYmin+aYmax)*99 + (aZmin+aZmax)*0.9;
|
||||
//exchange = val1 > val2;
|
||||
if ((val1 - val2) >= tol) {
|
||||
exchange = Standard_True;
|
||||
}
|
||||
//cout << "box: " << val1<<" > "<<val2 << endl;
|
||||
}
|
||||
}
|
||||
|
||||
if (exchange)
|
||||
{
|
||||
// cout << "exchange " << Index << " & " << Index+1 << endl;
|
||||
aTemp = OrderInd(Index);
|
||||
OrderInd(Index) = OrderInd(Index+1);
|
||||
OrderInd(Index+1) = aTemp;
|
||||
Sort = Standard_True;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (Index=1; Index <= MaxShapes; Index++)
|
||||
SL.Append( aShapes( OrderInd(Index) ));
|
||||
#endif
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//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())
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isTriangulation) {
|
||||
// calculate deflection
|
||||
Standard_Real aDeviationCoefficient = 0.001;
|
||||
|
||||
Bnd_Box B;
|
||||
BRepBndLib::Add(aShape, B);
|
||||
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
|
||||
B.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
|
||||
|
||||
Standard_Real dx = aXmax - aXmin, dy = aYmax - aYmin, dz = aZmax - aZmin;
|
||||
Standard_Real aDeflection = Max(Max(dx, dy), dz) * aDeviationCoefficient * 4;
|
||||
Standard_Real aHLRAngle = 0.349066;
|
||||
|
||||
BRepMesh_IncrementalMesh Inc (aShape, aDeflection, Standard_False, aHLRAngle);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#define MAX_TOLERANCE 1.e-7
|
||||
|
||||
//=======================================================================
|
||||
|
@ -51,11 +51,6 @@ class GEOM_Engine;
|
||||
class Handle(GEOM_Object);
|
||||
class Handle(TColStd_HArray1OfInteger);
|
||||
|
||||
inline Standard_Boolean IsEqual (const TopoDS_Shape& S1, const TopoDS_Shape& S2)
|
||||
{
|
||||
return S1.IsSame(S2);
|
||||
}
|
||||
|
||||
class GEOMImpl_IShapesOperations : public GEOM_IOperations
|
||||
{
|
||||
public:
|
||||
@ -375,50 +370,6 @@ 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.
|
||||
*/
|
||||
struct CompareShapes : public std::binary_function<TopoDS_Shape, TopoDS_Shape, bool>
|
||||
{
|
||||
CompareShapes (bool isOldSorting)
|
||||
: myIsOldSorting(isOldSorting) {}
|
||||
|
||||
bool operator()(const TopoDS_Shape& lhs, const TopoDS_Shape& rhs);
|
||||
|
||||
typedef NCollection_DataMap<TopoDS_Shape, std::pair<double, double> > NCollection_DataMapOfShapeDouble;
|
||||
NCollection_DataMapOfShapeDouble myMap;
|
||||
bool myIsOldSorting;
|
||||
};
|
||||
|
||||
Standard_EXPORT static void SortShapes (TopTools_ListOfShape& SL,
|
||||
const Standard_Boolean isOldSorting = Standard_True);
|
||||
|
||||
/*!
|
||||
* \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);
|
||||
|
||||
/*!
|
||||
* \brief Return type of shape for explode. In case of compound it will be a type of its first sub shape.
|
||||
* \param theShape The shape to get type of.
|
||||
* \retval TopAbs_ShapeEnum Return type of shape for explode.
|
||||
*/
|
||||
Standard_EXPORT static TopAbs_ShapeEnum GetTypeOfSimplePart (const TopoDS_Shape& theShape);
|
||||
|
||||
private:
|
||||
Handle(GEOM_Object) MakeShape (std::list<Handle(GEOM_Object)> theShapes,
|
||||
const Standard_Integer theObjectType,
|
||||
|
@ -18,13 +18,61 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
// NOTE: This is an interface to a function for the Spline creation.
|
||||
|
||||
#include "GEOM_Function.hxx"
|
||||
#include <GEOM_Function.hxx>
|
||||
|
||||
#include <TColStd_HSequenceOfTransient.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
|
||||
class GEOMImpl_ISpline
|
||||
{
|
||||
public:
|
||||
|
||||
enum {
|
||||
ARG_POINTS = 1,
|
||||
ARG_CLOSED = 2,
|
||||
ARG_REORDER = 3,
|
||||
CONSTRUCTOR = 4,
|
||||
ARG_ARRAY = 5,
|
||||
ARG_VEC_1 = 6,
|
||||
ARG_VEC_2 = 7
|
||||
};
|
||||
|
||||
GEOMImpl_ISpline(Handle(GEOM_Function) theFunction): _func(theFunction) {}
|
||||
|
||||
// Set
|
||||
|
||||
void SetPoints (const Handle(TColStd_HSequenceOfTransient)& thePoints)
|
||||
{ _func->SetReferenceList(ARG_POINTS, thePoints); }
|
||||
|
||||
void SetIsClosed (bool theIsClosed) { _func->SetInteger(ARG_CLOSED, (int)theIsClosed); }
|
||||
void SetDoReordering (bool theDoReordering) { _func->SetInteger(ARG_REORDER, (int)theDoReordering); }
|
||||
|
||||
void SetConstructorType (int theConstructor) { _func->SetInteger(CONSTRUCTOR, theConstructor); }
|
||||
|
||||
void SetCoordinates (const Handle(TColStd_HArray1OfReal)& theValue)
|
||||
{ _func->SetRealArray(ARG_ARRAY, theValue); }
|
||||
|
||||
void SetFirstVector (Handle(GEOM_Function) theVec) { _func->SetReference(ARG_VEC_1, theVec); }
|
||||
void SetLastVector (Handle(GEOM_Function) theVec) { _func->SetReference(ARG_VEC_2, theVec); }
|
||||
|
||||
// Get
|
||||
|
||||
Handle(TColStd_HSequenceOfTransient) GetPoints() { return _func->GetReferenceList(ARG_POINTS); }
|
||||
|
||||
bool GetIsClosed() { return (bool)_func->GetInteger(ARG_CLOSED); }
|
||||
bool GetDoReordering() { return (bool)_func->GetInteger(ARG_REORDER); }
|
||||
|
||||
int GetConstructorType() { return _func->GetInteger(CONSTRUCTOR); }
|
||||
|
||||
Handle(TColStd_HArray1OfReal) GetCoordinates() { return _func->GetRealArray(ARG_ARRAY); }
|
||||
|
||||
Handle(GEOM_Function) GetFirstVector () { return _func->GetReference(ARG_VEC_1); }
|
||||
Handle(GEOM_Function) GetLastVector () { return _func->GetReference(ARG_VEC_2); }
|
||||
|
||||
/* Old implementation (Salome 6.6.0 and earlier)
|
||||
#define SPL_ARG_LENG 1
|
||||
#define SPL_ARG_CLOS 2
|
||||
#define SPL_ARG_REOR 3
|
||||
@ -33,38 +81,21 @@
|
||||
#define SPL_CONSTRUCTOR 4
|
||||
#define SPL_ARG_ARRAY 5
|
||||
|
||||
class GEOMImpl_ISpline
|
||||
{
|
||||
public:
|
||||
|
||||
GEOMImpl_ISpline(Handle(GEOM_Function) theFunction): _func(theFunction) {}
|
||||
|
||||
void SetLength(int theLen) { _func->SetInteger(SPL_ARG_LENG, theLen); }
|
||||
|
||||
void SetIsClosed(bool theIsClosed) { _func->SetInteger(SPL_ARG_CLOS, (int)theIsClosed); }
|
||||
|
||||
void SetDoReordering(bool theDoReordering) { _func->SetInteger(SPL_ARG_REOR, (int)theDoReordering); }
|
||||
|
||||
void SetPoint(int theId, Handle(GEOM_Function) theP) { _func->SetReference(SPL_ARG_LAST + theId, theP); }
|
||||
|
||||
int GetLength() { return _func->GetInteger(SPL_ARG_LENG); }
|
||||
|
||||
bool GetIsClosed() { return (bool)_func->GetInteger(SPL_ARG_CLOS); }
|
||||
|
||||
bool GetDoReordering() { return (bool)_func->GetInteger(SPL_ARG_REOR); }
|
||||
|
||||
Handle(GEOM_Function) GetPoint(int theId) { return _func->GetReference(SPL_ARG_LAST + theId); }
|
||||
|
||||
|
||||
void SetConstructorType(int theConstructor) {_func->SetInteger(SPL_CONSTRUCTOR,theConstructor); }
|
||||
|
||||
int GetConstructorType() { return _func->GetInteger(SPL_CONSTRUCTOR); }
|
||||
|
||||
void SetPoint(int theId, Handle(GEOM_Function) theP) { _func->SetReference(SPL_ARG_LAST + theId, theP); }
|
||||
void SetCoordinates(const Handle(TColStd_HArray1OfReal)& theValue)
|
||||
{ _func->SetRealArray(SPL_ARG_ARRAY, theValue); }
|
||||
|
||||
|
||||
int GetLength() { return _func->GetInteger(SPL_ARG_LENG); }
|
||||
bool GetIsClosed() { return (bool)_func->GetInteger(SPL_ARG_CLOS); }
|
||||
bool GetDoReordering() { return (bool)_func->GetInteger(SPL_ARG_REOR); }
|
||||
int GetConstructorType() { return _func->GetInteger(SPL_CONSTRUCTOR); }
|
||||
Handle(GEOM_Function) GetPoint(int theId) { return _func->GetReference(SPL_ARG_LAST + theId); }
|
||||
Handle(TColStd_HArray1OfReal) GetCoordinates() { return _func->GetRealArray(SPL_ARG_ARRAY); }
|
||||
*/
|
||||
|
||||
private:
|
||||
|
||||
|
@ -18,15 +18,16 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
#include <Standard_Stream.hxx>
|
||||
|
||||
#include <GEOMImpl_MarkerDriver.hxx>
|
||||
#include <GEOMImpl_IMarker.hxx>
|
||||
#include <GEOMImpl_Types.hxx>
|
||||
|
||||
#include <GEOM_Function.hxx>
|
||||
#include <GEOMImpl_IMeasureOperations.hxx>
|
||||
|
||||
#include <GEOMUtils.hxx>
|
||||
|
||||
#include <BRepBuilderAPI_MakeFace.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
@ -109,7 +110,7 @@ Standard_Integer GEOMImpl_MarkerDriver::Execute(TFunction_Logbook& log) const
|
||||
} else if (aType == MARKER_SHAPE) {
|
||||
Handle(GEOM_Function) aRefShape = aPI.GetShape();
|
||||
TopoDS_Shape aSh = aRefShape->GetValue();
|
||||
gp_Ax3 anAx3 = GEOMImpl_IMeasureOperations::GetPosition(aSh);
|
||||
gp_Ax3 anAx3 = GEOMUtils::GetPosition(aSh);
|
||||
gp_Pln aPln (anAx3);
|
||||
|
||||
double aTrimSize = 100.0;
|
||||
|
@ -18,16 +18,17 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
#include <Standard_Stream.hxx>
|
||||
|
||||
#include <GEOMImpl_MeasureDriver.hxx>
|
||||
#include <GEOMImpl_IMeasure.hxx>
|
||||
#include <GEOMImpl_IMeasureOperations.hxx>
|
||||
#include <GEOMImpl_Types.hxx>
|
||||
|
||||
#include <GEOM_Function.hxx>
|
||||
|
||||
#include <GEOMUtils.hxx>
|
||||
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepGProp.hxx>
|
||||
#include <BRepBuilderAPI_MakeVertex.hxx>
|
||||
@ -96,7 +97,7 @@ Standard_Integer GEOMImpl_MeasureDriver::Execute(TFunction_Logbook& log) const
|
||||
Standard_NullObject::Raise("Shape for centre of mass calculation is null");
|
||||
}
|
||||
|
||||
gp_Ax3 aPos = GEOMImpl_IMeasureOperations::GetPosition(aShapeBase);
|
||||
gp_Ax3 aPos = GEOMUtils::GetPosition(aShapeBase);
|
||||
gp_Pnt aCenterMass = aPos.Location();
|
||||
aShape = BRepBuilderAPI_MakeVertex(aCenterMass).Shape();
|
||||
}
|
||||
@ -189,7 +190,7 @@ Standard_Integer GEOMImpl_MeasureDriver::Execute(TFunction_Logbook& log) const
|
||||
}
|
||||
else
|
||||
{
|
||||
gp_Ax3 aPos = GEOMImpl_IMeasureOperations::GetPosition(aFace);
|
||||
gp_Ax3 aPos = GEOMUtils::GetPosition(aFace);
|
||||
p1 = aPos.Location();
|
||||
}
|
||||
|
||||
|
@ -19,11 +19,8 @@
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
|
||||
#include <Standard_Stream.hxx>
|
||||
|
||||
#include <GEOMImpl_PipeDriver.hxx>
|
||||
|
||||
#include <GEOMImpl_IShapesOperations.hxx>
|
||||
#include <GEOMImpl_IPipeDiffSect.hxx>
|
||||
#include <GEOMImpl_IPipeShellSect.hxx>
|
||||
#include <GEOMImpl_IPipeBiNormal.hxx>
|
||||
@ -31,8 +28,11 @@
|
||||
#include <GEOMImpl_IPipePath.hxx>
|
||||
#include <GEOMImpl_GlueDriver.hxx>
|
||||
#include <GEOMImpl_Types.hxx>
|
||||
|
||||
#include <GEOM_Function.hxx>
|
||||
|
||||
#include <GEOMUtils.hxx>
|
||||
|
||||
#include <ShapeAnalysis_FreeBounds.hxx>
|
||||
#include <ShapeAnalysis_Edge.hxx>
|
||||
#include <ShapeFix_Face.hxx>
|
||||
@ -2491,7 +2491,7 @@ Standard_Integer GEOMImpl_PipeDriver::Execute (TFunction_Logbook& log) const
|
||||
//aShape = GEOMImpl_GlueDriver::GlueFaces(aShape, Precision::Confusion(), Standard_True);
|
||||
}
|
||||
|
||||
TopoDS_Shape aRes = GEOMImpl_IShapesOperations::CompsolidToCompound(aShape);
|
||||
TopoDS_Shape aRes = GEOMUtils::CompsolidToCompound(aShape);
|
||||
aFunction->SetValue(aRes);
|
||||
|
||||
log.SetTouched(Label());
|
||||
|
@ -15,20 +15,20 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
#include <Standard_Stream.hxx>
|
||||
|
||||
#include <GEOMImpl_PipeTShapeDriver.hxx>
|
||||
|
||||
#include <GEOMImpl_IPipeTShape.hxx>
|
||||
#include <GEOMImpl_Types.hxx>
|
||||
|
||||
#include <GEOMImpl_Block6Explorer.hxx>
|
||||
#include <GEOM_Function.hxx>
|
||||
|
||||
#include <GEOMImpl_IShapesOperations.hxx>
|
||||
#include "GEOMAlgo_FinderShapeOn1.hxx"
|
||||
#include "GEOMAlgo_FinderShapeOn2.hxx"
|
||||
#include <GEOM_Function.hxx>
|
||||
#include <GEOM_IOperations.hxx>
|
||||
|
||||
#include <GEOMUtils.hxx>
|
||||
|
||||
#include <GEOMAlgo_FinderShapeOn1.hxx>
|
||||
#include <GEOMAlgo_FinderShapeOn2.hxx>
|
||||
#include <GEOMAlgo_ClsfBox.hxx>
|
||||
|
||||
#include <TFunction_Logbook.hxx>
|
||||
@ -106,7 +106,7 @@ GEOMImpl_PipeTShapeDriver::GetShapesOnBoxIDs(const TopoDS_Shape& aBox,
|
||||
Handle(TColStd_HSequenceOfInteger) aSeqOfIDs;
|
||||
|
||||
// Check presence of triangulation, build if need
|
||||
if (!GEOMImpl_IShapesOperations::CheckTriangulation(aShape)) {
|
||||
if (!GEOMUtils::CheckTriangulation(aShape)) {
|
||||
StdFail_NotDone::Raise("Cannot build triangulation on the shape");
|
||||
return aSeqOfIDs;
|
||||
}
|
||||
@ -179,7 +179,7 @@ Handle(TColStd_HSequenceOfInteger)
|
||||
Handle(TColStd_HSequenceOfInteger) aSeqOfIDs;
|
||||
|
||||
// Check presence of triangulation, build if need
|
||||
if (!GEOMImpl_IShapesOperations::CheckTriangulation(theShape)) {
|
||||
if (!GEOMUtils::CheckTriangulation(theShape)) {
|
||||
StdFail_NotDone::Raise("Cannot build triangulation on the shape");
|
||||
return aSeqOfIDs;
|
||||
}
|
||||
|
@ -18,7 +18,6 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
#include <Standard_Stream.hxx>
|
||||
|
||||
@ -27,7 +26,7 @@
|
||||
#include <GEOMImpl_Types.hxx>
|
||||
#include <GEOM_Function.hxx>
|
||||
|
||||
#include <GEOMImpl_IMeasureOperations.hxx>
|
||||
#include <GEOMUtils.hxx>
|
||||
|
||||
#include <Basics_OCCTVersion.hxx>
|
||||
|
||||
@ -142,7 +141,7 @@ Standard_Integer GEOMImpl_PlaneDriver::Execute(TFunction_Logbook& log) const
|
||||
// Standard_TypeMismatch::Raise("Plane creation aborted: non-planar face given as argument");
|
||||
//}
|
||||
//aShape = BRepBuilderAPI_MakeFace(aGS, -aSize, +aSize, -aSize, +aSize).Shape();
|
||||
gp_Ax3 anAx3 = GEOMImpl_IMeasureOperations::GetPosition(aRefShape);
|
||||
gp_Ax3 anAx3 = GEOMUtils::GetPosition(aRefShape);
|
||||
gp_Pln aPln (anAx3);
|
||||
aShape = BRepBuilderAPI_MakeFace(aPln, -aSize, +aSize, -aSize, +aSize).Shape();
|
||||
}
|
||||
@ -223,7 +222,7 @@ Standard_Integer GEOMImpl_PlaneDriver::Execute(TFunction_Logbook& log) const
|
||||
TopoDS_Shape aRefShape = aRef->GetValue();
|
||||
if (aRefShape.ShapeType() != TopAbs_FACE)
|
||||
return 0;
|
||||
anAx3 = GEOMImpl_IMeasureOperations::GetPosition(aRefShape);
|
||||
anAx3 = GEOMUtils::GetPosition(aRefShape);
|
||||
}
|
||||
|
||||
if ( anOrientation == 2)
|
||||
|
@ -18,16 +18,15 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
//#include <Standard_Stream.hxx>
|
||||
//
|
||||
#include <GEOMImpl_PositionDriver.hxx>
|
||||
|
||||
#include <GEOMImpl_IPosition.hxx>
|
||||
#include <GEOMImpl_Types.hxx>
|
||||
|
||||
#include <GEOM_Function.hxx>
|
||||
|
||||
#include <GEOMImpl_IMeasureOperations.hxx>
|
||||
#include <GEOMUtils.hxx>
|
||||
|
||||
// OCCT Includes
|
||||
#include <BRepBuilderAPI_Transform.hxx>
|
||||
@ -117,10 +116,10 @@ Standard_Integer GEOMImpl_PositionDriver::Execute(TFunction_Logbook& log) const
|
||||
gp_Ax3 aStartAx3, aDestAx3;
|
||||
|
||||
// End LCS
|
||||
aDestAx3 = GEOMImpl_IMeasureOperations::GetPosition(aShapeEndLCS);
|
||||
aDestAx3 = GEOMUtils::GetPosition(aShapeEndLCS);
|
||||
|
||||
// Start LCS
|
||||
aStartAx3 = GEOMImpl_IMeasureOperations::GetPosition(aShapeStartLCS);
|
||||
aStartAx3 = GEOMUtils::GetPosition(aShapeStartLCS);
|
||||
|
||||
// Set transformation
|
||||
aTrsf.SetDisplacement(aStartAx3, aDestAx3);
|
||||
@ -145,7 +144,7 @@ Standard_Integer GEOMImpl_PositionDriver::Execute(TFunction_Logbook& log) const
|
||||
gp_Ax3 aStartAx3, aDestAx3;
|
||||
|
||||
// End LCS
|
||||
aDestAx3 = GEOMImpl_IMeasureOperations::GetPosition(aShapeEndLCS);
|
||||
aDestAx3 = GEOMUtils::GetPosition(aShapeEndLCS);
|
||||
|
||||
// Set transformation
|
||||
aTrsf.SetDisplacement(aStartAx3, aDestAx3);
|
||||
|
@ -18,17 +18,18 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
#include <GEOMImpl_PrismDriver.hxx>
|
||||
|
||||
#include <GEOMImpl_IPrism.hxx>
|
||||
#include <GEOMImpl_IShapesOperations.hxx>
|
||||
#include <GEOMImpl_IMeasureOperations.hxx>
|
||||
#include <GEOMImpl_GlueDriver.hxx>
|
||||
#include <GEOMImpl_PipeDriver.hxx>
|
||||
#include <GEOMImpl_Types.hxx>
|
||||
|
||||
#include <GEOM_Function.hxx>
|
||||
#include <GEOM_Object.hxx>
|
||||
|
||||
#include <GEOMUtils.hxx>
|
||||
|
||||
#include <BRepPrimAPI_MakePrism.hxx>
|
||||
#include <BRepFeat_MakeDPrism.hxx>
|
||||
@ -249,7 +250,7 @@ Standard_Integer GEOMImpl_PrismDriver::Execute(TFunction_Logbook& log) const
|
||||
}
|
||||
else
|
||||
{
|
||||
TopoDS_Shape aRes = GEOMImpl_IShapesOperations::CompsolidToCompound(aShape);
|
||||
TopoDS_Shape aRes = GEOMUtils::CompsolidToCompound(aShape);
|
||||
aFunction->SetValue(aRes);
|
||||
}
|
||||
|
||||
@ -275,7 +276,7 @@ TopoDS_Shape GEOMImpl_PrismDriver::MakeScaledPrism (const TopoDS_Shape& theShape
|
||||
// 1. aCDG = geompy.MakeCDG(theBase)
|
||||
gp_Pnt aCDG = theCDG;
|
||||
if (!isCDG) {
|
||||
gp_Ax3 aPos = GEOMImpl_IMeasureOperations::GetPosition(theShapeBase);
|
||||
gp_Ax3 aPos = GEOMUtils::GetPosition(theShapeBase);
|
||||
aCDG = aPos.Location();
|
||||
}
|
||||
TopoDS_Shape aShapeCDG_1 = BRepBuilderAPI_MakeVertex(aCDG).Shape();
|
||||
|
@ -18,17 +18,18 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
#include <Standard_Stream.hxx>
|
||||
|
||||
#include <GEOMImpl_RevolutionDriver.hxx>
|
||||
|
||||
#include <GEOMImpl_IShapesOperations.hxx>
|
||||
#include <GEOMImpl_IRevolution.hxx>
|
||||
#include <GEOMImpl_Types.hxx>
|
||||
|
||||
#include <GEOM_Function.hxx>
|
||||
|
||||
#include <GEOMUtils.hxx>
|
||||
|
||||
#include <BRepPrimAPI_MakeRevol.hxx>
|
||||
#include <BRepBuilderAPI_Transform.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
@ -128,7 +129,7 @@ Standard_Integer GEOMImpl_RevolutionDriver::Execute(TFunction_Logbook& log) cons
|
||||
|
||||
if (aShape.IsNull()) return 0;
|
||||
|
||||
TopoDS_Shape aRes = GEOMImpl_IShapesOperations::CompsolidToCompound(aShape);
|
||||
TopoDS_Shape aRes = GEOMUtils::CompsolidToCompound(aShape);
|
||||
aFunction->SetValue(aRes);
|
||||
|
||||
log.SetTouched(Label());
|
||||
|
@ -18,7 +18,6 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
#include <Standard_Stream.hxx>
|
||||
|
||||
@ -27,7 +26,7 @@
|
||||
#include <GEOMImpl_Types.hxx>
|
||||
#include <GEOM_Function.hxx>
|
||||
|
||||
#include <GEOMImpl_IMeasureOperations.hxx>
|
||||
#include <GEOMUtils.hxx>
|
||||
|
||||
#include <Basics_Utils.hxx>
|
||||
|
||||
@ -117,7 +116,7 @@ Standard_Integer GEOMImpl_SketcherDriver::Execute(TFunction_Logbook& log) const
|
||||
// return 0;
|
||||
//Handle(Geom_Plane) aGPlane = Handle(Geom_Plane)::DownCast( aGS );
|
||||
//aWPlane = aGPlane->Pln().Position();
|
||||
aWPlane = GEOMImpl_IMeasureOperations::GetPosition(aShape);
|
||||
aWPlane = GEOMUtils::GetPosition(aShape);
|
||||
}
|
||||
gp_Trsf aTrans;
|
||||
aTrans.SetTransformation(aWPlane);
|
||||
|
@ -18,14 +18,14 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
#include <Standard_Stream.hxx>
|
||||
|
||||
#include <GEOMImpl_SplineDriver.hxx>
|
||||
|
||||
#include <GEOMImpl_ISpline.hxx>
|
||||
#include <GEOMImpl_Types.hxx>
|
||||
|
||||
#include <GEOM_Function.hxx>
|
||||
#include <GEOMUtils.hxx>
|
||||
|
||||
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||
#include <BRepBuilderAPI_MakeVertex.hxx>
|
||||
@ -49,6 +49,10 @@
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColgp_HArray1OfPnt.hxx>
|
||||
|
||||
#include <Standard_Stream.hxx>
|
||||
|
||||
#include <Standard_NullObject.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : GetID
|
||||
//purpose :
|
||||
@ -82,54 +86,73 @@ Standard_Integer GEOMImpl_SplineDriver::Execute(TFunction_Logbook& log) const
|
||||
|
||||
TopoDS_Shape aShape;
|
||||
|
||||
if (aType == SPLINE_BEZIER || aType == SPLINE_INTERPOLATION) {
|
||||
if (aType == SPLINE_BEZIER ||
|
||||
aType == SPLINE_INTERPOLATION ||
|
||||
aType == SPLINE_INTERPOL_TANGENTS) {
|
||||
|
||||
bool useCoords = aCI.GetConstructorType() == COORD_CONSTRUCTOR;
|
||||
TColgp_Array1OfPnt points(1, (useCoords ? aCI.GetLength() : 1) );
|
||||
if(useCoords) {
|
||||
Handle(TColStd_HArray1OfReal) aCoordsArray = aCI.GetCoordinates();
|
||||
|
||||
Handle(TColStd_HArray1OfReal) aCoordsArray; // parametric case
|
||||
Handle(TColStd_HSequenceOfTransient) aPoints; // points case
|
||||
|
||||
int aLen = 0;
|
||||
if (useCoords) {
|
||||
aCoordsArray = aCI.GetCoordinates();
|
||||
aLen = aCoordsArray->Length() / 3;
|
||||
}
|
||||
else {
|
||||
aPoints = aCI.GetPoints();
|
||||
aLen = aPoints->Length();
|
||||
}
|
||||
|
||||
if (aLen < 2) return 0;
|
||||
|
||||
TColgp_Array1OfPnt points (1, (useCoords ? aLen : 1));
|
||||
if (useCoords) {
|
||||
int anArrayLength = aCoordsArray->Length();
|
||||
for (int i = 0, j = 1; i <= (anArrayLength-3); i += 3) {
|
||||
gp_Pnt aPnt = gp_Pnt(aCoordsArray->Value(i+1), aCoordsArray->Value(i+2), aCoordsArray->Value(i+3));
|
||||
points.SetValue(j,aPnt);
|
||||
points.SetValue(j, aPnt);
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int ind, aLen = aCI.GetLength();
|
||||
if (aLen < 2) return 0;
|
||||
Standard_Boolean isSeveral = Standard_False;
|
||||
gp_Pnt aPrevP;
|
||||
int aRealLen = aLen;
|
||||
|
||||
if (aType == SPLINE_BEZIER && aCI.GetIsClosed()) {
|
||||
TopoDS_Vertex aV1;
|
||||
if(useCoords) {
|
||||
if (useCoords) {
|
||||
aV1 = BRepBuilderAPI_MakeVertex(points.Value(1));
|
||||
} else {
|
||||
Handle(GEOM_Function) aFPoint = aCI.GetPoint(1);
|
||||
}
|
||||
else {
|
||||
Handle(GEOM_Function) aFPoint = Handle(GEOM_Function)::DownCast(aPoints->Value(1));
|
||||
TopoDS_Shape aFirstPnt = aFPoint->GetValue();
|
||||
aV1 = TopoDS::Vertex(aFirstPnt);
|
||||
}
|
||||
|
||||
TopoDS_Vertex aV2;
|
||||
if(useCoords) {
|
||||
if (useCoords) {
|
||||
aV2 = BRepBuilderAPI_MakeVertex(points.Value(aLen));
|
||||
} else {
|
||||
Handle(GEOM_Function) aLPoint = aCI.GetPoint(aLen);
|
||||
}
|
||||
else {
|
||||
Handle(GEOM_Function) aLPoint = Handle(GEOM_Function)::DownCast(aPoints->Value(aLen));
|
||||
TopoDS_Shape aLastPnt = aLPoint->GetValue();
|
||||
aV2 = TopoDS::Vertex(aLastPnt);
|
||||
}
|
||||
|
||||
|
||||
if (!aV1.IsNull() && !aV2.IsNull() && !aV1.IsSame(aV2)) {
|
||||
aRealLen++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int ind;
|
||||
Standard_Boolean isSeveral = Standard_False;
|
||||
gp_Pnt aPrevP;
|
||||
|
||||
TColgp_Array1OfPnt CurvePoints (1, aRealLen);
|
||||
for (ind = 1; ind <= aLen; ind++) {
|
||||
gp_Pnt aP;
|
||||
if( useCoords ) {
|
||||
if (useCoords) {
|
||||
aP = points.Value(ind);
|
||||
if (!isSeveral && ind > 1) {
|
||||
if (aP.Distance(aPrevP) > Precision::Confusion()) {
|
||||
@ -138,8 +161,9 @@ Standard_Integer GEOMImpl_SplineDriver::Execute(TFunction_Logbook& log) const
|
||||
}
|
||||
CurvePoints.SetValue(ind, aP);
|
||||
aPrevP = aP;
|
||||
} else {
|
||||
Handle(GEOM_Function) aRefPoint = aCI.GetPoint(ind);
|
||||
}
|
||||
else {
|
||||
Handle(GEOM_Function) aRefPoint = Handle(GEOM_Function)::DownCast(aPoints->Value(ind));
|
||||
TopoDS_Shape aShapePnt = aRefPoint->GetValue();
|
||||
if (aShapePnt.ShapeType() == TopAbs_VERTEX) {
|
||||
aP = BRep_Tool::Pnt(TopoDS::Vertex(aShapePnt));
|
||||
@ -153,6 +177,7 @@ Standard_Integer GEOMImpl_SplineDriver::Execute(TFunction_Logbook& log) const
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (aType == SPLINE_BEZIER) {
|
||||
if (!isSeveral) {
|
||||
Standard_ConstructionError::Raise("Points for Bezier Curve are too close");
|
||||
@ -160,13 +185,12 @@ Standard_Integer GEOMImpl_SplineDriver::Execute(TFunction_Logbook& log) const
|
||||
if (aRealLen > aLen) { // set last point equal to first for the closed curve
|
||||
CurvePoints.SetValue(aRealLen, CurvePoints.Value(1));
|
||||
}
|
||||
Handle(Geom_BezierCurve) GBC = new Geom_BezierCurve(CurvePoints);
|
||||
Handle(Geom_BezierCurve) GBC = new Geom_BezierCurve (CurvePoints);
|
||||
aShape = BRepBuilderAPI_MakeEdge(GBC).Edge();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
//GeomAPI_PointsToBSpline GBC (CurvePoints);
|
||||
//aShape = BRepBuilderAPI_MakeEdge(GBC).Edge();
|
||||
|
||||
Handle(TColgp_HArray1OfPnt) aHCurvePoints = new TColgp_HArray1OfPnt(1, aLen);
|
||||
|
||||
if (aCI.GetDoReordering()) {
|
||||
for (int curInd = 1; curInd < aLen - 1; curInd++) {
|
||||
@ -194,18 +218,35 @@ Standard_Integer GEOMImpl_SplineDriver::Execute(TFunction_Logbook& log) const
|
||||
CurvePoints.SetValue(curInd + 1, nearPnt);
|
||||
}
|
||||
}
|
||||
for (ind = 1; ind <= aLen; ind++) {
|
||||
aHCurvePoints->SetValue(ind, CurvePoints.Value(ind));
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (ind = 1; ind <= aLen; ind++) {
|
||||
aHCurvePoints->SetValue(ind, CurvePoints.Value(ind));
|
||||
}
|
||||
|
||||
Handle(TColgp_HArray1OfPnt) aHCurvePoints = new TColgp_HArray1OfPnt (1, aLen);
|
||||
for (ind = 1; ind <= aLen; ind++) {
|
||||
aHCurvePoints->SetValue(ind, CurvePoints.Value(ind));
|
||||
}
|
||||
|
||||
bool isClosed = aCI.GetIsClosed();
|
||||
|
||||
bool isClosed = Standard_False;
|
||||
if (aType == SPLINE_INTERPOLATION)
|
||||
isClosed = aCI.GetIsClosed();
|
||||
|
||||
GeomAPI_Interpolate GBC (aHCurvePoints, isClosed, gp::Resolution());
|
||||
|
||||
if (aType == SPLINE_INTERPOL_TANGENTS) {
|
||||
Handle(GEOM_Function) aVec1Ref = aCI.GetFirstVector();
|
||||
Handle(GEOM_Function) aVec2Ref = aCI.GetLastVector();
|
||||
|
||||
if (aVec1Ref.IsNull() || aVec2Ref.IsNull())
|
||||
Standard_NullObject::Raise("Null object is given for a vector");
|
||||
|
||||
TopoDS_Shape aVec1Sh = aVec1Ref->GetValue();
|
||||
TopoDS_Shape aVec2Sh = aVec2Ref->GetValue();
|
||||
|
||||
gp_Vec aV1 = GEOMUtils::GetVector(aVec1Sh);
|
||||
gp_Vec aV2 = GEOMUtils::GetVector(aVec2Sh);
|
||||
|
||||
GBC.Load(aV1, aV2, /*Scale*/Standard_True);
|
||||
}
|
||||
|
||||
GBC.Perform();
|
||||
if (GBC.IsDone())
|
||||
aShape = BRepBuilderAPI_MakeEdge(GBC.Curve()).Edge();
|
||||
@ -215,13 +256,13 @@ Standard_Integer GEOMImpl_SplineDriver::Execute(TFunction_Logbook& log) const
|
||||
}
|
||||
else {
|
||||
}
|
||||
|
||||
|
||||
if (aShape.IsNull()) return 0;
|
||||
|
||||
|
||||
aFunction->SetValue(aShape);
|
||||
|
||||
|
||||
log.SetTouched(Label());
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -234,8 +234,9 @@
|
||||
|
||||
#define POLYLINE_POINTS 1
|
||||
|
||||
#define SPLINE_BEZIER 1
|
||||
#define SPLINE_INTERPOLATION 2
|
||||
#define SPLINE_BEZIER 1
|
||||
#define SPLINE_INTERPOLATION 2
|
||||
#define SPLINE_INTERPOL_TANGENTS 3
|
||||
|
||||
#define CIRCLE_THREE_PNT 1
|
||||
#define CIRCLE_PNT_VEC_R 2
|
||||
|
@ -238,14 +238,18 @@ libGEOMimpl_la_CPPFLAGS = \
|
||||
-I$(srcdir)/../NMTDS \
|
||||
-I$(srcdir)/../NMTTools \
|
||||
-I$(srcdir)/../GEOM \
|
||||
-I$(srcdir)/../BlockFix \
|
||||
-I$(srcdir)/../GEOMAlgo \
|
||||
-I$(srcdir)/../GEOMUtils \
|
||||
-I$(srcdir)/../SKETCHER \
|
||||
-I$(srcdir)/../ARCHIMEDE \
|
||||
-I$(top_builddir)/idl
|
||||
|
||||
libGEOMimpl_la_LDFLAGS = \
|
||||
../GEOM/libGEOMbasic.la \
|
||||
../BlockFix/libBlockFix.la \
|
||||
../GEOMAlgo/libGEOMAlgo.la \
|
||||
../GEOMUtils/libGEOMUtils.la \
|
||||
../ShHealOper/libShHealOper.la \
|
||||
../ARCHIMEDE/libGEOMArchimede.la \
|
||||
../SKETCHER/libGEOMSketcher.la \
|
||||
|
499
src/GEOMUtils/GEOMUtils.cxx
Normal file
499
src/GEOMUtils/GEOMUtils.cxx
Normal file
@ -0,0 +1,499 @@
|
||||
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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
|
||||
|
||||
#include <Standard_Stream.hxx>
|
||||
|
||||
#include <GEOMUtils.hxx>
|
||||
|
||||
#include <Basics_OCCTVersion.hxx>
|
||||
|
||||
#include <utilities.h>
|
||||
#include <OpUtil.hxx>
|
||||
#include <Utils_ExceptHandlers.hxx>
|
||||
|
||||
// OCCT Includes
|
||||
#include <BRepMesh_IncrementalMesh.hxx>
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepBndLib.hxx>
|
||||
#include <BRepGProp.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
|
||||
#include <Bnd_Box.hxx>
|
||||
|
||||
#include <TopAbs.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
|
||||
#include <GeomLProp_CLProps.hxx>
|
||||
#include <GeomLProp_SLProps.hxx>
|
||||
|
||||
#include <GProp_GProps.hxx>
|
||||
#include <GProp_PrincipalProps.hxx>
|
||||
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <Standard_Failure.hxx>
|
||||
#include <Standard_NullObject.hxx>
|
||||
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
|
||||
|
||||
#define STD_SORT_ALGO 1
|
||||
|
||||
//=======================================================================
|
||||
//function : GetPosition
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
gp_Ax3 GEOMUtils::GetPosition (const TopoDS_Shape& theShape)
|
||||
{
|
||||
gp_Ax3 aResult;
|
||||
|
||||
if (theShape.IsNull())
|
||||
return aResult;
|
||||
|
||||
// Axes
|
||||
aResult.Transform(theShape.Location().Transformation());
|
||||
if (theShape.ShapeType() == TopAbs_FACE) {
|
||||
Handle(Geom_Surface) aGS = BRep_Tool::Surface(TopoDS::Face(theShape));
|
||||
if (!aGS.IsNull() && aGS->IsKind(STANDARD_TYPE(Geom_Plane))) {
|
||||
Handle(Geom_Plane) aGPlane = Handle(Geom_Plane)::DownCast(aGS);
|
||||
gp_Pln aPln = aGPlane->Pln();
|
||||
aResult = aPln.Position();
|
||||
// In case of reverse orinetation of the face invert the plane normal
|
||||
// (the face's normal does not mathc the plane's normal in this case)
|
||||
if(theShape.Orientation() == TopAbs_REVERSED)
|
||||
{
|
||||
gp_Dir Vx = aResult.XDirection();
|
||||
gp_Dir N = aResult.Direction().Mirrored(Vx);
|
||||
gp_Pnt P = aResult.Location();
|
||||
aResult = gp_Ax3(P, N, Vx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Origin
|
||||
gp_Pnt aPnt;
|
||||
|
||||
TopAbs_ShapeEnum aShType = theShape.ShapeType();
|
||||
|
||||
if (aShType == TopAbs_VERTEX) {
|
||||
aPnt = BRep_Tool::Pnt(TopoDS::Vertex(theShape));
|
||||
}
|
||||
else {
|
||||
if (aShType == TopAbs_COMPOUND) {
|
||||
aShType = GetTypeOfSimplePart(theShape);
|
||||
}
|
||||
|
||||
GProp_GProps aSystem;
|
||||
if (aShType == TopAbs_EDGE || aShType == TopAbs_WIRE)
|
||||
BRepGProp::LinearProperties(theShape, aSystem);
|
||||
else if (aShType == TopAbs_FACE || aShType == TopAbs_SHELL)
|
||||
BRepGProp::SurfaceProperties(theShape, aSystem);
|
||||
else
|
||||
BRepGProp::VolumeProperties(theShape, aSystem);
|
||||
|
||||
aPnt = aSystem.CentreOfMass();
|
||||
}
|
||||
|
||||
aResult.SetLocation(aPnt);
|
||||
|
||||
return aResult;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetVector
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
gp_Vec GEOMUtils::GetVector (const TopoDS_Shape& theShape)
|
||||
{
|
||||
if (theShape.IsNull())
|
||||
Standard_NullObject::Raise("Null shape is given for a vector");
|
||||
|
||||
if (theShape.ShapeType() != TopAbs_EDGE)
|
||||
Standard_TypeMismatch::Raise("Invalid shape is given, must be a vector or an edge");
|
||||
|
||||
TopoDS_Edge anE = TopoDS::Edge(theShape);
|
||||
|
||||
TopoDS_Vertex V1, V2;
|
||||
TopExp::Vertices(anE, V1, V2, Standard_True);
|
||||
|
||||
if (V1.IsNull() || V2.IsNull())
|
||||
Standard_NullObject::Raise("Invalid edge is given, it must have two points");
|
||||
|
||||
gp_Vec aV (BRep_Tool::Pnt(V1), BRep_Tool::Pnt(V2));
|
||||
if (aV.Magnitude() < gp::Resolution()) {
|
||||
Standard_ConstructionError::Raise("Vector of zero length is given");
|
||||
}
|
||||
|
||||
return aV;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ShapeToDouble
|
||||
//purpose : used by CompareShapes::operator()
|
||||
//=======================================================================
|
||||
std::pair<double, double> ShapeToDouble (const TopoDS_Shape& S, bool isOldSorting)
|
||||
{
|
||||
// Computing of CentreOfMass
|
||||
gp_Pnt GPoint;
|
||||
double Len;
|
||||
|
||||
if (S.ShapeType() == TopAbs_VERTEX) {
|
||||
GPoint = BRep_Tool::Pnt(TopoDS::Vertex(S));
|
||||
Len = (double)S.Orientation();
|
||||
}
|
||||
else {
|
||||
GProp_GProps GPr;
|
||||
// BEGIN: fix for Mantis issue 0020842
|
||||
if (isOldSorting) {
|
||||
BRepGProp::LinearProperties(S, GPr);
|
||||
}
|
||||
else {
|
||||
if (S.ShapeType() == TopAbs_EDGE || S.ShapeType() == TopAbs_WIRE) {
|
||||
BRepGProp::LinearProperties(S, GPr);
|
||||
}
|
||||
else if (S.ShapeType() == TopAbs_FACE || S.ShapeType() == TopAbs_SHELL) {
|
||||
BRepGProp::SurfaceProperties(S, GPr);
|
||||
}
|
||||
else {
|
||||
BRepGProp::VolumeProperties(S, GPr);
|
||||
}
|
||||
}
|
||||
// END: fix for Mantis issue 0020842
|
||||
GPoint = GPr.CentreOfMass();
|
||||
Len = GPr.Mass();
|
||||
}
|
||||
|
||||
double dMidXYZ = GPoint.X() * 999.0 + GPoint.Y() * 99.0 + GPoint.Z() * 0.9;
|
||||
return std::make_pair(dMidXYZ, Len);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : CompareShapes::operator()
|
||||
//purpose : used by std::sort(), called from SortShapes()
|
||||
//=======================================================================
|
||||
bool GEOMUtils::CompareShapes::operator() (const TopoDS_Shape& theShape1,
|
||||
const TopoDS_Shape& theShape2)
|
||||
{
|
||||
if (!myMap.IsBound(theShape1)) {
|
||||
myMap.Bind(theShape1, ShapeToDouble(theShape1, myIsOldSorting));
|
||||
}
|
||||
|
||||
if (!myMap.IsBound(theShape2)) {
|
||||
myMap.Bind(theShape2, ShapeToDouble(theShape2, myIsOldSorting));
|
||||
}
|
||||
|
||||
std::pair<double, double> val1 = myMap.Find(theShape1);
|
||||
std::pair<double, double> val2 = myMap.Find(theShape2);
|
||||
|
||||
double tol = Precision::Confusion();
|
||||
bool exchange = Standard_False;
|
||||
|
||||
double dMidXYZ = val1.first - val2.first;
|
||||
if (dMidXYZ >= tol) {
|
||||
exchange = Standard_True;
|
||||
}
|
||||
else if (Abs(dMidXYZ) < tol) {
|
||||
double dLength = val1.second - val2.second;
|
||||
if (dLength >= tol) {
|
||||
exchange = Standard_True;
|
||||
}
|
||||
else if (Abs(dLength) < tol && theShape1.ShapeType() <= TopAbs_FACE) {
|
||||
// PAL17233
|
||||
// equal values possible on shapes such as two halves of a sphere and
|
||||
// a membrane inside the sphere
|
||||
Bnd_Box box1,box2;
|
||||
BRepBndLib::Add(theShape1, box1);
|
||||
if (!box1.IsVoid()) {
|
||||
BRepBndLib::Add(theShape2, box2);
|
||||
Standard_Real dSquareExtent = box1.SquareExtent() - box2.SquareExtent();
|
||||
if (dSquareExtent >= tol) {
|
||||
exchange = Standard_True;
|
||||
}
|
||||
else if (Abs(dSquareExtent) < tol) {
|
||||
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax, val1, val2;
|
||||
box1.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
|
||||
val1 = (aXmin+aXmax)*999.0 + (aYmin+aYmax)*99.0 + (aZmin+aZmax)*0.9;
|
||||
box2.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
|
||||
val2 = (aXmin+aXmax)*999.0 + (aYmin+aYmax)*99.0 + (aZmin+aZmax)*0.9;
|
||||
if ((val1 - val2) >= tol) {
|
||||
exchange = Standard_True;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//return val1 < val2;
|
||||
return !exchange;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SortShapes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMUtils::SortShapes (TopTools_ListOfShape& SL,
|
||||
const Standard_Boolean isOldSorting)
|
||||
{
|
||||
#ifdef STD_SORT_ALGO
|
||||
std::vector<TopoDS_Shape> aShapesVec;
|
||||
aShapesVec.reserve(SL.Extent());
|
||||
|
||||
TopTools_ListIteratorOfListOfShape it (SL);
|
||||
for (; it.More(); it.Next()) {
|
||||
aShapesVec.push_back(it.Value());
|
||||
}
|
||||
SL.Clear();
|
||||
|
||||
CompareShapes shComp (isOldSorting);
|
||||
std::stable_sort(aShapesVec.begin(), aShapesVec.end(), shComp);
|
||||
//std::sort(aShapesVec.begin(), aShapesVec.end(), shComp);
|
||||
|
||||
std::vector<TopoDS_Shape>::const_iterator anIter = aShapesVec.begin();
|
||||
for (; anIter != aShapesVec.end(); ++anIter) {
|
||||
SL.Append(*anIter);
|
||||
}
|
||||
#else
|
||||
// old implementation
|
||||
Standard_Integer MaxShapes = SL.Extent();
|
||||
TopTools_Array1OfShape aShapes (1,MaxShapes);
|
||||
TColStd_Array1OfInteger OrderInd(1,MaxShapes);
|
||||
TColStd_Array1OfReal MidXYZ (1,MaxShapes); //X,Y,Z;
|
||||
TColStd_Array1OfReal Length (1,MaxShapes); //X,Y,Z;
|
||||
|
||||
// Computing of CentreOfMass
|
||||
Standard_Integer Index;
|
||||
GProp_GProps GPr;
|
||||
gp_Pnt GPoint;
|
||||
TopTools_ListIteratorOfListOfShape it(SL);
|
||||
for (Index=1; it.More(); Index++)
|
||||
{
|
||||
TopoDS_Shape S = it.Value();
|
||||
SL.Remove( it ); // == it.Next()
|
||||
aShapes(Index) = S;
|
||||
OrderInd.SetValue (Index, Index);
|
||||
if (S.ShapeType() == TopAbs_VERTEX) {
|
||||
GPoint = BRep_Tool::Pnt( TopoDS::Vertex( S ));
|
||||
Length.SetValue( Index, (Standard_Real) S.Orientation());
|
||||
}
|
||||
else {
|
||||
// BEGIN: fix for Mantis issue 0020842
|
||||
if (isOldSorting) {
|
||||
BRepGProp::LinearProperties (S, GPr);
|
||||
}
|
||||
else {
|
||||
if (S.ShapeType() == TopAbs_EDGE || S.ShapeType() == TopAbs_WIRE) {
|
||||
BRepGProp::LinearProperties (S, GPr);
|
||||
}
|
||||
else if (S.ShapeType() == TopAbs_FACE || S.ShapeType() == TopAbs_SHELL) {
|
||||
BRepGProp::SurfaceProperties(S, GPr);
|
||||
}
|
||||
else {
|
||||
BRepGProp::VolumeProperties(S, GPr);
|
||||
}
|
||||
}
|
||||
// END: fix for Mantis issue 0020842
|
||||
GPoint = GPr.CentreOfMass();
|
||||
Length.SetValue(Index, GPr.Mass());
|
||||
}
|
||||
MidXYZ.SetValue(Index, GPoint.X()*999.0 + GPoint.Y()*99.0 + GPoint.Z()*0.9);
|
||||
//cout << Index << " L: " << Length(Index) << "CG: " << MidXYZ(Index) << endl;
|
||||
}
|
||||
|
||||
// Sorting
|
||||
Standard_Integer aTemp;
|
||||
Standard_Boolean exchange, Sort = Standard_True;
|
||||
Standard_Real tol = Precision::Confusion();
|
||||
while (Sort)
|
||||
{
|
||||
Sort = Standard_False;
|
||||
for (Index=1; Index < MaxShapes; Index++)
|
||||
{
|
||||
exchange = Standard_False;
|
||||
Standard_Real dMidXYZ = MidXYZ(OrderInd(Index)) - MidXYZ(OrderInd(Index+1));
|
||||
Standard_Real dLength = Length(OrderInd(Index)) - Length(OrderInd(Index+1));
|
||||
if ( dMidXYZ >= tol ) {
|
||||
// cout << "MidXYZ: " << MidXYZ(OrderInd(Index))<< " > " <<MidXYZ(OrderInd(Index+1))
|
||||
// << " d: " << dMidXYZ << endl;
|
||||
exchange = Standard_True;
|
||||
}
|
||||
else if ( Abs(dMidXYZ) < tol && dLength >= tol ) {
|
||||
// cout << "Length: " << Length(OrderInd(Index))<< " > " <<Length(OrderInd(Index+1))
|
||||
// << " d: " << dLength << endl;
|
||||
exchange = Standard_True;
|
||||
}
|
||||
else if ( Abs(dMidXYZ) < tol && Abs(dLength) < tol &&
|
||||
aShapes(OrderInd(Index)).ShapeType() <= TopAbs_FACE) {
|
||||
// PAL17233
|
||||
// equal values possible on shapes such as two halves of a sphere and
|
||||
// a membrane inside the sphere
|
||||
Bnd_Box box1,box2;
|
||||
BRepBndLib::Add( aShapes( OrderInd(Index) ), box1 );
|
||||
if ( box1.IsVoid() ) continue;
|
||||
BRepBndLib::Add( aShapes( OrderInd(Index+1) ), box2 );
|
||||
Standard_Real dSquareExtent = box1.SquareExtent() - box2.SquareExtent();
|
||||
if ( dSquareExtent >= tol ) {
|
||||
// cout << "SquareExtent: " << box1.SquareExtent()<<" > "<<box2.SquareExtent() << endl;
|
||||
exchange = Standard_True;
|
||||
}
|
||||
else if ( Abs(dSquareExtent) < tol ) {
|
||||
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax, val1, val2;
|
||||
box1.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
|
||||
val1 = (aXmin+aXmax)*999 + (aYmin+aYmax)*99 + (aZmin+aZmax)*0.9;
|
||||
box2.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
|
||||
val2 = (aXmin+aXmax)*999 + (aYmin+aYmax)*99 + (aZmin+aZmax)*0.9;
|
||||
//exchange = val1 > val2;
|
||||
if ((val1 - val2) >= tol) {
|
||||
exchange = Standard_True;
|
||||
}
|
||||
//cout << "box: " << val1<<" > "<<val2 << endl;
|
||||
}
|
||||
}
|
||||
|
||||
if (exchange)
|
||||
{
|
||||
// cout << "exchange " << Index << " & " << Index+1 << endl;
|
||||
aTemp = OrderInd(Index);
|
||||
OrderInd(Index) = OrderInd(Index+1);
|
||||
OrderInd(Index+1) = aTemp;
|
||||
Sort = Standard_True;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (Index=1; Index <= MaxShapes; Index++)
|
||||
SL.Append( aShapes( OrderInd(Index) ));
|
||||
#endif
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : CompsolidToCompound
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
TopoDS_Shape GEOMUtils::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 GEOMUtils::CheckTriangulation (const TopoDS_Shape& aShape)
|
||||
{
|
||||
bool isTriangulation = true;
|
||||
|
||||
TopExp_Explorer exp (aShape, TopAbs_FACE);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isTriangulation) {
|
||||
// calculate deflection
|
||||
Standard_Real aDeviationCoefficient = 0.001;
|
||||
|
||||
Bnd_Box B;
|
||||
BRepBndLib::Add(aShape, B);
|
||||
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
|
||||
B.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
|
||||
|
||||
Standard_Real dx = aXmax - aXmin, dy = aYmax - aYmin, dz = aZmax - aZmin;
|
||||
Standard_Real aDeflection = Max(Max(dx, dy), dz) * aDeviationCoefficient * 4;
|
||||
Standard_Real aHLRAngle = 0.349066;
|
||||
|
||||
BRepMesh_IncrementalMesh Inc (aShape, aDeflection, Standard_False, aHLRAngle);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetTypeOfSimplePart
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
TopAbs_ShapeEnum GEOMUtils::GetTypeOfSimplePart (const TopoDS_Shape& theShape)
|
||||
{
|
||||
TopAbs_ShapeEnum aType = theShape.ShapeType();
|
||||
if (aType == TopAbs_VERTEX) return TopAbs_VERTEX;
|
||||
else if (aType == TopAbs_EDGE || aType == TopAbs_WIRE) return TopAbs_EDGE;
|
||||
else if (aType == TopAbs_FACE || aType == TopAbs_SHELL) return TopAbs_FACE;
|
||||
else if (aType == TopAbs_SOLID || aType == TopAbs_COMPSOLID) return TopAbs_SOLID;
|
||||
else if (aType == TopAbs_COMPOUND) {
|
||||
// Only the iType of the first shape in the compound is taken into account
|
||||
TopoDS_Iterator It (theShape, Standard_False, Standard_False);
|
||||
if (It.More()) {
|
||||
return GetTypeOfSimplePart(It.Value());
|
||||
}
|
||||
}
|
||||
return TopAbs_SHAPE;
|
||||
}
|
106
src/GEOMUtils/GEOMUtils.hxx
Normal file
106
src/GEOMUtils/GEOMUtils.hxx
Normal file
@ -0,0 +1,106 @@
|
||||
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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 _GEOMUtils_HXX_
|
||||
#define _GEOMUtils_HXX_
|
||||
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
|
||||
#include <TopAbs.hxx>
|
||||
|
||||
#include <gp_Ax3.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
|
||||
#include <NCollection_DataMap.hxx>
|
||||
|
||||
inline Standard_Boolean IsEqual (const TopoDS_Shape& S1, const TopoDS_Shape& S2)
|
||||
{
|
||||
return S1.IsSame(S2);
|
||||
}
|
||||
|
||||
class GEOMUtils {
|
||||
|
||||
public:
|
||||
/*!
|
||||
* \brief Get Local Coordinate System, corresponding to the given shape.
|
||||
*
|
||||
* Origin of the LCS is situated at the shape's center of mass.
|
||||
* Axes of the LCS are obtained from shape's location or,
|
||||
* if the shape is a planar face, from position of its plane.
|
||||
*/
|
||||
Standard_EXPORT static gp_Ax3 GetPosition (const TopoDS_Shape& theShape);
|
||||
|
||||
/*!
|
||||
* \brief Get vector, defined by the given edge.
|
||||
*/
|
||||
Standard_EXPORT static gp_Vec GetVector (const TopoDS_Shape& theShape);
|
||||
|
||||
/*!
|
||||
* \brief Sort shapes in the list by their coordinates.
|
||||
* \param SL The list of shapes to sort.
|
||||
*/
|
||||
struct CompareShapes : public std::binary_function<TopoDS_Shape, TopoDS_Shape, bool>
|
||||
{
|
||||
CompareShapes (bool isOldSorting)
|
||||
: myIsOldSorting(isOldSorting) {}
|
||||
|
||||
bool operator() (const TopoDS_Shape& lhs, const TopoDS_Shape& rhs);
|
||||
|
||||
typedef NCollection_DataMap<TopoDS_Shape, std::pair<double, double> > GEOMUtils_DataMapOfShapeDouble;
|
||||
GEOMUtils_DataMapOfShapeDouble myMap;
|
||||
bool myIsOldSorting;
|
||||
};
|
||||
|
||||
/*!
|
||||
* \brief Sort shapes by their centers of mass, using formula X*999 + Y*99 + Z*0.9
|
||||
*/
|
||||
Standard_EXPORT static void SortShapes (TopTools_ListOfShape& SL,
|
||||
const Standard_Boolean isOldSorting = Standard_True);
|
||||
|
||||
/*!
|
||||
* \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);
|
||||
|
||||
/*!
|
||||
* \brief Return type of shape for explode. In case of compound it will be a type of its first sub shape.
|
||||
* \param theShape The shape to get type of.
|
||||
* \retval TopAbs_ShapeEnum Return type of shape for explode.
|
||||
*/
|
||||
Standard_EXPORT static TopAbs_ShapeEnum GetTypeOfSimplePart (const TopoDS_Shape& theShape);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
57
src/GEOMUtils/Makefile.am
Normal file
57
src/GEOMUtils/Makefile.am
Normal file
@ -0,0 +1,57 @@
|
||||
# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
#
|
||||
# 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
|
||||
|
||||
# GEOMUtils : implementaion of some common methods for GEOMImpl package
|
||||
# File : Makefile.am
|
||||
# Author : Julia DOROVSKIKH
|
||||
|
||||
include $(top_srcdir)/adm_local/unix/make_common_starter.am
|
||||
|
||||
# Libraries targets
|
||||
lib_LTLIBRARIES = libGEOMUtils.la
|
||||
|
||||
# header files
|
||||
salomeinclude_HEADERS = \
|
||||
GEOMUtils.hxx
|
||||
|
||||
dist_libGEOMUtils_la_SOURCES = \
|
||||
GEOMUtils.cxx
|
||||
|
||||
# additional information to compile and link file
|
||||
|
||||
libGEOMUtils_la_CPPFLAGS = \
|
||||
$(CAS_CPPFLAGS) \
|
||||
$(KERNEL_CXXFLAGS) \
|
||||
$(BOOST_CPPFLAGS) \
|
||||
-I$(srcdir)/../ShHealOper \
|
||||
-I$(srcdir)/../NMTDS \
|
||||
-I$(srcdir)/../NMTTools \
|
||||
-I$(srcdir)/../BlockFix \
|
||||
-I$(srcdir)/../GEOMAlgo \
|
||||
-I$(srcdir)/../SKETCHER \
|
||||
-I$(srcdir)/../ARCHIMEDE
|
||||
|
||||
libGEOMUtils_la_LDFLAGS = \
|
||||
../BlockFix/libBlockFix.la \
|
||||
../GEOMAlgo/libGEOMAlgo.la \
|
||||
../ShHealOper/libShHealOper.la \
|
||||
../ARCHIMEDE/libGEOMArchimede.la \
|
||||
../SKETCHER/libGEOMSketcher.la \
|
||||
$(KERNEL_LDFLAGS) -lSALOMELocalTrace -lSALOMEBasics \
|
||||
$(CAS_LDPATH) -lTKCAF -lTKFillet -lTKOffset -lTKFeat \
|
||||
$(STDLIB)
|
@ -427,6 +427,46 @@ GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeSplineInterpolation
|
||||
return GetObject(anObject);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
* MakeSplineInterpolWithTangents
|
||||
*/
|
||||
//=============================================================================
|
||||
GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeSplineInterpolWithTangents
|
||||
(const GEOM::ListOfGO& thePoints,
|
||||
GEOM::GEOM_Object_ptr theFirstVec,
|
||||
GEOM::GEOM_Object_ptr theLastVec)
|
||||
{
|
||||
GEOM::GEOM_Object_var aGEOMObject;
|
||||
|
||||
//Set a not done flag
|
||||
GetOperations()->SetNotDone();
|
||||
|
||||
//Get the reference points
|
||||
int ind = 0;
|
||||
int aLen = thePoints.length();
|
||||
std::list<Handle(GEOM_Object)> aPoints;
|
||||
for (; ind < aLen; ind++) {
|
||||
Handle(GEOM_Object) aPnt = GetObjectImpl(thePoints[ind]);
|
||||
if (aPnt.IsNull()) return aGEOMObject._retn();
|
||||
aPoints.push_back(aPnt);
|
||||
}
|
||||
|
||||
//Get the reference vectors
|
||||
Handle(GEOM_Object) aVec1 = GetObjectImpl(theFirstVec);
|
||||
Handle(GEOM_Object) aVec2 = GetObjectImpl(theLastVec);
|
||||
|
||||
if (aVec1.IsNull() || aVec2.IsNull()) return aGEOMObject._retn();
|
||||
|
||||
// Make Polyline
|
||||
Handle(GEOM_Object) anObject =
|
||||
GetOperations()->MakeSplineInterpolWithTangents(aPoints, aVec1, aVec2);
|
||||
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||
return aGEOMObject._retn();
|
||||
|
||||
return GetObject(anObject);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
* MakeCurveParametric
|
||||
|
@ -85,6 +85,10 @@ class GEOM_I_EXPORT GEOM_ICurvesOperations_i :
|
||||
CORBA::Boolean theIsClosed,
|
||||
CORBA::Boolean theDoReordering);
|
||||
|
||||
GEOM::GEOM_Object_ptr MakeSplineInterpolWithTangents (const GEOM::ListOfGO& thePoints,
|
||||
GEOM::GEOM_Object_ptr theFirstVec,
|
||||
GEOM::GEOM_Object_ptr theLastVec);
|
||||
|
||||
GEOM::GEOM_Object_ptr MakeCurveParametric
|
||||
(const char* thexExpr, const char* theyExpr, const char* thezExpr,
|
||||
double theParamMin, double theParamMax, double theParamStep,
|
||||
|
@ -102,6 +102,8 @@ def TestAll (geompy, math):
|
||||
Polyline = geompy.MakePolyline([p0, pz, py, p200]) #(List of GEOM_Object)->GEOM_Object
|
||||
Bezier = geompy.MakeBezier([p0, pz, p200, px]) #(List of GEOM_Object)->GEOM_Object
|
||||
Interpol = geompy.MakeInterpol([px, py, p200, pxyz], True) #(List of GEOM_Object,Boolean)->GEOM_Object
|
||||
InterpT1 = geompy.MakeInterpolWithTangents([px, py, pxyz], vx, vz) #(List of GO, GO, GO)->GEOM_Object
|
||||
InterpT2 = geompy.MakeInterpolWithTangents([px, py, pxyz], vxy, vxyz) #(List of GO, GO, GO)->GEOM_Object
|
||||
Sketcher = geompy.MakeSketcher("Sketcher:F -100 -100:TT 250 -100:R 0:C 100 150:R 0:L 300:WW",
|
||||
[100,0,0, 1,1,1, -1,1,0]) #(String, List of Doubles)->GEOM_Object
|
||||
|
||||
@ -343,6 +345,8 @@ def TestAll (geompy, math):
|
||||
id_Polyline = geompy.addToStudy(Polyline, "Polyline")
|
||||
id_Bezier = geompy.addToStudy(Bezier, "Bezier")
|
||||
id_Interpol = geompy.addToStudy(Interpol, "Interpol")
|
||||
id_InterpT1 = geompy.addToStudy(InterpT1, "InterpT1")
|
||||
id_InterpT2 = geompy.addToStudy(InterpT2, "InterpT2")
|
||||
id_Sketcher = geompy.addToStudy(Sketcher, "Sketcher")
|
||||
|
||||
id_Sketcher3d_1 = geompy.addToStudy(Sketcher3d_1, "Sketcher 3D by interface")
|
||||
|
@ -1579,9 +1579,32 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
||||
"""
|
||||
# Example: see GEOM_TestAll.py
|
||||
anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
|
||||
RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
|
||||
RaiseIfFailed("MakeInterpol", self.CurvesOp)
|
||||
return anObj
|
||||
|
||||
## Create B-Spline curve on the set of points.
|
||||
# @param thePoints Sequence of points for the B-Spline curve.
|
||||
# @param theFirstVec Vector object, defining the curve direction at its first point.
|
||||
# @param theLastVec Vector object, defining the curve direction at its last point.
|
||||
# @return New GEOM.GEOM_Object, containing the created B-Spline curve.
|
||||
#
|
||||
# @ref tui_creation_curve "Example"
|
||||
def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec):
|
||||
"""
|
||||
Create B-Spline curve on the set of points.
|
||||
|
||||
Parameters:
|
||||
thePoints Sequence of points for the B-Spline curve.
|
||||
theFirstVec Vector object, defining the curve direction at its first point.
|
||||
theLastVec Vector object, defining the curve direction at its last point.
|
||||
|
||||
Returns:
|
||||
New GEOM.GEOM_Object, containing the created B-Spline curve.
|
||||
"""
|
||||
# Example: see GEOM_TestAll.py
|
||||
anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
|
||||
RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
|
||||
return anObj
|
||||
|
||||
## Creates a curve using the parametric definition of the basic points.
|
||||
# @param thexExpr parametric equation of the coordinates X.
|
||||
@ -1622,8 +1645,6 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
||||
RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
|
||||
anObj.SetParameters(Parameters)
|
||||
return anObj
|
||||
|
||||
|
||||
|
||||
# end of l4_curves
|
||||
## @}
|
||||
|
@ -15,15 +15,14 @@
|
||||
# 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.am
|
||||
# Author : Alexander BORODIN, Open CASCADE S.A.S. (alexander.borodin@opencascade.com)
|
||||
# Package : src (source files directory)
|
||||
|
||||
SUBDIRS = ARCHIMEDE NMTDS NMTTools GEOMAlgo SKETCHER OCC2VTK GEOM \
|
||||
BREPExport BREPImport IGESExport IGESImport STEPExport \
|
||||
STEPImport STLExport VTKExport ShHealOper GEOMImpl GEOM_I \
|
||||
SUBDIRS = ARCHIMEDE NMTDS NMTTools BlockFix GEOMAlgo SKETCHER OCC2VTK GEOM \
|
||||
BREPExport BREPImport IGESExport IGESImport STEPExport STEPImport \
|
||||
STLExport VTKExport ShHealOper GEOMUtils GEOMImpl GEOM_I \
|
||||
GEOMClient GEOM_I_Superv GEOM_SWIG GEOM_PY
|
||||
|
||||
if WITH_OPENCV
|
||||
@ -31,18 +30,18 @@ if WITH_OPENCV
|
||||
endif
|
||||
|
||||
if GEOM_ENABLE_GUI
|
||||
SUBDIRS += OBJECT DlgRef GEOMFiltersSelection Material GEOMGUI GEOMBase GEOMToolsGUI \
|
||||
DisplayGUI BasicGUI PrimitiveGUI GenerationGUI EntityGUI BuildGUI \
|
||||
BooleanGUI TransformationGUI OperationGUI RepairGUI MeasureGUI \
|
||||
GroupGUI BlocksGUI AdvancedGUI GEOM_SWIG_WITHIHM
|
||||
SUBDIRS += OBJECT DlgRef GEOMFiltersSelection Material GEOMGUI GEOMBase \
|
||||
GEOMToolsGUI DisplayGUI BasicGUI PrimitiveGUI GenerationGUI \
|
||||
EntityGUI BuildGUI BooleanGUI TransformationGUI OperationGUI \
|
||||
RepairGUI MeasureGUI GroupGUI BlocksGUI AdvancedGUI GEOM_SWIG_WITHIHM
|
||||
endif
|
||||
|
||||
DIST_SUBDIRS = ARCHIMEDE NMTDS NMTTools GEOMAlgo \
|
||||
SKETCHER OCC2VTK GEOM BREPExport \
|
||||
BREPImport IGESExport IGESImport STEPExport STEPImport STLExport \
|
||||
VTKExport ShHealOper GEOMImpl GEOM_I GEOMClient GEOM_I_Superv \
|
||||
GEOM_SWIG OBJECT DlgRef GEOMFiltersSelection Material GEOMGUI GEOMBase \
|
||||
DIST_SUBDIRS = ARCHIMEDE NMTDS NMTTools BlockFix GEOMAlgo SKETCHER \
|
||||
OCC2VTK GEOM BREPExport BREPImport IGESExport IGESImport \
|
||||
STEPExport STEPImport STLExport VTKExport ShHealOper GEOMUtils \
|
||||
GEOMImpl GEOM_I GEOMClient GEOM_I_Superv GEOM_SWIG OBJECT \
|
||||
DlgRef GEOMFiltersSelection Material GEOMGUI GEOMBase \
|
||||
GEOMToolsGUI DisplayGUI BasicGUI PrimitiveGUI GenerationGUI \
|
||||
EntityGUI BuildGUI BooleanGUI TransformationGUI OperationGUI \
|
||||
RepairGUI MeasureGUI GroupGUI BlocksGUI AdvancedGUI \
|
||||
RepairGUI MeasureGUI GroupGUI BlocksGUI AdvancedGUI \
|
||||
GEOM_SWIG_WITHIHM GEOM_PY ShapeRecognition
|
||||
|
Loading…
Reference in New Issue
Block a user