#include <scanrr.h>
Inheritance diagram for ScanningRenderRegion:
Public Member Functions | |
void | ComplexShapeFoundWrapper () |
This function is a public wrapper for ComplexShapeFound(). You should only call this function if you know what you are doing! | |
Protected Member Functions | |
void | ComplexShapeFound () |
void | ComplexShapeFoundHelper () |
This function is called every time the rendering functions find that the node they are dealing with is complex. It updates all the info the scanning render region tracks about complex shapes, such as the first and last complex nodes and the bounding rectangle of all the complex shapes. | |
void | SimpleShapeFound () |
void | SimpleShapeFoundHelper () |
This function should be called whenever a simple node is encountered. This allows the list of runs of simple / complex nodes to be maintained. | |
Protected Attributes | |
Node * | pFirstComplex |
Node * | pLastComplex |
INT32 | NumComplexShapes |
DocRect | ComplexBounds |
DocRect | SpanBounds |
List | NodeRuns |
NodeListItemWithComplexity * | pCurrentListItem |
BOOL | IsFirstComplex |
BOOL | IsThisTheFirstNode |
BOOL | InComplexRun |
INT32 | RunLength |
BOOL | bIsComplex |
BOOL | bIsSimple |
ClipRegionAttribute * | pLastClipAttr |
Private Member Functions | |
CC_DECLARE_DYNAMIC (ScanningRenderRegion) | |
ScanningRenderRegion (BOOL Printing) | |
The Scanning Render Regions constructor. This sets all the member vars of the class to default values (usually 0 or NULL). | |
~ScanningRenderRegion () | |
Destructor - It will do something if it needs to but at present this function is empty. | |
virtual BOOL | StartRender () |
Called to start the rendering process. Allows the render region to get ready to start rendering. | |
virtual BOOL | StopRender () |
Called to stop rendering. Since Scanning render regions are not used to background render, this marks the end of all rendering. This function marks the render region as completed, so all the get functions that return info about the objects found in the region start to function. | |
virtual void | DrawPathToOutputDevice (Path *PathToRender, PathShape shapePath=PATHSHAPE_PATH) |
This function will examine the attributes etc to see if this represents a simple or compex shape and update the counters that this class keeps. There is no actual rendering, as this class does not actually render anything to a device. | |
virtual void | DrawRect (DocRect *RectToRender) |
This function will examine the attributes etc to see if this represents a simple or compex shape and update the counters that this class keeps. There is no actual rendering, as this class does not actually render anything to a device. | |
virtual void | DrawLine (const DocCoord &StartPoint, const DocCoord &EndPoint) |
This function will examine the attributes etc to see if this represents a simple or compex shape and update the counters that this class keeps. There is no actual rendering, as this class does not actually render anything to a device. | |
virtual void | DrawPixel (const DocCoord &Point) |
This function will examine the attributes etc to see if this represents a simple or compex shape and update the counters that this class keeps. There is no actual rendering, as this class does not actually render anything to a device. | |
virtual void | DrawBitmap (const DocCoord &Point, KernelBitmap *pBitmap) |
This function will examine the attributes etc to see if this represents a simple or compex shape and update the counters that this class keeps. There is no actual rendering, as this class does not actually render anything to a device. | |
virtual void | DrawBitmap (const DocCoord &Point, UINT32 BitmapID, UINT32 ToolID=NULL) |
This function will examine the attributes etc to see if this represents a simple or compex shape and update the counters that this class keeps. There is no actual rendering, as this class does not actually render anything to a device. | |
virtual BOOL | DrawTransformedBitmap (NodeBitmap *pNodeBitmap) |
Works out if it can draw a Transformed bitmap. | |
virtual void | DrawDragRect (DocRect *RectToRender) |
None - I just had to overide this function as it is pure virtual. Does nothing. | |
virtual void | DrawBlob (DocCoord p, BlobType type) |
None - I just had to overide this function as it is pure virtual. Does nothing. | |
virtual void | DrawCross (const DocCoord &Point, const UINT32 Size) |
None - I just had to overide this function as it is pure virtual. Does nothing. | |
virtual void | DrawBitmapBlob (const DocCoord &Point, KernelBitmap *BlobShape) |
None - I just had to overide this function as it is pure virtual. Does nothing. | |
virtual void | DrawBitmapBlob (const DocCoord &Point, ResourceID resID) |
None - I just had to overide this function as it is pure virtual. Does nothing. | |
virtual void | InitClipping () |
Sets up the clipping - does nothing in this class. | |
virtual void | InitAttributes () |
Sets up the attributes. Does nothing in this class. | |
virtual void | SetLineAttributes () |
Does nothing in this class. | |
virtual void | SetOSDrawingMode () |
Does nothing in this class. | |
virtual void | SetQualityLevel () |
Does nothing in this class. | |
virtual MILLIPOINT | CalcPixelWidth () |
Does nothing in this class. | |
virtual MILLIPOINT | CalcScaledPixelWidth () |
Does nothing in this class. | |
virtual double | GetPixelsPerInch () |
virtual BOOL | CheckOffscreenBounds () |
virtual void | GetRenderRegionCaps (RRCaps *pCaps) |
This function allows render regions to admit to what they can and can not render. This allows other areas of the program to come in and help render regions out in some situations, if they are unable to render everything. eg. an OSRenderRegion can not render transparancy. | |
void | SetHostRRCaps (const RRCaps &pCaps) |
This function makes a note of what things the render region we are scanning on behalf of can render and what it can not. We use the info take a copy if pCaps and use it to make the decisions as to what is a complex object and what is not. | |
Node * | GetFirstComplexObject () |
This function will return a pointer to the first complex (ie one that can not be rendered without GDraw - such as a transparant shape) node that the render region would need to render. This function will return NULL if there were no complex shapes found. If the Scanning render region has not yet finished rendering, then this function will always return NULL. | |
Node * | GetLastComplexObject () |
This function will return a pointer to the last complex (ie one that can not be rendered without GDraw - such as a transparant shape) node that the render region would need to render. This function will return NULL if there were no complex shapes found. If the Scanning render region has not yet finished rendering, then this function will always return NULL. | |
INT32 | GetNumComplex () |
This function returns the number of complex shapes that have been found in the scanning render region. It only counts the complex shapes in the region. It will return 0 if there were no complex shapes in the region. If the Scanning render region has not yet finished rendering, then this function will always return 0. | |
DocRect | GetComplexBounds () |
Used to find out the bounding rect of all the complex shapes in the completed render region. If it is called before the region has finished rendering, then it will return the empty rectangle. If there are no complex shapes in the region then it will also return the empty rectangle. | |
BOOL | IsFinished () |
Lets you find out if the render region has finished rendering yet. If it has not finished then all the information that this class has to offer about the number of complex shapes etc is not valid. All the info functions will return 0 or NULL until the rendering is finished to stop you looking at incomplete data. | |
BOOL | IsFirstNodeComplex () |
Node * | FindFirstFromList () |
The nodes in the list represent the first node in a run of simple / complex nodes. You can determine if the first node to be rendered is simple or complex by calling IsFirstNodeComplex(). eg. If IsFirstNodeComplex() returned FALSE, then all the nodes up to the node returned by FindFirstFromList() will be simple. All the nodes from this one to the node returned by FindNextFromList will be complex. This toggle carries on all the way through the tree until there are no more nodes. If this function returns NULL, you can assume that there are no runs of nodes in the tree and all the nodes are of the same start as the first one (ie the same as what IsFirstNodeComplex() says). | |
Node * | FindNextFromList () |
Finds the first node in the next run of nodes. | |
BOOL | IsThisNodeComplex () |
DocRect | GetSpanBounds () |
Used to find out the bounding rect of all the shapes in the span. This rectanlge is only calculated for complex spans. If it is called before the region has finished rendering, then it will return the empty rectangle. If there are no complex shapes in the region then it will also return the empty rectangle. | |
void | SetRenderState (Node *RenderState) |
Sets the next Node to be rendered. | |
Private Attributes | |
BOOL | IsFinishedRendering |
RRCaps | HostCaps |
Definition at line 148 of file scanrr.h.
|
The Scanning Render Regions constructor. This sets all the member vars of the class to default values (usually 0 or NULL).
Definition at line 134 of file scanrr.cpp. 00135 { 00136 // The complex nodes if there are any. Default to none 00137 pFirstComplex = NULL; 00138 pLastComplex = NULL; 00139 00140 // Counts of objects, default to none 00141 NumComplexShapes = 0; 00142 00143 // The bounds of the complex objects 00144 ComplexBounds.MakeEmpty(); 00145 00146 // Flag to say if we have finished rendering or not 00147 IsFinishedRendering = FALSE; 00148 00149 // Assume the host render region can do nothing till we get told otherwise 00150 HostCaps.CanDoNothing(); 00151 00152 // Start by assuming that the first node is simple for now 00153 IsFirstComplex = FALSE; 00154 InComplexRun = FALSE; 00155 RunLength = 0; 00156 00157 // The list info 00158 NodeRuns.DeleteAll(); 00159 pCurrentListItem = NULL; 00160 IsThisTheFirstNode = FALSE; 00161 00162 bIsComplex = FALSE; 00163 bIsSimple = FALSE; 00164 pLastClipAttr = NULL; 00165 00166 // Render flags 00167 RenderFlags.Printing = Printing; 00168 }
|
|
Destructor - It will do something if it needs to but at present this function is empty.
Definition at line 183 of file scanrr.cpp.
|
|
Does nothing in this class.
Implements RenderRegion. Definition at line 1160 of file scanrr.cpp.
|
|
Does nothing in this class.
Implements RenderRegion. Definition at line 1176 of file scanrr.cpp.
|
|
|
|
Reimplemented from RenderRegion. Definition at line 194 of file scanrr.h. 00194 { return(FALSE); }
|
|
Definition at line 227 of file scanrr.h. 00227 { bIsComplex = TRUE; };
|
|
This function is called every time the rendering functions find that the node they are dealing with is complex. It updates all the info the scanning render region tracks about complex shapes, such as the first and last complex nodes and the bounding rectangle of all the complex shapes.
Definition at line 756 of file scanrr.cpp. 00757 { 00758 // TRACE( _T("ComplexShapeFound\n")); 00759 00760 Node* pThisNode = GetRenderState(); 00761 if (pThisNode == NULL) 00762 { 00763 TRACE( _T("NULL RenderState in ComplexShapeFoundHelper\n")); 00764 } 00765 00766 // Update the count of complex shapes 00767 NumComplexShapes++; 00768 00769 // update the first complex shape pointers as needed 00770 if (pFirstComplex==NULL) 00771 pFirstComplex = pThisNode; 00772 00773 // This is the last complex shape we know about so far... 00774 pLastComplex = pThisNode; 00775 00776 // Now deal with the runs of Nodes system, in case they want to use that. 00777 if (IsThisTheFirstNode) 00778 { 00779 // This node represents the first renderable node in the region 00780 // so make sure that we note the fact that the first node is complex 00781 IsFirstComplex = TRUE; 00782 IsThisTheFirstNode = FALSE; 00783 InComplexRun = TRUE; 00784 00785 NodeListItemWithComplexity* pItem = new NodeListItemWithComplexity(pThisNode, FALSE); 00786 if (pItem!=NULL) 00787 NodeRuns.AddTail(pItem); 00788 } 00789 00790 // Karim 12/12/2000 00791 // Clipping changes - basically, all objects in a run of complex shapes 00792 // must share the same clip-attr. 00793 if (pThisNode) 00794 { 00795 // if we were in the middle of a Simple Nodes Run, then record this node 00796 // as the first node in the Complex run and mark that we are now in a complex run 00797 if (!InComplexRun) 00798 { 00799 // TRACEUSER( "Gerry", _T("Just finished a run of %ld simple shapes - Add Next Complex shape\n"), RunLength); 00800 NodeListItemWithComplexity* pLast = (NodeListItemWithComplexity*)NodeRuns.GetTail(); 00801 if (pLast) 00802 pLast->RunLength = RunLength; 00803 00804 SpanBounds.MakeEmpty(); 00805 00806 // Add this node to the list 00807 RunLength = 0; 00808 NodeListItemWithComplexity* pItem = new NodeListItemWithComplexity(pThisNode, FALSE); 00809 if (pItem!=NULL) 00810 NodeRuns.AddTail(pItem); 00811 } 00812 00813 // Update the bounds to date of complex shapes 00814 if (pThisNode->IsBounded()) 00815 { 00816 DocRect NodeBounds = ((NodeRenderableBounded*)pThisNode)->GetBoundingRect(); 00817 ComplexBounds = NodeBounds.Union(ComplexBounds); 00818 SpanBounds = NodeBounds.Union(SpanBounds); 00819 // TRACE( _T("BoundsRect = (%d, %d) - (%d, %d)\n"), SpanBounds.lox, SpanBounds.loy, SpanBounds.hix, SpanBounds.hiy); 00820 } 00821 } 00822 00823 // Make sure we know we are rendering complex shapes now 00824 InComplexRun = TRUE; 00825 RunLength++; 00826 }
|
|
This function is a public wrapper for ComplexShapeFound(). You should only call this function if you know what you are doing!
Definition at line 738 of file scanrr.cpp. 00739 { 00740 ComplexShapeFound(); 00741 }
|
|
This function will examine the attributes etc to see if this represents a simple or compex shape and update the counters that this class keeps. There is no actual rendering, as this class does not actually render anything to a device.
Implements RenderRegion. Definition at line 386 of file scanrr.cpp. 00387 { 00388 // see if this is a complex shape 00389 if (TestForComplexShape(&HostCaps)) 00390 ComplexShapeFound(); 00391 else 00392 SimpleShapeFound(); 00393 }
|
|
This function will examine the attributes etc to see if this represents a simple or compex shape and update the counters that this class keeps. There is no actual rendering, as this class does not actually render anything to a device.
Implements RenderRegion. Definition at line 359 of file scanrr.cpp. 00360 { 00361 // see if this is a complex shape 00362 if (TestForComplexShape(&HostCaps)) 00363 ComplexShapeFound(); 00364 else 00365 SimpleShapeFound(); 00366 }
|
|
None - I just had to overide this function as it is pure virtual. Does nothing.
Implements RenderRegion. Definition at line 528 of file scanrr.cpp.
|
|
None - I just had to overide this function as it is pure virtual. Does nothing.
Implements RenderRegion. Definition at line 510 of file scanrr.cpp.
|
|
None - I just had to overide this function as it is pure virtual. Does nothing.
Implements RenderRegion. Definition at line 475 of file scanrr.cpp.
|
|
None - I just had to overide this function as it is pure virtual. Does nothing.
Implements RenderRegion. Definition at line 492 of file scanrr.cpp.
|
|
None - I just had to overide this function as it is pure virtual. Does nothing.
Implements RenderRegion. Definition at line 458 of file scanrr.cpp.
|
|
This function will examine the attributes etc to see if this represents a simple or compex shape and update the counters that this class keeps. There is no actual rendering, as this class does not actually render anything to a device.
Implements RenderRegion. Definition at line 310 of file scanrr.cpp. 00311 { 00312 // see if this is a complex shape 00313 if (TestForComplexShape(&HostCaps)) 00314 ComplexShapeFound(); 00315 else 00316 SimpleShapeFound(); 00317 }
|
|
This function will examine the attributes etc to see if this represents a simple or compex shape and update the counters that this class keeps. There is no actual rendering, as this class does not actually render anything to a device.
Implements RenderRegion. Definition at line 261 of file scanrr.cpp. 00262 { 00263 // see if this is a complex shape 00264 if (TestForComplexShape(&HostCaps)) 00265 ComplexShapeFound(); 00266 else 00267 SimpleShapeFound(); 00268 }
|
|
This function will examine the attributes etc to see if this represents a simple or compex shape and update the counters that this class keeps. There is no actual rendering, as this class does not actually render anything to a device.
Implements RenderRegion. Definition at line 334 of file scanrr.cpp. 00335 { 00336 // see if this is a complex shape 00337 if (TestForComplexShape(&HostCaps)) 00338 ComplexShapeFound(); 00339 else 00340 SimpleShapeFound(); 00341 }
|
|
This function will examine the attributes etc to see if this represents a simple or compex shape and update the counters that this class keeps. There is no actual rendering, as this class does not actually render anything to a device.
Implements RenderRegion. Definition at line 285 of file scanrr.cpp. 00286 { 00287 // see if this is a complex shape 00288 if (TestForComplexShape(&HostCaps)) 00289 ComplexShapeFound(); 00290 else 00291 SimpleShapeFound(); 00292 }
|
|
Works out if it can draw a Transformed bitmap.
Reimplemented from RenderRegion. Definition at line 408 of file scanrr.cpp. 00409 { 00410 BOOL IsShapeComplex = FALSE; 00411 00412 // see if this is a complex shape (e.g. transparency) 00413 if (TestForComplexShape(&HostCaps) || pNodeBitmap->NeedsTransparency()) 00414 { 00415 ComplexShapeFound(); 00416 return TRUE; 00417 } 00418 00419 // See what kind of bitmaps this render region can do 00420 if (HostCaps.ArbitraryBitmaps) 00421 { 00422 // We can do anything... 00423 if (!IsShapeComplex) 00424 SimpleShapeFound(); 00425 00426 return TRUE; 00427 } 00428 00429 if (HostCaps.SimpleBitmaps) 00430 { 00431 // Check that the bitmap area is rectangular, and is perpendicular to 00432 // the x and y axes. 00433 if (pNodeBitmap->HasSimpleOrientation(this)) 00434 { 00435 SimpleShapeFound(); 00436 return TRUE; 00437 } 00438 } 00439 00440 // If we get here, then we can't do the bitmap directly 00441 ComplexShapeFound(); 00442 00443 return TRUE; 00444 }
|
|
The nodes in the list represent the first node in a run of simple / complex nodes. You can determine if the first node to be rendered is simple or complex by calling IsFirstNodeComplex(). eg. If IsFirstNodeComplex() returned FALSE, then all the nodes up to the node returned by FindFirstFromList() will be simple. All the nodes from this one to the node returned by FindNextFromList will be complex. This toggle carries on all the way through the tree until there are no more nodes. If this function returns NULL, you can assume that there are no runs of nodes in the tree and all the nodes are of the same start as the first one (ie the same as what IsFirstNodeComplex() says).
Definition at line 970 of file scanrr.cpp. 00971 { 00972 // Reset our list pointer 00973 pCurrentListItem = NULL; 00974 00975 // If we have not finished yet, then return NULL 00976 if (!IsFinishedRendering) 00977 { 00978 return NULL; 00979 } 00980 00981 // return the first item in the list 00982 pCurrentListItem = (NodeListItemWithComplexity*) NodeRuns.GetHead(); 00983 if (pCurrentListItem!=NULL) 00984 return pCurrentListItem->pNode; 00985 00986 // the list was empty 00987 return NULL; 00988 }
|
|
Finds the first node in the next run of nodes.
Definition at line 1005 of file scanrr.cpp. 01006 { 01007 // If we have not finished rendering, or we are not looking at a list already, return null 01008 if ((!IsFinishedRendering) || (pCurrentListItem==NULL)) 01009 { 01010 return NULL; 01011 } 01012 01013 // return the next item in the list 01014 pCurrentListItem = (NodeListItemWithComplexity*) NodeRuns.GetNext(pCurrentListItem); 01015 if (pCurrentListItem!=NULL) 01016 return pCurrentListItem->pNode; 01017 01018 // the list was empty 01019 return NULL; 01020 }
|
|
Used to find out the bounding rect of all the complex shapes in the completed render region. If it is called before the region has finished rendering, then it will return the empty rectangle. If there are no complex shapes in the region then it will also return the empty rectangle.
Definition at line 680 of file scanrr.cpp. 00681 { 00682 // If we have not yet finished rendering then this function returns an empty rectangle 00683 if (!IsFinishedRendering) 00684 { 00685 DocRect EmptyOne(0,0,0,0); 00686 return EmptyOne; 00687 } 00688 00689 return ComplexBounds; 00690 }
|
|
This function will return a pointer to the first complex (ie one that can not be rendered without GDraw - such as a transparant shape) node that the render region would need to render. This function will return NULL if there were no complex shapes found. If the Scanning render region has not yet finished rendering, then this function will always return NULL.
Definition at line 596 of file scanrr.cpp. 00597 { 00598 // If we have not yet finished rendering then this function returns NULL 00599 if (!IsFinishedRendering) 00600 return NULL; 00601 00602 // Its finished so we these values are accurate 00603 return pFirstComplex; 00604 }
|
|
This function will return a pointer to the last complex (ie one that can not be rendered without GDraw - such as a transparant shape) node that the render region would need to render. This function will return NULL if there were no complex shapes found. If the Scanning render region has not yet finished rendering, then this function will always return NULL.
Definition at line 625 of file scanrr.cpp. 00626 { 00627 // If we have not yet finished rendering then this function returns NULL 00628 if (!IsFinishedRendering) 00629 return NULL; 00630 00631 // We have finished, so return the true value 00632 return pLastComplex; 00633 }
|
|
This function returns the number of complex shapes that have been found in the scanning render region. It only counts the complex shapes in the region. It will return 0 if there were no complex shapes in the region. If the Scanning render region has not yet finished rendering, then this function will always return 0.
Definition at line 653 of file scanrr.cpp. 00654 { 00655 // If we have not yet finished rendering then this function returns 0 00656 if (!IsFinishedRendering) 00657 return 0; 00658 00659 return NumComplexShapes; 00660 }
|
|
Reimplemented from RenderRegion. Definition at line 191 of file scanrr.h.
|
|
This function allows render regions to admit to what they can and can not render. This allows other areas of the program to come in and help render regions out in some situations, if they are unable to render everything. eg. an OSRenderRegion can not render transparancy.
Reimplemented from RenderRegion. Definition at line 548 of file scanrr.cpp. 00549 { 00550 pCaps->CanDoAll(); 00551 }
|
|
Used to find out the bounding rect of all the shapes in the span. This rectanlge is only calculated for complex spans. If it is called before the region has finished rendering, then it will return the empty rectangle. If there are no complex shapes in the region then it will also return the empty rectangle.
Definition at line 1060 of file scanrr.cpp. 01061 { 01062 // If we have not yet finished rendering then this function returns an empty rectangle 01063 if (!IsFinishedRendering || !pCurrentListItem) 01064 { 01065 DocRect EmptyOne(0,0,0,0); 01066 return EmptyOne; 01067 } 01068 01069 return pCurrentListItem->BoundsRect; 01070 }
|
|
Sets up the attributes. Does nothing in this class.
Implements RenderRegion. Definition at line 1100 of file scanrr.cpp.
|
|
Sets up the clipping - does nothing in this class.
Implements RenderRegion. Definition at line 1085 of file scanrr.cpp.
|
|
Lets you find out if the render region has finished rendering yet. If it has not finished then all the information that this class has to offer about the number of complex shapes etc is not valid. All the info functions will return 0 or NULL until the rendering is finished to stop you looking at incomplete data.
Definition at line 922 of file scanrr.cpp. 00923 { 00924 return IsFinishedRendering; 00925 }
|
|
Definition at line 943 of file scanrr.cpp. 00944 { 00945 return IsFirstComplex; 00946 }
|
|
Definition at line 1033 of file scanrr.cpp. 01034 { 01035 if ((!IsFinishedRendering) || (pCurrentListItem==NULL)) 01036 { 01037 return FALSE; 01038 } 01039 01040 return(!(pCurrentListItem->wasClassifiedSimple)); 01041 }
|
|
This function makes a note of what things the render region we are scanning on behalf of can render and what it can not. We use the info take a copy if pCaps and use it to make the decisions as to what is a complex object and what is not.
Definition at line 568 of file scanrr.cpp. 00569 { 00570 // make a copy of the RRCaps field 00571 // Host caps is used in TestForComplexShape(); 00572 HostCaps = Caps; 00573 }
|
|
Does nothing in this class.
Definition at line 1115 of file scanrr.cpp.
|
|
Does nothing in this class.
Implements RenderRegion. Definition at line 1130 of file scanrr.cpp.
|
|
Does nothing in this class.
Reimplemented from RenderRegion. Definition at line 1145 of file scanrr.cpp.
|
|
Sets the next Node to be rendered.
Reimplemented from RenderRegion. Definition at line 704 of file scanrr.cpp. 00705 { 00706 // If we have been rendering a Node then stick it's details where needed 00707 // Node* pLastNode = GetRenderState(); 00708 // if (pLastNode) 00709 // { 00710 if (bIsComplex || (bIsSimple && GetCaptureDepth() > 1)) 00711 ComplexShapeFoundHelper(); // go ahead and record the node 00712 else if (bIsSimple) 00713 SimpleShapeFoundHelper(); // go ahead and record the node 00714 // } 00715 00716 RenderRegion::SetRenderState(pNode); 00717 bIsComplex = FALSE; 00718 bIsSimple = FALSE; 00719 }
|
|
Definition at line 229 of file scanrr.h.
|
|
This function should be called whenever a simple node is encountered. This allows the list of runs of simple / complex nodes to be maintained.
Definition at line 839 of file scanrr.cpp. 00840 { 00841 // TRACE( _T("SimpleShapeFound\n")); 00842 00843 Node* pThisNode = GetRenderState(); 00844 if (pThisNode == NULL) 00845 { 00846 TRACE( _T("NULL RenderState in SimpleShapeFoundHelper\n")); 00847 } 00848 00849 if (IsThisTheFirstNode) 00850 { 00851 // This node represents the first renderable node in the region 00852 // so make sure that we note the fact that the first node is simple 00853 IsThisTheFirstNode = FALSE; 00854 00855 NodeListItemWithComplexity* pItem = new NodeListItemWithComplexity(pThisNode, TRUE); 00856 if (pItem!=NULL) 00857 NodeRuns.AddTail(pItem); 00858 } 00859 00860 // If we are in the middle of a Complex run then change over to a simple run 00861 if (InComplexRun) 00862 { 00863 // Add this node to the list as the first node in a simple run 00864 // TRACEUSER( "Gerry", _T("Just finished a run of %ld complex shapes - Add Next Simple shape\n"), RunLength); 00865 00866 NodeListItemWithComplexity* pLast = (NodeListItemWithComplexity*)NodeRuns.GetTail(); 00867 if (pLast) 00868 { 00869 pLast->RunLength = RunLength; 00870 pLast->BoundsRect = SpanBounds; 00871 } 00872 00873 SpanBounds.MakeEmpty(); 00874 RunLength = 0; 00875 NodeListItemWithComplexity* pItem = NULL; 00876 if (pThisNode) 00877 { 00878 // If this is the first non-attribute sibling then make the new simple 00879 // run start with our parent and continue up the tree 00880 while (TRUE) 00881 { 00882 // Get the previous sibling 00883 Node* pTestNode = pThisNode->FindPrevious(); 00884 // If we don't have one or it is an attribute then get our parent 00885 // and try again otherwise use this node 00886 if (!pTestNode || pTestNode->IsAnAttribute()) 00887 pThisNode = pThisNode->FindParent(); 00888 else 00889 break; 00890 } 00891 00892 pItem = new NodeListItemWithComplexity(pThisNode, TRUE); 00893 } 00894 00895 if (pItem != NULL) 00896 NodeRuns.AddTail(pItem); 00897 } 00898 00899 // We are no longer in a complex run 00900 InComplexRun = FALSE; 00901 RunLength++; 00902 }
|
|
Called to start the rendering process. Allows the render region to get ready to start rendering.
Reimplemented from RenderRegion. Definition at line 203 of file scanrr.cpp. 00204 { 00205 // Call base class first 00206 if (!RenderRegion::StartRender()) 00207 return FALSE; 00208 00209 // Say that we have not rendered any nodes yet 00210 IsThisTheFirstNode = TRUE; 00211 00212 // All worked 00213 return TRUE; 00214 }
|
|
Called to stop rendering. Since Scanning render regions are not used to background render, this marks the end of all rendering. This function marks the render region as completed, so all the get functions that return info about the objects found in the region start to function.
Implements RenderRegion. Definition at line 230 of file scanrr.cpp. 00231 { 00232 SetRenderState(NULL); 00233 // Update the RunLength of the last span 00234 NodeListItemWithComplexity* pLast = (NodeListItemWithComplexity*)NodeRuns.GetTail(); 00235 if (pLast) 00236 { 00237 // TRACEUSER( "Gerry", _T("Just finished a run of %ld %s shapes\n", RunLength, pLast->wasClassifiedSimple ? "simple" : "complex")); 00238 pLast->RunLength = RunLength; 00239 pLast->BoundsRect = SpanBounds; 00240 } 00241 IsFinishedRendering = TRUE; 00242 return TRUE; 00243 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|