MipResources::DraWin Class Reference
[Draw window]

"Abstract" resource DraWin More...

#include <DraWin.h>

Inheritance diagram for MipResources::DraWin:

MipResources::Resource MIPObject MipResources::DraWinGL MipResources::DraWinGL MipResources::DraWinQt2D

List of all members.

Public Member Functions

 DraWin ()
 Default constructor. The list 0 is created by default.
 ~DraWin ()
 Destructor.
virtual ResourcePlate getPlate () const =0
 Gets the plate.
bool addList (Time timeout, unsigned int &listNum)
 Add a drawing list.
bool swapList (Time timeout, unsigned int listNum)
 Draw the last pushed objects, delete previous objects.
bool pushObj (DraWinObj *draWinObj, Time timeout, unsigned int listNum=0)
 Push an object in the list. Push a pointer to a drawing object in a drawing list, the object must be allocated before the object will be visible only when swapList will be called.
bool overlapObj (DraWinObj *draWinObj, Time timeout, unsigned int listNum=0)
 Overlap an object in the list. Add a pointer to a drawing object in a drawing list, the object must be allocated before the object will be suddenly visible. If the number of objects in the list excedes DRA_WIN_RES_LIST_SIZE older objects are removed (wake effect).
bool clearList (Time timeout, unsigned int listNum)
 Identic to swapList. Draw the last pushed objects, delete previous objects.
bool accuList (Time timeout, unsigned int listNum)
 Identic to swapList. Draw the last pushed objects, delete previous objects.

Public Attributes

DraWinVar _draWinVar
 DraWin parameters.

Protected Member Functions

int _listsTrylock ()
int _listsUnlock ()

Protected Attributes

vector< DraWinList * > _draWinLists
 lists of _drawWinList pointers (mobile pointers used to toggle between A and B)
vector< DraWinList * > _draWinListsA
 lists of the first bank of _drawWinLists pointers
vector< DraWinList * > _draWinListsB
 lists of the second bank of _drawWinLists pointers
vector< unsigned int > _indexA
vector< unsigned int > _indexB


Detailed Description

"Abstract" resource DraWin

Todo:
Make _draWinVar protected.
Examples:

exampleDraWin.cpp.


Constructor & Destructor Documentation

MipResources::DraWin::DraWin (  )  [inline]

Default constructor. The list 0 is created by default.

MipResources::DraWin::~DraWin (  )  [inline]

Destructor.


Member Function Documentation

int MipResources::DraWin::_listsTrylock (  )  [inline, protected]

Try to lock the mutex of _drawWinLists (non blocking)

Returns:
zero if successful. Otherwise, an error number is returned to indicate the error (see man pthread_mutex_trylock)).

int MipResources::DraWin::_listsUnlock (  )  [inline, protected]

Unlock the mutex of _drawWinLists

Returns:
zero if successful; otherwise an error number shall be returned to indicate the error (see man pthread_mutex_unlock).

virtual ResourcePlate MipResources::DraWin::getPlate (  )  const [pure virtual]

Gets the plate.

Returns:
Plate.

Implements MipResources::Resource.

Implemented in MipResources::DraWinGL, MipResources::DraWinQt2D, and MipResources::DraWinGL.

bool MipResources::DraWin::addList ( Time  timeout,
unsigned int &  listNum 
)

Add a drawing list.

Note:
Mutexed access is necessary because all the list of lists could be reallocated in the push_back.
Returns:
True if the drawing list was correctly added, false otherwise.
Parameters:
[in] timeout Timeout for adding retries.
[out] listNum Number of the list, use it to push and to swap.
Examples:
exampleDraWin.cpp.

bool MipResources::DraWin::swapList ( Time  timeout,
unsigned int  listNum 
)

Draw the last pushed objects, delete previous objects.

Returns:
True if the drawing list was correctly swapped, false otherwise.
Parameters:
[in] timeout Timeout for swapping retries
[out] listNum Number of the list to swap.
Examples:
exampleDraWin.cpp.

bool MipResources::DraWin::pushObj ( DraWinObj draWinObj,
Time  timeout,
unsigned int  listNum = 0 
)

Push an object in the list. Push a pointer to a drawing object in a drawing list, the object must be allocated before the object will be visible only when swapList will be called.

Returns:
True if the drawing object was correctly added, false otherwise or if the list is not present.
Parameters:
[in] draWinObj Valid pointer to a drawing object to be pushed.
[in] timeout Timeout for pushing retries.
[in] listNum Number of the list to use (inf not specified the default 0 is used).
Examples:
exampleDraWin.cpp.

bool MipResources::DraWin::overlapObj ( DraWinObj draWinObj,
Time  timeout,
unsigned int  listNum = 0 
)

Overlap an object in the list. Add a pointer to a drawing object in a drawing list, the object must be allocated before the object will be suddenly visible. If the number of objects in the list excedes DRA_WIN_RES_LIST_SIZE older objects are removed (wake effect).

Returns:
true if the drawing object was correctly added, false otherwise or if the list is not present
Parameters:
[in] draWinObj Valid pointer to a drawing object to be overlapped.
[in] timeout Timeout for pushing retries.
[in] listNum Number of the list to use (inf not specified the default 0 is used).
Examples:
exampleDraWin.cpp.

bool MipResources::DraWin::clearList ( Time  timeout,
unsigned int  listNum 
) [inline]

Identic to swapList. Draw the last pushed objects, delete previous objects.

Returns:
True if the drawing list was correctly swapped, false otherwise.
Parameters:
[in] timeout Timeout for swapping retries
[out] listNum Number of the list to swap.

bool MipResources::DraWin::accuList ( Time  timeout,
unsigned int  listNum 
) [inline]

Identic to swapList. Draw the last pushed objects, delete previous objects.

Returns:
True if the drawing list was correctly swapped, false otherwise.
Parameters:
[in] timeout Timeout for swapping retries
[out] listNum Number of the list to swap.


Member Data Documentation

lists of _drawWinList pointers (mobile pointers used to toggle between A and B)

lists of the first bank of _drawWinLists pointers

lists of the second bank of _drawWinLists pointers

vector<unsigned int> MipResources::DraWin::_indexA [protected]

vector<unsigned int> MipResources::DraWin::_indexB [protected]

DraWin parameters.


The documentation for this class was generated from the following files:

Generated on Mon Feb 20 07:01:12 2017 for MIP by  doxygen 1.5.6