mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-12-29 10:50:35 +05:00
Merging with WPdev
This commit is contained in:
parent
611ec94e27
commit
a905ae28f6
47
src/BasicGUI/GEOM_BasicGUI.hxx
Executable file
47
src/BasicGUI/GEOM_BasicGUI.hxx
Executable file
@ -0,0 +1,47 @@
|
|||||||
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// File : GEOM_BasicGUI.hxx
|
||||||
|
// Author : Alexander A. BORODIN
|
||||||
|
// Module : GEOM
|
||||||
|
|
||||||
|
#ifndef _GEOM_BasicGUI_HXX_
|
||||||
|
#define _GEOM_BasicGUI_HXX_
|
||||||
|
|
||||||
|
#ifdef WNT
|
||||||
|
#if defined BASICGUI_EXPORTS
|
||||||
|
#if defined WIN32
|
||||||
|
#define GEOM_BASICGUI_EXPORT __declspec( dllexport )
|
||||||
|
#else
|
||||||
|
#define GEOM_BASICGUI_EXPORT
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#if defined WIN32
|
||||||
|
#define GEOM_BASICGUI_EXPORT __declspec( dllimport )
|
||||||
|
#else
|
||||||
|
#define GEOM_BASICGUI_EXPORT
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define GEOM_BASICGUI_EXPORT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
47
src/BlocksGUI/GEOM_BlocksGUI.hxx
Executable file
47
src/BlocksGUI/GEOM_BlocksGUI.hxx
Executable file
@ -0,0 +1,47 @@
|
|||||||
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// File : GEOM_BlocksGUI.hxx
|
||||||
|
// Author : Alexander A. BORODIN
|
||||||
|
// Module : GEOM
|
||||||
|
|
||||||
|
#ifndef _GEOM_BlocksGUI_HXX_
|
||||||
|
#define _GEOM_BlocksGUI_HXX_
|
||||||
|
|
||||||
|
#ifdef WNT
|
||||||
|
#if defined BLOCKSGUI_EXPORTS
|
||||||
|
#if defined WIN32
|
||||||
|
#define GEOM_BLOCKSGUI_EXPORT __declspec( dllexport )
|
||||||
|
#else
|
||||||
|
#define GEOM_BLOCKSGUI_EXPORT
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#if defined WIN32
|
||||||
|
#define GEOM_BLOCKSGUI_EXPORT __declspec( dllimport )
|
||||||
|
#else
|
||||||
|
#define GEOM_BLOCKSGUI_EXPORT
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define GEOM_BLOCKSGUI_EXPORT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
47
src/BuildGUI/GEOM_BuildGUI.hxx
Executable file
47
src/BuildGUI/GEOM_BuildGUI.hxx
Executable file
@ -0,0 +1,47 @@
|
|||||||
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// File : GEOM_BuildGUI.hxx
|
||||||
|
// Author : Alexander A. BORODIN
|
||||||
|
// Module : GEOM
|
||||||
|
|
||||||
|
#ifndef _GEOM_BuildGUI_HXX_
|
||||||
|
#define _GEOM_BuildGUI_HXX_
|
||||||
|
|
||||||
|
#ifdef WNT
|
||||||
|
#if defined BUILDGUI_EXPORTS
|
||||||
|
#if defined WIN32
|
||||||
|
#define GEOM_BUILDGUI_EXPORT __declspec( dllexport )
|
||||||
|
#else
|
||||||
|
#define GEOM_BUILDGUI_EXPORT
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#if defined WIN32
|
||||||
|
#define GEOM_BUILDGUI_EXPORT __declspec( dllimport )
|
||||||
|
#else
|
||||||
|
#define GEOM_BUILDGUI_EXPORT
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define GEOM_BUILDGUI_EXPORT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
125
src/DlgRef/DlgRef_2Sel1List_QTD.cxx
Normal file
125
src/DlgRef/DlgRef_2Sel1List_QTD.cxx
Normal file
@ -0,0 +1,125 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
//
|
||||||
|
/****************************************************************************
|
||||||
|
** Form implementation generated from reading ui file 'DlgRef_4Sel1List_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: lun oct 31 17:21:04 2006
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#include "DlgRef_2Sel1List_QTD.h"
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qcombobox.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <qlineedit.h>
|
||||||
|
#include <qpushbutton.h>
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qtooltip.h>
|
||||||
|
#include <qwhatsthis.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_2Sel1List_QTD which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'.
|
||||||
|
*/
|
||||||
|
DlgRef_2Sel1List_QTD::DlgRef_2Sel1List_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||||
|
: QWidget( parent, name, fl )
|
||||||
|
{
|
||||||
|
if ( !name )
|
||||||
|
setName( "DlgRef_2Sel1List_QTD" );
|
||||||
|
resize( 129, 175 );
|
||||||
|
setCaption( trUtf8( "DlgRef_2Sel1List_QTD" ) );
|
||||||
|
DlgRef_2Sel1List_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_2Sel1List_QTDLayout");
|
||||||
|
|
||||||
|
GroupBox1 = new QGroupBox( this, "GroupBox1" );
|
||||||
|
GroupBox1->setTitle( trUtf8( "" ) );
|
||||||
|
GroupBox1->setColumnLayout(0, Qt::Vertical );
|
||||||
|
GroupBox1->layout()->setSpacing( 6 );
|
||||||
|
GroupBox1->layout()->setMargin( 11 );
|
||||||
|
GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
|
||||||
|
GroupBox1Layout->setAlignment( Qt::AlignTop );
|
||||||
|
|
||||||
|
Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
|
||||||
|
|
||||||
|
TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
|
||||||
|
TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel1->setText( trUtf8( "TL1" ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( TextLabel1, 0, 0 );
|
||||||
|
|
||||||
|
PushButton1 = new QPushButton( GroupBox1, "PushButton1" );
|
||||||
|
PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
PushButton1->setText( trUtf8( "" ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( PushButton1, 0, 1 );
|
||||||
|
|
||||||
|
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
|
||||||
|
|
||||||
|
Layout1->addWidget( LineEdit1, 0, 2 );
|
||||||
|
|
||||||
|
|
||||||
|
TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
|
||||||
|
TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel2->setText( trUtf8( "TL2" ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( TextLabel2, 1, 0 );
|
||||||
|
|
||||||
|
PushButton2 = new QPushButton( GroupBox1, "PushButton2" );
|
||||||
|
PushButton2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton2->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
PushButton2->setText( trUtf8( "" ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( PushButton2, 1, 1 );
|
||||||
|
|
||||||
|
LineEdit2 = new QLineEdit( GroupBox1, "LineEdit2" );
|
||||||
|
|
||||||
|
Layout1->addWidget( LineEdit2, 1, 2 );
|
||||||
|
|
||||||
|
|
||||||
|
TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
|
||||||
|
TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
TextLabel3->setText( trUtf8( "TL3" ) );
|
||||||
|
|
||||||
|
Layout1->addMultiCellWidget( TextLabel3, 2, 2, 0, 1 );
|
||||||
|
|
||||||
|
ComboBox1 = new QComboBox( FALSE, GroupBox1, "ComboBox1" );
|
||||||
|
ComboBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, ComboBox1->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( ComboBox1, 2, 2 );
|
||||||
|
|
||||||
|
|
||||||
|
GroupBox1Layout->addLayout( Layout1, 0, 0 );
|
||||||
|
|
||||||
|
DlgRef_2Sel1List_QTDLayout->addWidget( GroupBox1, 0, 0 );
|
||||||
|
|
||||||
|
QSpacerItem* spacer = new QSpacerItem( 0, 80, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||||
|
Layout1->addItem( spacer, 5, 2 );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
DlgRef_2Sel1List_QTD::~DlgRef_2Sel1List_QTD()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
69
src/DlgRef/DlgRef_2Sel1List_QTD.h
Normal file
69
src/DlgRef/DlgRef_2Sel1List_QTD.h
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
//
|
||||||
|
/****************************************************************************
|
||||||
|
** Form interface generated from reading ui file 'DlgRef_2Sel1List_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: lun oct 31 17:21:03 2006
|
||||||
|
** by: The User Interface Compiler (uic)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
#ifndef DLGREF_2SEL1LIST_QTD_H
|
||||||
|
#define DLGREF_2SEL1LIST_QTD_H
|
||||||
|
|
||||||
|
#include "GEOM_DlgRef.hxx"
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qwidget.h>
|
||||||
|
class QVBoxLayout;
|
||||||
|
class QHBoxLayout;
|
||||||
|
class QGridLayout;
|
||||||
|
class QComboBox;
|
||||||
|
class QGroupBox;
|
||||||
|
class QLabel;
|
||||||
|
class QLineEdit;
|
||||||
|
class QPushButton;
|
||||||
|
|
||||||
|
class GEOM_DLGREF_EXPORT DlgRef_2Sel1List_QTD : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_2Sel1List_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||||
|
~DlgRef_2Sel1List_QTD();
|
||||||
|
|
||||||
|
QGroupBox* GroupBox1;
|
||||||
|
QLineEdit* LineEdit2;
|
||||||
|
QPushButton* PushButton1;
|
||||||
|
QPushButton* PushButton2;
|
||||||
|
QLabel* TextLabel1;
|
||||||
|
QLineEdit* LineEdit1;
|
||||||
|
QLabel* TextLabel2;
|
||||||
|
QComboBox* ComboBox1;
|
||||||
|
QLabel* TextLabel3;
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QGridLayout* DlgRef_2Sel1List_QTDLayout;
|
||||||
|
QGridLayout* GroupBox1Layout;
|
||||||
|
QGridLayout* Layout1;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_2SEL1LIST_QTD_H
|
106
src/DlgRef/DlgRef_4Sel1Spin2Check.cxx
Normal file
106
src/DlgRef/DlgRef_4Sel1Spin2Check.cxx
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
|
//
|
||||||
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// File : DlgRef_4Sel1Spin2Check.cxx
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#include "DlgRef_4Sel1Spin2Check.h"
|
||||||
|
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <qpushbutton.h>
|
||||||
|
#include <qlineedit.h>
|
||||||
|
#include <qcheckbox.h>
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qspinbox.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_4Sel1Spin2Check which is a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'
|
||||||
|
*/
|
||||||
|
DlgRef_4Sel1Spin2Check::DlgRef_4Sel1Spin2Check(QWidget* parent, const char* name, WFlags fl)
|
||||||
|
:DlgRef_4Sel1Spin2Check_QTD(parent, name, fl)
|
||||||
|
{
|
||||||
|
SpinBox1->close(TRUE);
|
||||||
|
SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
|
||||||
|
Layout1->addWidget(SpinBox_DX, 4, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
DlgRef_4Sel1Spin2Check::~DlgRef_4Sel1Spin2Check()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
||||||
|
void DlgRef_4Sel1Spin2Check::ShowRows(int fromRow, int toRow, bool toShow)
|
||||||
|
{
|
||||||
|
typedef void (QWidget::* ShowFun)();
|
||||||
|
ShowFun pShowFun;
|
||||||
|
|
||||||
|
if (toShow)
|
||||||
|
pShowFun = &QWidget::show;
|
||||||
|
else
|
||||||
|
pShowFun = &QWidget::hide;
|
||||||
|
|
||||||
|
if (fromRow >= 0 && toRow >= 0 && toRow >= fromRow)
|
||||||
|
{
|
||||||
|
if ( fromRow == 0)
|
||||||
|
{
|
||||||
|
(TextLabel1->*pShowFun)();
|
||||||
|
(PushButton1->*pShowFun)();
|
||||||
|
(LineEdit1->*pShowFun)();
|
||||||
|
}
|
||||||
|
if ( fromRow <= 1 && 1 <= toRow)
|
||||||
|
{
|
||||||
|
(TextLabel2->*pShowFun)();
|
||||||
|
(PushButton2->*pShowFun)();
|
||||||
|
(LineEdit2->*pShowFun)();
|
||||||
|
}
|
||||||
|
if ( fromRow <= 2 && 2 <= toRow)
|
||||||
|
{
|
||||||
|
(TextLabel4->*pShowFun)();
|
||||||
|
(PushButton4->*pShowFun)();
|
||||||
|
(LineEdit4->*pShowFun)();
|
||||||
|
}
|
||||||
|
if ( fromRow <= 3 && 3 <= toRow)
|
||||||
|
{
|
||||||
|
(TextLabel5->*pShowFun)();
|
||||||
|
(PushButton5->*pShowFun)();
|
||||||
|
(LineEdit5->*pShowFun)();
|
||||||
|
}
|
||||||
|
if ( fromRow <= 4 && 4 <= toRow)
|
||||||
|
{
|
||||||
|
(TextLabel3->*pShowFun)();
|
||||||
|
(SpinBox_DX->*pShowFun)();
|
||||||
|
(CheckButton2->*pShowFun)();
|
||||||
|
}
|
||||||
|
if ( fromRow <= 5 && 5 <= toRow)
|
||||||
|
(CheckButton1->*pShowFun)();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
51
src/DlgRef/DlgRef_4Sel1Spin2Check.h
Normal file
51
src/DlgRef/DlgRef_4Sel1Spin2Check.h
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
|
//
|
||||||
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// File : DlgRef_4Sel1Spin2Check.h
|
||||||
|
// Author : Damien COQUERET
|
||||||
|
// Module : GEOM
|
||||||
|
// $Header:
|
||||||
|
|
||||||
|
#ifndef DLGREF_4SEL1SPIN2CHECK_H
|
||||||
|
#define DLGREF_4SEL1SPIN2CHECK_H
|
||||||
|
|
||||||
|
#include "GEOM_DlgRef.hxx"
|
||||||
|
|
||||||
|
#include "DlgRef_4Sel1Spin2Check_QTD.h"
|
||||||
|
#include "DlgRef_SpinBox.h"
|
||||||
|
|
||||||
|
class GEOM_DLGREF_EXPORT DlgRef_4Sel1Spin2Check : public DlgRef_4Sel1Spin2Check_QTD
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_4Sel1Spin2Check(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
|
||||||
|
~DlgRef_4Sel1Spin2Check();
|
||||||
|
|
||||||
|
DlgRef_SpinBox* SpinBox_DX;
|
||||||
|
|
||||||
|
void ShowRows(int fromRow, int toRow, bool toShow = true);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_4SEL1SPIN2CHECK_H
|
158
src/DlgRef/DlgRef_4Sel1Spin2Check_QTD.cxx
Normal file
158
src/DlgRef/DlgRef_4Sel1Spin2Check_QTD.cxx
Normal file
@ -0,0 +1,158 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form implementation generated from reading ui file 'DlgRef_4Sel1Spin2Check_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: Wed Oct 25 20:32:42 2006
|
||||||
|
** by: The User Interface Compiler ($Id$)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "DlgRef_4Sel1Spin2Check_QTD.h"
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qpushbutton.h>
|
||||||
|
#include <qgroupbox.h>
|
||||||
|
#include <qcheckbox.h>
|
||||||
|
#include <qlineedit.h>
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <qspinbox.h>
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qtooltip.h>
|
||||||
|
#include <qwhatsthis.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructs a DlgRef_4Sel1Spin2Check_QTD as a child of 'parent', with the
|
||||||
|
* name 'name' and widget flags set to 'f'.
|
||||||
|
*/
|
||||||
|
DlgRef_4Sel1Spin2Check_QTD::DlgRef_4Sel1Spin2Check_QTD( QWidget* parent, const char* name, WFlags fl )
|
||||||
|
: QWidget( parent, name, fl )
|
||||||
|
{
|
||||||
|
if ( !name )
|
||||||
|
setName( "DlgRef_4Sel1Spin2Check_QTD" );
|
||||||
|
DlgRef_4Sel1Spin2Check_QTDLayout = new QVBoxLayout( this, 0, 6, "DlgRef_4Sel1Spin2Check_QTDLayout");
|
||||||
|
|
||||||
|
GroupBox1 = new QGroupBox( this, "GroupBox1" );
|
||||||
|
GroupBox1->setColumnLayout(0, Qt::Vertical );
|
||||||
|
GroupBox1->layout()->setSpacing( 6 );
|
||||||
|
GroupBox1->layout()->setMargin( 11 );
|
||||||
|
GroupBox1Layout = new QVBoxLayout( GroupBox1->layout() );
|
||||||
|
GroupBox1Layout->setAlignment( Qt::AlignTop );
|
||||||
|
|
||||||
|
Layout1 = new QGridLayout( 0, 1, 1, 6, 6, "Layout1");
|
||||||
|
|
||||||
|
CheckButton2 = new QCheckBox( GroupBox1, "CheckButton2" );
|
||||||
|
|
||||||
|
Layout1->addWidget( CheckButton2, 4, 3 );
|
||||||
|
|
||||||
|
PushButton2 = new QPushButton( GroupBox1, "PushButton2" );
|
||||||
|
PushButton2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton2->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( PushButton2, 1, 1 );
|
||||||
|
|
||||||
|
LineEdit5 = new QLineEdit( GroupBox1, "LineEdit5" );
|
||||||
|
|
||||||
|
Layout1->addMultiCellWidget( LineEdit5, 3, 3, 2, 3 );
|
||||||
|
|
||||||
|
TextLabel5 = new QLabel( GroupBox1, "TextLabel5" );
|
||||||
|
TextLabel5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel5->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( TextLabel5, 3, 0 );
|
||||||
|
|
||||||
|
TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
|
||||||
|
TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( TextLabel1, 0, 0 );
|
||||||
|
|
||||||
|
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
|
||||||
|
|
||||||
|
Layout1->addMultiCellWidget( LineEdit1, 0, 0, 2, 3 );
|
||||||
|
|
||||||
|
SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
|
||||||
|
SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( SpinBox1, 4, 2 );
|
||||||
|
|
||||||
|
CheckButton1 = new QCheckBox( GroupBox1, "CheckButton1" );
|
||||||
|
|
||||||
|
Layout1->addMultiCellWidget( CheckButton1, 5, 5, 0, 2 );
|
||||||
|
|
||||||
|
TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
|
||||||
|
TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( TextLabel2, 1, 0 );
|
||||||
|
|
||||||
|
PushButton5 = new QPushButton( GroupBox1, "PushButton5" );
|
||||||
|
PushButton5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton5->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( PushButton5, 3, 1 );
|
||||||
|
|
||||||
|
PushButton4 = new QPushButton( GroupBox1, "PushButton4" );
|
||||||
|
PushButton4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton4->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( PushButton4, 2, 1 );
|
||||||
|
|
||||||
|
TextLabel4 = new QLabel( GroupBox1, "TextLabel4" );
|
||||||
|
TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel4->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( TextLabel4, 2, 0 );
|
||||||
|
|
||||||
|
PushButton1 = new QPushButton( GroupBox1, "PushButton1" );
|
||||||
|
PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( PushButton1, 0, 1 );
|
||||||
|
|
||||||
|
LineEdit4 = new QLineEdit( GroupBox1, "LineEdit4" );
|
||||||
|
|
||||||
|
Layout1->addMultiCellWidget( LineEdit4, 2, 2, 2, 3 );
|
||||||
|
|
||||||
|
LineEdit2 = new QLineEdit( GroupBox1, "LineEdit2" );
|
||||||
|
|
||||||
|
Layout1->addMultiCellWidget( LineEdit2, 1, 1, 2, 3 );
|
||||||
|
|
||||||
|
TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
|
||||||
|
TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
|
Layout1->addWidget( TextLabel3, 4, 0 );
|
||||||
|
GroupBox1Layout->addLayout( Layout1 );
|
||||||
|
DlgRef_4Sel1Spin2Check_QTDLayout->addWidget( GroupBox1 );
|
||||||
|
languageChange();
|
||||||
|
resize( QSize(261, 198).expandedTo(minimumSizeHint()) );
|
||||||
|
clearWState( WState_Polished );
|
||||||
|
|
||||||
|
// tab order
|
||||||
|
setTabOrder( PushButton1, LineEdit1 );
|
||||||
|
setTabOrder( LineEdit1, PushButton2 );
|
||||||
|
setTabOrder( PushButton2, LineEdit2 );
|
||||||
|
setTabOrder( LineEdit2, SpinBox1 );
|
||||||
|
setTabOrder( SpinBox1, CheckButton2 );
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Destroys the object and frees any allocated resources
|
||||||
|
*/
|
||||||
|
DlgRef_4Sel1Spin2Check_QTD::~DlgRef_4Sel1Spin2Check_QTD()
|
||||||
|
{
|
||||||
|
// no need to delete child widgets, Qt does it all for us
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Sets the strings of the subwidgets using the current
|
||||||
|
* language.
|
||||||
|
*/
|
||||||
|
void DlgRef_4Sel1Spin2Check_QTD::languageChange()
|
||||||
|
{
|
||||||
|
setCaption( tr( "DlgRef_4Sel1Spin2Check_QTD" ) );
|
||||||
|
GroupBox1->setTitle( QString::null );
|
||||||
|
CheckButton2->setText( QString::null );
|
||||||
|
PushButton2->setText( QString::null );
|
||||||
|
TextLabel5->setText( tr( "TL5" ) );
|
||||||
|
TextLabel1->setText( tr( "TL1" ) );
|
||||||
|
CheckButton1->setText( QString::null );
|
||||||
|
TextLabel2->setText( tr( "TL2" ) );
|
||||||
|
PushButton5->setText( QString::null );
|
||||||
|
PushButton4->setText( QString::null );
|
||||||
|
TextLabel4->setText( tr( "TL4" ) );
|
||||||
|
PushButton1->setText( QString::null );
|
||||||
|
TextLabel3->setText( tr( "TL3" ) );
|
||||||
|
}
|
||||||
|
|
65
src/DlgRef/DlgRef_4Sel1Spin2Check_QTD.h
Normal file
65
src/DlgRef/DlgRef_4Sel1Spin2Check_QTD.h
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
** Form interface generated from reading ui file 'DlgRef_4Sel1Spin2Check_QTD.ui'
|
||||||
|
**
|
||||||
|
** Created: Wed Oct 25 20:32:41 2006
|
||||||
|
** by: The User Interface Compiler ($Id$)
|
||||||
|
**
|
||||||
|
** WARNING! All changes made in this file will be lost!
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef DLGREF_4SEL1SPIN2CHECK_QTD_H
|
||||||
|
#define DLGREF_4SEL1SPIN2CHECK_QTD_H
|
||||||
|
|
||||||
|
#include "GEOM_DlgRef.hxx"
|
||||||
|
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qwidget.h>
|
||||||
|
|
||||||
|
class QVBoxLayout;
|
||||||
|
class QHBoxLayout;
|
||||||
|
class QGridLayout;
|
||||||
|
class QSpacerItem;
|
||||||
|
class QGroupBox;
|
||||||
|
class QCheckBox;
|
||||||
|
class QPushButton;
|
||||||
|
class QLineEdit;
|
||||||
|
class QLabel;
|
||||||
|
class QSpinBox;
|
||||||
|
|
||||||
|
class GEOM_DLGREF_EXPORT DlgRef_4Sel1Spin2Check_QTD : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlgRef_4Sel1Spin2Check_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
|
||||||
|
~DlgRef_4Sel1Spin2Check_QTD();
|
||||||
|
|
||||||
|
QGroupBox* GroupBox1;
|
||||||
|
QCheckBox* CheckButton2;
|
||||||
|
QPushButton* PushButton2;
|
||||||
|
QLineEdit* LineEdit5;
|
||||||
|
QLabel* TextLabel5;
|
||||||
|
QLabel* TextLabel1;
|
||||||
|
QLineEdit* LineEdit1;
|
||||||
|
QSpinBox* SpinBox1;
|
||||||
|
QCheckBox* CheckButton1;
|
||||||
|
QLabel* TextLabel2;
|
||||||
|
QPushButton* PushButton5;
|
||||||
|
QPushButton* PushButton4;
|
||||||
|
QLabel* TextLabel4;
|
||||||
|
QPushButton* PushButton1;
|
||||||
|
QLineEdit* LineEdit4;
|
||||||
|
QLineEdit* LineEdit2;
|
||||||
|
QLabel* TextLabel3;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QVBoxLayout* DlgRef_4Sel1Spin2Check_QTDLayout;
|
||||||
|
QVBoxLayout* GroupBox1Layout;
|
||||||
|
QGridLayout* Layout1;
|
||||||
|
|
||||||
|
protected slots:
|
||||||
|
virtual void languageChange();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DLGREF_4SEL1SPIN2CHECK_QTD_H
|
47
src/DlgRef/GEOM_DlgRef.hxx
Executable file
47
src/DlgRef/GEOM_DlgRef.hxx
Executable file
@ -0,0 +1,47 @@
|
|||||||
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// File : GEOM_DlgRef.hxx
|
||||||
|
// Author : Alexander A. BORODIN
|
||||||
|
// Module : GEOM
|
||||||
|
|
||||||
|
#ifndef _GEOM_DlgRef_HXX_
|
||||||
|
#define _GEOM_DlgRef_HXX_
|
||||||
|
|
||||||
|
#ifdef WNT
|
||||||
|
#if defined DLGREF_EXPORTS
|
||||||
|
#if defined WIN32
|
||||||
|
#define GEOM_DLGREF_EXPORT __declspec( dllexport )
|
||||||
|
#else
|
||||||
|
#define GEOM_DLGREF_EXPORT
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#if defined WIN32
|
||||||
|
#define GEOM_DLGREF_EXPORT __declspec( dllimport )
|
||||||
|
#else
|
||||||
|
#define GEOM_DLGREF_EXPORT
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define GEOM_DLGREF_EXPORT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
264
src/DlgRef/UIFiles/DlgRef_4Sel1Spin2Check_QTD.ui
Normal file
264
src/DlgRef/UIFiles/DlgRef_4Sel1Spin2Check_QTD.ui
Normal file
@ -0,0 +1,264 @@
|
|||||||
|
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
|
||||||
|
<class>DlgRef_4Sel1Spin2Check_QTD</class>
|
||||||
|
<widget class="QWidget">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>DlgRef_4Sel1Spin2Check_QTD</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>261</width>
|
||||||
|
<height>198</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="caption">
|
||||||
|
<string>DlgRef_4Sel1Spin2Check_QTD</string>
|
||||||
|
</property>
|
||||||
|
<vbox>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>unnamed</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QGroupBox">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>GroupBox1</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string></string>
|
||||||
|
</property>
|
||||||
|
<vbox>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>unnamed</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>11</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QLayoutWidget">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>Layout1</cstring>
|
||||||
|
</property>
|
||||||
|
<grid>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>unnamed</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QCheckBox" row="4" column="3">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>CheckButton2</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QPushButton" row="1" column="1">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>PushButton2</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy>
|
||||||
|
<hsizetype>0</hsizetype>
|
||||||
|
<vsizetype>0</vsizetype>
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLineEdit" row="3" column="2" rowspan="1" colspan="2">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>LineEdit5</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" row="3" column="0">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>TextLabel5</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy>
|
||||||
|
<hsizetype>0</hsizetype>
|
||||||
|
<vsizetype>0</vsizetype>
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>TL5</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" row="0" column="0">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>TextLabel1</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy>
|
||||||
|
<hsizetype>0</hsizetype>
|
||||||
|
<vsizetype>0</vsizetype>
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>TL1</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLineEdit" row="0" column="2" rowspan="1" colspan="2">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>LineEdit1</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QSpinBox" row="4" column="2">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>SpinBox1</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy>
|
||||||
|
<hsizetype>7</hsizetype>
|
||||||
|
<vsizetype>0</vsizetype>
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QCheckBox" row="5" column="0" rowspan="1" colspan="3">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>CheckButton1</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" row="1" column="0">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>TextLabel2</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy>
|
||||||
|
<hsizetype>0</hsizetype>
|
||||||
|
<vsizetype>0</vsizetype>
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>TL2</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QPushButton" row="3" column="1">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>PushButton5</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy>
|
||||||
|
<hsizetype>0</hsizetype>
|
||||||
|
<vsizetype>0</vsizetype>
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QPushButton" row="2" column="1">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>PushButton4</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy>
|
||||||
|
<hsizetype>0</hsizetype>
|
||||||
|
<vsizetype>0</vsizetype>
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" row="2" column="0">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>TextLabel4</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy>
|
||||||
|
<hsizetype>0</hsizetype>
|
||||||
|
<vsizetype>0</vsizetype>
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>TL4</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QPushButton" row="0" column="1">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>PushButton1</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy>
|
||||||
|
<hsizetype>0</hsizetype>
|
||||||
|
<vsizetype>0</vsizetype>
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLineEdit" row="2" column="2" rowspan="1" colspan="2">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>LineEdit4</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLineEdit" row="1" column="2" rowspan="1" colspan="2">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>LineEdit2</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" row="4" column="0">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>TextLabel3</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy>
|
||||||
|
<hsizetype>0</hsizetype>
|
||||||
|
<vsizetype>0</vsizetype>
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>TL3</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</grid>
|
||||||
|
</widget>
|
||||||
|
</vbox>
|
||||||
|
</widget>
|
||||||
|
</vbox>
|
||||||
|
</widget>
|
||||||
|
<tabstops>
|
||||||
|
<tabstop>PushButton1</tabstop>
|
||||||
|
<tabstop>LineEdit1</tabstop>
|
||||||
|
<tabstop>PushButton2</tabstop>
|
||||||
|
<tabstop>LineEdit2</tabstop>
|
||||||
|
<tabstop>SpinBox1</tabstop>
|
||||||
|
<tabstop>CheckButton2</tabstop>
|
||||||
|
</tabstops>
|
||||||
|
<layoutdefaults spacing="6" margin="11"/>
|
||||||
|
</UI>
|
47
src/EntityGUI/GEOM_EntityGUI.hxx
Executable file
47
src/EntityGUI/GEOM_EntityGUI.hxx
Executable file
@ -0,0 +1,47 @@
|
|||||||
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// File : GEOM_EntityGUI.hxx
|
||||||
|
// Author : Alexander A. BORODIN
|
||||||
|
// Module : GEOM
|
||||||
|
|
||||||
|
#ifndef _GEOM_EntityGUI_HXX_
|
||||||
|
#define _GEOM_EntityGUI_HXX_
|
||||||
|
|
||||||
|
#ifdef WNT
|
||||||
|
#if defined ENTITYGUI_EXPORTS
|
||||||
|
#if defined WIN32
|
||||||
|
#define GEOM_ENTITYGUI_EXPORT __declspec( dllexport )
|
||||||
|
#else
|
||||||
|
#define GEOM_ENTITYGUI_EXPORT
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#if defined WIN32
|
||||||
|
#define GEOM_ENTITYGUI_EXPORT __declspec( dllimport )
|
||||||
|
#else
|
||||||
|
#define GEOM_ENTITYGUI_EXPORT
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define GEOM_ENTITYGUI_EXPORT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
247
src/GEOMAlgo/GEOMAlgo_Builder.cdl
Executable file
247
src/GEOMAlgo/GEOMAlgo_Builder.cdl
Executable file
@ -0,0 +1,247 @@
|
|||||||
|
-- Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
--
|
||||||
|
-- This library is free software; you can redistribute it and/or
|
||||||
|
-- modify it under the terms of the GNU Lesser General Public
|
||||||
|
-- License as published by the Free Software Foundation; either
|
||||||
|
-- version 2.1 of the License.
|
||||||
|
--
|
||||||
|
-- This library is distributed in the hope that it will be useful
|
||||||
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
-- Lesser General Public License for more details.
|
||||||
|
--
|
||||||
|
-- You should have received a copy of the GNU Lesser General Public
|
||||||
|
-- License along with this library; if not, write to the Free Software
|
||||||
|
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
--
|
||||||
|
-- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
--
|
||||||
|
-- File: GEOMAlgo_Builder.cdl
|
||||||
|
-- Created:
|
||||||
|
-- Author: Peter KURNEV
|
||||||
|
|
||||||
|
|
||||||
|
class Builder from GEOMAlgo
|
||||||
|
inherits BuilderShape from GEOMAlgo
|
||||||
|
|
||||||
|
---Purpose:
|
||||||
|
|
||||||
|
uses
|
||||||
|
ShapeEnum from TopAbs,
|
||||||
|
Shape from TopoDS,
|
||||||
|
|
||||||
|
ListOfShape from TopTools,
|
||||||
|
IndexedDataMapOfShapeListOfShape from TopTools,
|
||||||
|
IndexedDataMapOfShapeShape from TopTools,
|
||||||
|
MapOfShape from TopTools,
|
||||||
|
Image from BRepAlgo,
|
||||||
|
|
||||||
|
DSFiller from NMTTools,
|
||||||
|
PDSFiller from NMTTools
|
||||||
|
|
||||||
|
--raises
|
||||||
|
|
||||||
|
is
|
||||||
|
|
||||||
|
Create
|
||||||
|
---Purpose: Empty constructor
|
||||||
|
returns Builder from GEOMAlgo;
|
||||||
|
---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_Builder();"
|
||||||
|
|
||||||
|
Perform(me:out)
|
||||||
|
---Purpose: Performs calculations
|
||||||
|
is redefined;
|
||||||
|
|
||||||
|
PerformWithFiller(me:out;
|
||||||
|
theDSF: DSFiller from NMTTools)
|
||||||
|
---Purpose: Performs calculations using prepared DSFiller
|
||||||
|
-- object theDSF
|
||||||
|
is virtual;
|
||||||
|
|
||||||
|
AddShape (me:out;
|
||||||
|
theShape: Shape from TopoDS)
|
||||||
|
---Purpose: Adds argument theShape of the operation
|
||||||
|
is virtual;
|
||||||
|
|
||||||
|
Clear(me:out)
|
||||||
|
---Purpose: Clears internal fields and arguments
|
||||||
|
is virtual;
|
||||||
|
|
||||||
|
Shapes(me)
|
||||||
|
---Purpose: Returns the arguments of the operation
|
||||||
|
returns ListOfShape from TopTools;
|
||||||
|
---C++: return const &
|
||||||
|
--
|
||||||
|
-- History support
|
||||||
|
--
|
||||||
|
Generated (me:out;
|
||||||
|
theS : Shape from TopoDS)
|
||||||
|
---Purpose: Returns the list of shapes generated from the
|
||||||
|
-- shape theS.
|
||||||
|
returns ListOfShape from TopTools
|
||||||
|
is redefined;
|
||||||
|
---C++: return const &
|
||||||
|
|
||||||
|
Modified (me:out;
|
||||||
|
theS : Shape from TopoDS)
|
||||||
|
---Purpose: Returns the list of shapes modified from the shape
|
||||||
|
-- theS.
|
||||||
|
returns ListOfShape from TopTools
|
||||||
|
is redefined;
|
||||||
|
---C++: return const &
|
||||||
|
|
||||||
|
IsDeleted (me:out;
|
||||||
|
theS : Shape from TopoDS)
|
||||||
|
---Purpose: Returns true if the shape theS has been deleted.
|
||||||
|
returns Boolean from Standard
|
||||||
|
is redefined;
|
||||||
|
--
|
||||||
|
-- protected methods
|
||||||
|
--
|
||||||
|
PrepareHistory (me:out)
|
||||||
|
---Purpose: Prepare information for history support
|
||||||
|
is redefined protected;
|
||||||
|
|
||||||
|
ClearInternals(me:out)
|
||||||
|
---Purpose: Clears internal fields
|
||||||
|
is virtual protected;
|
||||||
|
|
||||||
|
Prepare(me:out)
|
||||||
|
---Purpose: Provides preparing actions
|
||||||
|
is virtual protected;
|
||||||
|
|
||||||
|
PostTreat(me:out)
|
||||||
|
---Purpose: Provides post-tratment actions
|
||||||
|
is virtual protected;
|
||||||
|
|
||||||
|
AddShape1 (me:out;
|
||||||
|
theShape: Shape from TopoDS)
|
||||||
|
---Purpose: Append the argument theShape to
|
||||||
|
-- typified lists of arguments myShapes1
|
||||||
|
is protected;
|
||||||
|
|
||||||
|
BuildResult(me:out;
|
||||||
|
theType: ShapeEnum from TopAbs)
|
||||||
|
---Purpose: Build the resulting shapes of type theType
|
||||||
|
is virtual protected;
|
||||||
|
|
||||||
|
-- Vertices
|
||||||
|
FillImagesVertices(me:out)
|
||||||
|
---Purpose: Fill Images for vertices
|
||||||
|
is protected;
|
||||||
|
|
||||||
|
-- Edges
|
||||||
|
FillImagesEdges(me:out)
|
||||||
|
---Purpose: Fill Images for edges
|
||||||
|
is protected;
|
||||||
|
--
|
||||||
|
-- Faces
|
||||||
|
FillImagesFaces(me:out)
|
||||||
|
---Purpose: Fill Images for faces
|
||||||
|
is protected;
|
||||||
|
|
||||||
|
FillIn2DParts(me:out)
|
||||||
|
---Purpose: For each interferred face find split edges
|
||||||
|
-- that are in 2-D domain of the face
|
||||||
|
is protected;
|
||||||
|
|
||||||
|
BuildSplitFaces(me:out)
|
||||||
|
---Purpose: Build draft faces
|
||||||
|
is protected;
|
||||||
|
|
||||||
|
FillSameDomainFaces(me:out)
|
||||||
|
---Purpose: Among draft faces find same domain faces
|
||||||
|
is protected;
|
||||||
|
|
||||||
|
FillImagesFaces1(me:out)
|
||||||
|
---Purpose: Fill Images for faces
|
||||||
|
-- taking into account same domain faces
|
||||||
|
is protected;
|
||||||
|
|
||||||
|
FillInternalVertices(me:out)
|
||||||
|
---Purpose: Update Images for faces by
|
||||||
|
-- internal vertices
|
||||||
|
is protected;
|
||||||
|
--
|
||||||
|
-- Wires, Shells, Compsolids, Compounds
|
||||||
|
FillImagesContainers(me:out;
|
||||||
|
theType:ShapeEnum from TopAbs)
|
||||||
|
---Purpose: Fill Images for Wires, Shells, Compsolids, Compounds
|
||||||
|
is protected;
|
||||||
|
--
|
||||||
|
-- Solids
|
||||||
|
FillImagesSolids(me:out)
|
||||||
|
---Purpose: Fill Images for solids
|
||||||
|
is protected;
|
||||||
|
|
||||||
|
FillIn3DParts(me:out)
|
||||||
|
---Purpose: For each interferred solid find split faces
|
||||||
|
-- that are in 3-D domain of the solid
|
||||||
|
is protected;
|
||||||
|
|
||||||
|
BuildSplitSolids(me:out)
|
||||||
|
---Purpose: Build draft solids
|
||||||
|
is protected;
|
||||||
|
|
||||||
|
FillInternalShapes(me:out)
|
||||||
|
---Purpose: Update draft solids by
|
||||||
|
-- internal shells, edges, vertices
|
||||||
|
is protected;
|
||||||
|
|
||||||
|
BuildDraftSolid(me:out;
|
||||||
|
theSolid: Shape from TopoDS;
|
||||||
|
theDraftSolid: out Shape from TopoDS;
|
||||||
|
theInternalFaces: out ListOfShape from TopTools)
|
||||||
|
---Purpose: Build solid theDraftSolid that consists of
|
||||||
|
-- non-internal split faces of the solid
|
||||||
|
-- theSolid.
|
||||||
|
-- All splits of internal faces of
|
||||||
|
-- theSolid are in the list: theInternalFaces
|
||||||
|
is protected;
|
||||||
|
--
|
||||||
|
-- debug methods
|
||||||
|
--
|
||||||
|
AddCompound (me:out;
|
||||||
|
theShape: Shape from TopoDS);
|
||||||
|
---Purpose: Adds arguments of the operation as
|
||||||
|
-- shapes of upper level of container shape theShape
|
||||||
|
Shapes1(me;
|
||||||
|
theType: Integer from Standard)
|
||||||
|
---Purpose: Returns list of arguments of type theType
|
||||||
|
returns ListOfShape from TopTools;
|
||||||
|
---C++: return const &
|
||||||
|
|
||||||
|
Images(me)
|
||||||
|
---Purpose: Returns image shapes
|
||||||
|
returns Image from BRepAlgo;
|
||||||
|
---C++: return const &
|
||||||
|
|
||||||
|
InParts(me;
|
||||||
|
theShape:Shape from TopoDS)
|
||||||
|
---Purpose: Returns split-parts of shapes that have
|
||||||
|
-- state IN for the domain of shape theShape
|
||||||
|
returns ListOfShape from TopTools;
|
||||||
|
---C++: return const &
|
||||||
|
|
||||||
|
-- =====================================================
|
||||||
|
|
||||||
|
fields
|
||||||
|
myDSFiller : PDSFiller from NMTTools is protected;
|
||||||
|
myShapes : ListOfShape from TopTools is protected;
|
||||||
|
-- Common usage
|
||||||
|
myNbTypes : Integer from Standard is protected;
|
||||||
|
myMapFence : MapOfShape from TopTools is protected;
|
||||||
|
myShapes1 : ListOfShape from TopTools[9] is protected;
|
||||||
|
myImages : Image from BRepAlgo is protected;
|
||||||
|
myInParts : IndexedDataMapOfShapeListOfShape from TopTools is protected;
|
||||||
|
|
||||||
|
-- Faces
|
||||||
|
mySplitFaces : Image from BRepAlgo is protected;
|
||||||
|
mySameDomainShapes: IndexedDataMapOfShapeShape from TopTools is protected;
|
||||||
|
-- solids
|
||||||
|
myDraftSolids : IndexedDataMapOfShapeShape from TopTools is protected;
|
||||||
|
|
||||||
|
--
|
||||||
|
end Builder;
|
||||||
|
|
389
src/GEOMAlgo/GEOMAlgo_Builder.cxx
Executable file
389
src/GEOMAlgo/GEOMAlgo_Builder.cxx
Executable file
@ -0,0 +1,389 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
//
|
||||||
|
// File: GEOMAlgo_Builder.cxx
|
||||||
|
// Created:
|
||||||
|
// Author: Peter KURNEV
|
||||||
|
|
||||||
|
|
||||||
|
#include <GEOMAlgo_Builder.ixx>
|
||||||
|
|
||||||
|
#include <TopAbs_ShapeEnum.hxx>
|
||||||
|
|
||||||
|
#include <TopoDS_Shape.hxx>
|
||||||
|
#include <TopoDS_Compound.hxx>
|
||||||
|
#include <TopoDS_Iterator.hxx>
|
||||||
|
|
||||||
|
#include <BRep_Builder.hxx>
|
||||||
|
|
||||||
|
#include <TopTools_MapOfShape.hxx>
|
||||||
|
#include <TopTools_ListOfShape.hxx>
|
||||||
|
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||||
|
|
||||||
|
#include <BOP_CorrectTolerances.hxx>
|
||||||
|
|
||||||
|
#include <NMTTools_DSFiller.hxx>
|
||||||
|
|
||||||
|
#include <BRepLib.hxx>
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function :
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
GEOMAlgo_Builder::GEOMAlgo_Builder()
|
||||||
|
:
|
||||||
|
GEOMAlgo_BuilderShape()
|
||||||
|
{
|
||||||
|
myNbTypes=9;
|
||||||
|
myDSFiller=NULL;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : ~
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
GEOMAlgo_Builder::~GEOMAlgo_Builder()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : AddCompound
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_Builder::AddCompound(const TopoDS_Shape& theShape)
|
||||||
|
{
|
||||||
|
TopoDS_Iterator aIt;
|
||||||
|
//
|
||||||
|
aIt.Initialize(theShape);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aS=aIt.Value();
|
||||||
|
AddShape(aS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : AddShape
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_Builder::AddShape(const TopoDS_Shape& theShape)
|
||||||
|
{
|
||||||
|
if (myMapFence.Add(theShape)) {
|
||||||
|
myShapes.Append(theShape);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Shapes
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
const TopTools_ListOfShape& GEOMAlgo_Builder::Shapes()const
|
||||||
|
{
|
||||||
|
return myShapes;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Clear
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_Builder::Clear()
|
||||||
|
{
|
||||||
|
myShapes.Clear();
|
||||||
|
ClearInternals();
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : ClearInternals
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_Builder::ClearInternals()
|
||||||
|
{
|
||||||
|
Standard_Integer i;
|
||||||
|
//
|
||||||
|
for (i=0; i<myNbTypes; ++i){
|
||||||
|
myShapes1[i].Clear();
|
||||||
|
}
|
||||||
|
myImages.Clear();
|
||||||
|
//
|
||||||
|
myInParts.Clear();
|
||||||
|
mySplitFaces.Clear();
|
||||||
|
mySameDomainShapes.Clear();
|
||||||
|
myDraftSolids.Clear();
|
||||||
|
myMapFence.Clear();
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Prepare
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_Builder::Prepare()
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
Standard_Integer aNb;
|
||||||
|
BRep_Builder aBB;
|
||||||
|
TopoDS_Compound aC;
|
||||||
|
TopTools_ListIteratorOfListOfShape aIt;
|
||||||
|
//
|
||||||
|
aNb=myShapes.Extent();
|
||||||
|
if (aNb<2) {
|
||||||
|
myErrorStatus=10; // No shapes to process
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// 1. myShape is empty compound
|
||||||
|
aBB.MakeCompound(aC);
|
||||||
|
myShape=aC;
|
||||||
|
//
|
||||||
|
// 2. myShapes1
|
||||||
|
aIt.Initialize(myShapes);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aS=aIt.Value();
|
||||||
|
AddShape1(aS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : PostTreat
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_Builder::PostTreat()
|
||||||
|
{
|
||||||
|
Standard_Integer aNbS;
|
||||||
|
TopoDS_Iterator aIt;
|
||||||
|
TopTools_ListOfShape aLS;
|
||||||
|
//
|
||||||
|
aIt.Initialize(myShape);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aS=aIt.Value();
|
||||||
|
aLS.Append(aS);
|
||||||
|
}
|
||||||
|
aNbS=aLS.Extent();
|
||||||
|
if (aNbS==1) {
|
||||||
|
myShape=aLS.First();
|
||||||
|
}
|
||||||
|
|
||||||
|
BRepLib::SameParameter(myShape, 1.e-7, Standard_True);
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : AddShape1
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_Builder::AddShape1(const TopoDS_Shape& theShape)
|
||||||
|
{
|
||||||
|
Standard_Integer iType;
|
||||||
|
TopAbs_ShapeEnum aType;
|
||||||
|
TopoDS_Iterator aIt;
|
||||||
|
TopTools_MapOfShape aM;
|
||||||
|
//
|
||||||
|
aType=theShape.ShapeType();
|
||||||
|
if (aType==TopAbs_COMPOUND) {
|
||||||
|
aIt.Initialize(theShape);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aS=aIt.Value();
|
||||||
|
AddShape1(aS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
iType=(Standard_Integer)aType;
|
||||||
|
if (aM.Add(theShape)) {
|
||||||
|
myShapes1[iType].Append(theShape);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : BuildResult
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_Builder::BuildResult(const TopAbs_ShapeEnum theType)
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
TopAbs_ShapeEnum aType;
|
||||||
|
BRep_Builder aBB;
|
||||||
|
TopTools_MapOfShape aM;
|
||||||
|
TopTools_ListIteratorOfListOfShape aIt, aItIm;
|
||||||
|
//
|
||||||
|
aIt.Initialize(myShapes);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aS=aIt.Value();
|
||||||
|
aType=aS.ShapeType();
|
||||||
|
if (aType==theType) {
|
||||||
|
if (myImages.HasImage(aS)){
|
||||||
|
const TopTools_ListOfShape& aLSIm=myImages.Image(aS);
|
||||||
|
aItIm.Initialize(aLSIm);
|
||||||
|
for (; aItIm.More(); aItIm.Next()) {
|
||||||
|
const TopoDS_Shape& aSIm=aItIm.Value();
|
||||||
|
if (aM.Add(aSIm)) {
|
||||||
|
aBB.Add(myShape, aSIm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (aM.Add(aS)) {
|
||||||
|
aBB.Add(myShape, aS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Perform
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_Builder::Perform()
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
BRep_Builder aBB;
|
||||||
|
TopoDS_Compound aCS;
|
||||||
|
TopTools_ListIteratorOfListOfShape aIt;
|
||||||
|
//
|
||||||
|
aBB.MakeCompound(aCS);
|
||||||
|
//
|
||||||
|
aIt.Initialize(myShapes);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aS=aIt.Value();
|
||||||
|
aBB.Add(aCS, aS);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
NMTTools_DSFiller* pDSF=new NMTTools_DSFiller;
|
||||||
|
//
|
||||||
|
pDSF->SetCompositeShape(aCS);
|
||||||
|
pDSF->Perform();
|
||||||
|
//
|
||||||
|
PerformWithFiller(*pDSF);
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : PerformWithFiller
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_Builder::PerformWithFiller(const NMTTools_DSFiller& theDSF)
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
Standard_Boolean bIsDone;
|
||||||
|
//
|
||||||
|
// 0. myDSFiller
|
||||||
|
myDSFiller=(NMTTools_DSFiller *)&theDSF;
|
||||||
|
//
|
||||||
|
bIsDone=myDSFiller->IsDone();
|
||||||
|
if (!bIsDone) {
|
||||||
|
myErrorStatus=2; // DSFiller is failed
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// 1. Clear Internal fields
|
||||||
|
ClearInternals();
|
||||||
|
//
|
||||||
|
// 2. Prepare
|
||||||
|
Prepare();
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// 3. Fill Images
|
||||||
|
//
|
||||||
|
// 3.1 Vertices
|
||||||
|
FillImagesVertices();
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
BuildResult(TopAbs_VERTEX);
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 3.2 Edges
|
||||||
|
FillImagesEdges();
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
BuildResult(TopAbs_EDGE);
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 3.3 Wires
|
||||||
|
FillImagesContainers(TopAbs_WIRE);
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
BuildResult(TopAbs_WIRE);
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3.4 Faces
|
||||||
|
FillImagesFaces();
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
BuildResult(TopAbs_FACE);
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 3.5 Shells
|
||||||
|
|
||||||
|
FillImagesContainers(TopAbs_SHELL);
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
BuildResult(TopAbs_SHELL);
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 3.6 Solids
|
||||||
|
FillImagesSolids();
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
BuildResult(TopAbs_SOLID);
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 3.7 CompSolids
|
||||||
|
FillImagesContainers(TopAbs_COMPSOLID);
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
BuildResult(TopAbs_COMPSOLID);
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 3.8 Compounds
|
||||||
|
FillImagesContainers(TopAbs_COMPOUND);
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
BuildResult(TopAbs_COMPOUND);
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// 4.History
|
||||||
|
PrepareHistory();
|
||||||
|
//
|
||||||
|
// 5 Post-treatment
|
||||||
|
PostTreat();
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// myErrorStatus
|
||||||
|
//
|
||||||
|
// 0 - Ok
|
||||||
|
// 1 - The object is just initialized
|
||||||
|
// 2 - DSFiller is failed
|
||||||
|
// 10 - No shapes to process
|
||||||
|
// 30 - SolidBuilder failed
|
245
src/GEOMAlgo/GEOMAlgo_Builder.hxx
Normal file
245
src/GEOMAlgo/GEOMAlgo_Builder.hxx
Normal file
@ -0,0 +1,245 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _GEOMAlgo_Builder_HeaderFile
|
||||||
|
#define _GEOMAlgo_Builder_HeaderFile
|
||||||
|
|
||||||
|
#ifndef _NMTTools_PDSFiller_HeaderFile
|
||||||
|
#include <NMTTools_PDSFiller.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopTools_ListOfShape_HeaderFile
|
||||||
|
#include <TopTools_ListOfShape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Integer_HeaderFile
|
||||||
|
#include <Standard_Integer.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopTools_MapOfShape_HeaderFile
|
||||||
|
#include <TopTools_MapOfShape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _BRepAlgo_Image_HeaderFile
|
||||||
|
#include <BRepAlgo_Image.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopTools_IndexedDataMapOfShapeListOfShape_HeaderFile
|
||||||
|
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopTools_IndexedDataMapOfShapeShape_HeaderFile
|
||||||
|
#include <TopTools_IndexedDataMapOfShapeShape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_BuilderShape_HeaderFile
|
||||||
|
#include <GEOMAlgo_BuilderShape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Boolean_HeaderFile
|
||||||
|
#include <Standard_Boolean.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopAbs_ShapeEnum_HeaderFile
|
||||||
|
#include <TopAbs_ShapeEnum.hxx>
|
||||||
|
#endif
|
||||||
|
class NMTTools_DSFiller;
|
||||||
|
class TopoDS_Shape;
|
||||||
|
class TopTools_ListOfShape;
|
||||||
|
class BRepAlgo_Image;
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _Standard_HeaderFile
|
||||||
|
#include <Standard.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Macro_HeaderFile
|
||||||
|
#include <Standard_Macro.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
class GEOMAlgo_Builder : public GEOMAlgo_BuilderShape {
|
||||||
|
|
||||||
|
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
|
||||||
|
//
|
||||||
|
|
||||||
|
//! Empty constructor <br>
|
||||||
|
Standard_EXPORT GEOMAlgo_Builder();
|
||||||
|
Standard_EXPORT virtual ~GEOMAlgo_Builder();
|
||||||
|
|
||||||
|
//! Performs calculations <br>
|
||||||
|
Standard_EXPORT virtual void Perform() ;
|
||||||
|
|
||||||
|
//! Performs calculations using prepared DSFiller <br>
|
||||||
|
//! object theDSF <br>
|
||||||
|
Standard_EXPORT virtual void PerformWithFiller(const NMTTools_DSFiller& theDSF) ;
|
||||||
|
|
||||||
|
//! Adds argument theShape of the operation <br>
|
||||||
|
Standard_EXPORT virtual void AddShape(const TopoDS_Shape& theShape) ;
|
||||||
|
|
||||||
|
//! Clears internal fields and arguments <br>
|
||||||
|
Standard_EXPORT virtual void Clear() ;
|
||||||
|
|
||||||
|
//! Returns the arguments of the operation <br>
|
||||||
|
Standard_EXPORT const TopTools_ListOfShape& Shapes() const;
|
||||||
|
|
||||||
|
//! Returns the list of shapes generated from the <br>
|
||||||
|
//! shape theS. <br>
|
||||||
|
Standard_EXPORT virtual const TopTools_ListOfShape& Generated(const TopoDS_Shape& theS) ;
|
||||||
|
|
||||||
|
//! Returns the list of shapes modified from the shape <br>
|
||||||
|
//! theS. <br>
|
||||||
|
Standard_EXPORT virtual const TopTools_ListOfShape& Modified(const TopoDS_Shape& theS) ;
|
||||||
|
|
||||||
|
//! Returns true if the shape theS has been deleted. <br>
|
||||||
|
Standard_EXPORT virtual Standard_Boolean IsDeleted(const TopoDS_Shape& theS) ;
|
||||||
|
|
||||||
|
//! Adds arguments of the operation as <br>
|
||||||
|
//! shapes of upper level of container shape theShape <br>
|
||||||
|
Standard_EXPORT void AddCompound(const TopoDS_Shape& theShape) ;
|
||||||
|
|
||||||
|
//! Returns list of arguments of type theType <br>
|
||||||
|
Standard_EXPORT const TopTools_ListOfShape& Shapes1(const Standard_Integer theType) const;
|
||||||
|
|
||||||
|
//! Returns image shapes <br>
|
||||||
|
Standard_EXPORT const BRepAlgo_Image& Images() const;
|
||||||
|
|
||||||
|
//! Returns split-parts of shapes that have <br>
|
||||||
|
//! state IN for the domain of shape theShape <br>
|
||||||
|
Standard_EXPORT const TopTools_ListOfShape& InParts(const TopoDS_Shape& theShape) const;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Methods PROTECTED
|
||||||
|
//
|
||||||
|
|
||||||
|
//! Prepare information for history support <br>
|
||||||
|
Standard_EXPORT virtual void PrepareHistory() ;
|
||||||
|
|
||||||
|
//! Clears internal fields <br>
|
||||||
|
Standard_EXPORT virtual void ClearInternals() ;
|
||||||
|
|
||||||
|
//! Provides preparing actions <br>
|
||||||
|
Standard_EXPORT virtual void Prepare() ;
|
||||||
|
|
||||||
|
//! Provides post-tratment actions <br>
|
||||||
|
Standard_EXPORT virtual void PostTreat() ;
|
||||||
|
|
||||||
|
//! Append the argument theShape to <br>
|
||||||
|
//! typified lists of arguments myShapes1 <br>
|
||||||
|
Standard_EXPORT void AddShape1(const TopoDS_Shape& theShape) ;
|
||||||
|
|
||||||
|
//! Build the resulting shapes of type theType <br>
|
||||||
|
Standard_EXPORT virtual void BuildResult(const TopAbs_ShapeEnum theType) ;
|
||||||
|
|
||||||
|
//! Fill Images for vertices <br>
|
||||||
|
Standard_EXPORT void FillImagesVertices() ;
|
||||||
|
|
||||||
|
//! Fill Images for edges <br>
|
||||||
|
Standard_EXPORT void FillImagesEdges() ;
|
||||||
|
|
||||||
|
//! Fill Images for faces <br>
|
||||||
|
Standard_EXPORT void FillImagesFaces() ;
|
||||||
|
|
||||||
|
//! For each interferred face find split edges <br>
|
||||||
|
//! that are in 2-D domain of the face <br>
|
||||||
|
Standard_EXPORT void FillIn2DParts() ;
|
||||||
|
|
||||||
|
//! Build draft faces <br>
|
||||||
|
Standard_EXPORT void BuildSplitFaces() ;
|
||||||
|
|
||||||
|
//! Among draft faces find same domain faces <br>
|
||||||
|
Standard_EXPORT void FillSameDomainFaces() ;
|
||||||
|
|
||||||
|
//! Fill Images for faces <br>
|
||||||
|
//! taking into account same domain faces <br>
|
||||||
|
Standard_EXPORT void FillImagesFaces1() ;
|
||||||
|
|
||||||
|
//! Update Images for faces by <br>
|
||||||
|
//! internal vertices <br>
|
||||||
|
Standard_EXPORT void FillInternalVertices() ;
|
||||||
|
|
||||||
|
//! Fill Images for Wires, Shells, Compsolids, Compounds <br>
|
||||||
|
Standard_EXPORT void FillImagesContainers(const TopAbs_ShapeEnum theType) ;
|
||||||
|
|
||||||
|
//! Fill Images for solids <br>
|
||||||
|
Standard_EXPORT void FillImagesSolids() ;
|
||||||
|
|
||||||
|
//! For each interferred solid find split faces <br>
|
||||||
|
//! that are in 3-D domain of the solid <br>
|
||||||
|
Standard_EXPORT void FillIn3DParts() ;
|
||||||
|
|
||||||
|
//! Build draft solids <br>
|
||||||
|
Standard_EXPORT void BuildSplitSolids() ;
|
||||||
|
|
||||||
|
//! Update draft solids by <br>
|
||||||
|
//! internal shells, edges, vertices <br>
|
||||||
|
Standard_EXPORT void FillInternalShapes() ;
|
||||||
|
|
||||||
|
//! Build solid theDraftSolid that consists of <br>
|
||||||
|
//! non-internal split faces of the solid <br>
|
||||||
|
//! theSolid. <br>
|
||||||
|
//! All splits of internal faces of <br>
|
||||||
|
//! theSolid are in the list: theInternalFaces <br>
|
||||||
|
Standard_EXPORT void BuildDraftSolid(const TopoDS_Shape& theSolid,TopoDS_Shape& theDraftSolid,TopTools_ListOfShape& theInternalFaces) ;
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PROTECTED
|
||||||
|
//
|
||||||
|
NMTTools_PDSFiller myDSFiller;
|
||||||
|
TopTools_ListOfShape myShapes;
|
||||||
|
Standard_Integer myNbTypes;
|
||||||
|
TopTools_MapOfShape myMapFence;
|
||||||
|
TopTools_ListOfShape myShapes1[9];
|
||||||
|
BRepAlgo_Image myImages;
|
||||||
|
TopTools_IndexedDataMapOfShapeListOfShape myInParts;
|
||||||
|
BRepAlgo_Image mySplitFaces;
|
||||||
|
TopTools_IndexedDataMapOfShapeShape mySameDomainShapes;
|
||||||
|
TopTools_IndexedDataMapOfShapeShape myDraftSolids;
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Methods PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// other Inline functions and methods (like "C++: function call" methods)
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
24
src/GEOMAlgo/GEOMAlgo_Builder.ixx
Normal file
24
src/GEOMAlgo/GEOMAlgo_Builder.ixx
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#include <GEOMAlgo_Builder.jxx>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
34
src/GEOMAlgo/GEOMAlgo_Builder.jxx
Normal file
34
src/GEOMAlgo/GEOMAlgo_Builder.jxx
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _NMTTools_DSFiller_HeaderFile
|
||||||
|
#include <NMTTools_DSFiller.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopoDS_Shape_HeaderFile
|
||||||
|
#include <TopoDS_Shape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopTools_ListOfShape_HeaderFile
|
||||||
|
#include <TopTools_ListOfShape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _BRepAlgo_Image_HeaderFile
|
||||||
|
#include <BRepAlgo_Image.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_Builder_HeaderFile
|
||||||
|
#include <GEOMAlgo_Builder.hxx>
|
||||||
|
#endif
|
101
src/GEOMAlgo/GEOMAlgo_BuilderArea.cdl
Executable file
101
src/GEOMAlgo/GEOMAlgo_BuilderArea.cdl
Executable file
@ -0,0 +1,101 @@
|
|||||||
|
-- Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
--
|
||||||
|
-- This library is free software; you can redistribute it and/or
|
||||||
|
-- modify it under the terms of the GNU Lesser General Public
|
||||||
|
-- License as published by the Free Software Foundation; either
|
||||||
|
-- version 2.1 of the License.
|
||||||
|
--
|
||||||
|
-- This library is distributed in the hope that it will be useful
|
||||||
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
-- Lesser General Public License for more details.
|
||||||
|
--
|
||||||
|
-- You should have received a copy of the GNU Lesser General Public
|
||||||
|
-- License along with this library; if not, write to the Free Software
|
||||||
|
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
--
|
||||||
|
-- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
--
|
||||||
|
-- File: ModGlue_BuilderArea.cdl
|
||||||
|
-- Created:
|
||||||
|
-- Author: Peter KURNEV
|
||||||
|
|
||||||
|
deferred class BuilderArea from GEOMAlgo
|
||||||
|
inherits Algo from GEOMAlgo
|
||||||
|
|
||||||
|
---Purpose: The root class for algorithms to build
|
||||||
|
-- faces/solids from set of edges/faces
|
||||||
|
|
||||||
|
uses
|
||||||
|
Shape from TopoDS,
|
||||||
|
ListOfShape from TopTools,
|
||||||
|
MapOfOrientedShape from TopTools,
|
||||||
|
Context from IntTools,
|
||||||
|
PContext from IntTools
|
||||||
|
|
||||||
|
--raises
|
||||||
|
|
||||||
|
is
|
||||||
|
Initialize
|
||||||
|
---Purpose: Empty constructor
|
||||||
|
returns BuilderArea from GEOMAlgo;
|
||||||
|
---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_BuilderArea();"
|
||||||
|
|
||||||
|
SetContext(me:out;
|
||||||
|
theContext:Context from IntTools);
|
||||||
|
---Purpose: Sets cashed geometrical tools
|
||||||
|
|
||||||
|
SetShapes(me:out;
|
||||||
|
theLS:ListOfShape from TopTools);
|
||||||
|
---Purpose: Sets edges/faces to process
|
||||||
|
|
||||||
|
Shapes(me)
|
||||||
|
---Purpose: Returns edges/faces to process
|
||||||
|
returns ListOfShape from TopTools;
|
||||||
|
---C++: return const &
|
||||||
|
|
||||||
|
Loops(me)
|
||||||
|
---Purpose: Returns wires/shells that have been built
|
||||||
|
returns ListOfShape from TopTools;
|
||||||
|
---C++: return const &
|
||||||
|
|
||||||
|
Areas(me)
|
||||||
|
---Purpose: Returns faces/solids that have been built
|
||||||
|
returns ListOfShape from TopTools;
|
||||||
|
---C++: return const &
|
||||||
|
|
||||||
|
PerformShapesToAvoid(me:out)
|
||||||
|
---Purpose: Collect the edges/faces that
|
||||||
|
-- a) are internal
|
||||||
|
-- b) are the same and have different orientation
|
||||||
|
is virtual protected;
|
||||||
|
|
||||||
|
PerformLoops(me:out)
|
||||||
|
---Purpose: Build draft faces/shells
|
||||||
|
-- a)myLoops - draft faces/shells that consist of
|
||||||
|
-- boundary edges/faces
|
||||||
|
-- b)myLoopsInternal - draft faces/shells that contains
|
||||||
|
-- inner edges/faces
|
||||||
|
is virtual protected;
|
||||||
|
|
||||||
|
PerformAreas(me:out)
|
||||||
|
---Purpose: Build draft faces/solids that contains boundary faces
|
||||||
|
is virtual protected;
|
||||||
|
|
||||||
|
PerformInternalShapes(me:out)
|
||||||
|
---Purpose: Build finalized faces/solids with internal wires/shells
|
||||||
|
is virtual protected;
|
||||||
|
|
||||||
|
|
||||||
|
fields
|
||||||
|
myShapes : ListOfShape from TopTools is protected;
|
||||||
|
myLoops : ListOfShape from TopTools is protected;
|
||||||
|
myLoopsInternal : ListOfShape from TopTools is protected;
|
||||||
|
myShapesToAvoid : MapOfOrientedShape from TopTools is protected;
|
||||||
|
myAreas : ListOfShape from TopTools is protected;
|
||||||
|
--
|
||||||
|
myContext : PContext from IntTools is protected;
|
||||||
|
|
||||||
|
end BuilderArea;
|
||||||
|
|
122
src/GEOMAlgo/GEOMAlgo_BuilderArea.cxx
Executable file
122
src/GEOMAlgo/GEOMAlgo_BuilderArea.cxx
Executable file
@ -0,0 +1,122 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
//
|
||||||
|
// File: GEOMAlgo_BuilderArea.cxx
|
||||||
|
// Created:
|
||||||
|
// Author: Peter KURNEV
|
||||||
|
|
||||||
|
|
||||||
|
#include <GEOMAlgo_BuilderArea.ixx>
|
||||||
|
|
||||||
|
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||||
|
#include <TopoDS_Shape.hxx>
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function :
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
GEOMAlgo_BuilderArea::GEOMAlgo_BuilderArea()
|
||||||
|
:
|
||||||
|
GEOMAlgo_Algo()
|
||||||
|
{
|
||||||
|
myContext=NULL;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : ~
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
GEOMAlgo_BuilderArea::~GEOMAlgo_BuilderArea()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : SetContext
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_BuilderArea::SetContext(const IntTools_Context& theContext)
|
||||||
|
{
|
||||||
|
myContext=(IntTools_Context*)&theContext;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : SetShapes
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_BuilderArea::SetShapes(const TopTools_ListOfShape& theLF)
|
||||||
|
{
|
||||||
|
TopTools_ListIteratorOfListOfShape aIt;
|
||||||
|
//
|
||||||
|
myShapes.Clear();
|
||||||
|
aIt.Initialize(theLF);
|
||||||
|
for(; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aF=aIt.Value();
|
||||||
|
myShapes.Append(aF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Shapes
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
const TopTools_ListOfShape& GEOMAlgo_BuilderArea::Shapes()const
|
||||||
|
{
|
||||||
|
return myShapes;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Loops
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
const TopTools_ListOfShape& GEOMAlgo_BuilderArea::Loops()const
|
||||||
|
{
|
||||||
|
return myLoops;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Solids
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
const TopTools_ListOfShape& GEOMAlgo_BuilderArea::Areas()const
|
||||||
|
{
|
||||||
|
return myAreas;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function :PerformShapesToAvoid
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_BuilderArea::PerformShapesToAvoid()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : PerformLoops
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_BuilderArea::PerformLoops()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : PerformAreas
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_BuilderArea::PerformAreas()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : PerformInternalShapes
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_BuilderArea::PerformInternalShapes()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
144
src/GEOMAlgo/GEOMAlgo_BuilderArea.hxx
Normal file
144
src/GEOMAlgo/GEOMAlgo_BuilderArea.hxx
Normal file
@ -0,0 +1,144 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _GEOMAlgo_BuilderArea_HeaderFile
|
||||||
|
#define _GEOMAlgo_BuilderArea_HeaderFile
|
||||||
|
|
||||||
|
#ifndef _TopTools_ListOfShape_HeaderFile
|
||||||
|
#include <TopTools_ListOfShape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopTools_MapOfOrientedShape_HeaderFile
|
||||||
|
#include <TopTools_MapOfOrientedShape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _IntTools_PContext_HeaderFile
|
||||||
|
#include <IntTools_PContext.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_Algo_HeaderFile
|
||||||
|
#include <GEOMAlgo_Algo.hxx>
|
||||||
|
#endif
|
||||||
|
class IntTools_Context;
|
||||||
|
class TopTools_ListOfShape;
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _Standard_HeaderFile
|
||||||
|
#include <Standard.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Macro_HeaderFile
|
||||||
|
#include <Standard_Macro.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//! The root class for algorithms to build <br>
|
||||||
|
//! faces/solids from set of edges/faces <br>
|
||||||
|
class GEOMAlgo_BuilderArea : public GEOMAlgo_Algo {
|
||||||
|
|
||||||
|
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
|
||||||
|
//
|
||||||
|
|
||||||
|
//! Sets cashed geometrical tools <br>
|
||||||
|
Standard_EXPORT void SetContext(const IntTools_Context& theContext) ;
|
||||||
|
|
||||||
|
//! Sets edges/faces to process <br>
|
||||||
|
Standard_EXPORT void SetShapes(const TopTools_ListOfShape& theLS) ;
|
||||||
|
|
||||||
|
//! Returns edges/faces to process <br>
|
||||||
|
Standard_EXPORT const TopTools_ListOfShape& Shapes() const;
|
||||||
|
|
||||||
|
//! Returns wires/shells that have been built <br>
|
||||||
|
Standard_EXPORT const TopTools_ListOfShape& Loops() const;
|
||||||
|
|
||||||
|
//! Returns faces/solids that have been built <br>
|
||||||
|
Standard_EXPORT const TopTools_ListOfShape& Areas() const;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Methods PROTECTED
|
||||||
|
//
|
||||||
|
|
||||||
|
//! Empty constructor <br>
|
||||||
|
Standard_EXPORT GEOMAlgo_BuilderArea();
|
||||||
|
Standard_EXPORT virtual ~GEOMAlgo_BuilderArea();
|
||||||
|
|
||||||
|
//! Collect the edges/faces that <br>
|
||||||
|
//! a) are internal <br>
|
||||||
|
//! b) are the same and have different orientation <br>
|
||||||
|
Standard_EXPORT virtual void PerformShapesToAvoid() ;
|
||||||
|
|
||||||
|
//! Build draft faces/shells <br>
|
||||||
|
//! a)myLoops - draft faces/shells that consist of <br>
|
||||||
|
//! boundary edges/faces <br>
|
||||||
|
//! b)myLoopsInternal - draft faces/shells that contains <br>
|
||||||
|
//! inner edges/faces <br>
|
||||||
|
Standard_EXPORT virtual void PerformLoops() ;
|
||||||
|
|
||||||
|
//! Build draft faces/solids that contains boundary faces <br>
|
||||||
|
Standard_EXPORT virtual void PerformAreas() ;
|
||||||
|
|
||||||
|
//! Build finalized faces/solids with internal wires/shells <br>
|
||||||
|
Standard_EXPORT virtual void PerformInternalShapes() ;
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PROTECTED
|
||||||
|
//
|
||||||
|
TopTools_ListOfShape myShapes;
|
||||||
|
TopTools_ListOfShape myLoops;
|
||||||
|
TopTools_ListOfShape myLoopsInternal;
|
||||||
|
TopTools_MapOfOrientedShape myShapesToAvoid;
|
||||||
|
TopTools_ListOfShape myAreas;
|
||||||
|
IntTools_PContext myContext;
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Methods PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// other Inline functions and methods (like "C++: function call" methods)
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
24
src/GEOMAlgo/GEOMAlgo_BuilderArea.ixx
Normal file
24
src/GEOMAlgo/GEOMAlgo_BuilderArea.ixx
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#include <GEOMAlgo_BuilderArea.jxx>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
28
src/GEOMAlgo/GEOMAlgo_BuilderArea.jxx
Normal file
28
src/GEOMAlgo/GEOMAlgo_BuilderArea.jxx
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _IntTools_Context_HeaderFile
|
||||||
|
#include <IntTools_Context.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopTools_ListOfShape_HeaderFile
|
||||||
|
#include <TopTools_ListOfShape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_BuilderArea_HeaderFile
|
||||||
|
#include <GEOMAlgo_BuilderArea.hxx>
|
||||||
|
#endif
|
82
src/GEOMAlgo/GEOMAlgo_BuilderFace.cdl
Executable file
82
src/GEOMAlgo/GEOMAlgo_BuilderFace.cdl
Executable file
@ -0,0 +1,82 @@
|
|||||||
|
-- Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
--
|
||||||
|
-- This library is free software; you can redistribute it and/or
|
||||||
|
-- modify it under the terms of the GNU Lesser General Public
|
||||||
|
-- License as published by the Free Software Foundation; either
|
||||||
|
-- version 2.1 of the License.
|
||||||
|
--
|
||||||
|
-- This library is distributed in the hope that it will be useful
|
||||||
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
-- Lesser General Public License for more details.
|
||||||
|
--
|
||||||
|
-- You should have received a copy of the GNU Lesser General Public
|
||||||
|
-- License along with this library; if not, write to the Free Software
|
||||||
|
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
--
|
||||||
|
-- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
--
|
||||||
|
-- File: GEOMAlgo_BuilderFace.cdl
|
||||||
|
-- Created:
|
||||||
|
-- Author: Peter KURNEV
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class BuilderFace from GEOMAlgo
|
||||||
|
inherits BuilderArea from GEOMAlgo
|
||||||
|
|
||||||
|
---Purpose: The algorithm to build faces from set of edges
|
||||||
|
|
||||||
|
uses
|
||||||
|
Face from TopoDS
|
||||||
|
|
||||||
|
--raises
|
||||||
|
|
||||||
|
is
|
||||||
|
Create
|
||||||
|
---Purpose: Empty constructor
|
||||||
|
returns BuilderFace from GEOMAlgo;
|
||||||
|
---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_BuilderFace();"
|
||||||
|
|
||||||
|
SetFace(me:out;
|
||||||
|
theFace:Face from TopoDS);
|
||||||
|
---Purpose: Sets the face generatix
|
||||||
|
|
||||||
|
Face(me)
|
||||||
|
---Purpose: Returns the face generatix
|
||||||
|
returns Face from TopoDS;
|
||||||
|
---C++: return const &
|
||||||
|
|
||||||
|
Perform(me:out)
|
||||||
|
---Purpose: Performs the algorithm
|
||||||
|
is redefined;
|
||||||
|
|
||||||
|
PerformShapesToAvoid(me:out)
|
||||||
|
---Purpose: Collect the edges that
|
||||||
|
-- a) are internal
|
||||||
|
-- b) are the same and have different orientation
|
||||||
|
is redefined protected;
|
||||||
|
|
||||||
|
PerformLoops(me:out)
|
||||||
|
---Purpose: Build draft wires
|
||||||
|
-- a)myLoops - draft wires that consist of
|
||||||
|
-- boundary edges
|
||||||
|
-- b)myLoopsInternal - draft wires that contains
|
||||||
|
-- inner edges
|
||||||
|
is redefined protected;
|
||||||
|
|
||||||
|
PerformAreas(me:out)
|
||||||
|
---Purpose: Build draft faces that contains boundary edges
|
||||||
|
is redefined protected;
|
||||||
|
|
||||||
|
PerformInternalShapes(me:out)
|
||||||
|
---Purpose: Build finalized faces with internals
|
||||||
|
is redefined protected;
|
||||||
|
|
||||||
|
|
||||||
|
fields
|
||||||
|
myFace : Face from TopoDS is protected;
|
||||||
|
|
||||||
|
end BuilderFace;
|
||||||
|
|
676
src/GEOMAlgo/GEOMAlgo_BuilderFace.cxx
Executable file
676
src/GEOMAlgo/GEOMAlgo_BuilderFace.cxx
Executable file
@ -0,0 +1,676 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
//
|
||||||
|
// File: GEOMAlgo_BuilderFace.cxx
|
||||||
|
// Created:
|
||||||
|
// Author: Peter KURNEV
|
||||||
|
|
||||||
|
#include <GEOMAlgo_BuilderFace.ixx>
|
||||||
|
|
||||||
|
#include <gp_Pnt2d.hxx>
|
||||||
|
#include <gp_Pln.hxx>
|
||||||
|
#include <gp_Vec.hxx>
|
||||||
|
#include <gp_Dir.hxx>
|
||||||
|
#include <gp_Pnt.hxx>
|
||||||
|
|
||||||
|
#include <Geom_Surface.hxx>
|
||||||
|
|
||||||
|
#include <TopAbs.hxx>
|
||||||
|
#include <TopLoc_Location.hxx>
|
||||||
|
|
||||||
|
#include <TopoDS_Iterator.hxx>
|
||||||
|
#include <TopoDS_Face.hxx>
|
||||||
|
#include <TopoDS.hxx>
|
||||||
|
#include <TopoDS_Shape.hxx>
|
||||||
|
#include <TopoDS_Wire.hxx>
|
||||||
|
#include <TopoDS_Edge.hxx>
|
||||||
|
#include <TopoDS_Vertex.hxx>
|
||||||
|
|
||||||
|
#include <BRep_Builder.hxx>
|
||||||
|
#include <BRep_Tool.hxx>
|
||||||
|
#include <BRepTools.hxx>
|
||||||
|
|
||||||
|
#include <TopExp.hxx>
|
||||||
|
#include <TopExp_Explorer.hxx>
|
||||||
|
|
||||||
|
#include <TopTools_MapOfShape.hxx>
|
||||||
|
#include <TopTools_MapIteratorOfMapOfShape.hxx>
|
||||||
|
#include <TopTools_MapOfOrientedShape.hxx>
|
||||||
|
#include <TopTools_MapIteratorOfMapOfOrientedShape.hxx>
|
||||||
|
#include <TopTools_ListOfShape.hxx>
|
||||||
|
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||||
|
#include <TopTools_DataMapOfShapeShape.hxx>
|
||||||
|
#include <TopTools_IndexedMapOfShape.hxx>
|
||||||
|
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||||
|
#include <TopTools_DataMapOfShapeListOfShape.hxx>
|
||||||
|
#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
|
||||||
|
|
||||||
|
#include <IntTools_FClass2d.hxx>
|
||||||
|
#include <IntTools_Context.hxx>
|
||||||
|
|
||||||
|
#include <BOPTools_Tools2D.hxx>
|
||||||
|
#include <BOP_WireEdgeSet.hxx>
|
||||||
|
#include <BOP_WESCorrector.hxx>
|
||||||
|
|
||||||
|
#include <NMTTools_ListOfCoupleOfShape.hxx>
|
||||||
|
#include <NMTTools_CoupleOfShape.hxx>
|
||||||
|
#include <NMTTools_ListIteratorOfListOfCoupleOfShape.hxx>
|
||||||
|
|
||||||
|
#include <GEOMAlgo_Tools3D.hxx>
|
||||||
|
#include <GEOMAlgo_BuilderTools.hxx>
|
||||||
|
#include <GEOMAlgo_WireEdgeSet.hxx>
|
||||||
|
#include <GEOMAlgo_WESCorrector.hxx>
|
||||||
|
|
||||||
|
//
|
||||||
|
static
|
||||||
|
Standard_Boolean IsGrowthWire(const TopoDS_Shape& ,
|
||||||
|
|
||||||
|
const TopTools_IndexedMapOfShape& );
|
||||||
|
|
||||||
|
static
|
||||||
|
Standard_Boolean IsInside(const TopoDS_Shape& ,
|
||||||
|
const TopoDS_Shape& ,
|
||||||
|
IntTools_PContext& );
|
||||||
|
static
|
||||||
|
void MakeInternalWires(const TopTools_MapOfShape& ,
|
||||||
|
TopTools_ListOfShape& );
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function :
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
GEOMAlgo_BuilderFace::GEOMAlgo_BuilderFace()
|
||||||
|
:
|
||||||
|
GEOMAlgo_BuilderArea()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : ~
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
GEOMAlgo_BuilderFace::~GEOMAlgo_BuilderFace()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : SetFace
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_BuilderFace::SetFace(const TopoDS_Face& theFace)
|
||||||
|
{
|
||||||
|
myFace=theFace;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Face
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
const TopoDS_Face& GEOMAlgo_BuilderFace::Face()const
|
||||||
|
{
|
||||||
|
return myFace;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Perform
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_BuilderFace::Perform()
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
if (myContext==NULL) {
|
||||||
|
myErrorStatus=11;// Null Context
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if (myFace.IsNull()) {
|
||||||
|
myErrorStatus=12;// Null face generix
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
PerformShapesToAvoid();
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
PerformLoops();
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
PerformAreas();
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
PerformInternalShapes();
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function :PerformShapesToAvoid
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_BuilderFace::PerformShapesToAvoid()
|
||||||
|
{
|
||||||
|
Standard_Boolean bFound;
|
||||||
|
Standard_Integer i, iCnt, aNbV, aNbE;
|
||||||
|
TopTools_IndexedDataMapOfShapeListOfShape aMVE;
|
||||||
|
TopTools_ListIteratorOfListOfShape aIt;
|
||||||
|
//
|
||||||
|
myShapesToAvoid.Clear();
|
||||||
|
//
|
||||||
|
iCnt=0;
|
||||||
|
while (1) {
|
||||||
|
++iCnt;
|
||||||
|
bFound=Standard_False;
|
||||||
|
//
|
||||||
|
// 1. MEF
|
||||||
|
aMVE.Clear();
|
||||||
|
aIt.Initialize (myShapes);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aE=aIt.Value();
|
||||||
|
if (!myShapesToAvoid.Contains(aE)) {
|
||||||
|
TopExp::MapShapesAndAncestors(aE, TopAbs_VERTEX, TopAbs_EDGE, aMVE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
int a=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
aNbV=aMVE.Extent();
|
||||||
|
//
|
||||||
|
// 2. myEdgesToAvoid
|
||||||
|
for (i=1; i<=aNbV; ++i) {
|
||||||
|
const TopoDS_Vertex& aV=TopoDS::Vertex(aMVE.FindKey(i));
|
||||||
|
//
|
||||||
|
TopTools_ListOfShape& aLE=aMVE.ChangeFromKey(aV);
|
||||||
|
aNbE=aLE.Extent();
|
||||||
|
if (!aNbE) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
const TopoDS_Edge& aE1=TopoDS::Edge(aLE.First());
|
||||||
|
if (aNbE==1) {
|
||||||
|
if (BRep_Tool::Degenerated(aE1)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (aV.Orientation()==TopAbs_INTERNAL) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
bFound=Standard_True;
|
||||||
|
myShapesToAvoid.Add(aE1);
|
||||||
|
}
|
||||||
|
else if (aNbE==2) {
|
||||||
|
const TopoDS_Edge& aE2=TopoDS::Edge(aLE.Last());
|
||||||
|
if (aE2.IsSame(aE1)) {
|
||||||
|
TopoDS_Vertex aV1x, aV2x;
|
||||||
|
//
|
||||||
|
TopExp::Vertices(aE1, aV1x, aV2x);
|
||||||
|
if (aV1x.IsSame(aV2x)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
bFound=Standard_True;
|
||||||
|
myShapesToAvoid.Add(aE1);
|
||||||
|
myShapesToAvoid.Add(aE2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}// for (i=1; i<=aNbE; ++i) {
|
||||||
|
//
|
||||||
|
if (!bFound) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
}//while (1)
|
||||||
|
//printf(" EdgesToAvoid=%d, iCnt=%d\n", EdgesToAvoid.Extent(), iCnt);
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : PerformLoops
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_BuilderFace::PerformLoops()
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
Standard_Boolean bFlag;
|
||||||
|
Standard_Integer aNbEA;
|
||||||
|
TopTools_ListIteratorOfListOfShape aIt;
|
||||||
|
TopTools_MapIteratorOfMapOfOrientedShape aItM;
|
||||||
|
TopTools_IndexedDataMapOfShapeListOfShape aVEMap;
|
||||||
|
TopTools_MapOfOrientedShape aMAdded;
|
||||||
|
BRep_Builder aBB;
|
||||||
|
GEOMAlgo_WireEdgeSet aWES;
|
||||||
|
GEOMAlgo_WESCorrector aWESCor;
|
||||||
|
//
|
||||||
|
// 1. Usual Wires
|
||||||
|
myLoops.Clear();
|
||||||
|
aWES.SetFace(myFace);
|
||||||
|
//
|
||||||
|
aIt.Initialize (myShapes);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aE=aIt.Value();
|
||||||
|
if (!myShapesToAvoid.Contains(aE)) {
|
||||||
|
aWES.AddStartElement(aE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aWESCor.SetWES(aWES);
|
||||||
|
aWESCor.Perform();
|
||||||
|
//
|
||||||
|
GEOMAlgo_WireEdgeSet& aWESN=aWESCor.NewWES();
|
||||||
|
const TopTools_ListOfShape& aLW=aWESN.Shapes();
|
||||||
|
//
|
||||||
|
aIt.Initialize (aLW);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aW=aIt.Value();
|
||||||
|
myLoops.Append(aW);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// 2. Internal Wires
|
||||||
|
myLoopsInternal.Clear();
|
||||||
|
//
|
||||||
|
aNbEA=myShapesToAvoid.Extent();
|
||||||
|
aItM.Initialize(myShapesToAvoid);
|
||||||
|
for (; aItM.More(); aItM.Next()) {
|
||||||
|
const TopoDS_Shape& aEE=aItM.Key();
|
||||||
|
TopExp::MapShapesAndAncestors(aEE, TopAbs_VERTEX, TopAbs_EDGE, aVEMap);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
bFlag=Standard_True;
|
||||||
|
aItM.Initialize(myShapesToAvoid);
|
||||||
|
for (; aItM.More()&&bFlag; aItM.Next()) {
|
||||||
|
const TopoDS_Shape& aEE=aItM.Key();
|
||||||
|
if (!aMAdded.Add(aEE)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// make new wire
|
||||||
|
TopoDS_Wire aW;
|
||||||
|
aBB.MakeWire(aW);
|
||||||
|
aBB.Add(aW, aEE);
|
||||||
|
//
|
||||||
|
TopoDS_Iterator aItW (aW);
|
||||||
|
for (; aItW.More()&&bFlag; aItW.Next()) {
|
||||||
|
const TopoDS_Edge& aE=TopoDS::Edge(aItW.Value());
|
||||||
|
//
|
||||||
|
TopoDS_Iterator aItE(aE);
|
||||||
|
for (; aItE.More()&&bFlag; aItE.Next()) {
|
||||||
|
const TopoDS_Vertex& aV = TopoDS::Vertex(aItE.Value());
|
||||||
|
const TopTools_ListOfShape& aLE=aVEMap.FindFromKey(aV);
|
||||||
|
aIt.Initialize(aLE);
|
||||||
|
for (; aIt.More()&&bFlag; aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aEx=aIt.Value();
|
||||||
|
if (aMAdded.Add(aEx)) {
|
||||||
|
aBB.Add(aW, aEx);
|
||||||
|
if(aMAdded.Extent()==aNbEA) {
|
||||||
|
bFlag=!bFlag;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}//for (; aIt.More(); aIt.Next()) {
|
||||||
|
}//for (; aItE.More(); aItE.Next()) {
|
||||||
|
}//for (; aItW.More(); aItW.Next()) {
|
||||||
|
myLoopsInternal.Append(aW);
|
||||||
|
}//for (; aItM.More(); aItM.Next()) {
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : PerformAreas
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_BuilderFace::PerformAreas()
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
Standard_Boolean bIsGrowth, bIsHole;
|
||||||
|
Standard_Real aTol;
|
||||||
|
TopTools_ListOfShape aNewFaces, aHoleWires;
|
||||||
|
TopoDS_Shape anInfinitePointShape;
|
||||||
|
TopTools_DataMapOfShapeShape aInOutMap;
|
||||||
|
TopTools_DataMapOfShapeListOfShape aMSH;
|
||||||
|
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItMSH;
|
||||||
|
TopTools_ListIteratorOfListOfShape aIt1, aIt2;
|
||||||
|
TopTools_IndexedMapOfShape aMHE;
|
||||||
|
BRep_Builder aBB;
|
||||||
|
Handle(Geom_Surface) aS;
|
||||||
|
TopLoc_Location aLoc;
|
||||||
|
//
|
||||||
|
aTol=BRep_Tool::Tolerance(myFace);
|
||||||
|
aS=BRep_Tool::Surface(myFace, aLoc);
|
||||||
|
//
|
||||||
|
myAreas.Clear();
|
||||||
|
//
|
||||||
|
// Draft faces [aNewFaces]
|
||||||
|
aIt1.Initialize(myLoops);
|
||||||
|
for ( ; aIt1.More(); aIt1.Next()) {
|
||||||
|
const TopoDS_Shape& aWire=aIt1.Value();
|
||||||
|
//
|
||||||
|
bIsGrowth=IsGrowthWire(aWire, aMHE);
|
||||||
|
if (bIsGrowth) {
|
||||||
|
// make a growth face from a wire
|
||||||
|
TopoDS_Face aFace;
|
||||||
|
aBB.MakeFace(aFace, aS, aLoc, aTol);
|
||||||
|
aBB.Add (aFace, aWire);
|
||||||
|
//
|
||||||
|
aNewFaces.Append (aFace);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
// check if a wire is a hole
|
||||||
|
//XX
|
||||||
|
//bIsHole=IsHole(aWire, myFace, myContext);
|
||||||
|
bIsHole=GEOMAlgo_BuilderTools::IsHole(aWire, myFace);
|
||||||
|
//XX
|
||||||
|
if (bIsHole) {
|
||||||
|
aHoleWires.Append(aWire);
|
||||||
|
TopExp::MapShapes(aWire, TopAbs_EDGE, aMHE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// make a growth face from a wire
|
||||||
|
TopoDS_Face aFace;
|
||||||
|
aBB.MakeFace(aFace, aS, aLoc, aTol);
|
||||||
|
aBB.Add (aFace, aWire);
|
||||||
|
//
|
||||||
|
aNewFaces.Append (aFace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// 2. Find outer growth shell that is most close to each hole shell
|
||||||
|
aIt2.Initialize(aHoleWires);
|
||||||
|
for (; aIt2.More(); aIt2.Next()) {
|
||||||
|
const TopoDS_Shape& aHole = aIt2.Value();
|
||||||
|
//
|
||||||
|
aIt1.Initialize(aNewFaces);
|
||||||
|
for ( ; aIt1.More(); aIt1.Next()) {
|
||||||
|
const TopoDS_Shape& aF=aIt1.Value();
|
||||||
|
//
|
||||||
|
if (!IsInside(aHole, aF, myContext)){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if ( aInOutMap.IsBound (aHole)){
|
||||||
|
const TopoDS_Shape& aF2=aInOutMap(aHole);
|
||||||
|
if (IsInside(aF, aF2, myContext)) {
|
||||||
|
aInOutMap.UnBind(aHole);
|
||||||
|
aInOutMap.Bind (aHole, aF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
aInOutMap.Bind (aHole, aF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// Add aHole to a map Face/ListOfHoles [aMSH]
|
||||||
|
if (aInOutMap.IsBound(aHole)){
|
||||||
|
const TopoDS_Shape& aF=aInOutMap(aHole);
|
||||||
|
if (aMSH.IsBound(aF)) {
|
||||||
|
TopTools_ListOfShape& aLH=aMSH.ChangeFind(aF);
|
||||||
|
aLH.Append(aHole);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
TopTools_ListOfShape aLH;
|
||||||
|
aLH.Append(aHole);
|
||||||
|
aMSH.Bind(aF, aLH);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}// for (; aIt2.More(); aIt2.Next())
|
||||||
|
//
|
||||||
|
// 3. Add aHoles to Faces
|
||||||
|
aItMSH.Initialize(aMSH);
|
||||||
|
for (; aItMSH.More(); aItMSH.Next()) {
|
||||||
|
TopoDS_Face aF=TopoDS::Face(aItMSH.Key());
|
||||||
|
//
|
||||||
|
const TopTools_ListOfShape& aLH=aItMSH.Value();
|
||||||
|
aIt2.Initialize(aLH);
|
||||||
|
for (; aIt2.More(); aIt2.Next()) {
|
||||||
|
const TopoDS_Shape& aHole = aIt2.Value();
|
||||||
|
aBB.Add (aF, aHole);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// update classifier
|
||||||
|
aTol=BRep_Tool::Tolerance(aF);
|
||||||
|
IntTools_FClass2d& aClsf=myContext->FClass2d(aF);
|
||||||
|
aClsf.Init(aF, aTol);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// These aNewFaces are draft faces that
|
||||||
|
// do not contain any internal shapes
|
||||||
|
//
|
||||||
|
myAreas.Append(aNewFaces);
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : PerformInternalShapes
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_BuilderFace::PerformInternalShapes()
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
Standard_Integer aNbWI=myLoopsInternal.Extent();
|
||||||
|
if (!aNbWI) {// nothing to do
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
//Standard_Real aTol;
|
||||||
|
BRep_Builder aBB;
|
||||||
|
TopTools_ListIteratorOfListOfShape aIt1, aIt2;
|
||||||
|
TopoDS_Iterator aIt;
|
||||||
|
TopTools_MapOfShape aME, aMEP;
|
||||||
|
TopTools_MapIteratorOfMapOfShape aItME;
|
||||||
|
TopTools_IndexedDataMapOfShapeListOfShape aMVE;
|
||||||
|
TopTools_ListOfShape aLSI;
|
||||||
|
//
|
||||||
|
// 1. All internal edges
|
||||||
|
aIt1.Initialize(myLoopsInternal);
|
||||||
|
for (; aIt1.More(); aIt1.Next()) {
|
||||||
|
const TopoDS_Shape& aWire=aIt1.Value();
|
||||||
|
aIt.Initialize(aWire);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aE=aIt.Value();
|
||||||
|
aME.Add(aE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
aNbWI=aME.Extent();
|
||||||
|
//
|
||||||
|
// 2 Process faces
|
||||||
|
aIt2.Initialize(myAreas);
|
||||||
|
for ( ; aIt2.More(); aIt2.Next()) {
|
||||||
|
TopoDS_Face& aF=TopoDS::Face(aIt2.Value());
|
||||||
|
//
|
||||||
|
aMVE.Clear();
|
||||||
|
TopExp::MapShapesAndAncestors(aF, TopAbs_VERTEX, TopAbs_EDGE, aMVE);
|
||||||
|
//
|
||||||
|
// 2.1 Separate faces to process aMEP
|
||||||
|
aMEP.Clear();
|
||||||
|
aItME.Initialize(aME);
|
||||||
|
for (; aItME.More(); aItME.Next()) {
|
||||||
|
const TopoDS_Edge& aE=TopoDS::Edge(aItME.Key());
|
||||||
|
if (IsInside(aE, aF, myContext)) {
|
||||||
|
aMEP.Add(aE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// 2.2 Make Internal Wires
|
||||||
|
aLSI.Clear();
|
||||||
|
MakeInternalWires(aMEP, aLSI);
|
||||||
|
//
|
||||||
|
// 2.3 Add them to aF
|
||||||
|
aIt1.Initialize(aLSI);
|
||||||
|
for (; aIt1.More(); aIt1.Next()) {
|
||||||
|
const TopoDS_Shape& aSI=aIt1.Value();
|
||||||
|
aBB.Add (aF, aSI);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// 2.4 Remove faces aMFP from aMF
|
||||||
|
aItME.Initialize(aMEP);
|
||||||
|
for (; aItME.More(); aItME.Next()) {
|
||||||
|
const TopoDS_Shape& aE=aItME.Key();
|
||||||
|
aME.Remove(aE);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aNbWI=aME.Extent();
|
||||||
|
if (!aNbWI) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} //for ( ; aIt2.More(); aIt2.Next()) {
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : MakeInternalWires
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void MakeInternalWires(const TopTools_MapOfShape& theME,
|
||||||
|
TopTools_ListOfShape& theWires)
|
||||||
|
{
|
||||||
|
TopTools_MapIteratorOfMapOfShape aItM;
|
||||||
|
TopTools_MapOfShape aAddedMap;
|
||||||
|
TopTools_ListIteratorOfListOfShape aItE;
|
||||||
|
TopTools_IndexedDataMapOfShapeListOfShape aMVE;
|
||||||
|
BRep_Builder aBB;
|
||||||
|
//
|
||||||
|
aItM.Initialize(theME);
|
||||||
|
for (; aItM.More(); aItM.Next()) {
|
||||||
|
const TopoDS_Shape& aE=aItM.Key();
|
||||||
|
TopExp::MapShapesAndAncestors(aE, TopAbs_VERTEX, TopAbs_EDGE, aMVE);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aItM.Initialize(theME);
|
||||||
|
for (; aItM.More(); aItM.Next()) {
|
||||||
|
TopoDS_Shape aEE=aItM.Key();
|
||||||
|
if (!aAddedMap.Add(aEE)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// make a new shell
|
||||||
|
TopoDS_Wire aW;
|
||||||
|
aBB.MakeWire(aW);
|
||||||
|
aEE.Orientation(TopAbs_INTERNAL);
|
||||||
|
aBB.Add(aW, aEE);
|
||||||
|
//
|
||||||
|
TopoDS_Iterator aItAdded (aW);
|
||||||
|
for (; aItAdded.More(); aItAdded.Next()) {
|
||||||
|
const TopoDS_Shape& aE =aItAdded.Value();
|
||||||
|
//
|
||||||
|
TopExp_Explorer aExp(aE, TopAbs_VERTEX);
|
||||||
|
for (; aExp.More(); aExp.Next()) {
|
||||||
|
const TopoDS_Shape& aV =aExp.Current();
|
||||||
|
const TopTools_ListOfShape& aLE=aMVE.FindFromKey(aV);
|
||||||
|
aItE.Initialize(aLE);
|
||||||
|
for (; aItE.More(); aItE.Next()) {
|
||||||
|
TopoDS_Shape aEL=aItE.Value();
|
||||||
|
if (aAddedMap.Add(aEL)){
|
||||||
|
aEL.Orientation(TopAbs_INTERNAL);
|
||||||
|
aBB.Add(aW, aEL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
theWires.Append(aW);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsInside
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean IsInside(const TopoDS_Shape& theHole,
|
||||||
|
const TopoDS_Shape& theF2,
|
||||||
|
IntTools_PContext& theContext)
|
||||||
|
{
|
||||||
|
Standard_Real aT, aU, aV;
|
||||||
|
TopExp_Explorer aExp;
|
||||||
|
TopAbs_State aState=TopAbs_UNKNOWN;
|
||||||
|
gp_Pnt2d aP2D;
|
||||||
|
//
|
||||||
|
const TopoDS_Face& aF2=TopoDS::Face(theF2);
|
||||||
|
//
|
||||||
|
aExp.Init(theHole, TopAbs_EDGE);
|
||||||
|
if (aExp.More()){
|
||||||
|
const TopoDS_Edge& aE = TopoDS::Edge(aExp.Current());
|
||||||
|
aT=BOPTools_Tools2D::IntermediatePoint(aE);
|
||||||
|
BOPTools_Tools2D::PointOnSurface(aE, aF2, aT, aU, aV);
|
||||||
|
aP2D.SetCoord(aU, aV);
|
||||||
|
//
|
||||||
|
IntTools_FClass2d& aClsf=theContext->FClass2d(aF2);
|
||||||
|
aState=aClsf.Perform(aP2D);
|
||||||
|
}
|
||||||
|
return (aState==TopAbs_IN);
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsGrowthWire
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean IsGrowthWire(const TopoDS_Shape& theWire,
|
||||||
|
const TopTools_IndexedMapOfShape& theMHE)
|
||||||
|
{
|
||||||
|
Standard_Boolean bRet;
|
||||||
|
TopoDS_Iterator aIt;
|
||||||
|
//
|
||||||
|
bRet=Standard_False;
|
||||||
|
if (theMHE.Extent()) {
|
||||||
|
aIt.Initialize(theWire);
|
||||||
|
for(; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aE=aIt.Value();
|
||||||
|
if (theMHE.Contains(aE)) {
|
||||||
|
return !bRet;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
//modified by NIZNHY-PKV Mon Sep 18 13:18:27 2006f
|
||||||
|
/*
|
||||||
|
static
|
||||||
|
Standard_Boolean IsHole(const TopoDS_Shape& ,
|
||||||
|
const TopoDS_Face& ,
|
||||||
|
IntTools_PContext& );
|
||||||
|
*/
|
||||||
|
//modified by NIZNHY-PKV Mon Sep 18 13:18:34 2006t
|
||||||
|
//modified by NIZNHY-PKV Mon Sep 18 13:18:13 2006f
|
||||||
|
/*
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsHole
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean IsHole(const TopoDS_Shape& theS2,
|
||||||
|
const TopoDS_Face& theFace,
|
||||||
|
IntTools_PContext& theContext)
|
||||||
|
{
|
||||||
|
Standard_Boolean bIsHole;
|
||||||
|
Standard_Real aTol;
|
||||||
|
Handle(Geom_Surface) aS;
|
||||||
|
TopLoc_Location aLoc;
|
||||||
|
TopoDS_Face aF;
|
||||||
|
BRep_Builder aBB;
|
||||||
|
//
|
||||||
|
aTol=BRep_Tool::Tolerance(theFace);
|
||||||
|
aS=BRep_Tool::Surface(theFace, aLoc);
|
||||||
|
aBB.MakeFace(aF, aS, aLoc, aTol);
|
||||||
|
aBB.Add (aF, theS2);
|
||||||
|
//
|
||||||
|
IntTools_FClass2d& aClsf=theContext->FClass2d(aF);
|
||||||
|
//
|
||||||
|
bIsHole=aClsf.IsHole();
|
||||||
|
//
|
||||||
|
return bIsHole;
|
||||||
|
//
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
//modified by NIZNHY-PKV Mon Sep 18 13:18:06 2006t
|
||||||
|
|
||||||
|
//BRepTools::Write(aFF, "ff");
|
||||||
|
//
|
||||||
|
// ErrorStatus :
|
||||||
|
// 11 - Null Context
|
||||||
|
// 12 - Null face generix
|
||||||
|
|
125
src/GEOMAlgo/GEOMAlgo_BuilderFace.hxx
Normal file
125
src/GEOMAlgo/GEOMAlgo_BuilderFace.hxx
Normal file
@ -0,0 +1,125 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _GEOMAlgo_BuilderFace_HeaderFile
|
||||||
|
#define _GEOMAlgo_BuilderFace_HeaderFile
|
||||||
|
|
||||||
|
#ifndef _TopoDS_Face_HeaderFile
|
||||||
|
#include <TopoDS_Face.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_BuilderArea_HeaderFile
|
||||||
|
#include <GEOMAlgo_BuilderArea.hxx>
|
||||||
|
#endif
|
||||||
|
class TopoDS_Face;
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _Standard_HeaderFile
|
||||||
|
#include <Standard.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Macro_HeaderFile
|
||||||
|
#include <Standard_Macro.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//! The algorithm to build faces from set of edges <br>
|
||||||
|
class GEOMAlgo_BuilderFace : public GEOMAlgo_BuilderArea {
|
||||||
|
|
||||||
|
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
|
||||||
|
//
|
||||||
|
|
||||||
|
//! Empty constructor <br>
|
||||||
|
Standard_EXPORT GEOMAlgo_BuilderFace();
|
||||||
|
Standard_EXPORT virtual ~GEOMAlgo_BuilderFace();
|
||||||
|
|
||||||
|
//! Sets the face generatix <br>
|
||||||
|
Standard_EXPORT void SetFace(const TopoDS_Face& theFace) ;
|
||||||
|
|
||||||
|
//! Returns the face generatix <br>
|
||||||
|
Standard_EXPORT const TopoDS_Face& Face() const;
|
||||||
|
|
||||||
|
//! Performs the algorithm <br>
|
||||||
|
Standard_EXPORT virtual void Perform() ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Methods PROTECTED
|
||||||
|
//
|
||||||
|
|
||||||
|
//! Collect the edges that <br>
|
||||||
|
//! a) are internal <br>
|
||||||
|
//! b) are the same and have different orientation <br>
|
||||||
|
Standard_EXPORT virtual void PerformShapesToAvoid() ;
|
||||||
|
|
||||||
|
//! Build draft wires <br>
|
||||||
|
//! a)myLoops - draft wires that consist of <br>
|
||||||
|
//! boundary edges <br>
|
||||||
|
//! b)myLoopsInternal - draft wires that contains <br>
|
||||||
|
//! inner edges <br>
|
||||||
|
Standard_EXPORT virtual void PerformLoops() ;
|
||||||
|
|
||||||
|
//! Build draft faces that contains boundary edges <br>
|
||||||
|
Standard_EXPORT virtual void PerformAreas() ;
|
||||||
|
|
||||||
|
//! Build finalized faces with internals <br>
|
||||||
|
Standard_EXPORT virtual void PerformInternalShapes() ;
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PROTECTED
|
||||||
|
//
|
||||||
|
TopoDS_Face myFace;
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Methods PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// other Inline functions and methods (like "C++: function call" methods)
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
24
src/GEOMAlgo/GEOMAlgo_BuilderFace.ixx
Normal file
24
src/GEOMAlgo/GEOMAlgo_BuilderFace.ixx
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#include <GEOMAlgo_BuilderFace.jxx>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
25
src/GEOMAlgo/GEOMAlgo_BuilderFace.jxx
Normal file
25
src/GEOMAlgo/GEOMAlgo_BuilderFace.jxx
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _TopoDS_Face_HeaderFile
|
||||||
|
#include <TopoDS_Face.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_BuilderFace_HeaderFile
|
||||||
|
#include <GEOMAlgo_BuilderFace.hxx>
|
||||||
|
#endif
|
114
src/GEOMAlgo/GEOMAlgo_BuilderShape.cdl
Executable file
114
src/GEOMAlgo/GEOMAlgo_BuilderShape.cdl
Executable file
@ -0,0 +1,114 @@
|
|||||||
|
-- Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
--
|
||||||
|
-- This library is free software; you can redistribute it and/or
|
||||||
|
-- modify it under the terms of the GNU Lesser General Public
|
||||||
|
-- License as published by the Free Software Foundation; either
|
||||||
|
-- version 2.1 of the License.
|
||||||
|
--
|
||||||
|
-- This library is distributed in the hope that it will be useful
|
||||||
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
-- Lesser General Public License for more details.
|
||||||
|
--
|
||||||
|
-- You should have received a copy of the GNU Lesser General Public
|
||||||
|
-- License along with this library; if not, write to the Free Software
|
||||||
|
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
--
|
||||||
|
-- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
--
|
||||||
|
-- File: GEOMAlgo_BuilderShape.cdl
|
||||||
|
-- Created:
|
||||||
|
-- Author: Peter KURNEV
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
deferred class BuilderShape from GEOMAlgo
|
||||||
|
inherits Algo from GEOMAlgo
|
||||||
|
|
||||||
|
---Purpose: Root class for algorithms that has shape as result
|
||||||
|
|
||||||
|
uses
|
||||||
|
Shape from TopoDS,
|
||||||
|
ListOfShape from TopTools,
|
||||||
|
MapOfShape from TopTools,
|
||||||
|
IndexedDataMapOfShapeListOfShape from TopTools
|
||||||
|
|
||||||
|
--raises
|
||||||
|
|
||||||
|
is
|
||||||
|
Initialize
|
||||||
|
---Purpose: Empty constructor
|
||||||
|
returns BuilderShape from GEOMAlgo;
|
||||||
|
---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_BuilderShape();"
|
||||||
|
|
||||||
|
Shape(me)
|
||||||
|
---Purpose: Returns the result of algorithm
|
||||||
|
returns Shape from TopoDS;
|
||||||
|
---C++: return const &
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------------------------------------
|
||||||
|
--- The following methods are not implemented at this level.
|
||||||
|
-- An empty list is returned.
|
||||||
|
--- They are optional and can be redefined.
|
||||||
|
------------------------------------------------------------------
|
||||||
|
Generated (me:out;
|
||||||
|
theS : Shape from TopoDS)
|
||||||
|
---Purpose: Returns the list of shapes generated from the
|
||||||
|
-- shape theS.
|
||||||
|
returns ListOfShape from TopTools
|
||||||
|
is virtual;
|
||||||
|
---C++: return const &
|
||||||
|
|
||||||
|
Modified (me:out;
|
||||||
|
theS : Shape from TopoDS)
|
||||||
|
---Purpose: Returns the list of shapes modified from the
|
||||||
|
-- shape theS.
|
||||||
|
returns ListOfShape from TopTools
|
||||||
|
is virtual;
|
||||||
|
---C++: return const &
|
||||||
|
|
||||||
|
IsDeleted (me:out;
|
||||||
|
theS : Shape from TopoDS)
|
||||||
|
---Purpose: Returns true if the shape theS has been deleted.
|
||||||
|
returns Boolean from Standard
|
||||||
|
is virtual;
|
||||||
|
|
||||||
|
HasDeleted (me)
|
||||||
|
---Purpose: Returns true if the at least one shape(or subshape)
|
||||||
|
-- of arguments has been deleted.
|
||||||
|
returns Boolean from Standard;
|
||||||
|
|
||||||
|
HasGenerated (me)
|
||||||
|
---Purpose: Returns true if the at least one shape(or subshape)
|
||||||
|
-- of arguments has generated shapes.
|
||||||
|
returns Boolean from Standard;
|
||||||
|
|
||||||
|
HasModified (me)
|
||||||
|
---Purpose: Returns true if the at least one shape(or subshape)
|
||||||
|
-- of arguments has modified shapes.
|
||||||
|
returns Boolean from Standard;
|
||||||
|
|
||||||
|
PrepareHistory (me:out)
|
||||||
|
---Purpose: Prepare information for history support
|
||||||
|
is virtual protected;
|
||||||
|
|
||||||
|
--modified by NIZNHY-PKV Thu Dec 7 11:13:17 2006f
|
||||||
|
ImagesResult(me)
|
||||||
|
returns IndexedDataMapOfShapeListOfShape from TopTools;
|
||||||
|
---C++: return const &
|
||||||
|
--modified by NIZNHY-PKV Thu Dec 7 11:13:20 2006t
|
||||||
|
fields
|
||||||
|
myShape : Shape from TopoDS is protected;
|
||||||
|
--
|
||||||
|
myHistShapes : ListOfShape from TopTools is protected;
|
||||||
|
myMapShape : MapOfShape from TopTools is protected;
|
||||||
|
myHasDeleted : Boolean from Standard is protected;
|
||||||
|
myHasGenerated : Boolean from Standard is protected;
|
||||||
|
myHasModified : Boolean from Standard is protected;
|
||||||
|
--modified by NIZNHY-PKV Thu Dec 7 11:13:10 2006f
|
||||||
|
myImagesResult : IndexedDataMapOfShapeListOfShape from TopTools is protected;
|
||||||
|
--modified by NIZNHY-PKV Thu Dec 7 11:13:13 2006t
|
||||||
|
end BuilderShape;
|
||||||
|
|
131
src/GEOMAlgo/GEOMAlgo_BuilderShape.cxx
Executable file
131
src/GEOMAlgo/GEOMAlgo_BuilderShape.cxx
Executable file
@ -0,0 +1,131 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
//
|
||||||
|
// File: GEOMAlgo_BuilderShape.cxx
|
||||||
|
// Created:
|
||||||
|
// Author: Peter KURNEV
|
||||||
|
|
||||||
|
|
||||||
|
#include <GEOMAlgo_BuilderShape.ixx>
|
||||||
|
//=======================================================================
|
||||||
|
//function :
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
GEOMAlgo_BuilderShape::GEOMAlgo_BuilderShape()
|
||||||
|
:
|
||||||
|
GEOMAlgo_Algo()
|
||||||
|
{
|
||||||
|
myHasDeleted=Standard_False;
|
||||||
|
myHasGenerated=Standard_False;
|
||||||
|
myHasModified=Standard_False;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : ~
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
GEOMAlgo_BuilderShape::~GEOMAlgo_BuilderShape()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Shape
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
const TopoDS_Shape& GEOMAlgo_BuilderShape::Shape() const
|
||||||
|
{
|
||||||
|
return myShape;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
//=======================================================================
|
||||||
|
//function : Generated
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
const TopTools_ListOfShape& GEOMAlgo_BuilderShape::Generated(const TopoDS_Shape& )
|
||||||
|
{
|
||||||
|
myHistShapes.Clear();
|
||||||
|
return myHistShapes;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Modified
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
const TopTools_ListOfShape& GEOMAlgo_BuilderShape::Modified(const TopoDS_Shape& )
|
||||||
|
{
|
||||||
|
myHistShapes.Clear();
|
||||||
|
return myHistShapes;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsDeleted
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean GEOMAlgo_BuilderShape::IsDeleted(const TopoDS_Shape& theS)
|
||||||
|
{
|
||||||
|
Standard_Boolean bRet;
|
||||||
|
//
|
||||||
|
bRet=!myMapShape.Contains(theS);
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : HasDeleted
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean GEOMAlgo_BuilderShape::HasDeleted()const
|
||||||
|
{
|
||||||
|
return myHasDeleted;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : HasGenerated
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean GEOMAlgo_BuilderShape::HasGenerated()const
|
||||||
|
{
|
||||||
|
return myHasGenerated;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : HasModified
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean GEOMAlgo_BuilderShape::HasModified()const
|
||||||
|
{
|
||||||
|
return myHasModified;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : PrepareHistory
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_BuilderShape::PrepareHistory()
|
||||||
|
{
|
||||||
|
myHistShapes.Clear();
|
||||||
|
myMapShape.Clear();
|
||||||
|
myHasDeleted=Standard_False;
|
||||||
|
myHasGenerated=Standard_False;
|
||||||
|
myHasModified=Standard_False;
|
||||||
|
//modified by NIZNHY-PKV Thu Dec 7 11:14:15 2006
|
||||||
|
myImagesResult.Clear();
|
||||||
|
//modified by NIZNHY-PKV Thu Dec 7 11:14:17 2006t
|
||||||
|
}
|
||||||
|
//modified by NIZNHY-PKV Thu Dec 7 11:57:00 2006f
|
||||||
|
//=======================================================================
|
||||||
|
//function : ImagesResult
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
const TopTools_IndexedDataMapOfShapeListOfShape& GEOMAlgo_BuilderShape::ImagesResult()const
|
||||||
|
{
|
||||||
|
return myImagesResult;
|
||||||
|
}
|
||||||
|
//modified by NIZNHY-PKV Thu Dec 7 11:57:04 2006t
|
152
src/GEOMAlgo/GEOMAlgo_BuilderShape.hxx
Normal file
152
src/GEOMAlgo/GEOMAlgo_BuilderShape.hxx
Normal file
@ -0,0 +1,152 @@
|
|||||||
|
// File generated by CPPExt (Value)
|
||||||
|
//
|
||||||
|
// Copyright (C) 1991 - 2000 by
|
||||||
|
// Matra Datavision SA. All rights reserved.
|
||||||
|
//
|
||||||
|
// Copyright (C) 2001 - 2004 by
|
||||||
|
// Open CASCADE SA. All rights reserved.
|
||||||
|
//
|
||||||
|
// This file is part of the Open CASCADE Technology software.
|
||||||
|
//
|
||||||
|
// This software may be distributed and/or modified under the terms and
|
||||||
|
// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
|
||||||
|
// and appearing in the file LICENSE included in the packaging of this file.
|
||||||
|
//
|
||||||
|
// This software is distributed on an "AS IS" basis, without warranty of any
|
||||||
|
// kind, and Open CASCADE SA hereby disclaims all such warranties,
|
||||||
|
// including without limitation, any warranties of merchantability, fitness
|
||||||
|
// for a particular purpose or non-infringement. Please see the License for
|
||||||
|
// the specific terms and conditions governing rights and limitations under the
|
||||||
|
// License.
|
||||||
|
|
||||||
|
#ifndef _GEOMAlgo_BuilderShape_HeaderFile
|
||||||
|
#define _GEOMAlgo_BuilderShape_HeaderFile
|
||||||
|
|
||||||
|
#ifndef _TopoDS_Shape_HeaderFile
|
||||||
|
#include <TopoDS_Shape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopTools_ListOfShape_HeaderFile
|
||||||
|
#include <TopTools_ListOfShape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopTools_MapOfShape_HeaderFile
|
||||||
|
#include <TopTools_MapOfShape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Boolean_HeaderFile
|
||||||
|
#include <Standard_Boolean.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopTools_IndexedDataMapOfShapeListOfShape_HeaderFile
|
||||||
|
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_Algo_HeaderFile
|
||||||
|
#include <GEOMAlgo_Algo.hxx>
|
||||||
|
#endif
|
||||||
|
class TopoDS_Shape;
|
||||||
|
class TopTools_ListOfShape;
|
||||||
|
class TopTools_IndexedDataMapOfShapeListOfShape;
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _Standard_HeaderFile
|
||||||
|
#include <Standard.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Macro_HeaderFile
|
||||||
|
#include <Standard_Macro.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//! Root class for algorithms that has shape as result <br>
|
||||||
|
class GEOMAlgo_BuilderShape : public GEOMAlgo_Algo {
|
||||||
|
|
||||||
|
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
|
||||||
|
//
|
||||||
|
|
||||||
|
//! Returns the result of algorithm <br>
|
||||||
|
Standard_EXPORT const TopoDS_Shape& Shape() const;
|
||||||
|
|
||||||
|
//! Returns the list of shapes generated from the <br>
|
||||||
|
//! shape theS. <br>
|
||||||
|
Standard_EXPORT virtual const TopTools_ListOfShape& Generated(const TopoDS_Shape& theS) ;
|
||||||
|
|
||||||
|
//! Returns the list of shapes modified from the <br>
|
||||||
|
//! shape theS. <br>
|
||||||
|
Standard_EXPORT virtual const TopTools_ListOfShape& Modified(const TopoDS_Shape& theS) ;
|
||||||
|
|
||||||
|
//! Returns true if the shape theS has been deleted. <br>
|
||||||
|
Standard_EXPORT virtual Standard_Boolean IsDeleted(const TopoDS_Shape& theS) ;
|
||||||
|
|
||||||
|
//! Returns true if the at least one shape(or subshape) <br>
|
||||||
|
//! of arguments has been deleted. <br>
|
||||||
|
Standard_EXPORT Standard_Boolean HasDeleted() const;
|
||||||
|
|
||||||
|
//! Returns true if the at least one shape(or subshape) <br>
|
||||||
|
//! of arguments has generated shapes. <br>
|
||||||
|
Standard_EXPORT Standard_Boolean HasGenerated() const;
|
||||||
|
|
||||||
|
//! Returns true if the at least one shape(or subshape) <br>
|
||||||
|
//! of arguments has modified shapes. <br>
|
||||||
|
Standard_EXPORT Standard_Boolean HasModified() const;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT const TopTools_IndexedDataMapOfShapeListOfShape& ImagesResult() const;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Methods PROTECTED
|
||||||
|
//
|
||||||
|
|
||||||
|
//! Empty constructor <br>
|
||||||
|
Standard_EXPORT GEOMAlgo_BuilderShape();
|
||||||
|
Standard_EXPORT virtual ~GEOMAlgo_BuilderShape();
|
||||||
|
|
||||||
|
//! Prepare information for history support <br>
|
||||||
|
Standard_EXPORT virtual void PrepareHistory() ;
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PROTECTED
|
||||||
|
//
|
||||||
|
TopoDS_Shape myShape;
|
||||||
|
TopTools_ListOfShape myHistShapes;
|
||||||
|
TopTools_MapOfShape myMapShape;
|
||||||
|
Standard_Boolean myHasDeleted;
|
||||||
|
Standard_Boolean myHasGenerated;
|
||||||
|
Standard_Boolean myHasModified;
|
||||||
|
TopTools_IndexedDataMapOfShapeListOfShape myImagesResult;
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Methods PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// other Inline functions and methods (like "C++: function call" methods)
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
24
src/GEOMAlgo/GEOMAlgo_BuilderShape.ixx
Normal file
24
src/GEOMAlgo/GEOMAlgo_BuilderShape.ixx
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#include <GEOMAlgo_BuilderShape.jxx>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
28
src/GEOMAlgo/GEOMAlgo_BuilderShape.jxx
Normal file
28
src/GEOMAlgo/GEOMAlgo_BuilderShape.jxx
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _TopoDS_Shape_HeaderFile
|
||||||
|
#include <TopoDS_Shape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopTools_ListOfShape_HeaderFile
|
||||||
|
#include <TopTools_ListOfShape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_BuilderShape_HeaderFile
|
||||||
|
#include <GEOMAlgo_BuilderShape.hxx>
|
||||||
|
#endif
|
67
src/GEOMAlgo/GEOMAlgo_BuilderSolid.cdl
Executable file
67
src/GEOMAlgo/GEOMAlgo_BuilderSolid.cdl
Executable file
@ -0,0 +1,67 @@
|
|||||||
|
-- Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
--
|
||||||
|
-- This library is free software; you can redistribute it and/or
|
||||||
|
-- modify it under the terms of the GNU Lesser General Public
|
||||||
|
-- License as published by the Free Software Foundation; either
|
||||||
|
-- version 2.1 of the License.
|
||||||
|
--
|
||||||
|
-- This library is distributed in the hope that it will be useful
|
||||||
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
-- Lesser General Public License for more details.
|
||||||
|
--
|
||||||
|
-- You should have received a copy of the GNU Lesser General Public
|
||||||
|
-- License along with this library; if not, write to the Free Software
|
||||||
|
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
--
|
||||||
|
-- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
--
|
||||||
|
-- File: GEOMAlgo_BuilderSolid.cdl
|
||||||
|
-- Created:
|
||||||
|
-- Author: Peter KURNEV
|
||||||
|
|
||||||
|
class BuilderSolid from GEOMAlgo
|
||||||
|
inherits BuilderArea from GEOMAlgo
|
||||||
|
|
||||||
|
---Purpose: The algorithm to build solids from set of faces
|
||||||
|
|
||||||
|
--uses
|
||||||
|
--raises
|
||||||
|
|
||||||
|
is
|
||||||
|
Create
|
||||||
|
---Purpose: Empty constructor
|
||||||
|
returns BuilderSolid from GEOMAlgo;
|
||||||
|
---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_BuilderSolid();"
|
||||||
|
|
||||||
|
|
||||||
|
Perform(me:out)
|
||||||
|
---Purpose: Performs the algorithm
|
||||||
|
is redefined;
|
||||||
|
|
||||||
|
PerformShapesToAvoid(me:out)
|
||||||
|
---Purpose: Collect the faces that
|
||||||
|
-- a) are internal
|
||||||
|
-- b) are the same and have different orientation
|
||||||
|
is redefined protected;
|
||||||
|
|
||||||
|
PerformLoops(me:out)
|
||||||
|
---Purpose: Build draft shells
|
||||||
|
-- a)myLoops - draft shells that consist of
|
||||||
|
-- boundary faces
|
||||||
|
-- b)myLoopsInternal - draft shells that contains
|
||||||
|
-- inner faces
|
||||||
|
is redefined protected;
|
||||||
|
|
||||||
|
PerformAreas(me:out)
|
||||||
|
---Purpose: Build draft solids that contains boundary faces
|
||||||
|
is redefined protected;
|
||||||
|
|
||||||
|
PerformInternalShapes(me:out)
|
||||||
|
---Purpose: Build finalized solids with internal shells
|
||||||
|
is redefined protected;
|
||||||
|
|
||||||
|
--fields
|
||||||
|
|
||||||
|
end BuilderSolid;
|
737
src/GEOMAlgo/GEOMAlgo_BuilderSolid.cxx
Executable file
737
src/GEOMAlgo/GEOMAlgo_BuilderSolid.cxx
Executable file
@ -0,0 +1,737 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
//
|
||||||
|
// File: GEOMAlgo_BuilderSolid.cxx
|
||||||
|
// Created:
|
||||||
|
// Author: Peter KURNEV
|
||||||
|
|
||||||
|
|
||||||
|
#include <GEOMAlgo_BuilderSolid.ixx>
|
||||||
|
|
||||||
|
#include <gp_Pnt2d.hxx>
|
||||||
|
#include <gp_Pln.hxx>
|
||||||
|
#include <gp_Vec.hxx>
|
||||||
|
#include <gp_Dir.hxx>
|
||||||
|
#include <gp_Pnt.hxx>
|
||||||
|
|
||||||
|
#include <Geom_Curve.hxx>
|
||||||
|
#include <Geom_Surface.hxx>
|
||||||
|
#include <Geom2d_Curve.hxx>
|
||||||
|
|
||||||
|
#include <TopAbs.hxx>
|
||||||
|
|
||||||
|
#include <TopoDS_Iterator.hxx>
|
||||||
|
#include <TopoDS_Face.hxx>
|
||||||
|
#include <TopoDS.hxx>
|
||||||
|
#include <TopoDS_Shape.hxx>
|
||||||
|
#include <TopoDS_Shell.hxx>
|
||||||
|
#include <TopoDS_Edge.hxx>
|
||||||
|
#include <TopoDS_Solid.hxx>
|
||||||
|
#include <TopoDS_Vertex.hxx>
|
||||||
|
#include <TopoDS_Compound.hxx>
|
||||||
|
|
||||||
|
#include <BRep_Builder.hxx>
|
||||||
|
#include <BRep_Tool.hxx>
|
||||||
|
#include <BRepTools.hxx>
|
||||||
|
#include <BRepClass3d_SolidClassifier.hxx>
|
||||||
|
|
||||||
|
#include <TopExp.hxx>
|
||||||
|
#include <TopExp_Explorer.hxx>
|
||||||
|
|
||||||
|
#include <TopTools_MapOfShape.hxx>
|
||||||
|
#include <TopTools_MapIteratorOfMapOfShape.hxx>
|
||||||
|
#include <TopTools_MapOfOrientedShape.hxx>
|
||||||
|
#include <TopTools_MapIteratorOfMapOfOrientedShape.hxx>
|
||||||
|
#include <TopTools_ListOfShape.hxx>
|
||||||
|
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||||
|
#include <TopTools_DataMapOfShapeShape.hxx>
|
||||||
|
#include <TopTools_IndexedMapOfShape.hxx>
|
||||||
|
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||||
|
#include <TopTools_DataMapOfShapeListOfShape.hxx>
|
||||||
|
#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
|
||||||
|
|
||||||
|
#include <IntTools_Context.hxx>
|
||||||
|
|
||||||
|
#include <BOPTools_Tools2D.hxx>
|
||||||
|
#include <BOPTools_Tools3D.hxx>
|
||||||
|
|
||||||
|
#include <NMTTools_ListOfCoupleOfShape.hxx>
|
||||||
|
#include <NMTTools_CoupleOfShape.hxx>
|
||||||
|
#include <NMTTools_ListIteratorOfListOfCoupleOfShape.hxx>
|
||||||
|
|
||||||
|
#include <GEOMAlgo_Tools3D.hxx>
|
||||||
|
#include <GEOMAlgo_BuilderTools.hxx>
|
||||||
|
|
||||||
|
//
|
||||||
|
static
|
||||||
|
Standard_Boolean IsGrowthShell(const TopoDS_Shape& ,
|
||||||
|
const TopTools_IndexedMapOfShape& );
|
||||||
|
static
|
||||||
|
Standard_Boolean IsHole(const TopoDS_Shape& ,
|
||||||
|
IntTools_PContext& );
|
||||||
|
static
|
||||||
|
Standard_Boolean IsInside(const TopoDS_Shape& ,
|
||||||
|
const TopoDS_Shape& ,
|
||||||
|
IntTools_PContext& );
|
||||||
|
static
|
||||||
|
void MakeInternalShells(const TopTools_MapOfShape& ,
|
||||||
|
TopTools_ListOfShape& );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function :
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
GEOMAlgo_BuilderSolid::GEOMAlgo_BuilderSolid()
|
||||||
|
:
|
||||||
|
GEOMAlgo_BuilderArea()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : ~
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
GEOMAlgo_BuilderSolid::~GEOMAlgo_BuilderSolid()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Perform
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_BuilderSolid::Perform()
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
TopoDS_Compound aC;
|
||||||
|
BRep_Builder aBB;
|
||||||
|
TopTools_ListIteratorOfListOfShape aIt;
|
||||||
|
|
||||||
|
aBB.MakeCompound(aC);
|
||||||
|
aIt.Initialize(myShapes);
|
||||||
|
for(; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aF=aIt.Value();
|
||||||
|
aBB.Add(aC, aF);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
//
|
||||||
|
if (myContext==NULL) {
|
||||||
|
myErrorStatus=11;// Null Context
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
PerformShapesToAvoid();
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
PerformLoops();
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
PerformAreas();
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
PerformInternalShapes();
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function :PerformShapesToAvoid
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_BuilderSolid::PerformShapesToAvoid()
|
||||||
|
{
|
||||||
|
Standard_Boolean bFound;
|
||||||
|
Standard_Integer i, iCnt, aNbE, aNbF;
|
||||||
|
TopAbs_Orientation aOrE;
|
||||||
|
TopTools_IndexedDataMapOfShapeListOfShape aMEF;
|
||||||
|
TopTools_ListIteratorOfListOfShape aIt;
|
||||||
|
//
|
||||||
|
myShapesToAvoid.Clear();
|
||||||
|
//
|
||||||
|
iCnt=0;
|
||||||
|
while (1) {
|
||||||
|
++iCnt;
|
||||||
|
bFound=Standard_False;
|
||||||
|
//
|
||||||
|
// 1. MEF
|
||||||
|
aMEF.Clear();
|
||||||
|
aIt.Initialize (myShapes);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aF=aIt.Value();
|
||||||
|
if (!myShapesToAvoid.Contains(aF)) {
|
||||||
|
TopExp::MapShapesAndAncestors(aF, TopAbs_EDGE, TopAbs_FACE, aMEF);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
int a=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
aNbE=aMEF.Extent();
|
||||||
|
//
|
||||||
|
// 2. myFacesToAvoid
|
||||||
|
for (i=1; i<=aNbE; ++i) {
|
||||||
|
const TopoDS_Edge& aE=TopoDS::Edge(aMEF.FindKey(i));
|
||||||
|
if (BRep_Tool::Degenerated(aE)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
TopTools_ListOfShape& aLF=aMEF.ChangeFromKey(aE);
|
||||||
|
//
|
||||||
|
aNbF=aLF.Extent();
|
||||||
|
if (!aNbF) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aOrE=aE.Orientation();
|
||||||
|
//
|
||||||
|
const TopoDS_Face& aF1=TopoDS::Face(aLF.First());
|
||||||
|
if (aNbF==1) {
|
||||||
|
if (aOrE==TopAbs_INTERNAL) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
bFound=Standard_True;
|
||||||
|
myShapesToAvoid.Add(aF1);
|
||||||
|
}
|
||||||
|
else if (aNbF==2) {
|
||||||
|
const TopoDS_Face& aF2=TopoDS::Face(aLF.Last());
|
||||||
|
if (aF2.IsSame(aF1)) {
|
||||||
|
if (BRep_Tool::IsClosed(aE, aF1)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if (aOrE==TopAbs_INTERNAL) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
bFound=Standard_True;
|
||||||
|
myShapesToAvoid.Add(aF1);
|
||||||
|
myShapesToAvoid.Add(aF2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}// for (i=1; i<=aNbE; ++i) {
|
||||||
|
//
|
||||||
|
if (!bFound) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
}//while (1)
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : PerformLoops
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_BuilderSolid::PerformLoops()
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
myLoops.Clear();
|
||||||
|
//
|
||||||
|
Standard_Integer aNbLF, aNbOff, aNbFP;
|
||||||
|
TopAbs_Orientation anOr;
|
||||||
|
TopoDS_Edge aEL;
|
||||||
|
BRep_Builder aBB;
|
||||||
|
NMTTools_CoupleOfShape aCSOff;
|
||||||
|
TopTools_MapOfOrientedShape AddedFacesMap;
|
||||||
|
TopTools_IndexedDataMapOfShapeListOfShape aEFMap, aMEFP;
|
||||||
|
TopTools_ListIteratorOfListOfShape aItF;
|
||||||
|
//
|
||||||
|
//=================================================
|
||||||
|
//
|
||||||
|
// 1. Shells Usual
|
||||||
|
//
|
||||||
|
aItF.Initialize (myShapes);
|
||||||
|
for (; aItF.More(); aItF.Next()) {
|
||||||
|
const TopoDS_Shape& aFF = aItF.Value();
|
||||||
|
TopExp::MapShapesAndAncestors(aFF, TopAbs_EDGE, TopAbs_FACE, aEFMap);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aItF.Initialize (myShapes);
|
||||||
|
for (; aItF.More(); aItF.Next()) {
|
||||||
|
const TopoDS_Shape& aFF = aItF.Value();
|
||||||
|
if (myShapesToAvoid.Contains(aFF)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!AddedFacesMap.Add(aFF)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// make a new shell
|
||||||
|
TopoDS_Shell aShell;
|
||||||
|
aBB.MakeShell(aShell);
|
||||||
|
aBB.Add(aShell, aFF);
|
||||||
|
//
|
||||||
|
aMEFP.Clear();
|
||||||
|
TopExp::MapShapesAndAncestors(aFF, TopAbs_EDGE, TopAbs_FACE, aMEFP);
|
||||||
|
//
|
||||||
|
// loop on faces added to Shell; add their neighbor faces to Shell and so on
|
||||||
|
TopoDS_Iterator aItAddedF (aShell);
|
||||||
|
for (; aItAddedF.More(); aItAddedF.Next()) {
|
||||||
|
const TopoDS_Face& aF = TopoDS::Face(aItAddedF.Value());
|
||||||
|
//
|
||||||
|
// loop on edges of aF; find a good neighbor face of aF by aE
|
||||||
|
TopExp_Explorer aEdgeExp(aF, TopAbs_EDGE);
|
||||||
|
for (; aEdgeExp.More(); aEdgeExp.Next()) {
|
||||||
|
const TopoDS_Edge& aE = TopoDS::Edge(aEdgeExp.Current());
|
||||||
|
//
|
||||||
|
//1
|
||||||
|
if (aMEFP.Contains(aE)) {
|
||||||
|
const TopTools_ListOfShape& aLFP=aMEFP.FindFromKey(aE);
|
||||||
|
aNbFP=aLFP.Extent();
|
||||||
|
if (aNbFP>1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//2
|
||||||
|
anOr=aE.Orientation();
|
||||||
|
if (anOr==TopAbs_INTERNAL) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//3
|
||||||
|
if (BRep_Tool::Degenerated(aE)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// candidate faces list
|
||||||
|
const TopTools_ListOfShape& aLF=aEFMap.FindFromKey(aE);
|
||||||
|
aNbLF=aLF.Extent();
|
||||||
|
if (!aNbLF) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// try to select one of neighbors
|
||||||
|
// check if a face already added to Shell shares E
|
||||||
|
Standard_Boolean bFound;
|
||||||
|
TopTools_ListIteratorOfListOfShape aItLF;
|
||||||
|
NMTTools_ListOfCoupleOfShape aLCSOff;
|
||||||
|
//
|
||||||
|
aItLF.Initialize(aLF);
|
||||||
|
for (; aItLF.More(); aItLF.Next()) {
|
||||||
|
const TopoDS_Face& aFL=TopoDS::Face(aItLF.Value());
|
||||||
|
if (myShapesToAvoid.Contains(aFL)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (aF.IsSame(aFL)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (AddedFacesMap.Contains(aFL)){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
bFound=GEOMAlgo_Tools3D::GetEdgeOff(aE, aFL, aEL);
|
||||||
|
if (!bFound) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aCSOff.SetShape1(aEL);
|
||||||
|
aCSOff.SetShape2(aFL);
|
||||||
|
aLCSOff.Append(aCSOff);
|
||||||
|
}//for (; aItLF.More(); aItLF.Next()) {
|
||||||
|
//
|
||||||
|
aNbOff=aLCSOff.Extent();
|
||||||
|
if (!aNbOff){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
TopoDS_Face aSelF;
|
||||||
|
if (aNbOff==1) {
|
||||||
|
aSelF=TopoDS::Face(aLCSOff.First().Shape2());
|
||||||
|
}
|
||||||
|
else if (aNbOff>1){
|
||||||
|
GEOMAlgo_Tools3D::GetFaceOff(aE, aF, aLCSOff, aSelF);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if (!aSelF.IsNull() && AddedFacesMap.Add(aSelF)) {
|
||||||
|
aBB.Add(aShell, aSelF);
|
||||||
|
TopExp::MapShapesAndAncestors(aSelF, TopAbs_EDGE, TopAbs_FACE, aMEFP);
|
||||||
|
}
|
||||||
|
} // for (; aEdgeExp.More(); aEdgeExp.Next()) {
|
||||||
|
} //for (; aItAddedF.More(); aItAddedF.Next()) {
|
||||||
|
myLoops.Append(aShell);
|
||||||
|
} // for (; aItF.More(); aItF.Next()) {
|
||||||
|
//=================================================
|
||||||
|
//
|
||||||
|
// 2.Internal Shells
|
||||||
|
//
|
||||||
|
myLoopsInternal.Clear();
|
||||||
|
//
|
||||||
|
Standard_Integer aNbFA;
|
||||||
|
TopTools_MapIteratorOfMapOfOrientedShape aItM;
|
||||||
|
//
|
||||||
|
aEFMap.Clear();
|
||||||
|
AddedFacesMap.Clear();
|
||||||
|
//
|
||||||
|
aNbFA=myShapesToAvoid.Extent();
|
||||||
|
//
|
||||||
|
aItM.Initialize(myShapesToAvoid);
|
||||||
|
for (; aItM.More(); aItM.Next()) {
|
||||||
|
const TopoDS_Shape& aFF=aItM.Key();
|
||||||
|
TopExp::MapShapesAndAncestors(aFF, TopAbs_EDGE, TopAbs_FACE, aEFMap);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aItM.Initialize(myShapesToAvoid);
|
||||||
|
for (; aItM.More(); aItM.Next()) {
|
||||||
|
const TopoDS_Shape& aFF=aItM.Key();
|
||||||
|
if (!AddedFacesMap.Add(aFF)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// make a new shell
|
||||||
|
TopoDS_Shell aShell;
|
||||||
|
aBB.MakeShell(aShell);
|
||||||
|
aBB.Add(aShell, aFF);
|
||||||
|
//
|
||||||
|
TopoDS_Iterator aItAddedF (aShell);
|
||||||
|
for (; aItAddedF.More(); aItAddedF.Next()) {
|
||||||
|
const TopoDS_Face& aF = TopoDS::Face(aItAddedF.Value());
|
||||||
|
//
|
||||||
|
TopExp_Explorer aEdgeExp(aF, TopAbs_EDGE);
|
||||||
|
for (; aEdgeExp.More(); aEdgeExp.Next()) {
|
||||||
|
const TopoDS_Edge& aE = TopoDS::Edge(aEdgeExp.Current());
|
||||||
|
const TopTools_ListOfShape& aLF=aEFMap.FindFromKey(aE);
|
||||||
|
aItF.Initialize(aLF);
|
||||||
|
for (; aItF.More(); aItF.Next()) {
|
||||||
|
const TopoDS_Face& aFL=TopoDS::Face(aItF.Value());
|
||||||
|
if (AddedFacesMap.Add(aFL)){
|
||||||
|
aBB.Add(aShell, aFL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
myLoopsInternal.Append(aShell);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : PerformAreas
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_BuilderSolid::PerformAreas()
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
Standard_Boolean bIsGrowthShell, bIsHole;
|
||||||
|
TopTools_ListOfShape aNewSolids, aHoleShells;
|
||||||
|
TopoDS_Shape anInfinitePointShape;
|
||||||
|
TopTools_DataMapOfShapeShape aInOutMap;
|
||||||
|
TopTools_DataMapOfShapeListOfShape aMSH;
|
||||||
|
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItMSH;
|
||||||
|
TopTools_ListIteratorOfListOfShape aShellIt, aSolidIt;
|
||||||
|
TopTools_IndexedMapOfShape aMHF;
|
||||||
|
BRep_Builder aBB;
|
||||||
|
//
|
||||||
|
myAreas.Clear();
|
||||||
|
//
|
||||||
|
// Draft solids [aNewSolids]
|
||||||
|
aShellIt.Initialize(myLoops);
|
||||||
|
for ( ; aShellIt.More(); aShellIt.Next()) {
|
||||||
|
const TopoDS_Shape& aShell = aShellIt.Value();
|
||||||
|
//
|
||||||
|
bIsGrowthShell=IsGrowthShell(aShell, aMHF);
|
||||||
|
if (bIsGrowthShell) {
|
||||||
|
// make a growth solid from a shell
|
||||||
|
TopoDS_Solid Solid;
|
||||||
|
aBB.MakeSolid(Solid);
|
||||||
|
aBB.Add (Solid, aShell);
|
||||||
|
//
|
||||||
|
aNewSolids.Append (Solid);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
// check if a shell is a hole
|
||||||
|
//XX
|
||||||
|
bIsHole=IsHole(aShell, myContext);
|
||||||
|
//bIsHole=GEOMAlgo_BuilderTools::IsHole(aShell);
|
||||||
|
//XX
|
||||||
|
if (bIsHole) {
|
||||||
|
aHoleShells.Append(aShell);
|
||||||
|
TopExp::MapShapes(aShell, TopAbs_FACE, aMHF);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// make a growth solid from a shell
|
||||||
|
TopoDS_Solid Solid;
|
||||||
|
aBB.MakeSolid(Solid);
|
||||||
|
aBB.Add (Solid, aShell);
|
||||||
|
//
|
||||||
|
aNewSolids.Append (Solid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// 2. Find outer growth shell that is most close to each hole shell
|
||||||
|
aShellIt.Initialize(aHoleShells);
|
||||||
|
for (; aShellIt.More(); aShellIt.Next()) {
|
||||||
|
const TopoDS_Shape& aHole = aShellIt.Value();
|
||||||
|
//
|
||||||
|
aSolidIt.Initialize(aNewSolids);
|
||||||
|
for ( ; aSolidIt.More(); aSolidIt.Next()) {
|
||||||
|
const TopoDS_Shape& aSolid = aSolidIt.Value();
|
||||||
|
//
|
||||||
|
if (!IsInside(aHole, aSolid, myContext)){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if ( aInOutMap.IsBound (aHole)){
|
||||||
|
const TopoDS_Shape& aSolid2 = aInOutMap(aHole);
|
||||||
|
if (IsInside(aSolid, aSolid2, myContext)) {
|
||||||
|
aInOutMap.UnBind(aHole);
|
||||||
|
aInOutMap.Bind (aHole, aSolid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
aInOutMap.Bind (aHole, aSolid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// Add aHole to a map Solid/ListOfHoles [aMSH]
|
||||||
|
if (aInOutMap.IsBound(aHole)){
|
||||||
|
const TopoDS_Shape& aSolid=aInOutMap(aHole);
|
||||||
|
if (aMSH.IsBound(aSolid)) {
|
||||||
|
TopTools_ListOfShape& aLH=aMSH.ChangeFind(aSolid);
|
||||||
|
aLH.Append(aHole);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
TopTools_ListOfShape aLH;
|
||||||
|
aLH.Append(aHole);
|
||||||
|
aMSH.Bind(aSolid, aLH);
|
||||||
|
}
|
||||||
|
//aBB.Add (aSolid, aHole);
|
||||||
|
}
|
||||||
|
}// for (; aShellIt.More(); aShellIt.Next()) {
|
||||||
|
//
|
||||||
|
// 3. Add aHoles to Solids
|
||||||
|
aItMSH.Initialize(aMSH);
|
||||||
|
for (; aItMSH.More(); aItMSH.Next()) {
|
||||||
|
TopoDS_Solid aSolid=TopoDS::Solid(aItMSH.Key());
|
||||||
|
//
|
||||||
|
const TopTools_ListOfShape& aLH=aItMSH.Value();
|
||||||
|
aShellIt.Initialize(aLH);
|
||||||
|
for (; aShellIt.More(); aShellIt.Next()) {
|
||||||
|
const TopoDS_Shape& aHole = aShellIt.Value();
|
||||||
|
aBB.Add (aSolid, aHole);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// update classifier
|
||||||
|
BRepClass3d_SolidClassifier& aSC=myContext->SolidClassifier(aSolid);
|
||||||
|
aSC.Load(aSolid);
|
||||||
|
//
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// These aNewSolids are draft solids that
|
||||||
|
// do not contain any internal shapes
|
||||||
|
//
|
||||||
|
myAreas.Append(aNewSolids);
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : PerformInternalShapes
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_BuilderSolid::PerformInternalShapes()
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
Standard_Integer aNbFI=myLoopsInternal.Extent();
|
||||||
|
if (!aNbFI) {// nothing to do
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
BRep_Builder aBB;
|
||||||
|
TopTools_ListIteratorOfListOfShape aShellIt, aSolidIt;
|
||||||
|
TopoDS_Iterator aIt;
|
||||||
|
TopTools_MapOfShape aMF, aMFP;
|
||||||
|
TopTools_MapIteratorOfMapOfShape aItMF;
|
||||||
|
TopTools_IndexedDataMapOfShapeListOfShape aMEF;
|
||||||
|
TopTools_ListOfShape aLSI;
|
||||||
|
//
|
||||||
|
// 1. All internal faces
|
||||||
|
aShellIt.Initialize(myLoopsInternal);
|
||||||
|
for (; aShellIt.More(); aShellIt.Next()) {
|
||||||
|
const TopoDS_Shape& aShell=aShellIt.Value();
|
||||||
|
aIt.Initialize(aShell);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aF=aIt.Value();
|
||||||
|
aMF.Add(aF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
aNbFI=aMF.Extent();
|
||||||
|
//
|
||||||
|
// 2 Process solids
|
||||||
|
aSolidIt.Initialize(myAreas);
|
||||||
|
for ( ; aSolidIt.More(); aSolidIt.Next()) {
|
||||||
|
TopoDS_Solid& aSolid=TopoDS::Solid(aSolidIt.Value());
|
||||||
|
//
|
||||||
|
aMEF.Clear();
|
||||||
|
TopExp::MapShapesAndAncestors(aSolid, TopAbs_EDGE, TopAbs_FACE, aMEF);
|
||||||
|
//
|
||||||
|
// 2.1 Separate faces to process aMFP
|
||||||
|
aMFP.Clear();
|
||||||
|
aItMF.Initialize(aMF);
|
||||||
|
for (; aItMF.More(); aItMF.Next()) {
|
||||||
|
const TopoDS_Face& aF=TopoDS::Face(aItMF.Key());
|
||||||
|
if (GEOMAlgo_Tools3D::IsInternalFace(aF, aSolid, aMEF, 1.e-14, *myContext)) {
|
||||||
|
aMFP.Add(aF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// 2.2 Make Internal Shells
|
||||||
|
aLSI.Clear();
|
||||||
|
MakeInternalShells(aMFP, aLSI);
|
||||||
|
//
|
||||||
|
// 2.3 Add them to aSolid
|
||||||
|
aShellIt.Initialize(aLSI);
|
||||||
|
for (; aShellIt.More(); aShellIt.Next()) {
|
||||||
|
const TopoDS_Shape& aSI=aShellIt.Value();
|
||||||
|
aBB.Add (aSolid, aSI);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// 2.4 Remove faces aMFP from aMF
|
||||||
|
aItMF.Initialize(aMFP);
|
||||||
|
for (; aItMF.More(); aItMF.Next()) {
|
||||||
|
const TopoDS_Shape& aF=aItMF.Key();
|
||||||
|
aMF.Remove(aF);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aNbFI=aMF.Extent();
|
||||||
|
if (!aNbFI) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} //for ( ; aSolidIt.More(); aSolidIt.Next()) {
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : MakeInternalShells
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void MakeInternalShells(const TopTools_MapOfShape& theMF,
|
||||||
|
TopTools_ListOfShape& theShells)
|
||||||
|
{
|
||||||
|
TopTools_MapIteratorOfMapOfShape aItM;
|
||||||
|
TopTools_MapOfShape aAddedFacesMap;
|
||||||
|
TopTools_ListIteratorOfListOfShape aItF;
|
||||||
|
TopTools_IndexedDataMapOfShapeListOfShape aMEF;
|
||||||
|
BRep_Builder aBB;
|
||||||
|
//
|
||||||
|
aItM.Initialize(theMF);
|
||||||
|
for (; aItM.More(); aItM.Next()) {
|
||||||
|
const TopoDS_Shape& aF=aItM.Key();
|
||||||
|
TopExp::MapShapesAndAncestors(aF, TopAbs_EDGE, TopAbs_FACE, aMEF);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aItM.Initialize(theMF);
|
||||||
|
for (; aItM.More(); aItM.Next()) {
|
||||||
|
TopoDS_Shape aFF=aItM.Key();
|
||||||
|
if (!aAddedFacesMap.Add(aFF)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// make a new shell
|
||||||
|
TopoDS_Shell aShell;
|
||||||
|
aBB.MakeShell(aShell);
|
||||||
|
aFF.Orientation(TopAbs_INTERNAL);
|
||||||
|
aBB.Add(aShell, aFF);
|
||||||
|
//
|
||||||
|
TopoDS_Iterator aItAddedF (aShell);
|
||||||
|
for (; aItAddedF.More(); aItAddedF.Next()) {
|
||||||
|
const TopoDS_Shape& aF =aItAddedF.Value();
|
||||||
|
//
|
||||||
|
TopExp_Explorer aEdgeExp(aF, TopAbs_EDGE);
|
||||||
|
for (; aEdgeExp.More(); aEdgeExp.Next()) {
|
||||||
|
const TopoDS_Shape& aE =aEdgeExp.Current();
|
||||||
|
const TopTools_ListOfShape& aLF=aMEF.FindFromKey(aE);
|
||||||
|
aItF.Initialize(aLF);
|
||||||
|
for (; aItF.More(); aItF.Next()) {
|
||||||
|
TopoDS_Shape aFL=aItF.Value();
|
||||||
|
if (aAddedFacesMap.Add(aFL)){
|
||||||
|
aFL.Orientation(TopAbs_INTERNAL);
|
||||||
|
aBB.Add(aShell, aFL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
theShells.Append(aShell);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsHole
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean IsHole(const TopoDS_Shape& theS2,
|
||||||
|
IntTools_PContext& theContext)
|
||||||
|
{
|
||||||
|
TopoDS_Solid *pS2=(TopoDS_Solid *)&theS2;
|
||||||
|
BRepClass3d_SolidClassifier& aClsf=theContext->SolidClassifier(*pS2);
|
||||||
|
//
|
||||||
|
aClsf.PerformInfinitePoint(::RealSmall());
|
||||||
|
//
|
||||||
|
return (aClsf.State()==TopAbs_IN);
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsInside
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean IsInside(const TopoDS_Shape& theS1,
|
||||||
|
const TopoDS_Shape& theS2,
|
||||||
|
IntTools_PContext& theContext)
|
||||||
|
{
|
||||||
|
TopExp_Explorer aExp;
|
||||||
|
TopAbs_State aState;
|
||||||
|
//
|
||||||
|
TopoDS_Solid *pS2=(TopoDS_Solid *)&theS2;
|
||||||
|
//
|
||||||
|
aExp.Init(theS1, TopAbs_FACE);
|
||||||
|
if (!aExp.More()){
|
||||||
|
BRepClass3d_SolidClassifier& aClsf=theContext->SolidClassifier(*pS2);
|
||||||
|
aClsf.PerformInfinitePoint(::RealSmall());
|
||||||
|
aState=aClsf.State();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
TopTools_IndexedMapOfShape aBounds;
|
||||||
|
const TopoDS_Face& aF = TopoDS::Face(aExp.Current());
|
||||||
|
aState=GEOMAlgo_Tools3D::ComputeState(aF, *pS2, 1.e-14, aBounds, *theContext);
|
||||||
|
}
|
||||||
|
return (aState==TopAbs_IN);
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsGrowthShell
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean IsGrowthShell(const TopoDS_Shape& theShell,
|
||||||
|
const TopTools_IndexedMapOfShape& theMHF)
|
||||||
|
{
|
||||||
|
Standard_Boolean bRet;
|
||||||
|
TopoDS_Iterator aIt;
|
||||||
|
//
|
||||||
|
bRet=Standard_False;
|
||||||
|
if (theMHF.Extent()) {
|
||||||
|
aIt.Initialize(theShell);
|
||||||
|
for(; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aF=aIt.Value();
|
||||||
|
if (theMHF.Contains(aF)) {
|
||||||
|
return !bRet;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
|
||||||
|
//BRepTools::Write(aFF, "ff");
|
||||||
|
//
|
||||||
|
// ErrorStatus :
|
||||||
|
// 11 - Null Context
|
114
src/GEOMAlgo/GEOMAlgo_BuilderSolid.hxx
Normal file
114
src/GEOMAlgo/GEOMAlgo_BuilderSolid.hxx
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _GEOMAlgo_BuilderSolid_HeaderFile
|
||||||
|
#define _GEOMAlgo_BuilderSolid_HeaderFile
|
||||||
|
|
||||||
|
#ifndef _GEOMAlgo_BuilderArea_HeaderFile
|
||||||
|
#include <GEOMAlgo_BuilderArea.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _Standard_HeaderFile
|
||||||
|
#include <Standard.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Macro_HeaderFile
|
||||||
|
#include <Standard_Macro.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//! The algorithm to build solids from set of faces <br>
|
||||||
|
class GEOMAlgo_BuilderSolid : public GEOMAlgo_BuilderArea {
|
||||||
|
|
||||||
|
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
|
||||||
|
//
|
||||||
|
|
||||||
|
//! Empty constructor <br>
|
||||||
|
Standard_EXPORT GEOMAlgo_BuilderSolid();
|
||||||
|
Standard_EXPORT virtual ~GEOMAlgo_BuilderSolid();
|
||||||
|
|
||||||
|
//! Performs the algorithm <br>
|
||||||
|
Standard_EXPORT virtual void Perform() ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Methods PROTECTED
|
||||||
|
//
|
||||||
|
|
||||||
|
//! Collect the faces that <br>
|
||||||
|
//! a) are internal <br>
|
||||||
|
//! b) are the same and have different orientation <br>
|
||||||
|
Standard_EXPORT virtual void PerformShapesToAvoid() ;
|
||||||
|
|
||||||
|
//! Build draft shells <br>
|
||||||
|
//! a)myLoops - draft shells that consist of <br>
|
||||||
|
//! boundary faces <br>
|
||||||
|
//! b)myLoopsInternal - draft shells that contains <br>
|
||||||
|
//! inner faces <br>
|
||||||
|
Standard_EXPORT virtual void PerformLoops() ;
|
||||||
|
|
||||||
|
//! Build draft solids that contains boundary faces <br>
|
||||||
|
Standard_EXPORT virtual void PerformAreas() ;
|
||||||
|
|
||||||
|
//! Build finalized solids with internal shells <br>
|
||||||
|
Standard_EXPORT virtual void PerformInternalShapes() ;
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PROTECTED
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Methods PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// other Inline functions and methods (like "C++: function call" methods)
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
24
src/GEOMAlgo/GEOMAlgo_BuilderSolid.ixx
Normal file
24
src/GEOMAlgo/GEOMAlgo_BuilderSolid.ixx
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#include <GEOMAlgo_BuilderSolid.jxx>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
22
src/GEOMAlgo/GEOMAlgo_BuilderSolid.jxx
Normal file
22
src/GEOMAlgo/GEOMAlgo_BuilderSolid.jxx
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _GEOMAlgo_BuilderSolid_HeaderFile
|
||||||
|
#include <GEOMAlgo_BuilderSolid.hxx>
|
||||||
|
#endif
|
47
src/GEOMAlgo/GEOMAlgo_BuilderTools.cdl
Executable file
47
src/GEOMAlgo/GEOMAlgo_BuilderTools.cdl
Executable file
@ -0,0 +1,47 @@
|
|||||||
|
-- Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
--
|
||||||
|
-- This library is free software; you can redistribute it and/or
|
||||||
|
-- modify it under the terms of the GNU Lesser General Public
|
||||||
|
-- License as published by the Free Software Foundation; either
|
||||||
|
-- version 2.1 of the License.
|
||||||
|
--
|
||||||
|
-- This library is distributed in the hope that it will be useful
|
||||||
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
-- Lesser General Public License for more details.
|
||||||
|
--
|
||||||
|
-- You should have received a copy of the GNU Lesser General Public
|
||||||
|
-- License along with this library; if not, write to the Free Software
|
||||||
|
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
--
|
||||||
|
-- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
--
|
||||||
|
-- File: GEOMAlgo_BuilderTools.cdl
|
||||||
|
-- Created:
|
||||||
|
-- Author: Peter KURNEV
|
||||||
|
-- <pkv@irinox>
|
||||||
|
|
||||||
|
|
||||||
|
class BuilderTools from GEOMAlgo
|
||||||
|
|
||||||
|
---Purpose:
|
||||||
|
|
||||||
|
uses
|
||||||
|
Shape from TopoDS
|
||||||
|
|
||||||
|
--raises
|
||||||
|
|
||||||
|
is
|
||||||
|
IsHole(myclass;
|
||||||
|
aW: Shape from TopoDS;
|
||||||
|
aF: Shape from TopoDS)
|
||||||
|
returns Boolean from Standard;
|
||||||
|
|
||||||
|
IsHole(myclass;
|
||||||
|
aShell: Shape from TopoDS)
|
||||||
|
returns Boolean from Standard;
|
||||||
|
|
||||||
|
--fields
|
||||||
|
|
||||||
|
end BuilderTools;
|
278
src/GEOMAlgo/GEOMAlgo_BuilderTools.cxx
Executable file
278
src/GEOMAlgo/GEOMAlgo_BuilderTools.cxx
Executable file
@ -0,0 +1,278 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
//
|
||||||
|
// File: GEOMAlgo_BuilderTools.cxx
|
||||||
|
// Created:
|
||||||
|
// Author: Peter KURNEV
|
||||||
|
// <pkv@irinox>
|
||||||
|
|
||||||
|
|
||||||
|
#include <GEOMAlgo_BuilderTools.ixx>
|
||||||
|
|
||||||
|
#include <TColStd_Array1OfReal.hxx>
|
||||||
|
|
||||||
|
#include <gp_Pnt2d.hxx>
|
||||||
|
#include <gp_Vec.hxx>
|
||||||
|
#include <gp_Dir.hxx>
|
||||||
|
#include <gp_Pnt.hxx>
|
||||||
|
|
||||||
|
#include <TColgp_Array1OfPnt.hxx>
|
||||||
|
|
||||||
|
#include <Poly_Triangulation.hxx>
|
||||||
|
#include <Poly_Array1OfTriangle.hxx>
|
||||||
|
#include <Poly_Triangle.hxx>
|
||||||
|
|
||||||
|
#include <Geom2d_Curve.hxx>
|
||||||
|
#include <Geom2dInt_Geom2dCurveTool.hxx>
|
||||||
|
|
||||||
|
#include <TopLoc_Location.hxx>
|
||||||
|
#include <TopAbs_Orientation.hxx>
|
||||||
|
|
||||||
|
#include <TopoDS_Face.hxx>
|
||||||
|
#include <TopoDS_Iterator.hxx>
|
||||||
|
#include <TopoDS_Wire.hxx>
|
||||||
|
#include <TopoDS.hxx>
|
||||||
|
#include <TopoDS_Edge.hxx>
|
||||||
|
#include <TopExp_Explorer.hxx>
|
||||||
|
|
||||||
|
#include <BRep_Tool.hxx>
|
||||||
|
#include <BRepBndLib.hxx>
|
||||||
|
#include <BRepMesh_FastDiscret.hxx>
|
||||||
|
#include <Bnd_Box.hxx>
|
||||||
|
#include <BRepAdaptor_Curve2d.hxx>
|
||||||
|
|
||||||
|
static
|
||||||
|
Standard_Integer ComputeProps(const TopoDS_Face& aF,
|
||||||
|
Standard_Real& aA,
|
||||||
|
Standard_Real& aV);
|
||||||
|
static
|
||||||
|
void BuildTriangulation(const TopoDS_Face& aF);
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsHole
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean GEOMAlgo_BuilderTools::IsHole(const TopoDS_Shape& aW,
|
||||||
|
const TopoDS_Shape& aFace)
|
||||||
|
{
|
||||||
|
Standard_Boolean bIsHole;
|
||||||
|
Standard_Integer i, aNbS;
|
||||||
|
Standard_Real aT1, aT2, aS;
|
||||||
|
Standard_Real aU1, aU2, aU, dU;
|
||||||
|
Standard_Real aX1, aY1, aX0, aY0;
|
||||||
|
TopAbs_Orientation aOr;
|
||||||
|
|
||||||
|
gp_Pnt2d aP2D0, aP2D1;
|
||||||
|
Handle(Geom2d_Curve) aC2D;
|
||||||
|
TopoDS_Face aF, aFF;
|
||||||
|
TopoDS_Iterator aItW;
|
||||||
|
//
|
||||||
|
bIsHole=Standard_False;
|
||||||
|
//
|
||||||
|
aF=TopoDS::Face(aFace);
|
||||||
|
aFF=aF;
|
||||||
|
aFF.Orientation(TopAbs_FORWARD);
|
||||||
|
//
|
||||||
|
aS=0.;
|
||||||
|
aItW.Initialize(aW);
|
||||||
|
for (; aItW.More(); aItW.Next()) {
|
||||||
|
const TopoDS_Edge& aE=TopoDS::Edge(aItW.Value());
|
||||||
|
aOr=aE.Orientation();
|
||||||
|
if (!(aOr==TopAbs_FORWARD ||
|
||||||
|
aOr==TopAbs_REVERSED)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aC2D=BRep_Tool::CurveOnSurface(aE, aFF, aT1, aT2);
|
||||||
|
if (aC2D.IsNull()) {
|
||||||
|
break; //xx
|
||||||
|
}
|
||||||
|
//
|
||||||
|
BRepAdaptor_Curve2d aBAC2D(aE, aFF);
|
||||||
|
aNbS=Geom2dInt_Geom2dCurveTool::NbSamples(aBAC2D);
|
||||||
|
if (aNbS>2) {
|
||||||
|
aNbS*=4;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
dU=(aT2-aT1)/(Standard_Real)(aNbS-1);
|
||||||
|
aU =aT1;
|
||||||
|
aU1=aT1;
|
||||||
|
aU2=aT2;
|
||||||
|
if (aOr==TopAbs_REVERSED) {
|
||||||
|
aU =aT2;
|
||||||
|
aU1=aT2;
|
||||||
|
aU2=aT1;
|
||||||
|
dU=-dU;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aC2D->D0(aU, aP2D0);
|
||||||
|
for(i=2; i<=aNbS; i++) {
|
||||||
|
aU=aU1+(i-1)*dU;
|
||||||
|
aC2D->D0(aU, aP2D1);
|
||||||
|
aP2D0.Coord(aX0, aY0);
|
||||||
|
aP2D1.Coord(aX1, aY1);
|
||||||
|
//
|
||||||
|
aS=aS+(aY0+aY1)*(aX1-aX0);
|
||||||
|
//
|
||||||
|
aP2D0=aP2D1;
|
||||||
|
}
|
||||||
|
}//for (; aItW.More(); aItW.Next()) {
|
||||||
|
bIsHole=(aS>0.);
|
||||||
|
return bIsHole;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsHole
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean GEOMAlgo_BuilderTools::IsHole(const TopoDS_Shape& aShell)
|
||||||
|
{
|
||||||
|
Standard_Boolean bIsHole;
|
||||||
|
Standard_Integer iRet;
|
||||||
|
Standard_Real aAi, aA, aV, aVi;
|
||||||
|
TopExp_Explorer aExp;
|
||||||
|
//
|
||||||
|
aA=0.;
|
||||||
|
aV=0.;
|
||||||
|
aExp.Init(aShell, TopAbs_FACE);
|
||||||
|
for (; aExp.More(); aExp.Next()) {
|
||||||
|
const TopoDS_Face& aF=TopoDS::Face(aExp.Current());
|
||||||
|
iRet=ComputeProps(aF, aAi, aVi);
|
||||||
|
if (!iRet) {
|
||||||
|
aA+=aAi;
|
||||||
|
aV+=aVi;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
bIsHole=aV<0.;
|
||||||
|
return bIsHole;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : ComputeProps
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Integer ComputeProps(const TopoDS_Face& aF,
|
||||||
|
Standard_Real& aA,
|
||||||
|
Standard_Real& aV)
|
||||||
|
{
|
||||||
|
Standard_Integer j, i, i1, i2, aNbNodes, aNbTrigs, n[3];
|
||||||
|
Standard_Real aAi, aVi;
|
||||||
|
gp_Pnt aP[3], aGC, aGC1;
|
||||||
|
TopLoc_Location aLoc;
|
||||||
|
TopAbs_Orientation aOr;
|
||||||
|
Handle(Poly_Triangulation) aTri;
|
||||||
|
//
|
||||||
|
aA=0.;
|
||||||
|
aV=0.;
|
||||||
|
//
|
||||||
|
aTri=BRep_Tool::Triangulation(aF, aLoc);
|
||||||
|
if(aTri.IsNull()) {
|
||||||
|
BuildTriangulation(aF);
|
||||||
|
aTri=BRep_Tool::Triangulation(aF, aLoc);
|
||||||
|
if(aTri.IsNull()) {
|
||||||
|
return 1;// a face is without triangulation
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aNbNodes=aTri->NbNodes();
|
||||||
|
aNbTrigs=aTri->NbTriangles();
|
||||||
|
if (!aNbTrigs){
|
||||||
|
return 2;//no triangles
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aOr=aF.Orientation();
|
||||||
|
//
|
||||||
|
const TColgp_Array1OfPnt& aNodes=aTri->Nodes();
|
||||||
|
const Poly_Array1OfTriangle& aTriangles=aTri->Triangles();
|
||||||
|
//
|
||||||
|
i1=aTriangles.Lower();
|
||||||
|
i2=aTriangles.Upper();
|
||||||
|
//
|
||||||
|
for (i=i1; i<=i2; ++i){
|
||||||
|
const Poly_Triangle& aTriangle=aTriangles.Value(i);
|
||||||
|
aTriangle.Get(n[0], n[1], n[2]);
|
||||||
|
aGC.SetCoord(0.,0.,0.);
|
||||||
|
for (j=0; j<3; ++j) {
|
||||||
|
aP[j]=aNodes.Value(n[j]);
|
||||||
|
aGC.ChangeCoord()+=aP[j].XYZ();
|
||||||
|
}
|
||||||
|
aGC.ChangeCoord()*=0.333333333333;
|
||||||
|
//
|
||||||
|
// Normal
|
||||||
|
gp_Vec aV01(aP[0], aP[1]);
|
||||||
|
gp_Vec aV12(aP[1], aP[2]);
|
||||||
|
gp_Vec aVN=aV01^aV12;
|
||||||
|
aAi=aVN.Magnitude();
|
||||||
|
aA=aA+aAi;
|
||||||
|
//
|
||||||
|
if (aAi>0.0000001) {
|
||||||
|
Standard_Real aSx, aZx;
|
||||||
|
gp_Dir aDN(aVN);
|
||||||
|
if (aOr==TopAbs_REVERSED) {
|
||||||
|
aDN.Reverse();
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aSx=aAi*aDN.Z();
|
||||||
|
aZx=aGC.Z();
|
||||||
|
aVi=aZx*aSx;
|
||||||
|
aV=aV+aVi;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : BuildTriangulation
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void BuildTriangulation(const TopoDS_Face& aF)
|
||||||
|
{
|
||||||
|
Standard_Boolean bWithShare;
|
||||||
|
Standard_Real aDiscret, aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
|
||||||
|
Standard_Real dX, dY, dZ, dMax, aCoeff, aAngle;
|
||||||
|
Bnd_Box aBox;
|
||||||
|
//
|
||||||
|
bWithShare=Standard_False;
|
||||||
|
aAngle=0.5;
|
||||||
|
//
|
||||||
|
BRepBndLib::Add(aF, aBox);
|
||||||
|
//
|
||||||
|
// aDiscret
|
||||||
|
aBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
|
||||||
|
dX=aXmax-aXmin;
|
||||||
|
dY=aYmax-aYmin;
|
||||||
|
dZ=aZmax-aZmin;
|
||||||
|
dMax=dX;
|
||||||
|
if (dY>dMax) {
|
||||||
|
dMax=dY;
|
||||||
|
}
|
||||||
|
if (dZ>dMax) {
|
||||||
|
dMax=dZ;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aCoeff=0.1;
|
||||||
|
aDiscret=aCoeff*dMax;
|
||||||
|
//
|
||||||
|
BRepMesh_FastDiscret aMesher(aDiscret,
|
||||||
|
aAngle,
|
||||||
|
aBox,
|
||||||
|
bWithShare,
|
||||||
|
Standard_True,
|
||||||
|
Standard_False,
|
||||||
|
Standard_True);
|
||||||
|
aMesher.Add(aF);
|
||||||
|
}
|
96
src/GEOMAlgo/GEOMAlgo_BuilderTools.hxx
Normal file
96
src/GEOMAlgo/GEOMAlgo_BuilderTools.hxx
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _GEOMAlgo_BuilderTools_HeaderFile
|
||||||
|
#define _GEOMAlgo_BuilderTools_HeaderFile
|
||||||
|
|
||||||
|
#ifndef _Standard_Boolean_HeaderFile
|
||||||
|
#include <Standard_Boolean.hxx>
|
||||||
|
#endif
|
||||||
|
class TopoDS_Shape;
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _Standard_HeaderFile
|
||||||
|
#include <Standard.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Macro_HeaderFile
|
||||||
|
#include <Standard_Macro.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
class GEOMAlgo_BuilderTools {
|
||||||
|
|
||||||
|
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 static Standard_Boolean IsHole(const TopoDS_Shape& aW,const TopoDS_Shape& aF) ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT static Standard_Boolean IsHole(const TopoDS_Shape& aShell) ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Methods PROTECTED
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PROTECTED
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Methods PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// other Inline functions and methods (like "C++: function call" methods)
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
24
src/GEOMAlgo/GEOMAlgo_BuilderTools.ixx
Normal file
24
src/GEOMAlgo/GEOMAlgo_BuilderTools.ixx
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#include <GEOMAlgo_BuilderTools.jxx>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
25
src/GEOMAlgo/GEOMAlgo_BuilderTools.jxx
Normal file
25
src/GEOMAlgo/GEOMAlgo_BuilderTools.jxx
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _TopoDS_Shape_HeaderFile
|
||||||
|
#include <TopoDS_Shape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_BuilderTools_HeaderFile
|
||||||
|
#include <GEOMAlgo_BuilderTools.hxx>
|
||||||
|
#endif
|
61
src/GEOMAlgo/GEOMAlgo_Builder_0.cxx
Normal file
61
src/GEOMAlgo/GEOMAlgo_Builder_0.cxx
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#include <GEOMAlgo_Builder.hxx>
|
||||||
|
|
||||||
|
#include <NMTDS_ShapesDataStructure.hxx>
|
||||||
|
#include <NMTTools_DSFiller.hxx>
|
||||||
|
#include <NMTTools_PaveFiller.hxx>
|
||||||
|
#include <IntTools_Context.hxx>
|
||||||
|
#include <TopoDS_Shape.hxx>
|
||||||
|
#include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
|
||||||
|
#include <TopTools_MapOfShape.hxx>
|
||||||
|
#include <TopTools_ListOfShape.hxx>
|
||||||
|
#include <BOPTools_ListOfPaveBlock.hxx>
|
||||||
|
#include <BOPTools_PaveBlock.hxx>
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : Shapes1
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
const TopTools_ListOfShape& GEOMAlgo_Builder::Shapes1(const Standard_Integer theType)const
|
||||||
|
{
|
||||||
|
return myShapes1[theType];
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Images
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
const BRepAlgo_Image& GEOMAlgo_Builder::Images()const
|
||||||
|
{
|
||||||
|
return myImages;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : InParts
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
const TopTools_ListOfShape& GEOMAlgo_Builder::InParts(const TopoDS_Shape& theS)const
|
||||||
|
{
|
||||||
|
static TopTools_ListOfShape sLS;
|
||||||
|
//
|
||||||
|
if (myInParts.Contains(theS)) {
|
||||||
|
return myInParts.FindFromKey(theS);
|
||||||
|
}
|
||||||
|
return sLS;
|
||||||
|
}
|
354
src/GEOMAlgo/GEOMAlgo_Builder_1.cxx
Executable file
354
src/GEOMAlgo/GEOMAlgo_Builder_1.cxx
Executable file
@ -0,0 +1,354 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
//
|
||||||
|
// File: GEOMAlgo_Builder_1.cxx
|
||||||
|
// Created:
|
||||||
|
// Author: Peter KURNEV
|
||||||
|
|
||||||
|
#include <GEOMAlgo_Builder.hxx>
|
||||||
|
//
|
||||||
|
#include <TColStd_ListOfInteger.hxx>
|
||||||
|
|
||||||
|
#include <TopoDS.hxx>
|
||||||
|
#include <TopoDS_Shape.hxx>
|
||||||
|
#include <TopoDS_Wire.hxx>
|
||||||
|
#include <TopoDS_Edge.hxx>
|
||||||
|
#include <TopoDS_Shell.hxx>
|
||||||
|
#include <TopoDS_Iterator.hxx>
|
||||||
|
//
|
||||||
|
#include <TopTools_MapOfShape.hxx>
|
||||||
|
#include <TopTools_ListOfShape.hxx>
|
||||||
|
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||||
|
#include <TopTools_MapIteratorOfMapOfShape.hxx>
|
||||||
|
//
|
||||||
|
#include <BRep_Tool.hxx>
|
||||||
|
#include <BRep_Builder.hxx>
|
||||||
|
//
|
||||||
|
#include <IntTools_Context.hxx>
|
||||||
|
#include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
|
||||||
|
#include <BOPTools_ListOfPaveBlock.hxx>
|
||||||
|
#include <BOPTools_PaveBlock.hxx>
|
||||||
|
//
|
||||||
|
#include <NMTDS_ShapesDataStructure.hxx>
|
||||||
|
//
|
||||||
|
#include <NMTTools_DSFiller.hxx>
|
||||||
|
#include <NMTTools_PaveFiller.hxx>
|
||||||
|
#include <NMTTools_CommonBlockPool.hxx>
|
||||||
|
#include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
|
||||||
|
#include <NMTTools_CommonBlock.hxx>
|
||||||
|
#include <NMTTools_CommonBlockPool.hxx>
|
||||||
|
#include <NMTTools_ListOfCommonBlock.hxx>
|
||||||
|
#include <NMTTools_CommonBlockAPI.hxx>
|
||||||
|
//
|
||||||
|
#include <GEOMAlgo_Tools3D.hxx>
|
||||||
|
#include <TColStd_ListIteratorOfListOfInteger.hxx>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static
|
||||||
|
void FillImagesCompounds(const TopTools_MapOfShape& ,
|
||||||
|
BRepAlgo_Image& );
|
||||||
|
|
||||||
|
static
|
||||||
|
void FillImagesCompound(const TopoDS_Shape& ,
|
||||||
|
BRepAlgo_Image& ,
|
||||||
|
TopTools_MapOfShape& );
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : FillImagesVertices
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_Builder::FillImagesVertices()
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
|
||||||
|
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
|
||||||
|
//
|
||||||
|
Standard_Integer i, aNb, iV;
|
||||||
|
//
|
||||||
|
aNb=aDS.NumberOfShapesOfTheObject();
|
||||||
|
for (i=1; i<=aNb; ++i) {
|
||||||
|
const TopoDS_Shape& aV=aDS.Shape(i);
|
||||||
|
if (aV.ShapeType()==TopAbs_VERTEX) {
|
||||||
|
iV=pPF->FindSDVertex(i);
|
||||||
|
if (iV) {
|
||||||
|
const TopoDS_Shape& aVSD=aDS.Shape(iV);
|
||||||
|
if (!myImages.HasImage(aV)) {
|
||||||
|
myImages.Bind(aV, aVSD);
|
||||||
|
//
|
||||||
|
mySameDomainShapes.Add(aV, aVSD);
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
// function: FillImagesEdges
|
||||||
|
// purpose:
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_Builder::FillImagesEdges()
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
|
||||||
|
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
|
||||||
|
const BOPTools_SplitShapesPool& aSSP=pPF->SplitShapesPool();
|
||||||
|
NMTTools_CommonBlockPool& aCBP=pPF->ChangeCommonBlockPool();
|
||||||
|
IntTools_Context& aCtx=pPF->ChangeContext();
|
||||||
|
//
|
||||||
|
Standard_Boolean bToReverse;
|
||||||
|
Standard_Integer i, aNb, aNbSp, nSp, nSpR, nSpx;
|
||||||
|
TColStd_ListIteratorOfListOfInteger aItLB;
|
||||||
|
TColStd_ListOfInteger aLB;
|
||||||
|
TopoDS_Edge aEE, aESpR;
|
||||||
|
TopTools_MapOfShape aMFence;
|
||||||
|
TopTools_ListOfShape aLSp;
|
||||||
|
TopTools_ListIteratorOfListOfShape aIt1;
|
||||||
|
BOPTools_ListIteratorOfListOfPaveBlock aIt;
|
||||||
|
//
|
||||||
|
aNb=aDS.NumberOfShapesOfTheObject();
|
||||||
|
for (i=1; i<=aNb; ++i) {
|
||||||
|
const TopoDS_Shape& aE=aDS.Shape(i);
|
||||||
|
if (aE.ShapeType()!=TopAbs_EDGE) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if (!aMFence.Add(aE)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
const BOPTools_ListOfPaveBlock& aLPB=aSSP(aDS.RefEdge(i));
|
||||||
|
aNbSp=aLPB.Extent();
|
||||||
|
if (!aNbSp) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aEE=TopoDS::Edge(aE);
|
||||||
|
aLSp.Clear();
|
||||||
|
//
|
||||||
|
if (aNbSp==1) {
|
||||||
|
const BOPTools_PaveBlock& aPB=aLPB.First();
|
||||||
|
nSp=aPB.Edge();
|
||||||
|
const TopoDS_Shape& aSp=aDS.Shape(nSp);
|
||||||
|
//
|
||||||
|
const BOPTools_PaveBlock& aPBR=pPF->RealPaveBlock(aPB, aLB);
|
||||||
|
nSpR=aPBR.Edge();
|
||||||
|
const TopoDS_Shape& aSpR=aDS.Shape(nSpR);
|
||||||
|
if (aSpR.IsSame(aSp) && aSpR.IsSame(aE)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aESpR=TopoDS::Edge(aSpR);
|
||||||
|
bToReverse=GEOMAlgo_Tools3D::IsSplitToReverse(aESpR, aEE, aCtx);
|
||||||
|
if (bToReverse) {
|
||||||
|
aESpR.Reverse();
|
||||||
|
}
|
||||||
|
aLSp.Append(aESpR);
|
||||||
|
//
|
||||||
|
aItLB.Initialize(aLB);
|
||||||
|
for (; aItLB.More(); aItLB.Next()) {
|
||||||
|
nSpx=aItLB.Value();
|
||||||
|
const TopoDS_Shape& aSpx=aDS.Shape(nSpx);
|
||||||
|
mySameDomainShapes.Add(aSpx ,aSpR);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
//
|
||||||
|
}// if (aNbSp==1) {
|
||||||
|
else {
|
||||||
|
aIt.Initialize(aLPB);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const BOPTools_PaveBlock& aPB=aIt.Value();
|
||||||
|
const BOPTools_PaveBlock& aPBR=pPF->RealPaveBlock(aPB, aLB);
|
||||||
|
nSpR=aPBR.Edge();
|
||||||
|
const TopoDS_Shape& aSpR=aDS.Shape(nSpR);
|
||||||
|
//
|
||||||
|
aESpR=TopoDS::Edge(aSpR);
|
||||||
|
bToReverse=GEOMAlgo_Tools3D::IsSplitToReverse(aESpR, aEE, aCtx);
|
||||||
|
if (bToReverse) {
|
||||||
|
aESpR.Reverse();
|
||||||
|
}
|
||||||
|
aLSp.Append(aESpR);
|
||||||
|
//
|
||||||
|
aItLB.Initialize(aLB);
|
||||||
|
for (; aItLB.More(); aItLB.Next()) {
|
||||||
|
nSpx=aItLB.Value();
|
||||||
|
const TopoDS_Shape& aSpx=aDS.Shape(nSpx);
|
||||||
|
mySameDomainShapes.Add(aSpx ,aSpR);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
myImages.Bind(aE, aLSp);
|
||||||
|
|
||||||
|
}//for (i=1; i<=aNb; ++i)
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
// function: FillImagesContainers
|
||||||
|
// purpose:
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_Builder::FillImagesContainers(const TopAbs_ShapeEnum theType)
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
Standard_Boolean bInterferred, bToReverse;
|
||||||
|
Standard_Integer i, aNbS;
|
||||||
|
TopAbs_ShapeEnum aType;
|
||||||
|
BRep_Builder aBB;
|
||||||
|
TopoDS_Iterator aIt;
|
||||||
|
TopTools_ListIteratorOfListOfShape aItIm;
|
||||||
|
TopTools_MapOfShape aMS;
|
||||||
|
TopTools_MapIteratorOfMapOfShape aItS;
|
||||||
|
//
|
||||||
|
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
|
||||||
|
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
|
||||||
|
IntTools_Context& aCtx= pPF->ChangeContext();
|
||||||
|
//
|
||||||
|
aNbS=aDS.NumberOfShapesOfTheObject();
|
||||||
|
for (i=1; i<=aNbS; ++i) {
|
||||||
|
const TopoDS_Shape& aC=aDS.Shape(i);
|
||||||
|
aType=aC.ShapeType();
|
||||||
|
if (aType==theType) {
|
||||||
|
aMS.Add(aC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if (theType==TopAbs_COMPOUND) {
|
||||||
|
FillImagesCompounds(aMS, myImages);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aItS.Initialize(aMS);
|
||||||
|
for (; aItS.More(); aItS.Next()) {
|
||||||
|
const TopoDS_Shape& aC=aItS.Key();
|
||||||
|
// whether the shape has image
|
||||||
|
bInterferred=Standard_False;
|
||||||
|
aIt.Initialize(aC);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aF=aIt.Value();
|
||||||
|
if (myImages.HasImage(aF)) {
|
||||||
|
bInterferred=!bInterferred;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!bInterferred){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
TopoDS_Shape aCIm;
|
||||||
|
GEOMAlgo_Tools3D::MakeContainer(theType, aCIm);
|
||||||
|
//
|
||||||
|
aIt.Initialize(aC);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aF=aIt.Value();
|
||||||
|
if (myImages.HasImage(aF)) {
|
||||||
|
const TopTools_ListOfShape& aLFIm=myImages.Image(aF);
|
||||||
|
aItIm.Initialize(aLFIm);
|
||||||
|
for (; aItIm.More(); aItIm.Next()) {
|
||||||
|
TopoDS_Shape aFIm=aItIm.Value();
|
||||||
|
//
|
||||||
|
bToReverse=GEOMAlgo_Tools3D::IsSplitToReverse(aFIm, aF, aCtx);
|
||||||
|
if (bToReverse) {
|
||||||
|
aFIm.Reverse();
|
||||||
|
}
|
||||||
|
aBB.Add(aCIm, aFIm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
aBB.Add(aCIm, aF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
myImages.Bind(aC, aCIm);
|
||||||
|
}// for (; aItS.More(); aItS.Next()) {
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
// function: FillImagesCompounds
|
||||||
|
// purpose:
|
||||||
|
//=======================================================================
|
||||||
|
void FillImagesCompounds(const TopTools_MapOfShape& theMS,
|
||||||
|
BRepAlgo_Image& theImages)
|
||||||
|
{
|
||||||
|
TopTools_MapOfShape aMFP;
|
||||||
|
TopTools_MapIteratorOfMapOfShape aItS;
|
||||||
|
//
|
||||||
|
aItS.Initialize(theMS);
|
||||||
|
for (; aItS.More(); aItS.Next()) {
|
||||||
|
const TopoDS_Shape& aC=aItS.Key();
|
||||||
|
FillImagesCompound(aC, theImages, aMFP);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : FillImagesCompound
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void FillImagesCompound(const TopoDS_Shape& theS,
|
||||||
|
BRepAlgo_Image& theImages,
|
||||||
|
TopTools_MapOfShape& theMFP)
|
||||||
|
{
|
||||||
|
Standard_Boolean bInterferred;
|
||||||
|
TopAbs_ShapeEnum aTypeX;
|
||||||
|
TopAbs_Orientation aOrX;
|
||||||
|
TopoDS_Iterator aIt;
|
||||||
|
BRep_Builder aBB;
|
||||||
|
TopTools_ListIteratorOfListOfShape aItIm;
|
||||||
|
//
|
||||||
|
if (!theMFP.Add(theS)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
bInterferred=Standard_False;
|
||||||
|
aIt.Initialize(theS);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aSX=aIt.Value();
|
||||||
|
aTypeX=aSX.ShapeType();
|
||||||
|
if (aTypeX==TopAbs_COMPOUND) {
|
||||||
|
FillImagesCompound(aSX, theImages, theMFP);
|
||||||
|
}
|
||||||
|
if (theImages.HasImage(aSX)) {
|
||||||
|
bInterferred=Standard_True;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!bInterferred){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
TopoDS_Shape aCIm;
|
||||||
|
GEOMAlgo_Tools3D::MakeContainer(TopAbs_COMPOUND, aCIm);
|
||||||
|
//
|
||||||
|
aIt.Initialize(theS);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aSX=aIt.Value();
|
||||||
|
aOrX=aSX.Orientation();
|
||||||
|
if (theImages.HasImage(aSX)) {
|
||||||
|
const TopTools_ListOfShape& aLFIm=theImages.Image(aSX);
|
||||||
|
aItIm.Initialize(aLFIm);
|
||||||
|
for (; aItIm.More(); aItIm.Next()) {
|
||||||
|
TopoDS_Shape aSXIm=aItIm.Value();
|
||||||
|
aSXIm.Orientation(aOrX);
|
||||||
|
aBB.Add(aCIm, aSXIm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
aBB.Add(aCIm, aSX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
theImages.Bind(theS, aCIm);
|
||||||
|
}
|
783
src/GEOMAlgo/GEOMAlgo_Builder_2.cxx
Executable file
783
src/GEOMAlgo/GEOMAlgo_Builder_2.cxx
Executable file
@ -0,0 +1,783 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
//
|
||||||
|
// File: GEOMAlgo_Builder_2.cxx
|
||||||
|
// Created:
|
||||||
|
// Author: Peter KURNEV
|
||||||
|
|
||||||
|
#include <GEOMAlgo_Builder.hxx>
|
||||||
|
|
||||||
|
#include <TColStd_IndexedMapOfInteger.hxx>
|
||||||
|
#include <TColStd_ListOfInteger.hxx>
|
||||||
|
|
||||||
|
#include <TopAbs_Orientation.hxx>
|
||||||
|
|
||||||
|
#include <TopoDS.hxx>
|
||||||
|
#include <TopoDS_Face.hxx>
|
||||||
|
#include <TopoDS_Edge.hxx>
|
||||||
|
#include <TopoDS_Shape.hxx>
|
||||||
|
#include <TopoDS_Compound.hxx>
|
||||||
|
|
||||||
|
#include <TopTools_IndexedMapOfShape.hxx>
|
||||||
|
#include <TopTools_ListOfShape.hxx>
|
||||||
|
#include <TopTools_MapOfShape.hxx>
|
||||||
|
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||||
|
|
||||||
|
#include <TopExp.hxx>
|
||||||
|
#include <TopExp_Explorer.hxx>
|
||||||
|
|
||||||
|
#include <BRep_Tool.hxx>
|
||||||
|
#include <BRep_Builder.hxx>
|
||||||
|
#include <BRepAlgo_Image.hxx>
|
||||||
|
#include <BRepTools.hxx>
|
||||||
|
|
||||||
|
#include <IntTools_Context.hxx>
|
||||||
|
#include <IntTools_FClass2d.hxx>
|
||||||
|
|
||||||
|
#include <BooleanOperations_OnceExplorer.hxx>
|
||||||
|
#include <BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger.hxx>
|
||||||
|
#include <BOPTools_ListOfPaveBlock.hxx>
|
||||||
|
#include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
|
||||||
|
#include <BOPTools_InterferencePool.hxx>
|
||||||
|
#include <BOPTools_CArray1OfSSInterference.hxx>
|
||||||
|
#include <BOPTools_SSInterference.hxx>
|
||||||
|
#include <BOPTools_SequenceOfCurves.hxx>
|
||||||
|
#include <BOPTools_Curve.hxx>
|
||||||
|
#include <BOPTools_ListOfPaveBlock.hxx>
|
||||||
|
#include <BOPTools_PaveBlock.hxx>
|
||||||
|
#include <BOPTools_Tools3D.hxx>
|
||||||
|
#include <BOPTools_CArray1OfVSInterference.hxx>
|
||||||
|
#include <BOPTools_VSInterference.hxx>
|
||||||
|
#include <BOPTools_ESInterference.hxx>
|
||||||
|
#include <BOPTools_CArray1OfESInterference.hxx>
|
||||||
|
|
||||||
|
#include <NMTDS_ShapesDataStructure.hxx>
|
||||||
|
#include <NMTTools_DSFiller.hxx>
|
||||||
|
#include <NMTTools_PaveFiller.hxx>
|
||||||
|
#include <NMTTools_ListOfCoupleOfShape.hxx>
|
||||||
|
#include <NMTTools_Tools.hxx>
|
||||||
|
#include <NMTTools_CoupleOfShape.hxx>
|
||||||
|
#include <NMTTools_IndexedDataMapOfShapeIndexedMapOfShape.hxx>
|
||||||
|
#include <NMTTools_Tools.hxx>
|
||||||
|
#include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
|
||||||
|
#include <NMTTools_ListOfCommonBlock.hxx>
|
||||||
|
#include <NMTTools_CommonBlock.hxx>
|
||||||
|
#include <NMTTools_IndexedDataMapOfIndexedMapOfInteger.hxx>
|
||||||
|
//
|
||||||
|
#include <GEOMAlgo_Tools3D.hxx>
|
||||||
|
#include <GEOMAlgo_WireEdgeSet.hxx>
|
||||||
|
#include <GEOMAlgo_BuilderFace.hxx>
|
||||||
|
|
||||||
|
static
|
||||||
|
void UpdateCandidates(const Standard_Integer ,
|
||||||
|
const Standard_Integer ,
|
||||||
|
NMTTools_IndexedDataMapOfIndexedMapOfInteger& );
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : FillImagesFaces
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_Builder::FillImagesFaces()
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
FillIn2DParts();
|
||||||
|
BuildSplitFaces();
|
||||||
|
FillSameDomainFaces();
|
||||||
|
FillImagesFaces1();
|
||||||
|
FillInternalVertices();
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
// function: FillIn2DParts
|
||||||
|
// purpose:
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_Builder::FillIn2DParts()
|
||||||
|
{
|
||||||
|
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
|
||||||
|
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
|
||||||
|
BOPTools_InterferencePool* pIP=(BOPTools_InterferencePool*)&myDSFiller->InterfPool();
|
||||||
|
BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences();
|
||||||
|
NMTTools_CommonBlockPool& aCBP=pPF->ChangeCommonBlockPool();
|
||||||
|
//
|
||||||
|
Standard_Integer j, nSpIn, nSpSc, aNbCurves;
|
||||||
|
Standard_Integer aNbS, nF, aNbCBP, n1, n2, aNbFFs, aNbSpIn;
|
||||||
|
TopTools_MapOfShape aMFence;
|
||||||
|
TopTools_ListOfShape aLSpIn;
|
||||||
|
TopoDS_Face aF;
|
||||||
|
NMTTools_ListIteratorOfListOfCommonBlock aItCB;
|
||||||
|
BOPTools_ListIteratorOfListOfPaveBlock aItPB;
|
||||||
|
//
|
||||||
|
myInParts.Clear();
|
||||||
|
//
|
||||||
|
aNbFFs=aFFs.Extent();
|
||||||
|
aNbCBP=aCBP.Extent();
|
||||||
|
//
|
||||||
|
aNbS=aDS.NumberOfShapesOfTheObject();
|
||||||
|
for (nF=1; nF<=aNbS; ++nF) {
|
||||||
|
if (aDS.GetShapeType(nF)!=TopAbs_FACE) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aF=TopoDS::Face(aDS.Shape(nF));
|
||||||
|
//
|
||||||
|
aMFence.Clear();
|
||||||
|
aLSpIn.Clear();
|
||||||
|
//
|
||||||
|
// 1. In Parts
|
||||||
|
for (j=1; j<=aNbCBP; ++j) {
|
||||||
|
NMTTools_ListOfCommonBlock& aLCB=aCBP(j);
|
||||||
|
aItCB.Initialize(aLCB);
|
||||||
|
for (; aItCB.More(); aItCB.Next()) {
|
||||||
|
NMTTools_CommonBlock& aCB=aItCB.Value();
|
||||||
|
if (aCB.IsPaveBlockOnFace(nF)) {
|
||||||
|
const BOPTools_PaveBlock& aPB1=aCB.PaveBlock1();
|
||||||
|
nSpIn=aPB1.Edge();
|
||||||
|
const TopoDS_Shape& aSpIn=aDS.Shape(nSpIn);
|
||||||
|
if (aMFence.Add(aSpIn)){
|
||||||
|
aLSpIn.Append(aSpIn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// 2. Section Parts
|
||||||
|
for (j=1; j<=aNbFFs; ++j) {
|
||||||
|
BOPTools_SSInterference& aFF=aFFs(j);
|
||||||
|
aFF.Indices(n1, n2);
|
||||||
|
if (!(n1==nF || n2==nF)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
BOPTools_SequenceOfCurves& aSC=aFF.Curves();
|
||||||
|
aNbCurves=aSC.Length();
|
||||||
|
if (!aNbCurves) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
const BOPTools_Curve& aBC=aSC(1);
|
||||||
|
const BOPTools_ListOfPaveBlock& aLPB=aBC.NewPaveBlocks();
|
||||||
|
aItPB.Initialize(aLPB);
|
||||||
|
for (; aItPB.More(); aItPB.Next()) {
|
||||||
|
const BOPTools_PaveBlock& aPBSc=aItPB.Value();
|
||||||
|
nSpSc=aPBSc.Edge();
|
||||||
|
const TopoDS_Shape& aSpSc=aDS.Shape(nSpSc);
|
||||||
|
if (aMFence.Add(aSpSc)){
|
||||||
|
aLSpIn.Append(aSpSc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
aNbSpIn=aLSpIn.Extent();
|
||||||
|
if (aNbSpIn) {
|
||||||
|
myInParts.Add(aF, aLSpIn);
|
||||||
|
}
|
||||||
|
}//for (nF=1; nF<=aNbS; ++nF) {
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
// function: BuildSplitFaces
|
||||||
|
// purpose:
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_Builder::BuildSplitFaces()
|
||||||
|
{
|
||||||
|
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
|
||||||
|
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
|
||||||
|
BOPTools_InterferencePool* pIP=(BOPTools_InterferencePool*)&myDSFiller->InterfPool();
|
||||||
|
BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences();
|
||||||
|
IntTools_Context& aCtx= pPF->ChangeContext();
|
||||||
|
//
|
||||||
|
Standard_Boolean bToReverse, bIsClosed, bIsDegenerated;
|
||||||
|
Standard_Integer i, aNb, aNbF, nF;
|
||||||
|
TopTools_MapOfShape aMFence;
|
||||||
|
TColStd_IndexedMapOfInteger aMFP;
|
||||||
|
TopExp_Explorer anExp;
|
||||||
|
TopoDS_Face aFF;
|
||||||
|
TopoDS_Edge aSp, aEE;
|
||||||
|
TopTools_ListIteratorOfListOfShape aIt;
|
||||||
|
TopAbs_Orientation anOriF, anOriE;
|
||||||
|
//
|
||||||
|
mySplitFaces.Clear();
|
||||||
|
//
|
||||||
|
// 1. Select Faces to process (MFP)
|
||||||
|
aNb=aDS.NumberOfShapesOfTheObject();
|
||||||
|
for (i=1; i<=aNb; ++i) {
|
||||||
|
const TopoDS_Shape& aF=aDS.Shape(i);
|
||||||
|
if (aF.ShapeType()!=TopAbs_FACE) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!aMFence.Add(aF)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if (myInParts.Contains(aF)) {
|
||||||
|
aMFP.Add(i);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
anExp.Init(aF, TopAbs_EDGE);
|
||||||
|
for (; anExp.More(); anExp.Next()) {
|
||||||
|
const TopoDS_Shape& aE=anExp.Current();
|
||||||
|
if (myImages.HasImage(aE)) {
|
||||||
|
aMFP.Add(i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
//===
|
||||||
|
{
|
||||||
|
Standard_Integer aNbFFs, aNbSE, j, n1, n2;
|
||||||
|
//
|
||||||
|
aNbFFs=aFFs.Extent();
|
||||||
|
for (j=1; j<=aNbFFs; ++j) {
|
||||||
|
BOPTools_SSInterference& aFFj=aFFs(j);
|
||||||
|
aFFj.Indices(n1, n2);
|
||||||
|
if (!(n1==i || n2==i)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
const TColStd_ListOfInteger& aLSE=aFFj.SharedEdges();
|
||||||
|
aNbSE=aLSE.Extent();
|
||||||
|
if (aNbSE) {
|
||||||
|
aMFP.Add(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//===
|
||||||
|
//
|
||||||
|
}// for (i=1; i<=aNb; ++i)
|
||||||
|
//
|
||||||
|
// 2. ProcessFaces
|
||||||
|
aNbF=aMFP.Extent();
|
||||||
|
for (i=1; i<=aNbF; ++i) {
|
||||||
|
nF=aMFP(i);
|
||||||
|
const TopoDS_Face& aF=TopoDS::Face(aDS.Shape(nF));
|
||||||
|
anOriF=aF.Orientation();
|
||||||
|
aFF=aF;
|
||||||
|
aFF.Orientation(TopAbs_FORWARD);
|
||||||
|
//
|
||||||
|
aMFence.Clear();
|
||||||
|
//
|
||||||
|
// 2.1. Fill WES
|
||||||
|
GEOMAlgo_WireEdgeSet aWES;
|
||||||
|
aWES.SetFace(aFF);
|
||||||
|
//
|
||||||
|
// 2.1.1. Add Split parts
|
||||||
|
anExp.Init(aFF, TopAbs_EDGE);
|
||||||
|
for (; anExp.More(); anExp.Next()) {
|
||||||
|
const TopoDS_Edge& aE=TopoDS::Edge(anExp.Current());
|
||||||
|
anOriE=aE.Orientation();
|
||||||
|
//
|
||||||
|
if (!myImages.HasImage(aE)) {
|
||||||
|
if (anOriE==TopAbs_INTERNAL) {
|
||||||
|
aEE=aE;
|
||||||
|
aEE.Orientation(TopAbs_FORWARD);
|
||||||
|
aWES.AddStartElement(aEE);
|
||||||
|
aEE.Orientation(TopAbs_REVERSED);
|
||||||
|
aWES.AddStartElement(aEE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
aWES.AddStartElement(aE);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
bIsDegenerated=BRep_Tool::Degenerated(aE);
|
||||||
|
bIsClosed=BRep_Tool::IsClosed(aE, aF);
|
||||||
|
//
|
||||||
|
const TopTools_ListOfShape& aLIE=myImages.Image(aE);
|
||||||
|
aIt.Initialize(aLIE);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
aSp=TopoDS::Edge(aIt.Value());
|
||||||
|
//
|
||||||
|
if (bIsDegenerated) {
|
||||||
|
aSp.Orientation(anOriE);
|
||||||
|
aWES.AddStartElement(aSp);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if (anOriE==TopAbs_INTERNAL) {
|
||||||
|
aSp.Orientation(TopAbs_FORWARD);
|
||||||
|
aWES.AddStartElement(aSp);
|
||||||
|
aSp.Orientation(TopAbs_REVERSED);
|
||||||
|
aWES.AddStartElement(aSp);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if (bIsClosed){
|
||||||
|
if (aMFence.Add(aSp)) {
|
||||||
|
//
|
||||||
|
if (!BRep_Tool::IsClosed(aSp, aF)){
|
||||||
|
BOPTools_Tools3D::DoSplitSEAMOnFace(aSp, aF);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aSp.Orientation(TopAbs_FORWARD);
|
||||||
|
aWES.AddStartElement(aSp);
|
||||||
|
aSp.Orientation(TopAbs_REVERSED);
|
||||||
|
aWES.AddStartElement(aSp);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}// if (aMFence.Add(aSp))
|
||||||
|
//
|
||||||
|
aSp.Orientation(anOriE);
|
||||||
|
bToReverse=BOPTools_Tools3D::IsSplitToReverse1(aSp, aE, aCtx);
|
||||||
|
if (bToReverse) {
|
||||||
|
aSp.Reverse();
|
||||||
|
}
|
||||||
|
aWES.AddStartElement(aSp);
|
||||||
|
}// for (; aIt.More(); aIt.Next()) {
|
||||||
|
}// for (; anExp.More(); anExp.Next()) {
|
||||||
|
//
|
||||||
|
// 2.1.2. Add In2D Parts
|
||||||
|
if (myInParts.Contains(aF)) {
|
||||||
|
const TopTools_ListOfShape& aLE=myInParts.FindFromKey(aF);
|
||||||
|
aIt.Initialize(aLE);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
aSp=TopoDS::Edge(aIt.Value());
|
||||||
|
//
|
||||||
|
aSp.Orientation(TopAbs_FORWARD);
|
||||||
|
aWES.AddStartElement(aSp);
|
||||||
|
//
|
||||||
|
aSp.Orientation(TopAbs_REVERSED);
|
||||||
|
aWES.AddStartElement(aSp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// 2.2. Build images Faces
|
||||||
|
GEOMAlgo_BuilderFace aBF;
|
||||||
|
//
|
||||||
|
aBF.SetFace(aFF);
|
||||||
|
aBF.SetContext(aCtx);
|
||||||
|
const TopTools_ListOfShape& aSE=aWES.StartElements();
|
||||||
|
aBF.SetShapes(aSE);
|
||||||
|
//
|
||||||
|
aBF.Perform();
|
||||||
|
//
|
||||||
|
const TopTools_ListOfShape& aLF=aBF.Areas();
|
||||||
|
//
|
||||||
|
TopTools_ListOfShape aLFR;
|
||||||
|
//
|
||||||
|
aIt.Initialize(aLF);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
TopoDS_Shape& aFR=aIt.Value();
|
||||||
|
if (anOriF==TopAbs_REVERSED) {
|
||||||
|
aFR.Orientation(TopAbs_REVERSED);
|
||||||
|
}
|
||||||
|
aLFR.Append(aFR);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// 2.3. Collect draft images Faces
|
||||||
|
mySplitFaces.Bind(aF, aLFR);
|
||||||
|
}//for (i=1; i<=aNbF; ++i)
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
// function: FillSameDomainFaces
|
||||||
|
// purpose:
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_Builder::FillSameDomainFaces()
|
||||||
|
{
|
||||||
|
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
|
||||||
|
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
|
||||||
|
BOPTools_InterferencePool* pIP=(BOPTools_InterferencePool*)&myDSFiller->InterfPool();
|
||||||
|
BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences();
|
||||||
|
IntTools_Context& aCtx= pPF->ChangeContext();
|
||||||
|
//
|
||||||
|
Standard_Boolean bIsSDF;
|
||||||
|
Standard_Integer i, j, aNbFF, nF1, nF2, aNbPBInOn, aNbC, aNbSE;
|
||||||
|
TopTools_MapOfShape aMFence;
|
||||||
|
TopTools_ListIteratorOfListOfShape aItF1, aItF2;
|
||||||
|
NMTTools_ListOfCoupleOfShape aLCS;
|
||||||
|
//
|
||||||
|
//mySameDomainShapes.Clear();
|
||||||
|
//
|
||||||
|
// 1. For each FF find among images of faces
|
||||||
|
// all pairs of same domain faces (SDF) [=> aLCS]
|
||||||
|
aNbFF=aFFs.Extent();
|
||||||
|
for (i=1; i<=aNbFF; ++i) {
|
||||||
|
BOPTools_SSInterference& aFF=aFFs(i);
|
||||||
|
aFF.Indices(nF1, nF2);
|
||||||
|
//
|
||||||
|
const TopoDS_Face& aF1=TopoDS::Face(aDS.Shape(nF1));
|
||||||
|
const TopoDS_Face& aF2=TopoDS::Face(aDS.Shape(nF2));
|
||||||
|
//
|
||||||
|
// if there are no in/on 2D split parts the faces nF1, nF2
|
||||||
|
// can not be SDF
|
||||||
|
const BOPTools_ListOfPaveBlock& aLPBInOn=aFF.PaveBlocks();
|
||||||
|
aNbPBInOn=aLPBInOn.Extent();
|
||||||
|
//
|
||||||
|
//===
|
||||||
|
const TColStd_ListOfInteger& aLSE=aFF.SharedEdges();
|
||||||
|
aNbSE=aLSE.Extent();
|
||||||
|
if (!aNbPBInOn && !aNbSE) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//===
|
||||||
|
//
|
||||||
|
// if there is at least one section edge between faces nF1, nF2
|
||||||
|
// they can not be SDF
|
||||||
|
BOPTools_SequenceOfCurves& aSC=aFF.Curves();
|
||||||
|
aNbC=aSC.Length();
|
||||||
|
if (aNbC) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// the faces are suspected to be SDF.
|
||||||
|
// Try to find SDF among images of nF1, nF2
|
||||||
|
aMFence.Clear();
|
||||||
|
const TopTools_ListOfShape& aLF1=mySplitFaces.Image(aF1);
|
||||||
|
const TopTools_ListOfShape& aLF2=mySplitFaces.Image(aF2);
|
||||||
|
//
|
||||||
|
aItF1.Initialize(aLF1);
|
||||||
|
for (; aItF1.More(); aItF1.Next()) {
|
||||||
|
const TopoDS_Face& aF1x=TopoDS::Face(aItF1.Value());
|
||||||
|
//
|
||||||
|
aItF2.Initialize(aLF2);
|
||||||
|
for (; aItF2.More(); aItF2.Next()) {
|
||||||
|
const TopoDS_Face& aF2y=TopoDS::Face(aItF2.Value());
|
||||||
|
bIsSDF=NMTTools_Tools::AreFacesSameDomain(aF1x, aF2y, aCtx);
|
||||||
|
if (bIsSDF) {
|
||||||
|
if (aMFence.Contains(aF1x) ||
|
||||||
|
aMFence.Contains(aF2y)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
aMFence.Add(aF1x);
|
||||||
|
aMFence.Add(aF2y);
|
||||||
|
//
|
||||||
|
NMTTools_CoupleOfShape aCS;
|
||||||
|
//
|
||||||
|
aCS.SetShape1(aF1x);
|
||||||
|
aCS.SetShape2(aF2y);
|
||||||
|
aLCS.Append(aCS);
|
||||||
|
//
|
||||||
|
if (aF1x==aF1) {
|
||||||
|
if (!mySplitFaces.HasImage(aF1)) {
|
||||||
|
mySplitFaces.Bind(aF1, aF1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (aF2y==aF2) {
|
||||||
|
if (!mySplitFaces.HasImage(aF2)) {
|
||||||
|
mySplitFaces.Bind(aF2, aF2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}//for (i=1; i<=aNbFF; ++i)
|
||||||
|
//
|
||||||
|
aNbC=aLCS.Extent();
|
||||||
|
if (!aNbC) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// 2. Find Chains
|
||||||
|
NMTTools_IndexedDataMapOfShapeIndexedMapOfShape aMC;
|
||||||
|
//
|
||||||
|
NMTTools_Tools::FindChains(aLCS, aMC);
|
||||||
|
//
|
||||||
|
// 3. Fill the map of SDF mySameDomainFaces
|
||||||
|
aNbC=aMC.Extent();
|
||||||
|
for (i=1; i<=aNbC; ++i) {
|
||||||
|
const TopoDS_Shape& aF=aMC.FindKey(i);
|
||||||
|
const TopTools_IndexedMapOfShape& aMSDF=aMC(i);
|
||||||
|
//
|
||||||
|
aNbFF=aMSDF.Extent();
|
||||||
|
for (j=1; j<=aNbFF; ++j) {
|
||||||
|
const TopoDS_Shape& aFSD=aMSDF(j);
|
||||||
|
mySameDomainShapes.Add(aFSD, aF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
// function: FillImagesFaces1
|
||||||
|
// purpose:
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_Builder::FillImagesFaces1()
|
||||||
|
{
|
||||||
|
Standard_Integer i, aNb, iSense;
|
||||||
|
TopoDS_Face aF, aFSp, aFSD;
|
||||||
|
TopTools_ListOfShape aLFx;
|
||||||
|
TopTools_ListIteratorOfListOfShape aIt;
|
||||||
|
//
|
||||||
|
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
|
||||||
|
//
|
||||||
|
aNb=aDS.NumberOfShapesOfTheObject();
|
||||||
|
for (i=1; i<=aNb; ++i) {
|
||||||
|
const TopoDS_Shape& aS=aDS.Shape(i);
|
||||||
|
if (aS.ShapeType()!=TopAbs_FACE) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if (!mySplitFaces.HasImage(aS)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aF=TopoDS::Face(aS);
|
||||||
|
//
|
||||||
|
aLFx.Clear();
|
||||||
|
const TopTools_ListOfShape& aLF=mySplitFaces.Image(aF);
|
||||||
|
aIt.Initialize(aLF);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
aFSp=TopoDS::Face(aIt.Value());
|
||||||
|
if (!mySameDomainShapes.Contains(aFSp)) {
|
||||||
|
aLFx.Append(aFSp);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const TopoDS_Shape& aSx=mySameDomainShapes.FindFromKey(aFSp);
|
||||||
|
aFSD=TopoDS::Face(aSx);
|
||||||
|
iSense=GEOMAlgo_Tools3D::Sense(aFSp, aFSD);
|
||||||
|
if (iSense<0) {
|
||||||
|
aFSD.Reverse();
|
||||||
|
}
|
||||||
|
aLFx.Append(aFSD);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!myImages.HasImage(aF)) {//XX
|
||||||
|
myImages.Bind(aF, aLFx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
// function: FillInternalVertices
|
||||||
|
// purpose:
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_Builder::FillInternalVertices()
|
||||||
|
{
|
||||||
|
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
|
||||||
|
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
|
||||||
|
BOPTools_InterferencePool* pIP=(BOPTools_InterferencePool*)&myDSFiller->InterfPool();
|
||||||
|
IntTools_Context& aCtx= pPF->ChangeContext();
|
||||||
|
//
|
||||||
|
BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences();
|
||||||
|
BOPTools_CArray1OfVSInterference& aVFs=pIP->VSInterferences();
|
||||||
|
BOPTools_CArray1OfESInterference& aEFs=pIP->ESInterferences();
|
||||||
|
const NMTTools_IndexedDataMapOfIndexedMapOfInteger& aMAV=pPF->AloneVertices();
|
||||||
|
//
|
||||||
|
Standard_Boolean bHasImage;
|
||||||
|
Standard_Integer i, j, nF, aNbS, nV, nVSD, n1, n2, iFlag;
|
||||||
|
Standard_Integer aNbVFs, aNbAVF, aNbEFs, aNbVC, aNbE, aNbV;
|
||||||
|
Standard_Real aU1, aU2, aTol;
|
||||||
|
NMTTools_IndexedDataMapOfIndexedMapOfInteger aMFMV;
|
||||||
|
TopTools_MapOfShape aMFence;
|
||||||
|
TopTools_ListIteratorOfListOfShape aIt, aItV;
|
||||||
|
BRep_Builder aBB;
|
||||||
|
//
|
||||||
|
// 1. Collect face-vertex candidates [aMFMV]
|
||||||
|
//
|
||||||
|
// 1.1. VFs
|
||||||
|
aNbVFs=aVFs.Extent();
|
||||||
|
for (i=1; i<=aNbVFs; ++i) {
|
||||||
|
const BOPTools_VSInterference& aVS=aVFs(i);
|
||||||
|
aVS.Indices(n1, n2);
|
||||||
|
nF=n2;
|
||||||
|
nV=n1;
|
||||||
|
if (aDS.Shape(n1).ShapeType()==TopAbs_FACE) {
|
||||||
|
nF=n1;
|
||||||
|
nV=n2;
|
||||||
|
}
|
||||||
|
nVSD=pPF->FindSDVertex(nV);
|
||||||
|
if (nVSD) {
|
||||||
|
nV=nVSD;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
UpdateCandidates(nF, nV, aMFMV);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// 1.2 EFs
|
||||||
|
aNbEFs=aEFs.Extent();
|
||||||
|
for (i=1; i<=aNbEFs; ++i) {
|
||||||
|
const BOPTools_ESInterference& aEF=aEFs(i);
|
||||||
|
aEF.Indices(n1, n2);
|
||||||
|
nV=aEF.NewShape();
|
||||||
|
if (!nV) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
const TopoDS_Shape& aSnew=aDS.Shape(nV);
|
||||||
|
if (aSnew.ShapeType()!=TopAbs_VERTEX) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
nF=(aDS.Shape(n1).ShapeType()==TopAbs_FACE) ? n1 : n2;
|
||||||
|
nVSD=pPF->FindSDVertex(nV);
|
||||||
|
if (nVSD) {
|
||||||
|
nV=nVSD;
|
||||||
|
}
|
||||||
|
UpdateCandidates(nF, nV, aMFMV);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aNbS=aDS.NumberOfShapesOfTheObject();
|
||||||
|
for (nF=1; nF<=aNbS; ++nF) {
|
||||||
|
const TopoDS_Shape& aF=aDS.Shape(nF);
|
||||||
|
//
|
||||||
|
if (aF.ShapeType()!=TopAbs_FACE) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!aMFence.Add(aF)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
const TopoDS_Face& aFF=TopoDS::Face(aF);
|
||||||
|
aTol=BRep_Tool::Tolerance(aFF);
|
||||||
|
//
|
||||||
|
// 1.3 FFs
|
||||||
|
if (aMAV.Contains(nF)) {
|
||||||
|
const TColStd_IndexedMapOfInteger& aMAVF=aMAV.FindFromKey(nF);
|
||||||
|
aNbAVF=aMAVF.Extent();
|
||||||
|
for (j=1; j<=aNbAVF; ++j) {
|
||||||
|
nV=aMAVF(j);
|
||||||
|
nVSD=pPF->FindSDVertex(nV);
|
||||||
|
if (nVSD) {
|
||||||
|
nV=nVSD;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
UpdateCandidates(nF, nV, aMFMV);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// 1.4 Internal vertices of the face nF
|
||||||
|
BooleanOperations_OnceExplorer aExp(aDS);
|
||||||
|
aExp.Init(nF, TopAbs_VERTEX);
|
||||||
|
for (; aExp.More(); aExp.Next()) {
|
||||||
|
nV=aExp.Current();
|
||||||
|
const TopoDS_Shape& aV=aDS.Shape(nV);
|
||||||
|
if (aV.Orientation()==TopAbs_INTERNAL) {
|
||||||
|
nVSD=pPF->FindSDVertex(nV);
|
||||||
|
if (nVSD) {
|
||||||
|
nV=nVSD;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
UpdateCandidates(nF, nV, aMFMV);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// 2. Process face nF
|
||||||
|
if (!aMFMV.Contains(nF)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
const TColStd_IndexedMapOfInteger& aMVC=aMFMV.FindFromKey(nF);
|
||||||
|
aNbVC=aMVC.Extent();
|
||||||
|
if (!aNbVC) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// 2.1 Refine candidates
|
||||||
|
TopTools_IndexedDataMapOfShapeListOfShape aMVE;
|
||||||
|
TopTools_ListOfShape aLV;
|
||||||
|
//
|
||||||
|
bHasImage=myImages.HasImage(aF);
|
||||||
|
if (bHasImage) {
|
||||||
|
const TopTools_ListOfShape& aLFx=myImages.Image(aF);
|
||||||
|
aIt.Initialize(aLFx);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aFx=aIt.Value();
|
||||||
|
TopExp::MapShapesAndAncestors(aFx, TopAbs_VERTEX, TopAbs_EDGE, aMVE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Standard_Boolean bFaceToProcess;
|
||||||
|
//
|
||||||
|
TopExp::MapShapesAndAncestors(aF, TopAbs_VERTEX, TopAbs_EDGE, aMVE);
|
||||||
|
bFaceToProcess=Standard_False;
|
||||||
|
for (j=1; j<=aNbVC; ++j) {
|
||||||
|
nV=aMVC(j);
|
||||||
|
const TopoDS_Shape& aV=aDS.Shape(nV);
|
||||||
|
if (!aMVE.Contains(aV)) {
|
||||||
|
bFaceToProcess=!bFaceToProcess;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!bFaceToProcess) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}// else
|
||||||
|
//
|
||||||
|
for (j=1; j<=aNbVC; ++j) {
|
||||||
|
nV=aMVC(j);
|
||||||
|
const TopoDS_Shape& aV=aDS.Shape(nV);
|
||||||
|
if (aMVE.Contains(aV)) {
|
||||||
|
const TopTools_ListOfShape& aLE=aMVE.FindFromKey(aV);
|
||||||
|
aNbE=aLE.Extent();
|
||||||
|
if (aNbE) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
aLV.Append(aV);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aNbV=aLV.Extent();
|
||||||
|
if (aNbV) {
|
||||||
|
// 3. Try to put vertices into the face(s)
|
||||||
|
aItV.Initialize(aLV);
|
||||||
|
for (; aItV.More(); aItV.Next()) {
|
||||||
|
TopoDS_Vertex aV=TopoDS::Vertex(aItV.Value());
|
||||||
|
aV.Orientation(TopAbs_INTERNAL);
|
||||||
|
//
|
||||||
|
bHasImage=myImages.HasImage(aF);
|
||||||
|
if (bHasImage) {
|
||||||
|
const TopTools_ListOfShape& aLFx=myImages.Image(aF);
|
||||||
|
aIt.Initialize(aLFx);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
TopoDS_Face aFx=TopoDS::Face(aIt.Value());
|
||||||
|
// update classifier
|
||||||
|
IntTools_FClass2d& aClsf=aCtx.FClass2d(aFx);
|
||||||
|
aClsf.Init(aFx, aTol);
|
||||||
|
//
|
||||||
|
iFlag=aCtx.ComputeVS (aV, aFx, aU1, aU2);
|
||||||
|
if (!iFlag) {
|
||||||
|
aBB.Add(aFx, aV);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const TopoDS_Face& aFx=TopoDS::Face(aF);
|
||||||
|
// update classifier
|
||||||
|
IntTools_FClass2d& aClsf=aCtx.FClass2d(aFx);
|
||||||
|
aClsf.Init(aFx, aTol);
|
||||||
|
//
|
||||||
|
iFlag=aCtx.ComputeVS (aV, aFx, aU1, aU2);
|
||||||
|
if (!iFlag) {
|
||||||
|
TopoDS_Face aFz;
|
||||||
|
//
|
||||||
|
GEOMAlgo_Tools3D::CopyFace(aFx, aFz);
|
||||||
|
aBB.Add(aFz, aV);
|
||||||
|
myImages.Bind(aF, aFz);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}// for (; aItV.More(); aItV.Next()) {
|
||||||
|
}// if (aNbV) {
|
||||||
|
}// for (nF=1; nF<=aNb; ++nF) {
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
// function: UpdateCandidates
|
||||||
|
// purpose:
|
||||||
|
//=======================================================================
|
||||||
|
void UpdateCandidates(const Standard_Integer theNF,
|
||||||
|
const Standard_Integer theNV,
|
||||||
|
NMTTools_IndexedDataMapOfIndexedMapOfInteger& theMFMV)
|
||||||
|
{
|
||||||
|
if (theMFMV.Contains(theNF)) {
|
||||||
|
TColStd_IndexedMapOfInteger& aMV=theMFMV.ChangeFromKey(theNF);
|
||||||
|
aMV.Add(theNV);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
TColStd_IndexedMapOfInteger aMV;
|
||||||
|
aMV.Add(theNV);
|
||||||
|
theMFMV.Add(theNF, aMV);
|
||||||
|
}
|
||||||
|
}
|
796
src/GEOMAlgo/GEOMAlgo_Builder_3.cxx
Executable file
796
src/GEOMAlgo/GEOMAlgo_Builder_3.cxx
Executable file
@ -0,0 +1,796 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
//
|
||||||
|
// File: GEOMAlgo_Builder_3.cxx
|
||||||
|
// Created:
|
||||||
|
// Author: Peter KURNEV
|
||||||
|
|
||||||
|
#include <GEOMAlgo_Builder.hxx>
|
||||||
|
|
||||||
|
#include <TopAbs_State.hxx>
|
||||||
|
|
||||||
|
#include <TopoDS.hxx>
|
||||||
|
#include <TopoDS_Iterator.hxx>
|
||||||
|
#include <TopoDS_Solid.hxx>
|
||||||
|
#include <TopoDS_Shape.hxx>
|
||||||
|
#include <TopoDS_Face.hxx>
|
||||||
|
#include <TopoDS_Solid.hxx>
|
||||||
|
#include <TopoDS_Iterator.hxx>
|
||||||
|
#include <TopoDS_Shell.hxx>
|
||||||
|
#include <TopoDS_Compound.hxx>
|
||||||
|
|
||||||
|
#include <TopExp.hxx>
|
||||||
|
#include <TopExp_Explorer.hxx>
|
||||||
|
|
||||||
|
#include <BRep_Builder.hxx>
|
||||||
|
#include <BRepTools.hxx>
|
||||||
|
#include <BRepClass3d_SolidClassifier.hxx>
|
||||||
|
|
||||||
|
#include <TopTools_ListOfShape.hxx>
|
||||||
|
#include <TopTools_IndexedMapOfShape.hxx>
|
||||||
|
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||||
|
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||||
|
#include <TopTools_IndexedMapOfShape.hxx>
|
||||||
|
#include <TopTools_MapIteratorOfMapOfShape.hxx>
|
||||||
|
#include <TopTools_DataMapOfShapeShape.hxx>
|
||||||
|
#include <TopTools_DataMapOfShapeInteger.hxx>
|
||||||
|
#include <TopTools_DataMapIteratorOfDataMapOfShapeInteger.hxx>
|
||||||
|
#include <TopTools_MapOfShape.hxx>
|
||||||
|
|
||||||
|
#include <IntTools_Context.hxx>
|
||||||
|
|
||||||
|
#include <NMTDS_ShapesDataStructure.hxx>
|
||||||
|
#include <NMTTools_DSFiller.hxx>
|
||||||
|
#include <NMTTools_PaveFiller.hxx>
|
||||||
|
|
||||||
|
#include <GEOMAlgo_Tools3D.hxx>
|
||||||
|
#include <GEOMAlgo_BuilderSolid.hxx>
|
||||||
|
#include <GEOMAlgo_ShapeSet.hxx>
|
||||||
|
#include <GEOMAlgo_DataMapOfShapeShapeSet.hxx>
|
||||||
|
#include <GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet.hxx>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static
|
||||||
|
void OwnInternalShapes(const TopoDS_Shape& ,
|
||||||
|
TopTools_IndexedMapOfShape& );
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : FillImagesSolids
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_Builder::FillImagesSolids()
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
FillIn3DParts();
|
||||||
|
BuildSplitSolids();
|
||||||
|
FillInternalShapes();
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : BuildDraftSolid
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_Builder::BuildDraftSolid(const TopoDS_Shape& theSolid,
|
||||||
|
TopoDS_Shape& theDraftSolid,
|
||||||
|
TopTools_ListOfShape& theLIF)
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
|
||||||
|
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
|
||||||
|
IntTools_Context& aCtx= pPF->ChangeContext();
|
||||||
|
//
|
||||||
|
Standard_Boolean bToReverse;
|
||||||
|
Standard_Integer iFlag;
|
||||||
|
TopAbs_Orientation aOrF, aOrSh, aOrSd;
|
||||||
|
TopoDS_Iterator aIt1, aIt2;
|
||||||
|
TopTools_ListIteratorOfListOfShape aItS;
|
||||||
|
BRep_Builder aBB;
|
||||||
|
TopoDS_Shell aShD;
|
||||||
|
TopoDS_Shape aFSDx, aFx;
|
||||||
|
//
|
||||||
|
aOrSd=theSolid.Orientation();
|
||||||
|
theDraftSolid.Orientation(aOrSd);
|
||||||
|
//
|
||||||
|
aIt1.Initialize(theSolid);
|
||||||
|
for (; aIt1.More(); aIt1.Next()) {
|
||||||
|
const TopoDS_Shape& aSh=aIt1.Value();
|
||||||
|
if(aSh.ShapeType()!=TopAbs_SHELL) {
|
||||||
|
continue; // mb internal edges,vertices
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aOrSh=aSh.Orientation();
|
||||||
|
aBB.MakeShell(aShD);
|
||||||
|
aShD.Orientation(aOrSh);
|
||||||
|
iFlag=0;
|
||||||
|
//
|
||||||
|
aIt2.Initialize(aSh);
|
||||||
|
for (; aIt2.More(); aIt2.Next()) {
|
||||||
|
const TopoDS_Shape& aF=aIt2.Value();
|
||||||
|
aOrF=aF.Orientation();
|
||||||
|
//
|
||||||
|
if (myImages.HasImage(aF)) {
|
||||||
|
const TopTools_ListOfShape& aLSp=myImages.Image(aF);
|
||||||
|
aItS.Initialize(aLSp);
|
||||||
|
for (; aItS.More(); aItS.Next()) {
|
||||||
|
aFx=aItS.Value();
|
||||||
|
//
|
||||||
|
if (mySameDomainShapes.Contains(aFx)) {
|
||||||
|
aFSDx=mySameDomainShapes.FindFromKey(aFx);
|
||||||
|
//
|
||||||
|
if (aOrF==TopAbs_INTERNAL) {
|
||||||
|
aFSDx.Orientation(aOrF);
|
||||||
|
theLIF.Append(aFSDx);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
bToReverse=GEOMAlgo_Tools3D::IsSplitToReverse(aFSDx, aF, aCtx);
|
||||||
|
if (bToReverse) {
|
||||||
|
aFSDx.Reverse();
|
||||||
|
}
|
||||||
|
//
|
||||||
|
iFlag=1;
|
||||||
|
aBB.Add(aShD, aFSDx);
|
||||||
|
}
|
||||||
|
}// if (mySameDomainShapes.Contains(aFx)) {
|
||||||
|
else {
|
||||||
|
aFx.Orientation(aOrF);
|
||||||
|
if (aOrF==TopAbs_INTERNAL) {
|
||||||
|
theLIF.Append(aFx);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
iFlag=1;
|
||||||
|
aBB.Add(aShD, aFx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} //if (myImages.HasImage(aF)) {
|
||||||
|
//
|
||||||
|
else {
|
||||||
|
if (aOrF==TopAbs_INTERNAL) {
|
||||||
|
theLIF.Append(aF);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
iFlag=1;
|
||||||
|
aBB.Add(aShD, aF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} //for (; aIt2.More(); aIt2.Next()) {
|
||||||
|
//
|
||||||
|
if (iFlag) {
|
||||||
|
aBB.Add(theDraftSolid, aShD);
|
||||||
|
}
|
||||||
|
} //for (; aIt1.More(); aIt1.Next()) {
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : FillIn3DParts
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_Builder::FillIn3DParts()
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
|
||||||
|
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
|
||||||
|
IntTools_Context& aCtx= pPF->ChangeContext();
|
||||||
|
//
|
||||||
|
Standard_Boolean bIsIN, bHasImage;
|
||||||
|
Standard_Integer aNbS, aNbSolids, i, j, aNbFaces, aNbFP, aNbFPx, aNbFIN, aNbLIF;// k,
|
||||||
|
TopAbs_ShapeEnum aType;
|
||||||
|
TopAbs_State aState;
|
||||||
|
TopTools_IndexedMapOfShape aMSolids, aMS, aMFaces, aMFIN;
|
||||||
|
TopTools_MapOfShape aMFDone;
|
||||||
|
TopTools_IndexedDataMapOfShapeListOfShape aMEF;
|
||||||
|
TopTools_ListIteratorOfListOfShape aItS;
|
||||||
|
TopoDS_Iterator aIt, aItF;
|
||||||
|
BRep_Builder aBB;
|
||||||
|
TopoDS_Solid aSolidSp;
|
||||||
|
TopoDS_Face aFP;
|
||||||
|
//
|
||||||
|
myDraftSolids.Clear();
|
||||||
|
//
|
||||||
|
aNbS=aDS.NumberOfShapesOfTheObject();
|
||||||
|
for (i=1; i<=aNbS; ++i) {
|
||||||
|
const TopoDS_Shape& aS=aDS.Shape(i);
|
||||||
|
//
|
||||||
|
aType=aS.ShapeType();
|
||||||
|
if (aType==TopAbs_SOLID) {
|
||||||
|
// all solids from DS
|
||||||
|
aMSolids.Add(aS);
|
||||||
|
}
|
||||||
|
else if (aType==TopAbs_FACE) {
|
||||||
|
// all faces (originals from DS or theirs images)
|
||||||
|
if (myImages.HasImage(aS)) {
|
||||||
|
const TopTools_ListOfShape& aLS=myImages.Image(aS);
|
||||||
|
aItS.Initialize(aLS);
|
||||||
|
for (; aItS.More(); aItS.Next()) {
|
||||||
|
const TopoDS_Shape& aFx=aItS.Value();
|
||||||
|
//
|
||||||
|
if (mySameDomainShapes.Contains(aFx)) {
|
||||||
|
const TopoDS_Shape& aFSDx=mySameDomainShapes.FindFromKey(aFx);
|
||||||
|
aMFaces.Add(aFSDx);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
aMFaces.Add(aFx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (mySameDomainShapes.Contains(aS)) {
|
||||||
|
const TopoDS_Shape& aFSDx=mySameDomainShapes.FindFromKey(aS);
|
||||||
|
aMFaces.Add(aFSDx);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
aMFaces.Add(aS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aNbFaces=aMFaces.Extent();
|
||||||
|
aNbSolids=aMSolids.Extent();
|
||||||
|
//
|
||||||
|
for (i=1; i<=aNbSolids; ++i) {
|
||||||
|
const TopoDS_Solid& aSolid=TopoDS::Solid(aMSolids(i));
|
||||||
|
aMFDone.Clear();
|
||||||
|
aMFIN.Clear();
|
||||||
|
aMEF.Clear();
|
||||||
|
//
|
||||||
|
aBB.MakeSolid(aSolidSp);
|
||||||
|
//
|
||||||
|
TopTools_ListOfShape aLIF;
|
||||||
|
//
|
||||||
|
BuildDraftSolid(aSolid, aSolidSp, aLIF);
|
||||||
|
aNbLIF=aLIF.Extent();
|
||||||
|
//
|
||||||
|
// 1 all faces/edges from aSolid [ aMS ]
|
||||||
|
bHasImage=Standard_False;
|
||||||
|
aMS.Clear();
|
||||||
|
aIt.Initialize(aSolid);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aShell=aIt.Value();
|
||||||
|
//
|
||||||
|
if (myImages.HasImage(aShell)) {
|
||||||
|
bHasImage=Standard_True;
|
||||||
|
//
|
||||||
|
const TopTools_ListOfShape& aLS=myImages.Image(aShell);
|
||||||
|
aItS.Initialize(aLS);
|
||||||
|
for (; aItS.More(); aItS.Next()) {
|
||||||
|
const TopoDS_Shape& aSx=aItS.Value();
|
||||||
|
aMS.Add(aSx);
|
||||||
|
TopExp::MapShapes(aSx, TopAbs_FACE, aMS);
|
||||||
|
TopExp::MapShapes(aSx, TopAbs_EDGE, aMS);
|
||||||
|
TopExp::MapShapesAndAncestors(aSx, TopAbs_EDGE, TopAbs_FACE, aMEF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//aMS.Add(aShell);
|
||||||
|
TopExp::MapShapes(aShell, TopAbs_FACE, aMS);
|
||||||
|
TopExp::MapShapesAndAncestors(aShell, TopAbs_EDGE, TopAbs_FACE, aMEF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// 2 all faces that are not from aSolid [ aLFP1 ]
|
||||||
|
Standard_Integer aNbEFP;
|
||||||
|
TopTools_IndexedDataMapOfShapeListOfShape aMEFP;
|
||||||
|
TopTools_ListIteratorOfListOfShape aItFP, aItEx;
|
||||||
|
TopTools_MapOfShape aMFence;
|
||||||
|
TopTools_ListOfShape aLFP1, aLFP2, aLFP, aLCBF, aLFIN, aLEx;//*pLFP,
|
||||||
|
//
|
||||||
|
// for all non-solid faces build EF map [ aMEFP ]
|
||||||
|
for (j=1; j<=aNbFaces; ++j) {
|
||||||
|
const TopoDS_Shape& aFace=aMFaces(j);
|
||||||
|
if (!aMS.Contains(aFace)) {
|
||||||
|
TopExp::MapShapesAndAncestors(aFace, TopAbs_EDGE, TopAbs_FACE, aMEFP);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// among all faces from aMEFP select these that have same edges
|
||||||
|
// with the solid (i.e aMEF). These faces will be treated first
|
||||||
|
// to prevent the usage of 3D classifier.
|
||||||
|
// The full list of faces to process is aLFP1.
|
||||||
|
aNbEFP=aMEFP.Extent();
|
||||||
|
for (j=1; j<=aNbEFP; ++j) {
|
||||||
|
const TopoDS_Shape& aE=aMEFP.FindKey(j);
|
||||||
|
//
|
||||||
|
if (aMEF.Contains(aE)) { // !!
|
||||||
|
const TopTools_ListOfShape& aLF=aMEFP(j);
|
||||||
|
aItFP.Initialize(aLF);
|
||||||
|
for (; aItFP.More(); aItFP.Next()) {
|
||||||
|
const TopoDS_Shape& aF=aItFP.Value();
|
||||||
|
if (aMFence.Add(aF)) {
|
||||||
|
aLFP1.Append(aF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
aLEx.Append(aE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aItEx.Initialize(aLEx);
|
||||||
|
for (; aItEx.More(); aItEx.Next()) {
|
||||||
|
const TopoDS_Shape& aE=aItEx.Value();
|
||||||
|
const TopTools_ListOfShape& aLF=aMEFP.FindFromKey(aE);
|
||||||
|
aItFP.Initialize(aLF);
|
||||||
|
for (; aItFP.More(); aItFP.Next()) {
|
||||||
|
const TopoDS_Shape& aF=aItFP.Value();
|
||||||
|
if (aMFence.Add(aF)) {
|
||||||
|
aLFP2.Append(aF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
aLFP1.Append(aLFP2);
|
||||||
|
//==========
|
||||||
|
//
|
||||||
|
// 3 Process faces aLFP1
|
||||||
|
aNbFP=aLFP1.Extent();
|
||||||
|
aItFP.Initialize(aLFP1);
|
||||||
|
for (; aItFP.More(); aItFP.Next()) {
|
||||||
|
const TopoDS_Shape& aSP=aItFP.Value();
|
||||||
|
if (!aMFDone.Add(aSP)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// first face to process
|
||||||
|
aFP=TopoDS::Face(aSP);
|
||||||
|
bIsIN= GEOMAlgo_Tools3D::IsInternalFace(aFP, aSolidSp, aMEF, 1.e-14, aCtx);
|
||||||
|
aState=(bIsIN) ? TopAbs_IN : TopAbs_OUT;
|
||||||
|
//
|
||||||
|
// collect faces to process [ aFP is the first ]
|
||||||
|
aLFP.Clear();
|
||||||
|
aLFP.Append(aFP);
|
||||||
|
aItS.Initialize(aLFP1);
|
||||||
|
for (; aItS.More(); aItS.Next()) {
|
||||||
|
const TopoDS_Shape& aSk=aItS.Value();
|
||||||
|
if (!aMFDone.Contains(aSk)) {
|
||||||
|
aLFP.Append(aSk);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// Connexity Block that spreads from aFP the Bound
|
||||||
|
// or till the end of the block itself
|
||||||
|
aLCBF.Clear();
|
||||||
|
GEOMAlgo_Tools3D::MakeConnexityBlock(aLFP, aMS, aLCBF);
|
||||||
|
//
|
||||||
|
// fill states for the Connexity Block
|
||||||
|
aItS.Initialize(aLCBF);
|
||||||
|
for (; aItS.More(); aItS.Next()) {
|
||||||
|
const TopoDS_Shape& aSx=aItS.Value();
|
||||||
|
aMFDone.Add(aSx);
|
||||||
|
if (aState==TopAbs_IN) {
|
||||||
|
aMFIN.Add(aSx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aNbFPx=aMFDone.Extent();
|
||||||
|
if (aNbFPx==aNbFP) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}//for (; aItFP.More(); aItFP.Next())
|
||||||
|
//
|
||||||
|
// faces Inside aSolid
|
||||||
|
aLFIN.Clear();
|
||||||
|
aNbFIN=aMFIN.Extent();
|
||||||
|
if (aNbFIN || aNbLIF) {
|
||||||
|
for (j=1; j<=aNbFIN; ++j) {
|
||||||
|
const TopoDS_Shape& aFIN=aMFIN(j);
|
||||||
|
aLFIN.Append(aFIN);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aItS.Initialize(aLIF);
|
||||||
|
for (; aItS.More(); aItS.Next()) {
|
||||||
|
const TopoDS_Shape& aFIN=aItS.Value();
|
||||||
|
aLFIN.Append(aFIN);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
myInParts.Add(aSolid, aLFIN);
|
||||||
|
}
|
||||||
|
if (aNbFIN || bHasImage) {
|
||||||
|
myDraftSolids.Add(aSolid, aSolidSp);
|
||||||
|
}
|
||||||
|
}//for (i=1; i<=aNbSolids; ++i) { // next solid
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : BuildSplitSolids
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_Builder::BuildSplitSolids()
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
|
||||||
|
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
|
||||||
|
IntTools_Context& aCtx= pPF->ChangeContext();
|
||||||
|
//
|
||||||
|
Standard_Integer i, aNbS, iErr;
|
||||||
|
TopExp_Explorer aExp;
|
||||||
|
TopTools_ListOfShape aSFS, aLSEmpty;
|
||||||
|
TopTools_MapOfShape aMFence;
|
||||||
|
TopTools_ListIteratorOfListOfShape aIt;
|
||||||
|
GEOMAlgo_BuilderSolid aSB;
|
||||||
|
GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet aItSS;
|
||||||
|
GEOMAlgo_DataMapOfShapeShapeSet aMSS;
|
||||||
|
GEOMAlgo_ShapeSet aSSi;
|
||||||
|
//
|
||||||
|
//modified by NIZNHY-PKV Wed Dec 6 17:08:03 2006f
|
||||||
|
//
|
||||||
|
// 0. Find same domain solids for non-interferred solids
|
||||||
|
aNbS=aDS.NumberOfShapesOfTheObject();
|
||||||
|
for (i=1; i<=aNbS; ++i) {
|
||||||
|
const TopoDS_Shape& aS=aDS.Shape(i);
|
||||||
|
if (aS.ShapeType()!=TopAbs_SOLID) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!aMFence.Add(aS)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if(myDraftSolids.Contains(aS)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aSSi.Clear();
|
||||||
|
aSSi.Add(aS, TopAbs_FACE);
|
||||||
|
//
|
||||||
|
aMSS.Bind(aS, aSSi);
|
||||||
|
} //for (i=1; i<=aNbS; ++i)
|
||||||
|
//
|
||||||
|
//modified by NIZNHY-PKV Wed Dec 6 17:08:09 2006t
|
||||||
|
//
|
||||||
|
// 1. Build solids for interferred source solids
|
||||||
|
//
|
||||||
|
aSB.SetContext(aCtx);
|
||||||
|
aNbS=myDraftSolids.Extent();
|
||||||
|
for (i=1; i<=aNbS; ++i) {
|
||||||
|
const TopoDS_Shape& aS =myDraftSolids.FindKey(i);
|
||||||
|
const TopoDS_Shape& aSD=myDraftSolids.FindFromIndex(i);
|
||||||
|
const TopTools_ListOfShape& aLFIN=
|
||||||
|
(myInParts.Contains(aS)) ? myInParts.FindFromKey(aS) : aLSEmpty;
|
||||||
|
//
|
||||||
|
// 1.1 Fill Shell Faces Set
|
||||||
|
aSFS.Clear();
|
||||||
|
|
||||||
|
aExp.Init(aSD, TopAbs_FACE);
|
||||||
|
for (; aExp.More(); aExp.Next()) {
|
||||||
|
const TopoDS_Shape& aF=aExp.Current();
|
||||||
|
aSFS.Append(aF);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aIt.Initialize(aLFIN);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
TopoDS_Shape aF=aIt.Value();
|
||||||
|
//
|
||||||
|
aF.Orientation(TopAbs_FORWARD);
|
||||||
|
aSFS.Append(aF);
|
||||||
|
aF.Orientation(TopAbs_REVERSED);
|
||||||
|
aSFS.Append(aF);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
Standard_Integer aNbSFS;
|
||||||
|
aNbSFS=aSFS.Extent();
|
||||||
|
//
|
||||||
|
// 1.2
|
||||||
|
// Check whether aSFS contains a subsets of faces
|
||||||
|
// of solids that have been already built.
|
||||||
|
// If yes, shrink aSFS by these subsets.
|
||||||
|
aSSi.Clear();
|
||||||
|
aSSi.Add(aSFS);
|
||||||
|
//
|
||||||
|
aItSS.Initialize(aMSS);
|
||||||
|
for (; aItSS.More(); aItSS.Next()) {
|
||||||
|
const TopoDS_Shape& aSR=aItSS.Key();
|
||||||
|
const GEOMAlgo_ShapeSet& aSSR=aItSS.Value();
|
||||||
|
if (aSSi.Contains(aSSR)) {
|
||||||
|
// the aSR is SD solid for aS
|
||||||
|
aSSi.Subtract(aSSR);
|
||||||
|
// update images
|
||||||
|
if(myImages.HasImage(aS)) {
|
||||||
|
myImages.Add(aS, aSR);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
myImages.Bind(aS, aSR);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// update SD Shapes
|
||||||
|
mySameDomainShapes.Add(aSR, aSR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const TopTools_ListOfShape& aSFS1=aSSi.GetSet();
|
||||||
|
aNbSFS=aSFS1.Extent();
|
||||||
|
//
|
||||||
|
// 1.3 Build new solids
|
||||||
|
aSB.SetShapes(aSFS1);
|
||||||
|
aSB.Perform();
|
||||||
|
iErr=aSB.ErrorStatus();
|
||||||
|
if (iErr) {
|
||||||
|
myErrorStatus=30; // SolidBuilder failed
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
const TopTools_ListOfShape& aLSR=aSB.Areas();
|
||||||
|
//
|
||||||
|
// 1.4 Collect resulting solids and theirs set of faces
|
||||||
|
aIt.Initialize(aLSR);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aSR=aIt.Value();
|
||||||
|
//
|
||||||
|
aSSi.Clear();
|
||||||
|
aExp.Init(aSR, TopAbs_FACE);
|
||||||
|
for (; aExp.More(); aExp.Next()) {
|
||||||
|
const TopoDS_Shape& aF=aExp.Current();
|
||||||
|
aSSi.Add(aF);
|
||||||
|
}
|
||||||
|
aMSS.Bind(aSR, aSSi);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// Update images
|
||||||
|
if (myImages.HasImage(aS)) {
|
||||||
|
myImages.Add(aS, aLSR);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
myImages.Bind(aS, aLSR);
|
||||||
|
}
|
||||||
|
} // for (i=1; i<=aNbS; ++i) {
|
||||||
|
//modified by NIZNHY-PKV Wed Dec 6 17:07:47 2006f
|
||||||
|
/*
|
||||||
|
//
|
||||||
|
// 2. Find same domain solids for non-interferred solids
|
||||||
|
aNbS=aDS.NumberOfShapesOfTheObject();
|
||||||
|
for (i=1; i<=aNbS; ++i) {
|
||||||
|
const TopoDS_Shape& aS=aDS.Shape(i);
|
||||||
|
if (aS.ShapeType()!=TopAbs_SOLID) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!aMFence.Add(aS)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if(myImages.HasImage(aS)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aSSi.Clear();
|
||||||
|
aSSi.Add(aS, TopAbs_FACE);
|
||||||
|
//
|
||||||
|
aItSS.Initialize(aMSS);
|
||||||
|
for (; aItSS.More(); aItSS.Next()) {
|
||||||
|
const TopoDS_Shape& aSR=aItSS.Key();
|
||||||
|
const GEOMAlgo_ShapeSet& aSSR=aItSS.Value();
|
||||||
|
if (aSSi.Contains(aSSR)) {
|
||||||
|
myImages.Bind(aS, aSR);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} //for (i=1; i<=aNbS; ++i)
|
||||||
|
*/
|
||||||
|
//modified by NIZNHY-PKV Wed Dec 6 17:07:55 2006t
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function :FillInternalShapes
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_Builder::FillInternalShapes()
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
|
||||||
|
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
|
||||||
|
IntTools_Context& aCtx= pPF->ChangeContext();
|
||||||
|
//
|
||||||
|
//Standard_Boolean bHasImage;
|
||||||
|
Standard_Integer i, j, jT, aNbS, aNbSI, aNbSx, aNbSd;
|
||||||
|
TopAbs_ShapeEnum aType, aT[]={ TopAbs_VERTEX, TopAbs_EDGE };
|
||||||
|
TopAbs_State aState;
|
||||||
|
TopTools_ListIteratorOfListOfShape aIt, aIt1;
|
||||||
|
TopTools_IndexedDataMapOfShapeListOfShape aMSx;
|
||||||
|
TopTools_IndexedMapOfShape aMx;
|
||||||
|
TopTools_MapOfShape aMSI, aMFence, aMSOr;
|
||||||
|
TopTools_MapIteratorOfMapOfShape aItM;
|
||||||
|
TopTools_ListOfShape aLSI, aLSd;
|
||||||
|
TopoDS_Iterator aItS;
|
||||||
|
BRep_Builder aBB;
|
||||||
|
//
|
||||||
|
// 1. Shapes to process
|
||||||
|
//
|
||||||
|
// 1.1 Shapes from pure arguments aMSI
|
||||||
|
// 1.1.1 vertex, edge
|
||||||
|
for (i=0; i<2; ++i) {
|
||||||
|
jT=(Standard_Integer)aT[i];
|
||||||
|
const TopTools_ListOfShape &aLS=myShapes1[jT];
|
||||||
|
aIt.Initialize(aLS);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aS=aIt.Value();
|
||||||
|
if (aMFence.Add(aS)) {
|
||||||
|
aLSI.Append(aS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 1.1.2 wire
|
||||||
|
{
|
||||||
|
jT=(Standard_Integer)TopAbs_WIRE;
|
||||||
|
const TopTools_ListOfShape &aLW=myShapes1[jT];
|
||||||
|
aIt.Initialize(aLW);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aW=aIt.Value();
|
||||||
|
aItS.Initialize(aW);
|
||||||
|
for (; aItS.More(); aItS.Next()) {
|
||||||
|
const TopoDS_Shape& aE=aItS.Value();
|
||||||
|
if (aMFence.Add(aE)) {
|
||||||
|
aLSI.Append(aE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 1.1.3 theirs images/sources
|
||||||
|
aIt1.Initialize(aLSI);
|
||||||
|
for (; aIt1.More(); aIt1.Next()) {
|
||||||
|
const TopoDS_Shape& aS=aIt1.Value();
|
||||||
|
if (myImages.HasImage(aS)) {
|
||||||
|
const TopTools_ListOfShape &aLSp=myImages.Image(aS);
|
||||||
|
aIt.Initialize(aLSp);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aSI=aIt.Value();
|
||||||
|
aMSI.Add(aSI);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
aMSI.Add(aS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
aLSI.Clear();
|
||||||
|
aNbSI=aMSI.Extent();
|
||||||
|
//
|
||||||
|
// 2. Internal vertices, edges from source solids
|
||||||
|
aMFence.Clear();
|
||||||
|
aLSd.Clear();
|
||||||
|
//
|
||||||
|
aNbS=aDS.NumberOfShapesOfTheObject();
|
||||||
|
for (i=1; i<=aNbS; ++i) {
|
||||||
|
const TopoDS_Shape& aS=aDS.Shape(i);
|
||||||
|
aType=aS.ShapeType();
|
||||||
|
if (aType==TopAbs_SOLID) {
|
||||||
|
//
|
||||||
|
aMx.Clear();
|
||||||
|
OwnInternalShapes(aS, aMx);
|
||||||
|
//
|
||||||
|
aNbSx=aMx.Extent();
|
||||||
|
for (j=1; j<=aNbSx; ++j) {
|
||||||
|
const TopoDS_Shape& aSI=aMx(j);
|
||||||
|
if (myImages.HasImage(aSI)) {
|
||||||
|
const TopTools_ListOfShape &aLSp=myImages.Image(aSI);
|
||||||
|
aIt.Initialize(aLSp);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aSp=aIt.Value();
|
||||||
|
aMSI.Add(aSp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
aMSI.Add(aSI);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// build aux map from splits of solids
|
||||||
|
if (myImages.HasImage(aS)) {
|
||||||
|
const TopTools_ListOfShape &aLSp=myImages.Image(aS);
|
||||||
|
aIt.Initialize(aLSp);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aSp=aIt.Value();
|
||||||
|
if (aMFence.Add(aSp)) {
|
||||||
|
TopExp::MapShapesAndAncestors(aSp, TopAbs_VERTEX, TopAbs_EDGE, aMSx);
|
||||||
|
TopExp::MapShapesAndAncestors(aSp, TopAbs_VERTEX, TopAbs_FACE, aMSx);
|
||||||
|
TopExp::MapShapesAndAncestors(aSp, TopAbs_EDGE , TopAbs_FACE, aMSx);
|
||||||
|
aLSd.Append(aSp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (aMFence.Add(aS)) {
|
||||||
|
TopExp::MapShapesAndAncestors(aS, TopAbs_VERTEX, TopAbs_EDGE, aMSx);
|
||||||
|
TopExp::MapShapesAndAncestors(aS, TopAbs_VERTEX, TopAbs_FACE, aMSx);
|
||||||
|
TopExp::MapShapesAndAncestors(aS, TopAbs_EDGE , TopAbs_FACE, aMSx);
|
||||||
|
aLSd.Append(aS);
|
||||||
|
aMSOr.Add(aS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}//if (aType==TopAbs_SOLID)
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aNbSd=aLSd.Extent();
|
||||||
|
//
|
||||||
|
// 3. Some shapes of aMSI can be already tied with faces of
|
||||||
|
// split solids
|
||||||
|
aItM.Initialize(aMSI);
|
||||||
|
for (; aItM.More(); aItM.Next()) {
|
||||||
|
const TopoDS_Shape& aSI=aItM.Key();
|
||||||
|
if (aMSx.Contains(aSI)) {
|
||||||
|
const TopTools_ListOfShape &aLSx=aMSx.FindFromKey(aSI);
|
||||||
|
aNbSx=aLSx.Extent();
|
||||||
|
if (aNbSx) {
|
||||||
|
aMSI.Remove(aSI);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// 4. Just check it
|
||||||
|
aNbSI=aMSI.Extent();
|
||||||
|
if (!aNbSI) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// 5 Settle internal vertices and edges into solids
|
||||||
|
aMx.Clear();
|
||||||
|
aIt.Initialize(aLSd);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
TopoDS_Solid aSd=TopoDS::Solid(aIt.Value());
|
||||||
|
//
|
||||||
|
aItM.Initialize(aMSI);
|
||||||
|
for (; aItM.More(); aItM.Next()) {
|
||||||
|
TopoDS_Shape aSI=aItM.Key();
|
||||||
|
aSI.Orientation(TopAbs_INTERNAL);
|
||||||
|
//
|
||||||
|
aState=GEOMAlgo_Tools3D::ComputeStateByOnePoint(aSI, aSd, 1.e-11, aCtx);
|
||||||
|
if (aState==TopAbs_IN) {
|
||||||
|
//
|
||||||
|
if(aMSOr.Contains(aSd)) {
|
||||||
|
//
|
||||||
|
TopoDS_Solid aSdx;
|
||||||
|
//
|
||||||
|
aBB.MakeSolid(aSdx);
|
||||||
|
aItS.Initialize(aSd);
|
||||||
|
for (; aItS.More(); aItS.Next()) {
|
||||||
|
const TopoDS_Shape& aSh=aItS.Value();
|
||||||
|
aBB.Add(aSdx, aSh);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aBB.Add(aSdx, aSI);
|
||||||
|
//
|
||||||
|
myImages.Bind(aSd, aSdx);
|
||||||
|
aMSOr.Remove(aSd);
|
||||||
|
aSd=aSdx;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
aBB.Add(aSd, aSI);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aMSI.Remove(aSI);
|
||||||
|
} //if (aState==TopAbs_IN) {
|
||||||
|
}// for (; aItM.More(); aItM.Next()) {
|
||||||
|
}//for (; aIt1.More(); aIt1.Next()) {
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : OwnInternalShapes
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void OwnInternalShapes(const TopoDS_Shape& theS,
|
||||||
|
TopTools_IndexedMapOfShape& theMx)
|
||||||
|
{
|
||||||
|
TopoDS_Iterator aIt;
|
||||||
|
//
|
||||||
|
aIt.Initialize(theS);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aSx=aIt.Value();
|
||||||
|
if (aSx.ShapeType()!=TopAbs_SHELL) {
|
||||||
|
theMx.Add(aSx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// ErrorStatus
|
||||||
|
// 30 - SolidBuilder failed
|
||||||
|
|
316
src/GEOMAlgo/GEOMAlgo_Builder_4.cxx
Executable file
316
src/GEOMAlgo/GEOMAlgo_Builder_4.cxx
Executable file
@ -0,0 +1,316 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
//
|
||||||
|
// File: GEOMAlgo_Builder_4.cxx
|
||||||
|
// Created:
|
||||||
|
// Author: Peter KURNEV
|
||||||
|
|
||||||
|
#include <GEOMAlgo_Builder.hxx>
|
||||||
|
|
||||||
|
#include <TopoDS_Iterator.hxx>
|
||||||
|
|
||||||
|
#include <TopTools_ListOfShape.hxx>
|
||||||
|
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||||
|
#include <TopTools_MapOfShape.hxx>
|
||||||
|
#include <TopTools_MapIteratorOfMapOfShape.hxx>
|
||||||
|
|
||||||
|
#include <IntTools_Context.hxx>
|
||||||
|
|
||||||
|
#include <NMTDS_ShapesDataStructure.hxx>
|
||||||
|
|
||||||
|
#include <NMTTools_PaveFiller.hxx>
|
||||||
|
#include <NMTTools_DSFiller.hxx>
|
||||||
|
|
||||||
|
#include <GEOMAlgo_Tools3D.hxx>
|
||||||
|
|
||||||
|
static
|
||||||
|
void MapShapes(const TopoDS_Shape& aS,
|
||||||
|
TopTools_MapOfShape& aM);
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : Generated
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
const TopTools_ListOfShape& GEOMAlgo_Builder::Generated(const TopoDS_Shape& theS)
|
||||||
|
{
|
||||||
|
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
|
||||||
|
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
|
||||||
|
IntTools_Context& aCtx=pPF->ChangeContext();
|
||||||
|
//
|
||||||
|
Standard_Boolean bHasImage, bToReverse;
|
||||||
|
TopAbs_ShapeEnum aType;
|
||||||
|
TopTools_ListIteratorOfListOfShape aIt;
|
||||||
|
//
|
||||||
|
myHistShapes.Clear();
|
||||||
|
//
|
||||||
|
if (theS.IsNull()) {
|
||||||
|
return myHistShapes;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
bHasImage=myImages.HasImage(theS);
|
||||||
|
if (!bHasImage) {
|
||||||
|
return myHistShapes;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aType=theS.ShapeType();
|
||||||
|
//
|
||||||
|
if (aType==TopAbs_EDGE || aType==TopAbs_FACE ||
|
||||||
|
aType==TopAbs_VERTEX || aType==TopAbs_SOLID) {
|
||||||
|
const TopTools_ListOfShape& aLSp=myImages.Image(theS);
|
||||||
|
aIt.Initialize(aLSp);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aSp=aIt.Value();
|
||||||
|
if (mySameDomainShapes.Contains(aSp)) {
|
||||||
|
if (myMapShape.Contains(aSp)) {
|
||||||
|
TopoDS_Shape aSpR=mySameDomainShapes.FindFromKey(aSp);
|
||||||
|
//
|
||||||
|
if (aType==TopAbs_VERTEX || aType==TopAbs_SOLID) {
|
||||||
|
aSpR.Orientation(theS.Orientation());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
bToReverse=GEOMAlgo_Tools3D::IsSplitToReverse(aSpR, theS, aCtx);
|
||||||
|
if (bToReverse) {
|
||||||
|
aSpR.Reverse();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
myHistShapes.Append(aSpR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
return myHistShapes;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Modified
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
const TopTools_ListOfShape& GEOMAlgo_Builder::Modified(const TopoDS_Shape& theS)
|
||||||
|
{
|
||||||
|
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
|
||||||
|
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
|
||||||
|
IntTools_Context& aCtx=pPF->ChangeContext();
|
||||||
|
//
|
||||||
|
Standard_Boolean bHasImage, bToReverse;
|
||||||
|
TopAbs_ShapeEnum aType;
|
||||||
|
TopTools_ListIteratorOfListOfShape aIt;
|
||||||
|
//
|
||||||
|
myHistShapes.Clear();
|
||||||
|
//
|
||||||
|
if (theS.IsNull()) {
|
||||||
|
return myHistShapes;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
bHasImage=myImages.HasImage(theS);
|
||||||
|
if (!bHasImage) {
|
||||||
|
return myHistShapes;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aType=theS.ShapeType();
|
||||||
|
//
|
||||||
|
if (aType==TopAbs_EDGE || aType==TopAbs_FACE ||
|
||||||
|
aType==TopAbs_VERTEX || aType==TopAbs_SOLID) {
|
||||||
|
const TopTools_ListOfShape& aLSp=myImages.Image(theS);
|
||||||
|
aIt.Initialize(aLSp);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
TopoDS_Shape aSp=aIt.Value();
|
||||||
|
if (!mySameDomainShapes.Contains(aSp)) {
|
||||||
|
if (myMapShape.Contains(aSp)) {
|
||||||
|
//
|
||||||
|
if (aType==TopAbs_VERTEX || aType==TopAbs_SOLID) {
|
||||||
|
aSp.Orientation(theS.Orientation());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
bToReverse=GEOMAlgo_Tools3D::IsSplitToReverse(aSp, theS, aCtx);
|
||||||
|
if (bToReverse) {
|
||||||
|
aSp.Reverse();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
myHistShapes.Append(aSp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
return myHistShapes;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsDeleted
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean GEOMAlgo_Builder::IsDeleted(const TopoDS_Shape& theS)
|
||||||
|
{
|
||||||
|
Standard_Boolean bRet, bHasImage, bContains;
|
||||||
|
TopAbs_ShapeEnum aType;
|
||||||
|
TopTools_ListIteratorOfListOfShape aIt;
|
||||||
|
//
|
||||||
|
bRet=Standard_False;
|
||||||
|
//
|
||||||
|
if (theS.IsNull()) {
|
||||||
|
return !bRet; //true
|
||||||
|
}
|
||||||
|
//
|
||||||
|
bContains=myMapShape.Contains(theS);
|
||||||
|
if (bContains) {
|
||||||
|
return bRet; //false
|
||||||
|
}
|
||||||
|
//
|
||||||
|
bHasImage=myImages.HasImage(theS);
|
||||||
|
if (!bHasImage) {
|
||||||
|
return !bRet; //true
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aType=theS.ShapeType();
|
||||||
|
if (aType==TopAbs_EDGE || aType==TopAbs_FACE ||
|
||||||
|
aType==TopAbs_VERTEX || aType==TopAbs_SOLID) {
|
||||||
|
const TopTools_ListOfShape& aLSp=myImages.Image(theS);
|
||||||
|
aIt.Initialize(aLSp);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
TopoDS_Shape aSp=aIt.Value();
|
||||||
|
//
|
||||||
|
if (!mySameDomainShapes.Contains(aSp)) {
|
||||||
|
if (myMapShape.Contains(aSp)) {
|
||||||
|
return bRet; //false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
TopoDS_Shape aSpR=mySameDomainShapes.FindFromKey(aSp);
|
||||||
|
if (myMapShape.Contains(aSpR)) {
|
||||||
|
return bRet; //false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return !bRet; // true
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : PrepareHistory
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_Builder::PrepareHistory()
|
||||||
|
{
|
||||||
|
if(myShape.IsNull()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
Standard_Boolean bHasImage, bContainsSD;
|
||||||
|
TopAbs_ShapeEnum aType;
|
||||||
|
TopTools_MapOfShape aMS;
|
||||||
|
TopTools_ListIteratorOfListOfShape aIt;
|
||||||
|
TopTools_MapIteratorOfMapOfShape aItM;
|
||||||
|
//
|
||||||
|
// 1. Clearing
|
||||||
|
GEOMAlgo_BuilderShape::PrepareHistory();
|
||||||
|
//
|
||||||
|
// 2. myMapShape - all shapes of result with theirs sub-shapes
|
||||||
|
MapShapes(myShape, myMapShape);
|
||||||
|
//
|
||||||
|
// 3. MS - all argument shapes with theirs sub-shapes
|
||||||
|
aIt.Initialize(myShapes);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aSx=aIt.Value();
|
||||||
|
MapShapes(aSx, aMS);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// 4. Treatment
|
||||||
|
aItM.Initialize(aMS);
|
||||||
|
for (; aItM.More(); aItM.Next()) {
|
||||||
|
const TopoDS_Shape& aSx=aItM.Key();
|
||||||
|
aType=aSx.ShapeType();
|
||||||
|
//modified by NIZNHY-PKV Thu Dec 7 11:34:05 2006f
|
||||||
|
//
|
||||||
|
// 4.1 .myImagesResult
|
||||||
|
TopTools_ListOfShape aLSx;
|
||||||
|
//
|
||||||
|
bHasImage=myImages.HasImage(aSx);
|
||||||
|
if (!bHasImage) {
|
||||||
|
if (myMapShape.Contains(aSx)) {
|
||||||
|
aLSx.Append(aSx);
|
||||||
|
myImagesResult.Add(aSx, aLSx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const TopTools_ListOfShape& aLSp=myImages.Image(aSx);
|
||||||
|
aIt.Initialize(aLSp);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aSp=aIt.Value();
|
||||||
|
if (myMapShape.Contains(aSp)) {
|
||||||
|
aLSx.Append(aSp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
myImagesResult.Add(aSx, aLSx);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
//modified by NIZNHY-PKV Thu Dec 7 11:34:10 2006t
|
||||||
|
//
|
||||||
|
// 4.2 As it was
|
||||||
|
if (!myHasDeleted) {
|
||||||
|
myHasDeleted=IsDeleted(aSx);//xx
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if (!myHasGenerated || !myHasModified) {
|
||||||
|
if (aType==TopAbs_EDGE || aType==TopAbs_FACE ||
|
||||||
|
aType==TopAbs_VERTEX || aType==TopAbs_SOLID) {
|
||||||
|
//modified by NIZNHY-PKV Thu Dec 7 11:53:01 2006f
|
||||||
|
//bHasImage=myImages.HasImage(aSx);
|
||||||
|
//modified by NIZNHY-PKV Thu Dec 7 11:53:04 2006t
|
||||||
|
if (bHasImage) {
|
||||||
|
const TopTools_ListOfShape& aLSp=myImages.Image(aSx);
|
||||||
|
aIt.Initialize(aLSp);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aSp=aIt.Value();
|
||||||
|
//
|
||||||
|
if (myMapShape.Contains(aSp)) {
|
||||||
|
bContainsSD=mySameDomainShapes.Contains(aSp);
|
||||||
|
//
|
||||||
|
if (!myHasGenerated) {
|
||||||
|
if (bContainsSD) {
|
||||||
|
myHasGenerated=Standard_True;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!myHasModified) {
|
||||||
|
if (!bContainsSD) {
|
||||||
|
myHasModified=Standard_True;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} // if (myMapShape.Contains(aSp))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : MapShapes
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void MapShapes(const TopoDS_Shape& theS,
|
||||||
|
TopTools_MapOfShape& theM)
|
||||||
|
{
|
||||||
|
theM.Add(theS);
|
||||||
|
TopoDS_Iterator anIt;
|
||||||
|
anIt.Initialize(theS);
|
||||||
|
for (; anIt.More(); anIt.Next()) {
|
||||||
|
const TopoDS_Shape& aSx=anIt.Value();
|
||||||
|
MapShapes(aSx, theM);
|
||||||
|
}
|
||||||
|
}
|
75
src/GEOMAlgo/GEOMAlgo_Clsf.cdl
Normal file
75
src/GEOMAlgo/GEOMAlgo_Clsf.cdl
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
-- Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
--
|
||||||
|
-- This library is free software; you can redistribute it and/or
|
||||||
|
-- modify it under the terms of the GNU Lesser General Public
|
||||||
|
-- License as published by the Free Software Foundation; either
|
||||||
|
-- version 2.1 of the License.
|
||||||
|
--
|
||||||
|
-- This library is distributed in the hope that it will be useful
|
||||||
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
-- Lesser General Public License for more details.
|
||||||
|
--
|
||||||
|
-- You should have received a copy of the GNU Lesser General Public
|
||||||
|
-- License along with this library; if not, write to the Free Software
|
||||||
|
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
--
|
||||||
|
-- See http:--www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
--
|
||||||
|
-- File: GEOMAlgo_Clsf.cdl
|
||||||
|
-- Created: Wed Nov 22 10:19:29 2006
|
||||||
|
-- Author: Peter KURNEV
|
||||||
|
-- <pkv@irinox>
|
||||||
|
|
||||||
|
|
||||||
|
deferred class Clsf from GEOMAlgo
|
||||||
|
inherits HAlgo from GEOMAlgo
|
||||||
|
|
||||||
|
---Purpose:
|
||||||
|
|
||||||
|
uses
|
||||||
|
State from TopAbs,
|
||||||
|
Pnt from gp,
|
||||||
|
Curve from Geom,
|
||||||
|
Surface from Geom
|
||||||
|
|
||||||
|
--raises
|
||||||
|
|
||||||
|
is
|
||||||
|
Initialize
|
||||||
|
returns mutable Clsf from GEOMAlgo;
|
||||||
|
---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_Clsf();"
|
||||||
|
|
||||||
|
SetPnt(me:mutable;
|
||||||
|
aP:Pnt from gp);
|
||||||
|
|
||||||
|
Pnt(me)
|
||||||
|
returns Pnt from gp;
|
||||||
|
---C++:return const&
|
||||||
|
|
||||||
|
SetTolerance(me:mutable;
|
||||||
|
aT:Real from Standard);
|
||||||
|
|
||||||
|
Tolerance(me)
|
||||||
|
returns Real from Standard;
|
||||||
|
|
||||||
|
State(me)
|
||||||
|
returns State from TopAbs;
|
||||||
|
|
||||||
|
CanBeON(me;
|
||||||
|
aCT:Curve from Geom)
|
||||||
|
returns Boolean from Standard
|
||||||
|
is virtual;
|
||||||
|
|
||||||
|
CanBeON(me;
|
||||||
|
aST:Surface from Geom)
|
||||||
|
returns Boolean from Standard
|
||||||
|
is virtual;
|
||||||
|
|
||||||
|
fields
|
||||||
|
myState :State from TopAbs is protected;
|
||||||
|
myPnt :Pnt from gp is protected;
|
||||||
|
myTolerance:Real from Standard is protected;
|
||||||
|
|
||||||
|
end Clsf;
|
102
src/GEOMAlgo/GEOMAlgo_Clsf.cxx
Normal file
102
src/GEOMAlgo/GEOMAlgo_Clsf.cxx
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
//
|
||||||
|
// File: GEOMAlgo_Classifier.cxx
|
||||||
|
// Created: Wed Nov 22 10:23:04 2006
|
||||||
|
// Author: Peter KURNEV
|
||||||
|
// <pkv@irinox>
|
||||||
|
|
||||||
|
|
||||||
|
#include <GEOMAlgo_Clsf.ixx>
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function :
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
GEOMAlgo_Clsf::GEOMAlgo_Clsf()
|
||||||
|
:
|
||||||
|
GEOMAlgo_HAlgo()
|
||||||
|
{
|
||||||
|
myState=TopAbs_UNKNOWN;
|
||||||
|
myPnt.SetCoord(99.,99.,99.);
|
||||||
|
myTolerance=0.0001;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : ~
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
GEOMAlgo_Clsf::~GEOMAlgo_Clsf()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : SetTolerance
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_Clsf::SetTolerance(const Standard_Real aT)
|
||||||
|
{
|
||||||
|
myTolerance=aT;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Tolerance
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Real GEOMAlgo_Clsf::Tolerance()const
|
||||||
|
{
|
||||||
|
return myTolerance;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : SetPnt
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_Clsf::SetPnt(const gp_Pnt& aP)
|
||||||
|
{
|
||||||
|
myPnt=aP;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Pnt
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
const gp_Pnt& GEOMAlgo_Clsf::Pnt()const
|
||||||
|
{
|
||||||
|
return myPnt;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : State
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
TopAbs_State GEOMAlgo_Clsf::State() const
|
||||||
|
{
|
||||||
|
return myState;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : CanBeON
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean GEOMAlgo_Clsf::CanBeON(const Handle(Geom_Curve)& ) const
|
||||||
|
{
|
||||||
|
return Standard_True;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : CanBeON
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean GEOMAlgo_Clsf::CanBeON(const Handle(Geom_Surface)& ) const
|
||||||
|
{
|
||||||
|
return Standard_True;
|
||||||
|
}
|
130
src/GEOMAlgo/GEOMAlgo_Clsf.hxx
Normal file
130
src/GEOMAlgo/GEOMAlgo_Clsf.hxx
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _GEOMAlgo_Clsf_HeaderFile
|
||||||
|
#define _GEOMAlgo_Clsf_HeaderFile
|
||||||
|
|
||||||
|
#ifndef _Standard_HeaderFile
|
||||||
|
#include <Standard.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Handle_GEOMAlgo_Clsf_HeaderFile
|
||||||
|
#include <Handle_GEOMAlgo_Clsf.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _TopAbs_State_HeaderFile
|
||||||
|
#include <TopAbs_State.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _gp_Pnt_HeaderFile
|
||||||
|
#include <gp_Pnt.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Real_HeaderFile
|
||||||
|
#include <Standard_Real.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_HAlgo_HeaderFile
|
||||||
|
#include <GEOMAlgo_HAlgo.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Boolean_HeaderFile
|
||||||
|
#include <Standard_Boolean.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Handle_Geom_Curve_HeaderFile
|
||||||
|
#include <Handle_Geom_Curve.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Handle_Geom_Surface_HeaderFile
|
||||||
|
#include <Handle_Geom_Surface.hxx>
|
||||||
|
#endif
|
||||||
|
class gp_Pnt;
|
||||||
|
class Geom_Curve;
|
||||||
|
class Geom_Surface;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class GEOMAlgo_Clsf : public GEOMAlgo_HAlgo {
|
||||||
|
|
||||||
|
public:
|
||||||
|
// Methods PUBLIC
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT void SetPnt(const gp_Pnt& aP) ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT const gp_Pnt& Pnt() const;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT void SetTolerance(const Standard_Real aT) ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT Standard_Real Tolerance() const;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT TopAbs_State State() const;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT virtual Standard_Boolean CanBeON(const Handle(Geom_Curve)& aCT) const;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT virtual Standard_Boolean CanBeON(const Handle(Geom_Surface)& aST) const;
|
||||||
|
//Standard_EXPORT ~GEOMAlgo_Clsf();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Type management
|
||||||
|
//
|
||||||
|
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
|
||||||
|
//Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Methods PROTECTED
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT GEOMAlgo_Clsf();
|
||||||
|
Standard_EXPORT virtual ~GEOMAlgo_Clsf();
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PROTECTED
|
||||||
|
//
|
||||||
|
TopAbs_State myState;
|
||||||
|
gp_Pnt myPnt;
|
||||||
|
Standard_Real myTolerance;
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Methods PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// other Inline functions and methods (like "C++: function call" methods)
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
73
src/GEOMAlgo/GEOMAlgo_Clsf.ixx
Normal file
73
src/GEOMAlgo/GEOMAlgo_Clsf.ixx
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#include <GEOMAlgo_Clsf.jxx>
|
||||||
|
|
||||||
|
#ifndef _Standard_TypeMismatch_HeaderFile
|
||||||
|
#include <Standard_TypeMismatch.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//GEOMAlgo_Clsf::~GEOMAlgo_Clsf() {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT Handle_Standard_Type& GEOMAlgo_Clsf_Type_()
|
||||||
|
{
|
||||||
|
|
||||||
|
static Handle_Standard_Type aType1 = STANDARD_TYPE(GEOMAlgo_HAlgo);
|
||||||
|
static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
|
||||||
|
static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
|
||||||
|
|
||||||
|
|
||||||
|
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
|
||||||
|
static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_Clsf",
|
||||||
|
sizeof(GEOMAlgo_Clsf),
|
||||||
|
1,
|
||||||
|
(Standard_Address)_Ancestors,
|
||||||
|
(Standard_Address)NULL);
|
||||||
|
|
||||||
|
return _aType;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// DownCast method
|
||||||
|
// allow safe downcasting
|
||||||
|
//
|
||||||
|
const Handle(GEOMAlgo_Clsf) Handle(GEOMAlgo_Clsf)::DownCast(const Handle(Standard_Transient)& AnObject)
|
||||||
|
{
|
||||||
|
Handle(GEOMAlgo_Clsf) _anOtherObject;
|
||||||
|
|
||||||
|
if (!AnObject.IsNull()) {
|
||||||
|
if (AnObject->IsKind(STANDARD_TYPE(GEOMAlgo_Clsf))) {
|
||||||
|
_anOtherObject = Handle(GEOMAlgo_Clsf)((Handle(GEOMAlgo_Clsf)&)AnObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return _anOtherObject ;
|
||||||
|
}
|
||||||
|
const Handle(Standard_Type)& GEOMAlgo_Clsf::DynamicType() const
|
||||||
|
{
|
||||||
|
return STANDARD_TYPE(GEOMAlgo_Clsf) ;
|
||||||
|
}
|
||||||
|
//Standard_Boolean GEOMAlgo_Clsf::IsKind(const Handle(Standard_Type)& AType) const
|
||||||
|
//{
|
||||||
|
// return (STANDARD_TYPE(GEOMAlgo_Clsf) == AType || GEOMAlgo_HAlgo::IsKind(AType));
|
||||||
|
//}
|
||||||
|
//Handle_GEOMAlgo_Clsf::~Handle_GEOMAlgo_Clsf() {}
|
||||||
|
|
31
src/GEOMAlgo/GEOMAlgo_Clsf.jxx
Normal file
31
src/GEOMAlgo/GEOMAlgo_Clsf.jxx
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _gp_Pnt_HeaderFile
|
||||||
|
#include <gp_Pnt.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Geom_Curve_HeaderFile
|
||||||
|
#include <Geom_Curve.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Geom_Surface_HeaderFile
|
||||||
|
#include <Geom_Surface.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_Clsf_HeaderFile
|
||||||
|
#include <GEOMAlgo_Clsf.hxx>
|
||||||
|
#endif
|
70
src/GEOMAlgo/GEOMAlgo_ClsfBox.cdl
Normal file
70
src/GEOMAlgo/GEOMAlgo_ClsfBox.cdl
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
-- Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
--
|
||||||
|
-- This library is free software; you can redistribute it and/or
|
||||||
|
-- modify it under the terms of the GNU Lesser General Public
|
||||||
|
-- License as published by the Free Software Foundation; either
|
||||||
|
-- version 2.1 of the License.
|
||||||
|
--
|
||||||
|
-- This library is distributed in the hope that it will be useful
|
||||||
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
-- Lesser General Public License for more details.
|
||||||
|
--
|
||||||
|
-- You should have received a copy of the GNU Lesser General Public
|
||||||
|
-- License along with this library; if not, write to the Free Software
|
||||||
|
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
--
|
||||||
|
-- See http:--www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
--
|
||||||
|
-- File: GEOMAlgo_ClsfBox.cdl
|
||||||
|
-- Created: Wed Nov 22 10:19:29 2006
|
||||||
|
-- Author: Peter KURNEV
|
||||||
|
-- <pkv@irinox>
|
||||||
|
|
||||||
|
|
||||||
|
class ClsfBox from GEOMAlgo
|
||||||
|
inherits Clsf from GEOMAlgo
|
||||||
|
|
||||||
|
---Purpose:
|
||||||
|
|
||||||
|
uses
|
||||||
|
Shape from TopoDS,
|
||||||
|
Curve from Geom,
|
||||||
|
Surface from Geom,
|
||||||
|
Surface from GeomAdaptor
|
||||||
|
|
||||||
|
--raises
|
||||||
|
|
||||||
|
is
|
||||||
|
Create
|
||||||
|
returns mutable ClsfBox from GEOMAlgo;
|
||||||
|
---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_ClsfBox();"
|
||||||
|
|
||||||
|
SetBox(me:mutable;
|
||||||
|
aS:Shape from TopoDS);
|
||||||
|
|
||||||
|
Box(me)
|
||||||
|
returns Shape from TopoDS;
|
||||||
|
---C++: return const &
|
||||||
|
|
||||||
|
Perform(me:mutable)
|
||||||
|
is redefined;
|
||||||
|
|
||||||
|
CheckData(me:mutable)
|
||||||
|
is redefined;
|
||||||
|
|
||||||
|
CanBeON(me;
|
||||||
|
aC:Curve from Geom)
|
||||||
|
returns Boolean from Standard
|
||||||
|
is redefined;
|
||||||
|
|
||||||
|
CanBeON(me;
|
||||||
|
aST:Surface from Geom)
|
||||||
|
returns Boolean from Standard
|
||||||
|
is redefined;
|
||||||
|
|
||||||
|
fields
|
||||||
|
myBox : Shape from TopoDS is protected;
|
||||||
|
myGAS : Surface from GeomAdaptor [6] is protected;
|
||||||
|
end ClsfBox;
|
216
src/GEOMAlgo/GEOMAlgo_ClsfBox.cxx
Normal file
216
src/GEOMAlgo/GEOMAlgo_ClsfBox.cxx
Normal file
@ -0,0 +1,216 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
//
|
||||||
|
// File: GEOMAlgo_ClsfSurf.cxx
|
||||||
|
// Created: Wed Nov 22 10:41:47 2006
|
||||||
|
// Author: Peter KURNEV
|
||||||
|
// <pkv@irinox>
|
||||||
|
|
||||||
|
|
||||||
|
#include <GEOMAlgo_ClsfBox.ixx>
|
||||||
|
#include <GeomAbs_SurfaceType.hxx>
|
||||||
|
#include <GEOMAlgo_SurfaceTools.hxx>
|
||||||
|
#include <TopAbs_ShapeEnum.hxx>
|
||||||
|
#include <TopTools_IndexedMapOfShape.hxx>
|
||||||
|
#include <TopExp.hxx>
|
||||||
|
#include <TopoDS_Face.hxx>
|
||||||
|
#include <TopoDS.hxx>
|
||||||
|
#include <Geom_Surface.hxx>
|
||||||
|
#include <BRep_Tool.hxx>
|
||||||
|
#include <Geom_Plane.hxx>
|
||||||
|
#include <gp_Pnt.hxx>
|
||||||
|
#include <gp_Dir.hxx>
|
||||||
|
#include <gp_Pln.hxx>
|
||||||
|
#include <gp_Ax1.hxx>
|
||||||
|
#include <Geom_Plane.hxx>
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function :
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
GEOMAlgo_ClsfBox::GEOMAlgo_ClsfBox()
|
||||||
|
:
|
||||||
|
GEOMAlgo_Clsf()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : ~
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
GEOMAlgo_ClsfBox::~GEOMAlgo_ClsfBox()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : SetBox
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_ClsfBox::SetBox(const TopoDS_Shape& aBox)
|
||||||
|
{
|
||||||
|
myBox=aBox;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Box
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
const TopoDS_Shape& GEOMAlgo_ClsfBox::Box() const
|
||||||
|
{
|
||||||
|
return myBox;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : CheckData
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_ClsfBox::CheckData()
|
||||||
|
{
|
||||||
|
Standard_Integer i, aNbF;
|
||||||
|
TopAbs_ShapeEnum aTypeShape;
|
||||||
|
TopAbs_Orientation aOr;
|
||||||
|
GeomAbs_SurfaceType aType;
|
||||||
|
Handle(Geom_Surface) aS;
|
||||||
|
TopTools_IndexedMapOfShape aMF;
|
||||||
|
//
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
if(myBox.IsNull()) {
|
||||||
|
myErrorStatus=10; // myBox=NULL
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aTypeShape=myBox.ShapeType();
|
||||||
|
if (aTypeShape!=TopAbs_SOLID) {
|
||||||
|
myErrorStatus=11; // unallowed shape type
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
TopExp::MapShapes(myBox, TopAbs_FACE, aMF);
|
||||||
|
aNbF=aMF.Extent();
|
||||||
|
if (aNbF!=6) {
|
||||||
|
myErrorStatus=12; // wrong number of faces
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
for (i=1; i<=aNbF; ++i) {
|
||||||
|
const TopoDS_Face& aF=TopoDS::Face(aMF(i));
|
||||||
|
aOr=aF.Orientation();
|
||||||
|
if (!(aOr==TopAbs_FORWARD || aOr==TopAbs_REVERSED)) {
|
||||||
|
myErrorStatus=12; // unallowed orientation of face
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aS=BRep_Tool::Surface(aF);
|
||||||
|
myGAS[i-1].Load(aS);
|
||||||
|
aType=myGAS[i-1].GetType();
|
||||||
|
if (!aType==GeomAbs_Plane) {
|
||||||
|
myErrorStatus=13; // unallowed surface type
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if(aOr==TopAbs_REVERSED) {
|
||||||
|
gp_Ax1 aAx1;
|
||||||
|
gp_Pln aPln;
|
||||||
|
gp_Pnt aP;
|
||||||
|
gp_Dir aD;
|
||||||
|
Handle(Geom_Plane) aSR;
|
||||||
|
//
|
||||||
|
aPln=myGAS[i-1].Plane();
|
||||||
|
aAx1=aPln.Axis();
|
||||||
|
aP=aAx1.Location();
|
||||||
|
aD=aAx1.Direction();
|
||||||
|
aD.Reverse();
|
||||||
|
aSR=new Geom_Plane(aP, aD);
|
||||||
|
myGAS[i-1].Load(aSR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Perform
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_ClsfBox::Perform()
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
const Standard_Integer aNbS=6;
|
||||||
|
Standard_Integer i, aNbON, aNbIN, iNext;
|
||||||
|
TopAbs_State aSt;
|
||||||
|
/*
|
||||||
|
CheckData();
|
||||||
|
if(myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
iNext=1;
|
||||||
|
aNbON=0;
|
||||||
|
aNbIN=0;
|
||||||
|
for(i=0; i<aNbS && iNext; i++) {
|
||||||
|
GEOMAlgo_SurfaceTools::GetState(myPnt, myGAS[i], myTolerance, aSt);
|
||||||
|
//
|
||||||
|
switch (aSt) {
|
||||||
|
case TopAbs_OUT:
|
||||||
|
myState=aSt;
|
||||||
|
iNext=0;
|
||||||
|
break;
|
||||||
|
case TopAbs_ON:
|
||||||
|
++aNbON;
|
||||||
|
break;
|
||||||
|
case TopAbs_IN:
|
||||||
|
++aNbIN;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
myState=TopAbs_UNKNOWN;
|
||||||
|
iNext=0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if (iNext) {
|
||||||
|
myState=TopAbs_UNKNOWN;
|
||||||
|
//
|
||||||
|
if (aNbON && aNbIN) {
|
||||||
|
myState=TopAbs_ON;
|
||||||
|
}
|
||||||
|
else if (aNbIN==aNbS){
|
||||||
|
myState=TopAbs_IN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : CanBeON
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean GEOMAlgo_ClsfBox::CanBeON(const Handle(Geom_Curve)& aC) const
|
||||||
|
{
|
||||||
|
return GEOMAlgo_Clsf::CanBeON(aC);
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : CanBeON
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean GEOMAlgo_ClsfBox::CanBeON(const Handle(Geom_Surface)& aS1) const
|
||||||
|
{
|
||||||
|
Standard_Boolean bRet;
|
||||||
|
GeomAbs_SurfaceType aST1;
|
||||||
|
GeomAdaptor_Surface aGAS1;
|
||||||
|
//
|
||||||
|
aGAS1.Load(aS1);
|
||||||
|
aST1=aGAS1.GetType();
|
||||||
|
bRet=(aST1==GeomAbs_Plane);
|
||||||
|
//
|
||||||
|
return bRet;
|
||||||
|
}
|
123
src/GEOMAlgo/GEOMAlgo_ClsfBox.hxx
Normal file
123
src/GEOMAlgo/GEOMAlgo_ClsfBox.hxx
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _GEOMAlgo_ClsfBox_HeaderFile
|
||||||
|
#define _GEOMAlgo_ClsfBox_HeaderFile
|
||||||
|
|
||||||
|
#ifndef _Standard_HeaderFile
|
||||||
|
#include <Standard.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Handle_GEOMAlgo_ClsfBox_HeaderFile
|
||||||
|
#include <Handle_GEOMAlgo_ClsfBox.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _TopoDS_Shape_HeaderFile
|
||||||
|
#include <TopoDS_Shape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GeomAdaptor_Surface_HeaderFile
|
||||||
|
#include <GeomAdaptor_Surface.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_Clsf_HeaderFile
|
||||||
|
#include <GEOMAlgo_Clsf.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Boolean_HeaderFile
|
||||||
|
#include <Standard_Boolean.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Handle_Geom_Curve_HeaderFile
|
||||||
|
#include <Handle_Geom_Curve.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Handle_Geom_Surface_HeaderFile
|
||||||
|
#include <Handle_Geom_Surface.hxx>
|
||||||
|
#endif
|
||||||
|
class TopoDS_Shape;
|
||||||
|
class Geom_Curve;
|
||||||
|
class Geom_Surface;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class GEOMAlgo_ClsfBox : public GEOMAlgo_Clsf {
|
||||||
|
|
||||||
|
public:
|
||||||
|
// Methods PUBLIC
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT GEOMAlgo_ClsfBox();
|
||||||
|
Standard_EXPORT virtual ~GEOMAlgo_ClsfBox();
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT void SetBox(const TopoDS_Shape& aS) ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT const TopoDS_Shape& Box() const;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT virtual void Perform() ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT virtual void CheckData() ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT virtual Standard_Boolean CanBeON(const Handle(Geom_Curve)& aC) const;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT virtual Standard_Boolean CanBeON(const Handle(Geom_Surface)& aST) const;
|
||||||
|
//Standard_EXPORT ~GEOMAlgo_ClsfBox();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Type management
|
||||||
|
//
|
||||||
|
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
|
||||||
|
//Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Methods PROTECTED
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PROTECTED
|
||||||
|
//
|
||||||
|
TopoDS_Shape myBox;
|
||||||
|
GeomAdaptor_Surface myGAS[6];
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Methods PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// other Inline functions and methods (like "C++: function call" methods)
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
74
src/GEOMAlgo/GEOMAlgo_ClsfBox.ixx
Normal file
74
src/GEOMAlgo/GEOMAlgo_ClsfBox.ixx
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#include <GEOMAlgo_ClsfBox.jxx>
|
||||||
|
|
||||||
|
#ifndef _Standard_TypeMismatch_HeaderFile
|
||||||
|
#include <Standard_TypeMismatch.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//GEOMAlgo_ClsfBox::~GEOMAlgo_ClsfBox() {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT Handle_Standard_Type& GEOMAlgo_ClsfBox_Type_()
|
||||||
|
{
|
||||||
|
|
||||||
|
static Handle_Standard_Type aType1 = STANDARD_TYPE(GEOMAlgo_Clsf);
|
||||||
|
static Handle_Standard_Type aType2 = STANDARD_TYPE(GEOMAlgo_HAlgo);
|
||||||
|
static Handle_Standard_Type aType3 = STANDARD_TYPE(MMgt_TShared);
|
||||||
|
static Handle_Standard_Type aType4 = STANDARD_TYPE(Standard_Transient);
|
||||||
|
|
||||||
|
|
||||||
|
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,NULL};
|
||||||
|
static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_ClsfBox",
|
||||||
|
sizeof(GEOMAlgo_ClsfBox),
|
||||||
|
1,
|
||||||
|
(Standard_Address)_Ancestors,
|
||||||
|
(Standard_Address)NULL);
|
||||||
|
|
||||||
|
return _aType;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// DownCast method
|
||||||
|
// allow safe downcasting
|
||||||
|
//
|
||||||
|
const Handle(GEOMAlgo_ClsfBox) Handle(GEOMAlgo_ClsfBox)::DownCast(const Handle(Standard_Transient)& AnObject)
|
||||||
|
{
|
||||||
|
Handle(GEOMAlgo_ClsfBox) _anOtherObject;
|
||||||
|
|
||||||
|
if (!AnObject.IsNull()) {
|
||||||
|
if (AnObject->IsKind(STANDARD_TYPE(GEOMAlgo_ClsfBox))) {
|
||||||
|
_anOtherObject = Handle(GEOMAlgo_ClsfBox)((Handle(GEOMAlgo_ClsfBox)&)AnObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return _anOtherObject ;
|
||||||
|
}
|
||||||
|
const Handle(Standard_Type)& GEOMAlgo_ClsfBox::DynamicType() const
|
||||||
|
{
|
||||||
|
return STANDARD_TYPE(GEOMAlgo_ClsfBox) ;
|
||||||
|
}
|
||||||
|
//Standard_Boolean GEOMAlgo_ClsfBox::IsKind(const Handle(Standard_Type)& AType) const
|
||||||
|
//{
|
||||||
|
// return (STANDARD_TYPE(GEOMAlgo_ClsfBox) == AType || GEOMAlgo_Clsf::IsKind(AType));
|
||||||
|
//}
|
||||||
|
//Handle_GEOMAlgo_ClsfBox::~Handle_GEOMAlgo_ClsfBox() {}
|
||||||
|
|
31
src/GEOMAlgo/GEOMAlgo_ClsfBox.jxx
Normal file
31
src/GEOMAlgo/GEOMAlgo_ClsfBox.jxx
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _TopoDS_Shape_HeaderFile
|
||||||
|
#include <TopoDS_Shape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Geom_Curve_HeaderFile
|
||||||
|
#include <Geom_Curve.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Geom_Surface_HeaderFile
|
||||||
|
#include <Geom_Surface.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_ClsfBox_HeaderFile
|
||||||
|
#include <GEOMAlgo_ClsfBox.hxx>
|
||||||
|
#endif
|
70
src/GEOMAlgo/GEOMAlgo_ClsfSurf.cdl
Normal file
70
src/GEOMAlgo/GEOMAlgo_ClsfSurf.cdl
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
-- Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
--
|
||||||
|
-- This library is free software; you can redistribute it and/or
|
||||||
|
-- modify it under the terms of the GNU Lesser General Public
|
||||||
|
-- License as published by the Free Software Foundation; either
|
||||||
|
-- version 2.1 of the License.
|
||||||
|
--
|
||||||
|
-- This library is distributed in the hope that it will be useful
|
||||||
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
-- Lesser General Public License for more details.
|
||||||
|
--
|
||||||
|
-- You should have received a copy of the GNU Lesser General Public
|
||||||
|
-- License along with this library; if not, write to the Free Software
|
||||||
|
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
--
|
||||||
|
-- See http:--www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
--
|
||||||
|
-- File: GEOMAlgo_ClsfSurf.cdl
|
||||||
|
-- Created: Wed Nov 22 10:19:29 2006
|
||||||
|
-- Author: Peter KURNEV
|
||||||
|
-- <pkv@irinox>
|
||||||
|
|
||||||
|
|
||||||
|
class ClsfSurf from GEOMAlgo
|
||||||
|
inherits Clsf from GEOMAlgo
|
||||||
|
|
||||||
|
---Purpose:
|
||||||
|
|
||||||
|
uses
|
||||||
|
Curve from Geom,
|
||||||
|
Surface from Geom,
|
||||||
|
Surface from GeomAdaptor
|
||||||
|
|
||||||
|
--raises
|
||||||
|
|
||||||
|
is
|
||||||
|
Create
|
||||||
|
returns mutable ClsfSurf from GEOMAlgo;
|
||||||
|
---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_ClsfSurf();"
|
||||||
|
|
||||||
|
SetSurface(me:mutable;
|
||||||
|
aS:Surface from Geom);
|
||||||
|
|
||||||
|
Surface(me)
|
||||||
|
returns Surface from Geom;
|
||||||
|
---C++: return const &
|
||||||
|
|
||||||
|
Perform(me:mutable)
|
||||||
|
is redefined;
|
||||||
|
|
||||||
|
CheckData(me:mutable)
|
||||||
|
is redefined;
|
||||||
|
|
||||||
|
CanBeON(me;
|
||||||
|
aC:Curve from Geom)
|
||||||
|
returns Boolean from Standard
|
||||||
|
is redefined;
|
||||||
|
|
||||||
|
CanBeON(me;
|
||||||
|
aST:Surface from Geom)
|
||||||
|
returns Boolean from Standard
|
||||||
|
is redefined;
|
||||||
|
|
||||||
|
fields
|
||||||
|
myS : Surface from Geom is protected;
|
||||||
|
myGAS : Surface from GeomAdaptor is protected;
|
||||||
|
|
||||||
|
end ClsfSurf;
|
136
src/GEOMAlgo/GEOMAlgo_ClsfSurf.cxx
Normal file
136
src/GEOMAlgo/GEOMAlgo_ClsfSurf.cxx
Normal file
@ -0,0 +1,136 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
//
|
||||||
|
// File: GEOMAlgo_ClsfSurf.cxx
|
||||||
|
// Created: Wed Nov 22 10:41:47 2006
|
||||||
|
// Author: Peter KURNEV
|
||||||
|
// <pkv@irinox>
|
||||||
|
|
||||||
|
|
||||||
|
#include <GEOMAlgo_ClsfSurf.ixx>
|
||||||
|
#include <GeomAbs_SurfaceType.hxx>
|
||||||
|
#include <GEOMAlgo_SurfaceTools.hxx>
|
||||||
|
#include <GeomAdaptor_Curve.hxx>
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function :
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
GEOMAlgo_ClsfSurf::GEOMAlgo_ClsfSurf()
|
||||||
|
:
|
||||||
|
GEOMAlgo_Clsf()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : ~
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
GEOMAlgo_ClsfSurf::~GEOMAlgo_ClsfSurf()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : SetSurface
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_ClsfSurf::SetSurface(const Handle(Geom_Surface)& aS)
|
||||||
|
{
|
||||||
|
myS=aS;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Surface
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
const Handle(Geom_Surface)& GEOMAlgo_ClsfSurf::Surface() const
|
||||||
|
{
|
||||||
|
return myS;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : CheckData
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_ClsfSurf::CheckData()
|
||||||
|
{
|
||||||
|
GeomAbs_SurfaceType aType;
|
||||||
|
//
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
if(myS.IsNull()) {
|
||||||
|
myErrorStatus=10; // mySurface=NULL
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
myGAS.Load(myS);
|
||||||
|
aType=myGAS.GetType();
|
||||||
|
if (!(aType==GeomAbs_Plane ||
|
||||||
|
aType==GeomAbs_Cylinder ||
|
||||||
|
aType==GeomAbs_Sphere)) {
|
||||||
|
myErrorStatus=11; // unallowed surface type
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Perform
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_ClsfSurf::Perform()
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
/*
|
||||||
|
CheckData();
|
||||||
|
if(myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
GEOMAlgo_SurfaceTools::GetState(myPnt, myGAS, myTolerance, myState);
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : CanBeON
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean GEOMAlgo_ClsfSurf::CanBeON(const Handle(Geom_Curve)& aC) const
|
||||||
|
{
|
||||||
|
GeomAbs_SurfaceType aST;
|
||||||
|
GeomAbs_CurveType aCT;
|
||||||
|
GeomAdaptor_Curve aGAC;
|
||||||
|
//
|
||||||
|
aGAC.Load(aC);
|
||||||
|
aCT=aGAC.GetType();
|
||||||
|
//
|
||||||
|
aST=myGAS.GetType();
|
||||||
|
if (aCT==GeomAbs_Line && aST==GeomAbs_Sphere) {
|
||||||
|
return Standard_False;
|
||||||
|
}
|
||||||
|
return Standard_True;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : CanBeON
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean GEOMAlgo_ClsfSurf::CanBeON(const Handle(Geom_Surface)& aS1) const
|
||||||
|
{
|
||||||
|
Standard_Boolean bRet;
|
||||||
|
GeomAbs_SurfaceType aST, aST1;
|
||||||
|
GeomAdaptor_Surface aGAS1;
|
||||||
|
//
|
||||||
|
aST=myGAS.GetType();
|
||||||
|
aGAS1.Load(aS1);
|
||||||
|
aST1=aGAS1.GetType();
|
||||||
|
bRet=(aST1==aST);
|
||||||
|
//
|
||||||
|
return bRet;
|
||||||
|
}
|
119
src/GEOMAlgo/GEOMAlgo_ClsfSurf.hxx
Normal file
119
src/GEOMAlgo/GEOMAlgo_ClsfSurf.hxx
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _GEOMAlgo_ClsfSurf_HeaderFile
|
||||||
|
#define _GEOMAlgo_ClsfSurf_HeaderFile
|
||||||
|
|
||||||
|
#ifndef _Standard_HeaderFile
|
||||||
|
#include <Standard.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Handle_GEOMAlgo_ClsfSurf_HeaderFile
|
||||||
|
#include <Handle_GEOMAlgo_ClsfSurf.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _Handle_Geom_Surface_HeaderFile
|
||||||
|
#include <Handle_Geom_Surface.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GeomAdaptor_Surface_HeaderFile
|
||||||
|
#include <GeomAdaptor_Surface.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_Clsf_HeaderFile
|
||||||
|
#include <GEOMAlgo_Clsf.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Boolean_HeaderFile
|
||||||
|
#include <Standard_Boolean.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Handle_Geom_Curve_HeaderFile
|
||||||
|
#include <Handle_Geom_Curve.hxx>
|
||||||
|
#endif
|
||||||
|
class Geom_Surface;
|
||||||
|
class Geom_Curve;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class GEOMAlgo_ClsfSurf : public GEOMAlgo_Clsf {
|
||||||
|
|
||||||
|
public:
|
||||||
|
// Methods PUBLIC
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT GEOMAlgo_ClsfSurf();
|
||||||
|
Standard_EXPORT virtual ~GEOMAlgo_ClsfSurf();
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT void SetSurface(const Handle(Geom_Surface)& aS) ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT const Handle_Geom_Surface& Surface() const;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT virtual void Perform() ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT virtual void CheckData() ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT virtual Standard_Boolean CanBeON(const Handle(Geom_Curve)& aC) const;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT virtual Standard_Boolean CanBeON(const Handle(Geom_Surface)& aST) const;
|
||||||
|
//Standard_EXPORT ~GEOMAlgo_ClsfSurf();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Type management
|
||||||
|
//
|
||||||
|
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
|
||||||
|
//Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Methods PROTECTED
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PROTECTED
|
||||||
|
//
|
||||||
|
Handle_Geom_Surface myS;
|
||||||
|
GeomAdaptor_Surface myGAS;
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Methods PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// other Inline functions and methods (like "C++: function call" methods)
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
74
src/GEOMAlgo/GEOMAlgo_ClsfSurf.ixx
Normal file
74
src/GEOMAlgo/GEOMAlgo_ClsfSurf.ixx
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#include <GEOMAlgo_ClsfSurf.jxx>
|
||||||
|
|
||||||
|
#ifndef _Standard_TypeMismatch_HeaderFile
|
||||||
|
#include <Standard_TypeMismatch.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//GEOMAlgo_ClsfSurf::~GEOMAlgo_ClsfSurf() {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT Handle_Standard_Type& GEOMAlgo_ClsfSurf_Type_()
|
||||||
|
{
|
||||||
|
|
||||||
|
static Handle_Standard_Type aType1 = STANDARD_TYPE(GEOMAlgo_Clsf);
|
||||||
|
static Handle_Standard_Type aType2 = STANDARD_TYPE(GEOMAlgo_HAlgo);
|
||||||
|
static Handle_Standard_Type aType3 = STANDARD_TYPE(MMgt_TShared);
|
||||||
|
static Handle_Standard_Type aType4 = STANDARD_TYPE(Standard_Transient);
|
||||||
|
|
||||||
|
|
||||||
|
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,NULL};
|
||||||
|
static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_ClsfSurf",
|
||||||
|
sizeof(GEOMAlgo_ClsfSurf),
|
||||||
|
1,
|
||||||
|
(Standard_Address)_Ancestors,
|
||||||
|
(Standard_Address)NULL);
|
||||||
|
|
||||||
|
return _aType;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// DownCast method
|
||||||
|
// allow safe downcasting
|
||||||
|
//
|
||||||
|
const Handle(GEOMAlgo_ClsfSurf) Handle(GEOMAlgo_ClsfSurf)::DownCast(const Handle(Standard_Transient)& AnObject)
|
||||||
|
{
|
||||||
|
Handle(GEOMAlgo_ClsfSurf) _anOtherObject;
|
||||||
|
|
||||||
|
if (!AnObject.IsNull()) {
|
||||||
|
if (AnObject->IsKind(STANDARD_TYPE(GEOMAlgo_ClsfSurf))) {
|
||||||
|
_anOtherObject = Handle(GEOMAlgo_ClsfSurf)((Handle(GEOMAlgo_ClsfSurf)&)AnObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return _anOtherObject ;
|
||||||
|
}
|
||||||
|
const Handle(Standard_Type)& GEOMAlgo_ClsfSurf::DynamicType() const
|
||||||
|
{
|
||||||
|
return STANDARD_TYPE(GEOMAlgo_ClsfSurf) ;
|
||||||
|
}
|
||||||
|
//Standard_Boolean GEOMAlgo_ClsfSurf::IsKind(const Handle(Standard_Type)& AType) const
|
||||||
|
//{
|
||||||
|
// return (STANDARD_TYPE(GEOMAlgo_ClsfSurf) == AType || GEOMAlgo_Clsf::IsKind(AType));
|
||||||
|
//}
|
||||||
|
//Handle_GEOMAlgo_ClsfSurf::~Handle_GEOMAlgo_ClsfSurf() {}
|
||||||
|
|
28
src/GEOMAlgo/GEOMAlgo_ClsfSurf.jxx
Normal file
28
src/GEOMAlgo/GEOMAlgo_ClsfSurf.jxx
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _Geom_Surface_HeaderFile
|
||||||
|
#include <Geom_Surface.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Geom_Curve_HeaderFile
|
||||||
|
#include <Geom_Curve.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_ClsfSurf_HeaderFile
|
||||||
|
#include <GEOMAlgo_ClsfSurf.hxx>
|
||||||
|
#endif
|
@ -0,0 +1,115 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape_HeaderFile
|
||||||
|
#define _GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape_HeaderFile
|
||||||
|
|
||||||
|
#ifndef _TCollection_BasicMapIterator_HeaderFile
|
||||||
|
#include <TCollection_BasicMapIterator.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Real_HeaderFile
|
||||||
|
#include <Standard_Real.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape_HeaderFile
|
||||||
|
#include <Handle_GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape.hxx>
|
||||||
|
#endif
|
||||||
|
class Standard_NoSuchObject;
|
||||||
|
class TopTools_ListOfShape;
|
||||||
|
class TColStd_MapRealHasher;
|
||||||
|
class GEOMAlgo_DataMapOfRealListOfShape;
|
||||||
|
class GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape;
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _Standard_HeaderFile
|
||||||
|
#include <Standard.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Macro_HeaderFile
|
||||||
|
#include <Standard_Macro.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
class GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape : public TCollection_BasicMapIterator {
|
||||||
|
|
||||||
|
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 GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape();
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape(const GEOMAlgo_DataMapOfRealListOfShape& aMap);
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT void Initialize(const GEOMAlgo_DataMapOfRealListOfShape& aMap) ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT const Standard_Real& Key() const;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT const TopTools_ListOfShape& Value() const;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Methods PROTECTED
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PROTECTED
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Methods PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// other Inline functions and methods (like "C++: function call" methods)
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,54 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#include <GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape.hxx>
|
||||||
|
|
||||||
|
#ifndef _Standard_NoSuchObject_HeaderFile
|
||||||
|
#include <Standard_NoSuchObject.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopTools_ListOfShape_HeaderFile
|
||||||
|
#include <TopTools_ListOfShape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TColStd_MapRealHasher_HeaderFile
|
||||||
|
#include <TColStd_MapRealHasher.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_DataMapOfRealListOfShape_HeaderFile
|
||||||
|
#include <GEOMAlgo_DataMapOfRealListOfShape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape_HeaderFile
|
||||||
|
#include <GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#define TheKey Standard_Real
|
||||||
|
#define TheKey_hxx <Standard_Real.hxx>
|
||||||
|
#define TheItem TopTools_ListOfShape
|
||||||
|
#define TheItem_hxx <TopTools_ListOfShape.hxx>
|
||||||
|
#define Hasher TColStd_MapRealHasher
|
||||||
|
#define Hasher_hxx <TColStd_MapRealHasher.hxx>
|
||||||
|
#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape
|
||||||
|
#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape.hxx>
|
||||||
|
#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape
|
||||||
|
#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape.hxx>
|
||||||
|
#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape
|
||||||
|
#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape_Type_()
|
||||||
|
#define TCollection_DataMap GEOMAlgo_DataMapOfRealListOfShape
|
||||||
|
#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfRealListOfShape.hxx>
|
||||||
|
#include <TCollection_DataMapIterator.gxx>
|
||||||
|
|
115
src/GEOMAlgo/GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal.hxx
Normal file
115
src/GEOMAlgo/GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal.hxx
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal_HeaderFile
|
||||||
|
#define _GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal_HeaderFile
|
||||||
|
|
||||||
|
#ifndef _TCollection_BasicMapIterator_HeaderFile
|
||||||
|
#include <TCollection_BasicMapIterator.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Real_HeaderFile
|
||||||
|
#include <Standard_Real.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeReal_HeaderFile
|
||||||
|
#include <Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeReal.hxx>
|
||||||
|
#endif
|
||||||
|
class Standard_NoSuchObject;
|
||||||
|
class TopoDS_Shape;
|
||||||
|
class TopTools_ShapeMapHasher;
|
||||||
|
class GEOMAlgo_DataMapOfShapeReal;
|
||||||
|
class GEOMAlgo_DataMapNodeOfDataMapOfShapeReal;
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _Standard_HeaderFile
|
||||||
|
#include <Standard.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Macro_HeaderFile
|
||||||
|
#include <Standard_Macro.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
class GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal : public TCollection_BasicMapIterator {
|
||||||
|
|
||||||
|
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 GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal();
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal(const GEOMAlgo_DataMapOfShapeReal& aMap);
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT void Initialize(const GEOMAlgo_DataMapOfShapeReal& aMap) ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT const TopoDS_Shape& Key() const;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT const Standard_Real& Value() const;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Methods PROTECTED
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PROTECTED
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Methods PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// other Inline functions and methods (like "C++: function call" methods)
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,54 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#include <GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal.hxx>
|
||||||
|
|
||||||
|
#ifndef _Standard_NoSuchObject_HeaderFile
|
||||||
|
#include <Standard_NoSuchObject.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopoDS_Shape_HeaderFile
|
||||||
|
#include <TopoDS_Shape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopTools_ShapeMapHasher_HeaderFile
|
||||||
|
#include <TopTools_ShapeMapHasher.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_DataMapOfShapeReal_HeaderFile
|
||||||
|
#include <GEOMAlgo_DataMapOfShapeReal.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_DataMapNodeOfDataMapOfShapeReal_HeaderFile
|
||||||
|
#include <GEOMAlgo_DataMapNodeOfDataMapOfShapeReal.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#define TheKey TopoDS_Shape
|
||||||
|
#define TheKey_hxx <TopoDS_Shape.hxx>
|
||||||
|
#define TheItem Standard_Real
|
||||||
|
#define TheItem_hxx <Standard_Real.hxx>
|
||||||
|
#define Hasher TopTools_ShapeMapHasher
|
||||||
|
#define Hasher_hxx <TopTools_ShapeMapHasher.hxx>
|
||||||
|
#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfShapeReal
|
||||||
|
#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfShapeReal.hxx>
|
||||||
|
#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal
|
||||||
|
#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal.hxx>
|
||||||
|
#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeReal
|
||||||
|
#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfShapeReal_Type_()
|
||||||
|
#define TCollection_DataMap GEOMAlgo_DataMapOfShapeReal
|
||||||
|
#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfShapeReal.hxx>
|
||||||
|
#include <TCollection_DataMapIterator.gxx>
|
||||||
|
|
@ -0,0 +1,113 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet_HeaderFile
|
||||||
|
#define _GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet_HeaderFile
|
||||||
|
|
||||||
|
#ifndef _TCollection_BasicMapIterator_HeaderFile
|
||||||
|
#include <TCollection_BasicMapIterator.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet_HeaderFile
|
||||||
|
#include <Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet.hxx>
|
||||||
|
#endif
|
||||||
|
class Standard_NoSuchObject;
|
||||||
|
class TopoDS_Shape;
|
||||||
|
class GEOMAlgo_ShapeSet;
|
||||||
|
class TopTools_ShapeMapHasher;
|
||||||
|
class GEOMAlgo_DataMapOfShapeShapeSet;
|
||||||
|
class GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet;
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _Standard_HeaderFile
|
||||||
|
#include <Standard.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Macro_HeaderFile
|
||||||
|
#include <Standard_Macro.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
class GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet : public TCollection_BasicMapIterator {
|
||||||
|
|
||||||
|
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 GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet();
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet(const GEOMAlgo_DataMapOfShapeShapeSet& aMap);
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT void Initialize(const GEOMAlgo_DataMapOfShapeShapeSet& aMap) ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT const TopoDS_Shape& Key() const;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT const GEOMAlgo_ShapeSet& Value() const;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Methods PROTECTED
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PROTECTED
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Methods PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// other Inline functions and methods (like "C++: function call" methods)
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,57 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#include <GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet.hxx>
|
||||||
|
|
||||||
|
#ifndef _Standard_NoSuchObject_HeaderFile
|
||||||
|
#include <Standard_NoSuchObject.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopoDS_Shape_HeaderFile
|
||||||
|
#include <TopoDS_Shape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_ShapeSet_HeaderFile
|
||||||
|
#include <GEOMAlgo_ShapeSet.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopTools_ShapeMapHasher_HeaderFile
|
||||||
|
#include <TopTools_ShapeMapHasher.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_DataMapOfShapeShapeSet_HeaderFile
|
||||||
|
#include <GEOMAlgo_DataMapOfShapeShapeSet.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet_HeaderFile
|
||||||
|
#include <GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#define TheKey TopoDS_Shape
|
||||||
|
#define TheKey_hxx <TopoDS_Shape.hxx>
|
||||||
|
#define TheItem GEOMAlgo_ShapeSet
|
||||||
|
#define TheItem_hxx <GEOMAlgo_ShapeSet.hxx>
|
||||||
|
#define Hasher TopTools_ShapeMapHasher
|
||||||
|
#define Hasher_hxx <TopTools_ShapeMapHasher.hxx>
|
||||||
|
#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet
|
||||||
|
#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet.hxx>
|
||||||
|
#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet
|
||||||
|
#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet.hxx>
|
||||||
|
#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet
|
||||||
|
#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet_Type_()
|
||||||
|
#define TCollection_DataMap GEOMAlgo_DataMapOfShapeShapeSet
|
||||||
|
#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfShapeShapeSet.hxx>
|
||||||
|
#include <TCollection_DataMapIterator.gxx>
|
||||||
|
|
131
src/GEOMAlgo/GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape.hxx
Normal file
131
src/GEOMAlgo/GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape.hxx
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape_HeaderFile
|
||||||
|
#define _GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape_HeaderFile
|
||||||
|
|
||||||
|
#ifndef _Standard_HeaderFile
|
||||||
|
#include <Standard.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape_HeaderFile
|
||||||
|
#include <Handle_GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _Standard_Real_HeaderFile
|
||||||
|
#include <Standard_Real.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopTools_ListOfShape_HeaderFile
|
||||||
|
#include <TopTools_ListOfShape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TCollection_MapNode_HeaderFile
|
||||||
|
#include <TCollection_MapNode.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TCollection_MapNodePtr_HeaderFile
|
||||||
|
#include <TCollection_MapNodePtr.hxx>
|
||||||
|
#endif
|
||||||
|
class TopTools_ListOfShape;
|
||||||
|
class TColStd_MapRealHasher;
|
||||||
|
class GEOMAlgo_DataMapOfRealListOfShape;
|
||||||
|
class GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape : public TCollection_MapNode {
|
||||||
|
|
||||||
|
public:
|
||||||
|
// Methods PUBLIC
|
||||||
|
//
|
||||||
|
|
||||||
|
GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape(const Standard_Real& K,const TopTools_ListOfShape& I,const TCollection_MapNodePtr& n);
|
||||||
|
|
||||||
|
Standard_Real& Key() const;
|
||||||
|
|
||||||
|
TopTools_ListOfShape& Value() const;
|
||||||
|
//Standard_EXPORT ~GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Type management
|
||||||
|
//
|
||||||
|
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 myKey;
|
||||||
|
TopTools_ListOfShape myValue;
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#define TheKey Standard_Real
|
||||||
|
#define TheKey_hxx <Standard_Real.hxx>
|
||||||
|
#define TheItem TopTools_ListOfShape
|
||||||
|
#define TheItem_hxx <TopTools_ListOfShape.hxx>
|
||||||
|
#define Hasher TColStd_MapRealHasher
|
||||||
|
#define Hasher_hxx <TColStd_MapRealHasher.hxx>
|
||||||
|
#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape
|
||||||
|
#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape.hxx>
|
||||||
|
#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape
|
||||||
|
#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape.hxx>
|
||||||
|
#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape
|
||||||
|
#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape_Type_()
|
||||||
|
#define TCollection_DataMap GEOMAlgo_DataMapOfRealListOfShape
|
||||||
|
#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfRealListOfShape.hxx>
|
||||||
|
|
||||||
|
#include <TCollection_DataMapNode.lxx>
|
||||||
|
|
||||||
|
#undef TheKey
|
||||||
|
#undef TheKey_hxx
|
||||||
|
#undef TheItem
|
||||||
|
#undef TheItem_hxx
|
||||||
|
#undef Hasher
|
||||||
|
#undef Hasher_hxx
|
||||||
|
#undef TCollection_DataMapNode
|
||||||
|
#undef TCollection_DataMapNode_hxx
|
||||||
|
#undef TCollection_DataMapIterator
|
||||||
|
#undef TCollection_DataMapIterator_hxx
|
||||||
|
#undef Handle_TCollection_DataMapNode
|
||||||
|
#undef TCollection_DataMapNode_Type_
|
||||||
|
#undef TCollection_DataMap
|
||||||
|
#undef TCollection_DataMap_hxx
|
||||||
|
|
||||||
|
|
||||||
|
// other Inline functions and methods (like "C++: function call" methods)
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,100 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#include <GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape.hxx>
|
||||||
|
|
||||||
|
#ifndef _Standard_TypeMismatch_HeaderFile
|
||||||
|
#include <Standard_TypeMismatch.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _TopTools_ListOfShape_HeaderFile
|
||||||
|
#include <TopTools_ListOfShape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TColStd_MapRealHasher_HeaderFile
|
||||||
|
#include <TColStd_MapRealHasher.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_DataMapOfRealListOfShape_HeaderFile
|
||||||
|
#include <GEOMAlgo_DataMapOfRealListOfShape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape_HeaderFile
|
||||||
|
#include <GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape.hxx>
|
||||||
|
#endif
|
||||||
|
//GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape::~GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape() {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT Handle_Standard_Type& GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape_Type_()
|
||||||
|
{
|
||||||
|
|
||||||
|
static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode);
|
||||||
|
static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
|
||||||
|
static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
|
||||||
|
|
||||||
|
|
||||||
|
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
|
||||||
|
static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape",
|
||||||
|
sizeof(GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape),
|
||||||
|
1,
|
||||||
|
(Standard_Address)_Ancestors,
|
||||||
|
(Standard_Address)NULL);
|
||||||
|
|
||||||
|
return _aType;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// DownCast method
|
||||||
|
// allow safe downcasting
|
||||||
|
//
|
||||||
|
const Handle(GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape) Handle(GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape)::DownCast(const Handle(Standard_Transient)& AnObject)
|
||||||
|
{
|
||||||
|
Handle(GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape) _anOtherObject;
|
||||||
|
|
||||||
|
if (!AnObject.IsNull()) {
|
||||||
|
if (AnObject->IsKind(STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape))) {
|
||||||
|
_anOtherObject = Handle(GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape)((Handle(GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape)&)AnObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return _anOtherObject ;
|
||||||
|
}
|
||||||
|
const Handle(Standard_Type)& GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape::DynamicType() const
|
||||||
|
{
|
||||||
|
return STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape) ;
|
||||||
|
}
|
||||||
|
//Standard_Boolean GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape::IsKind(const Handle(Standard_Type)& AType) const
|
||||||
|
//{
|
||||||
|
// return (STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape) == AType || TCollection_MapNode::IsKind(AType));
|
||||||
|
//}
|
||||||
|
//Handle_GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape::~Handle_GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape() {}
|
||||||
|
#define TheKey Standard_Real
|
||||||
|
#define TheKey_hxx <Standard_Real.hxx>
|
||||||
|
#define TheItem TopTools_ListOfShape
|
||||||
|
#define TheItem_hxx <TopTools_ListOfShape.hxx>
|
||||||
|
#define Hasher TColStd_MapRealHasher
|
||||||
|
#define Hasher_hxx <TColStd_MapRealHasher.hxx>
|
||||||
|
#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape
|
||||||
|
#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape.hxx>
|
||||||
|
#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape
|
||||||
|
#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape.hxx>
|
||||||
|
#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape
|
||||||
|
#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape_Type_()
|
||||||
|
#define TCollection_DataMap GEOMAlgo_DataMapOfRealListOfShape
|
||||||
|
#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfRealListOfShape.hxx>
|
||||||
|
#include <TCollection_DataMapNode.gxx>
|
||||||
|
|
131
src/GEOMAlgo/GEOMAlgo_DataMapNodeOfDataMapOfShapeReal.hxx
Normal file
131
src/GEOMAlgo/GEOMAlgo_DataMapNodeOfDataMapOfShapeReal.hxx
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _GEOMAlgo_DataMapNodeOfDataMapOfShapeReal_HeaderFile
|
||||||
|
#define _GEOMAlgo_DataMapNodeOfDataMapOfShapeReal_HeaderFile
|
||||||
|
|
||||||
|
#ifndef _Standard_HeaderFile
|
||||||
|
#include <Standard.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeReal_HeaderFile
|
||||||
|
#include <Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeReal.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _TopoDS_Shape_HeaderFile
|
||||||
|
#include <TopoDS_Shape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Real_HeaderFile
|
||||||
|
#include <Standard_Real.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TCollection_MapNode_HeaderFile
|
||||||
|
#include <TCollection_MapNode.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TCollection_MapNodePtr_HeaderFile
|
||||||
|
#include <TCollection_MapNodePtr.hxx>
|
||||||
|
#endif
|
||||||
|
class TopoDS_Shape;
|
||||||
|
class TopTools_ShapeMapHasher;
|
||||||
|
class GEOMAlgo_DataMapOfShapeReal;
|
||||||
|
class GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class GEOMAlgo_DataMapNodeOfDataMapOfShapeReal : public TCollection_MapNode {
|
||||||
|
|
||||||
|
public:
|
||||||
|
// Methods PUBLIC
|
||||||
|
//
|
||||||
|
|
||||||
|
GEOMAlgo_DataMapNodeOfDataMapOfShapeReal(const TopoDS_Shape& K,const Standard_Real& I,const TCollection_MapNodePtr& n);
|
||||||
|
|
||||||
|
TopoDS_Shape& Key() const;
|
||||||
|
|
||||||
|
Standard_Real& Value() const;
|
||||||
|
//Standard_EXPORT ~GEOMAlgo_DataMapNodeOfDataMapOfShapeReal();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Type management
|
||||||
|
//
|
||||||
|
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
|
||||||
|
//
|
||||||
|
TopoDS_Shape myKey;
|
||||||
|
Standard_Real myValue;
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#define TheKey TopoDS_Shape
|
||||||
|
#define TheKey_hxx <TopoDS_Shape.hxx>
|
||||||
|
#define TheItem Standard_Real
|
||||||
|
#define TheItem_hxx <Standard_Real.hxx>
|
||||||
|
#define Hasher TopTools_ShapeMapHasher
|
||||||
|
#define Hasher_hxx <TopTools_ShapeMapHasher.hxx>
|
||||||
|
#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfShapeReal
|
||||||
|
#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfShapeReal.hxx>
|
||||||
|
#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal
|
||||||
|
#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal.hxx>
|
||||||
|
#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeReal
|
||||||
|
#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfShapeReal_Type_()
|
||||||
|
#define TCollection_DataMap GEOMAlgo_DataMapOfShapeReal
|
||||||
|
#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfShapeReal.hxx>
|
||||||
|
|
||||||
|
#include <TCollection_DataMapNode.lxx>
|
||||||
|
|
||||||
|
#undef TheKey
|
||||||
|
#undef TheKey_hxx
|
||||||
|
#undef TheItem
|
||||||
|
#undef TheItem_hxx
|
||||||
|
#undef Hasher
|
||||||
|
#undef Hasher_hxx
|
||||||
|
#undef TCollection_DataMapNode
|
||||||
|
#undef TCollection_DataMapNode_hxx
|
||||||
|
#undef TCollection_DataMapIterator
|
||||||
|
#undef TCollection_DataMapIterator_hxx
|
||||||
|
#undef Handle_TCollection_DataMapNode
|
||||||
|
#undef TCollection_DataMapNode_Type_
|
||||||
|
#undef TCollection_DataMap
|
||||||
|
#undef TCollection_DataMap_hxx
|
||||||
|
|
||||||
|
|
||||||
|
// other Inline functions and methods (like "C++: function call" methods)
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
100
src/GEOMAlgo/GEOMAlgo_DataMapNodeOfDataMapOfShapeReal_0.cxx
Normal file
100
src/GEOMAlgo/GEOMAlgo_DataMapNodeOfDataMapOfShapeReal_0.cxx
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#include <GEOMAlgo_DataMapNodeOfDataMapOfShapeReal.hxx>
|
||||||
|
|
||||||
|
#ifndef _Standard_TypeMismatch_HeaderFile
|
||||||
|
#include <Standard_TypeMismatch.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _TopoDS_Shape_HeaderFile
|
||||||
|
#include <TopoDS_Shape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopTools_ShapeMapHasher_HeaderFile
|
||||||
|
#include <TopTools_ShapeMapHasher.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_DataMapOfShapeReal_HeaderFile
|
||||||
|
#include <GEOMAlgo_DataMapOfShapeReal.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal_HeaderFile
|
||||||
|
#include <GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal.hxx>
|
||||||
|
#endif
|
||||||
|
//GEOMAlgo_DataMapNodeOfDataMapOfShapeReal::~GEOMAlgo_DataMapNodeOfDataMapOfShapeReal() {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT Handle_Standard_Type& GEOMAlgo_DataMapNodeOfDataMapOfShapeReal_Type_()
|
||||||
|
{
|
||||||
|
|
||||||
|
static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode);
|
||||||
|
static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
|
||||||
|
static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
|
||||||
|
|
||||||
|
|
||||||
|
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
|
||||||
|
static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_DataMapNodeOfDataMapOfShapeReal",
|
||||||
|
sizeof(GEOMAlgo_DataMapNodeOfDataMapOfShapeReal),
|
||||||
|
1,
|
||||||
|
(Standard_Address)_Ancestors,
|
||||||
|
(Standard_Address)NULL);
|
||||||
|
|
||||||
|
return _aType;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// DownCast method
|
||||||
|
// allow safe downcasting
|
||||||
|
//
|
||||||
|
const Handle(GEOMAlgo_DataMapNodeOfDataMapOfShapeReal) Handle(GEOMAlgo_DataMapNodeOfDataMapOfShapeReal)::DownCast(const Handle(Standard_Transient)& AnObject)
|
||||||
|
{
|
||||||
|
Handle(GEOMAlgo_DataMapNodeOfDataMapOfShapeReal) _anOtherObject;
|
||||||
|
|
||||||
|
if (!AnObject.IsNull()) {
|
||||||
|
if (AnObject->IsKind(STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfShapeReal))) {
|
||||||
|
_anOtherObject = Handle(GEOMAlgo_DataMapNodeOfDataMapOfShapeReal)((Handle(GEOMAlgo_DataMapNodeOfDataMapOfShapeReal)&)AnObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return _anOtherObject ;
|
||||||
|
}
|
||||||
|
const Handle(Standard_Type)& GEOMAlgo_DataMapNodeOfDataMapOfShapeReal::DynamicType() const
|
||||||
|
{
|
||||||
|
return STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfShapeReal) ;
|
||||||
|
}
|
||||||
|
//Standard_Boolean GEOMAlgo_DataMapNodeOfDataMapOfShapeReal::IsKind(const Handle(Standard_Type)& AType) const
|
||||||
|
//{
|
||||||
|
// return (STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfShapeReal) == AType || TCollection_MapNode::IsKind(AType));
|
||||||
|
//}
|
||||||
|
//Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeReal::~Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeReal() {}
|
||||||
|
#define TheKey TopoDS_Shape
|
||||||
|
#define TheKey_hxx <TopoDS_Shape.hxx>
|
||||||
|
#define TheItem Standard_Real
|
||||||
|
#define TheItem_hxx <Standard_Real.hxx>
|
||||||
|
#define Hasher TopTools_ShapeMapHasher
|
||||||
|
#define Hasher_hxx <TopTools_ShapeMapHasher.hxx>
|
||||||
|
#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfShapeReal
|
||||||
|
#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfShapeReal.hxx>
|
||||||
|
#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal
|
||||||
|
#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal.hxx>
|
||||||
|
#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeReal
|
||||||
|
#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfShapeReal_Type_()
|
||||||
|
#define TCollection_DataMap GEOMAlgo_DataMapOfShapeReal
|
||||||
|
#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfShapeReal.hxx>
|
||||||
|
#include <TCollection_DataMapNode.gxx>
|
||||||
|
|
132
src/GEOMAlgo/GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet.hxx
Normal file
132
src/GEOMAlgo/GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet.hxx
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet_HeaderFile
|
||||||
|
#define _GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet_HeaderFile
|
||||||
|
|
||||||
|
#ifndef _Standard_HeaderFile
|
||||||
|
#include <Standard.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet_HeaderFile
|
||||||
|
#include <Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _TopoDS_Shape_HeaderFile
|
||||||
|
#include <TopoDS_Shape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_ShapeSet_HeaderFile
|
||||||
|
#include <GEOMAlgo_ShapeSet.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TCollection_MapNode_HeaderFile
|
||||||
|
#include <TCollection_MapNode.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TCollection_MapNodePtr_HeaderFile
|
||||||
|
#include <TCollection_MapNodePtr.hxx>
|
||||||
|
#endif
|
||||||
|
class TopoDS_Shape;
|
||||||
|
class GEOMAlgo_ShapeSet;
|
||||||
|
class TopTools_ShapeMapHasher;
|
||||||
|
class GEOMAlgo_DataMapOfShapeShapeSet;
|
||||||
|
class GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet : public TCollection_MapNode {
|
||||||
|
|
||||||
|
public:
|
||||||
|
// Methods PUBLIC
|
||||||
|
//
|
||||||
|
|
||||||
|
GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet(const TopoDS_Shape& K,const GEOMAlgo_ShapeSet& I,const TCollection_MapNodePtr& n);
|
||||||
|
|
||||||
|
TopoDS_Shape& Key() const;
|
||||||
|
|
||||||
|
GEOMAlgo_ShapeSet& Value() const;
|
||||||
|
//Standard_EXPORT ~GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Type management
|
||||||
|
//
|
||||||
|
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
|
||||||
|
//
|
||||||
|
TopoDS_Shape myKey;
|
||||||
|
GEOMAlgo_ShapeSet myValue;
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#define TheKey TopoDS_Shape
|
||||||
|
#define TheKey_hxx <TopoDS_Shape.hxx>
|
||||||
|
#define TheItem GEOMAlgo_ShapeSet
|
||||||
|
#define TheItem_hxx <GEOMAlgo_ShapeSet.hxx>
|
||||||
|
#define Hasher TopTools_ShapeMapHasher
|
||||||
|
#define Hasher_hxx <TopTools_ShapeMapHasher.hxx>
|
||||||
|
#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet
|
||||||
|
#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet.hxx>
|
||||||
|
#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet
|
||||||
|
#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet.hxx>
|
||||||
|
#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet
|
||||||
|
#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet_Type_()
|
||||||
|
#define TCollection_DataMap GEOMAlgo_DataMapOfShapeShapeSet
|
||||||
|
#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfShapeShapeSet.hxx>
|
||||||
|
|
||||||
|
#include <TCollection_DataMapNode.lxx>
|
||||||
|
|
||||||
|
#undef TheKey
|
||||||
|
#undef TheKey_hxx
|
||||||
|
#undef TheItem
|
||||||
|
#undef TheItem_hxx
|
||||||
|
#undef Hasher
|
||||||
|
#undef Hasher_hxx
|
||||||
|
#undef TCollection_DataMapNode
|
||||||
|
#undef TCollection_DataMapNode_hxx
|
||||||
|
#undef TCollection_DataMapIterator
|
||||||
|
#undef TCollection_DataMapIterator_hxx
|
||||||
|
#undef Handle_TCollection_DataMapNode
|
||||||
|
#undef TCollection_DataMapNode_Type_
|
||||||
|
#undef TCollection_DataMap
|
||||||
|
#undef TCollection_DataMap_hxx
|
||||||
|
|
||||||
|
|
||||||
|
// other Inline functions and methods (like "C++: function call" methods)
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
103
src/GEOMAlgo/GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet_0.cxx
Normal file
103
src/GEOMAlgo/GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet_0.cxx
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#include <GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet.hxx>
|
||||||
|
|
||||||
|
#ifndef _Standard_TypeMismatch_HeaderFile
|
||||||
|
#include <Standard_TypeMismatch.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _TopoDS_Shape_HeaderFile
|
||||||
|
#include <TopoDS_Shape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_ShapeSet_HeaderFile
|
||||||
|
#include <GEOMAlgo_ShapeSet.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopTools_ShapeMapHasher_HeaderFile
|
||||||
|
#include <TopTools_ShapeMapHasher.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_DataMapOfShapeShapeSet_HeaderFile
|
||||||
|
#include <GEOMAlgo_DataMapOfShapeShapeSet.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet_HeaderFile
|
||||||
|
#include <GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet.hxx>
|
||||||
|
#endif
|
||||||
|
//GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet::~GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet() {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT Handle_Standard_Type& GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet_Type_()
|
||||||
|
{
|
||||||
|
|
||||||
|
static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode);
|
||||||
|
static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
|
||||||
|
static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
|
||||||
|
|
||||||
|
|
||||||
|
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
|
||||||
|
static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet",
|
||||||
|
sizeof(GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet),
|
||||||
|
1,
|
||||||
|
(Standard_Address)_Ancestors,
|
||||||
|
(Standard_Address)NULL);
|
||||||
|
|
||||||
|
return _aType;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// DownCast method
|
||||||
|
// allow safe downcasting
|
||||||
|
//
|
||||||
|
const Handle(GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet) Handle(GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet)::DownCast(const Handle(Standard_Transient)& AnObject)
|
||||||
|
{
|
||||||
|
Handle(GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet) _anOtherObject;
|
||||||
|
|
||||||
|
if (!AnObject.IsNull()) {
|
||||||
|
if (AnObject->IsKind(STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet))) {
|
||||||
|
_anOtherObject = Handle(GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet)((Handle(GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet)&)AnObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return _anOtherObject ;
|
||||||
|
}
|
||||||
|
const Handle(Standard_Type)& GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet::DynamicType() const
|
||||||
|
{
|
||||||
|
return STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet) ;
|
||||||
|
}
|
||||||
|
//Standard_Boolean GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet::IsKind(const Handle(Standard_Type)& AType) const
|
||||||
|
//{
|
||||||
|
// return (STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet) == AType || TCollection_MapNode::IsKind(AType));
|
||||||
|
//}
|
||||||
|
//Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet::~Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet() {}
|
||||||
|
#define TheKey TopoDS_Shape
|
||||||
|
#define TheKey_hxx <TopoDS_Shape.hxx>
|
||||||
|
#define TheItem GEOMAlgo_ShapeSet
|
||||||
|
#define TheItem_hxx <GEOMAlgo_ShapeSet.hxx>
|
||||||
|
#define Hasher TopTools_ShapeMapHasher
|
||||||
|
#define Hasher_hxx <TopTools_ShapeMapHasher.hxx>
|
||||||
|
#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet
|
||||||
|
#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet.hxx>
|
||||||
|
#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet
|
||||||
|
#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet.hxx>
|
||||||
|
#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet
|
||||||
|
#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet_Type_()
|
||||||
|
#define TCollection_DataMap GEOMAlgo_DataMapOfShapeShapeSet
|
||||||
|
#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfShapeShapeSet.hxx>
|
||||||
|
#include <TCollection_DataMapNode.gxx>
|
||||||
|
|
157
src/GEOMAlgo/GEOMAlgo_DataMapOfRealListOfShape.hxx
Normal file
157
src/GEOMAlgo/GEOMAlgo_DataMapOfRealListOfShape.hxx
Normal file
@ -0,0 +1,157 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _GEOMAlgo_DataMapOfRealListOfShape_HeaderFile
|
||||||
|
#define _GEOMAlgo_DataMapOfRealListOfShape_HeaderFile
|
||||||
|
|
||||||
|
#ifndef _TCollection_BasicMap_HeaderFile
|
||||||
|
#include <TCollection_BasicMap.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Real_HeaderFile
|
||||||
|
#include <Standard_Real.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape_HeaderFile
|
||||||
|
#include <Handle_GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Integer_HeaderFile
|
||||||
|
#include <Standard_Integer.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Boolean_HeaderFile
|
||||||
|
#include <Standard_Boolean.hxx>
|
||||||
|
#endif
|
||||||
|
class Standard_DomainError;
|
||||||
|
class Standard_NoSuchObject;
|
||||||
|
class TopTools_ListOfShape;
|
||||||
|
class TColStd_MapRealHasher;
|
||||||
|
class GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape;
|
||||||
|
class GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape;
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _Standard_HeaderFile
|
||||||
|
#include <Standard.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Macro_HeaderFile
|
||||||
|
#include <Standard_Macro.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
class GEOMAlgo_DataMapOfRealListOfShape : public TCollection_BasicMap {
|
||||||
|
|
||||||
|
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 GEOMAlgo_DataMapOfRealListOfShape(const Standard_Integer NbBuckets = 1);
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT GEOMAlgo_DataMapOfRealListOfShape& Assign(const GEOMAlgo_DataMapOfRealListOfShape& Other) ;
|
||||||
|
GEOMAlgo_DataMapOfRealListOfShape& operator =(const GEOMAlgo_DataMapOfRealListOfShape& Other)
|
||||||
|
{
|
||||||
|
return Assign(Other);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT void Clear() ;
|
||||||
|
~GEOMAlgo_DataMapOfRealListOfShape()
|
||||||
|
{
|
||||||
|
Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT Standard_Boolean Bind(const Standard_Real& K,const TopTools_ListOfShape& I) ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT Standard_Boolean IsBound(const Standard_Real& K) const;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT Standard_Boolean UnBind(const Standard_Real& K) ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT const TopTools_ListOfShape& Find(const Standard_Real& K) const;
|
||||||
|
const TopTools_ListOfShape& operator()(const Standard_Real& K) const
|
||||||
|
{
|
||||||
|
return Find(K);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT TopTools_ListOfShape& ChangeFind(const Standard_Real& K) ;
|
||||||
|
TopTools_ListOfShape& operator()(const Standard_Real& K)
|
||||||
|
{
|
||||||
|
return ChangeFind(K);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Methods PROTECTED
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PROTECTED
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Methods PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT GEOMAlgo_DataMapOfRealListOfShape(const GEOMAlgo_DataMapOfRealListOfShape& Other);
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// other Inline functions and methods (like "C++: function call" methods)
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
57
src/GEOMAlgo/GEOMAlgo_DataMapOfRealListOfShape_0.cxx
Normal file
57
src/GEOMAlgo/GEOMAlgo_DataMapOfRealListOfShape_0.cxx
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#include <GEOMAlgo_DataMapOfRealListOfShape.hxx>
|
||||||
|
|
||||||
|
#ifndef _Standard_DomainError_HeaderFile
|
||||||
|
#include <Standard_DomainError.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_NoSuchObject_HeaderFile
|
||||||
|
#include <Standard_NoSuchObject.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopTools_ListOfShape_HeaderFile
|
||||||
|
#include <TopTools_ListOfShape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TColStd_MapRealHasher_HeaderFile
|
||||||
|
#include <TColStd_MapRealHasher.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape_HeaderFile
|
||||||
|
#include <GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape_HeaderFile
|
||||||
|
#include <GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#define TheKey Standard_Real
|
||||||
|
#define TheKey_hxx <Standard_Real.hxx>
|
||||||
|
#define TheItem TopTools_ListOfShape
|
||||||
|
#define TheItem_hxx <TopTools_ListOfShape.hxx>
|
||||||
|
#define Hasher TColStd_MapRealHasher
|
||||||
|
#define Hasher_hxx <TColStd_MapRealHasher.hxx>
|
||||||
|
#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape
|
||||||
|
#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape.hxx>
|
||||||
|
#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape
|
||||||
|
#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape.hxx>
|
||||||
|
#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape
|
||||||
|
#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape_Type_()
|
||||||
|
#define TCollection_DataMap GEOMAlgo_DataMapOfRealListOfShape
|
||||||
|
#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfRealListOfShape.hxx>
|
||||||
|
#include <TCollection_DataMap.gxx>
|
||||||
|
|
157
src/GEOMAlgo/GEOMAlgo_DataMapOfShapeReal.hxx
Normal file
157
src/GEOMAlgo/GEOMAlgo_DataMapOfShapeReal.hxx
Normal file
@ -0,0 +1,157 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _GEOMAlgo_DataMapOfShapeReal_HeaderFile
|
||||||
|
#define _GEOMAlgo_DataMapOfShapeReal_HeaderFile
|
||||||
|
|
||||||
|
#ifndef _TCollection_BasicMap_HeaderFile
|
||||||
|
#include <TCollection_BasicMap.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Real_HeaderFile
|
||||||
|
#include <Standard_Real.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeReal_HeaderFile
|
||||||
|
#include <Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeReal.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Integer_HeaderFile
|
||||||
|
#include <Standard_Integer.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Boolean_HeaderFile
|
||||||
|
#include <Standard_Boolean.hxx>
|
||||||
|
#endif
|
||||||
|
class Standard_DomainError;
|
||||||
|
class Standard_NoSuchObject;
|
||||||
|
class TopoDS_Shape;
|
||||||
|
class TopTools_ShapeMapHasher;
|
||||||
|
class GEOMAlgo_DataMapNodeOfDataMapOfShapeReal;
|
||||||
|
class GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal;
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _Standard_HeaderFile
|
||||||
|
#include <Standard.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Macro_HeaderFile
|
||||||
|
#include <Standard_Macro.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
class GEOMAlgo_DataMapOfShapeReal : public TCollection_BasicMap {
|
||||||
|
|
||||||
|
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 GEOMAlgo_DataMapOfShapeReal(const Standard_Integer NbBuckets = 1);
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT GEOMAlgo_DataMapOfShapeReal& Assign(const GEOMAlgo_DataMapOfShapeReal& Other) ;
|
||||||
|
GEOMAlgo_DataMapOfShapeReal& operator =(const GEOMAlgo_DataMapOfShapeReal& Other)
|
||||||
|
{
|
||||||
|
return Assign(Other);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT void Clear() ;
|
||||||
|
~GEOMAlgo_DataMapOfShapeReal()
|
||||||
|
{
|
||||||
|
Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT Standard_Boolean Bind(const TopoDS_Shape& K,const Standard_Real& I) ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT Standard_Boolean IsBound(const TopoDS_Shape& K) const;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT Standard_Boolean UnBind(const TopoDS_Shape& K) ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT const Standard_Real& Find(const TopoDS_Shape& K) const;
|
||||||
|
const Standard_Real& operator()(const TopoDS_Shape& K) const
|
||||||
|
{
|
||||||
|
return Find(K);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT Standard_Real& ChangeFind(const TopoDS_Shape& K) ;
|
||||||
|
Standard_Real& operator()(const TopoDS_Shape& K)
|
||||||
|
{
|
||||||
|
return ChangeFind(K);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Methods PROTECTED
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PROTECTED
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Methods PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT GEOMAlgo_DataMapOfShapeReal(const GEOMAlgo_DataMapOfShapeReal& Other);
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// other Inline functions and methods (like "C++: function call" methods)
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
57
src/GEOMAlgo/GEOMAlgo_DataMapOfShapeReal_0.cxx
Normal file
57
src/GEOMAlgo/GEOMAlgo_DataMapOfShapeReal_0.cxx
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#include <GEOMAlgo_DataMapOfShapeReal.hxx>
|
||||||
|
|
||||||
|
#ifndef _Standard_DomainError_HeaderFile
|
||||||
|
#include <Standard_DomainError.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_NoSuchObject_HeaderFile
|
||||||
|
#include <Standard_NoSuchObject.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopoDS_Shape_HeaderFile
|
||||||
|
#include <TopoDS_Shape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopTools_ShapeMapHasher_HeaderFile
|
||||||
|
#include <TopTools_ShapeMapHasher.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_DataMapNodeOfDataMapOfShapeReal_HeaderFile
|
||||||
|
#include <GEOMAlgo_DataMapNodeOfDataMapOfShapeReal.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal_HeaderFile
|
||||||
|
#include <GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#define TheKey TopoDS_Shape
|
||||||
|
#define TheKey_hxx <TopoDS_Shape.hxx>
|
||||||
|
#define TheItem Standard_Real
|
||||||
|
#define TheItem_hxx <Standard_Real.hxx>
|
||||||
|
#define Hasher TopTools_ShapeMapHasher
|
||||||
|
#define Hasher_hxx <TopTools_ShapeMapHasher.hxx>
|
||||||
|
#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfShapeReal
|
||||||
|
#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfShapeReal.hxx>
|
||||||
|
#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal
|
||||||
|
#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal.hxx>
|
||||||
|
#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeReal
|
||||||
|
#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfShapeReal_Type_()
|
||||||
|
#define TCollection_DataMap GEOMAlgo_DataMapOfShapeReal
|
||||||
|
#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfShapeReal.hxx>
|
||||||
|
#include <TCollection_DataMap.gxx>
|
||||||
|
|
155
src/GEOMAlgo/GEOMAlgo_DataMapOfShapeShapeSet.hxx
Normal file
155
src/GEOMAlgo/GEOMAlgo_DataMapOfShapeShapeSet.hxx
Normal file
@ -0,0 +1,155 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _GEOMAlgo_DataMapOfShapeShapeSet_HeaderFile
|
||||||
|
#define _GEOMAlgo_DataMapOfShapeShapeSet_HeaderFile
|
||||||
|
|
||||||
|
#ifndef _TCollection_BasicMap_HeaderFile
|
||||||
|
#include <TCollection_BasicMap.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet_HeaderFile
|
||||||
|
#include <Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Integer_HeaderFile
|
||||||
|
#include <Standard_Integer.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Boolean_HeaderFile
|
||||||
|
#include <Standard_Boolean.hxx>
|
||||||
|
#endif
|
||||||
|
class Standard_DomainError;
|
||||||
|
class Standard_NoSuchObject;
|
||||||
|
class TopoDS_Shape;
|
||||||
|
class GEOMAlgo_ShapeSet;
|
||||||
|
class TopTools_ShapeMapHasher;
|
||||||
|
class GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet;
|
||||||
|
class GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet;
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _Standard_HeaderFile
|
||||||
|
#include <Standard.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Macro_HeaderFile
|
||||||
|
#include <Standard_Macro.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
class GEOMAlgo_DataMapOfShapeShapeSet : public TCollection_BasicMap {
|
||||||
|
|
||||||
|
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 GEOMAlgo_DataMapOfShapeShapeSet(const Standard_Integer NbBuckets = 1);
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT GEOMAlgo_DataMapOfShapeShapeSet& Assign(const GEOMAlgo_DataMapOfShapeShapeSet& Other) ;
|
||||||
|
GEOMAlgo_DataMapOfShapeShapeSet& operator =(const GEOMAlgo_DataMapOfShapeShapeSet& Other)
|
||||||
|
{
|
||||||
|
return Assign(Other);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT void Clear() ;
|
||||||
|
~GEOMAlgo_DataMapOfShapeShapeSet()
|
||||||
|
{
|
||||||
|
Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT Standard_Boolean Bind(const TopoDS_Shape& K,const GEOMAlgo_ShapeSet& I) ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT Standard_Boolean IsBound(const TopoDS_Shape& K) const;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT Standard_Boolean UnBind(const TopoDS_Shape& K) ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT const GEOMAlgo_ShapeSet& Find(const TopoDS_Shape& K) const;
|
||||||
|
const GEOMAlgo_ShapeSet& operator()(const TopoDS_Shape& K) const
|
||||||
|
{
|
||||||
|
return Find(K);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT GEOMAlgo_ShapeSet& ChangeFind(const TopoDS_Shape& K) ;
|
||||||
|
GEOMAlgo_ShapeSet& operator()(const TopoDS_Shape& K)
|
||||||
|
{
|
||||||
|
return ChangeFind(K);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Methods PROTECTED
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PROTECTED
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Methods PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT GEOMAlgo_DataMapOfShapeShapeSet(const GEOMAlgo_DataMapOfShapeShapeSet& Other);
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// other Inline functions and methods (like "C++: function call" methods)
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
60
src/GEOMAlgo/GEOMAlgo_DataMapOfShapeShapeSet_0.cxx
Normal file
60
src/GEOMAlgo/GEOMAlgo_DataMapOfShapeShapeSet_0.cxx
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#include <GEOMAlgo_DataMapOfShapeShapeSet.hxx>
|
||||||
|
|
||||||
|
#ifndef _Standard_DomainError_HeaderFile
|
||||||
|
#include <Standard_DomainError.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_NoSuchObject_HeaderFile
|
||||||
|
#include <Standard_NoSuchObject.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopoDS_Shape_HeaderFile
|
||||||
|
#include <TopoDS_Shape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_ShapeSet_HeaderFile
|
||||||
|
#include <GEOMAlgo_ShapeSet.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopTools_ShapeMapHasher_HeaderFile
|
||||||
|
#include <TopTools_ShapeMapHasher.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet_HeaderFile
|
||||||
|
#include <GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet_HeaderFile
|
||||||
|
#include <GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#define TheKey TopoDS_Shape
|
||||||
|
#define TheKey_hxx <TopoDS_Shape.hxx>
|
||||||
|
#define TheItem GEOMAlgo_ShapeSet
|
||||||
|
#define TheItem_hxx <GEOMAlgo_ShapeSet.hxx>
|
||||||
|
#define Hasher TopTools_ShapeMapHasher
|
||||||
|
#define Hasher_hxx <TopTools_ShapeMapHasher.hxx>
|
||||||
|
#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet
|
||||||
|
#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet.hxx>
|
||||||
|
#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet
|
||||||
|
#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet.hxx>
|
||||||
|
#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet
|
||||||
|
#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet_Type_()
|
||||||
|
#define TCollection_DataMap GEOMAlgo_DataMapOfShapeShapeSet
|
||||||
|
#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfShapeShapeSet.hxx>
|
||||||
|
#include <TCollection_DataMap.gxx>
|
||||||
|
|
138
src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.cdl
Normal file
138
src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.cdl
Normal file
@ -0,0 +1,138 @@
|
|||||||
|
-- Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
--
|
||||||
|
-- This library is free software; you can redistribute it and/or
|
||||||
|
-- modify it under the terms of the GNU Lesser General Public
|
||||||
|
-- License as published by the Free Software Foundation; either
|
||||||
|
-- version 2.1 of the License.
|
||||||
|
--
|
||||||
|
-- This library is distributed in the hope that it will be useful
|
||||||
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
-- Lesser General Public License for more details.
|
||||||
|
--
|
||||||
|
-- You should have received a copy of the GNU Lesser General Public
|
||||||
|
-- License along with this library; if not, write to the Free Software
|
||||||
|
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
--
|
||||||
|
-- See http:--www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
--
|
||||||
|
-- File: GEOMAlgo_FinderShapeOn1.cdl
|
||||||
|
-- Created: Fri Mar 4 10:26:54 2005
|
||||||
|
-- Author: Peter KURNEV
|
||||||
|
-- <pkv@irinox>
|
||||||
|
|
||||||
|
|
||||||
|
class FinderShapeOn2 from GEOMAlgo
|
||||||
|
inherits ShapeAlgo from GEOMAlgo
|
||||||
|
|
||||||
|
---Purpose:
|
||||||
|
|
||||||
|
uses
|
||||||
|
Pnt from gp,
|
||||||
|
ShapeEnum from TopAbs,
|
||||||
|
State from TopAbs,
|
||||||
|
Face from TopoDS,
|
||||||
|
Edge from TopoDS,
|
||||||
|
ListOfShape from TopTools,
|
||||||
|
|
||||||
|
State from GEOMAlgo,
|
||||||
|
ListOfPnt from GEOMAlgo,
|
||||||
|
IndexedDataMapOfShapeState from GEOMAlgo,
|
||||||
|
Clsf from GEOMAlgo
|
||||||
|
|
||||||
|
--raises
|
||||||
|
|
||||||
|
is
|
||||||
|
Create
|
||||||
|
returns FinderShapeOn2 from GEOMAlgo;
|
||||||
|
---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_FinderShapeOn2();"
|
||||||
|
|
||||||
|
SetClsf(me:out;
|
||||||
|
aClsf:Clsf from GEOMAlgo);
|
||||||
|
|
||||||
|
Clsf(me)
|
||||||
|
returns Clsf from GEOMAlgo;
|
||||||
|
---C++: return const &
|
||||||
|
|
||||||
|
SetShapeType(me:out;
|
||||||
|
aST:ShapeEnum from TopAbs);
|
||||||
|
|
||||||
|
ShapeType(me)
|
||||||
|
returns ShapeEnum from TopAbs;
|
||||||
|
|
||||||
|
SetState(me:out;
|
||||||
|
aSF:State from GEOMAlgo);
|
||||||
|
|
||||||
|
State(me)
|
||||||
|
returns State from GEOMAlgo;
|
||||||
|
|
||||||
|
SetNbPntsMin(me:out;
|
||||||
|
aNb:Integer from Standard);
|
||||||
|
|
||||||
|
NbPntsMin(me)
|
||||||
|
returns Integer from Standard;
|
||||||
|
|
||||||
|
SetNbPntsMax(me:out;
|
||||||
|
aNb:Integer from Standard);
|
||||||
|
|
||||||
|
NbPntsMax(me)
|
||||||
|
returns Integer from Standard;
|
||||||
|
|
||||||
|
Perform(me:out)
|
||||||
|
is redefined;
|
||||||
|
|
||||||
|
Shapes(me)
|
||||||
|
returns ListOfShape from TopTools;
|
||||||
|
---C++: return const &
|
||||||
|
--
|
||||||
|
-- protected methods
|
||||||
|
--
|
||||||
|
CheckData(me:out)
|
||||||
|
is redefined protected;
|
||||||
|
|
||||||
|
ProcessVertices(me:out)
|
||||||
|
is protected;
|
||||||
|
|
||||||
|
ProcessEdges(me:out)
|
||||||
|
is protected;
|
||||||
|
|
||||||
|
ProcessFaces(me:out)
|
||||||
|
is protected;
|
||||||
|
|
||||||
|
ProcessSolids(me:out)
|
||||||
|
is protected;
|
||||||
|
|
||||||
|
InnerPoints(me:out;
|
||||||
|
aF :Face from TopoDS;
|
||||||
|
aLP:out ListOfPnt from GEOMAlgo)
|
||||||
|
is protected;
|
||||||
|
|
||||||
|
InnerPoints(me:out;
|
||||||
|
aE :Edge from TopoDS;
|
||||||
|
aLP:out ListOfPnt from GEOMAlgo)
|
||||||
|
is protected;
|
||||||
|
|
||||||
|
InnerPoints(me:out;
|
||||||
|
aE :Edge from TopoDS;
|
||||||
|
aNbPnts: Integer from Standard;
|
||||||
|
aLP:out ListOfPnt from GEOMAlgo)
|
||||||
|
is protected;
|
||||||
|
|
||||||
|
MSS (me)
|
||||||
|
returns IndexedDataMapOfShapeState from GEOMAlgo;
|
||||||
|
---C++:return const &
|
||||||
|
|
||||||
|
|
||||||
|
fields
|
||||||
|
myShapeType : ShapeEnum from TopAbs is protected;
|
||||||
|
myState : State from GEOMAlgo is protected;
|
||||||
|
myNbPntsMin : Integer from Standard is protected;
|
||||||
|
myNbPntsMax : Integer from Standard is protected;
|
||||||
|
myClsf : Clsf from GEOMAlgo is protected;
|
||||||
|
--
|
||||||
|
myLS : ListOfShape from TopTools is protected;
|
||||||
|
--
|
||||||
|
myMSS : IndexedDataMapOfShapeState from GEOMAlgo is protected;
|
||||||
|
|
||||||
|
end FinderShapeOn2;
|
821
src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.cxx
Normal file
821
src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.cxx
Normal file
@ -0,0 +1,821 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
//
|
||||||
|
// File: GEOMAlgo_FinderShapeOn1.cxx
|
||||||
|
// Created: Fri Mar 4 10:31:06 2005
|
||||||
|
// Author: Peter KURNEV
|
||||||
|
// <pkv@irinox>
|
||||||
|
|
||||||
|
|
||||||
|
#include <GEOMAlgo_FinderShapeOn2.ixx>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
|
||||||
|
#include <Precision.hxx>
|
||||||
|
#include <TColStd_Array1OfInteger.hxx>
|
||||||
|
#include <TColStd_MapOfInteger.hxx>
|
||||||
|
|
||||||
|
#include <gp_Trsf.hxx>
|
||||||
|
#include <gp_Cylinder.hxx>
|
||||||
|
#include <gp_Pnt.hxx>
|
||||||
|
|
||||||
|
#include <TColgp_Array1OfPnt.hxx>
|
||||||
|
|
||||||
|
#include <Poly_Array1OfTriangle.hxx>
|
||||||
|
#include <Poly_Triangle.hxx>
|
||||||
|
#include <Poly_PolygonOnTriangulation.hxx>
|
||||||
|
#include <Poly_Triangulation.hxx>
|
||||||
|
|
||||||
|
#include <Geom_Curve.hxx>
|
||||||
|
#include <Geom_Surface.hxx>
|
||||||
|
#include <GeomAdaptor_Surface.hxx>
|
||||||
|
#include <GeomAbs_SurfaceType.hxx>
|
||||||
|
#include <GeomAdaptor_Curve.hxx>
|
||||||
|
#include <GeomAbs_CurveType.hxx>
|
||||||
|
|
||||||
|
#include <TopAbs_State.hxx>
|
||||||
|
|
||||||
|
#include <TopLoc_Location.hxx>
|
||||||
|
#include <TopoDS.hxx>
|
||||||
|
#include <TopoDS_Shape.hxx>
|
||||||
|
#include <TopoDS_Vertex.hxx>
|
||||||
|
#include <TopoDS_Face.hxx>
|
||||||
|
#include <TopoDS_Edge.hxx>
|
||||||
|
|
||||||
|
#include <TopExp.hxx>
|
||||||
|
#include <TopExp_Explorer.hxx>
|
||||||
|
|
||||||
|
#include <TopTools_IndexedMapOfShape.hxx>
|
||||||
|
|
||||||
|
#include <BRep_Tool.hxx>
|
||||||
|
#include <BRepLib_MakeEdge.hxx>
|
||||||
|
|
||||||
|
#include <GEOMAlgo_ListIteratorOfListOfPnt.hxx>
|
||||||
|
|
||||||
|
#include <GEOMAlgo_SurfaceTools.hxx>
|
||||||
|
#include <GEOMAlgo_StateCollector.hxx>
|
||||||
|
|
||||||
|
#include <GEOMAlgo_PassKey.hxx>
|
||||||
|
#include <GEOMAlgo_DataMapOfPassKeyInteger.hxx>
|
||||||
|
#include <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx>
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : GEOMAlgo_FinderShapeOn1
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
GEOMAlgo_FinderShapeOn2::GEOMAlgo_FinderShapeOn2()
|
||||||
|
:
|
||||||
|
GEOMAlgo_ShapeAlgo()
|
||||||
|
{
|
||||||
|
myTolerance=0.0001;
|
||||||
|
myShapeType=TopAbs_VERTEX;
|
||||||
|
myState=GEOMAlgo_ST_UNKNOWN;
|
||||||
|
myNbPntsMin=3;
|
||||||
|
myNbPntsMax=0;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : ~
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
GEOMAlgo_FinderShapeOn2::~GEOMAlgo_FinderShapeOn2()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : SetClsf
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_FinderShapeOn2::SetClsf(const Handle(GEOMAlgo_Clsf)& aClsf)
|
||||||
|
{
|
||||||
|
myClsf=aClsf;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Clsf
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
const Handle(GEOMAlgo_Clsf)& GEOMAlgo_FinderShapeOn2::Clsf() const
|
||||||
|
{
|
||||||
|
return myClsf;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : SetShapeType
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_FinderShapeOn2::SetShapeType(const TopAbs_ShapeEnum aType)
|
||||||
|
{
|
||||||
|
myShapeType=aType;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : ShapeType
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
TopAbs_ShapeEnum GEOMAlgo_FinderShapeOn2::ShapeType()const
|
||||||
|
{
|
||||||
|
return myShapeType;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : SetState
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_FinderShapeOn2::SetState(const GEOMAlgo_State aState)
|
||||||
|
{
|
||||||
|
myState=aState;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : State
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
GEOMAlgo_State GEOMAlgo_FinderShapeOn2::State() const
|
||||||
|
{
|
||||||
|
return myState;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : SetNbPntsMin
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_FinderShapeOn2::SetNbPntsMin(const Standard_Integer aNb)
|
||||||
|
{
|
||||||
|
myNbPntsMin=aNb;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : NbPntsMin
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Integer GEOMAlgo_FinderShapeOn2::NbPntsMin()const
|
||||||
|
{
|
||||||
|
return myNbPntsMin;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : SetNbPntsMax
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_FinderShapeOn2::SetNbPntsMax(const Standard_Integer aNb)
|
||||||
|
{
|
||||||
|
myNbPntsMax=aNb;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : NbPntsMax
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Integer GEOMAlgo_FinderShapeOn2::NbPntsMax()const
|
||||||
|
{
|
||||||
|
return myNbPntsMax;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
// function: MSS
|
||||||
|
// purpose:
|
||||||
|
//=======================================================================
|
||||||
|
const GEOMAlgo_IndexedDataMapOfShapeState& GEOMAlgo_FinderShapeOn2::MSS() const
|
||||||
|
{
|
||||||
|
return myMSS;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
// function: Shapes
|
||||||
|
// purpose:
|
||||||
|
//=======================================================================
|
||||||
|
const TopTools_ListOfShape& GEOMAlgo_FinderShapeOn2::Shapes() const
|
||||||
|
{
|
||||||
|
Standard_Integer i, aNb;
|
||||||
|
TopTools_ListOfShape* pL;
|
||||||
|
//
|
||||||
|
pL=(TopTools_ListOfShape*) &myLS;
|
||||||
|
pL->Clear();
|
||||||
|
//
|
||||||
|
aNb=myMSS.Extent();
|
||||||
|
for (i=1; i<=aNb; ++i) {
|
||||||
|
const TopoDS_Shape& aS=myMSS.FindKey(i);
|
||||||
|
if (aS.ShapeType()==myShapeType) {
|
||||||
|
pL->Append(aS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return myLS;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Perform
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_FinderShapeOn2::Perform()
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
myWarningStatus=0;
|
||||||
|
myLS.Clear();
|
||||||
|
myMSS.Clear();
|
||||||
|
//
|
||||||
|
CheckData();
|
||||||
|
if(myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
myClsf->SetTolerance(myTolerance);
|
||||||
|
//
|
||||||
|
// 1
|
||||||
|
ProcessVertices();
|
||||||
|
if(myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (myShapeType==TopAbs_VERTEX) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// 2
|
||||||
|
ProcessEdges();
|
||||||
|
if(myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (myShapeType==TopAbs_EDGE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// 3
|
||||||
|
ProcessFaces();
|
||||||
|
if(myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (myShapeType==TopAbs_FACE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// 4
|
||||||
|
ProcessSolids();
|
||||||
|
//
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : CheckData
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_FinderShapeOn2::CheckData()
|
||||||
|
{
|
||||||
|
Standard_Integer iErr;
|
||||||
|
//
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
if(myClsf.IsNull()) {
|
||||||
|
myErrorStatus=10; // myClsf=NULL
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
myClsf->CheckData();
|
||||||
|
iErr=myClsf->ErrorStatus();
|
||||||
|
if (iErr) {
|
||||||
|
myErrorStatus=41; // invalid data for classifier
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if (myShape.IsNull()) {
|
||||||
|
myErrorStatus=11; // myShape=NULL
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if (!(myShapeType==TopAbs_VERTEX ||
|
||||||
|
myShapeType==TopAbs_EDGE ||
|
||||||
|
myShapeType==TopAbs_FACE ||
|
||||||
|
myShapeType==TopAbs_SOLID)) {
|
||||||
|
myErrorStatus=12; // unallowed subshape type
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if (myState==GEOMAlgo_ST_UNKNOWN ||
|
||||||
|
myState==GEOMAlgo_ST_INOUT) {
|
||||||
|
myErrorStatus=13; // unallowed state type
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : ProcessVertices
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_FinderShapeOn2::ProcessVertices()
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
Standard_Boolean bIsConformState;
|
||||||
|
Standard_Integer i, aNb, iErr;
|
||||||
|
gp_Pnt aP;
|
||||||
|
TopTools_IndexedMapOfShape aM;
|
||||||
|
TopAbs_State aSt;
|
||||||
|
//
|
||||||
|
TopExp::MapShapes(myShape, TopAbs_VERTEX, aM);
|
||||||
|
aNb=aM.Extent();
|
||||||
|
for (i=1; i<=aNb; ++i) {
|
||||||
|
const TopoDS_Vertex& aV=TopoDS::Vertex(aM(i));
|
||||||
|
aP=BRep_Tool::Pnt(aV);
|
||||||
|
//
|
||||||
|
myClsf->SetPnt(aP);
|
||||||
|
myClsf->Perform();
|
||||||
|
iErr=myClsf->ErrorStatus();
|
||||||
|
if (iErr) {
|
||||||
|
myErrorStatus=40; // point can not be classified
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aSt=myClsf->State();
|
||||||
|
bIsConformState=GEOMAlgo_SurfaceTools::IsConformState(aSt, myState);
|
||||||
|
//
|
||||||
|
if (myShapeType==TopAbs_VERTEX){
|
||||||
|
if (bIsConformState) {
|
||||||
|
myMSS.Add(aV, aSt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (bIsConformState || aSt==TopAbs_ON) {
|
||||||
|
myMSS.Add(aV, aSt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : ProcessEdges
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_FinderShapeOn2::ProcessEdges()
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
Standard_Boolean bIsConformState, bIsToBreak;
|
||||||
|
Standard_Integer i, aNb, iCnt, iErr;
|
||||||
|
TopAbs_State aSt;
|
||||||
|
TopTools_IndexedMapOfShape aM;
|
||||||
|
TopExp_Explorer aExp;
|
||||||
|
GEOMAlgo_ListIteratorOfListOfPnt aIt;
|
||||||
|
//
|
||||||
|
TopExp::MapShapes(myShape, TopAbs_EDGE, aM);
|
||||||
|
aNb=aM.Extent();
|
||||||
|
for (i=1; i<=aNb; ++i) {
|
||||||
|
GEOMAlgo_ListOfPnt aLP;
|
||||||
|
GEOMAlgo_StateCollector aSC;
|
||||||
|
//
|
||||||
|
const TopoDS_Edge& aE=TopoDS::Edge(aM(i));
|
||||||
|
//
|
||||||
|
aExp.Init(aE, TopAbs_VERTEX);
|
||||||
|
for (; aExp.More(); aExp.Next()) {
|
||||||
|
const TopoDS_Shape& aV=aExp.Current();
|
||||||
|
//
|
||||||
|
bIsConformState=myMSS.Contains(aV);
|
||||||
|
if (!bIsConformState) {
|
||||||
|
break;// vertex has non-conformed state
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
aSt=myMSS.FindFromKey(aV);
|
||||||
|
aSC.AppendState(aSt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if (!bIsConformState) {
|
||||||
|
continue; // vertex has non-conformed state,skip edge
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if (BRep_Tool::Degenerated(aE)) {
|
||||||
|
myMSS.Add(aE, aSt);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if (myState==GEOMAlgo_ST_ON) {
|
||||||
|
Standard_Boolean bCanBeON;
|
||||||
|
Standard_Real aT1, aT2;
|
||||||
|
Handle(Geom_Curve) aC;
|
||||||
|
//
|
||||||
|
aC=BRep_Tool::Curve(aE, aT1, aT2);
|
||||||
|
bCanBeON=myClsf->CanBeON(aC);
|
||||||
|
if(!bCanBeON) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
InnerPoints(aE, aLP);
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
bIsConformState=Standard_True;
|
||||||
|
aIt.Initialize(aLP);
|
||||||
|
for (iCnt=0; aIt.More(); aIt.Next(), ++iCnt) {
|
||||||
|
if (myNbPntsMax) {
|
||||||
|
if (iCnt > myNbPntsMax) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
const gp_Pnt& aP=aIt.Value();
|
||||||
|
//
|
||||||
|
myClsf->SetPnt(aP);
|
||||||
|
myClsf->Perform();
|
||||||
|
iErr=myClsf->ErrorStatus();
|
||||||
|
if (iErr) {
|
||||||
|
myErrorStatus=40; // point can not be classified
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aSt=myClsf->State();
|
||||||
|
//
|
||||||
|
bIsToBreak=aSC.AppendState(aSt);
|
||||||
|
if (bIsToBreak) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aSt=aSC.State();
|
||||||
|
//
|
||||||
|
bIsConformState=GEOMAlgo_SurfaceTools::IsConformState(aSt, myState);
|
||||||
|
if (myShapeType==TopAbs_EDGE) {
|
||||||
|
if (bIsConformState) {
|
||||||
|
myMSS.Add(aE, aSt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (bIsConformState || aSt==TopAbs_ON) {
|
||||||
|
myMSS.Add(aE, aSt);
|
||||||
|
}
|
||||||
|
} // for (i=1; i<=aNb; ++i) next edge
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : ProcessFaces
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_FinderShapeOn2::ProcessFaces()
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
Standard_Boolean bIsConformState, bIsToBreak, bCanBeON;
|
||||||
|
Standard_Integer i, aNbF, iCnt, iErr;
|
||||||
|
TopAbs_State aSt;
|
||||||
|
TopTools_IndexedMapOfShape aM;
|
||||||
|
TopExp_Explorer aExp;
|
||||||
|
GEOMAlgo_ListIteratorOfListOfPnt aIt;
|
||||||
|
//
|
||||||
|
TopExp::MapShapes(myShape, TopAbs_FACE, aM);
|
||||||
|
aNbF=aM.Extent();
|
||||||
|
for (i=1; i<=aNbF; ++i) {
|
||||||
|
GEOMAlgo_StateCollector aSC;
|
||||||
|
GEOMAlgo_ListOfPnt aLP;
|
||||||
|
//
|
||||||
|
const TopoDS_Face& aF=TopoDS::Face(aM(i));
|
||||||
|
//
|
||||||
|
if (myState==GEOMAlgo_ST_ON) {
|
||||||
|
Handle(Geom_Surface) aS;
|
||||||
|
//
|
||||||
|
aS=BRep_Tool::Surface(aF);
|
||||||
|
bCanBeON=myClsf->CanBeON(aS);
|
||||||
|
if(!bCanBeON) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aExp.Init(aF, TopAbs_EDGE);
|
||||||
|
for (; aExp.More(); aExp.Next()) {
|
||||||
|
const TopoDS_Shape& aE=aExp.Current();
|
||||||
|
bIsConformState=myMSS.Contains(aE);
|
||||||
|
if (!bIsConformState) {
|
||||||
|
break;// edge has non-conformed state
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
aSt=myMSS.FindFromKey(aE);
|
||||||
|
aSC.AppendState(aSt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if (!bIsConformState) {
|
||||||
|
continue; // edge has non-conformed state,skip face
|
||||||
|
}
|
||||||
|
//
|
||||||
|
InnerPoints(aF, aLP);
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
bIsConformState=Standard_True;
|
||||||
|
aIt.Initialize(aLP);
|
||||||
|
for (iCnt=0; aIt.More(); aIt.Next(), ++iCnt) {
|
||||||
|
if (myNbPntsMax) {
|
||||||
|
if (iCnt > myNbPntsMax) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
const gp_Pnt& aP=aIt.Value();
|
||||||
|
//
|
||||||
|
myClsf->SetPnt(aP);
|
||||||
|
myClsf->Perform();
|
||||||
|
iErr=myClsf->ErrorStatus();
|
||||||
|
if (iErr) {
|
||||||
|
myErrorStatus=40; // point can not be classified
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aSt=myClsf->State();
|
||||||
|
//
|
||||||
|
bIsToBreak=aSC.AppendState(aSt);
|
||||||
|
if (bIsToBreak) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aSt=aSC.State();
|
||||||
|
//
|
||||||
|
bIsConformState=GEOMAlgo_SurfaceTools::IsConformState(aSt, myState);
|
||||||
|
if (myShapeType==TopAbs_FACE) {
|
||||||
|
if (bIsConformState) {
|
||||||
|
myMSS.Add(aF, aSt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (bIsConformState || aSt==TopAbs_ON) {
|
||||||
|
myMSS.Add(aF, aSt);
|
||||||
|
}
|
||||||
|
}// for (i=1; i<=aNb; ++i) next face
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : ProcessSolids
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_FinderShapeOn2::ProcessSolids()
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
Standard_Boolean bIsConformState;
|
||||||
|
Standard_Integer i, aNbS, j, aNbF;
|
||||||
|
TopTools_IndexedMapOfShape aM, aMF;
|
||||||
|
TopAbs_State aSt;
|
||||||
|
//
|
||||||
|
TopExp::MapShapes(myShape, TopAbs_SOLID, aM);
|
||||||
|
aNbS=aM.Extent();
|
||||||
|
for (i=1; i<=aNbS; ++i) {
|
||||||
|
GEOMAlgo_StateCollector aSC;
|
||||||
|
//
|
||||||
|
const TopoDS_Shape& aSd=aM(i);
|
||||||
|
aMF.Clear();
|
||||||
|
TopExp::MapShapes(aSd, TopAbs_FACE, aMF);
|
||||||
|
aNbF=aMF.Extent();
|
||||||
|
for (j=1; j<=aNbF; ++j) {
|
||||||
|
const TopoDS_Shape& aF=aMF(j);
|
||||||
|
bIsConformState=myMSS.Contains(aF);
|
||||||
|
if (!bIsConformState) {
|
||||||
|
break;// face has non-conformed state
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
aSt=myMSS.FindFromKey(aF);
|
||||||
|
aSC.AppendState(aSt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if (!bIsConformState) {
|
||||||
|
continue; // face has non-conformed state,skip solid
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aSt=aSC.State();
|
||||||
|
//
|
||||||
|
bIsConformState=GEOMAlgo_SurfaceTools::IsConformState(aSt, myState);
|
||||||
|
if (bIsConformState) {
|
||||||
|
myMSS.Add(aSd, aSt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
//=======================================================================
|
||||||
|
//function : InnerPoints
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_FinderShapeOn2::InnerPoints(const TopoDS_Face& aF,
|
||||||
|
GEOMAlgo_ListOfPnt& aLP)
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
Standard_Integer j, j1, j2, k, n[4], aNbLinks, aNx, aNb, iCnt;//, aNbMax, *pIds;
|
||||||
|
TopLoc_Location aLoc;
|
||||||
|
Handle(Poly_Triangulation) aTRF;
|
||||||
|
TColStd_MapOfInteger aMBN;
|
||||||
|
GEOMAlgo_DataMapOfPassKeyInteger aMPKI;
|
||||||
|
GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger aIt;
|
||||||
|
gp_Pnt aP, aP1, aP2;
|
||||||
|
//
|
||||||
|
aLP.Clear();
|
||||||
|
//
|
||||||
|
aTRF=BRep_Tool::Triangulation(aF, aLoc);
|
||||||
|
if (aTRF.IsNull()) {
|
||||||
|
myErrorStatus=20; // no triangulation found
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
const gp_Trsf& aTrsf=aLoc.Transformation();
|
||||||
|
const Poly_Array1OfTriangle& aTrs=aTRF->Triangles();
|
||||||
|
const TColgp_Array1OfPnt& aNodes=aTRF->Nodes();
|
||||||
|
//
|
||||||
|
// map link/nbtriangles
|
||||||
|
j1=aTrs.Lower();
|
||||||
|
j2=aTrs.Upper();
|
||||||
|
for (j=j1; j<=j2; ++j) {
|
||||||
|
const Poly_Triangle& aTr=aTrs(j);
|
||||||
|
aTr.Get(n[0], n[1], n[2]);
|
||||||
|
n[3]=n[0];
|
||||||
|
for (k=0; k<3; ++k) {
|
||||||
|
GEOMAlgo_PassKey aPK;
|
||||||
|
//
|
||||||
|
aPK.SetIds(n[k], n[k+1]);
|
||||||
|
if (aMPKI.IsBound(aPK)) {
|
||||||
|
Standard_Integer& iCntX=aMPKI.ChangeFind(aPK);
|
||||||
|
++iCntX;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
aMPKI.Bind(aPK, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// boundary nodes aMBN
|
||||||
|
aNbLinks=aMPKI.Extent();
|
||||||
|
aIt.Initialize(aMPKI);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
iCnt=aIt.Value();
|
||||||
|
if (iCnt==1) {
|
||||||
|
const GEOMAlgo_PassKey& aPK=aIt.Key();
|
||||||
|
//qf
|
||||||
|
/*
|
||||||
|
aNbMax=aPK.NbMax();
|
||||||
|
pIds=(Standard_Integer*)aPK.Key();
|
||||||
|
for (k=1; k<3; ++k) {
|
||||||
|
aNx=*(pIds+aNbMax-k);
|
||||||
|
aMBN.Add(aNx);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
aNx=(Standard_Integer)aPK.Id(1);
|
||||||
|
aMBN.Add(aNx);
|
||||||
|
aNx=(Standard_Integer)aPK.Id(2);
|
||||||
|
aMBN.Add(aNx);
|
||||||
|
//qt
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// inner nodes=all_nodes - boundary_nodes
|
||||||
|
j1=aNodes.Lower();
|
||||||
|
j2=aNodes.Upper();
|
||||||
|
for (j=j1; j<=j2; ++j) {
|
||||||
|
if (!aMBN.Contains(j)) {
|
||||||
|
aP=aNodes(j).Transformed(aTrsf);
|
||||||
|
aLP.Append(aP);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aNb=aLP.Extent();
|
||||||
|
//
|
||||||
|
if (!aNb && myNbPntsMin) {
|
||||||
|
// try to fill it yourself
|
||||||
|
Standard_Boolean bIsDone;
|
||||||
|
Standard_Integer aN1, aN2;
|
||||||
|
Handle(Geom_Surface) aS;
|
||||||
|
GeomAdaptor_Surface aGAS;
|
||||||
|
GeomAbs_SurfaceType aType;
|
||||||
|
//
|
||||||
|
aS=BRep_Tool::Surface(aF);
|
||||||
|
aGAS.Load(aS);
|
||||||
|
aType=aGAS.GetType();
|
||||||
|
if (aType==GeomAbs_Plane || aType==GeomAbs_Cylinder) {
|
||||||
|
// inner links
|
||||||
|
aNbLinks=aMPKI.Extent();
|
||||||
|
aIt.Initialize(aMPKI);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
iCnt=aIt.Value();
|
||||||
|
if (iCnt>1) {
|
||||||
|
// take the first having occured inner link
|
||||||
|
// and discretize it
|
||||||
|
const GEOMAlgo_PassKey& aPK=aIt.Key();
|
||||||
|
//qf
|
||||||
|
/*
|
||||||
|
aNbMax=aPK.NbMax();
|
||||||
|
pIds=(Standard_Integer*)aPK.Key();
|
||||||
|
aN1=*(pIds+aNbMax-1);
|
||||||
|
aN2=*(pIds+aNbMax-2);
|
||||||
|
*/
|
||||||
|
//
|
||||||
|
aN1=(Standard_Integer)aPK.Id(1);
|
||||||
|
aN2=(Standard_Integer)aPK.Id(2);
|
||||||
|
//qt
|
||||||
|
aP1=aNodes(aN1).Transformed(aTrsf);
|
||||||
|
aP2=aNodes(aN2).Transformed(aTrsf);
|
||||||
|
//
|
||||||
|
if (aType==GeomAbs_Cylinder) {
|
||||||
|
Standard_Real aTolSM;
|
||||||
|
gp_Cylinder aCyl;
|
||||||
|
//
|
||||||
|
aTolSM=1.523e-6;//~1.-cos(0.1 deg)
|
||||||
|
aCyl=aGAS.Cylinder();
|
||||||
|
if (!GEOMAlgo_SurfaceTools::IsCoaxial(aP1, aP2, aCyl, aTolSM)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
BRepLib_MakeEdge aBME(aP1, aP2);
|
||||||
|
bIsDone=aBME.IsDone();
|
||||||
|
if (!bIsDone) {
|
||||||
|
myErrorStatus=30; //can not obtain the line fron the link
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
const TopoDS_Shape& aSx=aBME.Shape();
|
||||||
|
const TopoDS_Edge& aE=TopoDS::Edge(aSx);
|
||||||
|
//
|
||||||
|
InnerPoints(aE, myNbPntsMin, aLP);
|
||||||
|
break;
|
||||||
|
}// if (iCnt>1)
|
||||||
|
}// for (; aIt.More(); aIt.Next())
|
||||||
|
}// if (aType==GeomAbs_Plane || aType==GeomAbs_Cylinder)
|
||||||
|
}// if (!aNb && myNbPntsMin) {
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : InnerPoints
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_FinderShapeOn2::InnerPoints(const TopoDS_Edge& aE,
|
||||||
|
GEOMAlgo_ListOfPnt& aLP)
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
//
|
||||||
|
Standard_Integer j, aNbNodes, aIndex, aNb;
|
||||||
|
Handle(Poly_PolygonOnTriangulation) aPTE;
|
||||||
|
Handle(Poly_Triangulation) aTRE;
|
||||||
|
TopLoc_Location aLoc;
|
||||||
|
gp_Pnt aP;
|
||||||
|
//
|
||||||
|
aLP.Clear();
|
||||||
|
BRep_Tool::PolygonOnTriangulation(aE, aPTE, aTRE, aLoc);
|
||||||
|
if (aTRE.IsNull() || aPTE.IsNull()) {
|
||||||
|
myErrorStatus=20; // no triangulation found
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
const gp_Trsf& aTrsf=aLoc.Transformation();
|
||||||
|
const TColgp_Array1OfPnt& aNodes=aTRE->Nodes();
|
||||||
|
//
|
||||||
|
aNbNodes=aPTE->NbNodes();
|
||||||
|
const TColStd_Array1OfInteger& aInds=aPTE->Nodes();
|
||||||
|
for (j=2; j<aNbNodes; ++j) {
|
||||||
|
aIndex=aInds(j);
|
||||||
|
aP=aNodes(aIndex).Transformed(aTrsf);
|
||||||
|
aLP.Append(aP);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aNb=aLP.Extent();
|
||||||
|
if (!aNb && myNbPntsMin) {
|
||||||
|
// try to fill it yourself
|
||||||
|
InnerPoints(aE, myNbPntsMin, aLP);
|
||||||
|
aNb=aLP.Extent();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : InnerPoints
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_FinderShapeOn2::InnerPoints(const TopoDS_Edge& aE,
|
||||||
|
const Standard_Integer aNbPntsMin,
|
||||||
|
GEOMAlgo_ListOfPnt& aLP)
|
||||||
|
{
|
||||||
|
// try to fill it yourself
|
||||||
|
Standard_Boolean bInf1, bInf2;
|
||||||
|
Standard_Integer j, aNbT;
|
||||||
|
Standard_Real dT, aT, aT1, aT2;
|
||||||
|
gp_Pnt aP;
|
||||||
|
Handle(Geom_Curve) aC3D;
|
||||||
|
//
|
||||||
|
aC3D=BRep_Tool::Curve(aE, aT1, aT2);
|
||||||
|
if (aC3D.IsNull()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
bInf1=Precision::IsNegativeInfinite(aT1);
|
||||||
|
bInf2=Precision::IsPositiveInfinite(aT2);
|
||||||
|
if (bInf1 || bInf2) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aNbT=myNbPntsMin+1;
|
||||||
|
dT=(aT2-aT1)/aNbT;
|
||||||
|
for (j=1; j<=aNbPntsMin; ++j) {
|
||||||
|
aT=aT1+j*dT;
|
||||||
|
aC3D->D0(aT, aP);
|
||||||
|
aLP.Append(aP);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// myErrorStatus :
|
||||||
|
//
|
||||||
|
// 10 -myClsf=NULL
|
||||||
|
// 11 -myShape=NULL
|
||||||
|
// 12 -unallowed type of subshapes
|
||||||
|
// 13 -unallowed state
|
||||||
|
// 15 -unallowed surface type
|
||||||
|
// 20- no triangulation found
|
||||||
|
// 30- can not obtain the line from the link
|
||||||
|
// 40- point can not be classified
|
||||||
|
// 41- invalid data for classifier
|
||||||
|
|
187
src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.hxx
Normal file
187
src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.hxx
Normal file
@ -0,0 +1,187 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _GEOMAlgo_FinderShapeOn2_HeaderFile
|
||||||
|
#define _GEOMAlgo_FinderShapeOn2_HeaderFile
|
||||||
|
|
||||||
|
#ifndef _TopAbs_ShapeEnum_HeaderFile
|
||||||
|
#include <TopAbs_ShapeEnum.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_State_HeaderFile
|
||||||
|
#include <GEOMAlgo_State.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Integer_HeaderFile
|
||||||
|
#include <Standard_Integer.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Handle_GEOMAlgo_Clsf_HeaderFile
|
||||||
|
#include <Handle_GEOMAlgo_Clsf.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopTools_ListOfShape_HeaderFile
|
||||||
|
#include <TopTools_ListOfShape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_IndexedDataMapOfShapeState_HeaderFile
|
||||||
|
#include <GEOMAlgo_IndexedDataMapOfShapeState.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_ShapeAlgo_HeaderFile
|
||||||
|
#include <GEOMAlgo_ShapeAlgo.hxx>
|
||||||
|
#endif
|
||||||
|
class GEOMAlgo_Clsf;
|
||||||
|
class TopTools_ListOfShape;
|
||||||
|
class TopoDS_Face;
|
||||||
|
class GEOMAlgo_ListOfPnt;
|
||||||
|
class TopoDS_Edge;
|
||||||
|
class GEOMAlgo_IndexedDataMapOfShapeState;
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _Standard_HeaderFile
|
||||||
|
#include <Standard.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Macro_HeaderFile
|
||||||
|
#include <Standard_Macro.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
class GEOMAlgo_FinderShapeOn2 : public GEOMAlgo_ShapeAlgo {
|
||||||
|
|
||||||
|
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 GEOMAlgo_FinderShapeOn2();
|
||||||
|
Standard_EXPORT virtual ~GEOMAlgo_FinderShapeOn2();
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT void SetClsf(const Handle(GEOMAlgo_Clsf)& aClsf) ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT const Handle_GEOMAlgo_Clsf& Clsf() const;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT void SetShapeType(const TopAbs_ShapeEnum aST) ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT TopAbs_ShapeEnum ShapeType() const;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT void SetState(const GEOMAlgo_State aSF) ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT GEOMAlgo_State State() const;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT void SetNbPntsMin(const Standard_Integer aNb) ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT Standard_Integer NbPntsMin() const;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT void SetNbPntsMax(const Standard_Integer aNb) ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT Standard_Integer NbPntsMax() const;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT virtual void Perform() ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT const TopTools_ListOfShape& Shapes() const;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT const GEOMAlgo_IndexedDataMapOfShapeState& MSS() const;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Methods PROTECTED
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT virtual void CheckData() ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT void ProcessVertices() ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT void ProcessEdges() ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT void ProcessFaces() ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT void ProcessSolids() ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT void InnerPoints(const TopoDS_Face& aF,GEOMAlgo_ListOfPnt& aLP) ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT void InnerPoints(const TopoDS_Edge& aE,GEOMAlgo_ListOfPnt& aLP) ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT void InnerPoints(const TopoDS_Edge& aE,const Standard_Integer aNbPnts,GEOMAlgo_ListOfPnt& aLP) ;
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PROTECTED
|
||||||
|
//
|
||||||
|
TopAbs_ShapeEnum myShapeType;
|
||||||
|
GEOMAlgo_State myState;
|
||||||
|
Standard_Integer myNbPntsMin;
|
||||||
|
Standard_Integer myNbPntsMax;
|
||||||
|
Handle_GEOMAlgo_Clsf myClsf;
|
||||||
|
TopTools_ListOfShape myLS;
|
||||||
|
GEOMAlgo_IndexedDataMapOfShapeState myMSS;
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Methods PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// other Inline functions and methods (like "C++: function call" methods)
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
24
src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.ixx
Normal file
24
src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.ixx
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#include <GEOMAlgo_FinderShapeOn2.jxx>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
40
src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.jxx
Normal file
40
src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.jxx
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _GEOMAlgo_Clsf_HeaderFile
|
||||||
|
#include <GEOMAlgo_Clsf.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopTools_ListOfShape_HeaderFile
|
||||||
|
#include <TopTools_ListOfShape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopoDS_Face_HeaderFile
|
||||||
|
#include <TopoDS_Face.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_ListOfPnt_HeaderFile
|
||||||
|
#include <GEOMAlgo_ListOfPnt.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopoDS_Edge_HeaderFile
|
||||||
|
#include <TopoDS_Edge.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_IndexedDataMapOfShapeState_HeaderFile
|
||||||
|
#include <GEOMAlgo_IndexedDataMapOfShapeState.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_FinderShapeOn2_HeaderFile
|
||||||
|
#include <GEOMAlgo_FinderShapeOn2.hxx>
|
||||||
|
#endif
|
57
src/GEOMAlgo/GEOMAlgo_HAlgo.cdl
Normal file
57
src/GEOMAlgo/GEOMAlgo_HAlgo.cdl
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
-- Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
--
|
||||||
|
-- This library is free software; you can redistribute it and/or
|
||||||
|
-- modify it under the terms of the GNU Lesser General Public
|
||||||
|
-- License as published by the Free Software Foundation; either
|
||||||
|
-- version 2.1 of the License.
|
||||||
|
--
|
||||||
|
-- This library is distributed in the hope that it will be useful
|
||||||
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
-- Lesser General Public License for more details.
|
||||||
|
--
|
||||||
|
-- You should have received a copy of the GNU Lesser General Public
|
||||||
|
-- License along with this library; if not, write to the Free Software
|
||||||
|
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
--
|
||||||
|
-- See http:--www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
--
|
||||||
|
-- File: GEOMAlgo_Algo.cdl
|
||||||
|
-- Created: Sat Dec 04 12:37:56 2004
|
||||||
|
-- Author: Peter KURNEV
|
||||||
|
-- <peter@PREFEX>
|
||||||
|
|
||||||
|
|
||||||
|
deferred class HAlgo from GEOMAlgo
|
||||||
|
inherits TShared from MMgt
|
||||||
|
---Purpose:
|
||||||
|
|
||||||
|
--uses
|
||||||
|
--raises
|
||||||
|
|
||||||
|
is
|
||||||
|
Initialize
|
||||||
|
returns mutable HAlgo from GEOMAlgo;
|
||||||
|
---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_HAlgo();"
|
||||||
|
|
||||||
|
Perform(me:mutable)
|
||||||
|
is deferred;
|
||||||
|
|
||||||
|
CheckData(me:mutable)
|
||||||
|
is virtual;
|
||||||
|
|
||||||
|
CheckResult(me:mutable)
|
||||||
|
is virtual;
|
||||||
|
|
||||||
|
ErrorStatus (me)
|
||||||
|
returns Integer from Standard;
|
||||||
|
|
||||||
|
WarningStatus (me)
|
||||||
|
returns Integer from Standard;
|
||||||
|
|
||||||
|
fields
|
||||||
|
myErrorStatus : Integer from Standard is protected;
|
||||||
|
myWarningStatus : Integer from Standard is protected;
|
||||||
|
|
||||||
|
end HAlgo;
|
78
src/GEOMAlgo/GEOMAlgo_HAlgo.cxx
Normal file
78
src/GEOMAlgo/GEOMAlgo_HAlgo.cxx
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
//
|
||||||
|
// File: GEOMAlgo_Algo.cxx
|
||||||
|
// Created: Sat Dec 04 12:39:47 2004
|
||||||
|
// Author: Peter KURNEV
|
||||||
|
// <peter@PREFEX>
|
||||||
|
|
||||||
|
|
||||||
|
#include <GEOMAlgo_HAlgo.ixx>
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
// function:
|
||||||
|
// purpose:
|
||||||
|
//=======================================================================
|
||||||
|
GEOMAlgo_HAlgo::GEOMAlgo_HAlgo()
|
||||||
|
:
|
||||||
|
myErrorStatus(1),
|
||||||
|
myWarningStatus(0)
|
||||||
|
{}
|
||||||
|
//=======================================================================
|
||||||
|
// function: ~
|
||||||
|
// purpose:
|
||||||
|
//=======================================================================
|
||||||
|
GEOMAlgo_HAlgo::~GEOMAlgo_HAlgo()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
// function: CheckData
|
||||||
|
// purpose:
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_HAlgo::CheckData()
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
// function: CheckResult
|
||||||
|
// purpose:
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_HAlgo::CheckResult()
|
||||||
|
{
|
||||||
|
myErrorStatus=0;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
// function: ErrorStatus
|
||||||
|
// purpose:
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Integer GEOMAlgo_HAlgo::ErrorStatus()const
|
||||||
|
{
|
||||||
|
return myErrorStatus;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
// function: WarningStatus
|
||||||
|
// purpose:
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Integer GEOMAlgo_HAlgo::WarningStatus()const
|
||||||
|
{
|
||||||
|
return myWarningStatus;
|
||||||
|
}
|
||||||
|
// myErrorStatus
|
||||||
|
//
|
||||||
|
// 1 - object is just initialized
|
105
src/GEOMAlgo/GEOMAlgo_HAlgo.hxx
Normal file
105
src/GEOMAlgo/GEOMAlgo_HAlgo.hxx
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _GEOMAlgo_HAlgo_HeaderFile
|
||||||
|
#define _GEOMAlgo_HAlgo_HeaderFile
|
||||||
|
|
||||||
|
#ifndef _Standard_HeaderFile
|
||||||
|
#include <Standard.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Handle_GEOMAlgo_HAlgo_HeaderFile
|
||||||
|
#include <Handle_GEOMAlgo_HAlgo.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _Standard_Integer_HeaderFile
|
||||||
|
#include <Standard_Integer.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _MMgt_TShared_HeaderFile
|
||||||
|
#include <MMgt_TShared.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class GEOMAlgo_HAlgo : public MMgt_TShared {
|
||||||
|
|
||||||
|
public:
|
||||||
|
// Methods PUBLIC
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT virtual void Perform() = 0;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT virtual void CheckData() ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT virtual void CheckResult() ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT Standard_Integer ErrorStatus() const;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT Standard_Integer WarningStatus() const;
|
||||||
|
//Standard_EXPORT ~GEOMAlgo_HAlgo();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Type management
|
||||||
|
//
|
||||||
|
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
|
||||||
|
//Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Methods PROTECTED
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT GEOMAlgo_HAlgo();
|
||||||
|
Standard_EXPORT virtual ~GEOMAlgo_HAlgo();
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PROTECTED
|
||||||
|
//
|
||||||
|
Standard_Integer myErrorStatus;
|
||||||
|
Standard_Integer myWarningStatus;
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Methods PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// other Inline functions and methods (like "C++: function call" methods)
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
72
src/GEOMAlgo/GEOMAlgo_HAlgo.ixx
Normal file
72
src/GEOMAlgo/GEOMAlgo_HAlgo.ixx
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#include <GEOMAlgo_HAlgo.jxx>
|
||||||
|
|
||||||
|
#ifndef _Standard_TypeMismatch_HeaderFile
|
||||||
|
#include <Standard_TypeMismatch.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//GEOMAlgo_HAlgo::~GEOMAlgo_HAlgo() {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT Handle_Standard_Type& GEOMAlgo_HAlgo_Type_()
|
||||||
|
{
|
||||||
|
|
||||||
|
static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared);
|
||||||
|
static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient);
|
||||||
|
|
||||||
|
|
||||||
|
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL};
|
||||||
|
static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_HAlgo",
|
||||||
|
sizeof(GEOMAlgo_HAlgo),
|
||||||
|
1,
|
||||||
|
(Standard_Address)_Ancestors,
|
||||||
|
(Standard_Address)NULL);
|
||||||
|
|
||||||
|
return _aType;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// DownCast method
|
||||||
|
// allow safe downcasting
|
||||||
|
//
|
||||||
|
const Handle(GEOMAlgo_HAlgo) Handle(GEOMAlgo_HAlgo)::DownCast(const Handle(Standard_Transient)& AnObject)
|
||||||
|
{
|
||||||
|
Handle(GEOMAlgo_HAlgo) _anOtherObject;
|
||||||
|
|
||||||
|
if (!AnObject.IsNull()) {
|
||||||
|
if (AnObject->IsKind(STANDARD_TYPE(GEOMAlgo_HAlgo))) {
|
||||||
|
_anOtherObject = Handle(GEOMAlgo_HAlgo)((Handle(GEOMAlgo_HAlgo)&)AnObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return _anOtherObject ;
|
||||||
|
}
|
||||||
|
const Handle(Standard_Type)& GEOMAlgo_HAlgo::DynamicType() const
|
||||||
|
{
|
||||||
|
return STANDARD_TYPE(GEOMAlgo_HAlgo) ;
|
||||||
|
}
|
||||||
|
//Standard_Boolean GEOMAlgo_HAlgo::IsKind(const Handle(Standard_Type)& AType) const
|
||||||
|
//{
|
||||||
|
// return (STANDARD_TYPE(GEOMAlgo_HAlgo) == AType || MMgt_TShared::IsKind(AType));
|
||||||
|
//}
|
||||||
|
//Handle_GEOMAlgo_HAlgo::~Handle_GEOMAlgo_HAlgo() {}
|
||||||
|
|
22
src/GEOMAlgo/GEOMAlgo_HAlgo.jxx
Normal file
22
src/GEOMAlgo/GEOMAlgo_HAlgo.jxx
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _GEOMAlgo_HAlgo_HeaderFile
|
||||||
|
#include <GEOMAlgo_HAlgo.hxx>
|
||||||
|
#endif
|
27
src/GEOMAlgo/GEOMAlgo_PWireEdgeSet.hxx
Normal file
27
src/GEOMAlgo/GEOMAlgo_PWireEdgeSet.hxx
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _GEOMAlgo_PWireEdgeSet_HeaderFile
|
||||||
|
#define _GEOMAlgo_PWireEdgeSet_HeaderFile
|
||||||
|
|
||||||
|
class GEOMAlgo_WireEdgeSet;
|
||||||
|
|
||||||
|
typedef GEOMAlgo_WireEdgeSet* GEOMAlgo_PWireEdgeSet;
|
||||||
|
|
||||||
|
#endif
|
47
src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.cdl
Normal file
47
src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.cdl
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
-- Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
--
|
||||||
|
-- This library is free software; you can redistribute it and/or
|
||||||
|
-- modify it under the terms of the GNU Lesser General Public
|
||||||
|
-- License as published by the Free Software Foundation; either
|
||||||
|
-- version 2.1 of the License.
|
||||||
|
--
|
||||||
|
-- This library is distributed in the hope that it will be useful
|
||||||
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
-- Lesser General Public License for more details.
|
||||||
|
--
|
||||||
|
-- You should have received a copy of the GNU Lesser General Public
|
||||||
|
-- License along with this library; if not, write to the Free Software
|
||||||
|
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
--
|
||||||
|
-- See http:--www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
--
|
||||||
|
-- File: GEOMAlgo_PassKeyMapHasher.cdl
|
||||||
|
-- Created:
|
||||||
|
-- Author: Peter KURNEV
|
||||||
|
-- <pkv@irinox>
|
||||||
|
|
||||||
|
|
||||||
|
class PassKeyShapeMapHasher from GEOMAlgo
|
||||||
|
|
||||||
|
---Purpose:
|
||||||
|
|
||||||
|
uses
|
||||||
|
PassKeyShape from GEOMAlgo
|
||||||
|
|
||||||
|
--raises
|
||||||
|
|
||||||
|
is
|
||||||
|
HashCode(myclass;
|
||||||
|
aPKey : PassKeyShape from GEOMAlgo;
|
||||||
|
Upper : Integer from Standard)
|
||||||
|
returns Integer from Standard;
|
||||||
|
|
||||||
|
|
||||||
|
IsEqual(myclass;
|
||||||
|
aPKey1 : PassKeyShape from GEOMAlgo;
|
||||||
|
aPKey2 : PassKeyShape from GEOMAlgo)
|
||||||
|
returns Boolean from Standard;
|
||||||
|
|
||||||
|
end PassKeyShapeMapHasher;
|
45
src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.cxx
Normal file
45
src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.cxx
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
//
|
||||||
|
// File: GEOMAlgo_PassKeyMapHasher.cxx
|
||||||
|
// Created:
|
||||||
|
// Author: Peter KURNEV
|
||||||
|
// <pkv@irinox>
|
||||||
|
|
||||||
|
|
||||||
|
#include <GEOMAlgo_PassKeyShapeMapHasher.ixx>
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : HashCode
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Integer GEOMAlgo_PassKeyShapeMapHasher::HashCode(const GEOMAlgo_PassKeyShape& aPK,
|
||||||
|
const Standard_Integer Upper)
|
||||||
|
{
|
||||||
|
return aPK.HashCode(Upper);
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function :IsEqual
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean GEOMAlgo_PassKeyShapeMapHasher::IsEqual(const GEOMAlgo_PassKeyShape& aPK1,
|
||||||
|
const GEOMAlgo_PassKeyShape& aPK2)
|
||||||
|
{
|
||||||
|
return aPK1.IsEqual(aPK2);
|
||||||
|
}
|
99
src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.hxx
Normal file
99
src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.hxx
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _GEOMAlgo_PassKeyShapeMapHasher_HeaderFile
|
||||||
|
#define _GEOMAlgo_PassKeyShapeMapHasher_HeaderFile
|
||||||
|
|
||||||
|
#ifndef _Standard_Integer_HeaderFile
|
||||||
|
#include <Standard_Integer.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Boolean_HeaderFile
|
||||||
|
#include <Standard_Boolean.hxx>
|
||||||
|
#endif
|
||||||
|
class GEOMAlgo_PassKeyShape;
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _Standard_HeaderFile
|
||||||
|
#include <Standard.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Macro_HeaderFile
|
||||||
|
#include <Standard_Macro.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
class GEOMAlgo_PassKeyShapeMapHasher {
|
||||||
|
|
||||||
|
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 static Standard_Integer HashCode(const GEOMAlgo_PassKeyShape& aPKey,const Standard_Integer Upper) ;
|
||||||
|
|
||||||
|
|
||||||
|
Standard_EXPORT static Standard_Boolean IsEqual(const GEOMAlgo_PassKeyShape& aPKey1,const GEOMAlgo_PassKeyShape& aPKey2) ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Methods PROTECTED
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PROTECTED
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Methods PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// other Inline functions and methods (like "C++: function call" methods)
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
24
src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.ixx
Normal file
24
src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.ixx
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#include <GEOMAlgo_PassKeyShapeMapHasher.jxx>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
25
src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.jxx
Normal file
25
src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.jxx
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _GEOMAlgo_PassKeyShape_HeaderFile
|
||||||
|
#include <GEOMAlgo_PassKeyShape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _GEOMAlgo_PassKeyShapeMapHasher_HeaderFile
|
||||||
|
#include <GEOMAlgo_PassKeyShapeMapHasher.hxx>
|
||||||
|
#endif
|
78
src/GEOMAlgo/GEOMAlgo_ShapeSet.cdl
Executable file
78
src/GEOMAlgo/GEOMAlgo_ShapeSet.cdl
Executable file
@ -0,0 +1,78 @@
|
|||||||
|
-- Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
--
|
||||||
|
-- This library is free software; you can redistribute it and/or
|
||||||
|
-- modify it under the terms of the GNU Lesser General Public
|
||||||
|
-- License as published by the Free Software Foundation; either
|
||||||
|
-- version 2.1 of the License.
|
||||||
|
--
|
||||||
|
-- This library is distributed in the hope that it will be useful
|
||||||
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
-- Lesser General Public License for more details.
|
||||||
|
--
|
||||||
|
-- You should have received a copy of the GNU Lesser General Public
|
||||||
|
-- License along with this library; if not, write to the Free Software
|
||||||
|
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
--
|
||||||
|
-- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
--
|
||||||
|
-- File: GEOMAlgo_ShapeSet.cdl
|
||||||
|
-- Created:
|
||||||
|
-- Author: Peter KURNEV
|
||||||
|
|
||||||
|
class ShapeSet from GEOMAlgo
|
||||||
|
|
||||||
|
---Purpose: Implementation some formal
|
||||||
|
-- opereations with Set of shapes
|
||||||
|
|
||||||
|
uses
|
||||||
|
Shape from TopoDS,
|
||||||
|
MapOfOrientedShape from TopTools,
|
||||||
|
ListOfShape from TopTools,
|
||||||
|
ShapeEnum from TopAbs
|
||||||
|
|
||||||
|
--raises
|
||||||
|
|
||||||
|
is
|
||||||
|
Create
|
||||||
|
---Purpose: Empty constructor
|
||||||
|
returns ShapeSet from GEOMAlgo;
|
||||||
|
|
||||||
|
Add(me:out;
|
||||||
|
theLS:ListOfShape from TopTools);
|
||||||
|
---Purpose: Adds shapes from the list theLS to the Set
|
||||||
|
|
||||||
|
Add(me:out;
|
||||||
|
theShape:Shape from TopoDS);
|
||||||
|
---Purpose: Adds shape theShape to the Set
|
||||||
|
|
||||||
|
Add(me:out;
|
||||||
|
theShape:Shape from TopoDS;
|
||||||
|
theType :ShapeEnum from TopAbs);
|
||||||
|
---Purpose: Adds sub-shapes of shape theShape,
|
||||||
|
-- that have type theType to the Set
|
||||||
|
|
||||||
|
Subtract(me:out;
|
||||||
|
theSet:ShapeSet from GEOMAlgo);
|
||||||
|
---Purpose: Removes shapes of theSet from the Set
|
||||||
|
|
||||||
|
Clear(me:out);
|
||||||
|
---Purpose: Clears internal fields
|
||||||
|
|
||||||
|
Contains(me;
|
||||||
|
theSet:ShapeSet from GEOMAlgo)
|
||||||
|
---Purpose: Returns True if the Set contains
|
||||||
|
-- all shapes of theSet
|
||||||
|
returns Boolean from Standard;
|
||||||
|
|
||||||
|
GetSet(me)
|
||||||
|
---Purpose: Returns the Set
|
||||||
|
returns ListOfShape from TopTools;
|
||||||
|
---C++: return const &
|
||||||
|
|
||||||
|
fields
|
||||||
|
myMap : MapOfOrientedShape from TopTools is protected;
|
||||||
|
myList : ListOfShape from TopTools is protected;
|
||||||
|
|
||||||
|
end ShapeSet;
|
167
src/GEOMAlgo/GEOMAlgo_ShapeSet.cxx
Executable file
167
src/GEOMAlgo/GEOMAlgo_ShapeSet.cxx
Executable file
@ -0,0 +1,167 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
//
|
||||||
|
// File: GEOMAlgo_ShapeSet.cxx
|
||||||
|
// Created:
|
||||||
|
// Author: Peter KURNEV
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include <GEOMAlgo_ShapeSet.ixx>
|
||||||
|
|
||||||
|
#include <TopExp_Explorer.hxx>
|
||||||
|
|
||||||
|
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||||
|
#include <TopTools_MapIteratorOfMapOfOrientedShape.hxx>
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function :
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
GEOMAlgo_ShapeSet::GEOMAlgo_ShapeSet()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Clear
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_ShapeSet::Clear()
|
||||||
|
{
|
||||||
|
myMap.Clear();
|
||||||
|
myList.Clear();
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Add
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_ShapeSet::Add(const TopoDS_Shape& theShape)
|
||||||
|
{
|
||||||
|
if (myMap.Add(theShape)) {
|
||||||
|
myList.Append(theShape);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Add
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_ShapeSet::Add(const TopoDS_Shape& theShape,
|
||||||
|
const TopAbs_ShapeEnum theType)
|
||||||
|
{
|
||||||
|
TopExp_Explorer aExp;
|
||||||
|
//
|
||||||
|
aExp.Init(theShape, theType);
|
||||||
|
for (; aExp.More(); aExp.Next()) {
|
||||||
|
const TopoDS_Shape& aS=aExp.Current();
|
||||||
|
if (myMap.Add(aS)) {
|
||||||
|
myList.Append(aS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Add
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_ShapeSet::Add(const TopTools_ListOfShape& theLS)
|
||||||
|
{
|
||||||
|
TopTools_ListIteratorOfListOfShape aIt;
|
||||||
|
//
|
||||||
|
aIt.Initialize(theLS);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aS=aIt.Value();
|
||||||
|
if (myMap.Add(aS)) {
|
||||||
|
myList.Append(aS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function :GetSet
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
const TopTools_ListOfShape& GEOMAlgo_ShapeSet::GetSet()const
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
TopTools_ListOfShape *pL;
|
||||||
|
TopTools_MapIteratorOfMapOfOrientedShape aIt;
|
||||||
|
//
|
||||||
|
pL=(TopTools_ListOfShape *)&myList;
|
||||||
|
pL->Clear();
|
||||||
|
aIt.Initialize(myMap);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
pL->Append(aIt.Key());
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
return myList;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Contains
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean GEOMAlgo_ShapeSet::Contains(const GEOMAlgo_ShapeSet& theOther)const
|
||||||
|
{
|
||||||
|
Standard_Boolean bRet;
|
||||||
|
TopAbs_Orientation aOr;
|
||||||
|
TopTools_ListIteratorOfListOfShape aIt;
|
||||||
|
//
|
||||||
|
bRet=Standard_True;
|
||||||
|
const TopTools_ListOfShape& aLS=theOther.GetSet();
|
||||||
|
aIt.Initialize(aLS);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aF=aIt.Value();
|
||||||
|
aOr=aF.Orientation();
|
||||||
|
if (aOr==TopAbs_FORWARD || aOr==TopAbs_REVERSED) {
|
||||||
|
bRet=myMap.Contains(aF);
|
||||||
|
if (!bRet) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return bRet;
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Subtract
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_ShapeSet::Subtract(const GEOMAlgo_ShapeSet& theOther)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
TopTools_MapIteratorOfMapOfOrientedShape aIt;
|
||||||
|
//
|
||||||
|
aIt.Initialize(theOther.myMap);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aS=aIt.Key();
|
||||||
|
myMap.Remove(aS);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
//
|
||||||
|
TopTools_ListIteratorOfListOfShape aIt;
|
||||||
|
TopTools_ListOfShape aLS;
|
||||||
|
//
|
||||||
|
myMap.Clear();
|
||||||
|
aIt.Initialize(myList);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aS=aIt.Value();
|
||||||
|
if (!theOther.myMap.Contains(aS)) {
|
||||||
|
if(myMap.Add(aS)){
|
||||||
|
aLS.Append(aS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
myList=aLS;
|
||||||
|
}
|
129
src/GEOMAlgo/GEOMAlgo_ShapeSet.hxx
Normal file
129
src/GEOMAlgo/GEOMAlgo_ShapeSet.hxx
Normal file
@ -0,0 +1,129 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#ifndef _GEOMAlgo_ShapeSet_HeaderFile
|
||||||
|
#define _GEOMAlgo_ShapeSet_HeaderFile
|
||||||
|
|
||||||
|
#ifndef _TopTools_MapOfOrientedShape_HeaderFile
|
||||||
|
#include <TopTools_MapOfOrientedShape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopTools_ListOfShape_HeaderFile
|
||||||
|
#include <TopTools_ListOfShape.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _TopAbs_ShapeEnum_HeaderFile
|
||||||
|
#include <TopAbs_ShapeEnum.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Boolean_HeaderFile
|
||||||
|
#include <Standard_Boolean.hxx>
|
||||||
|
#endif
|
||||||
|
class TopTools_ListOfShape;
|
||||||
|
class TopoDS_Shape;
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _Standard_HeaderFile
|
||||||
|
#include <Standard.hxx>
|
||||||
|
#endif
|
||||||
|
#ifndef _Standard_Macro_HeaderFile
|
||||||
|
#include <Standard_Macro.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//! Implementation some formal <br>
|
||||||
|
//! opereations with Set of shapes <br>
|
||||||
|
class GEOMAlgo_ShapeSet {
|
||||||
|
|
||||||
|
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
|
||||||
|
//
|
||||||
|
|
||||||
|
//! Empty constructor <br>
|
||||||
|
Standard_EXPORT GEOMAlgo_ShapeSet();
|
||||||
|
|
||||||
|
//! Adds shapes from the list theLS to the Set <br>
|
||||||
|
Standard_EXPORT void Add(const TopTools_ListOfShape& theLS) ;
|
||||||
|
|
||||||
|
//! Adds shape theShape to the Set <br>
|
||||||
|
Standard_EXPORT void Add(const TopoDS_Shape& theShape) ;
|
||||||
|
|
||||||
|
//! Adds sub-shapes of shape theShape, <br>
|
||||||
|
//! that have type theType to the Set <br>
|
||||||
|
Standard_EXPORT void Add(const TopoDS_Shape& theShape,const TopAbs_ShapeEnum theType) ;
|
||||||
|
|
||||||
|
//! Removes shapes of theSet from the Set <br>
|
||||||
|
Standard_EXPORT void Subtract(const GEOMAlgo_ShapeSet& theSet) ;
|
||||||
|
|
||||||
|
//! Clears internal fields <br>
|
||||||
|
Standard_EXPORT void Clear() ;
|
||||||
|
|
||||||
|
//! Returns True if the Set contains <br>
|
||||||
|
//! all shapes of theSet <br>
|
||||||
|
Standard_EXPORT Standard_Boolean Contains(const GEOMAlgo_ShapeSet& theSet) const;
|
||||||
|
|
||||||
|
//! Returns the Set <br>
|
||||||
|
Standard_EXPORT const TopTools_ListOfShape& GetSet() const;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Methods PROTECTED
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PROTECTED
|
||||||
|
//
|
||||||
|
TopTools_MapOfOrientedShape myMap;
|
||||||
|
TopTools_ListOfShape myList;
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Methods PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
// Fields PRIVATE
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// other Inline functions and methods (like "C++: function call" methods)
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
24
src/GEOMAlgo/GEOMAlgo_ShapeSet.ixx
Normal file
24
src/GEOMAlgo/GEOMAlgo_ShapeSet.ixx
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
|
||||||
|
#include <GEOMAlgo_ShapeSet.jxx>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user