Parent Class: SliceO_Class

 

The parent class "Sliceo_Class" is rather big, to help understand it, I have split it in multiple parts: (the color code used in the tables is explained bellow):

 

 

Rows with pink background are for private variables

 

 

Rows with yellow background are for variables and methods that are used by TomoVision but will probably not be used in user modules.

 

 

Rows with white background are for variables and methods that will probably be useful in user modules.

 

 

 

 

Constructors

 

The constructor and destructor of the class are described here:

 

Public:

SliceO_Class

The constructor of the class.

 

~SliceO_Class

The destructor of the class.

 

 

 

Identification

 

The first part of the class contain the information needed to identify it.  This part include the following variables and methods:

 

Some of these are derived from the parent (SliceO) class:

 

Private:

m_class_a (unsigned short)

 

The exact meaning of the content of "A" depend on the class:

SliceO_Class

The class Type (CLASS_TYPE_ROOT, CLASS_TYPE_FRAME...)

Note: The first 100 values and the value 0xFFFF (CLASS_TYPE_FRAME) are reserved for TomoVision.

 

Public:

Class_A_Get

Return the value of the "m_class_a" variable.

 

Class_A_Set

Set the value of the "m_class_a" variable.

 

Private:

m_class_b (unsigned short)

 

The exact meaning of content of "B" depend on the class:

SliceO_Class

Depth in the class database tree

 

Public:

Class_B_Get

Return the value of the "m_class_b" variable.

 

Class_B_Set

Set the value of the "m_class_b" variable.

 

 

Private:

m_name (char *)

 

Name of the class instance

Public:

Name_Get

 

Return the name of the class instance

Name_Set

 

Assign a name to the class instance

 

 

And some are specific to the SliceO_Class class

 

Public:

m_index (unsigned int)

Index of this class instance. It start with 1 and it will be unique for each instances of each class (but they may not be sequential, and there will be holes)

 

Public:

 

Class_Id_Get

 

A method that returns the "Id" of this instance.  The "Id" is composed of both the "Type" and "Level" values:

Id = (type<<16) + level

 

Private:

m_title (char *)

The title of this class.  It can be accessed through: Title_Get() and Title_Set().

 

Public:

Title_Get

A method that returns the title of the class.

 

Title_Set

A method that sets the title of the class.

 

Private:

m_sort (char *)

A string used when sorting the elements of a class.   It can be accessed through: Sort_Get() and Sort_Set().

 

Public:

Sort_Get

A method that returns the sort string of this instance of the class.

 

Sort_Set

A method that sets the sort string of this instance of the class.

 

 

 

Tree Structure

 

The classes are part of a tree.  We need some information for the tree structure.

 

Private:

m_parent_pt (SliceO_Class *)

A pointer to the parent class (or NULL for the root class) of this instance.

 

m_child_nb (int)

The number of children of this instance

 

 m_child_pt (SliceO_Class **)

An array of m_child_nb pointers to the children of this instance.

 

Public:

Parent_Get_Pt

Get a pointer to the parent of this instance.

 

Parent_Set_Pt

Set the parent of this instance.

 

Child_Get_Nb

Get the number of children of this instance.

 

Child_Get_Pt

Get a pointer to a specific child of this instance.

 

Child_Get_Cur

Get a pointer to the child of this instance that is part of the "current" path.

 

Child_Delete

Delete all children of this instance.

 

Child_Add

Add a child to this instance.

 

 

 

Flags

 

This part of the class contain the different flags and their access functions.  The flags are used to signal that a class need to be updated, redrawn or just to give the state of the class.

 

Private:

m_flag_update_a (UINT64)

 

 

Public:

Update_A_Set_On

Set the bits identified by the mask to "1".

 

Update_A_Set_Off

Set the bits identified by by the mask to "0".

 

Update_A_Get_Bit

Return an "or" value of the bits identified by the mask for all affected classes.

 

Private:

m_flag_update_b (UINT64)

 

 

Public:

Update_B_Set_On

Set the bits identified by the mask to "1".

 

Update_B_Set_Off

Set the bits identified by the mask to "0".

 

Update_B_Get_Bit

Return an "or" value of the bits identified by the mask for all affected classes.

 

Private:

m_flag_redraw (UINT64)

 

 

Public:

Redraw_Set_On

Set the bits identified by the mask to "1".

 

Redraw_Set_Off

Set the bits identified by the mask to "0".

 

Redraw_Get_Bit

Return an "or" value of the bits identified by the mask for all affected classes.

 

Private:

m_flag_status (UINT64)

 

 

Public:

Flag_Set_On

Set the bits identified by the mask to "1".

 

Flag_Set_Off

Set the bits identified by the mask to "0".

 

Flag_Toggle

Toggle the value of the bits identified by the mask.

 

Flag_Get_Bit

Return an "or" value of the bits identified by the mask for all affected classes.

 

Public:

Visibility_Set

 

Set the visibility flag for an element an its descendants

 

 

Data buffers

 

We can have a number of user structures associated with each class instance.  Each of these user structure is assigned an ID number. The structures are recognized by their ID so you must assign an ID that is unique. 

 

The structure used for these buffers is also explained in the SliceO_Buffer section.

          

Private:

 

m_user_nb (int)

A variable containing the number of user structures.

 

m_user_id (unsigned int *)

An array of user structures ID.

 

m_user_pt (SliceO_Buffer **)

An array of pointers to the user structures.

 

Public:

 

User_Get

Get a pointer to a specific user structure.

 

User_Set

Assign a user structure to the class instance.

 

User_Delete

Delete a specific user structure.

 

User_Stool

For debugging: report the information on a user structure.

 

User_Memory

Return the amount of memory used by the user structures.

 

User_Cleanup

Delete all user structure below a priority threshold.

 

 

 

Interface

 

Some classes may have gadgets in "Display ALL" mode that can interact with the mouse. Mouse positions are expressed in "Infinite" space.

 

Public:

Interface_Click

A mouse button has been activated

 

Interface_Motion

The mouse has been moved

 

Interface_Scroll

The mouse wheel has been activated

 

Interface_Key

A keyboard key has been activated

 

Interface_Select

 

 

 

 

Inside Tests

 

This section deal with the space occupied by the class (and its descendants) when displayed in each of the 2D windows. all screen positions are expressed in "infinite" space.

 

Private:

m_inside (Region_2D *)

A variable containing the bounding box of this instance.

 

Public:

Inside_Pt

Return 1 if a point is inside the region.

 

Inside_Range

Return 1 if there is an intersection between the region and the one provide in argument

 

Inside_Get

Return a the region covered by the instance of the class and its descendant.

 

Inside_Clear

 

Reset the region.

Inside_Set

Set the value of the region from a region or 4 arguments

 

Inside_Add

Add a region to the existing region.

 

 

 

Callbacks

 

SliceOmatic provide you with a number of callback hooks in the class "SliceO_Class". If you want, you can use these to have your own function called instead of the default callback functions.

 

The callbacks are explained in more details in "The Callback Fct" section.

 

Public:

Fct_Pixel_Get_GLI

 

These function return the pixel values of a pixel identified by its 3D position.

 

Fct_Pixel_Get_TAG

 

Fct_Pixel_Set_TAG

 

This function change the TAG value of a pixel identified by its 3D position.

 

Fct_Metrics_Get_Res

 

This function returns the resolution of an image.

 

Fct_Metrics_Get_Pos

 

This function returns the 3D position of a point on a 2D image.

 

Fct_Draw_Highlight

 

This function is used to draw a border around portion of the class representation in 2D windows in MODE_ALL.

 

Fct_Draw_Base[ ]

 

These functions are used to draw the default information of the class.  For frames, it draw the pixels of the frame, for classes higher in the tree it draw icons and connecting lines in 2D windows in MODE_ALL.

 

Fct_Draw_OpenGL[ ]

 

These functions are used to draw in the OpenGL step of the drawing process.

 

Fct_Draw_Stencil[ ]

 

These functions are used to draw in the Stencil step of the drawing process.

 

Fct_Draw_3D[ ]

 

These functions are used to draw elements of the 2D database in a 3D window.

 

 

 

Virtual Methods

 

These are virtual methods.  The SliceO_Class definition provide default methods fro all of these, but if you create your own class, you have the possibility to override these defaults.

 

Public:

Update_A

 

 

Update_B

 

 

Update_Child_A

 

 

Stool

 

 

Resize

 

 

Sort

 

 

Compare

 

 

Icon_Name

 

 

 

 

Matrix Transformation

 

Some classes are used to position the frames in space.  For this we use a 4x4 transformation matrix.

 

Public:

 

 

m_ident (unsigned char)

A flag that signal that the transformation matrix is the identity matrix.

 

m_old2new (Matrix)

Transformation matrix from the parent system to this instance

 

m_new2old (Matrix)

Transformation matrix from this instance to the parent system.

 

 

 

Mutual Exclusion

 

When working with multi-thread systems, care must be taken to prevent 2 threads from working on the same frame at the same time.  In sliceOmatic this is done by using the "Lock_Get" and "Lock_Set" methods.

 

private:

m_lock (int)

 

 

Public:

 

Lock_Set

 

Lock that prevent 2 thread from playing in the data at the same time.

 

Lock_Get

 

Return the value of the lock.  "1" is locked, "0" is unlocked.

 

private:

m_mutex (HANDLE)

 

Mutual exclusion handle

 

Public:

 

void          Mutex_Open( char *str )

 

Open the mutual exclusion (for TomoVision usage only)

 

void          Mutex_Close( char *str )

 

Close the mutual exclusion (for TomoVision usage only)

 

 

 

Others

 

Public:

 

unsigned short *m_fps

number of frames per seconds (1 to 30)

 

UINT_PTR *m_timer

ID of the timer for frame loops