The Class Fct

 

The main database of sliceOmatic is composed of a tree of classes of type "SliceO_Class". 

 

The root of the tree is of type "SliceO_Root", and the leaves of the tree are of type "SliceO_Frames". The parent class "SliceO_Class" and the 2 children "SlceO_Root" and "SliceO_Frame" are part of sliceOmatic.  But all the other classes of the tree are defined in modules. You can add your own class to the tree.

 

When you create a new class, you need to define the class itself. It is derived from the parent class "SliceO_Class".  It must contain at least a constructor.  You will also need to provide the functions:

 

 

Class_Register

This function is needed to register your class with sliceOmatic

 

 

Class_Status

This function provide some information about your class

 

 

Class_Insert

This function will be called by sliceOmatic when it construct its database.

 

As mentioned, your class must provide a constructor, but it can also provide a number of methods to replace the default virtual ones.  The methods you can override are:

 

 

constructor

You need to have a constructor for your class

 

 

destructor

Needed if any allocation done in the constructor.

 

 

Compare

Used to compare 2 elements of the same class.

 

 

Icon_Name

Used to draw an icon in the "Mode All" of 2D windows.

 

 

Sort

Used to sort the elements of a same class.

 

 

Stool

Used for debugging.

 

 

Update_A

Update once per loop.

 

 

Update_B

Update only when we have time.

 

 

Update_Child_A

Recursive update.

 

With each instance of a class is associated a 32 bit "ID" flag.  This flag contain an 8 bit "Magic" number (CLASS_MAGIC = 0xAA000000), an 8 bit class ID number (0x00010000 to 0x00FF0000), a 16 bit class instance number (0x00000000 to 0x0000FFFF).

 

The "Magic" and instance numbers are assigned by sliceOmatic, you must provide the class ID value. The values 0x00010000 to 0x000F0000 and 0x00FF0000 reserved for TomoVision.  This leave the values 0x0010000 to 0x0FE0000 free for your use.

 

This ID is set with the method "Class_Class_Set()" and retrieved with the method "Class_Class_Get()". 

 

The function "Class_ID_Get()" return both the class ID and its instance number.  This make it the perfect function to uniquely identify a class instance.

 

A lot more information on the SliceO_Class class can be found here.