VisualizationController CATViewer

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


public class CATViewer

Class to display Graphic Representations on the screen.


Constructor and Destructor Index


o ~CATViewer()

Method Index


o AddRep(CAT2DRep*)
Adds a representation 2D in the main CAT2DViewpoint.
o AddRep(CAT3DRep*)
Adds a representation 3D in the Main 3D Viewpoint.
o AddRepFurtive(CAT2DRep*)
Adds a furtive representation in the Main CAT2DViewpoint.
o AddRepFurtive(CAT3DRep*)
Adds a 3D furtive representation in the main CAT3DViewpoint.
o AddViewpoint(CATViewpoint*,CATViewerPlacement)
Adds a new viewpoint in the Viewer's list with the highest/lowest priority.
o CATDeclareCBEvent(VIEWER_FEEDBACK_UPDATE)
Event sent when something happens to the viewer.
o ClassId()
Returns the class identifier for which the given object is an instance.
o DisplayNextViewpoint()
Restores the Viewpoint store after the current viepoint.
o DisplayPreviousViewpoint()
Restores the Viewpoint store before the current viepoint.
o Draw()
Asks for generating a new "image" displayed in the Viewer's screen.
o DrawElement(CATRepPath&)
Draws a CATRepPath without redrawing the entire screen .
o DrawElements(list<CATRepPath>&)
Draws a list of CATRepPath without redrawing the entire screen.
o End2DRemoveReps()
Updates the 2D viewpoint to take into account the removal of reps.
o End2DRemoveRepsFurtive()
Updates the 2D viewpoint to take into account the removal of reps.
o EndRemoveReps()
Updates the 3D viewpoint to take into account the removal of reps.
o EndRemoveRepsFurtive()
Updates the 3D viewpoint to take into account the removal of reps.
o GetBackgroundColor(float*,float*,float*)
Retreives the background color.
o GetCATColormap()
Gets the CATColormMap.
o GetContextualMenu()
Gets the CATDlgContextualMenu displayed when you right click on the viewer.
o GetDefaultBackgroundIndicator()
Gets the default CATIndicator associated to the backGround.
o GetFeedbackMode()
Returns the feedback mode.
o GetGlobalAmbientLight(float*,float*,float*)
Retreives the global ambient light color.
o GetGraphicSize(float*,float*)
Gets the size in pixel of the viewer.
o GetLightSourceReps(CAT3DLightSourceRep*&,CAT3DLightSourceRep*&)
Gets the two CAT3DLightSourceRep associated to the viewer.
o GetMMInSupportUnit()
Gets the Inverse of the size(height) of a pixel in millimeter.
o GetMain2DViewpoint()
Gets the main CAT2DViewopint.
o GetMain3DViewpoint()
Gets the main CAT3DViewopint.
o GetMainViewpoint()
Gets the main viewpoint.
o GetManipulatorToActive()
Gets the CATManipulator to activate.
o GetMousePosition(int*,int*)
Gets the cursor position in pixel coordinates.
o GetOverlayViewpoint()
Gets the OverlayViewpoint.
o GetPickingOptions()
Gets the options attached to this viewer for picking.
o GetSupport()
Gets the CATSupport associated to the CATViewer.
o IsBackgroundGraduated()
Gets whether or not the background is graduated.
o IsFullScreen()
Gets whether or not the Viewer is in fullScreen.
o IsNextViewpoint()
Gets wether or not there is a viewpoint store after the current one.
o IsPreviousViewpoint()
Gets wether or not there is a viewpoint store before the current one.
o Pick(CATPickingStyle,float,float,float,float,CATPickPathList&,CATRepPath*,float*,int,int,int,int)
Generates a CATPickPathList corresponding to all representations laying under the given position.
o Pick(CATPickingStyle,CATMathPointf&,CATMathDirectionf&,float,float,float,float,CATPickPathList&,CATRepPath*,int,int,int)
Generates a CATPickPathList corresponding to all representations laying under the given position.
o Reframe()
Changes the Main Viewpoint to have all the repreentations visible on screen.
o ReframeOnGeometry()
o RemoveManipulatorToActive()
Removes the CATManipulator to be activated.
o RemoveRep(CAT2DRep*)
Removes a representation 2D from the main CAT2DViewpoint.
o RemoveRep(CAT3DRep*)
Removes a representation 3D from the main CAT3DViewpoint.
o RemoveRepFurtive(CAT2DRep*)
Removes a 2D furtive representation from Main 2D Viewpoint .
o RemoveRepFurtive(CAT3DRep*)
Removes a 3D furtive representation from main 3D Viewpoint.
o RemoveReps(CAT2DRep*)
Removes a representation 2D from the main CAT2DViewpoint.
o RemoveReps(CAT3DRep*)
Removes a representation 3D from the Main CAT3DViewpoint to be visualized.
o RemoveRepsFurtive(CAT2DRep*)
Removes a furtive representation from the Main 2D Viewpoint.
o RemoveRepsFurtive(CAT3DRep*)
Removes a furtive representation from the main 3D Viewpoint.
o RemoveViewpoint(CATViewpoint*)
Removes the viewpoint from the viewer's list.
o Resize(float,float)
Resize the viewer.
o SaveViewpoint()
Stores the Current MainViewpoint so that it can be restored later.
o SetBackgroundColor(float,float,float,int)
Sets the background color.
o SetCursor(CATDialog::CATDlgCursor)
Sets the cursor displayed when the mouse is over the viewer.
o SetFeedbackMode(CATBoolean)
Sets the feedback mode.
o SetFullScreen(int)
Sets the viewer's FullScreen state.
o SetGlobalAmbientLight(float,float,float)
Sets the global ambient light color.
o SetGraduatedBackground(int)
Sets whether or not the background is graduated.
o SetIndicator(CATIndicator*,CATViewerPlacement)
Sets the current indicator.
o SetLightSourceReps(CAT3DLightSourceRep*,CAT3DLightSourceRep*)
Sets the two CAT3DLightSourceRep associated to the viewer.
o SetMainViewpoint(CATViewpoint*)
Sets the main viewpoint of the viewer.
o SetManipulatorToActive(CATManipulator*)
Sets the CATManipulator to activate on next mouse interaction.
o SetViewMode(int,int)
Sets the viewmode for viewer enclosed in the current CATSupport.
o UndrawElement(CATRepPath&)
Undraws a CATRepPath if it is Furtive .
o UndrawElements(list<CATRepPath>&)
Undraws a list of CATRepPath if they are Furtive .
o ViewMode(int)
Returns whether or not the given mode is active.

Constructor and Destructor


o ~CATViewer
public virtual ~CATViewer()

Methods


o AddRep
public virtual AddRep( iRep)
Adds a representation 2D in the main CAT2DViewpoint.
The representation will appear only at the next
Parameters:
iRep
The
to add
o AddRep
public virtual AddRep( iRep)
Adds a representation 3D in the Main 3D Viewpoint.
The representation will appears only at the next CATViewer::Draw
Parameters:
iRep
The rep to Add
o AddRepFurtive
public virtual AddRepFurtive( iRep)
Adds a furtive representation in the Main CAT2DViewpoint.
Role:The furtive representation will be displayed with the XOR color. See the method
Parameters:
iRep
the
to add
o AddRepFurtive
public virtual AddRepFurtive( iRep)
Adds a 3D furtive representation in the main CAT3DViewpoint.
Parameters:
iRep
The 3D Rep to add
o AddViewpoint
public AddViewpoint( iViewpoint,
const iPlace)
Adds a new viewpoint in the Viewer's list with the highest/lowest priority. The representations of this viewpoint will be displayed behind the other viewpoints
Parameters:
iViewpoint
the Viewpoint to add
iPlace
Legal values: Foreground and Background
o CATDeclareCBEvent
public CATDeclareCBEvent( )
Event sent when something happens to the viewer.
Role: This event contains a class pointer to describe itself. This event is not dispatched when the end user uses the Preselection Navigator.
Sample of callback:
::AddCallback(this,
         _myViewer,
          CATViewer::VIEWER_FEEDBACK_UPDATE(),
          (CATSubscriberMethod)&MyClass::MyCBMethod,
         NULL);
 
o ClassId
public static ClassId()
Returns the class identifier for which the given object is an instance.
o DisplayNextViewpoint
public virtual DisplayNextViewpoint()
Restores the Viewpoint store after the current viepoint.
o DisplayPreviousViewpoint
public virtual DisplayPreviousViewpoint()
Restores the Viewpoint store before the current viepoint.
o Draw
public virtual Draw()
Asks for generating a new "image" displayed in the Viewer's screen.
This image is composed of all representations attached to each viewpoint. This image is not computed immediately but as soon as possible.
o DrawElement
public virtual DrawElement( iPath)
Draws a CATRepPath without redrawing the entire screen .
if the is furtive. The is drawn in XOR mode
Parameters:
iPath
the CATRepPath to redraw
o DrawElements
public virtual DrawElements( iPaths)
Draws a list of CATRepPath without redrawing the entire screen. if the is furtive. The is drawn in XOR mode
Parameters:
iPaths
the list of
to redraw
o End2DRemoveReps
public virtual End2DRemoveReps()
Updates the 2D viewpoint to take into account the removal of reps.
Call that method after removing many representations with RemoveReps
o End2DRemoveRepsFurtive
public virtual End2DRemoveRepsFurtive()
Updates the 2D viewpoint to take into account the removal of reps. Call that method after removing many representations with RemoveRepsFurtive
o EndRemoveReps
public virtual EndRemoveReps()
Updates the 3D viewpoint to take into account the removal of reps.
Call that method after removing many representations with RemoveReps
o EndRemoveRepsFurtive
public virtual EndRemoveRepsFurtive()
Updates the 3D viewpoint to take into account the removal of reps.
Call that method after removing many representations with RemoveRepsFurtive
o GetBackgroundColor
public GetBackgroundColor( oR,
oG,
oB)
Retreives the background color.
Parameters:
oR
the red composant color.
oG
the green composant color.
oB
the blue composant color.
o GetCATColormap
public GetCATColormap()
Gets the CATColormMap.
Returns:
the CATColorMap
o GetContextualMenu
public GetContextualMenu()
Gets the CATDlgContextualMenu displayed when you right click on the viewer.
o GetDefaultBackgroundIndicator
public GetDefaultBackgroundIndicator()
Gets the default CATIndicator associated to the backGround.
o GetFeedbackMode
public GetFeedbackMode()
Returns the feedback mode.
Returns:
The feedback mode.
TRUE if the feedback mode is active, FALSE otherwise.
o GetGlobalAmbientLight
public GetGlobalAmbientLight( oR,
oG,
oB)
Retreives the global ambient light color.
Parameters:
oR
the red composant color.
oG
the green composant color.
oB
the blue composant color.
o GetGraphicSize
public GetGraphicSize( owidth,
oheight)
Gets the size in pixel of the viewer.
Parameters:
owidth
oheight
o GetLightSourceReps
public GetLightSourceReps( const lightRep1,
const lightRep2)
Gets the two CAT3DLightSourceRep associated to the viewer.
o GetMMInSupportUnit
public GetMMInSupportUnit()
Gets the Inverse of the size(height) of a pixel in millimeter.
o GetMain2DViewpoint
public GetMain2DViewpoint()
Gets the main CAT2DViewopint.
Returns:
the main
o GetMain3DViewpoint
public GetMain3DViewpoint()
Gets the main CAT3DViewopint.
Returns:
the main
o GetMainViewpoint
public GetMainViewpoint()
Gets the main viewpoint.
This viewpoint is the one being modified by local transformations
o GetManipulatorToActive
public GetManipulatorToActive()
Gets the CATManipulator to activate.
Returns:
the to Activate
o GetMousePosition
public GetMousePosition( oXPosition,
oYPosition)
Gets the cursor position in pixel coordinates. The cursor position is relative to the viewer.
Parameters:
oXPosition
oYPosition
o GetOverlayViewpoint
public GetOverlayViewpoint()
Gets the OverlayViewpoint.
Role: This viewpoint is a displayed in front of any other representation
Returns:
the overlay
o GetPickingOptions
public GetPickingOptions()
Gets the options attached to this viewer for picking.
Returns:
the options used for picking.
o GetSupport
public GetSupport()
Gets the CATSupport associated to the CATViewer.
Returns:
the
o IsBackgroundGraduated
public IsBackgroundGraduated()
Gets whether or not the background is graduated.
Returns:
the result of the test
o IsFullScreen
public virtual IsFullScreen()
Gets whether or not the Viewer is in fullScreen.
o IsNextViewpoint
public virtual IsNextViewpoint()
Gets wether or not there is a viewpoint store after the current one.
Returns:
the result of the test
o IsPreviousViewpoint
public virtual IsPreviousViewpoint()
Gets wether or not there is a viewpoint store before the current one.
Returns:
the result of the test
o Pick
public Pick( const istyle,
const ix,
const iy,
const idx,
const idy,
oPlist,
irepp= NULL,
const ipolygon= NULL,
const inb_point= 0,
const ipick_style= 0,
forceFullPick= 1,
ignoreNoPickFlag= 0)
Generates a CATPickPathList corresponding to all representations laying under the given position.
Parameters:
istyle
A CATPickingStyle specifying the way the
is generated
ix
The x coordinate of the position at wich we want to pick
iy
The y coordinate of the position at wich we want to pick
idx
The width in pixel
idy
The height in pixel
oPlist
The CATPickPathList generated
irepp
The CATRepPath we want to pick on. If this parameter is NULL, we pick on all representations
ipolygon
If the CATPickingStyle is CATPickingInsidePolygon, define the polygon used for the picking
inb_point
If the CATPickingStyle is CATPickingInsidePolygon, define the number of points in the polygon
ipick_style
The
used to do the picking
forceFullPick
Set to false to enable VID picking optimization (picking may stop if a VID representation if found)
ignoreNoPickFlag
Set to true to include reps with no_pick flag set to true in picking result
o Pick
public Pick( const istyle,
const iorg,
const idir,
const ineard,
const ifard,
const idx,
const idy,
oPlist,
irepp= NULL,
const ipick_style= 0,
forceFullPick= 1,
ignoreNoPickFlag= 0)
Generates a CATPickPathList corresponding to all representations laying under the given position.
Parameters:
istyle
A CATPickingStyle specifying the way the
is generated
iorg
The Point from wich we pick
idir
The direction into wich we pick
ineard
The distance from iorg at wich we begin to pick
ifard
The distance from iorg at wich we stop to pick
oPlist
The
generated
irepp
The
we want to pick on. If this parameter is NULL, we pick on all representations
ipick_style
The
used to do the picking
forceFullPick
Set to false to enable VID picking optimization (picking may stop if a VID representation if found)
ignoreNoPickFlag
Set to true to include reps with no_pick flag set to true in picking result
o Reframe
public virtual Reframe()
Changes the Main Viewpoint to have all the repreentations visible on screen.
o ReframeOnGeometry
public virtual ReframeOnGeometry()
o RemoveManipulatorToActive
public RemoveManipulatorToActive()
Removes the CATManipulator to be activated.
o RemoveRep
public virtual RemoveRep( iRep)
Removes a representation 2D from the main CAT2DViewpoint. The representation will disappear at the next
Parameters:
iRep
the
to remove
o RemoveRep
public virtual RemoveRep( iRep)
Removes a representation 3D from the main CAT3DViewpoint.
The representation will appears at he next Use this method in the process of removing many representations
Parameters:
iRep
The 3D rep to remove
o RemoveRepFurtive
public virtual RemoveRepFurtive( iRep)
Removes a 2D furtive representation from Main 2D Viewpoint .
Parameters:
iRep
the
to remove
o RemoveRepFurtive
public virtual RemoveRepFurtive( iRep)
Removes a 3D furtive representation from main 3D Viewpoint.
Parameters:
iRep
The 3D Rep to remove
o RemoveReps
public virtual RemoveReps( iRep)
Removes a representation 2D from the main CAT2DViewpoint. The representation will appears at the next Use this method in the process of removing many representations
Parameters:
iRep
the
to remove
o RemoveReps
public virtual RemoveReps( iRep)
Removes a representation 3D from the Main CAT3DViewpoint to be visualized.
The representation will appears at he next CATViewer::Draw
Parameters:
iRep
the 3D Rep to remove
o RemoveRepsFurtive
public virtual RemoveRepsFurtive( iRep)
Removes a furtive representation from the Main 2D Viewpoint.
Role:The representation will disappear at the next . Use this method in the process of removing many representations.
o RemoveRepsFurtive
public virtual RemoveRepsFurtive( iRep)
Removes a furtive representation from the main 3D Viewpoint.
The representation will disappear at the next Use this method in the process of removing many representations
Parameters:
iRep
The 3D Rep to remove
o RemoveViewpoint
public RemoveViewpoint( iViewpoint)
Removes the viewpoint from the viewer's list.
Parameters:
iViewpoint
to remove
o Resize
public Resize( const iWidth,
const iHeight)
Resize the viewer.
Parameters:
iWidth
the new width in pixel for the viewer.
iHeight
the new width in pixel for the viewer.
o SaveViewpoint
public virtual SaveViewpoint()
Stores the Current MainViewpoint so that it can be restored later.
o SetBackgroundColor
public virtual SetBackgroundColor( const iR,
const iG,
const iB,
const save=1)
Sets the background color.
Parameters:
iR
the red composant color.
iG
the green composant color.
iB
the blue composant color.
o SetCursor
public SetCursor( iCursor)
Sets the cursor displayed when the mouse is over the viewer.
Parameters:
iCursor
o SetFeedbackMode
public SetFeedbackMode( const iOnOff=FALSE)
Sets the feedback mode.
Parameters:
iOnOff
The feedback mode.
Legal values:
  • FALSE= Off (default value), no feedback
  • TRUE= On , a
is sent when something appends in the viewer.
o SetFullScreen
public virtual SetFullScreen( const iOnOff=1)
Sets the viewer's FullScreen state.
Parameters:
iOnOff
the FullScreen mode
o SetGlobalAmbientLight
public SetGlobalAmbientLight( const iR,
const iG,
const iB)
Sets the global ambient light color.
Parameters:
iR
the red composant color.
iG
the green composant color.
iB
the blue composant color.
o SetGraduatedBackground
public virtual SetGraduatedBackground( const iActive)
Sets whether or not the background is graduated.
Parameters:
iActive
0 = off. 1 = on.
o SetIndicator
public SetIndicator( iIndic,
const iPlace)
Sets the current indicator. The Background and foreground indicator are two uniques indicators. When you set the indicators, YOU MUST SAVE the previous one to put yours. Then at the end of your use, you connect back the saved one.
Parameters:
iIndic
the
iPlace
Placement Background or Foregroung
Returns:
Previous Current indicator to save.
o SetLightSourceReps
public SetLightSourceReps( lightRep1,
lightRep2)
Sets the two CAT3DLightSourceRep associated to the viewer.
Parameters:
lightRep1
the first light source
lightRep2
the second light source
o SetMainViewpoint
public virtual SetMainViewpoint( viewpoint)
Sets the main viewpoint of the viewer.
Parameters:
viewpoint
the viewpoint that is to be manipulated by local transformations
o SetManipulatorToActive
public SetManipulatorToActive( iManip)
Sets the CATManipulator to activate on next mouse interaction.
Parameters:
iManip
the
to activate
o SetViewMode
public SetViewMode( const iMode,
const iActive)
Sets the viewmode for viewer enclosed in the current CATSupport.
Parameters:
iMode
The viewer mode
Legal values:
iActive
0 = off. 1 = on.
o UndrawElement
public virtual UndrawElement( iPath)
Undraws a CATRepPath if it is Furtive .
Parameters:
iPath
the
to undraw
o UndrawElements
public virtual UndrawElements( iPaths)
Undraws a list of CATRepPath if they are Furtive .
Parameters:
iPaths
the list of
to undraw
o ViewMode
public ViewMode( const iMode)
Returns whether or not the given mode is active.
Parameters:
iMode
the viewer mode.
Legal values:

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

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