PerspectiveShapes Class Reference

The default perspective shapes class. This class provides a bunch of static functions to create some default shapes. All shapes are defined on a (0,0),(72000,72000) coordinate system. More...

#include <moldpers.h>

List of all members.

Static Public Member Functions

static BOOL Rectangular (Path *pPath)
 Creates a rectangular perspective. The perspective manifold is defined on a millipoint square coordinate system. ie its outer coorinates are (0,0), (72000,72000). So to scale the perspective perform Coord = (ScaleFactor * Coord / 72000).
static BOOL LeftWall (Path *pPath)
static BOOL RightWall (Path *pPath)
static BOOL Floor (Path *pPath)
static BOOL Ceiling (Path *pPath)

Static Private Member Functions

static BOOL MakeShape (Path *pPath, DocCoord *point)


Detailed Description

The default perspective shapes class. This class provides a bunch of static functions to create some default shapes. All shapes are defined on a (0,0),(72000,72000) coordinate system.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/12/94

Definition at line 267 of file moldpers.h.


Member Function Documentation

BOOL PerspectiveShapes::Ceiling Path pPath  )  [static]
 

Definition at line 1722 of file moldpers.cpp.

01723 {
01724     ERROR2IF(pPath==NULL,FALSE,"NULL path pointer passed to PerspectiveShapes::Ceiling()");
01725 
01726     DocCoord point[PER_NUMCOORDS];
01727 
01728     point[0].x = 27000; 
01729     point[0].y = 0;
01730     point[1].x = 0;
01731     point[1].y = 72000;
01732     point[2].x = 72000;
01733     point[2].y = 72000;
01734     point[3].x = 45000;
01735     point[3].y = 0;
01736 
01737     return MakeShape(pPath,point);
01738 }

BOOL PerspectiveShapes::Floor Path pPath  )  [static]
 

Definition at line 1703 of file moldpers.cpp.

01704 {
01705     ERROR2IF(pPath==NULL,FALSE,"NULL path pointer passed to PerspectiveShapes::Floor()");
01706 
01707     DocCoord point[PER_NUMCOORDS];
01708 
01709     point[0].x = 0; 
01710     point[0].y = 0;
01711     point[1].x = 27000;
01712     point[1].y = 72000;
01713     point[2].x = 45000;
01714     point[2].y = 72000;
01715     point[3].x = 72000;
01716     point[3].y = 0;
01717 
01718     return MakeShape(pPath,point);
01719 }

BOOL PerspectiveShapes::LeftWall Path pPath  )  [static]
 

Definition at line 1665 of file moldpers.cpp.

01666 {
01667     ERROR2IF(pPath==NULL,FALSE,"NULL path pointer passed to PerspectiveShapes::LeftWall()");
01668 
01669     DocCoord point[PER_NUMCOORDS];
01670 
01671     point[0].x = 0; 
01672     point[0].y = 0;
01673     point[1].x = 0;
01674     point[1].y = 72000;
01675     point[2].x = 72000;
01676     point[2].y = 45000;
01677     point[3].x = 72000;
01678     point[3].y = 27000;
01679 
01680     return MakeShape(pPath,point);
01681 }

BOOL PerspectiveShapes::MakeShape Path pPath,
DocCoord point
[static, private]
 

Definition at line 1742 of file moldpers.cpp.

01743 {
01744     PathFlags flags;
01745     flags.IsSelected = FALSE;
01746 
01747     // Build a perspective manifold
01748     BOOL ok = (pPath->AddMoveTo(point[0],&flags));
01749     if (!ok) return FALSE;
01750 
01751     ok = (pPath->AddLineTo(point[1],&flags));
01752     if (!ok) return FALSE;
01753 
01754     ok = (pPath->AddLineTo(point[2],&flags));
01755     if (!ok) return FALSE;
01756 
01757     ok = (pPath->AddLineTo(point[3],&flags));
01758     if (!ok) return FALSE;
01759 
01760     ok = (pPath->AddLineTo(point[0],&flags));
01761     if (!ok) return FALSE;
01762 
01763     ok = (pPath->CloseSubPath());
01764 
01765     return (ok);
01766 }

BOOL PerspectiveShapes::Rectangular Path pPath  )  [static]
 

Creates a rectangular perspective. The perspective manifold is defined on a millipoint square coordinate system. ie its outer coorinates are (0,0), (72000,72000). So to scale the perspective perform Coord = (ScaleFactor * Coord / 72000).

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/12/94
Parameters:
pPath = a pointer to an empty path (should be initialised but empty) [INPUTS]
a unit rectangular perspective, ready to be scaled to fit the selection. [OUTPUTS]
Returns:
TRUE if the rectangular perspective manifold has been created FALSE if no memory to create the perspective.

Definition at line 1646 of file moldpers.cpp.

01647 {
01648     ERROR2IF(pPath==NULL,FALSE,"NULL path pointer passed to PerspectiveShapes::Rectangular()");
01649 
01650     DocCoord point[PER_NUMCOORDS];
01651 
01652     point[0].x = 0; 
01653     point[0].y = 0;
01654     point[1].x = 0;
01655     point[1].y = 72000;
01656     point[2].x = 72000;
01657     point[2].y = 72000;
01658     point[3].x = 72000;
01659     point[3].y = 0;
01660 
01661     return MakeShape(pPath,point);
01662 }

BOOL PerspectiveShapes::RightWall Path pPath  )  [static]
 

Definition at line 1684 of file moldpers.cpp.

01685 {
01686     ERROR2IF(pPath==NULL,FALSE,"NULL path pointer passed to PerspectiveShapes::RightWall()");
01687 
01688     DocCoord point[PER_NUMCOORDS];
01689 
01690     point[0].x = 0; 
01691     point[0].y = 27000;
01692     point[1].x = 0;
01693     point[1].y = 45000;
01694     point[2].x = 72000;
01695     point[2].y = 72000;
01696     point[3].x = 72000;
01697     point[3].y = 0;
01698 
01699     return MakeShape(pPath,point);
01700 }


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