00001
00002
00003
00004
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00017
00018 #ifndef _VIEW_MANAGER_H_
00019 #define _VIEW_MANAGER_H_
00020
00021 #include <Inventor/nodes/SoGroup.h>
00022 #include <Medical/InventorMedical.h>
00023
00024
00025 #include "SceneView.h"
00026
00027 class SoNodeSensor;
00028 class SoHandleEventAction;
00029 class SoPickAction;
00030
00095 class INVENTORMEDICAL_API ViewManager : public SoGroup {
00096
00097 SO_NODE_HEADER(ViewManager);
00098
00099 public:
00100
00102 static void initClass();
00103
00105 static void exitClass();
00106
00108 ViewManager();
00109
00112 void addView( const SceneView* newView );
00113
00115 int getNumViews() const;
00116
00120 SceneView* getView( int index ) const;
00121
00128 SceneView* getView( const SbVec2f& position ) const;
00129
00132 int getViewIndex( const SceneView* view ) const;
00133
00140 int getViewIndex( const SbVec2f& position ) const;
00141
00148 int getLastEventViewIndex() const;
00149
00155 SbVec2f getLastEventPosition() const;
00156
00159 void setViewport( int index, SbVec4f& vport );
00160
00163 void setViewport( int index, float xorig, float yorig, float xsize, float ysize );
00164
00172 void setEventCaptureView( int viewIndex );
00173
00174 private:
00175
00177 virtual void addChild( SoNode* child );
00178 virtual void insertChild( SoNode *child, int newChildIndex );
00179 virtual void replaceChild( SoNode* oldChild, SoNode* newChild );
00180 virtual void replaceChild( int index, SoNode* newChild );
00181
00182 private:
00184 virtual ~ViewManager();
00185
00186
00187 virtual void handleEvent( SoHandleEventAction* action );
00188
00189
00190 int m_numViews;
00191 unsigned int m_buttonsPressed;
00192
00193 SbVec2f m_eventPos;
00194 int m_eventViewIndex;
00195 int m_captureViewIndex;
00196
00197 SoNodeSensor* m_sensor;
00198 static void sensorCB( void* data, SoSensor* sensor );
00199 };
00200
00201 #endif