SMESH_Gen::SMESH_Gen()
{
- MESSAGE("SMESH_Gen::SMESH_Gen");
- _localId = 0;
- _hypId = 0;
+ MESSAGE("SMESH_Gen::SMESH_Gen");
+ _localId = 0;
+ _hypId = 0;
_segmentation = 10;
}
SMESH_Gen::~SMESH_Gen()
{
- MESSAGE("SMESH_Gen::~SMESH_Gen");
+ MESSAGE("SMESH_Gen::~SMESH_Gen");
}
//=============================================================================
//=============================================================================
/*SMESH_Hypothesis *SMESH_Gen::CreateHypothesis(const char *anHyp, int studyId)
- throw(SALOME_Exception)
+ throw(SALOME_Exception)
{
- MESSAGE("CreateHypothesis("<<anHyp<<","<<studyId<<")");
- // Get studyContext, create it if it does'nt exist, with a SMESHDS_Document
+ MESSAGE("CreateHypothesis("<<anHyp<<","<<studyId<<")");
+ // Get studyContext, create it if it does'nt exist, with a SMESHDS_Document
- StudyContextStruct *myStudyContext = GetStudyContext(studyId);
+ StudyContextStruct *myStudyContext = GetStudyContext(studyId);
- // create a new hypothesis object, store its ref. in studyContext
+ // create a new hypothesis object, store its ref. in studyContext
- SMESH_Hypothesis *myHypothesis = _hypothesisFactory.Create(anHyp, studyId);
- int hypId = myHypothesis->GetID();
- myStudyContext->mapHypothesis[hypId] = myHypothesis;
- SCRUTE(studyId);
- SCRUTE(hypId);
+ SMESH_Hypothesis *myHypothesis = _hypothesisFactory.Create(anHyp, studyId);
+ int hypId = myHypothesis->GetID();
+ myStudyContext->mapHypothesis[hypId] = myHypothesis;
+ SCRUTE(studyId);
+ SCRUTE(hypId);
- // store hypothesis in SMESHDS document
+ // store hypothesis in SMESHDS document
- myStudyContext->myDocument->AddHypothesis(myHypothesis);
- return myHypothesis;
+ myStudyContext->myDocument->AddHypothesis(myHypothesis);
+ return myHypothesis;
}*/
//=============================================================================
// create a new SMESH_mesh object
SMESH_Mesh *aMesh = new SMESH_Mesh(_localId++,
- theStudyId,
- this,
- theIsEmbeddedMode,
- aStudyContext->myDocument);
+ theStudyId,
+ this,
+ theIsEmbeddedMode,
+ aStudyContext->myDocument);
aStudyContext->mapMesh[_localId] = aMesh;
return aMesh;
bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
const TopoDS_Shape & aShape,
const bool anUpward,
- const ::MeshDimension aDim,
- TSetOfInt* aShapesId)
+ const ::MeshDimension aDim,
+ TSetOfInt* aShapesId)
{
MESSAGE("SMESH_Gen::Compute");
// clear compute state to not show previous compute errors
// if preview invoked less dimension less than previous
smToCompute->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
- continue;
+ continue;
}
if (smToCompute->GetComputeState() == SMESH_subMesh::READY_TO_COMPUTE)
if (smToCompute->GetComputeState() == SMESH_subMesh::FAILED_TO_COMPUTE)
ret = false;
else if ( aShapesId )
- aShapesId->insert( smToCompute->GetId() );
+ aShapesId->insert( smToCompute->GetId() );
}
return ret;
}
// check for preview dimension limitations
if ( aShapesId && aShapeDim > (int)aDim )
- continue;
+ continue;
SMESH_Algo* algo = GetAlgo( aMesh, aSubShape );
if ( algo && !algo->NeedDescretBoundary() )
if ( algo->SupportSubmeshes() )
smWithAlgoSupportingSubmeshes.push_back( smToCompute );
else
- {
+ {
smToCompute->ComputeStateEngine( SMESH_subMesh::COMPUTE );
- if ( aShapesId )
- aShapesId->insert( smToCompute->GetId() );
- }
+ if ( aShapesId )
+ aShapesId->insert( smToCompute->GetId() );
+ }
}
}
// ------------------------------------------------------------
SMESH_subMesh* smToCompute = smIt->next();
const TopoDS_Shape& aSubShape = smToCompute->GetSubShape();
- const int aShapeDim = GetShapeDim( aSubShape );
+ const int aShapeDim = GetShapeDim( aSubShape );
//if ( aSubShape.ShapeType() == TopAbs_VERTEX ) continue;
- if ( aShapeDim < 1 ) continue;
+ if ( aShapeDim < 1 ) continue;
- // check for preview dimension limitations
- if ( aShapesId && GetShapeDim( aSubShape.ShapeType() ) > (int)aDim )
- continue;
-
+ // check for preview dimension limitations
+ if ( aShapesId && GetShapeDim( aSubShape.ShapeType() ) > (int)aDim )
+ continue;
+
SMESH_HypoFilter filter( SMESH_HypoFilter::IsAlgo() );
filter
.And( SMESH_HypoFilter::IsApplicableTo( aSubShape ))
for ( subIt = smWithAlgoSupportingSubmeshes.rbegin(); subIt != subEnd; ++subIt )
if ( sm->GetComputeState() == SMESH_subMesh::READY_TO_COMPUTE)
{
- const TopAbs_ShapeEnum aShType = sm->GetSubShape().ShapeType();
- // check for preview dimension limitations
- if ( aShapesId && GetShapeDim( aShType ) > (int)aDim )
- continue;
+ const TopAbs_ShapeEnum aShType = sm->GetSubShape().ShapeType();
+ // check for preview dimension limitations
+ if ( aShapesId && GetShapeDim( aShType ) > (int)aDim )
+ continue;
sm->ComputeStateEngine( SMESH_subMesh::COMPUTE );
- if ( aShapesId )
- aShapesId->insert( sm->GetId() );
+ if ( aShapesId )
+ aShapesId->insert( sm->GetId() );
}
// -----------------------------------------------
bool SMESH_Gen::Evaluate(SMESH_Mesh & aMesh,
const TopoDS_Shape & aShape,
MapShapeNbElems& aResMap,
- const bool anUpward,
- TSetOfInt* aShapesId)
+ const bool anUpward,
+ TSetOfInt* aShapesId)
{
MESSAGE("SMESH_Gen::Evaluate");
//if ( !aMesh.HasShapeToMesh() && aShType == TopAbs_VERTEX )
// continue;
if ( !aMesh.HasShapeToMesh() ) {
- if( aShType == TopAbs_VERTEX || aShType == TopAbs_WIRE ||
- aShType == TopAbs_SHELL )
- continue;
+ if( aShType == TopAbs_VERTEX || aShType == TopAbs_WIRE ||
+ aShType == TopAbs_SHELL )
+ continue;
}
smToCompute->Evaluate(aResMap);
if( aShapesId )
- aShapesId->insert( smToCompute->GetId() );
+ aShapesId->insert( smToCompute->GetId() );
}
return ret;
}
if ( algo && !algo->NeedDescretBoundary() ) {
if ( algo->SupportSubmeshes() ) {
smWithAlgoSupportingSubmeshes.push_back( smToCompute );
- }
+ }
else {
smToCompute->Evaluate(aResMap);
- if ( aShapesId )
- aShapesId->insert( smToCompute->GetId() );
- }
+ if ( aShapesId )
+ aShapesId->insert( smToCompute->GetId() );
+ }
}
}
// ------------------------------------------------------------
SMESH_subMesh* smToCompute = smIt->next();
const TopoDS_Shape& aSubShape = smToCompute->GetSubShape();
- const int aShapeDim = GetShapeDim( aSubShape );
- if ( aShapeDim < 1 ) continue;
+ const int aShapeDim = GetShapeDim( aSubShape );
+ if ( aShapeDim < 1 ) continue;
- //const TopAbs_ShapeEnum aShType = smToCompute->GetSubShape().ShapeType();
+ //const TopAbs_ShapeEnum aShType = smToCompute->GetSubShape().ShapeType();
SMESH_HypoFilter filter( SMESH_HypoFilter::IsAlgo() );
filter
for ( subIt = smWithAlgoSupportingSubmeshes.rbegin(); subIt != subEnd; ++subIt ) {
sm->Evaluate(aResMap);
if ( aShapesId )
- aShapesId->insert( sm->GetId() );
+ aShapesId->insert( sm->GetId() );
}
// -----------------------------------------------
checkConformIgnoredAlgos (aMesh, (*revItSub).second, aGlobIgnoAlgo,
algo, checkConform2, aCheckedMap, theErrors);
int key = (*revItSub).first;
- SMESH_subMesh* sm = (*revItSub).second;
+ SMESH_subMesh* sm = (*revItSub).second;
if ( aCheckedMap.find( key ) == aCheckedMap.end() )
{
aCheckedMap[ key ] = sm;
StudyContextStruct *SMESH_Gen::GetStudyContext(int studyId)
{
- // Get studyContext, create it if it does'nt exist, with a SMESHDS_Document
-
- if (_mapStudyContext.find(studyId) == _mapStudyContext.end())
- {
- _mapStudyContext[studyId] = new StudyContextStruct;
- _mapStudyContext[studyId]->myDocument = new SMESHDS_Document(studyId);
- }
- StudyContextStruct *myStudyContext = _mapStudyContext[studyId];
+ // Get studyContext, create it if it does'nt exist, with a SMESHDS_Document
+
+ if (_mapStudyContext.find(studyId) == _mapStudyContext.end())
+ {
+ _mapStudyContext[studyId] = new StudyContextStruct;
+ _mapStudyContext[studyId]->myDocument = new SMESHDS_Document(studyId);
+ }
+ StudyContextStruct *myStudyContext = _mapStudyContext[studyId];
// ASSERT(_mapStudyContext.find(studyId) != _mapStudyContext.end());
- return myStudyContext;
+ return myStudyContext;
}
// //=============================================================================
int SMESH_Gen::GetANewId()
{
- //MESSAGE("SMESH_Gen::GetANewId");
- return _hypId++;
+ //MESSAGE("SMESH_Gen::GetANewId");
+ return _hypId++;
}