Method constructor

 

Your_Class::Your_Class

 

You must provide a class constructor for your class.

 

This constructor must at least set the class ID value, the class title a pointer to the parent class and the Name and Sort values.

 

 

Syntax

 

Your_Class::Your_Class(

          SliceO_Class *parent,

          unsigned short id,

          SliceO_File *file,

          int bunch,

          int slice

)

 

 

Parameters

 

parent

Pointer to the parent of this class

 

id

Class instance number. (Only if more than one instance of this class in the DB Class tree).

 

file

Pointer to the file structure of the file to insert

 

bunch

bunch number if the file has multiple bunches (groups of slices)

 

slice

slice number if the file has multiple slices

 

 

Return value

 

This method does not return a value.

 

 

Remarks

 

 

Requirements

 

Header:

          sliceO_include.hpp

 

Library:

          sliceO_Structures.lib

 

 

Example

 

The "Series" class

 

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

//

//          SliceO_Series

//

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

class          __declspec(dllexport) SliceO_Series:public SliceO_Class  {

 

public:

 

          // ---- Constructor ---

          SliceO_Series( SliceO_Class *parent, unsigned short id, SliceO_File *file, int bunch, int slice ) ;

 

          // --- Local data ---

          unsigned short          scan_type ;          // axial, scout ...

 

          // --- Definition of virtual functions ---

          char          *Icon_Name( void ) ;

} ;

 

inline          SliceO_Series::SliceO_Series( SliceO_Class *parent, unsigned short id, SliceO_File *file, int bunch, int slice )

{

          this->Class_Class_Set( CLASS_ID_SERIES ) ;

          this->Class_Instance_Set( id ) ;

          this->Title_Set( "Series" ) ;

 

          Parent_Set_Pt( parent ) ;

 

          // --- get the local information ---

          Tomo_Image *ima = ((Tomo_Image **) file->m_bunch_head)[bunch] ;

 

          scan_type = ima->scan_type ;

 

          // --- create a series name ---

          this->Sort_Set( "%d", ima->g1.series_num ) ;

          this->Name_Set( "%d", ima->g1.series_num ) ;

 

          // ====================================================================

          // ===          By default, all slices are selected, and root is expanded   ===

          // ====================================================================

          Flag_Set_On( CLASS_MODE_THIS, CLASS_MODE_ALL, CLASS_FLAG_EXPAND ) ;

}

 

See also