InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IRectRegion Class Referenceabstract

#include <IRectRegion.h>

Inheritance diagram for IRectRegion:
grRefCountedObj

Public Member Functions

virtual void SetOrigin (const PMRect &rOrigin)=0
 
virtual const PMRectGetOrigin () const =0
 
virtual void Subtract (const PMRect &rRect, PMReal nMinHeight)=0
 
virtual void Invert ()=0
 
virtual uint32 Compress ()=0
 
virtual const PMRectCollectionGetRectCollection () const =0
 
virtual void CopyRectCollection (PMRectCollection *pRects) const =0
 
virtual bool16 IsModified () const =0
 
virtual bool16 IsInverted () const =0
 
virtual bool16 IsEmpty () const =0
 
virtual bool16 IsRectangular () const =0
 
virtual void Sort (PMRect::PointIndex nIndex, bool16 bXFirst)=0
 
- Public Member Functions inherited from grRefCountedObj
 grRefCountedObj ()
 
virtual ~grRefCountedObj ()=0
 
virtual void AddRef () const
 
virtual void Release () const
 

Additional Inherited Members

- Protected Attributes inherited from grRefCountedObj
int32 fRefCount
 

Detailed Description

IRectRegion has an origin PMRect from which you can substract other PMRects. The area that is left after substraction is stored in a PMRectCollection. You can also invert a IRectRegion so the rects in the PMRectCollections are treated as holes to origin. IRectRegion is used in the overlap management. It is designed to replace the old BandMap.

BP 8/2/96: Here are two examples that describe Subtract with a minimum height. You have always a choice how you divide an origin rect. If you specify a minimum height, Subtract() will look for a solution that avoids rects with a lower height. (Notice that we keep the rects, that are too small) The numbers shows the order of rects that are calculated by Subtract().

This sophisticated class is used by the SpreadOverlapManager and the StandOffs for evaluation of text 'tiles'. Subtract and Compress have to be very fast.

Member Function Documentation

virtual uint32 IRectRegion::Compress ()
pure virtual

Optimizes and tries to reduce the number of rects and returns the number of deleted rects.

Returns
number of deleted rects.
virtual void IRectRegion::CopyRectCollection (PMRectCollectionpRects) const
pure virtual

Copies the PMRectCollection with the rectangles that are left into pRects;

Parameters
pRectsOUT. The rectangle to be copied to.
virtual const PMRect& IRectRegion::GetOrigin () const
pure virtual

Returns the origin rectangle of the rect region.

Returns
the origin rectangle.
virtual const PMRectCollection& IRectRegion::GetRectCollection () const
pure virtual

Returns the PMRectCollection with the rectangles that are left.

Returns
PMRectCollection with the rectangles that are left.
virtual void IRectRegion::Invert ()
pure virtual

Inverts the rect region in such a way that holes become rects and rects become holes.

virtual bool16 IRectRegion::IsEmpty () const
pure virtual

Returns whether the rect region is empty or not.

Returns
whether the rect region is empty or not.
virtual bool16 IRectRegion::IsInverted () const
pure virtual

Returns whether the rect region has been inverted or not.

Returns
whether the rect region has been inverted or not.
virtual bool16 IRectRegion::IsModified () const
pure virtual

Returns whether the rect region has been modified or not.

Returns
whether the rect region has been modified or not.
virtual bool16 IRectRegion::IsRectangular () const
pure virtual

Returns whether the rect region is rectangular or not.

Returns
whether the rect region is rectangular or not.
virtual void IRectRegion::SetOrigin (const PMRectrOrigin)
pure virtual

Sets the origin of the rect region.

Parameters
rOriginIN. Origin rectangle.
virtual void IRectRegion::Sort (PMRect::PointIndex nIndex,
bool16 bXFirst 
)
pure virtual

Sorts the rect region.

Parameters
nIndexIN. Specifies the point index for sorting.
bXFirstIN. If bXFirst is true it will be sorted by PMPoint::X(). If bXFirst is false it will be sorted by PMPoint::Y().
virtual void IRectRegion::Subtract (const PMRectrRect,
PMReal nMinHeight 
)
pure virtual

Substracts rRect from the origin rectangle.

Parameters
rRectIN. Substracts rRect from the origin rectangle.
nMinHeightIN. After the subtaction all rectangles must have a minimum height of nMinHeight.