IViewPanel Class Reference
 
 
 
IViewPanel Class Reference

#include <IViewPanel.h>

Inheritance diagram for IViewPanel:
BaseInterface InterfaceServer MaxHeapOperators

Class Description

Many viewpanel related methods of CORE interface only work on the active tabbed view panel.

For example, Interface::getNumViewports() only return the number of viewports of current view panel. This interface provides methods to get/modify settings of a tabbed view panel no matter it is currently active or not. Here is an example on how to get the number of active and non-extended viewports of all view panels.

 int viewportCount = 0;
 for (int i = 0; i < GetViewPanelManager()->GetViewPanelCount(); ++i)
 {
                IViewPanel* pViewPanel = GetViewPanelManager()->GetViewPanel(i);
                if (pViewPanel)
                {
                        viewportCount += pViewPanel->GetNumberOfViewports();
                }
 }
See also:
IViewPanelManager

Public Member Functions

virtual  ~IViewPanel ()
virtual Interface_ID  GetID ()
virtual size_t  GetNumberOfViewports () const =0
  Gets number of the enabled and non-extended viewports.
virtual int  GetLayout () const =0
  Gets the layout of this view panel.
virtual void  SetLayout (int layout)=0
  Set layout of this view panel.
virtual void  SetLayout (int layout, bool forceSettings)=0
  Set layout of this view panel.
virtual int  GetViewportIndex (HWND hwnd)=0
  Gets index of the viewport with the specified window handle.
virtual bool  SetActiveViewport (int index)=0
  Set active viewport according to the input param.
virtual int  GetActiveViewportIndex (void)=0
  Get the index of the active viewport.
virtual HWND  GetHWnd ()=0
  Get the window handle of the tabbed view panel.
virtual void  SetViewPanelName (const MSTR &newName)=0
  Set the view panel name.
virtual const MSTR GetViewPanelName ()=0
  Get the view panel name.
virtual ViewExp GetViewExpByIndex (int index)=0
  Get the ViewExp interface given the viewport index.

Constructor & Destructor Documentation

virtual ~IViewPanel ( ) [inline, virtual]
{}

Member Function Documentation

virtual Interface_ID GetID ( ) [inline, virtual]
Remarks:
This method returns the unique interface ID.

Reimplemented from BaseInterface.

{ return VIEW_PANEL_INTERFACE; }
virtual size_t GetNumberOfViewports ( ) const [pure virtual]

Gets number of the enabled and non-extended viewports.

Returns:
the number of the enabled and non-extended viewports.
virtual int GetLayout ( ) const [pure virtual]

Gets the layout of this view panel.

Returns:
the layout id
See also:
View Panel Layout Configurations
virtual void SetLayout ( int  layout ) [pure virtual]

Set layout of this view panel.

Parameters:
[in] layout the layout configuration to use
See also:
View Panel Layout Configurations
virtual void SetLayout ( int  layout,
bool  forceSettings 
) [pure virtual]

Set layout of this view panel.

Parameters:
[in] layout the layout configuration to use
[in] forceSettings force the config setting to be re-applied
See also:
View Panel Layout Configurations
virtual int GetViewportIndex ( HWND  hwnd ) [pure virtual]

Gets index of the viewport with the specified window handle.

User can use the viewport index to get the corresponding ViewExp interface by calling IViewPanel::GetViewExpByIndex(int index).

Parameters:
[in] hwnd the window handle of a viewport in this viewpanel.
Returns:
the index of the viewport with the given window handle. If none of the viewport matches the given handle, -1 is returned.
virtual bool SetActiveViewport ( int  index ) [pure virtual]

Set active viewport according to the input param.

Parameters:
[in] index the index of the viewport to be activated
Returns:
true if this operation succeeds, false otherwise.
virtual int GetActiveViewportIndex ( void  ) [pure virtual]

Get the index of the active viewport.

Returns:
the index of the active viewport. If there is no active viewport in this viewpanel, -1 is returned.
virtual HWND GetHWnd ( ) [pure virtual]

Get the window handle of the tabbed view panel.

Returns:
Return the window handle of the view panel.
virtual void SetViewPanelName ( const MSTR newName ) [pure virtual]

Set the view panel name.

Parameters:
[in] newName the new name for the view panel.
virtual const MSTR& GetViewPanelName ( ) [pure virtual]

Get the view panel name.

Returns:
Return the view panel name.
virtual ViewExp& GetViewExpByIndex ( int  index ) [pure virtual]

Get the ViewExp interface given the viewport index.

Parameters:
[in] index a valid viewport index
Returns:
if input is valid, the specified ViewExp interface will be returned. Otherwise, the ViewExp interface of the first viewport(index = 0) will be returned.