MESSAGE("HYBRIDPlugin_HYBRID::HYBRIDPlugin_HYBRID");
_name = Name();
_shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID);// 1 bit /shape type
- _onlyUnaryInput = false; // Compute() will be called on a compound of solids
+ _onlyUnaryInput = true; // Compute() will be called on each solid
_iShape=0;
_nbShape=0;
_compatibleHypothesis.push_back( HYBRIDPlugin_Hypothesis::GetHypType());
return false;
MESSAGE("Done ");
- // Read ids of domains
- std::vector< int > solidIDByDomain;
+ // Hybrid is not multi-domain => We can't (and don't need to) read ids of domains in ouput file like in GHS3DPlugin
+ // We just need to get the id of the one and only solid
+ int solidID = 1;
if ( hasGeom )
{
- int solid1; // id used in case of 1 domain or some reading failure
if ( theHelper->GetSubShape().ShapeType() == TopAbs_SOLID )
- solid1 = theHelper->GetSubShapeID();
+ solidID = theHelper->GetSubShapeID();
else
- solid1 = theMeshDS->ShapeToIndex
+ solidID = theMeshDS->ShapeToIndex
( TopExp_Explorer( theHelper->GetSubShape(), TopAbs_SOLID ).Current() );
-
- int nbDomains = GmfStatKwd( InpMsh, GmfSubDomainFromGeom );
- if ( nbDomains > 1 )
- {
- solidIDByDomain.resize( nbDomains+1, theHelper->GetSubShapeID() );
- int faceNbNodes, faceIndex, orientation, domainNb;
- GmfGotoKwd( InpMsh, GmfSubDomainFromGeom );
- for ( int i = 0; i < nbDomains; ++i )
- {
- faceIndex = 0;
- GmfGetLin( InpMsh, GmfSubDomainFromGeom,
- &faceNbNodes, &faceIndex, &orientation, &domainNb);
- solidIDByDomain[ domainNb ] = 1;
- if ( 0 < faceIndex && faceIndex-1 < (int)theFaceByHybridId.size() )
- {
- const SMDS_MeshElement* face = theFaceByHybridId[ faceIndex-1 ];
- const SMDS_MeshNode* nn[3] = { face->GetNode(0),
- face->GetNode(1),
- face->GetNode(2) };
- if ( orientation < 0 )
- std::swap( nn[1], nn[2] );
- solidIDByDomain[ domainNb ] =
- findShapeID( *theHelper->GetMesh(), nn[0], nn[1], nn[2], toMeshHoles );
- if ( solidIDByDomain[ domainNb ] > 0 )
- {
- const TopoDS_Shape& foundShape = theMeshDS->IndexToShape( solidIDByDomain[ domainNb ] );
- if ( ! theHelper->IsSubShape( foundShape, theHelper->GetSubShape() ))
- solidIDByDomain[ domainNb ] = HOLE_ID;
- }
- }
- }
- }
- if ( solidIDByDomain.size() < 2 )
- solidIDByDomain.resize( 2, solid1 );
}
// Issue 0020682. Avoid creating nodes and tetras at place where
delete [] GMFNode;
return false;
}
- int dummy, solidID;
+ int dummy;
GmfKwdCod token = it->first;
nbRef = it->second;
case GmfTetrahedra:
if ( hasGeom )
{
- solidID = solidIDByDomain[ domainID[iElem]];
if ( solidID != HOLE_ID )
{
aCreatedElem = theHelper->AddVolume( node[1], node[0], node[2], node[3],
case GmfPrisms:
if ( hasGeom )
{
- solidID = solidIDByDomain[ domainID[iElem]];
if ( solidID != HOLE_ID )
{
aCreatedElem = theHelper->AddVolume( node[0], node[2], node[1],
case GmfHexahedra:
if ( hasGeom )
{
- solidID = solidIDByDomain[ domainID[iElem]];
if ( solidID != HOLE_ID )
{
aCreatedElem = theHelper->AddVolume( node[0], node[3], node[2], node[1],