mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-11-11 16:19:17 +05:00
Merge branch 'master' into V7_5_BR
This commit is contained in:
commit
1c3dc0bc76
@ -5,7 +5,7 @@
|
||||
\n To create a \b Compound in the <b>Main Menu</b> select <b>New
|
||||
Entity - > Build - > Compound</b>.
|
||||
|
||||
\n You can create a compound from a list of shells.
|
||||
\n You can create a compound from a list of shapes.
|
||||
\n The \b Result will be a \b GEOM_Object (COMPOUND).
|
||||
|
||||
\n <b>TUI Command:</b> <em>geompy.MakeCompound(ListOfShape)</em>
|
||||
|
@ -6,15 +6,15 @@ To create a \b Face in the <b>Main Menu</b> select <b>New Entity - >
|
||||
Build - > Face</b>
|
||||
|
||||
\n To create a \b Face you need to select input shape(s). The list of
|
||||
input shapes can include shapes of any type; if the shapes are nor
|
||||
wires or edges, the algorithm extracts all edges from
|
||||
input shapes can include shapes of any type except vertices; if the shapes are
|
||||
neither wires nor edges, the algorithm extracts all edges from
|
||||
the input shapes and works on the obtaineed edges.
|
||||
\n The edges and wires do not necessarily have to be closed, the
|
||||
algorithm automatically builds a wire of maximum length from all
|
||||
given edges and wires. If it founds multiple closed wires, it can
|
||||
build a face with holes or some separate faces, depending on the
|
||||
placement of the wires. If some resulting wires remain open, they will
|
||||
be added in the resulting compound "as is".
|
||||
given edges and wires. If several closed wires are detected the algorithm tries
|
||||
to create a face with holes. It is possible only if there is only one wire
|
||||
that can be interpreted as an outer one; other wires can be considered as
|
||||
inner ones.
|
||||
\n Check <b>Try to create a planar face</b> to create a planar
|
||||
face or nothing if it is impossible.
|
||||
\note Please note, that the resulting face can have a huge tolerance, if the initial wire has a big deviation from the plane. If the final tolerance exceeds 1e-06, a warning will be shown, but the face will be created and published in the study in a normal way. Using such faces can lead to failures or unpredictable results in most operations.
|
||||
|
@ -106,10 +106,7 @@ void BuildGUI_FaceDlg::Init()
|
||||
GroupWire->CheckButton1->setChecked( true );
|
||||
myWires.clear();
|
||||
|
||||
TColStd_MapOfInteger aMap;
|
||||
aMap.Add( GEOM_EDGE );
|
||||
aMap.Add( GEOM_WIRE );
|
||||
globalSelection( aMap );
|
||||
setGlobalSelection();
|
||||
|
||||
/* signals and slots connections */
|
||||
connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
|
||||
@ -123,6 +120,23 @@ void BuildGUI_FaceDlg::Init()
|
||||
SelectionIntoArgument();
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : setGlobalSelection
|
||||
// purpose :
|
||||
//=================================================================================
|
||||
void BuildGUI_FaceDlg::setGlobalSelection()
|
||||
{
|
||||
TColStd_MapOfInteger aMap;
|
||||
|
||||
aMap.Add(GEOM_EDGE);
|
||||
aMap.Add(GEOM_WIRE);
|
||||
aMap.Add(GEOM_FACE);
|
||||
aMap.Add(GEOM_SHELL);
|
||||
aMap.Add(GEOM_SOLID);
|
||||
aMap.Add(GEOM_COMPOUND);
|
||||
|
||||
globalSelection(aMap);
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnOk()
|
||||
@ -159,7 +173,8 @@ void BuildGUI_FaceDlg::SelectionIntoArgument()
|
||||
myEditCurrentArgument->setText( "" );
|
||||
|
||||
QList<TopAbs_ShapeEnum> types;
|
||||
types << TopAbs_EDGE << TopAbs_WIRE;
|
||||
types << TopAbs_EDGE << TopAbs_WIRE << TopAbs_FACE
|
||||
<< TopAbs_SHELL << TopAbs_SOLID << TopAbs_COMPOUND;
|
||||
myWires = getSelected( types, -1 );
|
||||
|
||||
if ( !myWires.isEmpty() ) {
|
||||
@ -178,12 +193,8 @@ void BuildGUI_FaceDlg::SetEditCurrentArgument()
|
||||
QPushButton* send = (QPushButton*)sender();
|
||||
if ( send != GroupWire->PushButton1 )
|
||||
return;
|
||||
|
||||
TColStd_MapOfInteger aMap;
|
||||
aMap.Add( GEOM_EDGE );
|
||||
aMap.Add( GEOM_WIRE );
|
||||
globalSelection( aMap );
|
||||
|
||||
setGlobalSelection();
|
||||
myEditCurrentArgument = GroupWire->LineEdit1;
|
||||
|
||||
myEditCurrentArgument->setFocus();
|
||||
@ -200,10 +211,7 @@ void BuildGUI_FaceDlg::ActivateThisDialog()
|
||||
GEOMBase_Skeleton::ActivateThisDialog();
|
||||
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
|
||||
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
||||
TColStd_MapOfInteger aMap;
|
||||
aMap.Add( GEOM_EDGE );
|
||||
aMap.Add( GEOM_WIRE );
|
||||
globalSelection( aMap );
|
||||
setGlobalSelection();
|
||||
}
|
||||
|
||||
|
||||
|
@ -53,6 +53,7 @@ protected:
|
||||
private:
|
||||
void Init();
|
||||
void enterEvent( QEvent* );
|
||||
void setGlobalSelection();
|
||||
|
||||
private:
|
||||
QList<GEOM::GeomObjPtr> myWires;
|
||||
|
@ -351,6 +351,18 @@ void DependencyTree_View::onRebuildModel()
|
||||
updateModel( true, false );
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : resizeEvent()
|
||||
// purpose : reimplemented from QGraphicsView::resizeEvent()
|
||||
//=================================================================================
|
||||
void DependencyTree_View::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
QPointF aCenter = mapToScene( event->oldSize().width()/2,
|
||||
event->oldSize().height()/2 );
|
||||
QGraphicsView::resizeEvent( event );
|
||||
centerOn( aCenter.x(),aCenter.y() );
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : onUpdateModel()
|
||||
// purpose : slot for updating tree model for main objects in viewer
|
||||
@ -689,7 +701,7 @@ void DependencyTree_View::updateView()
|
||||
return;
|
||||
|
||||
drawTree();
|
||||
fitAll();
|
||||
fitWindow();
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
@ -734,6 +746,23 @@ void DependencyTree_View::clearView( bool isClearModel )
|
||||
}
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : fitWindow()
|
||||
// purpose : scale the window considering a size of scene
|
||||
//=================================================================================
|
||||
void DependencyTree_View::fitWindow()
|
||||
{
|
||||
int sizeFactor = 4;
|
||||
if( objectsBoundingRect(true).width() > sizeFactor*size().width() ||
|
||||
objectsBoundingRect(true).height() > sizeFactor*size().width() ) {
|
||||
QRectF aRect = QRectF( -sizeFactor*size().width()/2, -sizeFactor*size().height()/2,
|
||||
sizeFactor*size().width(), sizeFactor*size().height() );
|
||||
fitInView( aRect, Qt::KeepAspectRatio );
|
||||
}
|
||||
else
|
||||
fitAll();
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : getNewTreeModel()
|
||||
// purpose : get dependency tree model from engine
|
||||
|
@ -68,6 +68,10 @@ public slots:
|
||||
|
||||
void onRebuildModel();
|
||||
|
||||
protected:
|
||||
|
||||
void resizeEvent( QResizeEvent *event );
|
||||
|
||||
private slots:
|
||||
|
||||
void onUpdateModel();
|
||||
@ -93,6 +97,8 @@ private:
|
||||
void updateView();
|
||||
void clearView( bool );
|
||||
|
||||
void fitWindow();
|
||||
|
||||
int checkMaxLevelsNumber();
|
||||
|
||||
void getNewTreeModel( bool = true, bool = true );
|
||||
|
@ -360,35 +360,6 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else if (aType == SOLID_SHELL) {
|
||||
anExpectedType = TopAbs_SOLID;
|
||||
|
||||
Handle(GEOM_Function) aRefShell = aCI.GetBase();
|
||||
TopoDS_Shape aShapeShell = aRefShell->GetValue();
|
||||
if (!aShapeShell.IsNull() && aShapeShell.ShapeType() == TopAbs_COMPOUND) {
|
||||
TopoDS_Iterator It (aShapeShell, Standard_True, Standard_True);
|
||||
if (It.More()) aShapeShell = It.Value();
|
||||
}
|
||||
if (aShapeShell.IsNull() || aShapeShell.ShapeType() != TopAbs_SHELL) {
|
||||
Standard_NullObject::Raise("Shape for solid construction is null or not a shell");
|
||||
}
|
||||
|
||||
BRepCheck_Shell chkShell(TopoDS::Shell(aShapeShell));
|
||||
if (chkShell.Closed() == BRepCheck_NotClosed) return 0;
|
||||
|
||||
TopoDS_Solid Sol;
|
||||
B.MakeSolid(Sol);
|
||||
B.Add(Sol, aShapeShell);
|
||||
BRepClass3d_SolidClassifier SC (Sol);
|
||||
SC.PerformInfinitePoint(Precision::Confusion());
|
||||
if (SC.State() == TopAbs_IN) {
|
||||
B.MakeSolid(Sol);
|
||||
B.Add(Sol, aShapeShell.Reversed());
|
||||
}
|
||||
|
||||
aShape = Sol;
|
||||
|
||||
}
|
||||
else if (aType == SOLID_SHELLS) {
|
||||
anExpectedType = TopAbs_SOLID;
|
||||
@ -445,30 +416,6 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
|
||||
aShape = C;
|
||||
|
||||
}
|
||||
/*
|
||||
else if (aType == REVERSE_ORIENTATION) {
|
||||
Handle(GEOM_Function) aRefShape = aCI.GetBase();
|
||||
TopoDS_Shape aShape_i = aRefShape->GetValue();
|
||||
if (aShape_i.IsNull()) {
|
||||
Standard_NullObject::Raise("Shape for reverse is null");
|
||||
}
|
||||
|
||||
BRepBuilderAPI_Copy Copy(aShape_i);
|
||||
if( Copy.IsDone() ) {
|
||||
TopoDS_Shape tds = Copy.Shape();
|
||||
if( tds.IsNull() ) {
|
||||
Standard_ConstructionError::Raise("Orientation aborted : Can not reverse the shape");
|
||||
}
|
||||
|
||||
if( tds.Orientation() == TopAbs_FORWARD)
|
||||
tds.Orientation(TopAbs_REVERSED);
|
||||
else
|
||||
tds.Orientation(TopAbs_FORWARD);
|
||||
|
||||
aShape = tds;
|
||||
}
|
||||
}
|
||||
*/
|
||||
else if (aType == EDGE_WIRE) {
|
||||
anExpectedType = TopAbs_EDGE;
|
||||
|
||||
@ -1221,7 +1168,6 @@ GetCreationInformation(std::string& theOperationName,
|
||||
theOperationName = "SHELL";
|
||||
AddParam( theParams, "Objects", aCI.GetShapes() );
|
||||
break;
|
||||
case SOLID_SHELL:
|
||||
case SOLID_SHELLS:
|
||||
theOperationName = "SOLID";
|
||||
AddParam( theParams, "Objects", aCI.GetShapes() );
|
||||
|
@ -292,7 +292,7 @@
|
||||
#define WIRE_EDGES 1
|
||||
#define FACE_WIRE 2
|
||||
#define SHELL_FACES 3
|
||||
#define SOLID_SHELL 4
|
||||
//#define SOLID_SHELL 4
|
||||
#define SOLID_SHELLS 5
|
||||
#define COMPOUND_SHAPES 6
|
||||
#define SUBSHAPE_SORTED 7
|
||||
|
Loading…
Reference in New Issue
Block a user