Mako 7.5.0 API
Loading...
Searching...
No Matches
IDOMShape Class Referenceabstract

Interface to an IDOMShape. More...

#include <idomshape.h>

Inheritance diagram for IDOMShape:

Classes

class  CShapeDetails
 Provides a view into the regions that comprise the shape. A region consists of a series of spans, each representing a series of rectangles that share the same y span. More...
 
class  Data
 Initialization data. More...
 

Public Member Functions

virtual IDOMImagePtr getAsImage (const ISessionPtr &session, bool bUseTempFileForImage) const =0
 Return in image an 1-bit-per-pixel DeviceGray image representation of this shape.
 
virtual IDOMPathGeometryPtr getAsGeometry (IEDLClassFactory *factory) const =0
 Get the shape as path geometry.
 
virtual FRect getBounds () const =0
 Get the bounds (in pixels) of the shape. The bounds is always integral.
 
virtual IntRect getIntBounds () const =0
 Get the bounds (in pixels) of the shape as an integer rect.
 
virtual float getResolution () const =0
 Get the resolution of the shape.
 
virtual bool getIsEmpty () const =0
 Detect an empty shape.
 
virtual bool getIsRect () const =0
 Detect if a shape is a rectangle.
 
virtual bool isEqualTo (const IDOMShapePtr &ptrShape) const =0
 Check this shape for equality to another shape.
 
virtual void unite (const IDOMShapePtr &ptrShape)=0
 Unite this shape with another.
 
virtual void intersect (const IDOMShapePtr &ptrShape)=0
 Reduce this shape to its intersection with another shape.
 
virtual void difference (const IDOMShapePtr &ptrShape)=0
 Reduce this shape by subtracting another shape.
 
virtual void offset (int32 offsetX, int32 offsetY)=0
 Offset the shape by the given numbers of pixels.
 
virtual bool intersects (const IDOMShapePtr &ptrShape) const =0
 Detect if this shape intersects with another.
 
virtual bool completelyContainsShape (const IDOMShapePtr &ptrShape) const =0
 Detect if another shape fits completely inside this shape.
 
virtual CShapeDetails getShapeDetails () const =0
 Fetch the regions that comprise the shape.
 
- Public Member Functions inherited from IEDLObject
virtual const CClassIDgetClassID () const =0
 Returns class ID of IEDLObject.
 
virtual bool init (CClassParams *pData)
 The init() method is called to perform any post-construction initialization of an IEDLObject that has been created by the EDL class factory, before it is actually returned by the factory.
 
virtual bool clone (IEDLObjectPtr &ptrObject, IEDLClassFactory *pFactory)
 Create a copy of EDLObject.
 
- Public Member Functions inherited from IRCObject
virtual void addRef () const =0
 Increases the reference count of the actual object pointed to. This would take place during an assignment or copying.
 
virtual bool decRef () const =0
 Decreases the reference count of the actual object pointed to. When the reference count falls to Zero, it deletes the actual object pointed to.
 
virtual int32 getRefCount () const =0
 Retrieve the current reference count of the actual object pointed to.
 
- Public Member Functions inherited from IDOMHashable
virtual ~IDOMHashable ()
 Virtual destructor.
 
virtual bool hash (uint64 &hash)=0
 Retrieve a hash for this object.
 
virtual uint64 hashE ()
 As hash(), but throws an exception if the operation fails.
 

Static Public Member Functions

static const CClassIDclassID ()
 Retrieves class id of IDOMShape.
 
static EDL_API IDOMShapePtr createRect (IEDLClassFactory *pFactory, float resolution, const FRect &rect)
 Create a rectangular shape.
 
static EDL_API IDOMShapePtr createRectPixels (IEDLClassFactory *pFactory, float resolution, const IntRect &rect)
 As per createRect(), but the rectangle is pixels. The shape will be tagged with the given resolution, however the dimensions of the shape will not change.
 

Additional Inherited Members

- Protected Member Functions inherited from IRCObject
virtual ~IRCObject ()
 Virtual destructor.
 

Detailed Description

Interface to an IDOMShape.

A shape describes a scan-converted path. That is, a path that has been scanned to find which pixels would be affected by the path.

This is useful for a number of things. Once a shape has been made from a path it may be compared to other shapes to test for things like intersection and occulsion using higher accuracy than can be obtained by simply comparing bounding boxes.

A shape may be compared only with another shape scan-converted at the same resolution.

As of current this interface does not allow access to the low level details of the scan converted result. Rather it is intended to allow for simple comparisons.

Member Function Documentation

◆ classID()

static const CClassID & IDOMShape::classID ( )
inlinestatic

Retrieves class id of IDOMShape.

Returns
CClassID Class id of the element

◆ completelyContainsShape()

virtual bool IDOMShape::completelyContainsShape ( const IDOMShapePtr & ptrShape) const
pure virtual

Detect if another shape fits completely inside this shape.

Parameters
[in]ptrShapeThe shape to test.
Returns
bool True if the given shape fits completely in this shape.

◆ difference()

virtual void IDOMShape::difference ( const IDOMShapePtr & ptrShape)
pure virtual

Reduce this shape by subtracting another shape.

Parameters
[in]ptrShapeThe shape to subtract.

◆ getAsGeometry()

virtual IDOMPathGeometryPtr IDOMShape::getAsGeometry ( IEDLClassFactory * factory) const
pure virtual

Get the shape as path geometry.

      Take care when using this API as it may generate very complex
      geometry, as the generated geometry will consist of rectangles
      representing the spans encoded in the shape, For complex shapes
      with many spans, this geometry can become very large.
Parameters
factoryThe factory to use.
Returns
IDOMPathGeometryPtr The resulting geometry.

◆ getAsImage()

virtual IDOMImagePtr IDOMShape::getAsImage ( const ISessionPtr & session,
bool bUseTempFileForImage ) const
pure virtual

Return in image an 1-bit-per-pixel DeviceGray image representation of this shape.

Parameters
[in]sessionThe current session.
[in]bUseTempFileForImageIf true, the method creates a temporary file (the lifecycle of which Mako manages itself) to store the underlying image data in. If false, it uses an in-memory stream to store the image data. Client code can determine the size of the image that will be created using this class's getBounds() method, and choose which value to send for this flag. Note that as the image returned is 1 bit per pixel, the number of bytes required to store an image is the product of the bounds divided by the size of a byte.
Returns
IDOMImagePtr The resulting image

◆ getBounds()

virtual FRect IDOMShape::getBounds ( ) const
pure virtual

Get the bounds (in pixels) of the shape. The bounds is always integral.

Returns
FRect The bounds of the shape.

◆ getIntBounds()

virtual IntRect IDOMShape::getIntBounds ( ) const
pure virtual

Get the bounds (in pixels) of the shape as an integer rect.

Returns
IntRect The bounds of the shape.

◆ getIsEmpty()

virtual bool IDOMShape::getIsEmpty ( ) const
pure virtual

Detect an empty shape.

Returns
bool True if the shape is empty.

◆ getIsRect()

virtual bool IDOMShape::getIsRect ( ) const
pure virtual

Detect if a shape is a rectangle.

Returns
bool True if the shape is rectangular.

◆ getResolution()

virtual float IDOMShape::getResolution ( ) const
pure virtual

Get the resolution of the shape.

Returns
float Returns the resolution of the shape.

◆ getShapeDetails()

virtual CShapeDetails IDOMShape::getShapeDetails ( ) const
pure virtual

Fetch the regions that comprise the shape.

Returns
CShapeDetails The details of the shape. See #CShapeDetails

◆ intersect()

virtual void IDOMShape::intersect ( const IDOMShapePtr & ptrShape)
pure virtual

Reduce this shape to its intersection with another shape.

Parameters
[in]ptrShapeThe shape with which to intersect.

◆ intersects()

virtual bool IDOMShape::intersects ( const IDOMShapePtr & ptrShape) const
pure virtual

Detect if this shape intersects with another.

Parameters
[in]ptrShapeThe shape to test with.
Returns
bool True if the shapes intersect, false otherwise.

◆ isEqualTo()

virtual bool IDOMShape::isEqualTo ( const IDOMShapePtr & ptrShape) const
pure virtual

Check this shape for equality to another shape.

Parameters
[in]ptrShapeThe shape to compare.
Returns
bool True if the shapes are equivalent.

◆ offset()

virtual void IDOMShape::offset ( int32 offsetX,
int32 offsetY )
pure virtual

Offset the shape by the given numbers of pixels.

Parameters
offsetXThe number of pixels to offset in x
offsetYThe number of pixels to offset in y

◆ unite()

virtual void IDOMShape::unite ( const IDOMShapePtr & ptrShape)
pure virtual

Unite this shape with another.

Parameters
[in]ptrShapeThe shape with which to unite.

The documentation for this class was generated from the following file: