mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-15 12:00:36 +05:00
Merge branch 'V8_0_0_BR'
This commit is contained in:
commit
aa14383e45
@ -29,8 +29,8 @@ CMAKE_POLICY(SET CMP0003 NEW)
|
|||||||
# Project name, upper case
|
# Project name, upper case
|
||||||
STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
|
STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
|
||||||
|
|
||||||
SET(${PROJECT_NAME_UC}_MAJOR_VERSION 7)
|
SET(${PROJECT_NAME_UC}_MAJOR_VERSION 8)
|
||||||
SET(${PROJECT_NAME_UC}_MINOR_VERSION 7)
|
SET(${PROJECT_NAME_UC}_MINOR_VERSION 0)
|
||||||
SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
|
SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
|
||||||
SET(${PROJECT_NAME_UC}_VERSION
|
SET(${PROJECT_NAME_UC}_VERSION
|
||||||
${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
|
${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
|
||||||
|
@ -299,7 +299,9 @@ module GEOM
|
|||||||
long GetStudyID();
|
long GetStudyID();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Get internal type of the object (POINT, BOX, CYLINDER, EXTRUSION...).
|
* \brief Get internal type of operation created this object (POINT, BOX, CYLINDER, EXTRUSION...).
|
||||||
|
* \note To get topological information on the object, use \ref GEOM_IMeasureOperations::WhatIs() "WhatIs()"
|
||||||
|
* or \ref GEOM_IMeasureOperations::KindOfShape() "KindOfShape()" operation.
|
||||||
*/
|
*/
|
||||||
long GetType();
|
long GetType();
|
||||||
|
|
||||||
@ -2654,7 +2656,8 @@ module GEOM
|
|||||||
* coincident with \a theShapeWhat or could be a part of it.
|
* coincident with \a theShapeWhat or could be a part of it.
|
||||||
* \param theShapeWhere Shape to find sub-shapes of.
|
* \param theShapeWhere Shape to find sub-shapes of.
|
||||||
* \param theShapeWhat Shape, specifying what to find.
|
* \param theShapeWhat Shape, specifying what to find.
|
||||||
* \return Group of all found sub-shapes or a single found sub-shape.
|
* \return Compound which includes all found sub-shapes if they have different types;
|
||||||
|
* or group of all found shapes of the equal type; or a single found sub-shape.
|
||||||
*/
|
*/
|
||||||
GEOM_Object GetInPlace (in GEOM_Object theShapeWhere,
|
GEOM_Object GetInPlace (in GEOM_Object theShapeWhere,
|
||||||
in GEOM_Object theShapeWhat);
|
in GEOM_Object theShapeWhat);
|
||||||
@ -2677,7 +2680,8 @@ module GEOM
|
|||||||
*
|
*
|
||||||
* \param theShapeWhere Shape to find sub-shapes of.
|
* \param theShapeWhere Shape to find sub-shapes of.
|
||||||
* \param theShapeWhat Shape, specifying what to find.
|
* \param theShapeWhat Shape, specifying what to find.
|
||||||
* \return Group of all found sub-shapes or a single found sub-shape.
|
* \return Compound which includes all found sub-shapes if they have different types;
|
||||||
|
* or group of all found shapes of the equal type; or a single found sub-shape.
|
||||||
*/
|
*/
|
||||||
GEOM_Object GetInPlaceByHistory (in GEOM_Object theShapeWhere,
|
GEOM_Object GetInPlaceByHistory (in GEOM_Object theShapeWhere,
|
||||||
in GEOM_Object theShapeWhat);
|
in GEOM_Object theShapeWhat);
|
||||||
|
@ -1278,6 +1278,8 @@ void FillMapOfRef(const Handle(GEOM_Function) &theFunction,
|
|||||||
|
|
||||||
const int aRefTag = GetTag(anObjEntry);
|
const int aRefTag = GetTag(anObjEntry);
|
||||||
|
|
||||||
|
if (anObjTag != aRefTag) {
|
||||||
|
// Avoid making references for operations without copy.
|
||||||
theRefMap[anObjTag].push_back(aRefTag);
|
theRefMap[anObjTag].push_back(aRefTag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1285,6 +1287,7 @@ void FillMapOfRef(const Handle(GEOM_Function) &theFunction,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
/*!
|
/*!
|
||||||
|
@ -17,6 +17,8 @@
|
|||||||
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
#
|
#
|
||||||
|
|
||||||
|
INCLUDE(UseQtExt)
|
||||||
|
|
||||||
# --- options ---
|
# --- options ---
|
||||||
|
|
||||||
# additional include directories
|
# additional include directories
|
||||||
|
@ -68,7 +68,7 @@ bool GEOMGUI::OnGUIEvent( int /*theCommandID*/, SUIT_Desktop* /*parent*/ )
|
|||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : GEOMGUI::OnMousePress
|
// class : GEOMGUI::OnMousePress
|
||||||
// purpose : Mouse press event processing. Should return FALSE to let the event
|
// purpose : Mouse press event processing. Should return false to let the event
|
||||||
// be processed further.
|
// be processed further.
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
bool GEOMGUI::OnMousePress( QMouseEvent* /*pe*/, SUIT_Desktop* /*parent*/, SUIT_ViewWindow* /*studyFrame*/ )
|
bool GEOMGUI::OnMousePress( QMouseEvent* /*pe*/, SUIT_Desktop* /*parent*/, SUIT_ViewWindow* /*studyFrame*/ )
|
||||||
|
@ -4960,10 +4960,18 @@ Please, select face, shell or solid and try again</translation>
|
|||||||
<source>MEN_POP_SHOW_DEPENDENCY_TREE</source>
|
<source>MEN_POP_SHOW_DEPENDENCY_TREE</source>
|
||||||
<translation>Show dependency tree</translation>
|
<translation>Show dependency tree</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>STB_POP_SHOW_DEPENDENCY_TREE</source>
|
||||||
|
<translation>Show dependency tree</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>MEN_POP_REDUCE_STUDY</source>
|
<source>MEN_POP_REDUCE_STUDY</source>
|
||||||
<translation>Reduce study</translation>
|
<translation>Reduce study</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>STB_POP_REDUCE_STUDY</source>
|
||||||
|
<translation>Reduce study</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>MEN_POP_SHOW_ALL_DIMENSIONS</source>
|
<source>MEN_POP_SHOW_ALL_DIMENSIONS</source>
|
||||||
<translation>Show all dimensions</translation>
|
<translation>Show all dimensions</translation>
|
||||||
|
@ -4952,10 +4952,18 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>MEN_POP_SHOW_DEPENDENCY_TREE</source>
|
<source>MEN_POP_SHOW_DEPENDENCY_TREE</source>
|
||||||
<translation>Montrer l'arbre des dépendances</translation>
|
<translation>Montrer l'arbre des dépendances</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>STB_POP_SHOW_DEPENDENCY_TREE</source>
|
||||||
|
<translation>Montrer l'arbre des dépendances</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>MEN_POP_REDUCE_STUDY</source>
|
<source>MEN_POP_REDUCE_STUDY</source>
|
||||||
<translation>Etude réduite</translation>
|
<translation>Etude réduite</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>STB_POP_REDUCE_STUDY</source>
|
||||||
|
<translation>Etude réduite</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>MEN_POP_SHOW_ALL_DIMENSIONS</source>
|
<source>MEN_POP_SHOW_ALL_DIMENSIONS</source>
|
||||||
<translation>Afficher les cotations </translation>
|
<translation>Afficher les cotations </translation>
|
||||||
|
@ -4955,10 +4955,18 @@
|
|||||||
<source>MEN_POP_SHOW_DEPENDENCY_TREE</source>
|
<source>MEN_POP_SHOW_DEPENDENCY_TREE</source>
|
||||||
<translation>依存ツリーの表示</translation>
|
<translation>依存ツリーの表示</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>STB_POP_SHOW_DEPENDENCY_TREE</source>
|
||||||
|
<translation>依存ツリーの表示</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>MEN_POP_REDUCE_STUDY</source>
|
<source>MEN_POP_REDUCE_STUDY</source>
|
||||||
<translation>スタディの削減</translation>
|
<translation>スタディの削減</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>STB_POP_REDUCE_STUDY</source>
|
||||||
|
<translation>スタディの削減</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>MEN_POP_SHOW_ALL_DIMENSIONS</source>
|
<source>MEN_POP_SHOW_ALL_DIMENSIONS</source>
|
||||||
<translation>すべての寸法を表示</translation>
|
<translation>すべての寸法を表示</translation>
|
||||||
|
@ -180,6 +180,8 @@ static GeomFill_Trihedron EvaluateBestSweepMode(const TopoDS_Shape& Spine)
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
static Standard_Boolean BuildPipeShell(BRepOffsetAPI_MakePipeShell &theBuilder)
|
static Standard_Boolean BuildPipeShell(BRepOffsetAPI_MakePipeShell &theBuilder)
|
||||||
{
|
{
|
||||||
|
theBuilder.SetForceApproxC1(Standard_True);
|
||||||
|
|
||||||
theBuilder.Build();
|
theBuilder.Build();
|
||||||
|
|
||||||
Standard_Boolean isDone = theBuilder.IsDone();
|
Standard_Boolean isDone = theBuilder.IsDone();
|
||||||
@ -3125,7 +3127,8 @@ Standard_Integer GEOMImpl_PipeDriver::Execute (TFunction_Logbook& log) const
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
GeomFill_Trihedron theBestMode = EvaluateBestSweepMode(aWirePath);
|
GeomFill_Trihedron theBestMode = EvaluateBestSweepMode(aWirePath);
|
||||||
BRepOffsetAPI_MakePipe aMkPipe(aWirePath, aShapeBase, theBestMode);
|
BRepOffsetAPI_MakePipe aMkPipe
|
||||||
|
(aWirePath, aShapeBase, theBestMode, Standard_True);
|
||||||
|
|
||||||
if (aMkPipe.IsDone() && aMkPipe.ErrorOnSurface() <= TolPipeSurf) {
|
if (aMkPipe.IsDone() && aMkPipe.ErrorOnSurface() <= TolPipeSurf) {
|
||||||
aShape = aMkPipe.Shape();
|
aShape = aMkPipe.Shape();
|
||||||
@ -3137,7 +3140,7 @@ Standard_Integer GEOMImpl_PipeDriver::Execute (TFunction_Logbook& log) const
|
|||||||
} else if (theBestMode != GeomFill_IsDiscreteTrihedron) {
|
} else if (theBestMode != GeomFill_IsDiscreteTrihedron) {
|
||||||
// Try to use Descrete Trihedron mode.
|
// Try to use Descrete Trihedron mode.
|
||||||
BRepOffsetAPI_MakePipe aMkPipeDescrete
|
BRepOffsetAPI_MakePipe aMkPipeDescrete
|
||||||
(aWirePath, aShapeBase, GeomFill_IsDiscreteTrihedron);
|
(aWirePath, aShapeBase, GeomFill_IsDiscreteTrihedron, Standard_True);
|
||||||
|
|
||||||
if (aMkPipeDescrete.IsDone()) {
|
if (aMkPipeDescrete.IsDone()) {
|
||||||
aShape = aMkPipeDescrete.Shape();
|
aShape = aMkPipeDescrete.Shape();
|
||||||
|
@ -73,6 +73,8 @@
|
|||||||
#include <TopoDS_Compound.hxx>
|
#include <TopoDS_Compound.hxx>
|
||||||
#include <TopoDS_Iterator.hxx>
|
#include <TopoDS_Iterator.hxx>
|
||||||
|
|
||||||
|
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||||
|
#include <TopTools_ListOfShape.hxx>
|
||||||
#include <TopTools_MapOfShape.hxx>
|
#include <TopTools_MapOfShape.hxx>
|
||||||
#include <TopTools_HSequenceOfShape.hxx>
|
#include <TopTools_HSequenceOfShape.hxx>
|
||||||
|
|
||||||
@ -161,6 +163,185 @@ namespace
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function adds faces from the input shape into the list of faces. If
|
||||||
|
* the input shape is a face, it is added itself. If it is a shell, its
|
||||||
|
* sub-shapes (faces) are added. If it is a compound, its sub-shapes
|
||||||
|
* (faces or shells) are added in the list. For null shapes and for other
|
||||||
|
* types of shapes an exception is thrown.
|
||||||
|
*
|
||||||
|
* @param theShape the shape to be added. Either face or shell or a compound
|
||||||
|
* of faces and/or shells.
|
||||||
|
* @param theListFaces the list of faces that is modified on output.
|
||||||
|
* @param theMapFence the map that protects from adding the same faces in
|
||||||
|
* the list.
|
||||||
|
*/
|
||||||
|
void addFaces(const TopoDS_Shape &theShape,
|
||||||
|
TopTools_ListOfShape &theListFaces,
|
||||||
|
TopTools_MapOfShape &theMapFence)
|
||||||
|
{
|
||||||
|
if (theShape.IsNull()) {
|
||||||
|
Standard_NullObject::Raise("Face for shell construction is null");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Append the shape is the mapFence
|
||||||
|
if (theMapFence.Add(theShape)) {
|
||||||
|
// Shape type
|
||||||
|
const TopAbs_ShapeEnum aType = theShape.ShapeType();
|
||||||
|
|
||||||
|
if (aType == TopAbs_FACE) {
|
||||||
|
theListFaces.Append(theShape);
|
||||||
|
} else if (aType == TopAbs_SHELL || aType == TopAbs_COMPOUND) {
|
||||||
|
TopoDS_Iterator anIter(theShape);
|
||||||
|
|
||||||
|
for (; anIter.More(); anIter.Next()) {
|
||||||
|
// Add sub-shapes: faces for shell or faces/shells for compound.
|
||||||
|
const TopoDS_Shape &aSubShape = anIter.Value();
|
||||||
|
|
||||||
|
addFaces(aSubShape, theListFaces, theMapFence);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Standard_TypeMismatch::Raise
|
||||||
|
("Shape for shell construction is neither a shell nor a face");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function constructs a shell or a compound of shells
|
||||||
|
* from a set of faces and/or shells.
|
||||||
|
*
|
||||||
|
* @param theShapes is a set of faces, shells and/or
|
||||||
|
* compounds of faces/shells.
|
||||||
|
* @return a shell or a compound of shells.
|
||||||
|
*/
|
||||||
|
TopoDS_Shape makeShellFromFaces
|
||||||
|
(const Handle(TColStd_HSequenceOfTransient) &theShapes)
|
||||||
|
{
|
||||||
|
const Standard_Integer aNbShapes = theShapes->Length();
|
||||||
|
Standard_Integer i;
|
||||||
|
TopTools_ListOfShape aListFaces;
|
||||||
|
TopTools_MapOfShape aMapFence;
|
||||||
|
BRep_Builder aBuilder;
|
||||||
|
|
||||||
|
// Fill the list of unique faces
|
||||||
|
for (i = 1; i <= aNbShapes; ++i) {
|
||||||
|
// Function
|
||||||
|
const Handle(GEOM_Function) aRefShape =
|
||||||
|
Handle(GEOM_Function)::DownCast(theShapes->Value(i));
|
||||||
|
|
||||||
|
if (aRefShape.IsNull()) {
|
||||||
|
Standard_NullObject::Raise("Face for shell construction is null");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Shape
|
||||||
|
const TopoDS_Shape aShape = aRefShape->GetValue();
|
||||||
|
|
||||||
|
addFaces(aShape, aListFaces, aMapFence);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Perform computation of shells.
|
||||||
|
TopTools_ListOfShape aListShells;
|
||||||
|
TopTools_ListIteratorOfListOfShape anIter;
|
||||||
|
|
||||||
|
while (!aListFaces.IsEmpty()) {
|
||||||
|
// Perform sewing
|
||||||
|
BRepBuilderAPI_Sewing aSewing(Precision::Confusion()*10.0);
|
||||||
|
|
||||||
|
for (anIter.Initialize(aListFaces); anIter.More(); anIter.Next()) {
|
||||||
|
aSewing.Add(anIter.Value());
|
||||||
|
}
|
||||||
|
|
||||||
|
aSewing.Perform();
|
||||||
|
|
||||||
|
// Fill list of shells.
|
||||||
|
const TopoDS_Shape &aSewed = aSewing.SewedShape();
|
||||||
|
TopExp_Explorer anExp(aSewed, TopAbs_SHELL);
|
||||||
|
Standard_Boolean isNewShells = Standard_False;
|
||||||
|
|
||||||
|
// Append shells
|
||||||
|
for (; anExp.More(); anExp.Next()) {
|
||||||
|
aListShells.Append(anExp.Current());
|
||||||
|
isNewShells = Standard_True;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Append single faces.
|
||||||
|
anExp.Init(aSewed, TopAbs_FACE, TopAbs_SHELL);
|
||||||
|
|
||||||
|
for (; anExp.More(); anExp.Next()) {
|
||||||
|
TopoDS_Shell aShell;
|
||||||
|
|
||||||
|
aBuilder.MakeShell(aShell);
|
||||||
|
aBuilder.Add(aShell, anExp.Current());
|
||||||
|
aListShells.Append(aShell);
|
||||||
|
isNewShells = Standard_True;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isNewShells) {
|
||||||
|
// There are no more shell can be obtained. Break the loop.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove faces that are in the result from the list.
|
||||||
|
TopTools_IndexedMapOfShape aMapFaces;
|
||||||
|
|
||||||
|
TopExp::MapShapes(aSewed, TopAbs_FACE, aMapFaces);
|
||||||
|
|
||||||
|
// Add deleted faces to the map
|
||||||
|
const Standard_Integer aNbDelFaces = aSewing.NbDeletedFaces();
|
||||||
|
|
||||||
|
for (i = 1; i <= aNbDelFaces; ++i) {
|
||||||
|
aMapFaces.Add(aSewing.DeletedFace(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (anIter.Initialize(aListFaces); anIter.More();) {
|
||||||
|
const TopoDS_Shape &aFace = anIter.Value();
|
||||||
|
Standard_Boolean isFaceUsed = Standard_False;
|
||||||
|
|
||||||
|
if (aMapFaces.Contains(aFace) || aSewing.IsModified(aFace)) {
|
||||||
|
// Remove face from the list.
|
||||||
|
aListFaces.Remove(anIter);
|
||||||
|
} else {
|
||||||
|
// Go to the next face.
|
||||||
|
anIter.Next();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If there are faces not used in shells create a shell for each face.
|
||||||
|
for (anIter.Initialize(aListFaces); anIter.More(); anIter.Next()) {
|
||||||
|
TopoDS_Shell aShell;
|
||||||
|
|
||||||
|
aBuilder.MakeShell(aShell);
|
||||||
|
aBuilder.Add(aShell, anIter.Value());
|
||||||
|
aListShells.Append(aShell);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Construct the result that can be either a shell or a compound of shells
|
||||||
|
TopoDS_Shape aResult;
|
||||||
|
|
||||||
|
if (!aListShells.IsEmpty()) {
|
||||||
|
if (aListShells.Extent() == 1) {
|
||||||
|
aResult = aListShells.First();
|
||||||
|
} else {
|
||||||
|
// There are more then one shell.
|
||||||
|
TopoDS_Compound aCompound;
|
||||||
|
|
||||||
|
aBuilder.MakeCompound(aCompound);
|
||||||
|
|
||||||
|
for (anIter.Initialize(aListShells); anIter.More(); anIter.Next()) {
|
||||||
|
aBuilder.Add(aCompound, anIter.Value());
|
||||||
|
}
|
||||||
|
|
||||||
|
aResult = aCompound;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return aResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
// End of namespace
|
||||||
}
|
}
|
||||||
|
|
||||||
//modified by NIZNHY-PKV Wed Dec 28 13:48:20 2011f
|
//modified by NIZNHY-PKV Wed Dec 28 13:48:20 2011f
|
||||||
@ -432,60 +613,13 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
|
|||||||
allowCompound = true;
|
allowCompound = true;
|
||||||
|
|
||||||
Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes();
|
Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes();
|
||||||
unsigned int ind, nbshapes = aShapes->Length();
|
|
||||||
|
|
||||||
// add faces
|
if (aShapes.IsNull()) {
|
||||||
BRepBuilderAPI_Sewing aSewing (Precision::Confusion()*10.0);
|
Standard_NullObject::Raise("Argument Shapes is null");
|
||||||
for (ind = 1; ind <= nbshapes; ind++) {
|
|
||||||
Handle(GEOM_Function) aRefShape = Handle(GEOM_Function)::DownCast(aShapes->Value(ind));
|
|
||||||
TopoDS_Shape aShape_i = aRefShape->GetValue();
|
|
||||||
if (aShape_i.IsNull()) {
|
|
||||||
Standard_NullObject::Raise("Face for shell construction is null");
|
|
||||||
}
|
|
||||||
aSewing.Add(aShape_i);
|
|
||||||
}
|
|
||||||
|
|
||||||
aSewing.Perform();
|
|
||||||
|
|
||||||
TopoDS_Shape sh = aSewing.SewedShape();
|
|
||||||
|
|
||||||
if (sh.ShapeType()==TopAbs_FACE && nbshapes==1) {
|
|
||||||
// case for creation of shell from one face - PAL12722 (skl 26.06.2006)
|
|
||||||
TopoDS_Shell ss;
|
|
||||||
B.MakeShell(ss);
|
|
||||||
B.Add(ss,sh);
|
|
||||||
aShape = ss;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
//TopExp_Explorer exp (aSewing.SewedShape(), TopAbs_SHELL);
|
|
||||||
TopExp_Explorer exp (sh, TopAbs_SHELL);
|
|
||||||
Standard_Integer ish = 0;
|
|
||||||
for (; exp.More(); exp.Next()) {
|
|
||||||
aShape = exp.Current();
|
|
||||||
ish++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ish != 1) {
|
|
||||||
// try the case of one face (Mantis issue 0021809)
|
|
||||||
TopExp_Explorer expF (sh, TopAbs_FACE);
|
|
||||||
Standard_Integer ifa = 0;
|
|
||||||
for (; expF.More(); expF.Next()) {
|
|
||||||
aShape = expF.Current();
|
|
||||||
ifa++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ifa == 1) {
|
|
||||||
TopoDS_Shell ss;
|
|
||||||
B.MakeShell(ss);
|
|
||||||
B.Add(ss,aShape);
|
|
||||||
aShape = ss;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
aShape = aSewing.SewedShape();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Compute a shell or a compound of shells.
|
||||||
|
aShape = makeShellFromFaces(aShapes);
|
||||||
}
|
}
|
||||||
else if (aType == SOLID_SHELLS) {
|
else if (aType == SOLID_SHELLS) {
|
||||||
// result may be only a solid or a compound of solids
|
// result may be only a solid or a compound of solids
|
||||||
|
@ -17,6 +17,8 @@
|
|||||||
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
#
|
#
|
||||||
|
|
||||||
|
INCLUDE(UseQtExt)
|
||||||
|
|
||||||
# --- options ---
|
# --- options ---
|
||||||
|
|
||||||
# additional include directories
|
# additional include directories
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
// purpose : Constructs a GEOMToolsGUI_DeflectionDlg which is a child of 'parent', with the
|
// purpose : Constructs a GEOMToolsGUI_DeflectionDlg which is a child of 'parent', with the
|
||||||
// name 'name' and widget flags set to 'f'.
|
// name 'name' and widget flags set to 'f'.
|
||||||
// The dialog will by default be modeless, unless you set 'modal' to
|
// The dialog will by default be modeless, unless you set 'modal' to
|
||||||
// TRUE to construct a modal dialog.
|
// true to construct a modal dialog.
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
GEOMToolsGUI_DeflectionDlg::GEOMToolsGUI_DeflectionDlg (QWidget* parent)
|
GEOMToolsGUI_DeflectionDlg::GEOMToolsGUI_DeflectionDlg (QWidget* parent)
|
||||||
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
|
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
// purpose : Constructs a GEOMToolsGUI_LineWidthDlg which is a child of 'parent', with the
|
// purpose : Constructs a GEOMToolsGUI_LineWidthDlg which is a child of 'parent', with the
|
||||||
// name 'name' and widget flags set to 'f'.
|
// name 'name' and widget flags set to 'f'.
|
||||||
// The dialog will by default be modeless, unless you set 'modal' to
|
// The dialog will by default be modeless, unless you set 'modal' to
|
||||||
// TRUE to construct a modal dialog.
|
// true to construct a modal dialog.
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
|
|
||||||
GEOMToolsGUI_LineWidthDlg::GEOMToolsGUI_LineWidthDlg (QWidget* parent, const QString& title)
|
GEOMToolsGUI_LineWidthDlg::GEOMToolsGUI_LineWidthDlg (QWidget* parent, const QString& title)
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
// purpose : Constructs a GEOMToolsGUI_NbIsosDlg which is a child of 'parent', with the
|
// purpose : Constructs a GEOMToolsGUI_NbIsosDlg which is a child of 'parent', with the
|
||||||
// name 'name' and widget flags set to 'f'.
|
// name 'name' and widget flags set to 'f'.
|
||||||
// The dialog will by default be modeless, unless you set 'modal' to
|
// The dialog will by default be modeless, unless you set 'modal' to
|
||||||
// TRUE to construct a modal dialog.
|
// true to construct a modal dialog.
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
GEOMToolsGUI_NbIsosDlg::GEOMToolsGUI_NbIsosDlg(QWidget* parent )
|
GEOMToolsGUI_NbIsosDlg::GEOMToolsGUI_NbIsosDlg(QWidget* parent )
|
||||||
:QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint )
|
:QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint )
|
||||||
|
@ -4834,8 +4834,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
|
|||||||
self._autoPublish(anObj, theName, "face")
|
self._autoPublish(anObj, theName, "face")
|
||||||
return anObj
|
return anObj
|
||||||
|
|
||||||
## Create a shell from the set of faces and shells.
|
## Create a shell from the set of faces, shells and/or compounds of faces.
|
||||||
# @param theFacesAndShells List of faces and/or shells.
|
# @param theFacesAndShells List of faces, shells and/or compounds of faces.
|
||||||
# @param theName Object name; when specified, this parameter is used
|
# @param theName Object name; when specified, this parameter is used
|
||||||
# for result publication in the study. Otherwise, if automatic
|
# for result publication in the study. Otherwise, if automatic
|
||||||
# publication is switched on, default value is used for result name.
|
# publication is switched on, default value is used for result name.
|
||||||
@ -5866,7 +5866,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
|
|||||||
# for result publication in the study. Otherwise, if automatic
|
# for result publication in the study. Otherwise, if automatic
|
||||||
# publication is switched on, default value is used for result name.
|
# publication is switched on, default value is used for result name.
|
||||||
#
|
#
|
||||||
# @return Group of all found sub-shapes or a single found sub-shape.
|
# @return Compound which includes all found sub-shapes if they have different types;
|
||||||
|
# or group of all found shapes of the equal type; or a single found sub-shape.
|
||||||
#
|
#
|
||||||
# @note This function has a restriction on argument shapes.
|
# @note This function has a restriction on argument shapes.
|
||||||
# If \a theShapeWhere has curved parts with significantly
|
# If \a theShapeWhere has curved parts with significantly
|
||||||
@ -5891,7 +5892,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
|
|||||||
publication is switched on, default value is used for result name.
|
publication is switched on, default value is used for result name.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Group of all found sub-shapes or a single found sub-shape.
|
Compound which includes all found sub-shapes if they have different types;
|
||||||
|
or group of all found shapes of the equal type; or a single found sub-shape.
|
||||||
|
|
||||||
|
|
||||||
Note:
|
Note:
|
||||||
@ -5927,7 +5929,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
|
|||||||
# for result publication in the study. Otherwise, if automatic
|
# for result publication in the study. Otherwise, if automatic
|
||||||
# publication is switched on, default value is used for result name.
|
# publication is switched on, default value is used for result name.
|
||||||
#
|
#
|
||||||
# @return Group of all found sub-shapes or a single found sub-shape.
|
# @return Compound which includes all found sub-shapes if they have different types;
|
||||||
|
# or group of all found shapes of the equal type; or a single found sub-shape.
|
||||||
#
|
#
|
||||||
# @ref swig_GetInPlace "Example"
|
# @ref swig_GetInPlace "Example"
|
||||||
@ManageTransactions("ShapesOp")
|
@ManageTransactions("ShapesOp")
|
||||||
@ -5948,7 +5951,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
|
|||||||
publication is switched on, default value is used for result name.
|
publication is switched on, default value is used for result name.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Group of all found sub-shapes or a single found sub-shape.
|
Compound which includes all found sub-shapes if they have different types;
|
||||||
|
or group of all found shapes of the equal type; or a single found sub-shape.
|
||||||
"""
|
"""
|
||||||
# Example: see GEOM_TestOthers.py
|
# Example: see GEOM_TestOthers.py
|
||||||
anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
|
anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
|
||||||
|
@ -18,12 +18,12 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
INCLUDE(${SWIG_USE_FILE})
|
INCLUDE(${SWIG_USE_FILE})
|
||||||
INCLUDE(UseQtExt)
|
|
||||||
|
|
||||||
# --- options ---
|
# --- options ---
|
||||||
|
|
||||||
# additional include directories
|
# additional include directories
|
||||||
INCLUDE_DIRECTORIES(
|
INCLUDE_DIRECTORIES(
|
||||||
|
${QT_INCLUDE_DIRS}
|
||||||
${PTHREAD_INCLUDE_DIR}
|
${PTHREAD_INCLUDE_DIR}
|
||||||
${VTK_INCLUDE_DIRS}
|
${VTK_INCLUDE_DIRS}
|
||||||
${OMNIORB_INCLUDE_DIR}
|
${OMNIORB_INCLUDE_DIR}
|
||||||
|
@ -17,10 +17,13 @@
|
|||||||
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
#
|
#
|
||||||
|
|
||||||
|
INCLUDE(UseQtExt)
|
||||||
|
|
||||||
# --- options ---
|
# --- options ---
|
||||||
|
|
||||||
# additional include directories
|
# additional include directories
|
||||||
INCLUDE_DIRECTORIES(
|
INCLUDE_DIRECTORIES(
|
||||||
|
${QT_INCLUDE_DIRS}
|
||||||
${VTK_INCLUDE_DIRS}
|
${VTK_INCLUDE_DIRS}
|
||||||
${OMNIORB_INCLUDE_DIR}
|
${OMNIORB_INCLUDE_DIR}
|
||||||
${CAS_INCLUDE_DIRS}
|
${CAS_INCLUDE_DIRS}
|
||||||
|
@ -17,6 +17,8 @@
|
|||||||
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
#
|
#
|
||||||
|
|
||||||
|
INCLUDE(UseQtExt)
|
||||||
|
|
||||||
# --- options ---
|
# --- options ---
|
||||||
|
|
||||||
# additional include directories
|
# additional include directories
|
||||||
|
@ -26,7 +26,7 @@ def t_shape_fluid(context):
|
|||||||
from salome.geom.t_shape import t_shape_dialog
|
from salome.geom.t_shape import t_shape_dialog
|
||||||
from salome.geom.t_shape import t_shape_progress
|
from salome.geom.t_shape import t_shape_progress
|
||||||
import xalome
|
import xalome
|
||||||
from PyQt4.QtGui import QMessageBox
|
from qtsalome import QMessageBox
|
||||||
activeStudy = context.study
|
activeStudy = context.study
|
||||||
|
|
||||||
dialog = t_shape_dialog.TShapeDialog()
|
dialog = t_shape_dialog.TShapeDialog()
|
||||||
|
@ -20,15 +20,14 @@
|
|||||||
# Author : Renaud Nédélec (OpenCascade S.A.S)
|
# Author : Renaud Nédélec (OpenCascade S.A.S)
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from PyQt4 import QtGui
|
from qtsalome import *
|
||||||
from PyQt4 import QtCore
|
|
||||||
|
|
||||||
from t_shape_dialog_ui import Ui_Dialog
|
from t_shape_dialog_ui import Ui_Dialog
|
||||||
|
|
||||||
|
|
||||||
class TShapeDialog(QtGui.QDialog):
|
class TShapeDialog(QDialog):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
QtGui.QDialog.__init__(self, None, QtCore.Qt.Tool)
|
QDialog.__init__(self, None, Qt.Tool)
|
||||||
# Set up the user interface from Designer.
|
# Set up the user interface from Designer.
|
||||||
self.ui = Ui_Dialog()
|
self.ui = Ui_Dialog()
|
||||||
self.ui.setupUi(self)
|
self.ui.setupUi(self)
|
||||||
@ -43,7 +42,7 @@ class TShapeDialog(QtGui.QDialog):
|
|||||||
|
|
||||||
def accept(self):
|
def accept(self):
|
||||||
self._wasOk = True
|
self._wasOk = True
|
||||||
QtGui.QDialog.accept(self)
|
QDialog.accept(self)
|
||||||
|
|
||||||
def getData(self):
|
def getData(self):
|
||||||
r1 = self.ui.dsb_bigRadius.value()
|
r1 = self.ui.dsb_bigRadius.value()
|
||||||
@ -58,7 +57,7 @@ class TShapeDialog(QtGui.QDialog):
|
|||||||
|
|
||||||
def reject(self):
|
def reject(self):
|
||||||
self._wasOk = False
|
self._wasOk = False
|
||||||
QtGui.QDialog.reject(self)
|
QDialog.reject(self)
|
||||||
|
|
||||||
def wasOk(self):
|
def wasOk(self):
|
||||||
return self._wasOk
|
return self._wasOk
|
||||||
@ -70,7 +69,7 @@ class TShapeDialog(QtGui.QDialog):
|
|||||||
|
|
||||||
def main( args ):
|
def main( args ):
|
||||||
import sys
|
import sys
|
||||||
app = QtGui.QApplication(sys.argv)
|
app = QApplication(sys.argv)
|
||||||
Dialog = TShapeDialog()
|
Dialog = TShapeDialog()
|
||||||
ui = Ui_Dialog()
|
ui = Ui_Dialog()
|
||||||
ui.setupUi(Dialog)
|
ui.setupUi(Dialog)
|
||||||
|
@ -20,15 +20,14 @@
|
|||||||
# Author : Renaud Nédélec (OpenCascade S.A.S)
|
# Author : Renaud Nédélec (OpenCascade S.A.S)
|
||||||
|
|
||||||
from salome.geom.t_shape import t_shape_builder
|
from salome.geom.t_shape import t_shape_builder
|
||||||
from PyQt4.QtGui import QProgressDialog
|
from qtsalome import *
|
||||||
from PyQt4 import QtCore
|
|
||||||
|
|
||||||
class t_shape_progress(QProgressDialog):
|
class t_shape_progress(QProgressDialog):
|
||||||
_totSteps = 0
|
_totSteps = 0
|
||||||
_nmaxSteps = 27
|
_nmaxSteps = 27
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
QProgressDialog.__init__(self, "t_shape fluid build", "stop", 0, self._nmaxSteps, parent, QtCore.Qt.Tool)
|
QProgressDialog.__init__(self, "t_shape fluid build", "stop", 0, self._nmaxSteps, parent, Qt.Tool)
|
||||||
self.show()
|
self.show()
|
||||||
|
|
||||||
def run(self, activeStudy, r1, r2, h1, h2, thickness):
|
def run(self, activeStudy, r1, r2, h1, h2, thickness):
|
||||||
|
@ -113,7 +113,7 @@ XAOPlugin_IOperations::~XAOPlugin_IOperations()
|
|||||||
MESSAGE( "XAOPlugin_IOperations::~XAOPlugin_IOperations" );
|
MESSAGE( "XAOPlugin_IOperations::~XAOPlugin_IOperations" );
|
||||||
}
|
}
|
||||||
|
|
||||||
void XAOPlugin_IOperations::exportGroups( std::list<Handle(GEOM_Object)> groupList,
|
bool XAOPlugin_IOperations::exportGroups( std::list<Handle(GEOM_Object)> groupList,
|
||||||
XAO::Xao* xaoObject,
|
XAO::Xao* xaoObject,
|
||||||
XAO::BrepGeometry* geometry )
|
XAO::BrepGeometry* geometry )
|
||||||
{
|
{
|
||||||
@ -122,6 +122,10 @@ void XAOPlugin_IOperations::exportGroups( std::list<Handle(GEOM_Object)> groupLi
|
|||||||
while (groupIterator != groupList.end())
|
while (groupIterator != groupList.end())
|
||||||
{
|
{
|
||||||
Handle(GEOM_Object) currGroup = (*groupIterator++);
|
Handle(GEOM_Object) currGroup = (*groupIterator++);
|
||||||
|
if (currGroup->GetType() != GEOM_GROUP) {
|
||||||
|
SetErrorCode("Error when export groups: you could perform this operation only with group.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
Handle(TColStd_HArray1OfInteger) groupIds = myGroupOperations->GetObjects(currGroup);
|
Handle(TColStd_HArray1OfInteger) groupIds = myGroupOperations->GetObjects(currGroup);
|
||||||
|
|
||||||
TopAbs_ShapeEnum shapeGroup = myGroupOperations->GetType(currGroup);
|
TopAbs_ShapeEnum shapeGroup = myGroupOperations->GetType(currGroup);
|
||||||
@ -164,6 +168,7 @@ void XAOPlugin_IOperations::exportGroups( std::list<Handle(GEOM_Object)> groupLi
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void XAOPlugin_IOperations::exportFields( std::list<Handle(GEOM_Field)> fieldList,
|
void XAOPlugin_IOperations::exportFields( std::list<Handle(GEOM_Field)> fieldList,
|
||||||
@ -337,7 +342,7 @@ bool XAOPlugin_IOperations::ExportXAO( Handle(GEOM_Object) shape,
|
|||||||
exportSubshapes(shape, geometry);
|
exportSubshapes(shape, geometry);
|
||||||
xaoObject->setGeometry(geometry);
|
xaoObject->setGeometry(geometry);
|
||||||
|
|
||||||
exportGroups(groupList, xaoObject, geometry);
|
if (!exportGroups(groupList, xaoObject, geometry)) return false;
|
||||||
exportFields(fieldList, xaoObject, geometry);
|
exportFields(fieldList, xaoObject, geometry);
|
||||||
|
|
||||||
// export the XAO to the file
|
// export the XAO to the file
|
||||||
|
@ -66,7 +66,7 @@ private:
|
|||||||
void exportFields( std::list<Handle(GEOM_Field)> fieldList,
|
void exportFields( std::list<Handle(GEOM_Field)> fieldList,
|
||||||
XAO::Xao* xaoObject,
|
XAO::Xao* xaoObject,
|
||||||
XAO::BrepGeometry* geometry );
|
XAO::BrepGeometry* geometry );
|
||||||
void exportGroups( std::list<Handle(GEOM_Object)> groupList,
|
bool exportGroups( std::list<Handle(GEOM_Object)> groupList,
|
||||||
XAO::Xao* xaoObject,
|
XAO::Xao* xaoObject,
|
||||||
XAO::BrepGeometry* geometry );
|
XAO::BrepGeometry* geometry );
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user