/*!
* \brief Split hexahedra into triangular prisms
* \param elems - elements to split
+ * \param startHexPoint - a point used to find a hexahedron for which \a facetToSplitNormal
+ * gives a normal vector defining facets to split into triangles.
* \param facetToSplitNormal - normal used to find a facet of hexahedron
- * to split into triangles. Location of this vector is used to
- * find a hexahedron whose facets are tested using direction of this vector.
+ * to split into triangles.
* \param methodFlags - flags passing splitting method:
* 1 - split the hexahedron into 2 prisms
* 2 - split the hexahedron into 4 prisms
* to \a facetToSplitNormal location are split, else \a facetToSplitNormal
* is used to find the facet to split in all domains present in \a elems.
*/
- void SplitHexahedraIntoPrisms(in SMESH_IDSource elems,
- in short methodFlags,
- in SMESH::AxisStruct facetToSplitNormal,
- in boolean allDomains)
+ void SplitHexahedraIntoPrisms(in SMESH_IDSource elems,
+ in SMESH::PointStruct startHexPoint,
+ in SMESH::DirStruct facetToSplitNormal,
+ in short methodFlags,
+ in boolean allDomains)
raises (SALOME::SALOME_Exception);
aParameters << myDirSpin[2]->text();
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
- SMESH::AxisStruct_var axis = new SMESH::AxisStruct;
- axis->x = myPointSpin[0]->GetValue();
- axis->y = myPointSpin[1]->GetValue();
- axis->z = myPointSpin[2]->GetValue();
- axis->vx = myDirSpin[0]->GetValue();
- axis->vy = myDirSpin[1]->GetValue();
- axis->vz = myDirSpin[2]->GetValue();
-
- theEditor->SplitHexahedraIntoPrisms( obj, myGroupChoice->checkedId()+1,
- axis, myAllDomainsChk->isChecked() );
+ SMESH::PointStruct_var point = new SMESH::PointStruct;
+ point->x = myPointSpin[0]->GetValue();
+ point->y = myPointSpin[1]->GetValue();
+ point->z = myPointSpin[2]->GetValue();
+ SMESH::DirStruct_var norm = new SMESH::DirStruct;
+ norm->PS.x = myDirSpin[0]->GetValue();
+ norm->PS.y = myDirSpin[1]->GetValue();
+ norm->PS.z = myDirSpin[2]->GetValue();
+
+ theEditor->SplitHexahedraIntoPrisms( obj, point, norm,
+ myGroupChoice->checkedId()+1,
+ myAllDomainsChk->isChecked() );
}
else
{
"ExtrusionSweepObject2D","ExtrusionSweepObject2DMakeGroups",
"Translate","TranslateMakeGroups","TranslateMakeMesh",
"TranslateObject","TranslateObjectMakeGroups", "TranslateObjectMakeMesh",
- "ExtrusionAlongPathX","ExtrusionAlongPathObjX"
+ "ExtrusionAlongPathX","ExtrusionAlongPathObjX","SplitHexahedraIntoPrisms"
,"" }; // <- mark of the end
methodsAcceptingList.Insert( methodNames );
}
"GetLastCreatedElems",
"MirrorMakeMesh","MirrorObjectMakeMesh","TranslateMakeMesh","TranslateObjectMakeMesh",
"Scale","ScaleMakeMesh","RotateMakeMesh","RotateObjectMakeMesh","MakeBoundaryMesh",
- "MakeBoundaryElements", "SplitVolumesIntoTetra",
+ "MakeBoundaryElements", "SplitVolumesIntoTetra","SplitHexahedraIntoPrisms",
"DoubleElements","DoubleNodes","DoubleNode","DoubleNodeGroup","DoubleNodeGroups",
"DoubleNodeElem","DoubleNodeElemInRegion","DoubleNodeElemGroup",
"DoubleNodeElemGroupInRegion","DoubleNodeElemGroups","DoubleNodeElemGroupsInRegion",
*/
//================================================================================
-void SMESH_MeshEditor_i::SplitHexahedraIntoPrisms (SMESH::SMESH_IDSource_ptr elems,
- CORBA::Short methodFlags,
- const SMESH::AxisStruct & facetToSplitNormal,
- CORBA::Boolean allDomains)
+void SMESH_MeshEditor_i::SplitHexahedraIntoPrisms (SMESH::SMESH_IDSource_ptr elems,
+ const SMESH::PointStruct & startHexPoint,
+ const SMESH::DirStruct& facetToSplitNormal,
+ CORBA::Short methodFlags,
+ CORBA::Boolean allDomains)
throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
prepareIdSource( elems );
- gp_Ax1 facetNorm( gp_Pnt( facetToSplitNormal.x,
- facetToSplitNormal.y,
- facetToSplitNormal.z ),
- gp_Dir( facetToSplitNormal.vx,
- facetToSplitNormal.vy,
- facetToSplitNormal.vz ));
+ gp_Ax1 facetNorm( gp_Pnt( startHexPoint.x,
+ startHexPoint.y,
+ startHexPoint.z ),
+ gp_Dir( facetToSplitNormal.PS.x,
+ facetToSplitNormal.PS.y,
+ facetToSplitNormal.PS.z ));
TIDSortedElemSet elemSet;
SMESH::long_array_var anElementsId = elems->GetIDs();
SMDS_MeshElement::GeomFilter filter( SMDSGeom_HEXA );
declareMeshModified( /*isReComputeSafe=*/true ); // it does not influence Compute()
TPythonDump() << this << ".SplitHexahedraIntoPrisms( "
- << elems << ", " << methodFlags<< ", "
- << facetToSplitNormal<< ", " << allDomains << " )";
+ << elems << ", "
+ << startHexPoint << ", "
+ << facetToSplitNormal<< ", "
+ << methodFlags<< ", "
+ << allDomains << " )";
SMESH_CATCH( SMESH::throwCorbaException );
}
void SplitVolumesIntoTetra(SMESH::SMESH_IDSource_ptr elems,
CORBA::Short methodFlags)
throw (SALOME::SALOME_Exception);
- void SplitHexahedraIntoPrisms(SMESH::SMESH_IDSource_ptr elems,
- CORBA::Short methodFlags,
- const SMESH::AxisStruct & facetToSplitNormal,
- CORBA::Boolean allDomains)
+ void SplitHexahedraIntoPrisms(SMESH::SMESH_IDSource_ptr elems,
+ const SMESH::PointStruct & startHexPoint,
+ const SMESH::DirStruct& facetToSplitNormal,
+ CORBA::Short methodFlags,
+ CORBA::Boolean allDomains)
throw (SALOME::SALOME_Exception);
CORBA::Boolean Smooth(const SMESH::long_array & IDsOfElements,
pass
# axis
if isinstance( startHexPoint, geomBuilder.GEOM._objref_GEOM_Object):
- startHexPoint = self.geompyD.PointCoordinates( startHexPoint )
+ startHexPoint = self.smeshpyD.GetPointStruct( startHexPoint )
+ elif isinstance( startHexPoint, list ):
+ startHexPoint = SMESH.PointStruct( startHexPoint[0],
+ startHexPoint[1],
+ startHexPoint[2])
if isinstance( facetNormal, geomBuilder.GEOM._objref_GEOM_Object):
- facetNormal = self.geompyD.VectorCoordinates( facetNormal )
- axis = SMESH.AxisStruct( startHexPoint[0], startHexPoint[1], startHexPoint[2],
- facetNormal[0], facetNormal[1], facetNormal[2])
- self.mesh.SetParameters( axis.parameters )
-
- self.editor.SplitHexahedraIntoPrisms(elems, method, axis, allDomains)
+ facetNormal = self.smeshpyD.GetDirStruct( facetNormal )
+ elif isinstance( facetNormal, list ):
+ facetNormal = self.smeshpyD.MakeDirStruct( facetNormal[0],
+ facetNormal[1],
+ facetNormal[2])
+ self.mesh.SetParameters( startHexPoint.parameters + facetNormal.PS.parameters )
+
+ self.editor.SplitHexahedraIntoPrisms(elems, startHexPoint, facetNormal, method, allDomains)
## Splits quadrangle faces near triangular facets of volumes
#