All Frameworks  Class Hierarchy  This Framework  Previous  Next  Indexes

VisualizationBase Class CATViewpoint

System.IUnknown
  |
  +---System.IDispatch
    |
    +---System.CATBaseUnknown
      |
      +---System.CATEventSubscriber
        |
        +---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,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 GetVizViewer()
Gets the CATVizViewer 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 SetViewer(CATVizViewer*)
Sets the CATViewer associated to the viewpoint.
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.

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 CATViewpoint& iViewpoint)
Create a viewpoint from another one.

Methods


o BeginModification
public virtual void 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(VIEWPOINT_MODIFIED )
Event sent when the viewpoint change.
o ComputeModelFromPixel
public virtual void ComputeModelFromPixel( const float x,
const float y,
CATMathPointf& neard,
CATMathPointf& fard,
const float width,
const float height,
const float mmInSupportUnit,
const float ratioWH) = 0
Computes the line going from the eye to a pixel position ( for insatnce the mouse position ) in model corrdinate system.
o ComputePixelFromModel
public virtual void ComputePixelFromModel( const CATMathPointf& pt_model,
CATMathPoint2Df& pt_pixel,
const float width,
const float height,
const float mmInSupportUnit,
const float ratioWH) = 0
Computes the pixel position at wich a given point is displayed .
o EndModification
public virtual void EndModification( const int 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 CATViewer * GetViewer()const
Gets the CATViewer associated to the viewpoint.
o GetVizViewer
public CATVizViewer * GetVizViewer()const
Gets the CATVizViewer associated to the viewpoint.
o GetZoom
public virtual float GetZoom()const
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));
 
CAT3DViewpoint.GetTarget 
CAT3DViewpoint.SetTarget 
CAT3DViewpoint.GetOrigin 
CAT3DViewpoint.SetOrigin 
CAT3DViewpoint.GetFocusDistance 
CAT3DViewpoint.GetSightDirection 
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:
CAT3DViewpoint
o Is3D
public virtual CATBoolean Is3D()
Retrieves whether viewpoint is a three dimensional one or not.
Returns:
  • TRUE: the viewpoint is a CAT3DViewpoint
  • FALSE: The viewpoint is not a 3D viewpoint.
o IsAnimated
public inline int IsAnimated()
Animation query.
o IsShowSpace
public int IsShowSpace()
Returns 1 if we display the Show Space.
o Reframe
public virtual void Reframe( const float width,
const float height,
const float mmInSupportUnit,
const float ratioWH) = 0
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 void SetShowSpace(int iShowState)
Specifies whether we display the show space or the noshow space.
o SetViewer
public void SetViewer(CATVizViewer* iViewer)
Sets the CATViewer associated to the viewpoint.
o StartAnimation
public virtual void StartAnimation(void* 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 void StopAnimation(void* 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 CATViewpoint & operator =( const CATViewpoint& )
Copy of zoom only.

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

Copyright © 2003, Dassault Systèmes. All rights reserved.