|
Open CASCADE Technology
6.7.1
|
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. –
More...
#include <Visual3d_ViewMapping.hxx>
Public Member Functions | |
| Visual3d_ViewMapping () | |
Creates a projection. <br> | |
| 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. <br> | |
| void | SetBackPlaneDistance (const Standard_Real BPD) |
Modifies the back clipping plane. <br> Category: Methods to modify the class definition | |
| void | SetFrontPlaneDistance (const Standard_Real FPD) |
Modifies the front clipping plane. <br> Category: Methods to modify the class definition | |
| void | SetProjection (const Visual3d_TypeOfProjection AType) |
Modifies the type of projection. <br> | |
| void | SetProjectionReferencePoint (const Graphic3d_Vertex &PRP) |
Modifies the PRP. <br> Category: Methods to modify the class definition | |
| void | SetViewPlaneDistance (const Standard_Real VPD) |
Modifies the distance of the view plane of projection. <br> Category: Methods to modify the class definition | |
| 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. <br> Category: Methods to modify the class definition | |
| void | SetCustomProjectionMatrix (const Handle< TColStd_HArray2OfReal > &Mat) |
| Sets custom PROJECTION matrix for the OpenGl context More... | |
| Standard_Real | BackPlaneDistance () const |
Returns the distance from the back clipping plane <br> of this view mapping. | |
| Standard_Real | FrontPlaneDistance () const |
Returns the distance from the front clipping plane <br> of this view mapping. | |
| Visual3d_TypeOfProjection | Projection () const |
| Returns the type of projection. More... | |
| Graphic3d_Vertex | ProjectionReferencePoint () const |
| Returns the PRP. More... | |
| Standard_Real | ViewPlaneDistance () const |
| Returns the distance from the projection plane. More... | |
| void | WindowLimit (Standard_Real &Umin, Standard_Real &Vmin, Standard_Real &Umax, Standard_Real &Vmax) const |
| Returns the visible part of the projection plane. More... | |
| Standard_Boolean | IsCustomMatrix () const |
| Returns whether the custom PROJECTION matrix is used. More... | |
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. –
| Visual3d_ViewMapping::Visual3d_ViewMapping | ( | ) |
Creates a projection. <br>
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::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. <br>
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.
| Standard_Real Visual3d_ViewMapping::BackPlaneDistance | ( | ) | const |
Returns the distance from the back clipping plane <br>
of this view mapping.
| Standard_Real Visual3d_ViewMapping::FrontPlaneDistance | ( | ) | const |
Returns the distance from the front clipping plane <br>
of this view mapping.
| Standard_Boolean Visual3d_ViewMapping::IsCustomMatrix | ( | ) | const |
Returns whether the custom PROJECTION matrix is used.
| Visual3d_TypeOfProjection Visual3d_ViewMapping::Projection | ( | ) | const |
Returns the type of projection.
| Graphic3d_Vertex Visual3d_ViewMapping::ProjectionReferencePoint | ( | ) | const |
Returns the PRP.
| void Visual3d_ViewMapping::SetBackPlaneDistance | ( | const Standard_Real | BPD | ) |
Modifies the back clipping plane. <br>
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 Visual3d_ViewMapping::SetCustomProjectionMatrix | ( | const Handle< TColStd_HArray2OfReal > & | Mat | ) |
Sets custom PROJECTION matrix for the OpenGl context
| void Visual3d_ViewMapping::SetFrontPlaneDistance | ( | const Standard_Real | FPD | ) |
Modifies the front clipping plane. <br>
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 Visual3d_ViewMapping::SetProjection | ( | const Visual3d_TypeOfProjection | AType | ) |
Modifies the type of projection. <br>
TypeOfProjection : TOP_PERSPECTIVE
TOP_PARALLEL
| void Visual3d_ViewMapping::SetProjectionReferencePoint | ( | const Graphic3d_Vertex & | PRP | ) |
Modifies the PRP. <br>
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 Visual3d_ViewMapping::SetViewPlaneDistance | ( | const Standard_Real | VPD | ) |
Modifies the distance of the view plane of projection. <br>
Category: Methods to modify the class definition
Warning: Raises ViewMappingDefinitionError
if <PRP> is positioned on the view plane.
| void Visual3d_ViewMapping::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. <br>
Category: Methods to modify the class definition
Warning: Raises ViewMappingDefinitionError if the
specified window is invalid.
| Standard_Real Visual3d_ViewMapping::ViewPlaneDistance | ( | ) | const |
Returns the distance from the projection plane.
| void Visual3d_ViewMapping::WindowLimit | ( | Standard_Real & | Umin, |
| Standard_Real & | Vmin, | ||
| Standard_Real & | Umax, | ||
| Standard_Real & | Vmax | ||
| ) | const |
Returns the visible part of the projection plane.
1.8.5