Public Types | Public Member Functions | Static Public Attributes

Plane Class Reference

Search for all occurrences

Detailed Description

See also:
Class FPMixinInterface, Class Point3, Class Ray , Class IManipulatorMgr

Description:
This class is available in release 4.0 and later only.

The manipulator system exports a helper plane class. This is very useful when writing OnMouseMove() methods. It is normally used to intersect a view ray with some plane that is used by the manipulator.
Data Members:
static Plane msXYPlane;

This constant defines the XY plane.

static Plane msXZPlane;

This constant defines the XZ plane.

static Plane msYZPlane;

This constant defines the YZ plane.

#include <manipulator.h>

Inheritance diagram for Plane:
Inheritance graph
[legend]

List of all members.

Public Types

enum   {
  intersect, mostOrthogonal, getNormal, getPoint,
  getPlaneConstant
}

Public Member Functions

ManipExport  Plane (Point3 &normal, Point3 &point)
ManipExport  Plane (Point3 &p1, Point3 &p2, Point3 &p3)
ManipExport  Plane ()
ManipExport bool  Intersect (Ray &ray, Point3 &intersectionPoint)
ManipExport Point3 GetNormal ()
ManipExport Point3 GetPoint ()
ManipExport float  GetPlaneConstant ()
ManipExport Plane MostOrthogonal (Ray &viewDir, Plane &plane)
BEGIN_FUNCTION_MAP  FN_2 (intersect, TYPE_BOOL, Intersect, TYPE_RAY_BV, TYPE_POINT3_BR)
  FN_2 (mostOrthogonal, TYPE_INTERFACE, FPMostOrthogonal, TYPE_RAY_BV, TYPE_INTERFACE)
  RO_PROP_FN (getNormal, GetNormal, TYPE_POINT3_BV)
  RO_PROP_FN (getPoint, GetPoint, TYPE_POINT3_BV)
  RO_PROP_FN (getPlaneConstant, GetPlaneConstant, TYPE_FLOAT)
END_FUNCTION_MAP ManipExport
Plane
FPMostOrthogonal (Ray &viewRay, FPInterface *plane)
ManipExport FPInterfaceDesc GetDesc ()
ManipExport LifetimeType  LifetimeControl ()
ManipExport BaseInterface AcquireInterface ()
ManipExport void  ReleaseInterface ()

Static Public Attributes

static ManipExport Plane  msXYPlane
static ManipExport Plane  msXZPlane
static ManipExport Plane  msYZPlane

Member Enumeration Documentation

anonymous enum

Constructor & Destructor Documentation

ManipExport Plane ( Point3 normal,
Point3 point 
)
Remarks:
Constructor.

Create a plane that passes through the given point with the given normal.
Parameters:
Point3& normal

The normal of the plane.

Point3& point

The point the plane should pass through.
ManipExport Plane ( Point3 p1,
Point3 p2,
Point3 p3 
)
Remarks:
Constructor.

Create a plane that passes through all three given points.
Parameters:
Points3& p1, Points3& p2, Points3& p3

The three points the plane should pass through.

ManipExport Plane ( ) [inline]
Remarks:
Constructor.
: mNormal(0,0,1), mPoint(0,0,0), mD(0.0f) {}

Member Function Documentation

ManipExport bool Intersect ( Ray ray,
Point3 intersectionPoint 
)
Remarks:
This method will intersect the plane with a ray.
Parameters:
Ray& ray

The ray you wish to test for intersection.

Points3& intersectionPoint

The resulting intersection point, if the ray intersected the plane.
Returns:
TRUE if the ray intersects, otherwise FALSE.
ManipExport Point3& GetNormal ( ) [inline]
Remarks:
This method returns the normal of the plane.
{ return mNormal; }
ManipExport Point3& GetPoint ( ) [inline]
Remarks:
This method returns the point that the plane passes through.
{ return mPoint; }
ManipExport float GetPlaneConstant ( ) [inline]
Remarks:
This method returns the plane equation constant.
{ return mD; }
ManipExport Plane& MostOrthogonal ( Ray viewDir,
Plane plane 
)
Remarks:
This method can be used to test which plane (either this or plane) is most orthogonal with the given view ray, returning that plane. This can be useful in determining which plane to project a view ray onto, if more than one is applicable.
Parameters:
Ray& viewDir

The given view ray.

Plane& plane

The plane to test.
BEGIN_FUNCTION_MAP FN_2 ( intersect  ,
TYPE_BOOL  ,
Intersect  ,
TYPE_RAY_BV  ,
TYPE_POINT3_BR   
)
FN_2 ( mostOrthogonal  ,
TYPE_INTERFACE  ,
FPMostOrthogonal  ,
TYPE_RAY_BV  ,
TYPE_INTERFACE   
)
RO_PROP_FN ( getNormal  ,
GetNormal  ,
TYPE_POINT3_BV   
)
RO_PROP_FN ( getPoint  ,
GetPoint  ,
TYPE_POINT3_BV   
)
RO_PROP_FN ( getPlaneConstant  ,
GetPlaneConstant  ,
TYPE_FLOAT   
)
END_FUNCTION_MAP ManipExport Plane* FPMostOrthogonal ( Ray viewRay,
FPInterface plane 
)
ManipExport FPInterfaceDesc* GetDesc ( ) [virtual]
Remarks:
Returns a pointer to the class which contains the interface metadata.

Implements FPInterface.

ManipExport LifetimeType LifetimeControl ( ) [inline, virtual]
Remarks:
This method allows inquiries into the actual lifetime policy of a client and provide a server-controlled delete notify callback.
Returns:
One of the following LifetimeTypes:

noRelease

Do not call release, use interface as long as you like.

immediateRelease

The interface is only good for one calls. The release is implied so a call to release is not required.

wantsRelease

The clients are controlling the lifetime, so the interface needs a Release() when the client has finished. This is the default.

serverControlled

The server controls the lifetime and will use the InterfaceNotifyCallback to inform the code when it is gone.
Default Implementation:
{ return noRelease; }

Reimplemented from FPMixinInterface.

{ return wantsRelease; }
ManipExport BaseInterface* AcquireInterface ( ) [inline, virtual]
Remarks:
This method is part of the interface reference management and can be implemented by dynamically allocated interfaces for ref-count based lifetime control). This method should return TRUE if it needs Release() to be called.
Default Implementation:
{ return false; }

Reimplemented from BaseInterface.

{ return this; }
ManipExport void ReleaseInterface ( ) [virtual]
Remarks:
This method is called when a reference to this object is deleted.
Default Implementation:
{ }

Reimplemented from BaseInterface.


Member Data Documentation

ManipExport Plane msXYPlane [static]
ManipExport Plane msXZPlane [static]
ManipExport Plane msYZPlane [static]

Plane Plane Plane Plane Plane Plane Plane Plane Plane Plane
Plane Plane Plane Plane Plane Plane Plane Plane Plane Plane