//=================================================================================
// function : GetEdgeNodes
//=================================================================================
// function : GetEdgeNodes
//=================================================================================
bool SMESH_VisualObjDef::GetEdgeNodes( const int theElemId,
const int theEdgeNum,
//=================================================================================
bool SMESH_VisualObjDef::GetEdgeNodes( const int theElemId,
const int theEdgeNum,
- if ( theEdgeNum < 0 || theEdgeNum > 3 || (nbNodes != 3 && nbNodes != 4) || theEdgeNum > nbNodes )
+ if (( theEdgeNum < 0 || theEdgeNum > 3 ) ||
+ ( nbNodes != 3 && nbNodes != 4 ) ||
+ ( theEdgeNum >= nbNodes ))
- theNodeId1 = anElem->GetNode( theEdgeNum - 1 )->GetID();
- theNodeId2 = anElem->GetNode( theEdgeNum % nbNodes )->GetID();
+ theNodeId1 = anElem->GetNode( theEdgeNum )->GetID();
+ theNodeId2 = anElem->GetNode(( theEdgeNum + 1 ) % nbNodes )->GetID();
//=================================================================================
bool SMESH_VisualObjDef::IsValid() const
{
//=================================================================================
bool SMESH_VisualObjDef::IsValid() const
{
- //MESSAGE("SMESH_VisualObjDef::IsValid");
- return ( GetNbEntities(SMDSAbs_0DElement) > 0 ||
- GetNbEntities(SMDSAbs_Ball ) > 0 ||
- GetNbEntities(SMDSAbs_Edge ) > 0 ||
+ return ( GetNbEntities(SMDSAbs_0DElement) > 0 ||
+ GetNbEntities(SMDSAbs_Ball ) > 0 ||
+ GetNbEntities(SMDSAbs_Edge ) > 0 ||
GetNbEntities(SMDSAbs_Face ) > 0 ||
GetNbEntities(SMDSAbs_Volume ) > 0 ||
GetNbEntities(SMDSAbs_Node ) > 0 );
GetNbEntities(SMDSAbs_Face ) > 0 ||
GetNbEntities(SMDSAbs_Volume ) > 0 ||
GetNbEntities(SMDSAbs_Node ) > 0 );
// function : updateEntitiesFlags
// purpose : Update entities flags
//=================================================================================
// function : updateEntitiesFlags
// purpose : Update entities flags
//=================================================================================
- if( myEntitiesCache[SMDSAbs_0DElement] != 0 || myEntitiesCache[SMDSAbs_0DElement] >= entities[SMDSAbs_0DElement] )
- myEntitiesState &= ~SMESH_Actor::e0DElements;
+ if( myEntitiesCache[SMDSAbs_0DElement] != 0 ||
+ myEntitiesCache[SMDSAbs_0DElement] >= entities[SMDSAbs_0DElement] )
+ myEntitiesState &= ~SMESH_Actor::e0DElements;
- if( myEntitiesCache[SMDSAbs_Ball] != 0 || myEntitiesCache[SMDSAbs_Ball] >= entities[SMDSAbs_Ball] )
- myEntitiesState &= ~SMESH_Actor::eBallElem;
+ if( myEntitiesCache[SMDSAbs_Ball] != 0 ||
+ myEntitiesCache[SMDSAbs_Ball] >= entities[SMDSAbs_Ball] )
+ myEntitiesState &= ~SMESH_Actor::eBallElem;
- if( myEntitiesCache[SMDSAbs_Edge] != 0 || myEntitiesCache[SMDSAbs_Edge] >= entities[SMDSAbs_Edge] )
- myEntitiesState &= ~SMESH_Actor::eEdges;
+ if( myEntitiesCache[SMDSAbs_Edge] != 0 ||
+ myEntitiesCache[SMDSAbs_Edge] >= entities[SMDSAbs_Edge] )
+ myEntitiesState &= ~SMESH_Actor::eEdges;
- if( myEntitiesCache[SMDSAbs_Face] != 0 || myEntitiesCache[SMDSAbs_Face] >= entities[SMDSAbs_Face] )
- myEntitiesState &= ~SMESH_Actor::eFaces;
+ if( myEntitiesCache[SMDSAbs_Face] != 0 ||
+ myEntitiesCache[SMDSAbs_Face] >= entities[SMDSAbs_Face] )
+ myEntitiesState &= ~SMESH_Actor::eFaces;
- if( myEntitiesCache[SMDSAbs_Volume] != 0 || myEntitiesCache[SMDSAbs_Volume] >= entities[SMDSAbs_Volume] )
- myEntitiesState &= ~SMESH_Actor::eVolumes;
+ if( myEntitiesCache[SMDSAbs_Volume] != 0 ||
+ myEntitiesCache[SMDSAbs_Volume] >= entities[SMDSAbs_Volume] )
+ myEntitiesState &= ~SMESH_Actor::eVolumes;
}
//=================================================================================
// function : ClearEntitiesFlags
// purpose : Clear the entities flags
//=================================================================================
}
//=================================================================================
// function : ClearEntitiesFlags
// purpose : Clear the entities flags
//=================================================================================
-void SMESH_VisualObjDef::ClearEntitiesFlags() {
- myEntitiesState = SMESH_Actor::eAllEntity;
- myEntitiesFlag = false;
+void SMESH_VisualObjDef::ClearEntitiesFlags()
+{
+ myEntitiesState = SMESH_Actor::eAllEntity;
+ myEntitiesFlag = false;
}
//=================================================================================
// function : GetEntitiesFlag
// purpose : Return the entities flag
//=================================================================================
}
//=================================================================================
// function : GetEntitiesFlag
// purpose : Return the entities flag
//=================================================================================
}
//=================================================================================
// function : GetEntitiesState
// purpose : Return the entities state
//=================================================================================
}
//=================================================================================
// function : GetEntitiesState
// purpose : Return the entities state
//=================================================================================
- MESSAGE ("SMESH_MeshObj::NulData() ==================================================================================");
- if (!myEmptyGrid)
- {
- myEmptyGrid = SMDS_UnstructuredGrid::New();
- myEmptyGrid->Initialize();
- myEmptyGrid->Allocate();
- vtkPoints* points = vtkPoints::New();
- points->SetNumberOfPoints(0);
- myEmptyGrid->SetPoints( points );
- points->Delete();
- myEmptyGrid->BuildLinks();
- }
- myGrid->ShallowCopy(myEmptyGrid);
- return true;
+ MESSAGE ("SMESH_MeshObj::NulData() ==================================================================================");
+ if (!myEmptyGrid)
+ {
+ myEmptyGrid = SMDS_UnstructuredGrid::New();
+ myEmptyGrid->Initialize();
+ myEmptyGrid->Allocate();
+ vtkPoints* points = vtkPoints::New();
+ points->SetNumberOfPoints(0);
+ myEmptyGrid->SetPoints( points );
+ points->Delete();
+ myEmptyGrid->BuildLinks();
+ }
+ myGrid->ShallowCopy(myEmptyGrid);
+ return true;
}
//=================================================================================
// function : GetElemDimension
}
//=================================================================================
// function : GetElemDimension