Open CASCADE Technology  6.5.4
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions
Visual3d_ViewMapping Class Reference

This class allows the definition of a projection and
a system of coordinates called NPC.
(Normalized Projection Coordinates).
The projection can be parallel or perspective.
References: The definitions are Phigs oriented.
Keywords: View, Mapping, Window, View Plane, Front Plane,
BackPlane, Projection Type, Reset, Projection
Summary of 3D View Mapping --
The view mapping transformation defines the --
window-to-viewport mapping of View Reference --
Coordinates (VRC) to Normalized Projection --
Coordinates (NPC). --
CAS.CADE supports two kinds of projection : --
Parallel : --
The Projection Reference Point (PRP) --
determines the direction of projection. --
Perspective : --
The projector lines converge at the --
Projection Reference Point (PRP). --
To define a view mapping transformation you --
must define : --
The Projection Type --
The Projection Reference Point (PRP) --
The Distance from Back Plane (BPD) --
The Distance from Front Plane (FPD) --
The Distance from View Plane (VPD) --
The Window in the View Plane. --

#include <Visual3d_ViewMapping.hxx>

Public Member Functions

DEFINE_STANDARD_ALLOC Visual3d_ViewMapping ()
 Creates a projection.

TypeOfProjection = TOP_PARALLEL
PRP : Projection Reference Point= (0.5, 0.5, 2.0)
BPD : Distance from Back Plane = 0.0
FPD : Distance from Front Plane = 1.0
VPD : Distance from View Plane = 1.0
WUmin = 0.0
WUmax = 1.0
WVmin = 0.0
WVmax = 1.0

 Visual3d_ViewMapping (const Visual3d_TypeOfProjection AType, const Graphic3d_Vertex &PRP, const Standard_Real BPD, const Standard_Real FPD, const Standard_Real VPD, const Standard_Real WUmin, const Standard_Real WVmin, const Standard_Real WUmax, const Standard_Real WVmax)
 Creates a projection.

TypeOfProjection : TOP_PERSPECTIVE
TOP_PARALLEL
PRP : Projection Reference Point with respect to
coordinate system VRC, defined by the
class ViewOrientation.
BPD : Distance from Back Plane.
FPD : Distance from Front Plane.
VPD : Distance from View Plane.
These three values are with respect to VRP, according to
the N axis of the VRC coordinate system, defined by the class
ViewOrientation.
WUmin,WUmax,WVmin,WVmax : Visible part of the plane of
projection defined with respect to the UV axes of coordinate
system VRC.
That's what allows modification of the zoom/panning.
The mapping of the visible part of the plane of projection
on the screen is done in the window.
That's why multiple views on the same window is not allowed.
Warning: Raises ViewMappingDefinitionError
if the specified window is invalid.
if <PRP> is between the front and back planes.
if <PRP> is positioned on the view plane.
if the back plane is in front of the front plane.

void SetBackPlaneDistance (const Standard_Real BPD)
 Modifies the back clipping plane.
Category: Methods to modify the class definition
Warning: Raises ViewMappingDefinitionError
if <PRP> is between the front and back planes.
if <PRP> is positioned on the view plane.
if the back plane is in front of the front plane.

void SetFrontPlaneDistance (const Standard_Real FPD)
 Modifies the front clipping plane.
Category: Methods to modify the class definition
Warning: Raises ViewMappingDefinitionError
if <PRP> is between the front and back planes.
if <PRP> is positioned on the view plane.
if the back plane is in front of the front plane.

void SetProjection (const Visual3d_TypeOfProjection AType)
 Modifies the type of projection.

TypeOfProjection : TOP_PERSPECTIVE
TOP_PARALLEL


void SetProjectionReferencePoint (const Graphic3d_Vertex &PRP)
 Modifies the PRP.
Category: Methods to modify the class definition
Warning: Raises ViewMappingDefinitionError
if <PRP> is between the front and back planes.
if <PRP> is positioned on the view plane.

void SetViewPlaneDistance (const Standard_Real VPD)
 Modifies the distance of the view plane of projection.
Category: Methods to modify the class definition
Warning: Raises ViewMappingDefinitionError
if <PRP> is positioned on the view plane.

void SetWindowLimit (const Standard_Real Umin, const Standard_Real Vmin, const Standard_Real Umax, const Standard_Real Vmax)
 Modifies the visible part of the projection plane.
Category: Methods to modify the class definition
Warning: Raises ViewMappingDefinitionError if the
specified window is invalid.

void SetCustomProjectionMatrix (const Handle< TColStd_HArray2OfReal > &Mat)
 Sets custom PROJECTION matrix for the OpenGl context

Standard_Real BackPlaneDistance () const
 Returns the distance from the back clipping plane
of this view mapping.

Standard_Real FrontPlaneDistance () const
 Returns the distance from the front clipping plane
of this view mapping.

Visual3d_TypeOfProjection Projection () const
 Returns the type of projection.

Graphic3d_Vertex ProjectionReferencePoint () const
 Returns the PRP.

Standard_Real ViewPlaneDistance () const
 Returns the distance from the projection plane.

void WindowLimit (Standard_Real &Umin, Standard_Real &Vmin, Standard_Real &Umax, Standard_Real &Vmax) const
 Returns the visible part of the projection plane.

Standard_Boolean IsCustomMatrix () const
 Returns whether the custom PROJECTION matrix is used.


Constructor & Destructor Documentation


Member Function Documentation


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