NCBI C++ ToolKit
|
Search Toolkit Book for CGraphContainer
CGraphContainer CGraphContainer a composite IRenderable that manages several child IRenderable graphs. More...
#include <gui/widgets/gl/graph_container.hpp>
Public Types | |
enum | ELayoutPolicy { eHorzStack , eVertStack , eWhole } |
typedef IRenderable | TGraph |
typedef CIRef< IRenderable > | TGraphRef |
Public Types inherited from CObject | |
enum | EAllocFillMode { eAllocFillNone = 1 , eAllocFillZero , eAllocFillPattern } |
Control filling of newly allocated memory. More... | |
typedef CObjectCounterLocker | TLockerType |
Default locker type for CRef. More... | |
typedef atomic< Uint8 > | TCounter |
Counter type is CAtomiCounter. More... | |
typedef Uint8 | TCount |
Alias for value type of counter. More... | |
Public Types inherited from CEventHandler | |
enum | EDispatch { eDispatch_SelfOnly , eDispatch_AllHandlers , eDispatch_FirstHandler , eDispatch_Default = eDispatch_AllHandlers } |
enum controlling dispatching strategies More... | |
enum | EPoolName { ePool_Default = 0 , ePool_Parent , ePool_Child , ePool_Sibling , ePool_NextAvailable } |
Identifiers for standard pools. More... | |
typedef vector< CEventHandler * > | TListeners |
typedef map< int, TListeners > | TPools |
typedef list< AutoPtr< SPostRequest > > | TPostRequests |
typedef std::map< CEventHandler *, int > | THandlerToCount |
typedef void(* | FOnPostCallback) () |
Public Member Functions | |
CGraphContainer (ELayoutPolicy policy) | |
CGraphContainer. More... | |
virtual | ~CGraphContainer () |
virtual bool | AddGraph (TGraph *graph, bool front=false) |
virtual bool | RemoveGraph (TGraph *graph) |
assumes ownership More... | |
virtual void | RemoveAllGraphs () |
virtual size_t | GetGraphsCount () const |
virtual TGraph * | GetGraph (size_t index) |
virtual const TGraph * | GetGraph (size_t index) const |
virtual void | Clear () |
virtual void | Layout () |
void | SetHost (IGraphContainerHost *host) |
void | OnMouseEvents (wxMouseEvent &event) |
void | SetGraphMaxSize (const TVPPoint &size) |
IRenderable implementation | |
virtual void | Render (CGlPane &pane) |
virtual void | SetVPRect (const TVPRect &rect) |
virtual void | SetModelRect (const TModelRect &rc) |
virtual TVPPoint | PreferredSize () |
virtual bool | NeedTooltip (CGlPane &pane, int vp_x, int vp_y) |
virtual string | GetTooltip () |
IGlEventHandler implementation | |
virtual wxEvtHandler * | GetEvtHandler () |
virtual void | SetPane (CGlPane *pane) |
Public Member Functions inherited from CObjectEx | |
CObjectEx (void) | |
virtual | ~CObjectEx (void) |
Public Member Functions inherited from CObject | |
CObject (void) | |
Constructor. More... | |
CObject (const CObject &src) | |
Copy constructor. More... | |
virtual | ~CObject (void) |
Destructor. More... | |
CObject & | operator= (const CObject &src) THROWS_NONE |
Assignment operator. More... | |
bool | CanBeDeleted (void) const THROWS_NONE |
Check if object can be deleted. More... | |
bool | IsAllocatedInPool (void) const THROWS_NONE |
Check if object is allocated in memory pool (not system heap) More... | |
bool | Referenced (void) const THROWS_NONE |
Check if object is referenced. More... | |
bool | ReferencedOnlyOnce (void) const THROWS_NONE |
Check if object is referenced only once. More... | |
void | AddReference (void) const |
Add reference to object. More... | |
void | RemoveReference (void) const |
Remove reference to object. More... | |
void | ReleaseReference (void) const |
Remove reference without deleting object. More... | |
virtual void | DoNotDeleteThisObject (void) |
Mark this object as not allocated in heap – do not delete this object. More... | |
virtual void | DoDeleteThisObject (void) |
Mark this object as allocated in heap – object can be deleted. More... | |
void * | operator new (size_t size) |
Define new operator for memory allocation. More... | |
void * | operator new[] (size_t size) |
Define new[] operator for 'array' memory allocation. More... | |
void | operator delete (void *ptr) |
Define delete operator for memory deallocation. More... | |
void | operator delete[] (void *ptr) |
Define delete[] operator for memory deallocation. More... | |
void * | operator new (size_t size, void *place) |
Define new operator. More... | |
void | operator delete (void *ptr, void *place) |
Define delete operator. More... | |
void * | operator new (size_t size, CObjectMemoryPool *place) |
Define new operator using memory pool. More... | |
void | operator delete (void *ptr, CObjectMemoryPool *place) |
Define delete operator. More... | |
virtual void | DebugDump (CDebugDumpContext ddc, unsigned int depth) const |
Define method for dumping debug information. More... | |
Public Member Functions inherited from CDebugDumpable | |
CDebugDumpable (void) | |
virtual | ~CDebugDumpable (void) |
void | DebugDumpText (ostream &out, const string &bundle, unsigned int depth) const |
void | DebugDumpFormat (CDebugDumpFormatter &ddf, const string &bundle, unsigned int depth) const |
void | DumpToConsole (void) const |
Public Member Functions inherited from CWeakObject | |
CWeakObject (void) | |
virtual | ~CWeakObject (void) |
CPtrToObjectProxy * | GetPtrProxy (void) const |
Get pointer to proxy object containing pointer to this object. More... | |
Public Member Functions inherited from IGlEventHandler | |
virtual | ~IGlEventHandler () |
Public Member Functions inherited from CRenderableImpl | |
CRenderableImpl () | |
CRenderableImpl. More... | |
virtual | ~CRenderableImpl () |
virtual TVPRect | GetVPRect () const |
virtual TModelRect | GetModelRect () const |
virtual bool | IsVisible () |
virtual void | SetVisible (bool set) |
virtual void | SetOrder (int order) |
virtual int | GetOrder () const |
Public Member Functions inherited from IRenderable | |
virtual | ~IRenderable (void) |
Public Member Functions inherited from CEventHandler | |
CEventHandler () | |
CEventHandler. More... | |
virtual | ~CEventHandler () |
virtual void | AddListener (CEventHandler *listener, int pool_name=ePool_Default) |
Add a listener. More... | |
virtual void | RemoveListener (CEventHandler *listener) |
Remove a listener. More... | |
virtual void | RemoveAllListeners (void) |
virtual bool | HasListener (CEventHandler *listener, int pool_name=ePool_Default) const |
returns "true" if the given listener belongs to the specified pool More... | |
virtual const TListeners * | GetListeners (int pool_name=ePool_Default) const |
returns a set of listeners fro the specified pool More... | |
virtual bool | OnEvent (CEvent *evt) |
Processes en event. Returns "true" if event has been processed. More... | |
virtual bool | Dispatch (CEvent *evt, EDispatch disp_how=eDispatch_Default, int pool_name=ePool_Default) |
Dispatches an event to the listeners (but does not handle it). More... | |
virtual bool | Send (CEvent *evt, EDispatch disp_how=eDispatch_Default, int pool_name=ePool_Default) |
Sends an event synchronously. More... | |
virtual bool | Send (CEvent *evt, int pool_name) |
void | Post (CRef< CEvent > evt, EDispatch disp_how=eDispatch_Default, int pool_name=ePool_Default) |
Handles an event asynchronously (process and/or dispatch). More... | |
Protected Types | |
typedef vector< TGraphRef > | TGraphs |
Protected Attributes | |
wxEvtHandler * | m_Handler |
IGraphContainerHost * | m_Host |
ELayoutPolicy | m_LayoutPolicy |
TGraphs | m_Graphs |
TGraph * | m_TooltipGraph |
CGlPane * | m_Pane |
TVPPoint | m_GraphMaxSize |
Protected Attributes inherited from CRenderableImpl | |
TVPRect | m_VPRect |
TModelRect | m_ModelRect |
bool | m_Visible |
int | m_Order = 0 |
Protected Attributes inherited from CEventHandler | |
TPools | m_Pools |
Additional Inherited Members | |
Static Public Member Functions inherited from CObject | |
static NCBI_XNCBI_EXPORT void | ThrowNullPointerException (void) |
Define method to throw null pointer exception. More... | |
static NCBI_XNCBI_EXPORT void | ThrowNullPointerException (const type_info &type) |
static EAllocFillMode | GetAllocFillMode (void) |
static void | SetAllocFillMode (EAllocFillMode mode) |
static void | SetAllocFillMode (const string &value) |
Set mode from configuration parameter value. More... | |
Static Public Member Functions inherited from CDebugDumpable | |
static void | EnableDebugDump (bool on) |
Static Public Member Functions inherited from CEventHandler | |
static bool | HandlePostRequest () |
static void | ClearPostQueue () |
erases all events from the queue More... | |
static void | DestroyPostQueue () |
Static Public Attributes inherited from CObject | |
static const TCount | eCounterBitsCanBeDeleted = 1 << 0 |
Define possible object states. More... | |
static const TCount | eCounterBitsInPlainHeap = 1 << 1 |
Heap signature was found. More... | |
static const TCount | eCounterBitsPlaceMask |
Mask for 'in heap' state flags. More... | |
static const int | eCounterStep = 1 << 2 |
Skip over the "in heap" bits. More... | |
static const TCount | eCounterValid = TCount(1) << (sizeof(TCount) * 8 - 2) |
Minimal value for valid objects (reference counter is zero) Must be a single bit value. More... | |
static const TCount | eCounterStateMask |
Valid object, and object in heap. More... | |
Protected Member Functions inherited from CObject | |
virtual void | DeleteThis (void) |
Virtual method "deleting" this object. More... | |
Protected Member Functions inherited from CWeakObject | |
void | CleanWeakRefs (void) const |
Method cleaning all CWeakRefs referencing at this moment to the object After calling to this method all existing CWeakRefs referencing to the object will return NULL, so it effectively will be equal to deleting the object. More... | |
Protected Member Functions inherited from CEventHandler | |
virtual const SEvtMap * | GetEventMap () const |
void | x_DeclareDead () |
Removes itself unavailable for async event delivery. More... | |
void | x_AddListenerToPool (CEventHandler *listener, int pool_name) |
Static Protected Attributes inherited from CEventHandler | |
static const SEvtMap | sm_EvtMap |
CGraphContainer CGraphContainer a composite IRenderable that manages several child IRenderable graphs.
All graphs are rendered using transformation defined by CGraphContainer model space and viewport.
Definition at line 62 of file graph_container.hpp.
typedef IRenderable CGraphContainer::TGraph |
Definition at line 69 of file graph_container.hpp.
typedef CIRef<IRenderable> CGraphContainer::TGraphRef |
Definition at line 70 of file graph_container.hpp.
|
protected |
Definition at line 120 of file graph_container.hpp.
Enumerator | |
---|---|
eHorzStack | |
eVertStack | |
eWhole |
Definition at line 72 of file graph_container.hpp.
CGraphContainer::CGraphContainer | ( | ELayoutPolicy | policy | ) |
Definition at line 63 of file graph_container.cpp.
|
virtual |
Definition at line 73 of file graph_container.cpp.
References m_Handler.
Definition at line 79 of file graph_container.cpp.
References _ASSERT, a, CEventHandler::AddListener(), b, CEventHandler::ePool_Child, CEventHandler::ePool_Parent, ctll::front(), and m_Graphs.
Referenced by CFeatureGraph::OnAJNotification(), CFeatureGraph::x_Create(), and CHitMatrixRenderer::x_SetGraphs().
|
virtual |
Definition at line 143 of file graph_container.cpp.
References m_Graphs.
|
inlinevirtual |
Implements IGlEventHandler.
Definition at line 161 of file graph_container.hpp.
References m_Handler.
|
virtual |
Definition at line 129 of file graph_container.cpp.
References _ASSERT, and m_Graphs.
Referenced by CHitMatrixRenderer::GetGraphs(), CHitMatrixRenderer::x_DestroyGraphs(), and CHitMatrixRenderer::x_SetGraphs().
|
virtual |
Definition at line 136 of file graph_container.cpp.
|
virtual |
Definition at line 124 of file graph_container.cpp.
References m_Graphs.
Referenced by CHitMatrixRenderer::GetGraphs(), CFeatureGraph::OnAJNotification(), CHitMatrixRenderer::x_DestroyGraphs(), and CHitMatrixRenderer::x_SetGraphs().
|
virtual |
Reimplemented from CRenderableImpl.
Definition at line 292 of file graph_container.cpp.
References _ASSERT, IRenderable::GetTooltip(), and m_TooltipGraph.
Referenced by CHitMatrixRenderer::GetTooltip().
|
virtual |
Reimplemented in CFeatureGraph, and CAlignRowGraphCont.
Definition at line 191 of file graph_container.cpp.
References CGlRect< T >::Bottom(), eHorzStack, eVertStack, i, CGlRect< T >::Left(), m_GraphMaxSize, m_Graphs, m_LayoutPolicy, CRenderableImpl::m_ModelRect, CRenderableImpl::m_VPRect, NON_CONST_ITERATE, CGlRect< T >::Offset(), IRenderable::PreferredSize(), CGlRect< T >::Right(), IRenderable::SetModelRect(), CGlRect< T >::SetRight(), CGlRect< T >::SetTop(), IRenderable::SetVPRect(), ncbi::grid::netcache::search::fields::size, CGlPoint< T >::X(), and CGlPoint< T >::Y().
Referenced by CAlignRowGraphCont::Layout(), CFeatureGraph::Layout(), SetModelRect(), SetVPRect(), and CHitMatrixRenderer::x_SetGraphs().
Reimplemented from CRenderableImpl.
Definition at line 279 of file graph_container.cpp.
References IRenderable::GetVPRect(), m_Graphs, m_TooltipGraph, IRenderable::NeedTooltip(), NON_CONST_ITERATE, and CGlRect< T >::PtInRect().
Referenced by CHitMatrixRenderer::NeedTooltip().
void CGraphContainer::OnMouseEvents | ( | wxMouseEvent & | event | ) |
Definition at line 299 of file graph_container.cpp.
References IGraphContainerHost::GCH_GetVPPosByWindowPos(), IRenderable::GetVPRect(), m_Graphs, m_Host, NON_CONST_ITERATE, CGlRect< T >::PtInRect(), CGlPoint< T >::X(), and CGlPoint< T >::Y().
Referenced by CGraphContainerEvtHandler::OnMouseEvents().
|
virtual |
Reimplemented from CRenderableImpl.
Reimplemented in CFeatureGraph.
Definition at line 242 of file graph_container.cpp.
References eHorzStack, eVertStack, eWhole, i, m_GraphMaxSize, m_Graphs, m_LayoutPolicy, max(), IRenderable::PreferredSize(), ncbi::grid::netcache::search::fields::size, CGlPoint< T >::X(), and CGlPoint< T >::Y().
Referenced by CHitMatrixRenderer::Layout(), and ON_EVENT().
|
virtual |
Definition at line 118 of file graph_container.cpp.
References m_Graphs.
Referenced by CFeatureGraph::Destroy(), CFeatureGraph::OnAJNotification(), CHitMatrixRenderer::x_DestroyGraphs(), and CHitMatrixRenderer::x_SetGraphs().
assumes ownership
Definition at line 102 of file graph_container.cpp.
References m_Graphs, and CEventHandler::RemoveListener().
|
virtual |
Implements IRenderable.
Definition at line 149 of file graph_container.cpp.
References CGlPane::GetClipRect(), CGlPane::GetViewport(), IRenderable::GetVPRect(), CGlRect< T >::IntersectWith(), IRenderable::IsVisible(), m_Graphs, NON_CONST_ITERATE, IRenderable::Render(), and CGlPane::SetClipRect().
Referenced by CFeatureGraph::Render(), and CHitMatrixRenderer::x_RenderContainers().
Definition at line 173 of file graph_container.hpp.
References m_GraphMaxSize, and ncbi::grid::netcache::search::fields::size.
|
inline |
Definition at line 154 of file graph_container.hpp.
References m_Host.
|
virtual |
Reimplemented from CRenderableImpl.
Definition at line 184 of file graph_container.cpp.
References Layout(), and CRenderableImpl::m_ModelRect.
Referenced by CHitMatrixRenderer::x_RenderContainers().
|
inlinevirtual |
Reimplemented from IGlEventHandler.
Definition at line 167 of file graph_container.hpp.
References m_Pane.
Reimplemented from CRenderableImpl.
Definition at line 177 of file graph_container.cpp.
References Layout(), and CRenderableImpl::m_VPRect.
Referenced by CHitMatrixRenderer::Layout().
|
protected |
Definition at line 130 of file graph_container.hpp.
Referenced by Layout(), PreferredSize(), and SetGraphMaxSize().
|
protected |
Definition at line 126 of file graph_container.hpp.
Referenced by AddGraph(), Clear(), CAlignRowGraphCont::Create(), CAlignRowGraphCont::Destroy(), GetGraph(), GetGraphsCount(), CAlignRowGraphCont::Layout(), CFeatureGraph::Layout(), Layout(), NeedTooltip(), OnMouseEvents(), PreferredSize(), RemoveAllGraphs(), RemoveGraph(), Render(), CAlignRowGraphCont::Render(), and CAlignRowGraphCont::Update().
|
protected |
Definition at line 122 of file graph_container.hpp.
Referenced by GetEvtHandler(), and ~CGraphContainer().
|
protected |
Definition at line 123 of file graph_container.hpp.
Referenced by OnMouseEvents(), and SetHost().
|
protected |
Definition at line 124 of file graph_container.hpp.
Referenced by CAlignRowGraphCont::Layout(), CFeatureGraph::Layout(), Layout(), and PreferredSize().
|
protected |
Definition at line 128 of file graph_container.hpp.
Referenced by SetPane().
|
protected |
Definition at line 127 of file graph_container.hpp.
Referenced by GetTooltip(), and NeedTooltip().