SOCC_Viewer Class Reference

#include <SOCC_ViewModel.h>

Inheritance diagram for SOCC_Viewer:

Inheritance graph

Public Types

typedef QMap< HotOperation,
Qt::ButtonState > 
StatesMap
typedef QMap< HotOperation,
Qt::ButtonState > 
ButtonsMap
enum  HotOperation { PAN, ZOOM, ROTATE, FIT_AREA }

Public Slots

void onClearViewAspects ()

Signals

void selectionChanged ()

Public Member Functions

 SOCC_Viewer (bool DisplayTrihedron=true)
virtual ~SOCC_Viewer ()
bool highlight (const Handle(SALOME_InteractiveObject)&, bool, bool=true)
bool isInViewer (const Handle(SALOME_InteractiveObject)&, bool=false)
void setColor (const Handle(SALOME_InteractiveObject)&, const QColor &, bool=true)
void switchRepresentation (const Handle(SALOME_InteractiveObject)&, int, bool=true)
void setTransparency (const Handle(SALOME_InteractiveObject)&, float, bool=true)
void rename (const Handle(SALOME_InteractiveObject)&, const QString &)
virtual SUIT_ViewWindowcreateView (SUIT_Desktop *theDesktop)
virtual void Display (const SALOME_OCCPrs *)
virtual void Erase (const SALOME_OCCPrs *, const bool=false)
virtual void EraseAll (const bool=false)
virtual SALOME_PrsCreatePrs (const char *entry=0)
virtual void BeforeDisplay (SALOME_Displayer *d)
virtual void AfterDisplay (SALOME_Displayer *d)
virtual void LocalSelection (const SALOME_OCCPrs *, const int)
virtual void GlobalSelection (const bool=false) const
virtual bool isVisible (const Handle(SALOME_InteractiveObject)&)
virtual void Repaint ()
bool getTrihedronSize (double &theNewSize, double &theSize)
void update ()
virtual void setViewManager (SUIT_ViewManager *theViewManager)
virtual QString getType () const
virtual void contextMenuPopup (QPopupMenu *)
void getSelectedObjects (AIS_ListOfInteractive &theList)
void setObjectsSelected (const AIS_ListOfInteractive &theList)
void setSelected (const Handle(AIS_InteractiveObject)&theIO)
void performSelectionChanged ()
virtual const viewAspectListgetViewAspects ()
virtual void appendViewAspect (const viewAspect &)
virtual void updateViewAspects (const viewAspectList &)
virtual void clearViewAspects ()
QColor backgroundColor () const
void setBackgroundColor (const QColor &)
bool trihedronActivated () const
 returns true if 3d Trihedron in viewer was created
void toggleTrihedron ()
bool isTrihedronVisible () const
virtual void setTrihedronShown (const bool)
double trihedronSize () const
virtual void setTrihedronSize (const double)
 Handle (V3d_Viewer) getViewer3d() const
 Handle (V3d_Viewer) getCollector3d() const
 Handle (AIS_InteractiveContext) getAISContext() const
 Handle (AIS_Trihedron) getTrihedron() const
void enableSelection (bool isEnabled)
bool isSelectionEnabled () const
void enableMultiselection (bool isEnable)
bool isMultiSelectionEnabled () const
int getSelectionCount () const
bool highlight (const Handle(AIS_InteractiveObject)&, bool, bool=true)
bool unHighlightAll (bool=true)
bool isInViewer (const Handle(AIS_InteractiveObject)&, bool=false)
bool isVisible (const Handle(AIS_InteractiveObject)&)
void setColor (const Handle(AIS_InteractiveObject)&, const QColor &, bool=true)
void switchRepresentation (const Handle(AIS_InteractiveObject)&, int, bool=true)
void setTransparency (const Handle(AIS_InteractiveObject)&, float, bool=true)
void setIsos (const int u, const int v)
void isos (int &u, int &v) const
SUIT_ViewManagergetViewManager () const
void Display (const SALOME_Prs *)
 This Display() method should be called to display given presentation
created anywhere by anybody.
virtual void Display (const SALOME_VTKPrs *)
 Display SALOME_VTKPrs presentation.
virtual void Display (const SALOME_Prs2d *)
 Display SALOME_Prs2d presentation.
void Erase (const SALOME_Prs *, const bool=false)
 This Erase() method should be called to erase given presentation
created anywhere by anybody.
virtual void Erase (const SALOME_VTKPrs *, const bool=false)
 Erase SALOME_VTKPrs.
virtual void Erase (const SALOME_Prs2d *, const bool=false)
 Erase SALOME_Prs2d.
void LocalSelection (const SALOME_Prs *, const int)
 This LocalSelection() method should be called to activate sub-shapes selection
created anywhere by anybody.
virtual void LocalSelection (const SALOME_VTKPrs *, const int)
 Local selection SALOME_VTKPrs.
virtual void LocalSelection (const SALOME_Prs2d *, const int)
 Local selection SALOME_Prs2d.
virtual bool isVisible (const Handle_SALOME_InteractiveObject &)

Static Public Member Functions

static QString Type ()
static void setHotButton (HotOperation theOper, Qt::ButtonState theState, Qt::ButtonState theButton)
static void getHotButton (HotOperation theOper, Qt::ButtonState &theState, Qt::ButtonState &theButton)

Static Public Attributes

static StatesMap myStateMap
static ButtonsMap myButtonMap

Protected Slots

void onMousePress (SUIT_ViewWindow *, QMouseEvent *)
void onMouseMove (SUIT_ViewWindow *, QMouseEvent *)
void onMouseRelease (SUIT_ViewWindow *, QMouseEvent *)
void onDumpView ()
void onShowToolbar ()
void onChangeBgColor ()

Protected Member Functions

void initView (OCCViewer_ViewWindow *view)

Protected Attributes

SUIT_ViewManagermyViewManager

Member Typedef Documentation

typedef QMap<HotOperation, Qt::ButtonState> SUIT_ViewModel.StatesMap [inherited]
 

typedef QMap<HotOperation, Qt::ButtonState> SUIT_ViewModel.ButtonsMap [inherited]
 


Member Enumeration Documentation

enum SUIT_ViewModel::HotOperation [inherited]
 

Enumerator:
PAN 
ZOOM 
ROTATE 
FIT_AREA 


Constructor & Destructor Documentation

SOCC_Viewer::SOCC_Viewer bool  DisplayTrihedron = true  ) 
 

Constructor

Parameters:
DisplayTrihedron - is trihedron displayed

SOCC_Viewer::~SOCC_Viewer  )  [virtual]
 

Destructor


Member Function Documentation

bool SOCC_Viewer::highlight const Handle(SALOME_InteractiveObject)&  obj,
bool  hilight,
bool  upd = true
 

Hilights/unhilights object in viewer

Parameters:
obj - object to be updated
hilight - if it is true, object will be hilighted, otherwise it will be unhilighted
update - update current viewer

bool SOCC_Viewer::isInViewer const Handle(SALOME_InteractiveObject)&  obj,
bool  onlyInViewer = false
 

Returns:
true if object is in viewer or in collector
Parameters:
obj - object to be checked
onlyInViewer - search object only in viewer (so object must be displayed)

void SOCC_Viewer::setColor const Handle(SALOME_InteractiveObject)&  obj,
const QColor &  color,
bool  update = true
 

Sets color of object

Parameters:
obj - object to be updated
color - new color
update - update current viewer

void SOCC_Viewer::switchRepresentation const Handle(SALOME_InteractiveObject)&  obj,
int  mode,
bool  update = true
 

Changes display mode of object

Parameters:
obj - object to be processed
mode - new display mode
update - update current viewer

void SOCC_Viewer::setTransparency const Handle(SALOME_InteractiveObject)&  obj,
float  trans,
bool  update = true
 

Changes transparency of object

Parameters:
obj - object to be processed
trans - new transparency
update - update current viewer

void SOCC_Viewer::rename const Handle(SALOME_InteractiveObject)&  obj,
const QString &  name
 

Changes name of object

Parameters:
obj - object to be renamed
name - new name

SUIT_ViewWindow * SOCC_Viewer::createView SUIT_Desktop theDesktop  )  [virtual]
 

create SOCC_ViewWindow

Reimplemented from OCCViewer_Viewer.

void SOCC_Viewer::Display const SALOME_OCCPrs prs  )  [virtual]
 

Display presentation

Parameters:
prs - presentation

Reimplemented from SALOME_View.

void SOCC_Viewer::Erase const SALOME_OCCPrs prs,
const   bool = false
[virtual]
 

Erase presentation

Parameters:
prs - presentation
forced - removes object from context

Reimplemented from SALOME_View.

void SOCC_Viewer::EraseAll const   bool = false  )  [virtual]
 

Erase all presentations

Parameters:
forced - removes all objects from context

Reimplemented from SALOME_View.

SALOME_Prs * SOCC_Viewer::CreatePrs const char *  entry = 0  )  [virtual]
 

Create presentation corresponding to the entry

Parameters:
entry - entry

Reimplemented from SALOME_View.

void SOCC_Viewer::BeforeDisplay SALOME_Displayer d  )  [virtual]
 

Auxiliary method called before displaying of objects

Reimplemented from SALOME_View.

void SOCC_Viewer::AfterDisplay SALOME_Displayer d  )  [virtual]
 

Auxiliary method called after displaying of objects

Reimplemented from SALOME_View.

void SOCC_Viewer::LocalSelection const SALOME_OCCPrs thePrs,
const   int
[virtual]
 

Activates selection of sub shapes

Reimplemented from SALOME_View.

void SOCC_Viewer::GlobalSelection const   bool = false  )  const [virtual]
 

Deactivates selection of sub shapes

Reimplemented from SALOME_View.

bool SOCC_Viewer::isVisible const Handle(SALOME_InteractiveObject)&  obj  )  [virtual]
 

Returns:
true if object is displayed in viewer
Parameters:
obj - object to be checked

void SOCC_Viewer::Repaint  )  [virtual]
 

Updates current viewer

Reimplemented from SALOME_View.

bool SOCC_Viewer::getTrihedronSize double &  theNewSize,
double &  theSize
 

Get new and current trihedron size corresponding to the current model size

static QString OCCViewer_Viewer.Type  )  [static, inherited]
 

void OCCViewer_Viewer::update  )  [inherited]
 

Updates OCC 3D viewer

void OCCViewer_Viewer::setViewManager SUIT_ViewManager theViewManager  )  [virtual, inherited]
 

Sets new view manager

Parameters:
theViewManager - new view manager

Reimplemented from SUIT_ViewModel.

virtual QString OCCViewer_Viewer.getType  )  const [virtual, inherited]
 

Reimplemented from SUIT_ViewModel.

void OCCViewer_Viewer::contextMenuPopup QPopupMenu thePopup  )  [virtual, inherited]
 

Builds popup for occ viewer

Reimplemented from SUIT_ViewModel.

void OCCViewer_Viewer::getSelectedObjects AIS_ListOfInteractive &  theList  )  [inherited]
 

Returns:
objects selected in 3D viewer
Parameters:
theList - list to be filled with selected objects

void OCCViewer_Viewer::setObjectsSelected const AIS_ListOfInteractive &  theList  )  [inherited]
 

Selects objects in 3D viewer. Other selected objects are left as selected

Parameters:
theList - list objects to be selected

void OCCViewer_Viewer.setSelected const Handle(AIS_InteractiveObject)&  theIO  )  [inherited]
 

void OCCViewer_Viewer::performSelectionChanged  )  [inherited]
 

Auxiliary method to emit signal selectionChanged()

const viewAspectList & OCCViewer_Viewer::getViewAspects  )  [virtual, inherited]
 

Returns:
const reference to list of view aspects

void OCCViewer_Viewer::appendViewAspect const viewAspect aParams  )  [virtual, inherited]
 

Appends new view aspect

Parameters:
aParams - new view aspects

void OCCViewer_Viewer::updateViewAspects const viewAspectList aViewList  )  [virtual, inherited]
 

Replaces old view aspects by new ones

Parameters:
aViewList - list of new view aspects

void OCCViewer_Viewer::clearViewAspects  )  [virtual, inherited]
 

Clears view aspects

QColor OCCViewer_Viewer::backgroundColor  )  const [inherited]
 

Returns:
background color of viewer

void OCCViewer_Viewer::setBackgroundColor const QColor &  c  )  [inherited]
 

Sets background color

Parameters:
c - new background color

bool OCCViewer_Viewer.trihedronActivated  )  const [inherited]
 

void OCCViewer_Viewer::toggleTrihedron  )  [inherited]
 

Changes visibility of trihedron to opposite

bool OCCViewer_Viewer::isTrihedronVisible  )  const [inherited]
 

Returns:
true if trihedron is visible

void OCCViewer_Viewer::setTrihedronShown const   bool  )  [virtual, inherited]
 

Sets visibility state of trihedron

Parameters:
on - new state

double OCCViewer_Viewer::trihedronSize  )  const [inherited]
 

Returns:
trihedron size

void OCCViewer_Viewer::setTrihedronSize const   double  )  [virtual, inherited]
 

Changes trihedron size

Parameters:
sz - new size

void OCCViewer_Viewer::onClearViewAspects  )  [slot, inherited]
 

SLOT, clears view aspects

OCCViewer_Viewer.Handle V3d_Viewer   )  const [inherited]
 

OCCViewer_Viewer.Handle V3d_Viewer   )  const [inherited]
 

OCCViewer_Viewer.Handle AIS_InteractiveContext   )  const [inherited]
 

OCCViewer_Viewer.Handle AIS_Trihedron   )  const [inherited]
 

void OCCViewer_Viewer::enableSelection bool  isEnabled  )  [inherited]
 

Sets selection enabled status

Parameters:
isEnabled - new status
! To be done for view windows

bool OCCViewer_Viewer.isSelectionEnabled  )  const [inherited]
 

void OCCViewer_Viewer::enableMultiselection bool  isEnable  )  [inherited]
 

Sets multiselection enabled status

Parameters:
isEnabled - new status
! To be done for view windows

bool OCCViewer_Viewer.isMultiSelectionEnabled  )  const [inherited]
 

int OCCViewer_Viewer.getSelectionCount  )  const [inherited]
 

bool OCCViewer_Viewer::highlight const Handle(AIS_InteractiveObject)&  obj,
bool  hilight,
bool  update = true
[inherited]
 

Hilights/unhilights object in viewer

Parameters:
obj - object to be updated
hilight - if it is true, object will be hilighted, otherwise it will be unhilighted
update - update current viewer

bool OCCViewer_Viewer::unHighlightAll bool  updateviewer = true  )  [inherited]
 

Unhilights all objects in viewer

Parameters:
updateviewer - update current viewer

bool OCCViewer_Viewer::isInViewer const Handle(AIS_InteractiveObject)&  obj,
bool  onlyInViewer = false
[inherited]
 

Returns:
true if object is in viewer or in collector
Parameters:
obj - object to be checked
onlyInViewer - search object only in viewer (so object must be displayed)

bool OCCViewer_Viewer::isVisible const Handle(AIS_InteractiveObject)&  obj  )  [inherited]
 

Returns:
true if object is displayed in viewer
Parameters:
obj - object to be checked

void OCCViewer_Viewer::setColor const Handle(AIS_InteractiveObject)&  obj,
const QColor &  color,
bool  update = true
[inherited]
 

Sets color of object

Parameters:
obj - object to be updated
color - new color
update - update current viewer

void OCCViewer_Viewer::switchRepresentation const Handle(AIS_InteractiveObject)&  obj,
int  mode,
bool  update = true
[inherited]
 

Changes display mode of object

Parameters:
obj - object to be processed
mode - new display mode
update - update current viewer

void OCCViewer_Viewer::setTransparency const Handle(AIS_InteractiveObject)&  obj,
float  trans,
bool  update = true
[inherited]
 

Changes transparency of object

Parameters:
obj - object to be processed
trans - new transparency
update - update current viewer

void OCCViewer_Viewer::setIsos const int  u,
const int  v
[inherited]
 

Set number of isolines

Parameters:
u - u-isolines (first parametric co-ordinate)
v - v-isolines (second parametric co-ordinate)

void OCCViewer_Viewer::isos int &  u,
int &  v
const [inherited]
 

Returns:
number of isolines
Parameters:
u - to return u-isolines (first parametric co-ordinate)
v - to return v-isolines (second parametric co-ordinate)

void OCCViewer_Viewer.selectionChanged  )  [signal, inherited]
 

void OCCViewer_Viewer::initView OCCViewer_ViewWindow view  )  [protected, inherited]
 

Start initialization of view window

Parameters:
view - view window to be initialized

void OCCViewer_Viewer::onMousePress SUIT_ViewWindow theWindow,
QMouseEvent *  theEvent
[protected, slot, inherited]
 

SLOT: called on mouse button press, stores current mouse position as start point for transformations

void OCCViewer_Viewer::onMouseMove SUIT_ViewWindow theWindow,
QMouseEvent *  theEvent
[protected, slot, inherited]
 

SLOT: called on mouse move, processes transformation or hilighting

void OCCViewer_Viewer::onMouseRelease SUIT_ViewWindow theWindow,
QMouseEvent *  theEvent
[protected, slot, inherited]
 

SLOT: called on mouse button release, finishes transformation or selection

void OCCViewer_Viewer::onDumpView  )  [protected, slot, inherited]
 

SLOT: called on dump view operation is activated, stores scene to raster file

void OCCViewer_Viewer::onShowToolbar  )  [protected, slot, inherited]
 

SLOT: called when popup item "Show toolbar" is activated, shows toolbar of active view window

void OCCViewer_Viewer::onChangeBgColor  )  [protected, slot, inherited]
 

SLOT: called if background color is to be changed changed, passes new color to view port

SUIT_ViewManager* SUIT_ViewModel.getViewManager  )  const [inherited]
 

void SUIT_ViewModel::setHotButton HotOperation  theOper,
Qt::ButtonState  theState,
Qt::ButtonState  theButton
[static, inherited]
 

Sets hot button

Parameters:
theOper - hot operation
theState - adding state to state map operations.
theButton - adding state to button map operations.

void SUIT_ViewModel::getHotButton HotOperation  theOper,
Qt::ButtonState &  theState,
Qt::ButtonState &  theButton
[static, inherited]
 

Gets hot button for operation theOper.

Parameters:
theOper - input hot operation
theState - output state from state map operations.
theButton - output state from button map operations.

void SALOME_View::Display const SALOME_Prs  )  [inherited]
 

It simply passes control to SALOME_Prs object
so that it could perform double dispatch.

void SALOME_View::Display const SALOME_VTKPrs  )  [virtual, inherited]
 

Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.

Reimplemented in SVTK_Viewer.

void SALOME_View::Display const SALOME_Prs2d  )  [virtual, inherited]
 

Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.

Reimplemented in SPlot2d_Viewer.

void SALOME_View::Erase