TNodeColumn& column = bot_column->second;
// bottom node parameters and coords
- gp_XYZ botParams = tBotNode.GetParams();
myShapeXYZ[ ID_BOT_FACE ] = tBotNode.GetCoords();
+ gp_XYZ botParams = tBotNode.GetParams();
// compute top node parameters
- gp_XYZ topParams;
myShapeXYZ[ ID_TOP_FACE ] = gpXYZ( column.back() );
- if ( column.size() < 3 ) { // only top and bottom nodes in columns
- topParams = botParams;
- }
- else {
+ gp_XYZ topParams = botParams;
+ topParams.SetZ( 1 );
+ if ( column.size() > 2 ) {
gp_Pnt topCoords = myShapeXYZ[ ID_TOP_FACE ];
- if ( !myBlock.ComputeParameters( topCoords, topParams, ID_TOP_FACE ))
+ if ( !myBlock.ComputeParameters( topCoords, topParams, ID_TOP_FACE, topParams ))
return error(TCom("Can't compute normalized parameters ")
<< "for node " << column.back()->GetID()
<< " on the face #"<< column.back()->GetPosition()->GetShapeId() );
if ( !SMESH_Block::ShellPoint( params, myShapeXYZ, coords ))
return error("Can't compute coordinates by normalized parameters");
+ SHOWYXZ("TOPFacePoint ",myShapeXYZ[ ID_TOP_FACE]);
+ SHOWYXZ("BOT Node "<< tBotNode.myNode->GetID(),gpXYZ(tBotNode.myNode));
+ SHOWYXZ("ShellPoint ",coords);
+
// create a node
node = meshDS->AddNode( coords.X(), coords.Y(), coords.Z() );
meshDS->SetNodeInVolume( node, volumeID );
// Fill myBotToColumnMap
int zSize = myBlock.VerticalSize();
+ TNode prevTNode;
TNodeNodeMap::iterator bN_tN = n2nMap.begin();
for ( ; bN_tN != n2nMap.end(); ++bN_tN )
{
continue; // wall columns are contained in myBlock
// compute bottom node params
TNode bN( botNode );
- if ( zSize > 2 )
- if ( !myBlock.ComputeParameters( bN.GetCoords(), bN.ChangeParams(), ID_BOT_FACE ))
+ if ( zSize > 2 ) {
+ gp_XYZ paramHint(-1,-1,-1);
+// if ( prevTNode.IsNeighbor( bN ))
+// paramHint = prevTNode.GetParams();
+ if ( !myBlock.ComputeParameters( bN.GetCoords(), bN.ChangeParams(),
+ ID_BOT_FACE, paramHint ))
return error(TCom("Can't compute normalized parameters ")
<< "for node " << botNode->GetID() << " on the face #"<< botSM->GetId() );
+ }
+ prevTNode = bN;
// create node column
TNode2ColumnMap::iterator bN_col =
myBotToColumnMap.insert( make_pair ( bN, TNodeColumn() )).first;
return true;
}
+//================================================================================
+/*!
+ * \brief Return true if this node and other one belong to one face
+ */
+//================================================================================
+
+bool TNode::IsNeighbor( const TNode& other ) const
+{
+ if ( !other.myNode || !myNode ) return false;
+
+ SMDS_ElemIteratorPtr fIt = other.myNode->GetInverseElementIterator(SMDSAbs_Face);
+ while ( fIt->more() )
+ if ( fIt->next()->GetNodeIndex( myNode ) >= 0 )
+ return true;
+ return false;
+}
+
//================================================================================
/*!
* \brief Constructor. Initialization is needed
gp_XYZ GetCoords() const { return gp_XYZ( myNode->X(), myNode->Y(), myNode->Z() ); }
gp_XYZ GetParams() const { return myParams; }
gp_XYZ& ChangeParams() { return myParams; }
+ bool HasParams() const { return myParams.X() >= 0.0; }
SMDS_TypeOfPosition GetPositionType() const
{ return myNode ? myNode->GetPosition()->GetTypeOfPosition() : SMDS_TOP_UNSPEC; }
+ bool IsNeighbor( const TNode& other ) const;
- TNode(const SMDS_MeshNode* node = 0): myNode(node), myParams(0,0,0) {}
+ TNode(const SMDS_MeshNode* node = 0): myNode(node), myParams(-1,-1,-1) {}
bool operator < (const TNode& other) const { return myNode < other.myNode; }
};