0023210: [CEA 1681] Regression with the function GetInPlaceByHistory

This commit is contained in:
mpa 2016-01-18 11:00:10 +03:00
parent e44e43fed4
commit 845487b156
4 changed files with 54 additions and 43 deletions

View File

@ -2654,7 +2654,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 +2678,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);

View File

@ -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)

View File

@ -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

View 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 );
}; };