FilterRenderCallback Class Reference

Handling callbacks from RenderTree Notes: RenderTree function calls the main function in this class when it's about to render any Node. More...

#include <filters.h>

Inheritance diagram for FilterRenderCallback:

RenderCallback CCObject SimpleCCObject List of all members.

Public Member Functions

 FilterRenderCallback (Filter *pFilter, BOOL bCount, BOOL bVisibleLayersOnly, BOOL bSelectedOnly)
virtual BOOL BeforeNode (RenderRegion *pRegion, Node *pNode)
 Handle the callback from RenderTree that has been requested by Filter.
virtual BOOL BeforeSubtree (RenderRegion *pRegion, Node *pNode, Node **ppNextNode, BOOL bClip, SubtreeRenderState *pState)
 Handle the callback from RenderTree that has been requested by Filter.

Private Attributes

Filterm_pFilter
BOOL m_bCount
BOOL m_bVisibleLayersOnly
BOOL m_bSelectedOnly

Detailed Description

Handling callbacks from RenderTree Notes: RenderTree function calls the main function in this class when it's about to render any Node.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/11/2004

Definition at line 867 of file filters.h.


Constructor & Destructor Documentation

FilterRenderCallback::FilterRenderCallback Filter pFilter,
BOOL  bCount,
BOOL  bVisibleLayersOnly,
BOOL  bSelectedOnly
[inline]
 

Definition at line 870 of file filters.h.

00871     {
00872         m_pFilter = pFilter;
00873         m_bCount = bCount;
00874         m_bVisibleLayersOnly = bVisibleLayersOnly;
00875         m_bSelectedOnly = bSelectedOnly;
00876     }


Member Function Documentation

BOOL FilterRenderCallback::BeforeNode RenderRegion pRegion,
Node pNode
[virtual]
 

Handle the callback from RenderTree that has been requested by Filter.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/11/2004
Parameters:
pNode - pointer to node about to be rendered by RenderTree [INPUTS] pRender - pointer to RenderRegion running RenderTree loop
- [OUTPUTS]
Returns:
TRUE if node can be rendered FALSE if not

Reimplemented from RenderCallback.

Definition at line 2069 of file filters.cpp.

02070 {
02071 // Don't need to do this because BeforeSubtree should have doen it for every node
02072 // that gets passed to BeforeNode...
02073 //  if (!pNode->NeedsToExport(pRegion, m_bVisibleLayersOnly, m_bSelectedOnly))
02074 //      return FALSE;
02075 
02076     if (m_bCount)
02077     {
02078         if (pNode->IsNodeRenderableClass())
02079             Filter::NumNodes += ((NodeRenderable*)pNode)->GetSizeOfExport(m_pFilter);
02080 
02081         return FALSE;   // Don't render anything!
02082     }
02083 
02084     // --------------------------------------------------------------------------
02085     // If rendering an RGBT bitmap, don't render anything in background layers
02086     if (pRegion->m_DoCompression)
02087     {
02088         Layer* pLayer = (Layer*)pNode->FindParent(CC_RUNTIME_CLASS(Layer));
02089         if (pLayer && pLayer->IsBackground())
02090             return FALSE;
02091     }
02092 
02093     // Update the progress display
02094     if (pNode->IsNodeRenderableClass())
02095         m_pFilter->UpdateFilterProgress(((NodeRenderable*)pNode)->GetSizeOfExport(m_pFilter));
02096     else
02097         m_pFilter->UpdateFilterProgress(0);             // For back compatibility with previous version of this code
02098 
02099     // Render (export) the node that we have, using special export rendering if it exists.
02100     BOOL bExportRendered = pNode->ExportRender(pRegion);
02101 
02102     return (!bExportRendered);                      // If not exported let RenderTree do it, return TRUE
02103 }

BOOL FilterRenderCallback::BeforeSubtree RenderRegion pRegion,
Node pNode,
Node **  ppNextNode,
BOOL  bClip,
SubtreeRenderState pState
[virtual]
 

Handle the callback from RenderTree that has been requested by Filter.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/11/2004
Parameters:
pNode - pointer to node about to be rendered by RenderTree [INPUTS] pRender - pointer to RenderRegion running RenderTree loop
pNextNode - pointer to node where navigation should continue [OUTPUTS] State - Navigation state for RenderTree state machine
Returns:
TRUE if we've returned a valid SubRenderState FALSE if not

Reimplemented from RenderCallback.

Definition at line 2126 of file filters.cpp.

02131 {
02132     if (pNode==NULL)
02133         return TRUE;
02134 
02135     if (m_bCount)
02136     {
02137         // We're only counting so we will control tree navigation to ensure clever
02138         // nodes don't skip around by themselves
02139         if (pNode->NeedsToExport(pRegion, m_bVisibleLayersOnly, m_bSelectedOnly))
02140             *pState = SUBTREE_ROOTANDCHILDREN;
02141         else
02142             *pState = SUBTREE_NORENDER;
02143 
02144         return TRUE;
02145     }
02146 
02147     // --------------------------------------------------------------------------
02148     // We're not counting so let normal, smart navigation take place
02149     if (pNode->NeedsToExport(pRegion, m_bVisibleLayersOnly, m_bSelectedOnly))
02150     {
02151         // This node does need to be exported
02152         // Tell the node at the root of the subtree that we're about to export it and it's children
02153         pNode->PreExportRender(pRegion);
02154         return FALSE;                       // Tell RenderTree we want normal navigation to take place
02155     }
02156     else
02157     {
02158         *pState = SUBTREE_NORENDER;         // Tell RenderTree we want to forcibly skip this node
02159         return TRUE;
02160     }
02161 }


Member Data Documentation

BOOL FilterRenderCallback::m_bCount [private]
 

Definition at line 887 of file filters.h.

BOOL FilterRenderCallback::m_bSelectedOnly [private]
 

Definition at line 889 of file filters.h.

BOOL FilterRenderCallback::m_bVisibleLayersOnly [private]
 

Definition at line 888 of file filters.h.

Filter* FilterRenderCallback::m_pFilter [private]
 

Definition at line 886 of file filters.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:54:19 2007 for Camelot by  doxygen 1.4.4