X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpExtensions%2FVisualization%2FImageSliceActors.cxx;h=024fbe09c9bc94051ac6652bc19092f7de7a2424;hb=a7142bafa94bd9f1d1fd9df4c11d5356676cf419;hp=88a0a4bc7d8a3c6cb47c0bd31239bec3781ced68;hpb=dbc5b32e13cf4a299ce29a5666a8e0a2ff5e62a8;p=cpPlugins.git diff --git a/lib/cpExtensions/Visualization/ImageSliceActors.cxx b/lib/cpExtensions/Visualization/ImageSliceActors.cxx index 88a0a4b..024fbe0 100644 --- a/lib/cpExtensions/Visualization/ImageSliceActors.cxx +++ b/lib/cpExtensions/Visualization/ImageSliceActors.cxx @@ -902,10 +902,17 @@ UpdateText( ) else if( axId == 1 ) axis = 'Y'; else if( axId == 2 ) axis = 'Z'; +#if defined(WIN32) + sprintf_s( + this->m_TextBuffer, 1024, "Axis: %c (%d)", + axis, this->m_ImageMapper->GetSliceNumber( ) + ); +#else // defined(WIN32) std::sprintf( this->m_TextBuffer, "Axis: %c (%d)", axis, this->m_ImageMapper->GetSliceNumber( ) ); +#endif // defined(WIN32) } else this->m_TextBuffer[ 0 ] = '\0'; @@ -956,11 +963,18 @@ UpdateText( double pos[ 3 ] ) ijk[ 0 ], ijk[ 1 ], ijk[ 2 ], n ); str << ")"; + +#if defined(WIN32) + sprintf_s( + this->m_TextBuffer, 1024, "Axis: %c (%d)\nPixel %s", + axis, slice, str.str( ).c_str( ) + ); +#else // defined(WIN32) std::sprintf( this->m_TextBuffer, "Axis: %c (%d)\nPixel %s", axis, slice, str.str( ).c_str( ) ); - +#endif // defined(WIN32) } // fi } else @@ -982,10 +996,17 @@ UpdateText( const double& w, const double& l ) else if( axId == 1 ) axis = 'Y'; else if( axId == 2 ) axis = 'Z'; +#if defined(WIN32) + sprintf_s( + this->m_TextBuffer, 1024, "Axis: %c (%d)\nW/L (%.2f/%.2f)", + axis, this->m_ImageMapper->GetSliceNumber( ), w, l + ); +#else // defined(WIN32) std::sprintf( this->m_TextBuffer, "Axis: %c (%d)\nW/L (%.2f/%.2f)", axis, this->m_ImageMapper->GetSliceNumber( ), w, l ); +#endif // defined(WIN32) } else this->m_TextBuffer[ 0 ] = '\0';