SMDS_VolumeTool::~SMDS_VolumeTool()
{
- if (myVolumeNodes != NULL) {
- delete [] myVolumeNodes;
- myVolumeNodes = NULL;
- }
- if (myFaceNodes != NULL) {
- delete [] myFaceNodes;
- myFaceNodes = NULL;
- }
+ if ( myVolumeNodes != NULL ) delete [] myVolumeNodes;
+ if ( myFaceNodes != NULL ) delete [] myFaceNodes;
+
+ myFaceNodeIndices = NULL;
+ myVolumeNodes = myFaceNodes = NULL;
}
//=======================================================================
const int* SMDS_VolumeTool::GetFaceNodesIndices( int faceIndex )
{
- if (myVolume->IsPoly()) {
- MESSAGE("Warning: attempt to obtain FaceNodesIndices of polyhedral volume");
- return NULL;
- }
if ( !setFace( faceIndex ))
return 0;
+
+ if (myVolume->IsPoly())
+ {
+ myPolyIndices.resize( myFaceNbNodes + 1 );
+ myFaceNodeIndices = & myPolyIndices[0];
+ for ( int i = 0; i <= myFaceNbNodes; ++i )
+ myFaceNodeIndices[i] = myVolume->GetNodeIndex( myFaceNodes[i] );
+ }
return myFaceNodeIndices;
}
//purpose : return element
//=======================================================================
-const SMDS_MeshVolume* SMDS_VolumeTool::Get() const
+const SMDS_MeshVolume* SMDS_VolumeTool::Element() const
{
return static_cast<const SMDS_MeshVolume*>( myVolume );
}
// Set volume.
// Return false if theVolume is not of type SMDSAbs_Volume
- const SMDS_MeshVolume* Get() const;
+ const SMDS_MeshVolume* Element() const;
// return element
int ID() const;
int myNbFaces;
int myVolumeNbNodes;
const SMDS_MeshNode** myVolumeNodes;
+ std::vector< int > myPolyIndices;
bool myExternalFaces;