* Returns entries of shapes defining enforced nodes
*/
SMESH::string_array GetEnfVertices();
+
+ /*!
+ * Set corner vertices
+ */
+ void SetCorners( in SMESH::long_array vertexIDs );
+
+ /*!
+ * Return IDs of corner vertices
+ */
+ SMESH::long_array GetCorners();
};
/*!
SMESH_Gen::~SMESH_Gen()
{
- std::map < int, SMESH_Hypothesis * >::iterator i_hyp = _studyContext->mapHypothesis.begin();
- for ( ; i_hyp != _studyContext->mapHypothesis.end(); ++i_hyp )
- {
- if ( _Hyp* h = static_cast< _Hyp*>( i_hyp->second ))
- h->NullifyGen();
- }
+ std::map < int, SMESH_Hypothesis * >::iterator i_hyp = _studyContext->mapHypothesis.begin();
+ for ( ; i_hyp != _studyContext->mapHypothesis.end(); ++i_hyp )
+ {
+ if ( _Hyp* h = static_cast< _Hyp*>( i_hyp->second ))
+ h->NullifyGen();
+ }
delete _studyContext->myDocument;
delete _studyContext;
}
SMESHGUI_DisplayEntitiesDlg.h
SMESHGUI_SplitBiQuad.h
SMESHGUI_IdPreview.h
+ SMESHGUI_PreVisualObj.h
)
# header files / no moc processing
#include "SMESHGUI_PreVisualObj.h"
-#include <SMDS_Mesh.hxx>
+#include <SMESHDS_Mesh.hxx>
#include <SMESH_Actor.h>
SMESHGUI_PreVisualObj::SMESHGUI_PreVisualObj()
{
- myMesh = new SMDS_Mesh();
+ myMesh = new SMESHDS_Mesh(0,true);
+}
+
+SMDS_Mesh* SMESHGUI_PreVisualObj::GetMesh() const
+{
+ return myMesh;
}
bool SMESHGUI_PreVisualObj::Update( int theIsClear = true )
#include "SMESH_Object.h"
+class SMESHDS_Mesh;
+
/*!
* \brief Incarnation of SMESH_VisualObj allowing usage of SMESH_Actor
* to show arbitrary mesh data. SMESHGUI_PreVisualObj encapsulates
*/
class SMESHGUI_EXPORT SMESHGUI_PreVisualObj : public SMESH_VisualObj
{
- mutable SMDS_Mesh* myMesh;
- bool myEntitiesFlag;
- unsigned int myEntitiesState;
+ mutable SMESHDS_Mesh* myMesh;
+ bool myEntitiesFlag;
+ unsigned int myEntitiesState;
public:
SMESHGUI_PreVisualObj();
- virtual SMDS_Mesh* GetMesh() const { return myMesh; }
+ virtual SMDS_Mesh* GetMesh() const;
+ SMESHDS_Mesh* GetMeshDS() const { return myMesh; }
virtual bool Update( int theIsClear );
virtual bool NulData() { return false; }
* the directions. Any combination of these transformations is allowed.
*
* The following code picks up a transformation such that two known array items
- * appear in a desired positions:
+ * appear in desired positions:
* \code
* for ( int ori = 0; ori < SMESH_OrientedIndexer::MAX_ORI+1; ++ori )
* {
return *this;
}
- template<class TArray>
- void DumpArray(const TArray& theArray, TPythonDump & theStream)
- {
- if ( theArray.length() == 0 )
- {
- theStream << "[]";
- }
- else
- {
- theStream << "[ ";
- for (CORBA::ULong i = 1; i <= theArray.length(); i++) {
- theStream << theArray[i-1];
- if ( i < theArray.length() )
- theStream << ", ";
- }
- theStream << " ]";
- }
- }
-
TPythonDump&
TPythonDump::operator<<(const SMESH::long_array& theArg)
{
TPythonDump&
operator<<(const std::string& theArg);
+
+ template<class TArray, class TStream>
+ static TStream& DumpArray(const TArray& theArray, TStream & theStream)
+ {
+ if ( theArray.length() == 0 )
+ {
+ theStream << "[]";
+ }
+ else
+ {
+ theStream << "[ ";
+ for (CORBA::ULong i = 1; i <= theArray.length(); i++) {
+ theStream << theArray[i-1];
+ if ( i < theArray.length() )
+ theStream << ", ";
+ }
+ theStream << " ]";
+ }
+ return theStream;
+ }
+
static const char* SMESHGenName() { return "smeshgen"; }
static const char* MeshEditorName() { return "mesh_editor"; }
static const char* NotPublishedObjectName();
pass
def QuadrangleParameters(self, quadType=StdMeshers.QUAD_STANDARD, triangleVertex=0,
- enfVertices=[],enfPoints=[],UseExisting=0):
+ enfVertices=[],enfPoints=[],corners=[],UseExisting=0):
"""
Defines "QuadrangleParameters" hypothesis
quadType defines the algorithm of transition between differently descretized
or triples of values ([[x1,y1,z1], [x2,y2,z2], ...]).
In the case if the defined QuadrangleParameters() refer to a sole face,
all given points must lie on this face, else the mesher fails.
+ corners: list of vertices that should be used as quadrangle corners.
+ The parameter can be useful for faces with more than four vertices,
+ since in some cases Quadrangle Mapping algorithm chooses corner vertices
+ differently than it is desired.
+ A hypothesis can be global and define corners for all CAD faces that
+ require it, but be sure that each specified vertex is a corner in all
+ faces the hypothesis will be applied to.
UseExisting: if *True* - searches for the existing hypothesis created with
the same parameters, else (default) - Create a new one
"""
if isinstance( enfVertices, int ) and not enfPoints and not UseExisting:
# a call of old syntax, before inserting enfVertices and enfPoints before UseExisting
UseExisting, enfVertices = enfVertices, []
+
pStructs, xyz = [], []
for p in enfPoints:
if isinstance( p, SMESH.PointStruct ):
self.params = self.Hypothesis("QuadrangleParams", [quadType,vertexID,entries,xyz],
UseExisting = UseExisting, CompareMethod=compFun)
pass
+
+ if corners and isinstance( corners[0], GEOM._objref_GEOM_Object ):
+ corners = [ self.mesh.geompyD.GetSubShapeID( self.mesh.geom, v ) for v in corners ]
+
if self.params.GetQuadType() != quadType:
self.params.SetQuadType(quadType)
if vertexID > 0:
for v in enfVertices:
AssureGeomPublished( self.mesh, v )
self.params.SetEnforcedNodes( enfVertices, pStructs )
+ self.params.SetCorners( corners )
return self.params
def QuadranglePreference(self, reversed=False, UseExisting=0):
*/
//=============================================================================
-void StdMeshers_FixedPoints1D::SetPoints(std::vector<double>& listParams)
+void StdMeshers_FixedPoints1D::SetPoints(const std::vector<double>& listParams)
throw(SALOME_Exception)
{
_params = listParams;
*/
//=============================================================================
-void StdMeshers_FixedPoints1D::SetNbSegments(std::vector<int>& listNbSeg)
+void StdMeshers_FixedPoints1D::SetNbSegments(const std::vector<int>& listNbSeg)
throw(SALOME_Exception)
{
_nbsegs = listNbSeg;
StdMeshers_FixedPoints1D(int hypId, SMESH_Gen* gen);
virtual ~StdMeshers_FixedPoints1D();
- void SetPoints(std::vector<double>& listParams)
+ void SetPoints(const std::vector<double>& listParams)
throw(SALOME_Exception);
- void SetNbSegments(std::vector<int>& listNbSeg)
+ void SetNbSegments(const std::vector<int>& listNbSeg)
throw(SALOME_Exception);
const std::vector<double>& GetPoints() const { return _params; }
void StdMeshers_Sweeper::prepareTopBotDelaunay()
{
+ SMESH_MesherHelper* helper[2] = { myHelper, myHelper };
+ SMESH_MesherHelper botHelper( *myHelper->GetMesh() );
+ SMESH_MesherHelper topHelper( *myHelper->GetMesh() );
+ const SMDS_MeshNode* intBotNode = 0;
+ const SMDS_MeshNode* intTopNode = 0;
+ if ( myHelper->HasSeam() || myHelper->HasDegeneratedEdges() ) // use individual helpers
+ {
+ botHelper.SetSubShape( myBotFace );
+ topHelper.SetSubShape( myTopFace );
+ helper[0] = & botHelper;
+ helper[1] = & topHelper;
+ if ( !myIntColumns.empty() )
+ {
+ TNodeColumn& nodes = *myIntColumns[ myIntColumns.size()/2 ];
+ intBotNode = nodes[0];
+ intTopNode = nodes.back();
+ }
+ }
+
UVPtStructVec botUV( myBndColumns.size() );
UVPtStructVec topUV( myBndColumns.size() );
for ( size_t i = 0; i < myBndColumns.size(); ++i )
{
TNodeColumn& nodes = *myBndColumns[i];
botUV[i].node = nodes[0];
- botUV[i].SetUV( myHelper->GetNodeUV( myBotFace, nodes[0] ));
+ botUV[i].SetUV( helper[0]->GetNodeUV( myBotFace, nodes[0], intBotNode ));
topUV[i].node = nodes.back();
- topUV[i].SetUV( myHelper->GetNodeUV( myTopFace, nodes.back() ));
+ topUV[i].SetUV( helper[1]->GetNodeUV( myTopFace, nodes.back(), intTopNode ));
botUV[i].node->setIsMarked( true );
}
TopoDS_Edge dummyE;