Method Icon_Name

 

Your_Class::Icon_Name

 

The "Icon_Name()" method is used to getthe name of an icon used to represent the class in the "MODE_ALL" of the 2D windows.

 

The default method return the name of a generic "folder" icon.

 

 

Syntax

 

char          * Your_Class::Icon_Name(

          void

)

 

 

Parameters

 

This method does not have a parameter.

 

 

Return value

 

This method return the name of the image file to use as icon.

 

 

Remarks

 

·The icon file must be a TARGA image file (.tga) of 12x12 to 18x18 pixels (it does not have to be square).

·Pixels with the value r=0, g=0, b=255 will be considered as transparent.

The actual icon image file must be placed in the Icon sub-directory of the installation directory.

 

Requirements

 

Header:

          sliceO_include.hpp

 

Library:

          sliceO_Structures.lib

 

 

Example

 

The default  method

 

// ---------------------------------------------------------------------------

//

//          Icon_Name()

//

//          Get the name of the icon file for this class (NULL if none)

//

//          param:          void

//

//          return:          (char *)

//

// ----------------------------------------------------------------------------

char          *SliceO_Class::Icon_Name( void )

{

          return( "icon folder.tga" ) ;

}

 

 

The "Series"  method

 

// ----------------------------------------------------------------------------

//

//          Function:          Icon_Name

//

//          Parameters:          (void)

//          Returns:          (char *)                    The name of the icon file

//

//          We will assign an icon that represent the type of series we have:

//          a 3D volume, a 2D cine animation, a set of oblique slices or a

//          generic "image" icon.

//

// ----------------------------------------------------------------------------

inline          char          *SliceO_Series::Icon_Name( void )

{

          // --- The Fct_Group_Test test all the frames in a class and return

           // a flag describing the relation between them. ---

          unsigned int type = Fct_Group_Test( this ) ;

 

          // --- volume if: same res, same inc, parallel, sorted, uniform

          if ( ! (type & ( FLAG_SLICE_RES

                           | FLAG_SLICE_INC

                           | FLAG_SLICE_PARALLEL

                           | FLAG_SLICE_SORTED

                           | FLAG_SLICE_UNIFORM

                           | FLAG_SLICE_SAME_D ) ) )

              return( "icon volume.tga" ) ;

 

                          

          // --- animation if: same res, same inc, parallel, all_d

          if ( ! (type & ( FLAG_SLICE_RES

                           | FLAG_SLICE_INC

                           | FLAG_SLICE_PARALLEL

                           | FLAG_SLICE_ALL_D ) ) )

              return( "icon cine.tga" ) ;

                          

          // --- scout we can identify easily ---

          if ( this->scan_type & SCAN_TYPE_SCOUT )

              return( "icon oblique.tga" ) ;

 

          return( "icon image.tga" ) ;

}

 

See also