#include <filters.h>
Inheritance diagram for FilterRenderCallback:
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 | |
Filter * | m_pFilter |
BOOL | m_bCount |
BOOL | m_bVisibleLayersOnly |
BOOL | m_bSelectedOnly |
Definition at line 867 of file filters.h.
|
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 }
|
|
Handle the callback from RenderTree that has been requested by Filter.
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 }
|
|
Handle the callback from RenderTree that has been requested by Filter.
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 }
|
|
|
|
|
|
|
|
|