VisualizationFoundation CATViewpoint

Usage: you must use this class as is. You should never derive it.


public class CATViewpoint

A viewpoint represents the scene to be seen and the position of the observer.
This scene will be displayed in a window.


Constructor and Destructor Index


o CATViewpoint()
Create a non-initialized viewpoint.
o CATViewpoint(CATViewpoint&)
Create a viewpoint from another one.

Method Index


o BeginModification()
Declares the begining of the transaction.
o CATDeclareCBEvent(VIEWPOINT_MODIFIED)
Event sent when the viewpoint change.
o ComputeModelFromPixel(float,float,CATMathPoint&,CATMathPoint&,float,float,float,float)
Computes the line going from the eye to a pixel position ( for insatnce the mouse position ) in model corrdinate system.
o ComputeModelFromPixel(float,float,CATMathPointf&,CATMathPointf&,float,float,float,float)
Computes the line going from the eye to a pixel position ( for insatnce the mouse position ) in model corrdinate system.
o ComputePixelFromModel(CATMathPointf&,CATMathPoint2Df&,float,float,float,float)
Computes the pixel position at wich a given point is displayed .
o EndModification(int)
Declares the end of the transaction.
o GetViewer()
Gets the CATViewer associated to the viewpoint.
o GetZoom()
Gets the zoom value.
o Is3D()
Retrieves whether viewpoint is a three dimensional one or not.
o IsAnimated()
Animation query.
o IsShowSpace()
Returns 1 if we display the Show Space.
o Reframe(float,float,float,float)
Changes the viewpoint configuration so that all representation are visible.
o SetShowSpace(int)
Specifies whether we display the show space or the noshow space.
o StartAnimation(void*)
Declares the begining of the manipulation of the viewpoint.
o StopAnimation(void*)
Declares the end of the manipulation of the viewpoint.
o operator =(CATViewpoint&)
Copy of zoom only.

Enumerated Type Index


o VisAAMode

Constructor and Destructor


o CATViewpoint
public CATViewpoint()
Create a non-initialized viewpoint. At the first display, a reframe will automatically been done.
o CATViewpoint
public CATViewpoint( const iViewpoint)
Create a viewpoint from another one.

Methods


o BeginModification
public virtual BeginModification()
Declares the begining of the transaction.
It is necessary the enclose with Begin and End if the viewpoint is modified with severals methods
o CATDeclareCBEvent
public CATDeclareCBEvent( )
Event sent when the viewpoint change.
o ComputeModelFromPixel
public virtual ComputeModelFromPixel( const x,
const y,
neard,
fard,
const width,
const height,
const mmInSupportUnit,
const ratioWH)
Computes the line going from the eye to a pixel position ( for insatnce the mouse position ) in model corrdinate system.
o ComputeModelFromPixel
public virtual ComputeModelFromPixel( const x,
const y,
neard,
fard,
const width,
const height,
const mmInSupportUnit,
const ratioWH)
Computes the line going from the eye to a pixel position ( for insatnce the mouse position ) in model corrdinate system.
o ComputePixelFromModel
public virtual ComputePixelFromModel( const pt_model,
pt_pixel,
const width,
const height,
const mmInSupportUnit,
const ratioWH)
Computes the pixel position at wich a given point is displayed .
o EndModification
public virtual EndModification( const iNotify=1)
Declares the end of the transaction.
After the translation, an event VIEWPOINT_MODIFIED is sent (by callbacks)
Parameters:
iNotify
The notification is sent (default) or not (when we want a reframe at the first display of the viewer.
o GetViewer
public GetViewer()
Gets the CATViewer associated to the viewpoint.
o GetZoom
public virtual GetZoom()
Gets the zoom value.
role: This method should be used only on a CAT2DViewpoint.
In order to zoom in or out on a CAT3DViewpoint, you should use something like:
  CATMathVectorf t = 0.1 * theViewpoint.GetFocusDistance() * theViewpoint.GetSightDirection();
  CATMathPointf Target = theViewpoint.GetTarget();
  theViewpoint.SetOrigin( theViewpoint.GetOrigin() + t);
  theViewpoint.SetFocus( theViewpoint.GetOrigin().DistanceTo(Target));
 
 
 
 
 
 
 
This code zooms in by a small factor. In fact, it moves the Viewpoint origin forward, so that you are 10% closer to the model. The reference distance is the distance to the Target.
See also:
o Is3D
public virtual Is3D()
Retrieves whether viewpoint is a three dimensional one or not.
Returns:
  • TRUE: the viewpoint is a
  • FALSE: The viewpoint is not a 3D viewpoint.
o IsAnimated
public IsAnimated()
Animation query.
o IsShowSpace
public IsShowSpace()
Returns 1 if we display the Show Space.
o Reframe
public virtual Reframe( const width,
const height,
const mmInSupportUnit,
const ratioWH)
Changes the viewpoint configuration so that all representation are visible.
Parameters:
width
width in pixel
height
height in pixel
mmInSupportUnit
precision on wich you display, in mm per unit
ratioWH
ratio of a pixel on the display ( width/hright )
o SetShowSpace
public SetShowSpace( iShowState)
Specifies whether we display the show space or the noshow space.
o StartAnimation
public virtual StartAnimation( iFrom)
Declares the begining of the manipulation of the viewpoint.
It is necessary the do begin/end animation when several steps are displayed consecutively. At the start, an event VIEWPOINT_ANIMATION_STARTED is sent
Parameters:
iFrom
Not used
o StopAnimation
public virtual StopAnimation( iFrom)
Declares the end of the manipulation of the viewpoint.
At the stop, an event VIEWPOINT_ANIMATION_STOPED is sent.
Parameters:
iFrom
Not used
o operator =
public operator =( const )
Copy of zoom only.

Enumerated Types


o VisAAMode
enum VisAAMode {
  VIS_USE_SETTINGS,
  VIS_FORCE_ON,
  VIS_FORCE_OFF
}

This object is included in the file: CATViewpoint.h
If needed, your Imakefile.mk should include the module: CATVisFoundation

Copyright © 1999-2015, Dassault Systèmes. All rights reserved.