-
-typedef double (SMDS_MeshNode::* TGetCoord)() const;
-typedef const char* TName;
-typedef const char* TUnit;
-
-static TUnit aUnit[3] = {"m","m","m"};
-
-static TGetCoord aXYZGetCoord[3] = {
- &SMDS_MeshNode::X,
- &SMDS_MeshNode::Y,
- &SMDS_MeshNode::Z
-};
-static TName aXYZName[3] = {"x","y","z"};
-
-
-static TGetCoord aXYGetCoord[2] = {
- &SMDS_MeshNode::X,
- &SMDS_MeshNode::Y
-};
-static TName aXYName[2] = {"x","y"};
-
-static TGetCoord aYZGetCoord[2] = {
- &SMDS_MeshNode::Y,
- &SMDS_MeshNode::Z
-};
-static TName aYZName[2] = {"y","z"};
-
-static TGetCoord aXZGetCoord[2] = {
- &SMDS_MeshNode::X,
- &SMDS_MeshNode::Z
-};
-static TName aXZName[2] = {"x","z"};
-
-
-static TGetCoord aXGetCoord[1] = {
- &SMDS_MeshNode::X
-};
-static TName aXName[1] = {"x"};
-
-static TGetCoord aYGetCoord[1] = {
- &SMDS_MeshNode::Y
-};
-static TName aYName[1] = {"y"};
-
-static TGetCoord aZGetCoord[1] = {
- &SMDS_MeshNode::Z
-};
-static TName aZName[1] = {"z"};
-
-
-class TCoordHelper{
- SMDS_NodeIteratorPtr myNodeIter;
- const SMDS_MeshNode* myCurrentNode;
- TGetCoord* myGetCoord;
- TName* myName;
- TUnit* myUnit;
-public:
- TCoordHelper(const SMDS_NodeIteratorPtr& theNodeIter,
- TGetCoord* theGetCoord,
- TName* theName,
- TUnit* theUnit = aUnit):
- myNodeIter(theNodeIter),
- myGetCoord(theGetCoord),
- myName(theName),
- myUnit(theUnit)
- {}
- virtual ~TCoordHelper(){}
- bool Next(){
- return myNodeIter->more() &&
- (myCurrentNode = myNodeIter->next());
- }
- const SMDS_MeshNode* GetNode(){
- return myCurrentNode;
- }
- MED::TIntVector::value_type GetID(){
- myCurrentNode->GetID();
- }
- MED::TFloatVector::value_type GetCoord(med_int theCoodId){
- return (myCurrentNode->*myGetCoord[theCoodId])();
- }
- MED::TStringVector::value_type GetName(med_int theDimId){
- return myName[theDimId];
- }
- MED::TStringVector::value_type GetUnit(med_int theDimId){
- return myUnit[theDimId];
- }
-};
-typedef boost::shared_ptr<TCoordHelper> TCoordHelperPtr;
-
-
-void DriverMED_W_SMESHDS_Mesh::Add()