GEOM_Shape MakePlacedBox(in double x1, in double y1, in double z1,
in double delta1, in double delta2, in double delta3) raises (SALOME::SALOME_Exception) ;
+ GEOM_Shape MakePanel(in GEOM_Shape shape,
+ in short directiontype,
+ in double delta) raises (SALOME::SALOME_Exception) ;
GEOM_Shape MakeGlueFaces(in GEOM_Shape shape,
in double tol3d) raises (SALOME::SALOME_Exception) ;
in PointStruct pstruct2) raises (SALOME::SALOME_Exception) ;
GEOM_Shape MakeWire (in ListOfIOR ListShape) raises (SALOME::SALOME_Exception) ;
GEOM_Shape MakeCompound (in ListOfIOR ListShape) raises (SALOME::SALOME_Exception) ;
- GEOM_Shape MakeFace (in ListOfIOR ListShape,
- in boolean wantplanarface ) raises (SALOME::SALOME_Exception) ;
+ GEOM_Shape MakeFace (in GEOM_Shape shapeWire,
+ in boolean wantplanarface) raises (SALOME::SALOME_Exception) ;
+ GEOM_Shape MakeFaces (in ListOfIOR ListShape,
+ in boolean wantplanarface) raises (SALOME::SALOME_Exception) ;
GEOM_Shape MakeShell (in ListOfIOR ListShape) raises (SALOME::SALOME_Exception) ;
GEOM_Shape MakeSolid (in ListOfIOR ListShape) raises (SALOME::SALOME_Exception) ;
const Standard_Boolean wantPlanar)
{
try {
- GEOM::GEOM_Shape_var result = myGeom->MakeFace(listShapesIOR, wantPlanar);
+ GEOM::GEOM_Shape_var result = myGeom->MakeFaces(listShapesIOR, wantPlanar);
if(result->_is_nil()) {
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
return;
#else
#include <BRepAlgoAPI.hxx>
#endif
+#include <BRepAlgo_FaceRestrictor.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <BRepBuilderAPI_Copy.hxx>
#include <BRepAlgoAPI_Common.hxx>
}
+//=================================================================================
+// function : MakeFaces()
+// purpose :
+//=================================================================================
+GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeFaces(const GEOM::GEOM_Gen::ListOfIOR& ListShapes,
+ CORBA::Boolean wantplanarface)
+ throw (SALOME::SALOME_Exception)
+{
+ GEOM::GEOM_Shape_var result;
+
+ try {
+ GEOM::GEOM_Shape_var aShape = GetIORFromString(ListShapes[0]);
+ TopoDS_Shape Shape = GetTopoShape(aShape);
+ if(Shape.IsNull() || Shape.ShapeType() != TopAbs_WIRE) {
+ THROW_SALOME_CORBA_EXCEPTION("Shell aborted : null shape during operation", SALOME::BAD_PARAM);
+ }
+ TopoDS_Wire W = TopoDS::Wire(Shape);
+ TopoDS_Shape FFace = BRepBuilderAPI_MakeFace(W, wantplanarface).Shape();
+ if(!FFace.IsNull()) {
+ if(ListShapes.length() == 1) {
+ result = CreateObject(FFace);
+ InsertInLabelMoreArguments(FFace, result, ListShapes, myCurrentOCAFDoc);
+ }
+ else if(ListShapes.length() >= 2) {
+ TopoDS_Compound C;
+ BRep_Builder aBuilder;
+ aBuilder.MakeCompound(C);
+ BRepAlgo_FaceRestrictor FR;
+
+ TopAbs_Orientation OriF = FFace.Orientation();
+ TopoDS_Shape aLocalS = FFace.Oriented(TopAbs_FORWARD);
+ FR.Init(TopoDS::Face(aLocalS), Standard_False, Standard_True);
+
+ for(unsigned int i = 0; i < ListShapes.length(); i++) {
+ GEOM::GEOM_Shape_var aShape = GetIORFromString(ListShapes[i]);
+ TopoDS_Shape Shape = GetTopoShape(aShape);
+ if(Shape.IsNull()) {
+ THROW_SALOME_CORBA_EXCEPTION("Shell aborted : null shape during operation", SALOME::BAD_PARAM);
+ }
+ FR.Add(TopoDS::Wire(Shape));
+ }
+
+ FR.Perform();
+
+ if(FR.IsDone()) {
+ for(; FR.More(); FR.Next())
+ aBuilder.Add(C, FR.Current().Oriented(OriF));
+ result = CreateObject(C);
+ InsertInLabelMoreArguments(C, result, ListShapes, myCurrentOCAFDoc);
+ }
+ }
+ }
+ else {
+ THROW_SALOME_CORBA_EXCEPTION("Null result in GEOM_Gen_i::MakeFace", SALOME::BAD_PARAM);
+ }
+ }
+ catch (Standard_Failure) {
+ THROW_SALOME_CORBA_EXCEPTION("Exception catched in GEOM_Gen_i::MakeFace", SALOME::BAD_PARAM);
+ }
+ return result;
+}
+
+
//=================================================================================
// function : MakeShell()
// purpose : Make a compound from a list containing one or more shapes
GEOM::GEOM_Shape_ptr MakePlacedBox(CORBA::Double x1, CORBA::Double y1, CORBA::Double z1,
CORBA::Double delta1, CORBA::Double delta2, CORBA::Double delta3)
throw (SALOME::SALOME_Exception) ;
-
GEOM::GEOM_Shape_ptr MakePanel(GEOM::GEOM_Shape_ptr shape,
CORBA::Short directiontype,
CORBA::Double delta)
throw (SALOME::SALOME_Exception) ;
GEOM::GEOM_Shape_ptr MakeFace (GEOM::GEOM_Shape_ptr wire, CORBA::Boolean wantplanarface)
throw (SALOME::SALOME_Exception) ;
+ GEOM::GEOM_Shape_ptr MakeFaces (const GEOM::GEOM_Gen::ListOfIOR& ListShapes,
+ CORBA::Boolean wantplanarface)
+ throw (SALOME::SALOME_Exception) ;
GEOM::GEOM_Shape_ptr MakeShell (const GEOM::GEOM_Gen::ListOfIOR& ListShapes)
throw (SALOME::SALOME_Exception) ;
GEOM::GEOM_Shape_ptr MakeSolid (const GEOM::GEOM_Gen::ListOfIOR& ListShapes)
anObj._set_Name(ior)
return anObj
+def MakeFaces(ListShape,WantPlanarFace):
+ anObj = geom.MakeFaces(ListShape,WantPlanarFace)
+ ior = salome.orb.object_to_string(anObj)
+ anObj._set_Name(ior)
+ return anObj
+
def MakeCompound(ListShape):
anObj = geom.MakeCompound(ListShape)
ior = salome.orb.object_to_string(anObj)